Class: PaypalServerSdk::LinkDescription
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- PaypalServerSdk::LinkDescription
- Defined in:
- lib/paypal_server_sdk/models/link_description.rb
Overview
The request-related [HATEOAS link](/api/rest/responses/#hateoas-links) information.
Instance Attribute Summary collapse
-
#href ⇒ String
The complete target URL.
-
#method ⇒ LinkHttpMethod
The HTTP method required to make the related call.
-
#rel ⇒ String
The [link relation type](tools.ietf.org/html/rfc5988#section-4), which serves as an ID for a link that unambiguously describes the semantics of the link.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(href:, rel:, method: SKIP) ⇒ LinkDescription
constructor
A new instance of LinkDescription.
Methods inherited from BaseModel
Constructor Details
#initialize(href:, rel:, method: SKIP) ⇒ LinkDescription
Returns a new instance of LinkDescription.
54 55 56 57 58 |
# File 'lib/paypal_server_sdk/models/link_description.rb', line 54 def initialize(href:, rel:, method: SKIP) @href = href @rel = rel @method = method unless method == SKIP end |
Instance Attribute Details
#href ⇒ String
The complete target URL. To make the related call, combine the method with this [URI Template-formatted](tools.ietf.org/html/rfc6570) link. For pre-processing, include the ‘$`, `(`, and `)` characters. The `href` is the key HATEOAS component that links a completed call with a subsequent call.
19 20 21 |
# File 'lib/paypal_server_sdk/models/link_description.rb', line 19 def href @href end |
#method ⇒ LinkHttpMethod
The HTTP method required to make the related call.
31 32 33 |
# File 'lib/paypal_server_sdk/models/link_description.rb', line 31 def method @method end |
#rel ⇒ String
The [link relation type](tools.ietf.org/html/rfc5988#section-4), which serves as an ID for a link that unambiguously describes the semantics of the link. See [Link Relations](www.iana.org/assignments/link-relations/link-relations. xhtml).
27 28 29 |
# File 'lib/paypal_server_sdk/models/link_description.rb', line 27 def rel @rel end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/paypal_server_sdk/models/link_description.rb', line 61 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. href = hash.key?('href') ? hash['href'] : nil rel = hash.key?('rel') ? hash['rel'] : nil method = hash.key?('method') ? hash['method'] : SKIP # Create object from extracted values. LinkDescription.new(href: href, rel: rel, method: method) end |
.names ⇒ Object
A mapping from model property names to API property names.
34 35 36 37 38 39 40 |
# File 'lib/paypal_server_sdk/models/link_description.rb', line 34 def self.names @_hash = {} if @_hash.nil? @_hash['href'] = 'href' @_hash['rel'] = 'rel' @_hash['method'] = 'method' @_hash end |
.nullables ⇒ Object
An array for nullable fields
50 51 52 |
# File 'lib/paypal_server_sdk/models/link_description.rb', line 50 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
43 44 45 46 47 |
# File 'lib/paypal_server_sdk/models/link_description.rb', line 43 def self.optionals %w[ method ] end |