Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,44 @@ on:
- 'stl-preview-base/**'

jobs:
build:
timeout-minutes: 10
name: build
permissions:
contents: read
id-token: write
runs-on: ${{ github.repository == 'stainless-sdks/amocrm-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: |-
github.repository == 'stainless-sdks/amocrm-ruby' &&
(github.event_name == 'push' || github.event.pull_request.head.repo.fork)
steps:
- uses: actions/checkout@v6
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: false
- run: |-
bundle install

- name: Get GitHub OIDC Token
if: |-
github.repository == 'stainless-sdks/amocrm-ruby' &&
!startsWith(github.ref, 'refs/heads/stl/')
id: github-oidc
uses: actions/github-script@v8
with:
script: core.setOutput('github_token', await core.getIDToken());

- name: Build and upload gem artifacts
if: |-
github.repository == 'stainless-sdks/amocrm-ruby' &&
!startsWith(github.ref, 'refs/heads/stl/')
env:
URL: https://pkg.stainless.com/s
AUTH: ${{ steps.github-oidc.outputs.github_token }}
SHA: ${{ github.sha }}
PACKAGE_NAME: amocrm
run: ./scripts/utils/upload-artifact.sh
lint:
timeout-minutes: 10
name: lint
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.5.2"
".": "0.5.3"
}
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

## 0.5.3 (2026-03-08)

Full Changelog: [v0.5.2...v0.5.3](https://github.com/Hexlet/amocrm-ruby/compare/v0.5.2...v0.5.3)

### Bug Fixes

* properly mock time in ruby ci tests ([2c02d7c](https://github.com/Hexlet/amocrm-ruby/commit/2c02d7cdad78f91fc96b3572830b69c1e1781e69))


### Chores

* **ci:** add build step ([0111d8b](https://github.com/Hexlet/amocrm-ruby/commit/0111d8b871937e6422e3b348630971ae5a882d94))
* **ci:** skip uploading artifacts on stainless-internal branches ([59ed3cd](https://github.com/Hexlet/amocrm-ruby/commit/59ed3cd3a6282f58f826bde41e572836b42436d9))
* **internal:** codegen related update ([70ecc90](https://github.com/Hexlet/amocrm-ruby/commit/70ecc90ab1f89bff2aafa6ee7fc29934a9d9329d))
* **internal:** codegen related update ([906bc89](https://github.com/Hexlet/amocrm-ruby/commit/906bc8924e5c7ae9b50d3f194629ff7e8981d80a))
* **internal:** remove mock server code ([97b11dc](https://github.com/Hexlet/amocrm-ruby/commit/97b11dc026b0de710edaacc6a65526f9a6969ec7))
* update mock server docs ([4393e5d](https://github.com/Hexlet/amocrm-ruby/commit/4393e5d94350640a132c8df0d330715e7ca369ff))

## 0.5.2 (2026-02-07)

Full Changelog: [v0.5.1...v0.5.2](https://github.com/Hexlet/amocrm-ruby/compare/v0.5.1...v0.5.2)
Expand Down
6 changes: 0 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,6 @@ $ bundle exec rake

## Running tests

Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.

```bash
$ npx prism mock path/to/your/openapi.yml
```

```bash
$ bundle exec rake test
```
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GIT
PATH
remote: .
specs:
amocrm (0.5.2)
amocrm (0.5.3)
cgi
connection_pool

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
<!-- x-release-please-start-version -->

```ruby
gem "amocrm", "~> 0.5.2"
gem "amocrm", "~> 0.5.3"
```

<!-- x-release-please-end -->
Expand Down
31 changes: 31 additions & 0 deletions lib/amocrm/internal/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,37 @@ def writable_enum(&blk)
JSONL_CONTENT = %r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)}

class << self
# @api private
#
# @param query [Hash{Symbol=>Object}]
#
# @return [Hash{Symbol=>Object}]
def encode_query_params(query)
out = {}
query.each { write_query_param_element!(out, _1, _2) }
out
end

# @api private
#
# @param collection [Hash{Symbol=>Object}]
# @param key [String]
# @param element [Object]
#
# @return [nil]
private def write_query_param_element!(collection, key, element)
case element
in Hash
element.each do |name, value|
write_query_param_element!(collection, "#{key}[#{name}]", value)
end
in Array
collection[key] = element.map(&:to_s).join(",")
else
collection[key] = element.to_s
end
end

# @api private
#
# @param y [Enumerator::Yielder]
Expand Down
8 changes: 7 additions & 1 deletion lib/amocrm/models/catalog_element_create_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@ class CatalogElementCreateParams < Amocrm::Internal::Type::BaseModel
extend Amocrm::Internal::Type::RequestParameters::Converter
include Amocrm::Internal::Type::RequestParameters

# @!attribute catalog_id
#
# @return [Integer]
required :catalog_id, Integer

# @!attribute body
#
# @return [Array<Amocrm::Models::CatalogElementCreateParams::Body>]
required :body, -> { Amocrm::Internal::Type::ArrayOf[Amocrm::CatalogElementCreateParams::Body] }

# @!method initialize(body:, request_options: {})
# @!method initialize(catalog_id:, body:, request_options: {})
# @param catalog_id [Integer]
# @param body [Array<Amocrm::Models::CatalogElementCreateParams::Body>]
# @param request_options [Amocrm::RequestOptions, Hash{Symbol=>Object}]

Expand Down
9 changes: 8 additions & 1 deletion lib/amocrm/models/catalog_element_get_by_id_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,22 @@ class CatalogElementGetByIDParams < Amocrm::Internal::Type::BaseModel
# @return [Integer]
required :catalog_id, Integer

# @!attribute id
#
# @return [Integer]
required :id, Integer

# @!attribute with
# Additional data to include (comma-separated).
#
# @return [String, nil]
optional :with, String

# @!method initialize(catalog_id:, with: nil, request_options: {})
# @!method initialize(catalog_id:, id:, with: nil, request_options: {})
# @param catalog_id [Integer]
#
# @param id [Integer]
#
# @param with [String] Additional data to include (comma-separated).
#
# @param request_options [Amocrm::RequestOptions, Hash{Symbol=>Object}]
Expand Down
8 changes: 7 additions & 1 deletion lib/amocrm/models/catalog_element_list_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ class CatalogElementListParams < Amocrm::Internal::Type::BaseModel
extend Amocrm::Internal::Type::RequestParameters::Converter
include Amocrm::Internal::Type::RequestParameters

# @!attribute catalog_id
#
# @return [Integer]
required :catalog_id, Integer

# @!attribute filter
#
# @return [Object, nil]
Expand All @@ -27,7 +32,8 @@ class CatalogElementListParams < Amocrm::Internal::Type::BaseModel
# @return [String, Integer, nil]
optional :query, union: -> { Amocrm::CatalogElementListParams::Query }

# @!method initialize(filter: nil, limit: nil, page: nil, query: nil, request_options: {})
# @!method initialize(catalog_id:, filter: nil, limit: nil, page: nil, query: nil, request_options: {})
# @param catalog_id [Integer]
# @param filter [Object]
# @param limit [Integer]
# @param page [Integer]
Expand Down
8 changes: 7 additions & 1 deletion lib/amocrm/models/catalog_element_update_by_id_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ class CatalogElementUpdateByIDParams < Amocrm::Internal::Type::BaseModel
# @return [Integer]
required :catalog_id, Integer

# @!attribute id
#
# @return [Integer]
required :id, Integer

# @!attribute custom_fields_values
#
# @return [Array<Amocrm::Models::CatalogElementUpdateByIDParams::CustomFieldsValue>, nil]
Expand All @@ -28,8 +33,9 @@ class CatalogElementUpdateByIDParams < Amocrm::Internal::Type::BaseModel
# @return [String, nil]
optional :request_id, String

# @!method initialize(catalog_id:, custom_fields_values: nil, name: nil, request_id: nil, request_options: {})
# @!method initialize(catalog_id:, id:, custom_fields_values: nil, name: nil, request_id: nil, request_options: {})
# @param catalog_id [Integer]
# @param id [Integer]
# @param custom_fields_values [Array<Amocrm::Models::CatalogElementUpdateByIDParams::CustomFieldsValue>]
# @param name [String]
# @param request_id [String]
Expand Down
8 changes: 7 additions & 1 deletion lib/amocrm/models/catalog_element_update_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@ class CatalogElementUpdateParams < Amocrm::Internal::Type::BaseModel
extend Amocrm::Internal::Type::RequestParameters::Converter
include Amocrm::Internal::Type::RequestParameters

# @!attribute catalog_id
#
# @return [Integer]
required :catalog_id, Integer

# @!attribute body
#
# @return [Array<Amocrm::Models::CatalogElementUpdateParams::Body>]
required :body, -> { Amocrm::Internal::Type::ArrayOf[Amocrm::CatalogElementUpdateParams::Body] }

# @!method initialize(body:, request_options: {})
# @!method initialize(catalog_id:, body:, request_options: {})
# @param catalog_id [Integer]
# @param body [Array<Amocrm::Models::CatalogElementUpdateParams::Body>]
# @param request_options [Amocrm::RequestOptions, Hash{Symbol=>Object}]

Expand Down
8 changes: 7 additions & 1 deletion lib/amocrm/models/catalog_get_by_id_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ class CatalogGetByIDParams < Amocrm::Internal::Type::BaseModel
extend Amocrm::Internal::Type::RequestParameters::Converter
include Amocrm::Internal::Type::RequestParameters

# @!method initialize(request_options: {})
# @!attribute id
#
# @return [Integer]
required :id, Integer

# @!method initialize(id:, request_options: {})
# @param id [Integer]
# @param request_options [Amocrm::RequestOptions, Hash{Symbol=>Object}]
end
end
Expand Down
8 changes: 7 additions & 1 deletion lib/amocrm/models/catalog_update_by_id_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ class CatalogUpdateByIDParams < Amocrm::Internal::Type::BaseModel
extend Amocrm::Internal::Type::RequestParameters::Converter
include Amocrm::Internal::Type::RequestParameters

# @!attribute id
#
# @return [Integer]
required :id, Integer

# @!attribute can_add_elements
#
# @return [Boolean, nil]
Expand All @@ -32,7 +37,8 @@ class CatalogUpdateByIDParams < Amocrm::Internal::Type::BaseModel
# @return [Integer, nil]
optional :sort, Integer

# @!method initialize(can_add_elements: nil, can_link_multiple: nil, name: nil, request_id: nil, sort: nil, request_options: {})
# @!method initialize(id:, can_add_elements: nil, can_link_multiple: nil, name: nil, request_id: nil, sort: nil, request_options: {})
# @param id [Integer]
# @param can_add_elements [Boolean]
# @param can_link_multiple [Boolean]
# @param name [String]
Expand Down
9 changes: 8 additions & 1 deletion lib/amocrm/models/company_get_by_id_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,20 @@ class CompanyGetByIDParams < Amocrm::Internal::Type::BaseModel
extend Amocrm::Internal::Type::RequestParameters::Converter
include Amocrm::Internal::Type::RequestParameters

# @!attribute id
#
# @return [Integer]
required :id, Integer

# @!attribute with
# Expand related entities; comma-separated values
#
# @return [String, nil]
optional :with, String

# @!method initialize(with: nil, request_options: {})
# @!method initialize(id:, with: nil, request_options: {})
# @param id [Integer]
#
# @param with [String] Expand related entities; comma-separated values
#
# @param request_options [Amocrm::RequestOptions, Hash{Symbol=>Object}]
Expand Down
9 changes: 8 additions & 1 deletion lib/amocrm/models/company_update_by_id_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ class CompanyUpdateByIDParams < Amocrm::Internal::Type::BaseModel
extend Amocrm::Internal::Type::RequestParameters::Converter
include Amocrm::Internal::Type::RequestParameters

# @!attribute id
#
# @return [Integer]
required :id, Integer

# @!attribute _embedded
#
# @return [Amocrm::Models::CompanyUpdateByIDParams::Embedded, nil]
Expand Down Expand Up @@ -62,7 +67,9 @@ class CompanyUpdateByIDParams < Amocrm::Internal::Type::BaseModel
# @return [Integer, nil]
optional :updated_by, Integer

# @!method initialize(_embedded: nil, created_at: nil, created_by: nil, custom_fields_values: nil, name: nil, responsible_user_id: nil, tags_to_add: nil, tags_to_delete: nil, updated_at: nil, updated_by: nil, request_options: {})
# @!method initialize(id:, _embedded: nil, created_at: nil, created_by: nil, custom_fields_values: nil, name: nil, responsible_user_id: nil, tags_to_add: nil, tags_to_delete: nil, updated_at: nil, updated_by: nil, request_options: {})
# @param id [Integer]
#
# @param _embedded [Amocrm::Models::CompanyUpdateByIDParams::Embedded]
#
# @param created_at [Integer]
Expand Down
9 changes: 8 additions & 1 deletion lib/amocrm/models/contact_get_by_id_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,20 @@ class ContactGetByIDParams < Amocrm::Internal::Type::BaseModel
extend Amocrm::Internal::Type::RequestParameters::Converter
include Amocrm::Internal::Type::RequestParameters

# @!attribute id
#
# @return [Integer]
required :id, Integer

# @!attribute with
# Expand related entities; comma-separated values
#
# @return [String, nil]
optional :with, String

# @!method initialize(with: nil, request_options: {})
# @!method initialize(id:, with: nil, request_options: {})
# @param id [Integer]
#
# @param with [String] Expand related entities; comma-separated values
#
# @param request_options [Amocrm::RequestOptions, Hash{Symbol=>Object}]
Expand Down
9 changes: 8 additions & 1 deletion lib/amocrm/models/contact_update_by_id_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ class ContactUpdateByIDParams < Amocrm::Internal::Type::BaseModel
extend Amocrm::Internal::Type::RequestParameters::Converter
include Amocrm::Internal::Type::RequestParameters

# @!attribute id
#
# @return [Integer]
required :id, Integer

# @!attribute _embedded
#
# @return [Amocrm::Models::ContactUpdateByIDParams::Embedded, nil]
Expand Down Expand Up @@ -72,7 +77,9 @@ class ContactUpdateByIDParams < Amocrm::Internal::Type::BaseModel
# @return [Integer, nil]
optional :updated_by, Integer

# @!method initialize(_embedded: nil, created_at: nil, created_by: nil, custom_fields_values: nil, first_name: nil, last_name: nil, name: nil, responsible_user_id: nil, tags_to_add: nil, tags_to_delete: nil, updated_at: nil, updated_by: nil, request_options: {})
# @!method initialize(id:, _embedded: nil, created_at: nil, created_by: nil, custom_fields_values: nil, first_name: nil, last_name: nil, name: nil, responsible_user_id: nil, tags_to_add: nil, tags_to_delete: nil, updated_at: nil, updated_by: nil, request_options: {})
# @param id [Integer]
#
# @param _embedded [Amocrm::Models::ContactUpdateByIDParams::Embedded]
#
# @param created_at [Integer]
Expand Down
8 changes: 7 additions & 1 deletion lib/amocrm/models/custom_field_create_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@ class CustomFieldCreateParams < Amocrm::Internal::Type::BaseModel
extend Amocrm::Internal::Type::RequestParameters::Converter
include Amocrm::Internal::Type::RequestParameters

# @!attribute entity_type
#
# @return [String]
required :entity_type, String

# @!attribute body
#
# @return [Array<Amocrm::Models::CustomFieldCreateParams::Body>]
required :body, -> { Amocrm::Internal::Type::ArrayOf[Amocrm::CustomFieldCreateParams::Body] }

# @!method initialize(body:, request_options: {})
# @!method initialize(entity_type:, body:, request_options: {})
# @param entity_type [String]
# @param body [Array<Amocrm::Models::CustomFieldCreateParams::Body>]
# @param request_options [Amocrm::RequestOptions, Hash{Symbol=>Object}]

Expand Down
Loading
Loading