pescheck-client 0.4.3 → 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 (89) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +52 -45
  3. data/docs/AddOnsApi.md +305 -0
  4. data/docs/AddonPrice.md +20 -0
  5. data/docs/AuthenticationApi.md +0 -70
  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 +3 -1
  25. data/docs/V2ScreeningDetail.md +3 -1
  26. data/docs/{V2ScreeningDetailProfile.md → V2ScreeningDetailOrganisation.md} +2 -2
  27. data/docs/V2ScreeningListItem.md +3 -1
  28. data/docs/V2ScreeningNoteInput.md +1 -1
  29. data/docs/WebhooksApi.md +1 -1
  30. data/lib/pescheck-client/api/add_ons_api.rb +305 -0
  31. data/lib/pescheck-client/api/authentication_api.rb +0 -66
  32. data/lib/pescheck-client/api/profiles_api.rb +1 -1
  33. data/lib/pescheck-client/api/screenings_api.rb +66 -0
  34. data/lib/pescheck-client/api/webhooks_api.rb +2 -2
  35. data/lib/pescheck-client/configuration.rb +8 -0
  36. data/lib/pescheck-client/models/{custom_token_obtain_pair.rb → addon_price.rb} +46 -45
  37. data/lib/pescheck-client/models/disabled_division.rb +190 -0
  38. data/lib/pescheck-client/models/o_auth_application.rb +3 -3
  39. data/lib/pescheck-client/models/o_auth_application_response.rb +70 -44
  40. data/lib/pescheck-client/models/organisation_addon.rb +339 -0
  41. data/lib/pescheck-client/models/organisation_addon_update.rb +165 -0
  42. data/lib/pescheck-client/models/organisation_addon_update_result.rb +368 -0
  43. data/lib/pescheck-client/models/patched_organisation_addon_update.rb +148 -0
  44. data/lib/pescheck-client/models/v2_candidate.rb +1 -35
  45. data/lib/pescheck-client/models/v2_check_field.rb +2 -2
  46. data/lib/pescheck-client/models/v2_document.rb +6 -30
  47. data/lib/pescheck-client/models/v2_profile_check.rb +3 -3
  48. data/lib/pescheck-client/models/v2_profile_check_entry.rb +6 -30
  49. data/lib/pescheck-client/models/v2_profile_detail.rb +55 -1
  50. data/lib/pescheck-client/models/v2_profile_update_check.rb +3 -3
  51. data/lib/pescheck-client/models/v2_screening_check.rb +3 -3
  52. data/lib/pescheck-client/models/v2_screening_check_entry.rb +6 -30
  53. data/lib/pescheck-client/models/v2_screening_check_list_item.rb +6 -30
  54. data/lib/pescheck-client/models/v2_screening_create.rb +14 -4
  55. data/lib/pescheck-client/models/v2_screening_detail.rb +14 -2
  56. data/lib/pescheck-client/models/{v2_screening_detail_profile.rb → v2_screening_detail_organisation.rb} +4 -3
  57. data/lib/pescheck-client/models/v2_screening_list_item.rb +14 -2
  58. data/lib/pescheck-client/models/v2_screening_note_input.rb +3 -3
  59. data/lib/pescheck-client/models/webhook_response.rb +5 -5
  60. data/lib/pescheck-client/version.rb +1 -1
  61. data/lib/pescheck-client.rb +8 -2
  62. data/spec/api/add_ons_api_spec.rb +84 -0
  63. data/spec/api/authentication_api_spec.rb +1 -12
  64. data/spec/api/screenings_api_spec.rb +13 -0
  65. data/spec/api/webhooks_api_spec.rb +1 -1
  66. data/spec/models/{custom_token_obtain_pair_spec.rb → addon_price_spec.rb} +8 -8
  67. data/spec/models/disabled_division_spec.rb +42 -0
  68. data/spec/models/o_auth_application_response_spec.rb +12 -8
  69. data/spec/models/o_auth_application_spec.rb +1 -1
  70. data/spec/models/organisation_addon_spec.rb +78 -0
  71. data/spec/models/organisation_addon_update_result_spec.rb +84 -0
  72. data/spec/models/organisation_addon_update_spec.rb +36 -0
  73. data/spec/models/patched_organisation_addon_update_spec.rb +36 -0
  74. data/spec/models/v2_candidate_spec.rb +0 -4
  75. data/spec/models/v2_document_spec.rb +0 -4
  76. data/spec/models/v2_profile_check_entry_spec.rb +0 -4
  77. data/spec/models/v2_profile_check_spec.rb +1 -1
  78. data/spec/models/v2_profile_detail_spec.rb +12 -0
  79. data/spec/models/v2_profile_update_check_spec.rb +1 -1
  80. data/spec/models/v2_screening_check_entry_spec.rb +0 -4
  81. data/spec/models/v2_screening_check_list_item_spec.rb +0 -4
  82. data/spec/models/v2_screening_check_spec.rb +1 -1
  83. data/spec/models/v2_screening_create_spec.rb +12 -0
  84. data/spec/models/{v2_screening_detail_profile_spec.rb → v2_screening_detail_organisation_spec.rb} +6 -6
  85. data/spec/models/v2_screening_detail_spec.rb +12 -0
  86. data/spec/models/v2_screening_list_item_spec.rb +6 -0
  87. data/spec/models/v2_screening_note_input_spec.rb +1 -1
  88. metadata +65 -41
  89. data/docs/CustomTokenObtainPair.md +0 -22
