pescheck-client 0.4.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +54 -45
  3. data/docs/AddOnsApi.md +305 -0
  4. data/docs/AddonPrice.md +20 -0
  5. data/docs/AuthenticationApi.md +1 -71
  6. data/docs/DisabledDivision.md +20 -0
  7. data/docs/OAuthApplication.md +1 -1
  8. data/docs/OAuthApplicationResponse.md +6 -2
  9. data/docs/OrganisationAddon.md +32 -0
  10. data/docs/OrganisationAddonUpdate.md +18 -0
  11. data/docs/OrganisationAddonUpdateResult.md +34 -0
  12. data/docs/PatchedOrganisationAddonUpdate.md +18 -0
  13. data/docs/ScreeningsApi.md +72 -0
  14. data/docs/V2Candidate.md +1 -1
  15. data/docs/V2CheckField.md +1 -1
  16. data/docs/V2Document.md +1 -1
  17. data/docs/V2ProfileCheck.md +1 -1
  18. data/docs/V2ProfileCheckEntry.md +1 -1
  19. data/docs/V2ProfileDetail.md +4 -0
  20. data/docs/V2ProfileUpdateCheck.md +1 -1
  21. data/docs/V2ScreeningCheck.md +1 -1
  22. data/docs/V2ScreeningCheckEntry.md +1 -1
  23. data/docs/V2ScreeningCheckListItem.md +1 -1
  24. data/docs/V2ScreeningCreate.md +5 -1
  25. data/docs/V2ScreeningDetail.md +5 -1
  26. data/docs/{V2ScreeningDetailProfile.md → V2ScreeningDetailOrganisation.md} +2 -2
  27. data/docs/V2ScreeningListItem.md +3 -1
  28. data/docs/V2ScreeningNote.md +24 -0
  29. data/docs/V2ScreeningNoteInput.md +22 -0
  30. data/docs/WebhooksApi.md +1 -1
  31. data/lib/pescheck-client/api/add_ons_api.rb +305 -0
  32. data/lib/pescheck-client/api/authentication_api.rb +2 -68
  33. data/lib/pescheck-client/api/profiles_api.rb +1 -1
  34. data/lib/pescheck-client/api/screenings_api.rb +66 -0
  35. data/lib/pescheck-client/api/webhooks_api.rb +2 -2
  36. data/lib/pescheck-client/configuration.rb +8 -0
  37. data/lib/pescheck-client/models/addon_price.rb +202 -0
  38. data/lib/pescheck-client/models/{custom_token_obtain_pair.rb → disabled_division.rb} +34 -35
  39. data/lib/pescheck-client/models/o_auth_application.rb +3 -3
  40. data/lib/pescheck-client/models/o_auth_application_response.rb +70 -44
  41. data/lib/pescheck-client/models/organisation_addon.rb +339 -0
  42. data/lib/pescheck-client/models/organisation_addon_update.rb +165 -0
  43. data/lib/pescheck-client/models/organisation_addon_update_result.rb +368 -0
  44. data/lib/pescheck-client/models/patched_organisation_addon_update.rb +148 -0
  45. data/lib/pescheck-client/models/v2_candidate.rb +1 -35
  46. data/lib/pescheck-client/models/v2_check_field.rb +2 -2
  47. data/lib/pescheck-client/models/v2_document.rb +6 -30
  48. data/lib/pescheck-client/models/v2_profile_check.rb +3 -3
  49. data/lib/pescheck-client/models/v2_profile_check_entry.rb +6 -30
  50. data/lib/pescheck-client/models/v2_profile_detail.rb +55 -1
  51. data/lib/pescheck-client/models/v2_profile_update_check.rb +3 -3
  52. data/lib/pescheck-client/models/v2_screening_check.rb +3 -3
  53. data/lib/pescheck-client/models/v2_screening_check_entry.rb +6 -30
  54. data/lib/pescheck-client/models/v2_screening_check_list_item.rb +6 -30
  55. data/lib/pescheck-client/models/v2_screening_create.rb +25 -4
  56. data/lib/pescheck-client/models/v2_screening_detail.rb +42 -2
  57. data/lib/pescheck-client/models/{v2_screening_detail_profile.rb → v2_screening_detail_organisation.rb} +4 -3
  58. data/lib/pescheck-client/models/v2_screening_list_item.rb +14 -2
  59. data/lib/pescheck-client/models/v2_screening_note.rb +229 -0
  60. data/lib/pescheck-client/models/v2_screening_note_input.rb +220 -0
  61. data/lib/pescheck-client/models/webhook_response.rb +5 -5
  62. data/lib/pescheck-client/version.rb +1 -1
  63. data/lib/pescheck-client.rb +10 -2
  64. data/spec/api/add_ons_api_spec.rb +84 -0
  65. data/spec/api/authentication_api_spec.rb +1 -12
  66. data/spec/api/screenings_api_spec.rb +13 -0
  67. data/spec/api/webhooks_api_spec.rb +1 -1
  68. data/spec/models/{custom_token_obtain_pair_spec.rb → addon_price_spec.rb} +8 -8
  69. data/spec/models/disabled_division_spec.rb +42 -0
  70. data/spec/models/o_auth_application_response_spec.rb +12 -8
  71. data/spec/models/o_auth_application_spec.rb +1 -1
  72. data/spec/models/organisation_addon_spec.rb +78 -0
  73. data/spec/models/organisation_addon_update_result_spec.rb +84 -0
  74. data/spec/models/organisation_addon_update_spec.rb +36 -0
  75. data/spec/models/patched_organisation_addon_update_spec.rb +36 -0
  76. data/spec/models/v2_candidate_spec.rb +0 -4
  77. data/spec/models/v2_document_spec.rb +0 -4
  78. data/spec/models/v2_profile_check_entry_spec.rb +0 -4
  79. data/spec/models/v2_profile_check_spec.rb +1 -1
  80. data/spec/models/v2_profile_detail_spec.rb +12 -0
  81. data/spec/models/v2_profile_update_check_spec.rb +1 -1
  82. data/spec/models/v2_screening_check_entry_spec.rb +0 -4
  83. data/spec/models/v2_screening_check_list_item_spec.rb +0 -4
  84. data/spec/models/v2_screening_check_spec.rb +1 -1
  85. data/spec/models/v2_screening_create_spec.rb +12 -0
  86. data/spec/models/{v2_screening_detail_profile_spec.rb → v2_screening_detail_organisation_spec.rb} +6 -6
  87. data/spec/models/v2_screening_detail_spec.rb +12 -0
  88. data/spec/models/v2_screening_list_item_spec.rb +6 -0
  89. data/spec/models/v2_screening_note_input_spec.rb +52 -0
  90. data/spec/models/v2_screening_note_spec.rb +54 -0
  91. metadata +71 -39
  92. data/docs/CustomTokenObtainPair.md +0 -20
