Class: Io::Flow::V0::Models::OrganizationAuthorization
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::OrganizationAuthorization
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Defines the data used for broad authorization of user access to org level data
Instance Attribute Summary collapse
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#role ⇒ Object
readonly
Returns the value of attribute role.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ OrganizationAuthorization
constructor
A new instance of OrganizationAuthorization.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ OrganizationAuthorization
Returns a new instance of OrganizationAuthorization.
24953 24954 24955 24956 24957 24958 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24953 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:role, :environment], 'OrganizationAuthorization') @role = (x = opts.delete(:role); x.is_a?(::Io::Flow::V0::Models::Role) ? x : ::Io::Flow::V0::Models::Role.apply(x)) @environment = (x = opts.delete(:environment); x.is_a?(::Io::Flow::V0::Models::Environment) ? x : ::Io::Flow::V0::Models::Environment.apply(x)) end |
Instance Attribute Details
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
24951 24952 24953 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24951 def environment @environment end |
#role ⇒ Object (readonly)
Returns the value of attribute role.
24951 24952 24953 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24951 def role @role end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
24964 24965 24966 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24964 def copy(incoming={}) OrganizationAuthorization.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
24968 24969 24970 24971 24972 24973 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24968 def to_hash { :role => role.value, :environment => environment.value } end |
#to_json ⇒ Object
24960 24961 24962 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24960 def to_json JSON.dump(to_hash) end |