ding_sdk 0.8.2 → 0.8.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1d09302de99a2e4ef61702909d79c0cb53e5772a53562261d0b70d98012f2fbe
4
- data.tar.gz: 6c8e5b5cc3f6424cc03367cebc3a4d5caa394a2cc079924e52ac4d3ab97e5ea4
3
+ metadata.gz: 91d39af4727dad1916a565bf25fb04254c1d896b6ea62add8aad17a264fc87e0
4
+ data.tar.gz: 6d8da210d8bf86e4f63b962b321f8af78edeee0033215e945acf11bf8a216d4a
5
5
  SHA512:
6
- metadata.gz: 951a497dfb89b0d94d88df16475d641b4e39dc38a29657e0294bed7dacab34a2243d8d2e19856843ac96d5ecceea0728861243dde2546d8b8a33b69b2ea0f458
7
- data.tar.gz: e0e7c85843acc8fa401f5b90f366948fbffcb38585f23a5adfa4b6b0906576ee3a678fc3fcf5e35d4169c4eaa44df50defd5143a36c15af945eef2c65995777b
6
+ metadata.gz: c049dc644fde38fc771c3361fb7f444f88ba4f517f494d6cfd3303592cde6d0420dc6fcc5e0f380fe4ec267c9bd80791faaf149db53af8e0fba38ca44883ef61
7
+ data.tar.gz: 0d4c423f2b6084094023cba0cb619cb0de008bc4d1d85d9bbe9d6a176b558f676cf683638a5af942034b2c756bc8a22b15dfebf401e39d3fe5a6b1b01a259298
@@ -8,7 +8,7 @@ module DingSDK
8
8
  module Operations
9
9
 
10
10
 
11
- class CreateAutenticationResponse < ::DingSDK::Utils::FieldAugmented
11
+ class CreateAuthenticationResponse < ::DingSDK::Utils::FieldAugmented
12
12
  extend T::Sig
13
13
 
14
14
  # HTTP response content type for this operation
@@ -0,0 +1,36 @@
1
+ # Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module DingSDK
8
+ module Operations
9
+
10
+
11
+ class FeedbackResponse < ::DingSDK::Utils::FieldAugmented
12
+ extend T::Sig
13
+
14
+ # HTTP response content type for this operation
15
+ field :content_type, ::String
16
+ # Raw HTTP response; suitable for custom response parsing
17
+ field :raw_response, ::Faraday::Response
18
+ # HTTP response status code for this operation
19
+ field :status_code, ::Integer
20
+ # Bad Request
21
+ field :error_response, T.nilable(::DingSDK::Shared::ErrorResponse)
22
+ # OK
23
+ field :feedback_response, T.nilable(::DingSDK::Shared::FeedbackResponse)
24
+
25
+
26
+ sig { params(content_type: ::String, raw_response: ::Faraday::Response, status_code: ::Integer, error_response: T.nilable(::DingSDK::Shared::ErrorResponse), feedback_response: T.nilable(::DingSDK::Shared::FeedbackResponse)).void }
27
+ def initialize(content_type: nil, raw_response: nil, status_code: nil, error_response: nil, feedback_response: nil)
28
+ @content_type = content_type
29
+ @raw_response = raw_response
30
+ @status_code = status_code
31
+ @error_response = error_response
32
+ @feedback_response = feedback_response
33
+ end
34
+ end
35
+ end
36
+ end
@@ -6,7 +6,8 @@
6
6
  module DingSDK
7
7
  module Operations
8
8
  autoload :CheckResponse, 'ding_sdk/models/operations/check_response.rb'
9
- autoload :CreateAutenticationResponse, 'ding_sdk/models/operations/create_autentication_response.rb'
9
+ autoload :CreateAuthenticationResponse, 'ding_sdk/models/operations/create_authentication_response.rb'
10
+ autoload :FeedbackResponse, 'ding_sdk/models/operations/feedback_response.rb'
10
11
  autoload :RetryResponse, 'ding_sdk/models/operations/retry_response.rb'
11
12
  autoload :LookupRequest, 'ding_sdk/models/operations/lookup_request.rb'
12
13
  autoload :LookupResponse, 'ding_sdk/models/operations/lookup_response.rb'
