class Io::Flow::V0::Models::OrganizationSessionAuthorization

Represents a session authorized access to the specified organization’s data

Attributes

environment[R]
organization[R]

Public Class Methods

new(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 55434
def initialize(incoming={})
  super(:discriminator => SessionAuthorization::Types::ORGANIZATION_SESSION_AUTHORIZATION)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:organization, :environment], 'OrganizationSessionAuthorization')
  @organization = (x = opts.delete(:organization); x.is_a?(::Io::Flow::V0::Models::OrganizationReference) ? x : ::Io::Flow::V0::Models::OrganizationReference.new(x))
  @environment = (x = opts.delete(:environment); x.is_a?(::Io::Flow::V0::Models::Environment) ? x : ::Io::Flow::V0::Models::Environment.apply(x))
end

Public Instance Methods

copy(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 55446
def copy(incoming={})
  OrganizationSessionAuthorization.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end
subtype_to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 55450
def subtype_to_hash
  {
    :organization => organization.to_hash,
    :environment => environment.value
  }
end
to_json() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 55442
def to_json
  JSON.dump(to_hash)
end