@@ -0,0 +1,202 @@
1
+ =begin
2
+ #Pescheck API
3
+
4
+ #Official client library for the Pescheck API (v2), generated from the OpenAPI specification. Authenticate with OAuth2 client credentials and use the checks, profiles, screenings, webhooks and divisions endpoints. See https://github.com/pescheckit/pescheck-clients for installation and usage.
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.23.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Pescheck
17
+ class AddonPrice < ApiModelBase
18
+ attr_accessor :amount
19
+
20
+ # ISO 4217 code, e.g. EUR.
21
+ attr_accessor :currency
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'amount' => :'amount',
27
+ :'currency' => :'currency'
28
+ }
29
+ end
30
+
31
+ # Returns attribute mapping this model knows about
32
+ def self.acceptable_attribute_map
33
+ attribute_map
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ acceptable_attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'amount' => :'String',
45
+ :'currency' => :'String'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pescheck::AddonPrice` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ acceptable_attribute_map = self.class.acceptable_attribute_map
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!acceptable_attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pescheck::AddonPrice`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'amount')
72
+ self.amount = attributes[:'amount']
73
+ else
74
+ self.amount = nil
75
+ end
76
+
77
+ if attributes.key?(:'currency')
78
+ self.currency = attributes[:'currency']
79
+ else
80
+ self.currency = nil
81
+ end
82
+ end
83
+
84
+ # Show invalid properties with the reasons. Usually used together with valid?
85
+ # @return Array for valid properties with the reasons
86
+ def list_invalid_properties
87
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
88
+ invalid_properties = Array.new
89
+ if @amount.nil?
90
+ invalid_properties.push('invalid value for "amount", amount cannot be nil.')
91
+ end
92
+
93
+ pattern = Regexp.new(/^-?\d{0,12}(?:\.\d{0,2})?$/)
94
+ if @amount !~ pattern
95
+ invalid_properties.push("invalid value for \"amount\", must conform to the pattern #{pattern}.")
96
+ end
97
+
98
+ if @currency.nil?
99
+ invalid_properties.push('invalid value for "currency", currency cannot be nil.')
100
+ end
101
+
102
+ invalid_properties
103
+ end
104
+
105
+ # Check to see if the all the properties in the model are valid
106
+ # @return true if the model is valid
107
+ def valid?
108
+ warn '[DEPRECATED] the `valid?` method is obsolete'
109
+ return false if @amount.nil?
110
+ return false if @amount !~ Regexp.new(/^-?\d{0,12}(?:\.\d{0,2})?$/)
111
+ return false if @currency.nil?
112
+ true
113
+ end
114
+
115
+ # Custom attribute writer method with validation
116
+ # @param [Object] amount Value to be assigned
117
+ def amount=(amount)
118
+ if amount.nil?
119
+ fail ArgumentError, 'amount cannot be nil'
120
+ end
121
+
122
+ pattern = Regexp.new(/^-?\d{0,12}(?:\.\d{0,2})?$/)
123
+ if amount !~ pattern
124
+ fail ArgumentError, "invalid value for \"amount\", must conform to the pattern #{pattern}."
125
+ end
126
+
127
+ @amount = amount
128
+ end
129
+
130
+ # Custom attribute writer method with validation
131
+ # @param [Object] currency Value to be assigned
132
+ def currency=(currency)
133
+ if currency.nil?
134
+ fail ArgumentError, 'currency cannot be nil'
135
+ end
136
+
137
+ @currency = currency
138
+ end
139
+
140
+ # Checks equality by comparing each attribute.
141
+ # @param [Object] Object to be compared
142
+ def ==(o)
143
+ return true if self.equal?(o)
144
+ self.class == o.class &&
145
+ amount == o.amount &&
146
+ currency == o.currency
147
+ end
148
+
149
+ # @see the `==` method
150
+ # @param [Object] Object to be compared
151
+ def eql?(o)
152
+ self == o
153
+ end
154
+
155
+ # Calculates hash code according to all attributes.
156
+ # @return [Integer] Hash code
157
+ def hash
158
+ [amount, currency].hash
159
+ end
160
+
161
+ # Builds the object from hash
162
+ # @param [Hash] attributes Model attributes in the form of hash
163
+ # @return [Object] Returns the model itself
164
+ def self.build_from_hash(attributes)
165
+ return nil unless attributes.is_a?(Hash)
166
+ attributes = attributes.transform_keys(&:to_sym)
167
+ transformed_hash = {}
168
+ openapi_types.each_pair do |key, type|
169
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
170
+ transformed_hash["#{key}"] = nil
171
+ elsif type =~ /\AArray<(.*)>/i
172
+ # check to ensure the input is an array given that the attribute
173
+ # is documented as an array but the input is not
174
+ if attributes[attribute_map[key]].is_a?(Array)
175
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
176
+ end
177
+ elsif !attributes[attribute_map[key]].nil?
178
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
179
+ end
180
+ end
181
+ new(transformed_hash)
182
+ end
183
+
184
+ # Returns the object in the form of hash
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_hash
187
+ hash = {}
188
+ self.class.attribute_map.each_pair do |attr, param|
189
+ value = self.send(attr)
190
+ if value.nil?
191
+ is_nullable = self.class.openapi_nullable.include?(attr)
192
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
193
+ end
194
+
195
+ hash[param] = _to_hash(value)
196
+ end
197
+ hash
198
+ end
199
+
200
+ end
201
+
202
+ end
@@ -14,17 +14,16 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Pescheck
17
- # Custom JWT serializer that includes organization information in the token.
18
- class CustomTokenObtainPair < ApiModelBase
19
- attr_accessor :email
17
+ class DisabledDivision < ApiModelBase
18
+ attr_accessor :id
20
19
 
