Skip to content

Commit

Permalink
Merge pull request #89 from dubinc/speakeasy-sdk-regen-1740270566
Browse files Browse the repository at this point in the history
chore: 🐝 Update SDK - Generate 0.2.2-alpha.70
  • Loading branch information
devkiran authored Feb 26, 2025
2 parents 005e3c6 + b3aac63 commit 15565d4
Show file tree
Hide file tree
Showing 185 changed files with 734 additions and 658 deletions.
16 changes: 9 additions & 7 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
lockVersion: 2.0.0
id: 5a2dd83e-da98-455b-8ef9-0100a914efdf
management:
docChecksum: 0eaecf8bf6bf099e2c77a089ca253cd6
docChecksum: 4ed7bf1fc90b54224f530facc9c37231
docVersion: 0.0.1
speakeasyVersion: 1.501.0
generationVersion: 2.522.1
releaseVersion: 0.2.2-alpha.69
configChecksum: 18e4ecfa741ddbcb3f2822deb5efc714
speakeasyVersion: 1.504.1
generationVersion: 2.529.2
releaseVersion: 0.2.2-alpha.70
configChecksum: 6b800f61b5176ced188e6dd37c881fa5
repoURL: https://github.com/dubinc/dub-ruby.git
installationURL: https://github.com/dubinc/dub-ruby
published: true
Expand Down Expand Up @@ -246,6 +246,10 @@ generatedFiles:
- docs/sdks/track/README.md
- docs/sdks/workspaces/README.md
- dub.gemspec
- lib/crystalline.rb
- lib/crystalline/metadata_fields.rb
- lib/crystalline/t.rb
- lib/crystalline/utils.rb
- lib/dub.rb
- lib/open_api_sdk/analytics.rb
- lib/open_api_sdk/customers.rb
Expand Down Expand Up @@ -467,8 +471,6 @@ generatedFiles:
- lib/open_api_sdk/sdkconfiguration.rb
- lib/open_api_sdk/tags.rb
- lib/open_api_sdk/track.rb
- lib/open_api_sdk/utils/metadata_fields.rb
- lib/open_api_sdk/utils/t.rb
- lib/open_api_sdk/utils/utils.rb
- lib/open_api_sdk/workspaces.rb
- sorbet/config
Expand Down
2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ generation:
oAuth2ClientCredentialsEnabled: true
oAuth2PasswordEnabled: false
ruby:
version: 0.2.2-alpha.69
version: 0.2.2-alpha.70
author: Dub
description: Ruby Client SDK Generated by Speakeasy
imports:
Expand Down
14 changes: 7 additions & 7 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
speakeasyVersion: 1.501.0
speakeasyVersion: 1.504.1
sources:
dub:
sourceNamespace: dub
sourceRevisionDigest: sha256:8954b87e863ba42a7b547d02cca09b390b0f3373bde241f97475c2e223c2d074
sourceBlobDigest: sha256:f868a57be590cf4f39302d485ea5b02d2b59851153ac34fb03a11d43f2e8101d
sourceRevisionDigest: sha256:1d8c8d48f43af8908165789c021879e0eee8f1aabf37d4d5c9db0f7fd646c6dc
sourceBlobDigest: sha256:54ac15b838758d799f7d08a7cbae8394185a7c7fdfe697ff9bc4e15488b59782
tags:
- latest
- speakeasy-sdk-regen-1740183962
- speakeasy-sdk-regen-1740270566
- 0.0.1
targets:
my-first-target:
source: dub
sourceNamespace: dub
sourceRevisionDigest: sha256:8954b87e863ba42a7b547d02cca09b390b0f3373bde241f97475c2e223c2d074
sourceBlobDigest: sha256:f868a57be590cf4f39302d485ea5b02d2b59851153ac34fb03a11d43f2e8101d
sourceRevisionDigest: sha256:1d8c8d48f43af8908165789c021879e0eee8f1aabf37d4d5c9db0f7fd646c6dc
sourceBlobDigest: sha256:54ac15b838758d799f7d08a7cbae8394185a7c7fdfe697ff9bc4e15488b59782
codeSamplesNamespace: code-samples-ruby-my-first-target
codeSamplesRevisionDigest: sha256:7499ccfc303c11a9ceb2487477b0e8f280da73d9d29aad27719f41440cc36162
codeSamplesRevisionDigest: sha256:b9f46496635b31955b663bdd301648dcc5886b726ff5c49c9277c8279a414f24
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
5 changes: 4 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
dub (0.2.2.pre.alpha.69)
dub (0.2.2.pre.alpha.70)
faraday
faraday-multipart
rack
Expand All @@ -25,6 +25,8 @@ GEM
language_server-protocol (3.17.0.3)
logger (1.6.6)
minitest (5.25.2)
minitest-focus (1.4.0)
minitest (>= 4, < 6)
multipart-post (2.4.1)
net-http (0.6.0)
uri
Expand Down Expand Up @@ -97,6 +99,7 @@ PLATFORMS
DEPENDENCIES
dub!
minitest
minitest-focus
rubocop (~> 1.60.2)
sorbet
tapioca
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -838,4 +838,14 @@ Based on:
### Generated
- [ruby v0.2.2-alpha.69] .
### Releases
- [Ruby Gems v0.2.2-alpha.69] https://rubygems.org/gems/dub/versions/0.2.2-alpha.69 - .
- [Ruby Gems v0.2.2-alpha.69] https://rubygems.org/gems/dub/versions/0.2.2-alpha.69 - .

