Class: Io::Flow::V0::Models::TokenRbacAuthenticationForm

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

Overview

Used to authenticate a given token with RBAC checks.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ TokenRbacAuthenticationForm

Returns a new instance of TokenRbacAuthenticationForm.



71179
71180
71181
71182
71183
71184
71185
71186
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 71179

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:token, :method, :path_pattern, :path], 'TokenRbacAuthenticationForm')
  @token = HttpClient::Preconditions.assert_class('token', opts.delete(:token), String)
  @method = HttpClient::Preconditions.assert_class('method', opts.delete(:method), String)
  @path_pattern = HttpClient::Preconditions.assert_class('path_pattern', opts.delete(:path_pattern), String)
  @path = HttpClient::Preconditions.assert_class('path', opts.delete(:path), String)
end

Instance Attribute Details

#methodObject (readonly)

Returns the value of attribute method.



71177
71178
71179
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 71177

def method
  @method
end

#pathObject (readonly)

Returns the value of attribute path.



71177
71178
71179
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 71177

def path
  @path
end

#path_patternObject (readonly)

Returns the value of attribute path_pattern.



71177
71178
71179
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 71177

def path_pattern
  @path_pattern
end

#tokenObject (readonly)

Returns the value of attribute token.



71177
71178
71179
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 71177

def token
  @token
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



71192
71193
71194
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 71192

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

#to_hashObject



71196
71197
71198
71199
71200
71201
71202
71203
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 71196

def to_hash
  {
    :token => token,
    :method => method,
    :path_pattern => path_pattern,
    :path => path
  }
end

#to_jsonObject



71188
71189
71190
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 71188

def to_json
  JSON.dump(to_hash)
end