21
- attr_accessor :password
20
+ attr_accessor :name
22
21
 
23
22
  # Attribute mapping from ruby-style variable name to JSON key.
24
23
  def self.attribute_map
25
24
  {
26
- :'email' => :'email',
27
- :'password' => :'password'
25
+ :'id' => :'id',
26
+ :'name' => :'name'
28
27
  }
29
28
  end
30
29
 
@@ -41,8 +40,8 @@ module Pescheck
41
40
  # Attribute type mapping.
42
41
  def self.openapi_types
43
42
  {
44
- :'email' => :'String',
45
- :'password' => :'String'
43
+ :'id' => :'String',
44
+ :'name' => :'String'
46
45
  }
47
46
  end
48
47
 
@@ -56,28 +55,28 @@ module Pescheck
56
55
  # @param [Hash] attributes Model attributes in the form of hash
57
56
  def initialize(attributes = {})
58
57
  if (!attributes.is_a?(Hash))
59
- fail ArgumentError, "The input argument (attributes) must be a hash in `Pescheck::CustomTokenObtainPair` initialize method"
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pescheck::DisabledDivision` initialize method"
60
59
  end
61
60
 
62
61
  # check to see if the attribute exists and convert string to symbol for hash key
63
62
  acceptable_attribute_map = self.class.acceptable_attribute_map
64
63
  attributes = attributes.each_with_object({}) { |(k, v), h|
65
64
  if (!acceptable_attribute_map.key?(k.to_sym))
66
- fail ArgumentError, "`#{k}` is not a valid attribute in `Pescheck::CustomTokenObtainPair`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pescheck::DisabledDivision`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
67
66
  end
