Class: Io::Flow::V0::Models::RouteAudit

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ RouteAudit

Returns a new instance of RouteAudit.



43269
43270
43271
43272
43273
43274
43275
43276
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43269

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:method, :path, :authentication_techniques, :roles], 'RouteAudit')
  @method = (x = opts.delete(:method); x.is_a?(::Io::Flow::V0::Models::PermittedHttpMethod) ? x : ::Io::Flow::V0::Models::PermittedHttpMethod.apply(x))
  @path = HttpClient::Preconditions.assert_class('path', opts.delete(:path), String)
  @authentication_techniques = HttpClient::Preconditions.assert_class('authentication_techniques', opts.delete(:authentication_techniques), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::AuthenticationTechnique) ? x : ::Io::Flow::V0::Models::AuthenticationTechnique.apply(x)) }
  @roles = HttpClient::Preconditions.assert_class('roles', opts.delete(:roles), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::FlowRole) ? x : ::Io::Flow::V0::Models::FlowRole.from_json(x)) }
end

Instance Attribute Details

#authentication_techniquesObject (readonly)

Returns the value of attribute authentication_techniques.



43267
43268
43269
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43267

def authentication_techniques
  @authentication_techniques
end

#methodObject (readonly)

Returns the value of attribute method.



43267
43268
43269
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43267

def method
  @method
end

#pathObject (readonly)

Returns the value of attribute path.



43267
43268
43269
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43267

def path
  @path
end

#rolesObject (readonly)

Returns the value of attribute roles.



43267
43268
43269
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43267

def roles
  @roles
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



43282
43283
43284
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43282

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

#to_hashObject



43286
43287
43288
43289
43290
43291
43292
43293
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43286

def to_hash
  {
    :method => method.value,
    :path => path,
    :authentication_techniques => authentication_techniques.map { |o| o.value },
    :roles => roles.map { |o| o.to_hash }
  }
end

#to_jsonObject



43278
43279
43280
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43278

def to_json
  JSON.dump(to_hash)
end