@@ -14,21 +14,17 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Pescheck
17
- # Custom JWT serializer that scopes the token to one organization. The organization comes from the optional ``organization_id`` field, or from the user's single organization when the field is absent. Users with access to multiple organizations must pass ``organization_id`` explicitly; the token is never scoped implicitly (e.g. via the last viewed organization, which is mutable web-UI state).
18
- class CustomTokenObtainPair < ApiModelBase
19
- # Organization or division ID to scope the token to. Required when your account has access to more than one organization.
20
- attr_accessor :organization_id
17
+ class AddonPrice < ApiModelBase
18
+ attr_accessor :amount
21
19
 
22
- attr_accessor :email
23
-
24
- attr_accessor :password
20
+ # ISO 4217 code, e.g. EUR.
21
+ attr_accessor :currency
25
22
 
26
23
  # Attribute mapping from ruby-style variable name to JSON key.
27
24
  def self.attribute_map
28
25
  {
29
- :'organization_id' => :'organization_id',
30
- :'email' => :'email',
31
- :'password' => :'password'
26
+ :'amount' => :'amount',
27
+ :'currency' => :'currency'
32
28
  }
33
29
  end
34
30
 
@@ -45,9 +41,8 @@ module Pescheck
45
41
  # Attribute type mapping.
46
42
  def self.openapi_types
47
43
  {
48
- :'organization_id' => :'String',
49
- :'email' => :'String',
50
- :'password' => :'String'
44
+ :'amount' => :'String',
45
+ :'currency' => :'String'
51
46
  }
52
47
  end
53
48
 
@@ -61,32 +56,28 @@ module Pescheck
61
56
  # @param [Hash] attributes Model attributes in the form of hash
62
57
  def initialize(attributes = {})
63
58
  if (!attributes.is_a?(Hash))
