Class: Io::Flow::V0::Models::PartnerTokenForm

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Overview

Used to create a new token. User making the request must be authorized to create a token for this partner.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ PartnerTokenForm

Returns a new instance of PartnerTokenForm.



23335
23336
23337
23338
23339
23340
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23335

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:environment], 'PartnerTokenForm')
  @environment = (x = opts.delete(:environment); x.is_a?(::Io::Flow::V0::Models::Environment) ? x : ::Io::Flow::V0::Models::Environment.apply(x))
  @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



23333
23334
23335
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23333

def description
  @description
end

#environmentObject (readonly)

Returns the value of attribute environment.



23333
23334
23335
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23333

def environment
  @environment
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



23346
23347
23348
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23346

def copy(incoming={})
  PartnerTokenForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



23350
23351
23352
23353
23354
23355
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23350

def to_hash
  {
    :environment => environment.value,
    :description => description
  }
end

#to_jsonObject



23342
23343
23344
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23342

def to_json
  JSON.dump(to_hash)
end