Class: UspsApi::ServiceStandardsFilesHypermediaLink
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- UspsApi::ServiceStandardsFilesHypermediaLink
- Defined in:
- lib/usps_api/models/service_standards_files_hypermedia_link.rb
Overview
ServiceStandardsFilesHypermediaLink Model.
Instance Attribute Summary collapse
-
#description ⇒ String
A human-readable description of the link relationship.
-
#href ⇒ String
The URL to a related resource.
-
#method ⇒ Method
The HTTP method to use to access this link.
-
#publish_date ⇒ DateTime
The date and time the file was published.
-
#rel ⇒ Array[String]
The short name(s) of the relationship corresponding to the link.
-
#submission_media_type ⇒ String
The media type of the resource request.
-
#target_media_type ⇒ String
The media type of the resource response.
-
#title ⇒ String
A human-readable title of the link relationship.
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(rel:, href:, title: SKIP, description: SKIP, method: SKIP, submission_media_type: SKIP, target_media_type: SKIP, publish_date: SKIP) ⇒ ServiceStandardsFilesHypermediaLink
constructor
A new instance of ServiceStandardsFilesHypermediaLink.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_publish_date ⇒ Object
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(rel:, href:, title: SKIP, description: SKIP, method: SKIP, submission_media_type: SKIP, target_media_type: SKIP, publish_date: SKIP) ⇒ ServiceStandardsFilesHypermediaLink
Returns a new instance of ServiceStandardsFilesHypermediaLink.
77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/usps_api/models/service_standards_files_hypermedia_link.rb', line 77 def initialize(rel:, href:, title: SKIP, description: SKIP, method: SKIP, submission_media_type: SKIP, target_media_type: SKIP, publish_date: SKIP) @rel = rel @title = title unless title == SKIP @description = description unless description == SKIP @href = href @method = method unless method == SKIP @submission_media_type = submission_media_type unless submission_media_type == SKIP @target_media_type = target_media_type unless target_media_type == SKIP @publish_date = publish_date unless publish_date == SKIP end |
Instance Attribute Details
#description ⇒ String
A human-readable description of the link relationship.
23 24 25 |
# File 'lib/usps_api/models/service_standards_files_hypermedia_link.rb', line 23 def description @description end |
#href ⇒ String
The URL to a related resource.
27 28 29 |
# File 'lib/usps_api/models/service_standards_files_hypermedia_link.rb', line 27 def href @href end |
#method ⇒ Method
The HTTP method to use to access this link.
31 32 33 |
# File 'lib/usps_api/models/service_standards_files_hypermedia_link.rb', line 31 def method @method end |
#publish_date ⇒ DateTime
The date and time the file was published. The date and time will be returned in UTC (Zulu) format.
44 45 46 |
# File 'lib/usps_api/models/service_standards_files_hypermedia_link.rb', line 44 def publish_date @publish_date end |
#rel ⇒ Array[String]
The short name(s) of the relationship corresponding to the link.
15 16 17 |
# File 'lib/usps_api/models/service_standards_files_hypermedia_link.rb', line 15 def rel @rel end |
#submission_media_type ⇒ String
The media type of the resource request.
35 36 37 |
# File 'lib/usps_api/models/service_standards_files_hypermedia_link.rb', line 35 def submission_media_type @submission_media_type end |
#target_media_type ⇒ String
The media type of the resource response.
39 40 41 |
# File 'lib/usps_api/models/service_standards_files_hypermedia_link.rb', line 39 def target_media_type @target_media_type end |
#title ⇒ String
A human-readable title of the link relationship.
19 20 21 |
# File 'lib/usps_api/models/service_standards_files_hypermedia_link.rb', line 19 def title @title end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/usps_api/models/service_standards_files_hypermedia_link.rb', line 91 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. rel = hash.key?('rel') ? hash['rel'] : nil href = hash.key?('href') ? hash['href'] : nil title = hash.key?('title') ? hash['title'] : SKIP description = hash.key?('description') ? hash['description'] : SKIP method = hash.key?('method') ? hash['method'] : SKIP submission_media_type = hash.key?('submissionMediaType') ? hash['submissionMediaType'] : SKIP target_media_type = hash.key?('targetMediaType') ? hash['targetMediaType'] : SKIP publish_date = if hash.key?('publishDate') (DateTimeHelper.from_rfc3339(hash['publishDate']) if hash['publishDate']) else SKIP end # Create object from extracted values. ServiceStandardsFilesHypermediaLink.new(rel: rel, href: href, title: title, description: description, method: method, submission_media_type: submission_media_type, target_media_type: target_media_type, publish_date: publish_date) end |
.names ⇒ Object
A mapping from model property names to API property names.
47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/usps_api/models/service_standards_files_hypermedia_link.rb', line 47 def self.names @_hash = {} if @_hash.nil? @_hash['rel'] = 'rel' @_hash['title'] = 'title' @_hash['description'] = 'description' @_hash['href'] = 'href' @_hash['method'] = 'method' @_hash['submission_media_type'] = 'submissionMediaType' @_hash['target_media_type'] = 'targetMediaType' @_hash['publish_date'] = 'publishDate' @_hash end |
.nullables ⇒ Object
An array for nullable fields
73 74 75 |
# File 'lib/usps_api/models/service_standards_files_hypermedia_link.rb', line 73 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
61 62 63 64 65 66 67 68 69 70 |
# File 'lib/usps_api/models/service_standards_files_hypermedia_link.rb', line 61 def self.optionals %w[ title description method submission_media_type target_media_type publish_date ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
134 135 136 137 138 139 140 |
# File 'lib/usps_api/models/service_standards_files_hypermedia_link.rb', line 134 def inspect class_name = self.class.name.split('::').last "<#{class_name} rel: #{@rel.inspect}, title: #{@title.inspect}, description:"\ " #{@description.inspect}, href: #{@href.inspect}, method: #{@method.inspect},"\ " submission_media_type: #{@submission_media_type.inspect}, target_media_type:"\ " #{@target_media_type.inspect}, publish_date: #{@publish_date.inspect}>" end |
#to_custom_publish_date ⇒ Object
121 122 123 |
# File 'lib/usps_api/models/service_standards_files_hypermedia_link.rb', line 121 def to_custom_publish_date DateTimeHelper.to_rfc3339(publish_date) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
126 127 128 129 130 131 |
# File 'lib/usps_api/models/service_standards_files_hypermedia_link.rb', line 126 def to_s class_name = self.class.name.split('::').last "<#{class_name} rel: #{@rel}, title: #{@title}, description: #{@description}, href:"\ " #{@href}, method: #{@method}, submission_media_type: #{@submission_media_type},"\ " target_media_type: #{@target_media_type}, publish_date: #{@publish_date}>" end |