@@ -21,6 +21,9 @@ module DingSDK
21
21
  # * `invalid_os_version` - The provided OS version is invalid.
22
22
  # * `invalid_device_model` - The provided device model is invalid.
23
23
  # * `invalid_device_id` - The provided device ID is invalid.
24
+ # * `no_associated_auth_found` - The associated authentication was not found.
25
+ # * `duplicated_feedback_status` - Duplicated feedback status has found.
26
+ # * `invalid_template_id` - The provided template ID is invalid.
24
27
  #
25
28
  class Code < T::Enum
26
29
  enums do
@@ -40,6 +43,9 @@ module DingSDK
40
43
  INVALID_OS_VERSION = new('invalid_os_version')
41
44
  INVALID_DEVICE_MODEL = new('invalid_device_model')
42
45
  INVALID_DEVICE_ID = new('invalid_device_id')
46
+ NO_ASSOCIATED_AUTH_FOUND = new('no_associated_auth_found')
47
+ DUPLICATED_FEEDBACK_STATUS = new('duplicated_feedback_status')
48
+ INVALID_TEMPLATE_ID = new('invalid_template_id')
43
49
  end
44
50
  end
45
51
 
@@ -33,10 +33,12 @@ module DingSDK
33
33
  field :is_returning_user, T.nilable(T::Boolean), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('is_returning_user') } }
34
34
  # The version of the user's device operating system.
35
35
  field :os_version, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('os_version') } }
36
+ # The template id associated with the message content variant to be sent.
37
+ field :template_id, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('template_id') } }
36
38
 
37
39
 
38
- sig { params(customer_uuid: ::String, phone_number: ::String, app_realm: T.nilable(::String), app_version: T.nilable(::String), callback_url: T.nilable(::String), device_id: T.nilable(::String), device_model: T.nilable(::String), device_type: T.nilable(::DingSDK::Shared::DeviceType), ip: T.nilable(::String), is_returning_user: T.nilable(T::Boolean), os_version: T.nilable(::String)).void }
39
- def initialize(customer_uuid: nil, phone_number: nil, app_realm: nil, app_version: nil, callback_url: nil, device_id: nil, device_model: nil, device_type: nil, ip: nil, is_returning_user: nil, os_version: nil)
40
+ sig { params(customer_uuid: ::String, phone_number: ::String, app_realm: T.nilable(::String), app_version: T.nilable(::String), callback_url: T.nilable(::String), device_id: T.nilable(::String), device_model: T.nilable(::String), device_type: T.nilable(::DingSDK::Shared::DeviceType), ip: T.nilable(::String), is_returning_user: T.nilable(T::Boolean), os_version: T.nilable(::String), template_id: T.nilable(::String)).void }
41
+ def initialize(customer_uuid: nil, phone_number: nil, app_realm: nil, app_version: nil, callback_url: nil, device_id: nil, device_model: nil, device_type: nil, ip: nil, is_returning_user: nil, os_version: nil, template_id: nil)
40
42
  @customer_uuid = customer_uuid
41
43
  @phone_number = phone_number
42
44
  @app_realm = app_realm
@@ -48,6 +50,7 @@ module DingSDK
48
50
  @ip = ip
49
51
  @is_returning_user = is_returning_user
50
52
  @os_version = os_version
53
+ @template_id = template_id
51
54
  end
52
55
  end
53
56
  end
@@ -25,6 +25,9 @@ module DingSDK
25
25
  # * `invalid_os_version` - The provided OS version is invalid.
26
26
  # * `invalid_device_model` - The provided device model is invalid.
27
27
  # * `invalid_device_id` - The provided device ID is invalid.
28
+ # * `no_associated_auth_found` - The associated authentication was not found.
29
+ # * `duplicated_feedback_status` - Duplicated feedback status has found.
30
+ # * `invalid_template_id` - The provided template ID is invalid.
28
31
  #
29
32
  field :code, T.nilable(::DingSDK::Shared::Code), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('code'), 'decoder': Utils.enum_from_string(::DingSDK::Shared::Code, true) } }
30
33
  # A link to the documentation that describes the error.