68
67
  h[k.to_sym] = v
69
68
  }
70
69
 
71
- if attributes.key?(:'email')
72
- self.email = attributes[:'email']
70
+ if attributes.key?(:'id')
71
+ self.id = attributes[:'id']
73
72
  else
74
- self.email = nil
73
+ self.id = nil
75
74
  end
76
75
 
77
- if attributes.key?(:'password')
78
- self.password = attributes[:'password']
76
+ if attributes.key?(:'name')
77
+ self.name = attributes[:'name']
79
78
  else
80
- self.password = nil
79
+ self.name = nil
81
80
  end
82
81
  end
83
82
 
@@ -86,12 +85,12 @@ module Pescheck
86
85
  def list_invalid_properties
87
86
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
88
87
  invalid_properties = Array.new
89
- if @email.nil?
90
- invalid_properties.push('invalid value for "email", email cannot be nil.')
88
+ if @id.nil?
89
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
91
90
  end
92
91
 
93
- if @password.nil?
94
- invalid_properties.push('invalid value for "password", password cannot be nil.')
92
+ if @name.nil?
93
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
95
94
  end
96
95
 
97
96
  invalid_properties
@@ -101,29 +100,29 @@ module Pescheck
101
100
  # @return true if the model is valid
102
101
  def valid?
103
102
  warn '[DEPRECATED] the `valid?` method is obsolete'
104
- return false if @email.nil?
105
- return false if @password.nil?
103
+ return false if @id.nil?
104
+ return false if @name.nil?
106
105
  true
107
106
  end
108
107
 
109
108
  # Custom attribute writer method with validation
110
- # @param [Object] email Value to be assigned
111
- def email=(email)
112
- if email.nil?
113
- fail ArgumentError, 'email cannot be nil'
109
+ # @param [Object] id Value to be assigned
110
+ def id=(id)
111
+ if id.nil?
112
+ fail ArgumentError, 'id cannot be nil'
114
113
  end
115
114
 
116
- @email = email
115
+ @id = id
117
116
  end
118
117
 
119
118
  # Custom attribute writer method with validation
120
- # @param [Object] password Value to be assigned
121
- def password=(password)
122
- if password.nil?
123
- fail ArgumentError, 'password cannot be nil'
119
+ # @param [Object] name Value to be assigned
120
+ def name=(name)
121
+ if name.nil?
122
+ fail ArgumentError, 'name cannot be nil'
124
123
  end
125
124
 
126
- @password = password
125
+ @name = name
127
126
  end
128
127
 
129
128
  # Checks equality by comparing each attribute.
