Class: Inttegro::Application::UpdatedOperatingPolicy

Inherits:
T::Struct
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/inttegro/app/updated_operating_policy.rb

Overview

Immutable operating policy applied to the application. Omitted for root applications and when the private beta is unavailable to the caller.

This generated model is immutable. Construct it with .new, or decode a string-keyed API payload with .from_hash. #serialize produces a string-keyed hash using the original wire field names and serialized enum values.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#capabilities ⇒ Inttegro::Shared::OperatingPolicyCapabilities (readonly)

Value of the capabilities field in the Inttegro API payload.

Required in the API payload. Wire name: capabilities.



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/inttegro/app/updated_operating_policy.rb', line 33

class UpdatedOperatingPolicy < T::Struct
  const :capabilities, Inttegro::Shared::OperatingPolicyCapabilities
  const :source, T.any(Inttegro::Shared::InlineOperatingPolicySource, Inttegro::Shared::TemplateOperatingPolicySource)

  extend T::Sig

  sig { params(hash: T::Hash[String, Object], strict: T::Boolean).returns(T.attached_class) }
  def self.from_hash(hash, strict = false)
    data = hash.dup
    if (source_value = data["source"]).is_a?(Hash)
      data["source"] = case source_value["type"]
      when "inline"
        Inttegro::Shared::InlineOperatingPolicySource.from_hash(source_value)
      when "template"
        Inttegro::Shared::TemplateOperatingPolicySource.from_hash(source_value)
      else
        source_value
      end
    end
    super(data, strict)
  end
end

#source ⇒ Inttegro::Shared::InlineOperatingPolicySource, Inttegro::Shared::TemplateOperatingPolicySource (readonly)

Value of the source field in the Inttegro API payload.

Required in the API payload. Wire name: source.



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/inttegro/app/updated_operating_policy.rb', line 33

class UpdatedOperatingPolicy < T::Struct
  const :capabilities, Inttegro::Shared::OperatingPolicyCapabilities
  const :source, T.any(Inttegro::Shared::InlineOperatingPolicySource, Inttegro::Shared::TemplateOperatingPolicySource)

  extend T::Sig

  sig { params(hash: T::Hash[String, Object], strict: T::Boolean).returns(T.attached_class) }
  def self.from_hash(hash, strict = false)
    data = hash.dup
    if (source_value = data["source"]).is_a?(Hash)
      data["source"] = case source_value["type"]
      when "inline"
        Inttegro::Shared::InlineOperatingPolicySource.from_hash(source_value)
      when "template"
        Inttegro::Shared::TemplateOperatingPolicySource.from_hash(source_value)
      else
        source_value
      end
    end
    super(data, strict)
  end
end

Class Method Details

.from_hash(hash, strict = false) ⇒ Object



40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/inttegro/app/updated_operating_policy.rb', line 40

def self.from_hash(hash, strict = false)
  data = hash.dup
  if (source_value = data["source"]).is_a?(Hash)
    data["source"] = case source_value["type"]
    when "inline"
      Inttegro::Shared::InlineOperatingPolicySource.from_hash(source_value)
    when "template"
      Inttegro::Shared::TemplateOperatingPolicySource.from_hash(source_value)
    else
      source_value
    end
  end
  super(data, strict)
end