merge_ticketing_client 1.0.0 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +31 -7
- data/docs/Account.md +3 -1
- data/docs/AccountIntegration.md +1 -1
- data/docs/Attachment.md +5 -3
- data/docs/AttachmentRequest.md +7 -3
- data/docs/Collection.md +34 -0
- data/docs/CollectionTypeEnum.md +15 -0
- data/docs/CollectionsApi.md +193 -0
- data/docs/Comment.md +6 -4
- data/docs/CommentRequest.md +8 -4
- data/docs/ConditionSchema.md +30 -0
- data/docs/ConditionTypeEnum.md +15 -0
- data/docs/Contact.md +3 -1
- data/docs/DataPassthroughRequest.md +1 -1
- data/docs/EndUserDetailsRequest.md +2 -2
- data/docs/Issue.md +9 -7
- data/docs/LinkToken.md +1 -1
- data/docs/LinkedAccountCondition.md +28 -0
- data/docs/LinkedAccountConditionRequest.md +22 -0
- data/docs/LinkedAccountSelectiveSyncConfiguration.md +18 -0
- data/docs/LinkedAccountSelectiveSyncConfigurationListRequest.md +18 -0
- data/docs/LinkedAccountSelectiveSyncConfigurationRequest.md +18 -0
- data/docs/OperatorSchema.md +20 -0
- data/docs/PaginatedCollectionList.md +22 -0
- data/docs/PaginatedConditionSchemaList.md +22 -0
- data/docs/PatchedTicketEndpointRequest.md +18 -0
- data/docs/PatchedTicketRequest.md +56 -0
- data/docs/PriorityEnum.md +15 -0
- data/docs/Project.md +3 -1
- data/docs/ProjectsApi.md +10 -8
- data/docs/RemoteResponse.md +3 -1
- data/docs/ResponseTypeEnum.md +15 -0
- data/docs/SelectiveSyncApi.md +233 -0
- data/docs/SelectiveSyncConfigurationsUsageEnum.md +15 -0
- data/docs/SyncStatus.md +7 -5
- data/docs/Tag.md +3 -1
- data/docs/Team.md +3 -1
- data/docs/Ticket.md +18 -6
- data/docs/TicketRequest.md +20 -6
- data/docs/TicketsApi.md +207 -13
- data/docs/User.md +5 -1
- data/docs/UsersApi.md +2 -0
- data/lib/merge_ticketing_client/api/collections_api.rb +234 -0
- data/lib/merge_ticketing_client/api/linked_accounts_api.rb +1 -1
- data/lib/merge_ticketing_client/api/projects_api.rb +14 -11
- data/lib/merge_ticketing_client/api/selective_sync_api.rb +225 -0
- data/lib/merge_ticketing_client/api/tickets_api.rb +242 -19
- data/lib/merge_ticketing_client/api/users_api.rb +3 -0
- data/lib/merge_ticketing_client/models/account.rb +16 -4
- data/lib/merge_ticketing_client/models/account_details_and_actions_status_enum.rb +1 -1
- data/lib/merge_ticketing_client/models/account_integration.rb +1 -1
- data/lib/merge_ticketing_client/models/attachment.rb +18 -4
- data/lib/merge_ticketing_client/models/attachment_request.rb +31 -5
- data/lib/merge_ticketing_client/models/categories_enum.rb +1 -1
- data/lib/merge_ticketing_client/models/category_enum.rb +1 -1
- data/lib/merge_ticketing_client/models/collection.rb +308 -0
- data/lib/merge_ticketing_client/models/collection_type_enum.rb +45 -0
- data/lib/merge_ticketing_client/models/comment.rb +19 -4
- data/lib/merge_ticketing_client/models/comment_request.rb +32 -5
- data/lib/merge_ticketing_client/models/condition_schema.rb +297 -0
- data/lib/merge_ticketing_client/models/condition_type_enum.rb +50 -0
- data/lib/merge_ticketing_client/models/contact.rb +16 -4
- data/lib/merge_ticketing_client/models/data_passthrough_request.rb +2 -1
- data/lib/merge_ticketing_client/models/encoding_enum.rb +1 -1
- data/lib/merge_ticketing_client/models/end_user_details_request.rb +2 -2
- data/lib/merge_ticketing_client/models/issue.rb +16 -5
- data/lib/merge_ticketing_client/models/link_token.rb +0 -5
- data/lib/merge_ticketing_client/models/linked_account_condition.rb +282 -0
- data/lib/merge_ticketing_client/models/linked_account_condition_request.rb +269 -0
- data/lib/merge_ticketing_client/models/linked_account_selective_sync_configuration.rb +221 -0
- data/lib/merge_ticketing_client/models/linked_account_selective_sync_configuration_list_request.rb +226 -0
- data/lib/merge_ticketing_client/models/linked_account_selective_sync_configuration_request.rb +226 -0
- data/lib/merge_ticketing_client/models/meta_response.rb +1 -1
- data/lib/merge_ticketing_client/models/method_enum.rb +1 -1
- data/lib/merge_ticketing_client/models/operator_schema.rb +229 -0
- data/lib/merge_ticketing_client/models/paginated_collection_list.rb +240 -0
- data/lib/merge_ticketing_client/models/paginated_condition_schema_list.rb +240 -0
- data/lib/merge_ticketing_client/models/patched_ticket_endpoint_request.rb +223 -0
- data/lib/merge_ticketing_client/models/patched_ticket_request.rb +447 -0
- data/lib/merge_ticketing_client/models/priority_enum.rb +47 -0
- data/lib/merge_ticketing_client/models/project.rb +16 -4
- data/lib/merge_ticketing_client/models/remote_response.rb +14 -11
- data/lib/merge_ticketing_client/models/request_format_enum.rb +1 -1
- data/lib/merge_ticketing_client/models/response_type_enum.rb +45 -0
- data/lib/merge_ticketing_client/models/selective_sync_configurations_usage_enum.rb +45 -0
- data/lib/merge_ticketing_client/models/sync_status.rb +13 -14
- data/lib/merge_ticketing_client/models/sync_status_status_enum.rb +1 -1
- data/lib/merge_ticketing_client/models/tag.rb +16 -4
- data/lib/merge_ticketing_client/models/team.rb +16 -4
- data/lib/merge_ticketing_client/models/ticket.rb +91 -5
- data/lib/merge_ticketing_client/models/ticket_request.rb +104 -6
- data/lib/merge_ticketing_client/models/ticket_status_enum.rb +4 -2
- data/lib/merge_ticketing_client/models/user.rb +27 -4
- data/lib/merge_ticketing_client/version.rb +1 -1
- data/lib/merge_ticketing_client.rb +19 -0
- data/spec/api/collections_api_spec.rb +76 -0
- data/spec/api/projects_api_spec.rb +3 -2
- data/spec/api/selective_sync_api_spec.rb +72 -0
- data/spec/api/tickets_api_spec.rb +50 -4
- data/spec/api/users_api_spec.rb +1 -0
- data/spec/models/account_spec.rb +6 -0
- data/spec/models/attachment_request_spec.rb +12 -0
- data/spec/models/attachment_spec.rb +6 -0
- data/spec/models/collection_spec.rb +82 -0
- data/spec/models/collection_type_enum_spec.rb +28 -0
- data/spec/models/comment_request_spec.rb +12 -0
- data/spec/models/comment_spec.rb +6 -0
- data/spec/models/condition_schema_spec.rb +70 -0
- data/spec/models/condition_type_enum_spec.rb +28 -0
- data/spec/models/contact_spec.rb +6 -0
- data/spec/models/issue_spec.rb +6 -0
- data/spec/models/linked_account_condition_request_spec.rb +46 -0
- data/spec/models/linked_account_condition_spec.rb +64 -0
- data/spec/models/linked_account_selective_sync_configuration_list_request_spec.rb +34 -0
- data/spec/models/linked_account_selective_sync_configuration_request_spec.rb +34 -0
- data/spec/models/linked_account_selective_sync_configuration_spec.rb +34 -0
- data/spec/models/operator_schema_spec.rb +40 -0
- data/spec/models/paginated_collection_list_spec.rb +46 -0
- data/spec/models/paginated_condition_schema_list_spec.rb +46 -0
- data/spec/models/patched_ticket_endpoint_request_spec.rb +34 -0
- data/spec/models/patched_ticket_request_spec.rb +148 -0
- data/spec/models/priority_enum_spec.rb +28 -0
- data/spec/models/project_spec.rb +6 -0
- data/spec/models/remote_response_spec.rb +6 -0
- data/spec/models/response_type_enum_spec.rb +28 -0
- data/spec/models/selective_sync_configurations_usage_enum_spec.rb +28 -0
- data/spec/models/sync_status_spec.rb +6 -0
- data/spec/models/tag_spec.rb +6 -0
- data/spec/models/team_spec.rb +6 -0
- data/spec/models/ticket_request_spec.rb +42 -0
- data/spec/models/ticket_spec.rb +36 -0
- data/spec/models/user_spec.rb +12 -0
- metadata +144 -68
@@ -0,0 +1,223 @@
|
|
1
|
+
=begin
|
2
|
+
#Merge Ticketing API
|
3
|
+
|
4
|
+
#The unified API for building rich integrations with multiple Ticketing platforms.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0
|
7
|
+
Contact: hello@merge.dev
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.1.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module MergeTicketingClient
|
17
|
+
class PatchedTicketEndpointRequest
|
18
|
+
attr_accessor :model
|
19
|
+
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
21
|
+
def self.attribute_map
|
22
|
+
{
|
23
|
+
:'model' => :'model'
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
# Returns all the JSON keys this model knows about
|
28
|
+
def self.acceptable_attributes
|
29
|
+
attribute_map.values
|
30
|
+
end
|
31
|
+
|
32
|
+
# Attribute type mapping.
|
33
|
+
def self.openapi_types
|
34
|
+
{
|
35
|
+
:'model' => :'PatchedTicketRequest'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# List of attributes with nullable: true
|
40
|
+
def self.openapi_nullable
|
41
|
+
Set.new([
|
42
|
+
])
|
43
|
+
end
|
44
|
+
|
45
|
+
# Initializes the object
|
46
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
47
|
+
def initialize(attributes = {})
|
48
|
+
if (!attributes.is_a?(Hash))
|
49
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MergeTicketingClient::PatchedTicketEndpointRequest` initialize method"
|
50
|
+
end
|
51
|
+
|
52
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
53
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
54
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
55
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MergeTicketingClient::PatchedTicketEndpointRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
56
|
+
end
|
57
|
+
h[k.to_sym] = v
|
58
|
+
}
|
59
|
+
|
60
|
+
if attributes.key?(:'model')
|
61
|
+
self.model = attributes[:'model']
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
66
|
+
# @return Array for valid properties with the reasons
|
67
|
+
def list_invalid_properties
|
68
|
+
invalid_properties = Array.new
|
69
|
+
if @model.nil?
|
70
|
+
invalid_properties.push('invalid value for "model", model cannot be nil.')
|
71
|
+
end
|
72
|
+
|
73
|
+
invalid_properties
|
74
|
+
end
|
75
|
+
|
76
|
+
# Check to see if the all the properties in the model are valid
|
77
|
+
# @return true if the model is valid
|
78
|
+
def valid?
|
79
|
+
return false if @model.nil?
|
80
|
+
true
|
81
|
+
end
|
82
|
+
|
83
|
+
# Checks equality by comparing each attribute.
|
84
|
+
# @param [Object] Object to be compared
|
85
|
+
def ==(o)
|
86
|
+
return true if self.equal?(o)
|
87
|
+
self.class == o.class &&
|
88
|
+
model == o.model
|
89
|
+
end
|
90
|
+
|
91
|
+
# @see the `==` method
|
92
|
+
# @param [Object] Object to be compared
|
93
|
+
def eql?(o)
|
94
|
+
self == o
|
95
|
+
end
|
96
|
+
|
97
|
+
# Calculates hash code according to all attributes.
|
98
|
+
# @return [Integer] Hash code
|
99
|
+
def hash
|
100
|
+
[model].hash
|
101
|
+
end
|
102
|
+
|
103
|
+
# Builds the object from hash
|
104
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
105
|
+
# @return [Object] Returns the model itself
|
106
|
+
def self.build_from_hash(attributes)
|
107
|
+
new.build_from_hash(attributes)
|
108
|
+
end
|
109
|
+
|
110
|
+
# Builds the object from hash
|
111
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
112
|
+
# @return [Object] Returns the model itself
|
113
|
+
def build_from_hash(attributes)
|
114
|
+
return nil unless attributes.is_a?(Hash)
|
115
|
+
self.class.openapi_types.each_pair do |key, type|
|
116
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
117
|
+
self.send("#{key}=", nil)
|
118
|
+
elsif type =~ /\AArray<(.*)>/i
|
119
|
+
# check to ensure the input is an array given that the attribute
|
120
|
+
# is documented as an array but the input is not
|
121
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
122
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
123
|
+
end
|
124
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
125
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
self
|
130
|
+
end
|
131
|
+
|
132
|
+
# Deserializes the data based on type
|
133
|
+
# @param string type Data type
|
134
|
+
# @param string value Value to be deserialized
|
135
|
+
# @return [Object] Deserialized data
|
136
|
+
def _deserialize(type, value)
|
137
|
+
case type.to_sym
|
138
|
+
when :Time
|
139
|
+
Time.parse(value)
|
140
|
+
when :Date
|
141
|
+
Date.parse(value)
|
142
|
+
when :String
|
143
|
+
value
|
144
|
+
when :Integer
|
145
|
+
value.to_i
|
146
|
+
when :Float
|
147
|
+
value.to_f
|
148
|
+
when :Boolean
|
149
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
150
|
+
true
|
151
|
+
else
|
152
|
+
false
|
153
|
+
end
|
154
|
+
when :Object
|
155
|
+
# generic object (usually a Hash), return directly
|
156
|
+
value
|
157
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
158
|
+
inner_type = Regexp.last_match[:inner_type]
|
159
|
+
value.map { |v| _deserialize(inner_type, v) }
|
160
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
161
|
+
k_type = Regexp.last_match[:k_type]
|
162
|
+
v_type = Regexp.last_match[:v_type]
|
163
|
+
{}.tap do |hash|
|
164
|
+
value.each do |k, v|
|
165
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
166
|
+
end
|
167
|
+
end
|
168
|
+
else # model
|
169
|
+
# models (e.g. Pet) or oneOf
|
170
|
+
klass = MergeTicketingClient.const_get(type)
|
171
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
# Returns the string representation of the object
|
176
|
+
# @return [String] String presentation of the object
|
177
|
+
def to_s
|
178
|
+
to_hash.to_s
|
179
|
+
end
|
180
|
+
|
181
|
+
# to_body is an alias to to_hash (backward compatibility)
|
182
|
+
# @return [Hash] Returns the object in the form of hash
|
183
|
+
def to_body
|
184
|
+
to_hash
|
185
|
+
end
|
186
|
+
|
187
|
+
# Returns the object in the form of hash
|
188
|
+
# @return [Hash] Returns the object in the form of hash
|
189
|
+
def to_hash
|
190
|
+
hash = {}
|
191
|
+
self.class.attribute_map.each_pair do |attr, param|
|
192
|
+
value = self.send(attr)
|
193
|
+
if value.nil?
|
194
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
195
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
196
|
+
end
|
197
|
+
|
198
|
+
hash[param] = _to_hash(value)
|
199
|
+
end
|
200
|
+
hash
|
201
|
+
end
|
202
|
+
|
203
|
+
# Outputs non-array value in the form of hash
|
204
|
+
# For object, use to_hash. Otherwise, just return the value
|
205
|
+
# @param [Object] value Any valid value
|
206
|
+
# @return [Hash] Returns the value in the form of hash
|
207
|
+
def _to_hash(value)
|
208
|
+
if value.is_a?(Array)
|
209
|
+
value.compact.map { |v| _to_hash(v) }
|
210
|
+
elsif value.is_a?(Hash)
|
211
|
+
{}.tap do |hash|
|
212
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
213
|
+
end
|
214
|
+
elsif value.respond_to? :to_hash
|
215
|
+
value.to_hash
|
216
|
+
else
|
217
|
+
value
|
218
|
+
end
|
219
|
+
end
|
220
|
+
|
221
|
+
end
|
222
|
+
|
223
|
+
end
|
@@ -0,0 +1,447 @@
|
|
1
|
+
=begin
|
2
|
+
#Merge Ticketing API
|
3
|
+
|
4
|
+
#The unified API for building rich integrations with multiple Ticketing platforms.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0
|
7
|
+
Contact: hello@merge.dev
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.1.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module MergeTicketingClient
|
17
|
+
# # The Ticket Object ### Description The `Ticket` object is used to represent a ticket or a task within a system. ### Usage Example TODO
|
18
|
+
class PatchedTicketRequest
|
19
|
+
# The ticket's name.
|
20
|
+
attr_accessor :name
|
21
|
+
|
22
|
+
attr_accessor :assignees
|
23
|
+
|
24
|
+
# The user who created this ticket.
|
25
|
+
attr_accessor :creator
|
26
|
+
|
27
|
+
# The ticket's due date.
|
28
|
+
attr_accessor :due_date
|
29
|
+
|
30
|
+
# The current status of the ticket.
|
31
|
+
attr_accessor :status
|
32
|
+
|
33
|
+
# The ticket’s description. HTML version of description is mapped if supported by the third-party platform.
|
34
|
+
attr_accessor :description
|
35
|
+
|
36
|
+
# The project the ticket belongs to.
|
37
|
+
attr_accessor :project
|
38
|
+
|
39
|
+
attr_accessor :collections
|
40
|
+
|
41
|
+
# The ticket's type.
|
42
|
+
attr_accessor :ticket_type
|
43
|
+
|
44
|
+
# The account associated with the ticket.
|
45
|
+
attr_accessor :account
|
46
|
+
|
47
|
+
# The contact associated with the ticket.
|
48
|
+
attr_accessor :contact
|
49
|
+
|
50
|
+
# The ticket's parent ticket.
|
51
|
+
attr_accessor :parent_ticket
|
52
|
+
|
53
|
+
attr_accessor :tags
|
54
|
+
|
55
|
+
# When the third party's ticket was created.
|
56
|
+
attr_accessor :remote_created_at
|
57
|
+
|
58
|
+
# When the third party's ticket was updated.
|
59
|
+
attr_accessor :remote_updated_at
|
60
|
+
|
61
|
+
# When the ticket was completed.
|
62
|
+
attr_accessor :completed_at
|
63
|
+
|
64
|
+
# The 3rd party url of the Ticket.
|
65
|
+
attr_accessor :ticket_url
|
66
|
+
|
67
|
+
# The priority or urgency of the Ticket.
|
68
|
+
attr_accessor :priority
|
69
|
+
|
70
|
+
attr_accessor :integration_params
|
71
|
+
|
72
|
+
attr_accessor :linked_account_params
|
73
|
+
|
74
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
75
|
+
def self.attribute_map
|
76
|
+
{
|
77
|
+
:'name' => :'name',
|
78
|
+
:'assignees' => :'assignees',
|
79
|
+
:'creator' => :'creator',
|
80
|
+
:'due_date' => :'due_date',
|
81
|
+
:'status' => :'status',
|
82
|
+
:'description' => :'description',
|
83
|
+
:'project' => :'project',
|
84
|
+
:'collections' => :'collections',
|
85
|
+
:'ticket_type' => :'ticket_type',
|
86
|
+
:'account' => :'account',
|
87
|
+
:'contact' => :'contact',
|
88
|
+
:'parent_ticket' => :'parent_ticket',
|
89
|
+
:'tags' => :'tags',
|
90
|
+
:'remote_created_at' => :'remote_created_at',
|
91
|
+
:'remote_updated_at' => :'remote_updated_at',
|
92
|
+
:'completed_at' => :'completed_at',
|
93
|
+
:'ticket_url' => :'ticket_url',
|
94
|
+
:'priority' => :'priority',
|
95
|
+
:'integration_params' => :'integration_params',
|
96
|
+
:'linked_account_params' => :'linked_account_params'
|
97
|
+
}
|
98
|
+
end
|
99
|
+
|
100
|
+
# Returns all the JSON keys this model knows about
|
101
|
+
def self.acceptable_attributes
|
102
|
+
attribute_map.values
|
103
|
+
end
|
104
|
+
|
105
|
+
# Attribute type mapping.
|
106
|
+
def self.openapi_types
|
107
|
+
{
|
108
|
+
:'name' => :'String',
|
109
|
+
:'assignees' => :'Array<String>',
|
110
|
+
:'creator' => :'String',
|
111
|
+
:'due_date' => :'Time',
|
112
|
+
:'status' => :'TicketStatusEnum',
|
113
|
+
:'description' => :'String',
|
114
|
+
:'project' => :'String',
|
115
|
+
:'collections' => :'Array<String>',
|
116
|
+
:'ticket_type' => :'String',
|
117
|
+
:'account' => :'String',
|
118
|
+
:'contact' => :'String',
|
119
|
+
:'parent_ticket' => :'String',
|
120
|
+
:'tags' => :'Array<String>',
|
121
|
+
:'remote_created_at' => :'Time',
|
122
|
+
:'remote_updated_at' => :'Time',
|
123
|
+
:'completed_at' => :'Time',
|
124
|
+
:'ticket_url' => :'String',
|
125
|
+
:'priority' => :'PriorityEnum',
|
126
|
+
:'integration_params' => :'Hash<String, Object>',
|
127
|
+
:'linked_account_params' => :'Hash<String, Object>'
|
128
|
+
}
|
129
|
+
end
|
130
|
+
|
131
|
+
# List of attributes with nullable: true
|
132
|
+
def self.openapi_nullable
|
133
|
+
Set.new([
|
134
|
+
:'name',
|
135
|
+
:'creator',
|
136
|
+
:'due_date',
|
137
|
+
:'status',
|
138
|
+
:'description',
|
139
|
+
:'project',
|
140
|
+
:'ticket_type',
|
141
|
+
:'account',
|
142
|
+
:'contact',
|
143
|
+
:'parent_ticket',
|
144
|
+
:'remote_created_at',
|
145
|
+
:'remote_updated_at',
|
146
|
+
:'completed_at',
|
147
|
+
:'ticket_url',
|
148
|
+
:'priority',
|
149
|
+
:'integration_params',
|
150
|
+
:'linked_account_params'
|
151
|
+
])
|
152
|
+
end
|
153
|
+
|
154
|
+
# Initializes the object
|
155
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
156
|
+
def initialize(attributes = {})
|
157
|
+
if (!attributes.is_a?(Hash))
|
158
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MergeTicketingClient::PatchedTicketRequest` initialize method"
|
159
|
+
end
|
160
|
+
|
161
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
162
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
163
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
164
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MergeTicketingClient::PatchedTicketRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
165
|
+
end
|
166
|
+
h[k.to_sym] = v
|
167
|
+
}
|
168
|
+
|
169
|
+
if attributes.key?(:'name')
|
170
|
+
self.name = attributes[:'name']
|
171
|
+
end
|
172
|
+
|
173
|
+
if attributes.key?(:'assignees')
|
174
|
+
if (value = attributes[:'assignees']).is_a?(Array)
|
175
|
+
self.assignees = value
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
if attributes.key?(:'creator')
|
180
|
+
self.creator = attributes[:'creator']
|
181
|
+
end
|
182
|
+
|
183
|
+
if attributes.key?(:'due_date')
|
184
|
+
self.due_date = attributes[:'due_date']
|
185
|
+
end
|
186
|
+
|
187
|
+
if attributes.key?(:'status')
|
188
|
+
self.status = attributes[:'status']
|
189
|
+
end
|
190
|
+
|
191
|
+
if attributes.key?(:'description')
|
192
|
+
self.description = attributes[:'description']
|
193
|
+
end
|
194
|
+
|
195
|
+
if attributes.key?(:'project')
|
196
|
+
self.project = attributes[:'project']
|
197
|
+
end
|
198
|
+
|
199
|
+
if attributes.key?(:'collections')
|
200
|
+
if (value = attributes[:'collections']).is_a?(Array)
|
201
|
+
self.collections = value
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
205
|
+
if attributes.key?(:'ticket_type')
|
206
|
+
self.ticket_type = attributes[:'ticket_type']
|
207
|
+
end
|
208
|
+
|
209
|
+
if attributes.key?(:'account')
|
210
|
+
self.account = attributes[:'account']
|
211
|
+
end
|
212
|
+
|
213
|
+
if attributes.key?(:'contact')
|
214
|
+
self.contact = attributes[:'contact']
|
215
|
+
end
|
216
|
+
|
217
|
+
if attributes.key?(:'parent_ticket')
|
218
|
+
self.parent_ticket = attributes[:'parent_ticket']
|
219
|
+
end
|
220
|
+
|
221
|
+
if attributes.key?(:'tags')
|
222
|
+
if (value = attributes[:'tags']).is_a?(Array)
|
223
|
+
self.tags = value
|
224
|
+
end
|
225
|
+
end
|
226
|
+
|
227
|
+
if attributes.key?(:'remote_created_at')
|
228
|
+
self.remote_created_at = attributes[:'remote_created_at']
|
229
|
+
end
|
230
|
+
|
231
|
+
if attributes.key?(:'remote_updated_at')
|
232
|
+
self.remote_updated_at = attributes[:'remote_updated_at']
|
233
|
+
end
|
234
|
+
|
235
|
+
if attributes.key?(:'completed_at')
|
236
|
+
self.completed_at = attributes[:'completed_at']
|
237
|
+
end
|
238
|
+
|
239
|
+
if attributes.key?(:'ticket_url')
|
240
|
+
self.ticket_url = attributes[:'ticket_url']
|
241
|
+
end
|
242
|
+
|
243
|
+
if attributes.key?(:'priority')
|
244
|
+
self.priority = attributes[:'priority']
|
245
|
+
end
|
246
|
+
|
247
|
+
if attributes.key?(:'integration_params')
|
248
|
+
if (value = attributes[:'integration_params']).is_a?(Hash)
|
249
|
+
self.integration_params = value
|
250
|
+
end
|
251
|
+
end
|
252
|
+
|
253
|
+
if attributes.key?(:'linked_account_params')
|
254
|
+
if (value = attributes[:'linked_account_params']).is_a?(Hash)
|
255
|
+
self.linked_account_params = value
|
256
|
+
end
|
257
|
+
end
|
258
|
+
end
|
259
|
+
|
260
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
261
|
+
# @return Array for valid properties with the reasons
|
262
|
+
def list_invalid_properties
|
263
|
+
invalid_properties = Array.new
|
264
|
+
if !@ticket_url.nil? && @ticket_url.to_s.length > 2000
|
265
|
+
invalid_properties.push('invalid value for "ticket_url", the character length must be smaller than or equal to 2000.')
|
266
|
+
end
|
267
|
+
|
268
|
+
invalid_properties
|
269
|
+
end
|
270
|
+
|
271
|
+
# Check to see if the all the properties in the model are valid
|
272
|
+
# @return true if the model is valid
|
273
|
+
def valid?
|
274
|
+
return false if !@ticket_url.nil? && @ticket_url.to_s.length > 2000
|
275
|
+
true
|
276
|
+
end
|
277
|
+
|
278
|
+
# Custom attribute writer method with validation
|
279
|
+
# @param [Object] ticket_url Value to be assigned
|
280
|
+
def ticket_url=(ticket_url)
|
281
|
+
if !ticket_url.nil? && ticket_url.to_s.length > 2000
|
282
|
+
fail ArgumentError, 'invalid value for "ticket_url", the character length must be smaller than or equal to 2000.'
|
283
|
+
end
|
284
|
+
|
285
|
+
@ticket_url = ticket_url
|
286
|
+
end
|
287
|
+
|
288
|
+
# Checks equality by comparing each attribute.
|
289
|
+
# @param [Object] Object to be compared
|
290
|
+
def ==(o)
|
291
|
+
return true if self.equal?(o)
|
292
|
+
self.class == o.class &&
|
293
|
+
name == o.name &&
|
294
|
+
assignees == o.assignees &&
|
295
|
+
creator == o.creator &&
|
296
|
+
due_date == o.due_date &&
|
297
|
+
status == o.status &&
|
298
|
+
description == o.description &&
|
299
|
+
project == o.project &&
|
300
|
+
collections == o.collections &&
|
301
|
+
ticket_type == o.ticket_type &&
|
302
|
+
account == o.account &&
|
303
|
+
contact == o.contact &&
|
304
|
+
parent_ticket == o.parent_ticket &&
|
305
|
+
tags == o.tags &&
|
306
|
+
remote_created_at == o.remote_created_at &&
|
307
|
+
remote_updated_at == o.remote_updated_at &&
|
308
|
+
completed_at == o.completed_at &&
|
309
|
+
ticket_url == o.ticket_url &&
|
310
|
+
priority == o.priority &&
|
311
|
+
integration_params == o.integration_params &&
|
312
|
+
linked_account_params == o.linked_account_params
|
313
|
+
end
|
314
|
+
|
315
|
+
# @see the `==` method
|
316
|
+
# @param [Object] Object to be compared
|
317
|
+
def eql?(o)
|
318
|
+
self == o
|
319
|
+
end
|
320
|
+
|
321
|
+
# Calculates hash code according to all attributes.
|
322
|
+
# @return [Integer] Hash code
|
323
|
+
def hash
|
324
|
+
[name, assignees, creator, due_date, status, description, project, collections, ticket_type, account, contact, parent_ticket, tags, remote_created_at, remote_updated_at, completed_at, ticket_url, priority, integration_params, linked_account_params].hash
|
325
|
+
end
|
326
|
+
|
327
|
+
# Builds the object from hash
|
328
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
329
|
+
# @return [Object] Returns the model itself
|
330
|
+
def self.build_from_hash(attributes)
|
331
|
+
new.build_from_hash(attributes)
|
332
|
+
end
|
333
|
+
|
334
|
+
# Builds the object from hash
|
335
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
336
|
+
# @return [Object] Returns the model itself
|
337
|
+
def build_from_hash(attributes)
|
338
|
+
return nil unless attributes.is_a?(Hash)
|
339
|
+
self.class.openapi_types.each_pair do |key, type|
|
340
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
341
|
+
self.send("#{key}=", nil)
|
342
|
+
elsif type =~ /\AArray<(.*)>/i
|
343
|
+
# check to ensure the input is an array given that the attribute
|
344
|
+
# is documented as an array but the input is not
|
345
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
346
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
347
|
+
end
|
348
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
349
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
350
|
+
end
|
351
|
+
end
|
352
|
+
|
353
|
+
self
|
354
|
+
end
|
355
|
+
|
356
|
+
# Deserializes the data based on type
|
357
|
+
# @param string type Data type
|
358
|
+
# @param string value Value to be deserialized
|
359
|
+
# @return [Object] Deserialized data
|
360
|
+
def _deserialize(type, value)
|
361
|
+
case type.to_sym
|
362
|
+
when :Time
|
363
|
+
Time.parse(value)
|
364
|
+
when :Date
|
365
|
+
Date.parse(value)
|
366
|
+
when :String
|
367
|
+
value
|
368
|
+
when :Integer
|
369
|
+
value.to_i
|
370
|
+
when :Float
|
371
|
+
value.to_f
|
372
|
+
when :Boolean
|
373
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
374
|
+
true
|
375
|
+
else
|
376
|
+
false
|
377
|
+
end
|
378
|
+
when :Object
|
379
|
+
# generic object (usually a Hash), return directly
|
380
|
+
value
|
381
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
382
|
+
inner_type = Regexp.last_match[:inner_type]
|
383
|
+
value.map { |v| _deserialize(inner_type, v) }
|
384
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
385
|
+
k_type = Regexp.last_match[:k_type]
|
386
|
+
v_type = Regexp.last_match[:v_type]
|
387
|
+
{}.tap do |hash|
|
388
|
+
value.each do |k, v|
|
389
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
390
|
+
end
|
391
|
+
end
|
392
|
+
else # model
|
393
|
+
# models (e.g. Pet) or oneOf
|
394
|
+
klass = MergeTicketingClient.const_get(type)
|
395
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
396
|
+
end
|
397
|
+
end
|
398
|
+
|
399
|
+
# Returns the string representation of the object
|
400
|
+
# @return [String] String presentation of the object
|
401
|
+
def to_s
|
402
|
+
to_hash.to_s
|
403
|
+
end
|
404
|
+
|
405
|
+
# to_body is an alias to to_hash (backward compatibility)
|
406
|
+
# @return [Hash] Returns the object in the form of hash
|
407
|
+
def to_body
|
408
|
+
to_hash
|
409
|
+
end
|
410
|
+
|
411
|
+
# Returns the object in the form of hash
|
412
|
+
# @return [Hash] Returns the object in the form of hash
|
413
|
+
def to_hash
|
414
|
+
hash = {}
|
415
|
+
self.class.attribute_map.each_pair do |attr, param|
|
416
|
+
value = self.send(attr)
|
417
|
+
if value.nil?
|
418
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
419
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
420
|
+
end
|
421
|
+
|
422
|
+
hash[param] = _to_hash(value)
|
423
|
+
end
|
424
|
+
hash
|
425
|
+
end
|
426
|
+
|
427
|
+
# Outputs non-array value in the form of hash
|
428
|
+
# For object, use to_hash. Otherwise, just return the value
|
429
|
+
# @param [Object] value Any valid value
|
430
|
+
# @return [Hash] Returns the value in the form of hash
|
431
|
+
def _to_hash(value)
|
432
|
+
if value.is_a?(Array)
|
433
|
+
value.compact.map { |v| _to_hash(v) }
|
434
|
+
elsif value.is_a?(Hash)
|
435
|
+
{}.tap do |hash|
|
436
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
437
|
+
end
|
438
|
+
elsif value.respond_to? :to_hash
|
439
|
+
value.to_hash
|
440
|
+
else
|
441
|
+
value
|
442
|
+
end
|
443
|
+
end
|
444
|
+
|
445
|
+
end
|
446
|
+
|
447
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
=begin
|
2
|
+
#Merge Ticketing API
|
3
|
+
|
4
|
+
#The unified API for building rich integrations with multiple Ticketing platforms.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0
|
7
|
+
Contact: hello@merge.dev
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.1.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module MergeTicketingClient
|
17
|
+
class PriorityEnum
|
18
|
+
URGENT = "URGENT".freeze
|
19
|
+
HIGH = "HIGH".freeze
|
20
|
+
NORMAL = "NORMAL".freeze
|
21
|
+
LOW = "LOW".freeze
|
22
|
+
|
23
|
+
MERGE_NONSTANDARD_VALUE = "MERGE_NONSTANDARD_VALUE".freeze
|
24
|
+
|
25
|
+
attr_accessor :value
|
26
|
+
attr_accessor :raw_value
|
27
|
+
|
28
|
+
# Builds the enum from string
|
29
|
+
# @param [String] The enum value in the form of the string
|
30
|
+
# @return [String] The enum value
|
31
|
+
def build_from_hash(value)
|
32
|
+
@raw_value = value
|
33
|
+
if ["URGENT", "HIGH", "NORMAL", "LOW", ].include? value
|
34
|
+
@value = value
|
35
|
+
else
|
36
|
+
@value = MERGE_NONSTANDARD_VALUE
|
37
|
+
end
|
38
|
+
|
39
|
+
self
|
40
|
+
end
|
41
|
+
|
42
|
+
def self.build_from_hash(value)
|
43
|
+
PriorityEnum.new.build_from_hash(value)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|