@@ -131,8 +130,8 @@ module Pescheck
131
130
  def ==(o)
132
131
  return true if self.equal?(o)
133
132
  self.class == o.class &&
134
- email == o.email &&
135
- password == o.password
133
+ id == o.id &&
134
+ name == o.name
136
135
  end
137
136
 
138
137
  # @see the `==` method
@@ -144,7 +143,7 @@ module Pescheck
144
143
  # Calculates hash code according to all attributes.
145
144
  # @return [Integer] Hash code
146
145
  def hash
147
- [email, password].hash
146
+ [id, name].hash
148
147
  end
149
148
 
150
149
  # Builds the object from hash
@@ -22,7 +22,7 @@ module Pescheck
22
22
  # Client type (confidential recommended for server-to-server) * `confidential` - Confidential * `public` - Public
23
23
  attr_accessor :client_type
24
24
 
25
- # Grant type (client_credentials for API access) * `authorization-code` - Authorization code * `implicit` - Implicit * `password` - Resource owner password-based * `client-credentials` - Client credentials * `openid-hybrid` - OpenID connect hybrid
25
+ # Grant type (client_credentials for API access) * `authorization-code` - Authorization code * `urn:ietf:params:oauth:grant-type:device_code` - Device Code * `implicit` - Implicit * `password` - Resource owner password-based * `client-credentials` - Client credentials * `openid-hybrid` - OpenID connect hybrid
26
26
  attr_accessor :authorization_grant_type
27
27
 
28
28
  # Space-separated redirect URIs (optional for client_credentials)
@@ -158,7 +158,7 @@ module Pescheck
158
158
  return false if @name.to_s.length > 255
159
159
  client_type_validator = EnumAttributeValidator.new('String', ["confidential", "public"])
160
160
  return false unless client_type_validator.valid?(@client_type)
161
- authorization_grant_type_validator = EnumAttributeValidator.new('String', ["authorization-code", "implicit", "password", "client-credentials", "openid-hybrid"])
161
+ authorization_grant_type_validator = EnumAttributeValidator.new('String', ["authorization-code", "urn:ietf:params:oauth:grant-type:device_code", "implicit", "password", "client-credentials", "openid-hybrid"])
162
162
  return false unless authorization_grant_type_validator.valid?(@authorization_grant_type)
163
163
  true
164
164
  end
@@ -190,7 +190,7 @@ module Pescheck
190
190
  # Custom attribute writer method checking allowed values (enum).
191
191
  # @param [Object] authorization_grant_type Object to be assigned
192
192
  def authorization_grant_type=(authorization_grant_type)
193
- validator = EnumAttributeValidator.new('String', ["authorization-code", "implicit", "password", "client-credentials", "openid-hybrid"])
193
+ validator = EnumAttributeValidator.new('String', ["authorization-code", "urn:ietf:params:oauth:grant-type:device_code", "implicit", "password", "client-credentials", "openid-hybrid"])
194
194
  unless validator.valid?(authorization_grant_type)
195
195
  fail ArgumentError, "invalid value for \"authorization_grant_type\", must be one of #{validator.allowable_values}."
196
196
  end
@@ -24,37 +24,19 @@ module Pescheck
24
24
 
25
25
  attr_accessor :client_secret
26
26
 
27
- # * `confidential` - Confidential * `public` - Public
27
+ # * `confidential` - Confidential * `public` - Public Known values: confidential, public. New values may be added; handle unknown values.
28
28
  attr_accessor :client_type
29
29
 
30
- # * `authorization-code` - Authorization code * `implicit` - Implicit * `password` - Resource owner password-based * `client-credentials` - Client credentials * `openid-hybrid` - OpenID connect hybrid
30
+ # * `authorization-code` - Authorization code * `urn:ietf:params:oauth:grant-type:device_code` - Device Code * `implicit` - Implicit * `password` - Resource owner password-based * `client-credentials` - Client credentials * `openid-hybrid` - OpenID connect hybrid Known values: authorization-code, urn:ietf:params:oauth:grant-type:device_code, implicit, password, client-credentials, openid-hybrid. New values may be added; handle unknown values.
31
31
  attr_accessor :authorization_grant_type
32
32
 
33
- attr_accessor :created
33
+ attr_accessor :organisation
34
34
 