@@ -0,0 +1,30 @@
1
+ # Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module DingSDK
8
+ module Shared
9
+
10
+
11
+ class FeedbackRequest < ::DingSDK::Utils::FieldAugmented
12
+ extend T::Sig
13
+
14
+ # Your customer UUID, which can be found in the API settings in the dashboard.
15
+ field :customer_uuid, ::String, { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('customer_uuid') } }
16
+ # An E.164 formatted phone number.
17
+ field :phone_number, ::String, { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('phone_number') } }
18
+ # The type of the feedback.
19
+ field :status, ::DingSDK::Shared::FeedbackRequestStatus, { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('status'), 'decoder': Utils.enum_from_string(::DingSDK::Shared::FeedbackRequestStatus, false) } }
20
+
21
+
22
+ sig { params(customer_uuid: ::String, phone_number: ::String, status: ::DingSDK::Shared::FeedbackRequestStatus).void }
23
+ def initialize(customer_uuid: nil, phone_number: nil, status: nil)
24
+ @customer_uuid = customer_uuid
25
+ @phone_number = phone_number
26
+ @status = status
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,18 @@
1
+ # Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module DingSDK
8
+ module Shared
9
+
10
+ # FeedbackRequestStatus - The type of the feedback.
11
+ class FeedbackRequestStatus < T::Enum
12
+ enums do
13
+ ONBOARDED = new('onboarded')
14
+ end
15
+ end
16
+
17
+ end
18
+ end
@@ -0,0 +1,24 @@
1
+ # Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module DingSDK
8
+ module Shared
9
+
10
+
11
+ class FeedbackResponse < ::DingSDK::Utils::FieldAugmented
12
+ extend T::Sig
13
+
14
+ # The UUID of the feedback.
15
+ field :uuid, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('uuid') } }
16
+
17
+
18
+ sig { params(uuid: T.nilable(::String)).void }
19
+ def initialize(uuid: nil)
20
+ @uuid = uuid
21
+ end
22
+ end
23
+ end
24
+ end
@@ -14,6 +14,9 @@ module DingSDK
14
14
  autoload :CreateAuthenticationResponse, 'ding_sdk/models/shared/createauthenticationresponse.rb'
15
15
  autoload :DeviceType, 'ding_sdk/models/shared/device_type.rb'
16
16
  autoload :CreateAuthenticationRequest, 'ding_sdk/models/shared/createauthenticationrequest.rb'
17
+ autoload :FeedbackResponse, 'ding_sdk/models/shared/feedbackresponse.rb'
18
+ autoload :FeedbackRequestStatus, 'ding_sdk/models/shared/feedbackrequest_status.rb'
19
+ autoload :FeedbackRequest, 'ding_sdk/models/shared/feedbackrequest.rb'
17
20
  autoload :RetryAuthenticationResponseStatus, 'ding_sdk/models/shared/retryauthenticationresponse_status.rb'
18
21
  autoload :RetryAuthenticationResponse, 'ding_sdk/models/shared/retryauthenticationresponse.rb'
19
22
  autoload :RetryAuthenticationRequest, 'ding_sdk/models/shared/retryauthenticationrequest.rb'
data/lib/ding_sdk/otp.rb CHANGED
@@ -63,9 +63,9 @@ module DingSDK
63
63
  end
64
64
 
65
65
 
66
- sig { params(request: T.nilable(::DingSDK::Shared::CreateAuthenticationRequest)).returns(::DingSDK::Operations::CreateAutenticationResponse) }
67
- def create_autentication(request)
68
- # create_autentication - Send a code
66
+ sig { params(request: T.nilable(::DingSDK::Shared::CreateAuthenticationRequest)).returns(::DingSDK::Operations::CreateAuthenticationResponse) }
67
+ def create_authentication(request)
68
+ # create_authentication - Send a code
69
69
  url, params = @sdk_configuration.get_server_details
70
70
  base_url = Utils.template_url(url, params)
71
71
  url = "#{base_url}/authentication"
@@ -89,7 +89,7 @@ module DingSDK
89
89
 
90
90
  content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
91
91
 