## 2025-02-26 00:27:00
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.504.1 (2.529.2) https://github.com/speakeasy-api/speakeasy
### Generated
- [ruby v0.2.2-alpha.70] .
### Releases
- [Ruby Gems v0.2.2-alpha.70] https://rubygems.org/gems/dub/versions/0.2.2-alpha.70 - .
18 changes: 10 additions & 8 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ RuboCop::RakeTask.new

Minitest::TestTask.create

# So far default is working - leaving this here for reference.
task :default => :test

# Minitest::TestTask.create(:test) do |t|
# t.libs << 'test'
# t.libs << 'lib'
# t.warning = false
# t.test_globs = ['test/**/*_test.rb']
# end

task :default => :test
# Developers can run all tests with:
#
# $ rake test
#
# Developers can run individual test files with:
#
# $ rake test test/parameter_test
#
# and run individual tests by adding `focus` to the line before the test definition.
1 change: 1 addition & 0 deletions docs/models/operations/createpartnerlinkrequestbody.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
| `tenant_id` | *T.nilable(::String)* | :heavy_minus_sign: | The ID of the partner in your system. If both `partnerId` and `tenantId` are not provided, an error will be thrown. |
| `url` | *T.nilable(::String)* | :heavy_minus_sign: | The URL to shorten (if not provided, the program's default URL will be used). Will throw an error if the domain doesn't match the program's default URL domain. |
| `key` | *T.nilable(::String)* | :heavy_minus_sign: | The short link slug. If not provided, a random 7-character slug will be generated. |
| `comments` | *T.nilable(::String)* | :heavy_minus_sign: | The comments for the short link. |
| `link_props` | [T.nilable(::OpenApiSDK::Operations::CreatePartnerLinkLinkProps)](../../models/operations/createpartnerlinklinkprops.md) | :heavy_minus_sign: | Additional properties that you can pass to the partner's short link. Will be used to override the default link properties for this partner. |
3 changes: 2 additions & 1 deletion docs/models/operations/createpartnerresponsebody.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ The created partner
| `leads` | *::Float* | :heavy_check_mark: | N/A |
| `sales` | *::Float* | :heavy_check_mark: | N/A |
| `sale_amount` | *::Float* | :heavy_check_mark: | N/A |
| `earnings` | *::Float* | :heavy_check_mark: | N/A |
| `earnings` | *::Float* | :heavy_check_mark: | N/A |
| `application_id` | *T.nilable(::String)* | :heavy_minus_sign: | N/A |
1 change: 1 addition & 0 deletions docs/models/operations/upsertpartnerlinkrequestbody.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
| `tenant_id` | *T.nilable(::String)* | :heavy_minus_sign: | The ID of the partner in your system. If both `partnerId` and `tenantId` are not provided, an error will be thrown. |
| `url` | *T.nilable(::String)* | :heavy_minus_sign: | The URL to shorten (if not provided, the program's default URL will be used). Will throw an error if the domain doesn't match the program's default URL domain. |
| `key` | *T.nilable(::String)* | :heavy_minus_sign: | The short link slug. If not provided, a random 7-character slug will be generated. |
| `comments` | *T.nilable(::String)* | :heavy_minus_sign: | The comments for the short link. |
| `link_props` | [T.nilable(::OpenApiSDK::Operations::UpsertPartnerLinkLinkProps)](../../models/operations/upsertpartnerlinklinkprops.md) | :heavy_minus_sign: | Additional properties that you can pass to the partner's short link. Will be used to override the default link properties for this partner. |
3 changes: 2 additions & 1 deletion dub.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ $LOAD_PATH.push File.expand_path('lib', __dir__)

Gem::Specification.new do |s|
s.name = 'dub'
s.version = '0.2.2-alpha.69'
s.version = '0.2.2-alpha.70'
s.platform = Gem::Platform::RUBY
s.licenses = ['Apache-2.0']
s.summary = ''
Expand All @@ -29,6 +29,7 @@ Gem::Specification.new do |s|


s.add_development_dependency('minitest')
s.add_development_dependency('minitest-focus')
s.add_development_dependency('rubocop', '~> 1.60.2')
s.add_development_dependency('sorbet')
s.add_development_dependency('tapioca')
Expand Down
12 changes: 12 additions & 0 deletions lib/crystalline.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.

# typed: true
# frozen_string_literal: true

module Crystalline
autoload :MetadataFields, 'crystalline/metadata_fields'
end


require_relative 'crystalline/utils'
require_relative 'crystalline/t'
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
# typed: true
# frozen_string_literal: true

module OpenApiSDK
module Crystalline
extend T::Sig
module MetadataFields
extend T::Sig

Expand Down Expand Up @@ -32,9 +33,13 @@ def field(field_name, type, metadata = {})
fields << Field.new(field_name, type, metadata)
end

def field_augmented?
true
end

def unmarshal_single(field_type, value, decoder = nil)
if field_type.respond_to? :unmarshal_json
unmarshalled = field_type.unmarshal_json(value)
if field_type.instance_of?(Class) && field_type < ::Crystalline::FieldAugmented
unmarshalled = field_type.from_dict(value)
return unmarshalled
elsif field_type.to_s == 'Object'
# rubocop:disable Lint/SuppressedException
Expand All @@ -52,14 +57,20 @@ def unmarshal_single(field_type, value, decoder = nil)
end
end

sig { params(json_obj: T.any(String, T::Hash[Symbol, String])).returns(Utils::FieldAugmented) }
def unmarshal_json(json_obj)
to_build = new
sig { params(json_obj: T.any(String, T::Hash[Symbol, String])).returns(::Crystalline::FieldAugmented) }
def from_json(json_obj)
begin
d = JSON.parse(json_obj)
rescue TypeError, JSON::ParserError
d = json_obj
end
from_dict(d)
end

sig { params(d: T::Hash[Symbol, String]).returns(::Crystalline::FieldAugmented) }
def from_dict(d)
to_build = new

fields.each do |field|
field_type = field.type
if T.nilable? field_type
Expand Down Expand Up @@ -113,15 +124,15 @@ def field(field_name)
end

def marshal_single(field)
if field.respond_to? :marshal_json
field.marshal_json(encode: false)
if field.is_a? ::Crystalline::FieldAugmented
field.to_dict
else
Utils.val_to_string(field, primitives: false)
::Crystalline.val_to_string(field, primitives: false)
end
end

def marshal_json(encode: true)
d = {}
def to_dict
result = {}
fields.sort_by(&:name).each do |field|
f = send(field.name)
next if f.nil?
Expand All @@ -133,18 +144,20 @@ def marshal_json(encode: true)
key = field.name
end
if f.is_a? Array
d[key] = f.map { |o| marshal_single(o) }
result[key] = f.map { |o| marshal_single(o) }
elsif f.is_a? Hash
d[key] = f.map { |k, v| [k, marshal_single(v)] }
result[key] = f.map { |k, v| [k, marshal_single(v)] }
else
d[key] = marshal_single(f)
result[key] = marshal_single(f)
end
end
if encode
JSON.dump(d)
else
d
end
result
end

def to_json(*args)
JSON.generate(to_dict, *args)
end
end


end
File renamed without changes.
65 changes: 65 additions & 0 deletions lib/crystalline/utils.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.

# typed: true
# frozen_string_literal: true

require 'sorbet-runtime'

module Crystalline
extend T::Sig

class FieldAugmented
include MetadataFields
end

sig { params(complex: Object).returns(Object) }
def self.marshal_dict_complex(complex)
if complex.is_a? Array
complex.map { |v| Crystalline.marshal_dict_complex(v) }
elsif complex.is_a? Hash
complex.transform_values { |v| Crystalline.marshal_dict_complex(v) }
elsif complex.is_a? Crystalline::FieldAugmented
complex.to_dict
else
complex
end
end

def self.marshal_json_complex(complex)
JSON.dump(marshal_dict_complex(complex))
end

sig { params(data: Object, type: Object).returns(Object) }
def self.unmarshal_complex(data, type)
unmarshal_json(data, type)
end

sig { params(data: Object, type: Object).returns(Object) }
def self.unmarshal_json(data, type)
if T.simplifiable? type
type = T.simplify_type type
end
if type.instance_of?(Class) && type < ::Crystalline::FieldAugmented
type.from_dict(data)
elsif T.arr? type
data.map { |v| Crystalline.unmarshal_complex(v, T.arr_of(type)) }
elsif T.hash? type
data.transform_values { |v| Crystalline.unmarshal_complex(v, T.hash_of(type)) }
else
data
end
end

sig { params(val: Object, primitives: T::Boolean).returns(Object) }
def self.val_to_string(val, primitives: true)
if val.is_a? T::Enum
val.serialize
elsif val.is_a? DateTime
val.strftime('%Y-%m-%dT%H:%M:%S.%NZ')
elsif primitives
val.to_s
else
val
end
end
end
3 changes: 1 addition & 2 deletions lib/dub.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ module OpenApiSDK
autoload :Metatags, 'open_api_sdk/metatags'
end

require_relative 'open_api_sdk/utils/t'
require_relative 'open_api_sdk/utils/utils'
require_relative 'open_api_sdk/utils/metadata_fields'
require_relative 'crystalline'
require_relative 'open_api_sdk/sdkconfiguration'
Loading

0 comments on commit 15565d4

Please sign in to comment.