Class: ApimaticApi::UserCodeGeneration
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ApimaticApi::UserCodeGeneration
- Defined in:
- lib/apimatic_api/models/user_code_generation.rb
Overview
The Code Generation structure encapsulates all the the details of an SDK generation performed by a user.
Instance Attribute Summary collapse
-
#code_gen_version ⇒ String
Generation Version.
-
#code_generation_source ⇒ String
Generation Source.
-
#generated_file ⇒ String
The generated SDK.
-
#generated_on ⇒ DateTime
Generation Date and Time.
-
#hash_code ⇒ String
The md5 hash of the API Description.
-
#id ⇒ String
Unique Code Generation Identifier.
-
#input_file ⇒ String
API Specification file in a supported format.
-
#success ⇒ TrueClass | FalseClass
Generation Status.
-
#template ⇒ Platforms
The structure contains platforms that APIMatic CodeGen can generate SDKs and Docs in.
-
#user_id ⇒ String
Unique User Identifier.
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(id:, template: Platforms::CS_NET_STANDARD_LIB, generated_file:, generated_on:, hash_code:, code_generation_source:, code_gen_version:, success:, user_id:, input_file:, additional_properties: nil) ⇒ UserCodeGeneration
constructor
A new instance of UserCodeGeneration.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_generated_on ⇒ 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(id:, template: Platforms::CS_NET_STANDARD_LIB, generated_file:, generated_on:, hash_code:, code_generation_source:, code_gen_version:, success:, user_id:, input_file:, additional_properties: nil) ⇒ UserCodeGeneration
Returns a new instance of UserCodeGeneration.
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/apimatic_api/models/user_code_generation.rb', line 81 def initialize(id:, template: Platforms::CS_NET_STANDARD_LIB, generated_file:, generated_on:, hash_code:, code_generation_source:, code_gen_version:, success:, user_id:, input_file:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @id = id @template = template @generated_file = generated_file @generated_on = generated_on @hash_code = hash_code @code_generation_source = code_generation_source @code_gen_version = code_gen_version @success = success @user_id = user_id @input_file = input_file @additional_properties = additional_properties end |
Instance Attribute Details
#code_gen_version ⇒ String
Generation Version
41 42 43 |
# File 'lib/apimatic_api/models/user_code_generation.rb', line 41 def code_gen_version @code_gen_version end |
#code_generation_source ⇒ String
Generation Source
37 38 39 |
# File 'lib/apimatic_api/models/user_code_generation.rb', line 37 def code_generation_source @code_generation_source end |
#generated_file ⇒ String
The generated SDK
25 26 27 |
# File 'lib/apimatic_api/models/user_code_generation.rb', line 25 def generated_file @generated_file end |
#generated_on ⇒ DateTime
Generation Date and Time
29 30 31 |
# File 'lib/apimatic_api/models/user_code_generation.rb', line 29 def generated_on @generated_on end |
#hash_code ⇒ String
The md5 hash of the API Description
33 34 35 |
# File 'lib/apimatic_api/models/user_code_generation.rb', line 33 def hash_code @hash_code end |
#id ⇒ String
Unique Code Generation Identifier
16 17 18 |
# File 'lib/apimatic_api/models/user_code_generation.rb', line 16 def id @id end |
#input_file ⇒ String
API Specification file in a supported format
53 54 55 |
# File 'lib/apimatic_api/models/user_code_generation.rb', line 53 def input_file @input_file end |
#success ⇒ TrueClass | FalseClass
Generation Status
45 46 47 |
# File 'lib/apimatic_api/models/user_code_generation.rb', line 45 def success @success end |
#template ⇒ Platforms
The structure contains platforms that APIMatic CodeGen can generate SDKs and Docs in.
21 22 23 |
# File 'lib/apimatic_api/models/user_code_generation.rb', line 21 def template @template end |
#user_id ⇒ String
Unique User Identifier
49 50 51 |
# File 'lib/apimatic_api/models/user_code_generation.rb', line 49 def user_id @user_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
# File 'lib/apimatic_api/models/user_code_generation.rb', line 102 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : nil template = hash['template'] ||= Platforms::CS_NET_STANDARD_LIB generated_file = hash.key?('generatedFile') ? hash['generatedFile'] : nil generated_on = if hash.key?('generatedOn') (DateTimeHelper.from_rfc3339(hash['generatedOn']) if hash['generatedOn']) end hash_code = hash.key?('hashCode') ? hash['hashCode'] : nil code_generation_source = hash.key?('codeGenerationSource') ? hash['codeGenerationSource'] : nil code_gen_version = hash.key?('codeGenVersion') ? hash['codeGenVersion'] : nil success = hash.key?('success') ? hash['success'] : nil user_id = hash.key?('userId') ? hash['userId'] : nil input_file = hash.key?('inputFile') ? hash['inputFile'] : nil # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. UserCodeGeneration.new(id: id, template: template, generated_file: generated_file, generated_on: generated_on, hash_code: hash_code, code_generation_source: code_generation_source, code_gen_version: code_gen_version, success: success, user_id: user_id, input_file: input_file, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/apimatic_api/models/user_code_generation.rb', line 56 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['template'] = 'template' @_hash['generated_file'] = 'generatedFile' @_hash['generated_on'] = 'generatedOn' @_hash['hash_code'] = 'hashCode' @_hash['code_generation_source'] = 'codeGenerationSource' @_hash['code_gen_version'] = 'codeGenVersion' @_hash['success'] = 'success' @_hash['user_id'] = 'userId' @_hash['input_file'] = 'inputFile' @_hash end |
.nullables ⇒ Object
An array for nullable fields
77 78 79 |
# File 'lib/apimatic_api/models/user_code_generation.rb', line 77 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
72 73 74 |
# File 'lib/apimatic_api/models/user_code_generation.rb', line 72 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
157 158 159 160 161 162 163 164 165 |
# File 'lib/apimatic_api/models/user_code_generation.rb', line 157 def inspect class_name = self.class.name.split('::').last "<#{class_name} id: #{@id.inspect}, template: #{@template.inspect}, generated_file:"\ " #{@generated_file.inspect}, generated_on: #{@generated_on.inspect}, hash_code:"\ " #{@hash_code.inspect}, code_generation_source: #{@code_generation_source.inspect},"\ " code_gen_version: #{@code_gen_version.inspect}, success: #{@success.inspect}, user_id:"\ " #{@user_id.inspect}, input_file: #{@input_file.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_custom_generated_on ⇒ Object
142 143 144 |
# File 'lib/apimatic_api/models/user_code_generation.rb', line 142 def to_custom_generated_on DateTimeHelper.to_rfc3339(generated_on) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
147 148 149 150 151 152 153 154 |
# File 'lib/apimatic_api/models/user_code_generation.rb', line 147 def to_s class_name = self.class.name.split('::').last "<#{class_name} id: #{@id}, template: #{@template}, generated_file: #{@generated_file},"\ " generated_on: #{@generated_on}, hash_code: #{@hash_code}, code_generation_source:"\ " #{@code_generation_source}, code_gen_version: #{@code_gen_version}, success: #{@success},"\ " user_id: #{@user_id}, input_file: #{@input_file}, additional_properties:"\ " #{@additional_properties}>" end |