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.
34094 34095 34096 34097 34098 34099 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34094 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:environment], 'OrganizationAuthorization') @role = (x = opts.delete(:role); x.nil? ? nil : (x = x; 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.
34092 34093 34094 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34092 def environment @environment end |
#role ⇒ Object (readonly)
Returns the value of attribute role.
34092 34093 34094 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34092 def role @role end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
34105 34106 34107 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34105 def copy(incoming={}) OrganizationAuthorization.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
34109 34110 34111 34112 34113 34114 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34109 def to_hash { :role => role.nil? ? nil : role.value, :environment => environment.value } end |
#to_json ⇒ Object
34101 34102 34103 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34101 def to_json JSON.dump(to_hash) end |