Class: Io::Flow::V0::Models::PermittedHttpMethod

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ PermittedHttpMethod

Returns a new instance of PermittedHttpMethod.



24964
24965
24966
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24964

def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



24962
24963
24964
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24962

def value
  @value
end

Class Method Details

.ALLObject



24984
24985
24986
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24984

def PermittedHttpMethod.ALL
  @@all ||= [PermittedHttpMethod.get, PermittedHttpMethod.post, PermittedHttpMethod.put, PermittedHttpMethod.delete, PermittedHttpMethod.patch]
end

.apply(value) ⇒ Object

Returns the instance of PermittedHttpMethod for this value, creating a new instance for an unknown value



24969
24970
24971
24972
24973
24974
24975
24976
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24969

def PermittedHttpMethod.apply(value)
  if value.instance_of?(PermittedHttpMethod)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || PermittedHttpMethod.new(value))
  end
end

.deleteObject



25000
25001
25002
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25000

def PermittedHttpMethod.delete
  @@_delete ||= PermittedHttpMethod.new('DELETE')
end

.from_string(value) ⇒ Object

Returns the instance of PermittedHttpMethod for this value, or nil if not found



24979
24980
24981
24982
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24979

def PermittedHttpMethod.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  PermittedHttpMethod.ALL.find { |v| v.value == value }
end

.getObject



24988
24989
24990
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24988

def PermittedHttpMethod.get
  @@_get ||= PermittedHttpMethod.new('GET')
end

.patchObject



25004
25005
25006
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25004

def PermittedHttpMethod.patch
  @@_patch ||= PermittedHttpMethod.new('PATCH')
end

.postObject



24992
24993
24994
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24992

def PermittedHttpMethod.post
  @@_post ||= PermittedHttpMethod.new('POST')
end

.putObject



24996
24997
24998
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24996

def PermittedHttpMethod.put
  @@_put ||= PermittedHttpMethod.new('PUT')
end

Instance Method Details

#to_hashObject



25008
25009
25010
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25008

def to_hash
  value
end