92
- res = ::DingSDK::Operations::CreateAutenticationResponse.new(
92
+ res = ::DingSDK::Operations::CreateAuthenticationResponse.new(
93
93
  status_code: r.status, content_type: content_type, raw_response: r
94
94
  )
95
95
  if r.status == 200
@@ -107,6 +107,51 @@ module DingSDK
107
107
  end
108
108
 
109
109
 
110
+ sig { params(request: T.nilable(::DingSDK::Shared::FeedbackRequest)).returns(::DingSDK::Operations::FeedbackResponse) }
111
+ def feedback(request)
112
+ # feedback - Send feedback
113
+ url, params = @sdk_configuration.get_server_details
114
+ base_url = Utils.template_url(url, params)
115
+ url = "#{base_url}/authentication/feedback"
116
+ headers = {}
117
+ req_content_type, data, form = Utils.serialize_request_body(request, :request, :json)
118
+ headers['content-type'] = req_content_type
119
+ headers['Accept'] = 'application/json'
120
+ headers['user-agent'] = @sdk_configuration.user_agent
121
+
122
+ r = @sdk_configuration.client.post(url) do |req|
123
+ req.headers = headers
124
+ Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
125
+ if form
126
+ req.body = Utils.encode_form(form)
127
+ elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
128
+ req.body = URI.encode_www_form(data)
129
+ else
130
+ req.body = data
131
+ end
132
+ end
133
+
134
+ content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
135
+
136
+ res = ::DingSDK::Operations::FeedbackResponse.new(
137
+ status_code: r.status, content_type: content_type, raw_response: r
138
+ )
139
+ if r.status == 200
140
+ if Utils.match_content_type(content_type, 'application/json')
141
+ out = Utils.unmarshal_complex(r.env.response_body, ::DingSDK::Shared::FeedbackResponse)
142
+ res.feedback_response = out
143
+ end
144
+ else
145
+
146
+ if Utils.match_content_type(content_type, 'application/json')
147
+ out = Utils.unmarshal_complex(r.env.response_body, ::DingSDK::Shared::ErrorResponse)
148
+ res.error_response = out
149
+ end
150
+ end
151
+ res
152
+ end
153
+
154
+
110
155
  sig { params(request: T.nilable(::DingSDK::Shared::RetryAuthenticationRequest)).returns(::DingSDK::Operations::RetryResponse) }
111
156
  def retry(request)
112
157
  # retry - Perform a retry
@@ -38,9 +38,9 @@ module DingSDK
38
38
  @security = security
39
39
  @language = 'ruby'
40
40
  @openapi_doc_version = '1.0.0'
41
- @sdk_version = '0.8.2'
42
- @gen_version = '2.275.4'
43
- @user_agent = 'speakeasy-sdk/ruby 0.8.2 2.275.4 1.0.0 ding_sdk'
41
+ @sdk_version = '0.8.4'
42
+ @gen_version = '2.280.6'
43
+ @user_agent = 'speakeasy-sdk/ruby 0.8.4 2.280.6 1.0.0 ding_sdk'
44
44
  end
45
45
 
46
46
  sig { returns([String, T::Hash[Symbol, String]]) }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ding_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ding
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-01 00:00:00.000000000 Z
11
+ date: 2024-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -147,7 +147,8 @@ files:
147
147
  - lib/ding_sdk/lookup.rb
148
148
  - lib/ding_sdk/models/operations.rb
149
149
  - lib/ding_sdk/models/operations/check_response.rb
150
- - lib/ding_sdk/models/operations/create_autentication_response.rb
150
+ - lib/ding_sdk/models/operations/create_authentication_response.rb
151
+ - lib/ding_sdk/models/operations/feedback_response.rb
151
152
  - lib/ding_sdk/models/operations/lookup_request.rb
152
153
  - lib/ding_sdk/models/operations/lookup_response.rb
153
154
  - lib/ding_sdk/models/operations/retry_response.rb
@@ -160,6 +161,9 @@ files:
160
161
  - lib/ding_sdk/models/shared/createcheckresponse_status.rb
161
162
  - lib/ding_sdk/models/shared/device_type.rb
162
163
  - lib/ding_sdk/models/shared/errorresponse.rb
164
+ - lib/ding_sdk/models/shared/feedbackrequest.rb
165
+ - lib/ding_sdk/models/shared/feedbackrequest_status.rb
166
+ - lib/ding_sdk/models/shared/feedbackresponse.rb
163
167
  - lib/ding_sdk/models/shared/line_type.rb
164
168
  - lib/ding_sdk/models/shared/lookupresponse.rb
165
169
  - lib/ding_sdk/models/shared/retryauthenticationrequest.rb