64
- fail ArgumentError, "The input argument (attributes) must be a hash in `Pescheck::CustomTokenObtainPair` initialize method"
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pescheck::AddonPrice` initialize method"
65
60
  end
66
61
 
67
62
  # check to see if the attribute exists and convert string to symbol for hash key
68
63
  acceptable_attribute_map = self.class.acceptable_attribute_map
69
64
  attributes = attributes.each_with_object({}) { |(k, v), h|
70
65
  if (!acceptable_attribute_map.key?(k.to_sym))
71
- 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
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
72
67
  end
73
68
  h[k.to_sym] = v
74
69
  }
75
70
 
76
- if attributes.key?(:'organization_id')
77
- self.organization_id = attributes[:'organization_id']
78
- end
79
-
80
- if attributes.key?(:'email')
81
- self.email = attributes[:'email']
71
+ if attributes.key?(:'amount')
72
+ self.amount = attributes[:'amount']
82
73
  else
83
- self.email = nil
74
+ self.amount = nil
84
75
  end
85
76
 
86
- if attributes.key?(:'password')
87
- self.password = attributes[:'password']
77
+ if attributes.key?(:'currency')
78
+ self.currency = attributes[:'currency']
88
79
  else
89
- self.password = nil
80
+ self.currency = nil
90
81
  end
91
82
  end
92
83
 
@@ -95,12 +86,17 @@ module Pescheck
95
86
  def list_invalid_properties
96
87
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
97
88
  invalid_properties = Array.new
98
- if @email.nil?
99
- invalid_properties.push('invalid value for "email", email cannot be nil.')
89
+ if @amount.nil?
90
+ invalid_properties.push('invalid value for "amount", amount cannot be nil.')
100
91
  end
101
92
 
102
- if @password.nil?
103
- invalid_properties.push('invalid value for "password", password cannot be nil.')
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.')
104
100
  end
105
101
 
106
102
  invalid_properties
@@ -110,29 +106,35 @@ module Pescheck
110
106
  # @return true if the model is valid
111
107
  def valid?
112
108
  warn '[DEPRECATED] the `valid?` method is obsolete'
113
- return false if @email.nil?
114
- return false if @password.nil?
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?
115
112
  true
116
113
  end
117
114
 
118
115
  # Custom attribute writer method with validation
119
- # @param [Object] email Value to be assigned
120
- def email=(email)
121
- if email.nil?
122
- fail ArgumentError, 'email cannot be nil'
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}."
123
125
  end
124
126
 
125
- @email = email
127
+ @amount = amount
126
128
  end
127
129
 
128
130
  # Custom attribute writer method with validation
129
- # @param [Object] password Value to be assigned
130
- def password=(password)
131
- if password.nil?
132
- fail ArgumentError, 'password cannot be nil'
131
+ # @param [Object] currency Value to be assigned
132
+ def currency=(currency)
133
+ if currency.nil?
134
+ fail ArgumentError, 'currency cannot be nil'
133
135
  end
134
136
 
135
- @password = password
137
+ @currency = currency
136
138
  end
137
139
 
138
140
  # Checks equality by comparing each attribute.
@@ -140,9 +142,8 @@ module Pescheck
140
142
  def ==(o)
141
143
  return true if self.equal?(o)
142
144
  self.class == o.class &&
143
- organization_id == o.organization_id &&
144
- email == o.email &&
145
- password == o.password
145
+ amount == o.amount &&
146
+ currency == o.currency
146
147
  end
147
148
 
148
149
  # @see the `==` method
@@ -154,7 +155,7 @@ module Pescheck
154
155
  # Calculates hash code according to all attributes.
155
156
  # @return [Integer] Hash code
156
157
  def hash
157
- [organization_id, email, password].hash
158
+ [amount, currency].hash
158
159
  end
159
160
 
160
161
  # Builds the object from hash
@@ -0,0 +1,190 @@
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 DisabledDivision < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :name
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'id' => :'id',
26
+ :'name' => :'name'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'id' => :'String',
44
+ :'name' => :'String'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pescheck::DisabledDivision` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
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
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'id')
71
+ self.id = attributes[:'id']
72
+ else
73
+ self.id = nil
74
+ end
75
+
76
+ if attributes.key?(:'name')
77
+ self.name = attributes[:'name']
78
+ else
79
+ self.name = nil
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
87
+ invalid_properties = Array.new
88
+ if @id.nil?
89
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
90
+ end
91
+
92
+ if @name.nil?
93
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
94
+ end
95
+
96
+ invalid_properties
97
+ end
98
+
99
+ # Check to see if the all the properties in the model are valid
100
+ # @return true if the model is valid
101
+ def valid?
102
+ warn '[DEPRECATED] the `valid?` method is obsolete'
103
+ return false if @id.nil?
104
+ return false if @name.nil?
105
+ true
106
+ end
107
+
108
+ # Custom attribute writer method with validation
109
+ # @param [Object] id Value to be assigned
110
+ def id=(id)
111
+ if id.nil?
112
+ fail ArgumentError, 'id cannot be nil'
113
+ end
114
+
115
+ @id = id
116
+ end
117
+
118
+ # Custom attribute writer method with validation
119
+ # @param [Object] name Value to be assigned
120
+ def name=(name)
121
+ if name.nil?
122
+ fail ArgumentError, 'name cannot be nil'
123
+ end
124
+
125
+ @name = name
126
+ end
127
+
128
+ # Checks equality by comparing each attribute.
129
+ # @param [Object] Object to be compared
130
+ def ==(o)
131
+ return true if self.equal?(o)
132
+ self.class == o.class &&
133
+ id == o.id &&
134
+ name == o.name
135
+ end
136
+
137
+ # @see the `==` method
138
+ # @param [Object] Object to be compared
139
+ def eql?(o)
140
+ self == o
141
+ end
142
+
143
+ # Calculates hash code according to all attributes.
144
+ # @return [Integer] Hash code
145
+ def hash
146
+ [id, name].hash
147
+ end
148
+
149
+ # Builds the object from hash
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ # @return [Object] Returns the model itself
152
+ def self.build_from_hash(attributes)
153
+ return nil unless attributes.is_a?(Hash)
154
+ attributes = attributes.transform_keys(&:to_sym)
155
+ transformed_hash = {}
156
+ openapi_types.each_pair do |key, type|
157
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
158
+ transformed_hash["#{key}"] = nil
159
+ elsif type =~ /\AArray<(.*)>/i
160
+ # check to ensure the input is an array given that the attribute
161
+ # is documented as an array but the input is not
162
+ if attributes[attribute_map[key]].is_a?(Array)
163
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
164
+ end
165
+ elsif !attributes[attribute_map[key]].nil?
166
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
167
+ end
168
+ end
169
+ new(transformed_hash)
170
+ end
171
+
172
+ # Returns the object in the form of hash
173
+ # @return [Hash] Returns the object in the form of hash
174
+ def to_hash
175
+ hash = {}
176
+ self.class.attribute_map.each_pair do |attr, param|
177
+ value = self.send(attr)
178
+ if value.nil?
179
+ is_nullable = self.class.openapi_nullable.include?(attr)
180
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
181
+ end
182
+
183
+ hash[param] = _to_hash(value)
184
+ end
185
+ hash
186
+ end
187
+
188
+ end
189
+
190
+ end
@@ -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