license_manager 0.3.0 → 0.3.2

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.
@@ -19,6 +19,69 @@ module LicenseManager
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
+ # Start connecting a Slack channel
23
+ # Returns the URL of Slack's consent screen, where the user picks the channel getting the product's notifications. Slack then redirects to the app's integrations page. Doesn't accept tokens: only API keys and sessions. **Required role permission**: `integration:create` when called with a session, granted by the member's role. API keys aren't limited by roles.
24
+ # @param product_id [String]
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [SlackAuthorize]
27
+ def authorize_slack(product_id, opts = {})
28
+ data, _status_code, _headers = authorize_slack_with_http_info(product_id, opts)
29
+ data
30
+ end
31
+
32
+ # Start connecting a Slack channel
33
+ # Returns the URL of Slack's consent screen, where the user picks the channel getting the product's notifications. Slack then redirects to the app's integrations page. Doesn't accept tokens: only API keys and sessions. **Required role permission**: `integration:create` when called with a session, granted by the member's role. API keys aren't limited by roles.
34
+ # @param product_id [String]
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(SlackAuthorize, Integer, Hash)>] SlackAuthorize data, response status code and response headers
37
+ def authorize_slack_with_http_info(product_id, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: IntegrationsApi.authorize_slack ...'
40
+ end
41
+ # verify the required parameter 'product_id' is set
42
+ if @api_client.config.client_side_validation && product_id.nil?
43
+ fail ArgumentError, "Missing the required parameter 'product_id' when calling IntegrationsApi.authorize_slack"
44
+ end
45
+ # resource path
46
+ local_var_path = '/v1/products/{productId}/integrations/slack/authorize'.sub('{productId}', CGI.escape(product_id.to_s))
47
+
48
+ # query parameters
49
+ query_params = opts[:query_params] || {}
50
+
51
+ # header parameters
52
+ header_params = opts[:header_params] || {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
55
+
56
+ # form parameters
57
+ form_params = opts[:form_params] || {}
58
+
59
+ # http body (model)
60
+ post_body = opts[:debug_body]
61
+
62
+ # return_type
63
+ return_type = opts[:debug_return_type] || 'SlackAuthorize'
64
+
65
+ # auth_names
66
+ auth_names = opts[:debug_auth_names] || ['apiKey']
67
+
68
+ new_options = opts.merge(
69
+ :operation => :"IntegrationsApi.authorize_slack",
70
+ :header_params => header_params,
71
+ :query_params => query_params,
72
+ :form_params => form_params,
73
+ :body => post_body,
74
+ :auth_names => auth_names,
75
+ :return_type => return_type
76
+ )
77
+
78
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
79
+ if @api_client.config.debugging
80
+ @api_client.config.logger.debug "API called: IntegrationsApi#authorize_slack\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
81
+ end
82
+ return data, status_code, headers
83
+ end
84
+
22
85
  # Check an integration
23
86
  # Checks right away, as done every day, that the API key still works and can manage the webhook endpoint, which is pointed at the server's webhook URL again (or created again when it was deleted). Updates the status. Doesn't accept tokens: only API keys and sessions. **Required role permission**: `integration:update` when called with a session, granted by the member's role. API keys aren't limited by roles.
24
87
  # @param id [String]
@@ -230,6 +293,69 @@ module LicenseManager
230
293
  return data, status_code, headers
231
294
  end
232
295
 
296
+ # Remove a Slack connection
297
+ # Stops posting to the channel and revokes the installation's token in Slack. Doesn't accept tokens: only API keys and sessions. **Required role permission**: `integration:delete` when called with a session, granted by the member's role. API keys aren't limited by roles.
298
+ # @param id [String]
299
+ # @param [Hash] opts the optional parameters
300
+ # @return [nil]
301
+ def delete_slack_connection(id, opts = {})
302
+ delete_slack_connection_with_http_info(id, opts)
303
+ nil
304
+ end
305
+
306
+ # Remove a Slack connection
307
+ # Stops posting to the channel and revokes the installation&#39;s token in Slack. Doesn&#39;t accept tokens: only API keys and sessions. **Required role permission**: &#x60;integration:delete&#x60; when called with a session, granted by the member&#39;s role. API keys aren&#39;t limited by roles.
308
+ # @param id [String]
309
+ # @param [Hash] opts the optional parameters
310
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
311
+ def delete_slack_connection_with_http_info(id, opts = {})
312
+ if @api_client.config.debugging
313
+ @api_client.config.logger.debug 'Calling API: IntegrationsApi.delete_slack_connection ...'
314
+ end
315
+ # verify the required parameter 'id' is set
316
+ if @api_client.config.client_side_validation && id.nil?
317
+ fail ArgumentError, "Missing the required parameter 'id' when calling IntegrationsApi.delete_slack_connection"
318
+ end
319
+ # resource path
320
+ local_var_path = '/v1/slack-connections/{id}'.sub('{id}', CGI.escape(id.to_s))
321
+
322
+ # query parameters
323
+ query_params = opts[:query_params] || {}
324
+
325
+ # header parameters
326
+ header_params = opts[:header_params] || {}
327
+ # HTTP header 'Accept' (if needed)
328
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
329
+
330
+ # form parameters
331
+ form_params = opts[:form_params] || {}
332
+
333
+ # http body (model)
334
+ post_body = opts[:debug_body]
335
+
336
+ # return_type
337
+ return_type = opts[:debug_return_type]
338
+
339
+ # auth_names
340
+ auth_names = opts[:debug_auth_names] || ['apiKey']
341
+
342
+ new_options = opts.merge(
343
+ :operation => :"IntegrationsApi.delete_slack_connection",
344
+ :header_params => header_params,
345
+ :query_params => query_params,
346
+ :form_params => form_params,
347
+ :body => post_body,
348
+ :auth_names => auth_names,
349
+ :return_type => return_type
350
+ )
351
+
352
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
353
+ if @api_client.config.debugging
354
+ @api_client.config.logger.debug "API called: IntegrationsApi#delete_slack_connection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
355
+ end
356
+ return data, status_code, headers
357
+ end
358
+
233
359
  # Delete a mapping
234
360
  # Paying the price no longer creates licenses. The licenses it created stay. Doesn't accept tokens: only API keys and sessions. **Required role permission**: `integration:update` when called with a session, granted by the member's role. API keys aren't limited by roles.
235
361
  # @param id [String]
@@ -356,6 +482,69 @@ module LicenseManager
356
482
  return data, status_code, headers
357
483
  end
358
484
 
485
+ # Get the Slack integration of a product
486
+ # Slack channels getting notifications about the product's licenses: purchases, renewals, failed payments and cancellations. Doesn't accept tokens: only API keys and sessions.
487
+ # @param product_id [String]
488
+ # @param [Hash] opts the optional parameters
489
+ # @return [SlackIntegration]
490
+ def get_slack_integration(product_id, opts = {})
491
+ data, _status_code, _headers = get_slack_integration_with_http_info(product_id, opts)
492
+ data
493
+ end
494
+
495
+ # Get the Slack integration of a product
496
+ # Slack channels getting notifications about the product&#39;s licenses: purchases, renewals, failed payments and cancellations. Doesn&#39;t accept tokens: only API keys and sessions.
497
+ # @param product_id [String]
498
+ # @param [Hash] opts the optional parameters
499
+ # @return [Array<(SlackIntegration, Integer, Hash)>] SlackIntegration data, response status code and response headers
500
+ def get_slack_integration_with_http_info(product_id, opts = {})
501
+ if @api_client.config.debugging
502
+ @api_client.config.logger.debug 'Calling API: IntegrationsApi.get_slack_integration ...'
503
+ end
504
+ # verify the required parameter 'product_id' is set
505
+ if @api_client.config.client_side_validation && product_id.nil?
506
+ fail ArgumentError, "Missing the required parameter 'product_id' when calling IntegrationsApi.get_slack_integration"
507
+ end
508
+ # resource path
509
+ local_var_path = '/v1/products/{productId}/integrations/slack'.sub('{productId}', CGI.escape(product_id.to_s))
510
+
511
+ # query parameters
512
+ query_params = opts[:query_params] || {}
513
+
514
+ # header parameters
515
+ header_params = opts[:header_params] || {}
516
+ # HTTP header 'Accept' (if needed)
517
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
518
+
519
+ # form parameters
520
+ form_params = opts[:form_params] || {}
521
+
522
+ # http body (model)
523
+ post_body = opts[:debug_body]
524
+
525
+ # return_type
526
+ return_type = opts[:debug_return_type] || 'SlackIntegration'
527
+
528
+ # auth_names
529
+ auth_names = opts[:debug_auth_names] || ['apiKey']
530
+
531
+ new_options = opts.merge(
532
+ :operation => :"IntegrationsApi.get_slack_integration",
533
+ :header_params => header_params,
534
+ :query_params => query_params,
535
+ :form_params => form_params,
536
+ :body => post_body,
537
+ :auth_names => auth_names,
538
+ :return_type => return_type
539
+ )
540
+
541
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
542
+ if @api_client.config.debugging
543
+ @api_client.config.logger.debug "API called: IntegrationsApi#get_slack_integration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
544
+ end
545
+ return data, status_code, headers
546
+ end
547
+
359
548
  # Get the Stripe integration of a product
360
549
  # The organization connects one Stripe account for its live products, and one in test mode for its test products. Its mappings tell which Stripe prices create licenses of the product. Doesn't accept tokens: only API keys and sessions.
361
550
  # @param product_id [String]
@@ -482,6 +671,69 @@ module LicenseManager
482
671
  return data, status_code, headers
483
672
  end
484
673
 
674
+ # Send a test message to a Slack channel
675
+ # Posts a message to the channel, to check it gets the notifications. Marks the connection `revoked` when Slack says it won't work again. Doesn't accept tokens: only API keys and sessions. **Required role permission**: `integration:update` when called with a session, granted by the member's role. API keys aren't limited by roles.
676
+ # @param id [String]
677
+ # @param [Hash] opts the optional parameters
678
+ # @return [SlackConnection]
679
+ def test_slack_connection(id, opts = {})
680
+ data, _status_code, _headers = test_slack_connection_with_http_info(id, opts)
681
+ data
682
+ end
683
+
684
+ # Send a test message to a Slack channel
685
+ # Posts a message to the channel, to check it gets the notifications. Marks the connection &#x60;revoked&#x60; when Slack says it won&#39;t work again. Doesn&#39;t accept tokens: only API keys and sessions. **Required role permission**: &#x60;integration:update&#x60; when called with a session, granted by the member&#39;s role. API keys aren&#39;t limited by roles.
686
+ # @param id [String]
687
+ # @param [Hash] opts the optional parameters
688
+ # @return [Array<(SlackConnection, Integer, Hash)>] SlackConnection data, response status code and response headers
689
+ def test_slack_connection_with_http_info(id, opts = {})
690
+ if @api_client.config.debugging
691
+ @api_client.config.logger.debug 'Calling API: IntegrationsApi.test_slack_connection ...'
692
+ end
693
+ # verify the required parameter 'id' is set
694
+ if @api_client.config.client_side_validation && id.nil?
695
+ fail ArgumentError, "Missing the required parameter 'id' when calling IntegrationsApi.test_slack_connection"
696
+ end
697
+ # resource path
698
+ local_var_path = '/v1/slack-connections/{id}/test'.sub('{id}', CGI.escape(id.to_s))
699
+
700
+ # query parameters
701
+ query_params = opts[:query_params] || {}
702
+
703
+ # header parameters
704
+ header_params = opts[:header_params] || {}
705
+ # HTTP header 'Accept' (if needed)
706
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
707
+
708
+ # form parameters
709
+ form_params = opts[:form_params] || {}
710
+
711
+ # http body (model)
712
+ post_body = opts[:debug_body]
713
+
714
+ # return_type
715
+ return_type = opts[:debug_return_type] || 'SlackConnection'
716
+
717
+ # auth_names
718
+ auth_names = opts[:debug_auth_names] || ['apiKey']
719
+
720
+ new_options = opts.merge(
721
+ :operation => :"IntegrationsApi.test_slack_connection",
722
+ :header_params => header_params,
723
+ :query_params => query_params,
724
+ :form_params => form_params,
725
+ :body => post_body,
726
+ :auth_names => auth_names,
727
+ :return_type => return_type
728
+ )
729
+
730
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
731
+ if @api_client.config.debugging
732
+ @api_client.config.logger.debug "API called: IntegrationsApi#test_slack_connection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
733
+ end
734
+ return data, status_code, headers
735
+ end
736
+
485
737
  # Update an integration
486
738
  # Changes the settings of the integration, for every product of its mode. Doesn't accept tokens: only API keys and sessions. **Required role permission**: `integration:update` when called with a session, granted by the member's role. API keys aren't limited by roles.
487
739
  # @param id [String]
@@ -556,6 +808,80 @@ module LicenseManager
556
808
  return data, status_code, headers
557
809
  end
558
810
 
811
+ # Update a Slack connection
812
+ # Changes the notifications the channel gets. Doesn't accept tokens: only API keys and sessions. **Required role permission**: `integration:update` when called with a session, granted by the member's role. API keys aren't limited by roles.
813
+ # @param id [String]
814
+ # @param update_slack_connection [UpdateSlackConnection]
815
+ # @param [Hash] opts the optional parameters
816
+ # @return [SlackConnection]
817
+ def update_slack_connection(id, update_slack_connection, opts = {})
818
+ data, _status_code, _headers = update_slack_connection_with_http_info(id, update_slack_connection, opts)
819
+ data
820
+ end
821
+
822
+ # Update a Slack connection
823
+ # Changes the notifications the channel gets. Doesn&#39;t accept tokens: only API keys and sessions. **Required role permission**: &#x60;integration:update&#x60; when called with a session, granted by the member&#39;s role. API keys aren&#39;t limited by roles.
824
+ # @param id [String]
825
+ # @param update_slack_connection [UpdateSlackConnection]
826
+ # @param [Hash] opts the optional parameters
827
+ # @return [Array<(SlackConnection, Integer, Hash)>] SlackConnection data, response status code and response headers
828
+ def update_slack_connection_with_http_info(id, update_slack_connection, opts = {})
829
+ if @api_client.config.debugging
830
+ @api_client.config.logger.debug 'Calling API: IntegrationsApi.update_slack_connection ...'
831
+ end
832
+ # verify the required parameter 'id' is set
833
+ if @api_client.config.client_side_validation && id.nil?
834
+ fail ArgumentError, "Missing the required parameter 'id' when calling IntegrationsApi.update_slack_connection"
835
+ end
836
+ # verify the required parameter 'update_slack_connection' is set
837
+ if @api_client.config.client_side_validation && update_slack_connection.nil?
838
+ fail ArgumentError, "Missing the required parameter 'update_slack_connection' when calling IntegrationsApi.update_slack_connection"
839
+ end
840
+ # resource path
841
+ local_var_path = '/v1/slack-connections/{id}'.sub('{id}', CGI.escape(id.to_s))
842
+
843
+ # query parameters
844
+ query_params = opts[:query_params] || {}
845
+
846
+ # header parameters
847
+ header_params = opts[:header_params] || {}
848
+ # HTTP header 'Accept' (if needed)
849
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
850
+ # HTTP header 'Content-Type'
851
+ content_type = @api_client.select_header_content_type(['application/json'])
852
+ if !content_type.nil?
853
+ header_params['Content-Type'] = content_type
854
+ end
855
+
856
+ # form parameters
857
+ form_params = opts[:form_params] || {}
858
+
859
+ # http body (model)
860
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(update_slack_connection)
861
+
862
+ # return_type
863
+ return_type = opts[:debug_return_type] || 'SlackConnection'
864
+
865
+ # auth_names
866
+ auth_names = opts[:debug_auth_names] || ['apiKey']
867
+
868
+ new_options = opts.merge(
869
+ :operation => :"IntegrationsApi.update_slack_connection",
870
+ :header_params => header_params,
871
+ :query_params => query_params,
872
+ :form_params => form_params,
873
+ :body => post_body,
874
+ :auth_names => auth_names,
875
+ :return_type => return_type
876
+ )
877
+
878
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
879
+ if @api_client.config.debugging
880
+ @api_client.config.logger.debug "API called: IntegrationsApi#update_slack_connection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
881
+ end
882
+ return data, status_code, headers
883
+ end
884
+
559
885
  # Change the policy of a mapping
560
886
  # Only affects the licenses created afterwards. Doesn't accept tokens: only API keys and sessions. **Required role permission**: `integration:update` when called with a session, granted by the member's role. API keys aren't limited by roles.
561
887
  # @param id [String]
@@ -420,7 +420,7 @@ module LicenseManager
420
420
  # @option opts [Integer] :page Page to return. Pages are numbered from 1: &#x60;1&#x60; is the first page. A page past the last one returns an empty &#x60;data&#x60;, not an error. Defaults to &#x60;1&#x60;. (default to 1)
421
421
  # @option opts [Integer] :page_size Maximum number of items per page, from 1 to 100. Every page holds this many items except the last one, which can hold fewer. Defaults to &#x60;20&#x60;. (default to 20)
422
422
  # @option opts [String] :sort Field to sort by, prefixed with &#x60;-&#x60; for descending order. Defaults to &#x60;-createdAt&#x60;. (default to '-createdAt')
423
- # @option opts [String] :search Case-insensitive text the key contains.
423
+ # @option opts [String] :search Case-insensitive text the key or the email of the customer contains.
424
424
  # @option opts [String] :key Only returns the license with this exact key, case included. Keys of test products start with &#x60;TEST-&#x60;.
425
425
  # @option opts [String] :policy_id Only returns the licenses following this policy.
426
426
  # @option opts [String] :machine_version Only returns the licenses with at least one active machine running this version of the product.
@@ -451,7 +451,7 @@ module LicenseManager
451
451
  # @option opts [Integer] :page Page to return. Pages are numbered from 1: &#x60;1&#x60; is the first page. A page past the last one returns an empty &#x60;data&#x60;, not an error. Defaults to &#x60;1&#x60;. (default to 1)
452
452
  # @option opts [Integer] :page_size Maximum number of items per page, from 1 to 100. Every page holds this many items except the last one, which can hold fewer. Defaults to &#x60;20&#x60;. (default to 20)
453
453
  # @option opts [String] :sort Field to sort by, prefixed with &#x60;-&#x60; for descending order. Defaults to &#x60;-createdAt&#x60;. (default to '-createdAt')
454
- # @option opts [String] :search Case-insensitive text the key contains.
454
+ # @option opts [String] :search Case-insensitive text the key or the email of the customer contains.
455
455
  # @option opts [String] :key Only returns the license with this exact key, case included. Keys of test products start with &#x60;TEST-&#x60;.
456
456
  # @option opts [String] :policy_id Only returns the licenses following this policy.
457
457
  # @option opts [String] :machine_version Only returns the licenses with at least one active machine running this version of the product.
@@ -582,7 +582,7 @@ module LicenseManager
582
582
  # @option opts [Integer] :page Page to return. Pages are numbered from 1: &#x60;1&#x60; is the first page. A page past the last one returns an empty &#x60;data&#x60;, not an error. Defaults to &#x60;1&#x60;. (default to 1)
583
583
  # @option opts [Integer] :page_size Maximum number of items per page, from 1 to 100. Every page holds this many items except the last one, which can hold fewer. Defaults to &#x60;20&#x60;. (default to 20)
584
584
  # @option opts [String] :sort Field to sort by, prefixed with &#x60;-&#x60; for descending order. Defaults to &#x60;-createdAt&#x60;. (default to '-createdAt')
585
- # @option opts [String] :search Case-insensitive text the key contains.
585
+ # @option opts [String] :search Case-insensitive text the key or the email of the customer contains.
586
586
  # @option opts [String] :key Only returns the license with this exact key, case included. Keys of test products start with &#x60;TEST-&#x60;.
587
587
  # @option opts [String] :policy_id Only returns the licenses following this policy.
588
588
  # @option opts [String] :customer_id Only returns the licenses of this customer.
@@ -614,7 +614,7 @@ module LicenseManager
614
614
  # @option opts [Integer] :page Page to return. Pages are numbered from 1: &#x60;1&#x60; is the first page. A page past the last one returns an empty &#x60;data&#x60;, not an error. Defaults to &#x60;1&#x60;. (default to 1)
615
615
  # @option opts [Integer] :page_size Maximum number of items per page, from 1 to 100. Every page holds this many items except the last one, which can hold fewer. Defaults to &#x60;20&#x60;. (default to 20)
616
616
  # @option opts [String] :sort Field to sort by, prefixed with &#x60;-&#x60; for descending order. Defaults to &#x60;-createdAt&#x60;. (default to '-createdAt')
617
- # @option opts [String] :search Case-insensitive text the key contains.
617
+ # @option opts [String] :search Case-insensitive text the key or the email of the customer contains.
618
618
  # @option opts [String] :key Only returns the license with this exact key, case included. Keys of test products start with &#x60;TEST-&#x60;.
619
619
  # @option opts [String] :policy_id Only returns the licenses following this policy.
620
620
  # @option opts [String] :customer_id Only returns the licenses of this customer.
@@ -23,6 +23,8 @@ module LicenseManager
23
23
 
24
24
  attr_accessor :customer_id
25
25
 
26
+ attr_accessor :customer
27
+
26
28
  # Unique within the product. Case sensitive: `validateKey` compares keys exactly.
27
29
  attr_accessor :key
28
30
 
@@ -103,6 +105,7 @@ module LicenseManager
103
105
  :'product_id' => :'productId',
104
106
  :'policy_id' => :'policyId',
105
107
  :'customer_id' => :'customerId',
108
+ :'customer' => :'customer',
106
109
  :'key' => :'key',
107
110
  :'created_at' => :'createdAt',
108
111
  :'expires_at' => :'expiresAt',
@@ -142,6 +145,7 @@ module LicenseManager
142
145
  :'product_id' => :'String',
143
146
  :'policy_id' => :'String',
144
147
  :'customer_id' => :'String',
148
+ :'customer' => :'LicenseCustomer',
145
149
  :'key' => :'String',
146
150
  :'created_at' => :'Time',
147
151
  :'expires_at' => :'Time',
@@ -231,6 +235,12 @@ module LicenseManager
231
235
  self.customer_id = nil
232
236
  end
233
237
 
238
+ if attributes.key?(:'customer')
239
+ self.customer = attributes[:'customer']
240
+ else
241
+ self.customer = nil
242
+ end
243
+
234
244
  if attributes.key?(:'key')
235
245
  self.key = attributes[:'key']
236
246
  else
@@ -369,6 +379,10 @@ module LicenseManager
369
379
  invalid_properties.push('invalid value for "customer_id", customer_id cannot be nil.')
370
380
  end
371
381
 
382
+ if @customer.nil?
383
+ invalid_properties.push('invalid value for "customer", customer cannot be nil.')
384
+ end
385
+
372
386
  if @key.nil?
373
387
  invalid_properties.push('invalid value for "key", key cannot be nil.')
374
388
  end
@@ -412,6 +426,7 @@ module LicenseManager
412
426
  return false if @product_id.nil?
413
427
  return false if @policy_id.nil?
414
428
  return false if @customer_id.nil?
429
+ return false if @customer.nil?
415
430
  return false if @key.nil?
416
431
  return false if @created_at.nil?
417
432
  return false if @max_offline_duration_seconds.nil?
@@ -463,6 +478,16 @@ module LicenseManager
463
478
  @customer_id = customer_id
464
479
  end
465
480
 
481
+ # Custom attribute writer method with validation
482
+ # @param [Object] customer Value to be assigned
483
+ def customer=(customer)
484
+ if customer.nil?
485
+ fail ArgumentError, 'customer cannot be nil'
486
+ end
487
+
488
+ @customer = customer
489
+ end
490
+
466
491
  # Custom attribute writer method with validation
467
492
  # @param [Object] key Value to be assigned
468
493
  def key=(key)
@@ -552,6 +577,7 @@ module LicenseManager
552
577
  product_id == o.product_id &&
553
578
  policy_id == o.policy_id &&
554
579
  customer_id == o.customer_id &&
580
+ customer == o.customer &&
555
581
  key == o.key &&
556
582
  created_at == o.created_at &&
557
583
  expires_at == o.expires_at &&
@@ -582,7 +608,7 @@ module LicenseManager
582
608
  # Calculates hash code according to all attributes.
583
609
  # @return [Integer] Hash code
584
610
  def hash
585
- [id, product_id, policy_id, customer_id, key, created_at, expires_at, meta, stripe_payment_intent_id, max_machines, max_offline_duration_seconds, active_machine_count, last_activated_at, max_version, price, status, cancellable_until, canceled_at, cancellation_reason, subscription, cancellation_comment, stripe_refund_id, updated_at].hash
611
+ [id, product_id, policy_id, customer_id, customer, key, created_at, expires_at, meta, stripe_payment_intent_id, max_machines, max_offline_duration_seconds, active_machine_count, last_activated_at, max_version, price, status, cancellable_until, canceled_at, cancellation_reason, subscription, cancellation_comment, stripe_refund_id, updated_at].hash
586
612
  end
587
613
 
588
614
  # Builds the object from hash