35
- attr_accessor :updated
35
+ attr_accessor :organisation_id
36
36
 
37
- class EnumAttributeValidator
38
- attr_reader :datatype
39
- attr_reader :allowable_values
40
-
41
- def initialize(datatype, allowable_values)
42
- @allowable_values = allowable_values.map do |value|
43
- case datatype.to_s
44
- when /Integer/i
45
- value.to_i
46
- when /Float/i
47
- value.to_f
48
- else
49
- value
50
- end
51
- end
52
- end
37
+ attr_accessor :created
53
38
 
54
- def valid?(value)
55
- !value || allowable_values.include?(value)
56
- end
57
- end
39
+ attr_accessor :updated
58
40
 
59
41
  # Attribute mapping from ruby-style variable name to JSON key.
60
42
  def self.attribute_map
@@ -65,6 +47,8 @@ module Pescheck
65
47
  :'client_secret' => :'client_secret',
66
48
  :'client_type' => :'client_type',
67
49
  :'authorization_grant_type' => :'authorization_grant_type',
50
+ :'organisation' => :'organisation',
51
+ :'organisation_id' => :'organisation_id',
68
52
  :'created' => :'created',
69
53
  :'updated' => :'updated'
70
54
  }
@@ -89,6 +73,8 @@ module Pescheck
89
73
  :'client_secret' => :'String',
90
74
  :'client_type' => :'String',
91
75
  :'authorization_grant_type' => :'String',
76
+ :'organisation' => :'String',
77
+ :'organisation_id' => :'String',
92
78
  :'created' => :'Time',
93
79
  :'updated' => :'Time'
94
80
  }
@@ -148,6 +134,18 @@ module Pescheck
148
134
  self.authorization_grant_type = nil
149
135
  end
150
136
 
137
+ if attributes.key?(:'organisation')
138
+ self.organisation = attributes[:'organisation']
139
+ else
140
+ self.organisation = nil
141
+ end
142
+
143
+ if attributes.key?(:'organisation_id')
144
+ self.organisation_id = attributes[:'organisation_id']
145
+ else
146
+ self.organisation_id = nil
147
+ end
148
+
151
149
  if attributes.key?(:'created')
152
150
  self.created = attributes[:'created']
153
151
  else
@@ -174,8 +172,8 @@ module Pescheck
174
172
  invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.')
175
173
  end
176
174
 
177
- if !@client_id.nil? && @client_id.to_s.length > 100
178
- invalid_properties.push('invalid value for "client_id", the character length must be smaller than or equal to 100.')
175
+ if !@client_id.nil? && @client_id.to_s.length > 255
176
+ invalid_properties.push('invalid value for "client_id", the character length must be smaller than or equal to 255.')
179
177
  end
180
178
 
181
179
  if @client_secret.nil?
@@ -190,6 +188,14 @@ module Pescheck
190
188
  invalid_properties.push('invalid value for "authorization_grant_type", authorization_grant_type cannot be nil.')
191
189
  end
192
190
 
191
+ if @organisation.nil?
192
+ invalid_properties.push('invalid value for "organisation", organisation cannot be nil.')
193
+ end
194
+
195
+ if @organisation_id.nil?
196
+ invalid_properties.push('invalid value for "organisation_id", organisation_id cannot be nil.')
197
+ end
198
+
193
199
  if @created.nil?
194
200
  invalid_properties.push('invalid value for "created", created cannot be nil.')
195
201
  end
@@ -207,14 +213,12 @@ module Pescheck
207
213
  warn '[DEPRECATED] the `valid?` method is obsolete'
208
214
  return false if @id.nil?
209
215
  return false if !@name.nil? && @name.to_s.length > 255
210
- return false if !@client_id.nil? && @client_id.to_s.length > 100
216
+ return false if !@client_id.nil? && @client_id.to_s.length > 255
211
217
  return false if @client_secret.nil?
212
218
  return false if @client_type.nil?
213
- client_type_validator = EnumAttributeValidator.new('String', ["confidential", "public"])
214
- return false unless client_type_validator.valid?(@client_type)
215
219
  return false if @authorization_grant_type.nil?
216
- authorization_grant_type_validator = EnumAttributeValidator.new('String', ["authorization-code", "implicit", "password", "client-credentials", "openid-hybrid"])
217
- return false unless authorization_grant_type_validator.valid?(@authorization_grant_type)
220
+ return false if @organisation.nil?
221
+ return false if @organisation_id.nil?
218
222
  return false if @created.nil?
219
223
  return false if @updated.nil?
220
224
  true
@@ -251,8 +255,8 @@ module Pescheck
251
255
  fail ArgumentError, 'client_id cannot be nil'
252
256
  end
253
257
 
254
- if client_id.to_s.length > 100
255
- fail ArgumentError, 'invalid value for "client_id", the character length must be smaller than or equal to 100.'
258
+ if client_id.to_s.length > 255
259
+ fail ArgumentError, 'invalid value for "client_id", the character length must be smaller than or equal to 255.'
256
260
  end
257
261
 
258
262
  @client_id = client_id
@@ -268,26 +272,46 @@ module Pescheck
268
272
  @client_secret = client_secret
269
273
  end
270
274
 
271
- # Custom attribute writer method checking allowed values (enum).
272
- # @param [Object] client_type Object to be assigned
275
+ # Custom attribute writer method with validation
276
+ # @param [Object] client_type Value to be assigned
273
277
  def client_type=(client_type)
274
- validator = EnumAttributeValidator.new('String', ["confidential", "public"])
275
- unless validator.valid?(client_type)
276
- fail ArgumentError, "invalid value for \"client_type\", must be one of #{validator.allowable_values}."
278
+ if client_type.nil?
279
+ fail ArgumentError, 'client_type cannot be nil'
277
280
  end
281
+
278
282
  @client_type = client_type
279
283
  end
280
284
 
281
- # Custom attribute writer method checking allowed values (enum).
282
- # @param [Object] authorization_grant_type Object to be assigned
285
+ # Custom attribute writer method with validation
286
+ # @param [Object] authorization_grant_type Value to be assigned
283
287
  def authorization_grant_type=(authorization_grant_type)
284
- validator = EnumAttributeValidator.new('String', ["authorization-code", "implicit", "password", "client-credentials", "openid-hybrid"])
285
- unless validator.valid?(authorization_grant_type)
286
- fail ArgumentError, "invalid value for \"authorization_grant_type\", must be one of #{validator.allowable_values}."
288
+ if authorization_grant_type.nil?
289
+ fail ArgumentError, 'authorization_grant_type cannot be nil'
287
290
  end
291
+
288
292
  @authorization_grant_type = authorization_grant_type
289
293
  end
290
294
 
295
+ # Custom attribute writer method with validation
296
+ # @param [Object] organisation Value to be assigned
297
+ def organisation=(organisation)
298
+ if organisation.nil?
299
+ fail ArgumentError, 'organisation cannot be nil'
300
+ end
301
+
302
+ @organisation = organisation
303
+ end
304
+
305
+ # Custom attribute writer method with validation
306
+ # @param [Object] organisation_id Value to be assigned
307
+ def organisation_id=(organisation_id)
308
+ if organisation_id.nil?
309
+ fail ArgumentError, 'organisation_id cannot be nil'
310
+ end
311
+
312
+ @organisation_id = organisation_id
313
+ end
314
+
291
315
  # Custom attribute writer method with validation
292
316
  # @param [Object] created Value to be assigned
293
317
  def created=(created)
@@ -319,6 +343,8 @@ module Pescheck
319
343
  client_secret == o.client_secret &&
320
344
  client_type == o.client_type &&
321
345
  authorization_grant_type == o.authorization_grant_type &&
346
+ organisation == o.organisation &&
347
+ organisation_id == o.organisation_id &&
322
348
  created == o.created &&
323
349
  updated == o.updated
324
350
  end
@@ -332,7 +358,7 @@ module Pescheck
332
358
  # Calculates hash code according to all attributes.
333
359
  # @return [Integer] Hash code
334
360
  def hash
335
- [id, name, client_id, client_secret, client_type, authorization_grant_type, created, updated].hash
361
+ [id, name, client_id, client_secret, client_type, authorization_grant_type, organisation, organisation_id, created, updated].hash
336
362
  end
337
363
 
338
364
  # Builds the object from hash