diff --git a/.gitignore b/.gitignore index edaa164e..3d26ceed 100644 --- a/.gitignore +++ b/.gitignore @@ -7,5 +7,4 @@ bin/tapioca Brewfile.lock.json doc/ -Gemfile.lock sorbet/tapioca/* diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 37fcefaa..5fdd8830 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.0.0" + ".": "1.1.0" } diff --git a/.rubocop.yml b/.rubocop.yml index e2b23b21..0df91b7f 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -8,7 +8,7 @@ AllCops: - "bin/*" NewCops: enable SuggestExtensions: false - TargetRubyVersion: 3.1.0 + TargetRubyVersion: 3.2.0 # Whether MFA is required or not should be left to the token configuration. Gemspec/RequireMFA: @@ -63,6 +63,8 @@ Layout/MultilineMethodParameterLineBreaks: # Prefer compact hash literals. Layout/SpaceInsideHashLiteralBraces: EnforcedStyle: no_space + Exclude: + - "**/*.rbi" Lint/BooleanSymbol: Enabled: false @@ -90,6 +92,10 @@ Lint/MissingSuper: Exclude: - "**/*.rbi" +Lint/SymbolConversion: + Exclude: + - "**/*.rbi" + # Disabled for safety reasons, this option changes code semantics. Lint/UnusedMethodArgument: AutoCorrect: false @@ -106,6 +112,8 @@ Metrics/AbcSize: Metrics/BlockLength: AllowedPatterns: - assert_pattern + - type_alias + - define_sorbet_constant! Exclude: - "**/*.rbi" @@ -176,6 +184,9 @@ Style/ClassAndModuleChildren: Exclude: - "test/**/*" +Style/CommentAnnotation: + Enabled: false + # We should go back and add these docs, but ignore for now. Style/Documentation: Enabled: false @@ -244,6 +255,10 @@ Style/RedundantInitialize: Exclude: - "**/*.rbi" +Style/RedundantParentheses: + Exclude: + - "**/*.rbi" + # Prefer slashes for regex literals. Style/RegexpLiteral: EnforcedStyle: slashes diff --git a/.stats.yml b/.stats.yml index 6a1766d5..9b155a84 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 89 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-641970ffdc1043cad290c3384d3d9c55b50cb709016a7513c03b2b84cf24fb31.yml -openapi_spec_hash: e10e8093bf0dbde38523b98bec436123 -config_hash: 7460c5bd6d1a7041faa274f677789407 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-923618cb1489556307ce0be07853170d15516da8fe450578fed856e560ec361c.yml +openapi_spec_hash: 1406cf9ab287412197a1907f5d66d541 +config_hash: 2ae8965d371a03bd30c6a56819c04cf2 diff --git a/CHANGELOG.md b/CHANGELOG.md index 45f54f7c..8961ce64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,46 @@ # Changelog +## 1.1.0 (2025-05-15) + +Full Changelog: [v1.0.0...v1.1.0](https://github.com/knocklabs/knock-ruby/compare/v1.0.0...v1.1.0) + +### Features + +* **api:** api update ([02959e8](https://github.com/knocklabs/knock-ruby/commit/02959e82c2148f3a1a3e9e6021d48298644305e9)) +* **api:** api update ([6bc31c4](https://github.com/knocklabs/knock-ruby/commit/6bc31c4a6c0a81e096267f1c5a1cb3a9f8b29dac)) +* **api:** removes duplicate activities section ([e83c36e](https://github.com/knocklabs/knock-ruby/commit/e83c36e5c6e88a457f7306ab7515d03c1ae0a7bc)) +* bump default connection pool size limit to minimum of 99 ([b04fe89](https://github.com/knocklabs/knock-ruby/commit/b04fe8949b02a6f56979748226d24b2a30e2ea62)) +* expose base client options as read only attributes ([4f7b9a2](https://github.com/knocklabs/knock-ruby/commit/4f7b9a248aed50a6b0077a5db4f34b764f86ffd5)) +* expose recursive `#to_h` conversion ([153be54](https://github.com/knocklabs/knock-ruby/commit/153be54a04fd0b2ac0dd27278d96be70cc87b1e1)) +* support sorbet aliases at the runtime ([5e9d146](https://github.com/knocklabs/knock-ruby/commit/5e9d146ae0303f729ebeb949d0d6bb4a9943e4be)) + + +### Bug Fixes + +* **internal:** ensure formatting always uses c.utf-8 locale ([9f8e834](https://github.com/knocklabs/knock-ruby/commit/9f8e8345f2206a5b060d55838f9e22226fa47589)) +* **internal:** fix formatting script for macos ([11e651e](https://github.com/knocklabs/knock-ruby/commit/11e651eaea730816e2a558cf708382eed559a71c)) +* **internal:** update gemspec name ([2a1af3a](https://github.com/knocklabs/knock-ruby/commit/2a1af3a8e6f8dbea4f448ce3acbdf694f993aea8)) + + +### Chores + +* accept all nd-json mimetype variants ([f13a7aa](https://github.com/knocklabs/knock-ruby/commit/f13a7aa66b6ef36d0d044cea3674bfeef1f18ac2)) +* always check if current page is empty in `next_page?` ([b43503c](https://github.com/knocklabs/knock-ruby/commit/b43503c22d1c7ca08adcf1f8a01d3d3c48608962)) +* fix misc linting / minor issues ([4d8eadc](https://github.com/knocklabs/knock-ruby/commit/4d8eadcee14d85c3eb7f95b0417b74d932b344ad)) +* **internal:** codegen related update ([1ab97b3](https://github.com/knocklabs/knock-ruby/commit/1ab97b344adc1bebd79bef05e33bf825500e91e2)) +* **internal:** codegen related update ([1cdabfe](https://github.com/knocklabs/knock-ruby/commit/1cdabfed4481b5bc2f1892647c604f37ec4f201b)) +* re-export top level models under library namespace ([a2bbf55](https://github.com/knocklabs/knock-ruby/commit/a2bbf558687ac11cdb6d72e9d54c47e0a8998e7b)) +* remove Gemfile.lock during bootstrap ([b0ad2cd](https://github.com/knocklabs/knock-ruby/commit/b0ad2cd268ff2f6fe6f96d8cf1baa7296287eec4)) +* reorganize type aliases ([c50a167](https://github.com/knocklabs/knock-ruby/commit/c50a16701c7a044b1b0b5c2b6aefffe2fc1eb102)) +* revert ignoring Gemfile.lock ([c005465](https://github.com/knocklabs/knock-ruby/commit/c0054656e506496ba90c6c3b68c18e2017531fec)) +* validate request option coercion correctness ([611e596](https://github.com/knocklabs/knock-ruby/commit/611e5969960440e4004a73158af6a26da4fb4755)) + + +### Documentation + +* illustrate environmental defaults for auth variables ([a6de609](https://github.com/knocklabs/knock-ruby/commit/a6de609be150aa0d64298b0cb8a696c27c3f724c)) +* rewrite much of README.md for readability ([0530377](https://github.com/knocklabs/knock-ruby/commit/0530377bd49cb6e65155c36ed30239fa64b3bc7b)) + ## 1.0.0 (2025-05-01) Full Changelog: [v0.6.2...v1.0.0](https://github.com/knocklabs/knock-ruby/compare/v0.6.2...v1.0.0) diff --git a/Gemfile.lock b/Gemfile.lock index 7d4bc931..19d0f641 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - knockapi (1.0.0) + knockapi (1.1.0) connection_pool GEM @@ -33,7 +33,7 @@ GEM addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) ast (2.4.3) - async (2.23.1) + async (2.24.0) console (~> 1.29) fiber-annotation io-event (~> 1.9) @@ -105,7 +105,7 @@ GEM redcarpet (3.6.1) regexp_parser (2.10.0) rexml (3.4.1) - rubocop (1.75.4) + rubocop (1.75.5) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -121,13 +121,13 @@ GEM prism (~> 1.4) ruby-progressbar (1.13.0) securerandom (0.4.1) - sorbet (0.5.12048) - sorbet-static (= 0.5.12048) - sorbet-runtime (0.5.12048) - sorbet-static (0.5.12048-x86_64-linux) - sorbet-static-and-runtime (0.5.12048) - sorbet (= 0.5.12048) - sorbet-runtime (= 0.5.12048) + sorbet (0.5.12067) + sorbet-static (= 0.5.12067) + sorbet-runtime (0.5.12067) + sorbet-static (0.5.12067-x86_64-linux) + sorbet-static-and-runtime (0.5.12067) + sorbet (= 0.5.12067) + sorbet-runtime (= 0.5.12067) spoom (1.6.1) erubi (>= 1.10.0) prism (>= 0.28.0) @@ -151,7 +151,7 @@ GEM strscan (>= 1.0.0) terminal-table (>= 2, < 5) uri (>= 0.12.0) - strscan (3.1.4) + strscan (3.1.5) syntax_tree (6.2.0) prettier_print (>= 1.2.0) tapioca (0.16.11) diff --git a/README.md b/README.md index 5f6cc935..741f187a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Knock Ruby API library -The Knock Ruby library provides convenient access to the Knock REST API from any Ruby 3.2.0+ application. +The Knock Ruby library provides convenient access to the Knock REST API from any Ruby 3.2.0+ application. It ships with comprehensive types & docstrings in Yard, RBS, and RBI – [see below](https://github.com/knocklabs/knock-ruby#Sorbet) for usage with Sorbet. The standard library's `net/http` is used as the HTTP transport, with connection pooling via the `connection_pool` gem. It is generated with [Stainless](https://www.stainless.com/). @@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "knockapi", "~> 1.0.0" +gem "knockapi", "~> 1.1.0" ``` @@ -29,7 +29,7 @@ require "bundler/setup" require "knockapi" knock = Knockapi::Client.new( - api_key: "My API Key" # defaults to ENV["KNOCK_API_KEY"] + api_key: ENV["KNOCK_API_KEY"] # This is the default and can be omitted ) response = knock.workflows.trigger("dinosaurs-loose", recipients: ["dnedry"], data: {dinosaur: "triceratops"}) @@ -37,16 +37,6 @@ response = knock.workflows.trigger("dinosaurs-loose", recipients: ["dnedry"], da puts(response.workflow_run_id) ``` -## Sorbet - -This library is written with [Sorbet type definitions](https://sorbet.org/docs/rbi). However, there is no runtime dependency on the `sorbet-runtime`. - -When using sorbet, it is recommended to use model classes as below. This provides stronger type checking and tooling integration. - -```ruby -knock.workflows.trigger("dinosaurs-loose", recipients: ["dnedry"], data: {dinosaur: "triceratops"}) -``` - ### Pagination List methods in the Knock API are paginated. @@ -66,15 +56,30 @@ page.auto_paging_each do |user| end ``` -### Errors +Alternatively, you can use the `#next_page?` and `#next_page` methods for more granular control working with pages. + +```ruby +if page.next_page? + new_page = page.next_page + puts(new_page.entries[0].id) +end +``` + +### Handling errors When the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `Knockapi::Errors::APIError` will be thrown: ```ruby begin user = knock.users.get("dnedry") -rescue Knockapi::Errors::APIError => e - puts(e.status) # 400 +rescue Knockapi::Errors::APIConnectionError => e + puts("The server could not be reached") + puts(e.cause) # an underlying Exception, likely raised within `net/http` +rescue Knockapi::Errors::RateLimitError => e + puts("A 429 status code was received; we should back off a bit.") +rescue Knockapi::Errors::APIStatusError => e + puts("Another non-200-range status code was received") + puts(e.status) end ``` @@ -114,11 +119,7 @@ knock.users.get("dnedry", request_options: {max_retries: 5}) ### Timeouts -By default, requests will time out after 60 seconds. - -Timeouts are applied separately to the initial connection and the overall request time, so in some cases a request could wait 2\*timeout seconds before it fails. - -You can use the `timeout` option to configure or disable this: +By default, requests will time out after 60 seconds. You can use the timeout option to configure or disable this: ```ruby # Configure the default for all requests: @@ -130,40 +131,53 @@ knock = Knockapi::Client.new( knock.users.get("dnedry", request_options: {timeout: 5}) ``` -## Model DSL +On timeout, `Knockapi::Errors::APITimeoutError` is raised. -This library uses a simple DSL to represent request parameters and response shapes in `lib/knockapi/models`. +Note that requests that time out are retried by default. -With the right [editor plugins](https://shopify.github.io/ruby-lsp), you can ctrl-click on elements of the DSL to navigate around and explore the library. +## Advanced concepts -In all places where a `BaseModel` type is specified, vanilla Ruby `Hash` can also be used. For example, the following are interchangeable as arguments: +### BaseModel -```ruby -# This has tooling readability, for auto-completion, static analysis, and goto definition with supported language services -params = Knockapi::Models::WorkflowTriggerParams.new(recipients: ["dnedry"], data: {dinosaur: "triceratops"}) - -# This also works -params = { - recipients: ["dnedry"], - data: {dinosaur: "triceratops"} -} -``` +All parameter and response objects inherit from `Knockapi::Internal::Type::BaseModel`, which provides several conveniences, including: -## Editor support +1. All fields, including unknown ones, are accessible with `obj[:prop]` syntax, and can be destructured with `obj => {prop: prop}` or pattern-matching syntax. -A combination of [Shopify LSP](https://shopify.github.io/ruby-lsp) and [Solargraph](https://solargraph.org/) is recommended for non-[Sorbet](https://sorbet.org) users. The former is especially good at go to definition, while the latter has much better auto-completion support. +2. Structural equivalence for equality; if two API calls return the same values, comparing the responses with == will return true. -## Advanced concepts +3. Both instances and the classes themselves can be pretty-printed. + +4. Helpers such as `#to_h`, `#deep_to_h`, `#to_json`, and `#to_yaml`. + +### Making custom or undocumented requests -### Making custom/undocumented requests +#### Undocumented properties + +You can send undocumented parameters to any endpoint, and read undocumented response properties, like so: + +Note: the `extra_` parameters of the same name overrides the documented parameters. + +```ruby +user = + knock.users.get( + "dnedry", + request_options: { + extra_query: {my_query_parameter: value}, + extra_body: {my_body_parameter: value}, + extra_headers: {"my-header": value} + } + ) + +puts(user[:my_undocumented_property]) +``` #### Undocumented request params -If you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` under the `request_options:` parameter when making a requests as seen in examples above. +If you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` under the `request_options:` parameter when making a request as seen in examples above. #### Undocumented endpoints -To make requests to undocumented endpoints, you can make requests using `client.request`. Options on the client will be respected (such as retries) when making this request. +To make requests to undocumented endpoints while retaining the benefit of auth, retries, and so on, you can make requests using `client.request`, like so: ```ruby response = client.request( @@ -171,31 +185,69 @@ response = client.request( path: '/undocumented/endpoint', query: {"dog": "woof"}, headers: {"useful-header": "interesting-value"}, - body: {"he": "llo"}, + body: {"hello": "world"} ) ``` ### Concurrency & connection pooling -The `Knockapi::Client` instances are thread-safe, and should be re-used across multiple threads. By default, each `Client` have their own HTTP connection pool, with a maximum number of connections equal to thread count. +The `Knockapi::Client` instances are threadsafe, but only are fork-safe when there are no in-flight HTTP requests. + +Each instance of `Knockapi::Client` has its own HTTP connection pool with a default size of 99. As such, we recommend instantiating the client once per application in most settings. -When the maximum number of connections has been checked out from the connection pool, the `Client` will wait for an in use connection to become available. The queue time for this mechanism is accounted for by the per-request timeout. +When all available connections from the pool are checked out, requests wait for a new connection to become available, with queue time counting towards the request timeout. Unless otherwise specified, other classes in the SDK do not have locks protecting their underlying data structure. -Currently, `Knockapi::Client` instances are only fork-safe if there are no in-flight HTTP requests. +## Sorbet + +This library provides comprehensive [RBI](https://sorbet.org/docs/rbi) definitions, and has no dependency on sorbet-runtime. -### Sorbet +You can provide typesafe request parameters like so: -#### Argument passing trick +```ruby +knock.workflows.trigger("dinosaurs-loose", recipients: ["dnedry"], data: {dinosaur: "triceratops"}) +``` -It is possible to pass a compatible model / parameter class to a method that expects keyword arguments by using the `**` splat operator. +Or, equivalently: ```ruby -params = Knockapi::Models::WorkflowTriggerParams.new(recipients: ["dnedry"], data: {dinosaur: "triceratops"}) +# Hashes work, but are not typesafe: +knock.workflows.trigger("dinosaurs-loose", recipients: ["dnedry"], data: {dinosaur: "triceratops"}) + +# You can also splat a full Params class: +params = Knockapi::WorkflowTriggerParams.new(recipients: ["dnedry"], data: {dinosaur: "triceratops"}) knock.workflows.trigger("dinosaurs-loose", **params) ``` +### Enums + +Since this library does not depend on `sorbet-runtime`, it cannot provide [`T::Enum`](https://sorbet.org/docs/tenum) instances. Instead, we provide "tagged symbols" instead, which is always a primitive at runtime: + +```ruby +# :exclude +puts(Knockapi::Users::FeedListItemsParams::Archived::EXCLUDE) + +# Revealed type: `T.all(Knockapi::Users::FeedListItemsParams::Archived, Symbol)` +T.reveal_type(Knockapi::Users::FeedListItemsParams::Archived::EXCLUDE) +``` + +Enum parameters have a "relaxed" type, so you can either pass in enum constants or their literal value: + +```ruby +# Using the enum constants preserves the tagged type information: +knock.users.feeds.list_items( + archived: Knockapi::Users::FeedListItemsParams::Archived::EXCLUDE, + # … +) + +# Literal values is also permissible: +knock.users.feeds.list_items( + archived: :exclude, + # … +) +``` + ## Versioning This package follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions. As the library is in initial development and has a major version of `0`, APIs may change at any time. diff --git a/Rakefile b/Rakefile index 661da932..f4ca7db4 100644 --- a/Rakefile +++ b/Rakefile @@ -11,7 +11,7 @@ require "rubocop/rake_task" tapioca = "sorbet/tapioca" ignore_file = ".ignore" -CLEAN.push(*%w[.idea/ .ruby-lsp/ .yardoc/ doc/ Gemfile.lock], *FileList["*.gem"], ignore_file) +CLEAN.push(*%w[.idea/ .ruby-lsp/ .yardoc/ doc/], *FileList["*.gem"], ignore_file) CLOBBER.push(*%w[sorbet/rbi/annotations/ sorbet/rbi/gems/], tapioca) @@ -34,36 +34,48 @@ multitask(:test) do ruby(*%w[-w -e], rb, verbose: false) { fail unless _1 } end -rubo_find = %w[find ./lib ./test ./rbi -type f -and ( -name *.rb -or -name *.rbi ) -print0] xargs = %w[xargs --no-run-if-empty --null --max-procs=0 --max-args=300 --] +locale = {"LC_ALL" => "C.UTF-8"} desc("Lint `*.rb(i)`") multitask(:"lint:rubocop") do - rubocop = %w[rubocop --fail-level E] + find = %w[find ./lib ./test ./rbi -type f -and ( -name *.rb -or -name *.rbi ) -print0] + + rubocop = %w[rubocop] rubocop += %w[--format github] if ENV.key?("CI") # some lines cannot be shortened rubocop += %w[--except Lint/RedundantCopDisableDirective,Layout/LineLength] lint = xargs + rubocop - sh("#{rubo_find.shelljoin} | #{lint.shelljoin}") + sh("#{find.shelljoin} | #{lint.shelljoin}") end -desc("Format `*.rb(i)`") -multitask(:"format:rubocop") do +desc("Format `*.rb`") +multitask(:"format:rb") do + # while `syntax_tree` is much faster than `rubocop`, `rubocop` is the only formatter with full syntax support + find = %w[find ./lib ./test -type f -and -name *.rb -print0] fmt = xargs + %w[rubocop --fail-level F --autocorrect --format simple --] - sh("#{rubo_find.shelljoin} | #{fmt.shelljoin}") + sh("#{find.shelljoin} | #{fmt.shelljoin}") +end + +desc("Format `*.rbi`") +multitask(:"format:rbi") do + find = %w[find ./rbi -type f -and -name *.rbi -print0] + fmt = xargs + %w[stree write --] + sh(locale, "#{find.shelljoin} | #{fmt.shelljoin}") end desc("Format `*.rbs`") -multitask(:"format:syntax_tree") do +multitask(:"format:rbs") do find = %w[find ./sig -type f -name *.rbs -print0] - inplace = /darwin|bsd/ =~ RUBY_PLATFORM ? %w[-i''] : %w[-i] + inplace = /darwin|bsd/ =~ RUBY_PLATFORM ? ["-i", ""] : %w[-i] uuid = SecureRandom.uuid # `syntax_tree` has trouble with `rbs`'s class & module aliases - sed = xargs + %w[sed -E] + inplace + %w[-e] + sed_bin = /darwin/ =~ RUBY_PLATFORM ? "/usr/bin/sed" : "sed" + sed = xargs + [sed_bin, "-E", *inplace, "-e"] # annotate unprocessable aliases with a unique comment pre = sed + ["s/(class|module) ([^ ]+) = (.+$)/# \\1 #{uuid}\\n\\2: \\3/", "--"] fmt = xargs + %w[stree write --plugin=rbs --] @@ -87,7 +99,7 @@ multitask(:"format:syntax_tree") do # transform class aliases to type aliases, which syntax tree has no trouble with sh("#{find.shelljoin} | #{pre.shelljoin}") # run syntax tree to format `*.rbs` files - sh("#{find.shelljoin} | #{fmt.shelljoin}") do + sh(locale, "#{find.shelljoin} | #{fmt.shelljoin}") do success = _1 end # transform type aliases back to class aliases @@ -98,7 +110,7 @@ multitask(:"format:syntax_tree") do end desc("Format everything") -multitask(format: [:"format:rubocop", :"format:syntax_tree"]) +multitask(format: [:"format:rb", :"format:rbi", :"format:rbs"]) desc("Typecheck `*.rbs`") multitask(:"typecheck:steep") do @@ -135,7 +147,7 @@ multitask(:"build:gem") do sig/* GLOB - sh(*%w[gem build -- openai.gemspec]) + sh(*%w[gem build -- knockapi.gemspec]) rm_rf(ignore_file) end diff --git a/lib/knockapi.rb b/lib/knockapi.rb index 24c08691..19e065ff 100644 --- a/lib/knockapi.rb +++ b/lib/knockapi.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true # Standard libraries. +# rubocop:disable Lint/RedundantRequireStatement require "English" require "cgi" require "date" @@ -15,6 +16,7 @@ require "stringio" require "time" require "uri" +# rubocop:enable Lint/RedundantRequireStatement # We already ship the preferred sorbet manifests in the package itself. # `tapioca` currently does not offer us a way to opt out of unnecessary compilation. @@ -55,10 +57,12 @@ require_relative "knockapi/models/identify_user_request" require_relative "knockapi/models/activity" require_relative "knockapi/models/audience_add_members_params" +require_relative "knockapi/models/audience_add_members_response" require_relative "knockapi/models/audience_list_members_params" require_relative "knockapi/models/audience_list_members_response" require_relative "knockapi/models/audience_member" require_relative "knockapi/models/audience_remove_members_params" +require_relative "knockapi/models/audience_remove_members_response" require_relative "knockapi/models/bulk_operation" require_relative "knockapi/models/bulk_operation_get_params" require_relative "knockapi/models/channels/bulk_update_message_status_params" @@ -86,7 +90,6 @@ require_relative "knockapi/models/message_mark_as_seen_params" require_relative "knockapi/models/message_mark_as_unread_params" require_relative "knockapi/models/message_mark_as_unseen_params" -require_relative "knockapi/models/messages/activity_list_params" require_relative "knockapi/models/messages/batch_archive_params" require_relative "knockapi/models/messages/batch_archive_response" require_relative "knockapi/models/messages/batch_get_content_params" @@ -108,6 +111,7 @@ require_relative "knockapi/models/object_add_subscriptions_params" require_relative "knockapi/models/object_add_subscriptions_response" require_relative "knockapi/models/object_delete_params" +require_relative "knockapi/models/object_delete_response" require_relative "knockapi/models/object_delete_subscriptions_params" require_relative "knockapi/models/object_delete_subscriptions_response" require_relative "knockapi/models/object_get_channel_data_params" @@ -126,6 +130,7 @@ require_relative "knockapi/models/object_set_params" require_relative "knockapi/models/object_set_preferences_params" require_relative "knockapi/models/object_unset_channel_data_params" +require_relative "knockapi/models/object_unset_channel_data_response" require_relative "knockapi/models/page_info" require_relative "knockapi/models/providers/ms_team_check_auth_params" require_relative "knockapi/models/providers/ms_team_check_auth_response" @@ -168,6 +173,7 @@ require_relative "knockapi/models/schedule_update_response" require_relative "knockapi/models/tenant" require_relative "knockapi/models/tenant_delete_params" +require_relative "knockapi/models/tenant_delete_response" require_relative "knockapi/models/tenant_get_params" require_relative "knockapi/models/tenant_list_params" require_relative "knockapi/models/tenant_request" @@ -176,6 +182,7 @@ require_relative "knockapi/models/tenant_set_params" require_relative "knockapi/models/user" require_relative "knockapi/models/user_delete_params" +require_relative "knockapi/models/user_delete_response" require_relative "knockapi/models/user_get_channel_data_params" require_relative "knockapi/models/user_get_params" require_relative "knockapi/models/user_get_preferences_params" @@ -204,10 +211,13 @@ require_relative "knockapi/models/user_set_channel_data_params" require_relative "knockapi/models/user_set_preferences_params" require_relative "knockapi/models/user_unset_channel_data_params" +require_relative "knockapi/models/user_unset_channel_data_response" require_relative "knockapi/models/user_update_params" require_relative "knockapi/models/workflow_cancel_params" +require_relative "knockapi/models/workflow_cancel_response" require_relative "knockapi/models/workflow_trigger_params" require_relative "knockapi/models/workflow_trigger_response" +require_relative "knockapi/models" require_relative "knockapi/resources/audiences" require_relative "knockapi/resources/bulk_operations" require_relative "knockapi/resources/channels" @@ -216,7 +226,6 @@ require_relative "knockapi/resources/integrations/census" require_relative "knockapi/resources/integrations/hightouch" require_relative "knockapi/resources/messages" -require_relative "knockapi/resources/messages/activities" require_relative "knockapi/resources/messages/batch" require_relative "knockapi/resources/objects" require_relative "knockapi/resources/objects/bulk" diff --git a/lib/knockapi/client.rb b/lib/knockapi/client.rb index 609fee76..8112fa5b 100644 --- a/lib/knockapi/client.rb +++ b/lib/knockapi/client.rb @@ -83,10 +83,10 @@ class Client < Knockapi::Internal::Transport::BaseClient def initialize( api_key: ENV["KNOCK_API_KEY"], base_url: ENV["KNOCK_BASE_URL"], - max_retries: Knockapi::Client::DEFAULT_MAX_RETRIES, - timeout: Knockapi::Client::DEFAULT_TIMEOUT_IN_SECONDS, - initial_retry_delay: Knockapi::Client::DEFAULT_INITIAL_RETRY_DELAY, - max_retry_delay: Knockapi::Client::DEFAULT_MAX_RETRY_DELAY + max_retries: self.class::DEFAULT_MAX_RETRIES, + timeout: self.class::DEFAULT_TIMEOUT_IN_SECONDS, + initial_retry_delay: self.class::DEFAULT_INITIAL_RETRY_DELAY, + max_retry_delay: self.class::DEFAULT_MAX_RETRY_DELAY ) base_url ||= "https://api.knock.app" diff --git a/lib/knockapi/errors.rb b/lib/knockapi/errors.rb index 75282c42..cd9ff5fb 100644 --- a/lib/knockapi/errors.rb +++ b/lib/knockapi/errors.rb @@ -99,7 +99,7 @@ class APIStatusError < Knockapi::Errors::APIError # @param response [nil] # @param message [String, nil] # - # @return [Knockapi::Errors::APIStatusError] + # @return [self] def self.for(url:, status:, body:, request:, response:, message: nil) kwargs = { url: url, diff --git a/lib/knockapi/file_part.rb b/lib/knockapi/file_part.rb index 9191d83f..82f78950 100644 --- a/lib/knockapi/file_part.rb +++ b/lib/knockapi/file_part.rb @@ -45,9 +45,9 @@ def initialize(content, filename: nil, content_type: nil) @filename = case content in Pathname - filename.nil? ? content.basename.to_path : File.basename(filename) + filename.nil? ? content.basename.to_path : ::File.basename(filename) else - filename.nil? ? nil : File.basename(filename) + filename.nil? ? nil : ::File.basename(filename) end @content_type = content_type end diff --git a/lib/knockapi/internal.rb b/lib/knockapi/internal.rb index 242de7da..4c5a331d 100644 --- a/lib/knockapi/internal.rb +++ b/lib/knockapi/internal.rb @@ -2,10 +2,16 @@ module Knockapi module Internal + extend Knockapi::Internal::Util::SorbetRuntimeSupport + OMIT = Object.new.tap do _1.define_singleton_method(:inspect) { "#<#{Knockapi::Internal}::OMIT>" } end .freeze + + define_sorbet_constant!(:AnyHash) do + T.type_alias { T::Hash[Symbol, T.anything] } + end end end diff --git a/lib/knockapi/internal/entries_cursor.rb b/lib/knockapi/internal/entries_cursor.rb index 9c83312a..976eb49e 100644 --- a/lib/knockapi/internal/entries_cursor.rb +++ b/lib/knockapi/internal/entries_cursor.rb @@ -24,7 +24,7 @@ class EntriesCursor # @return [Boolean] def next_page? - !page_info&.after.nil? + !entries.to_a.empty? && !page_info&.after.to_s.empty? end # @raise [Knockapi::HTTP::Error] @@ -66,8 +66,8 @@ def initialize(client:, req:, headers:, page_data:) super case page_data - in {entries: Array | nil => entries} - @entries = entries&.map { Knockapi::Internal::Type::Converter.coerce(@model, _1) } + in {entries: Array => entries} + @entries = entries.map { Knockapi::Internal::Type::Converter.coerce(@model, _1) } else end case page_data diff --git a/lib/knockapi/internal/items_cursor.rb b/lib/knockapi/internal/items_cursor.rb index 8d73e903..ad828cb0 100644 --- a/lib/knockapi/internal/items_cursor.rb +++ b/lib/knockapi/internal/items_cursor.rb @@ -24,7 +24,7 @@ class ItemsCursor # @return [Boolean] def next_page? - !page_info&.after.nil? + !items.to_a.empty? && !page_info&.after.to_s.empty? end # @raise [Knockapi::HTTP::Error] @@ -66,8 +66,8 @@ def initialize(client:, req:, headers:, page_data:) super case page_data - in {items: Array | nil => items} - @items = items&.map { Knockapi::Internal::Type::Converter.coerce(@model, _1) } + in {items: Array => items} + @items = items.map { Knockapi::Internal::Type::Converter.coerce(@model, _1) } else end case page_data diff --git a/lib/knockapi/internal/ms_teams_pagination.rb b/lib/knockapi/internal/ms_teams_pagination.rb index d53c74e0..abb7dbcb 100644 --- a/lib/knockapi/internal/ms_teams_pagination.rb +++ b/lib/knockapi/internal/ms_teams_pagination.rb @@ -24,7 +24,7 @@ class MsTeamsPagination # @return [Boolean] def next_page? - !skip_token.nil? + !ms_teams_teams.to_a.empty? && !skip_token.to_s.empty? end # @raise [Knockapi::HTTP::Error] @@ -67,8 +67,8 @@ def initialize(client:, req:, headers:, page_data:) @skip_token = page_data[:skip_token] case page_data - in {ms_teams_teams: Array | nil => ms_teams_teams} - @ms_teams_teams = ms_teams_teams&.map { Knockapi::Internal::Type::Converter.coerce(@model, _1) } + in {ms_teams_teams: Array => ms_teams_teams} + @ms_teams_teams = ms_teams_teams.map { Knockapi::Internal::Type::Converter.coerce(@model, _1) } else end end diff --git a/lib/knockapi/internal/slack_channels_cursor.rb b/lib/knockapi/internal/slack_channels_cursor.rb index 9b4401e7..47db848e 100644 --- a/lib/knockapi/internal/slack_channels_cursor.rb +++ b/lib/knockapi/internal/slack_channels_cursor.rb @@ -24,7 +24,7 @@ class SlackChannelsCursor # @return [Boolean] def next_page? - !next_cursor.nil? + !slack_channels.to_a.empty? && !next_cursor.to_s.empty? end # @raise [Knockapi::HTTP::Error] @@ -67,8 +67,8 @@ def initialize(client:, req:, headers:, page_data:) @next_cursor = page_data[:next_cursor] case page_data - in {slack_channels: Array | nil => slack_channels} - @slack_channels = slack_channels&.map { Knockapi::Internal::Type::Converter.coerce(@model, _1) } + in {slack_channels: Array => slack_channels} + @slack_channels = slack_channels.map { Knockapi::Internal::Type::Converter.coerce(@model, _1) } else end end diff --git a/lib/knockapi/internal/transport/base_client.rb b/lib/knockapi/internal/transport/base_client.rb index adfcfbcb..f9d8139c 100644 --- a/lib/knockapi/internal/transport/base_client.rb +++ b/lib/knockapi/internal/transport/base_client.rb @@ -7,6 +7,8 @@ module Transport # # @abstract class BaseClient + extend Knockapi::Internal::Util::SorbetRuntimeSupport + # from whatwg fetch spec MAX_REDIRECTS = 20 @@ -151,6 +153,27 @@ def reap_connection!(status, stream:) end end + # @return [URI::Generic] + attr_reader :base_url + + # @return [Float] + attr_reader :timeout + + # @return [Integer] + attr_reader :max_retries + + # @return [Float] + attr_reader :initial_retry_delay + + # @return [Float] + attr_reader :max_retry_delay + + # @return [Hash{String=>String}] + attr_reader :headers + + # @return [String, nil] + attr_reader :idempotency_header + # @api private # @return [Knockapi::Internal::Transport::PooledNetRequester] attr_reader :requester @@ -182,10 +205,11 @@ def initialize( }, headers ) - @base_url = Knockapi::Internal::Util.parse_uri(base_url) + @base_url_components = Knockapi::Internal::Util.parse_uri(base_url) + @base_url = Knockapi::Internal::Util.unparse_uri(@base_url_components) @idempotency_header = idempotency_header&.to_s&.downcase - @max_retries = max_retries @timeout = timeout + @max_retries = max_retries @initial_retry_delay = initial_retry_delay @max_retry_delay = max_retry_delay end @@ -276,10 +300,14 @@ def initialize( Knockapi::Internal::Util.deep_merge(*[req[:body], opts[:extra_body]].compact) end + url = Knockapi::Internal::Util.join_parsed_uri( + @base_url_components, + {**req, path: path, query: query} + ) headers, encoded = Knockapi::Internal::Util.encode_content(headers, body) { method: method, - url: Knockapi::Internal::Util.join_parsed_uri(@base_url, {**req, path: path, query: query}), + url: url, headers: headers, body: encoded, max_retries: opts.fetch(:max_retries, @max_retries), @@ -458,9 +486,9 @@ def request(req) decoded = Knockapi::Internal::Util.decode_content(response, stream: stream) case req - in { stream: Class => st } + in {stream: Class => st} st.new(model: model, url: url, status: status, response: response, stream: decoded) - in { page: Class => page } + in {page: Class => page} page.new(client: self, req: req, headers: response, page_data: decoded) else unwrapped = Knockapi::Internal::Util.dig(decoded, req[:unwrap]) @@ -473,10 +501,54 @@ def request(req) # @return [String] def inspect # rubocop:disable Layout/LineLength - base_url = Knockapi::Internal::Util.unparse_uri(@base_url) - "#<#{self.class.name}:0x#{object_id.to_s(16)} base_url=#{base_url} max_retries=#{@max_retries} timeout=#{@timeout}>" + "#<#{self.class.name}:0x#{object_id.to_s(16)} base_url=#{@base_url} max_retries=#{@max_retries} timeout=#{@timeout}>" # rubocop:enable Layout/LineLength end + + define_sorbet_constant!(:RequestComponents) do + T.type_alias do + { + method: Symbol, + path: T.any(String, T::Array[String]), + query: T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))]), + headers: T.nilable( + T::Hash[String, + T.nilable( + T.any( + String, + Integer, + T::Array[T.nilable(T.any(String, Integer))] + ) + )] + ), + body: T.nilable(T.anything), + unwrap: T.nilable( + T.any( + Symbol, + Integer, + T::Array[T.any(Symbol, Integer)], + T.proc.params(arg0: T.anything).returns(T.anything) + ) + ), + page: T.nilable(T::Class[Knockapi::Internal::Type::BasePage[Knockapi::Internal::Type::BaseModel]]), + stream: T.nilable(T::Class[T.anything]), + model: T.nilable(Knockapi::Internal::Type::Converter::Input), + options: T.nilable(Knockapi::RequestOptions::OrHash) + } + end + end + define_sorbet_constant!(:RequestInput) do + T.type_alias do + { + method: Symbol, + url: URI::Generic, + headers: T::Hash[String, String], + body: T.anything, + max_retries: Integer, + timeout: Float + } + end + end end end end diff --git a/lib/knockapi/internal/transport/pooled_net_requester.rb b/lib/knockapi/internal/transport/pooled_net_requester.rb index 7afab2e8..1b4b3079 100644 --- a/lib/knockapi/internal/transport/pooled_net_requester.rb +++ b/lib/knockapi/internal/transport/pooled_net_requester.rb @@ -5,10 +5,14 @@ module Internal module Transport # @api private class PooledNetRequester + extend Knockapi::Internal::Util::SorbetRuntimeSupport + # from the golang stdlib # https://github.com/golang/go/blob/c8eced8580028328fde7c03cbfcb720ce15b2358/src/net/http/transport.go#L49 KEEP_ALIVE_TIMEOUT = 30 + DEFAULT_MAX_CONNECTIONS = [Etc.nprocessors, 99].max + class << self # @api private # @@ -182,11 +186,23 @@ def execute(request) # @api private # # @param size [Integer] - def initialize(size: Etc.nprocessors) + def initialize(size: self.class::DEFAULT_MAX_CONNECTIONS) @mutex = Mutex.new @size = size @pools = {} end + + define_sorbet_constant!(:Request) do + T.type_alias do + { + method: Symbol, + url: URI::Generic, + headers: T::Hash[String, String], + body: T.anything, + deadline: Float + } + end + end end end end diff --git a/lib/knockapi/internal/type/array_of.rb b/lib/knockapi/internal/type/array_of.rb index f6ef02b8..2bf51369 100644 --- a/lib/knockapi/internal/type/array_of.rb +++ b/lib/knockapi/internal/type/array_of.rb @@ -29,7 +29,7 @@ class ArrayOf # # @option spec [Boolean] :"nil?" # - # @return [Knockapi::Internal::Type::ArrayOf] + # @return [self] def self.[](...) = new(...) # @api public diff --git a/lib/knockapi/internal/type/base_model.rb b/lib/knockapi/internal/type/base_model.rb index 62229380..f51420ae 100644 --- a/lib/knockapi/internal/type/base_model.rb +++ b/lib/knockapi/internal/type/base_model.rb @@ -6,6 +6,7 @@ module Type # @abstract class BaseModel extend Knockapi::Internal::Type::Converter + extend Knockapi::Internal::Util::SorbetRuntimeSupport class << self # @api private @@ -13,11 +14,17 @@ class << self # Assumes superclass fields are totally defined before fields are accessed / # defined on subclasses. # - # @return [Hash{Symbol=>Hash{Symbol=>Object}}] - def known_fields - @known_fields ||= (self < Knockapi::Internal::Type::BaseModel ? superclass.known_fields.dup : {}) + # @param child [Class] + def inherited(child) + super + child.known_fields.replace(known_fields.dup) end + # @api private + # + # @return [Hash{Symbol=>Hash{Symbol=>Object}}] + def known_fields = @known_fields ||= {} + # @api private # # @return [Hash{Symbol=>Hash{Symbol=>Object}}] @@ -206,7 +213,7 @@ class << self # # @option state [Integer] :branched # - # @return [Knockapi::Internal::Type::BaseModel, Object] + # @return [self, Object] def coerce(value, state:) exactness = state.fetch(:exactness) @@ -265,7 +272,7 @@ def coerce(value, state:) # @api private # - # @param value [Knockapi::Internal::Type::BaseModel, Object] + # @param value [self, Object] # # @param state [Hash{Symbol=>Object}] . # @@ -306,6 +313,39 @@ def dump(value, state:) end end + class << self + # @api private + # + # @param model [Knockapi::Internal::Type::BaseModel] + # @param convert [Boolean] + # + # @return [Hash{Symbol=>Object}] + def recursively_to_h(model, convert:) + rec = ->(x) do + case x + in Knockapi::Internal::Type::BaseModel + if convert + fields = x.class.known_fields + x.to_h.to_h do |key, val| + [key, rec.call(fields.key?(key) ? x.public_send(key) : val)] + rescue Knockapi::Errors::ConversionError + [key, rec.call(val)] + end + else + rec.call(x.to_h) + end + in Hash + x.transform_values(&rec) + in Array + x.map(&rec) + else + x + end + end + rec.call(model) + end + end + # @api public # # Returns the raw value associated with the given key, if found. Otherwise, nil is @@ -342,9 +382,25 @@ def to_h = @data alias_method :to_hash, :to_h + # @api public + # + # In addition to the behaviour of `#to_h`, this method will recursively call + # `#to_h` on nested models. + # + # @return [Hash{Symbol=>Object}] + def deep_to_h = self.class.recursively_to_h(@data, convert: false) + # @param keys [Array, nil] # # @return [Hash{Symbol=>Object}] + # + # @example + # # `condition` is a `Knockapi::Condition` + # condition => { + # argument: argument, + # operator: operator, + # variable: variable + # } def deconstruct_keys(keys) (keys || self.class.known_fields.keys) .filter_map do |k| @@ -357,29 +413,6 @@ def deconstruct_keys(keys) .to_h end - class << self - # @api private - # - # @param model [Knockapi::Internal::Type::BaseModel] - # - # @return [Hash{Symbol=>Object}] - def walk(model) - walk = ->(x) do - case x - in Knockapi::Internal::Type::BaseModel - walk.call(x.to_h) - in Hash - x.transform_values(&walk) - in Array - x.map(&walk) - else - x - end - end - walk.call(model) - end - end - # @api public # # @param a [Object] @@ -397,15 +430,7 @@ def to_yaml(*a) = Knockapi::Internal::Type::Converter.dump(self.class, self).to_ # Create a new instance of a model. # # @param data [Hash{Symbol=>Object}, self] - def initialize(data = {}) - case Knockapi::Internal::Util.coerce_hash(data) - in Hash => coerced - @data = coerced - else - message = "Expected a #{Hash} or #{Knockapi::Internal::Type::BaseModel}, got #{data.inspect}" - raise ArgumentError.new(message) - end - end + def initialize(data = {}) = (@data = Knockapi::Internal::Util.coerce_hash!(data).to_h) class << self # @api private @@ -433,12 +458,19 @@ def inspect(depth: 0) # @api public # # @return [String] - def to_s = self.class.walk(@data).to_s + def to_s = deep_to_h.to_s # @api private # # @return [String] - def inspect = "#<#{self.class}:0x#{object_id.to_s(16)} #{self}>" + def inspect + converted = self.class.recursively_to_h(self, convert: true) + "#<#{self.class}:0x#{object_id.to_s(16)} #{converted}>" + end + + define_sorbet_constant!(:KnownField) do + T.type_alias { {mode: T.nilable(Symbol), required: T::Boolean, nilable: T::Boolean} } + end end end end diff --git a/lib/knockapi/internal/type/converter.rb b/lib/knockapi/internal/type/converter.rb index 1185105c..da77d2d8 100644 --- a/lib/knockapi/internal/type/converter.rb +++ b/lib/knockapi/internal/type/converter.rb @@ -5,6 +5,8 @@ module Internal module Type # @api private module Converter + extend Knockapi::Internal::Util::SorbetRuntimeSupport + # rubocop:disable Lint/UnusedMethodArgument # @api private @@ -268,6 +270,22 @@ def inspect(target, depth:) end end end + + define_sorbet_constant!(:Input) do + T.type_alias { T.any(Knockapi::Internal::Type::Converter, T::Class[T.anything]) } + end + define_sorbet_constant!(:CoerceState) do + T.type_alias do + { + strictness: T.any(T::Boolean, Symbol), + exactness: {yes: Integer, no: Integer, maybe: Integer}, + branched: Integer + } + end + end + define_sorbet_constant!(:DumpState) do + T.type_alias { {can_retry: T::Boolean} } + end end end end diff --git a/lib/knockapi/internal/type/enum.rb b/lib/knockapi/internal/type/enum.rb index d6951901..a2df0fa4 100644 --- a/lib/knockapi/internal/type/enum.rb +++ b/lib/knockapi/internal/type/enum.rb @@ -17,6 +17,7 @@ module Type # values safely. module Enum include Knockapi::Internal::Type::Converter + include Knockapi::Internal::Util::SorbetRuntimeSupport # All of the valid Symbol values for this enum. # diff --git a/lib/knockapi/internal/type/hash_of.rb b/lib/knockapi/internal/type/hash_of.rb index 049326a5..5332ff2b 100644 --- a/lib/knockapi/internal/type/hash_of.rb +++ b/lib/knockapi/internal/type/hash_of.rb @@ -29,7 +29,7 @@ class HashOf # # @option spec [Boolean] :"nil?" # - # @return [Knockapi::Internal::Type::HashOf] + # @return [self] def self.[](...) = new(...) # @api public diff --git a/lib/knockapi/internal/type/request_parameters.rb b/lib/knockapi/internal/type/request_parameters.rb index 6b87f169..3e184520 100644 --- a/lib/knockapi/internal/type/request_parameters.rb +++ b/lib/knockapi/internal/type/request_parameters.rb @@ -5,10 +5,10 @@ module Internal module Type # @api private module RequestParameters - # @!parse - # # Options to specify HTTP behaviour for this request. - # # @return [Knockapi::RequestOptions, Hash{Symbol=>Object}] - # attr_accessor :request_options + # @!attribute request_options + # Options to specify HTTP behaviour for this request. + # + # @return [Knockapi::RequestOptions, Hash{Symbol=>Object}] # @param mod [Module] def self.included(mod) @@ -28,14 +28,8 @@ def dump_request(params) state = {can_retry: true} case (dumped = dump(params, state: state)) in Hash - options = Knockapi::Internal::Util.coerce_hash(dumped[:request_options]) - request_options = - case [options, state.fetch(:can_retry)] - in [Hash | nil, false] - {**options.to_h, max_retries: 0} - else - options - end + options = Knockapi::Internal::Util.coerce_hash!(dumped[:request_options]).to_h + request_options = state.fetch(:can_retry) ? options : {**options, max_retries: 0} [dumped.except(:request_options), request_options] else [dumped, nil] diff --git a/lib/knockapi/internal/type/union.rb b/lib/knockapi/internal/type/union.rb index 4db14167..65fd6aa3 100644 --- a/lib/knockapi/internal/type/union.rb +++ b/lib/knockapi/internal/type/union.rb @@ -6,17 +6,18 @@ module Type # @api private # # @example - # # `recipient` is a `Knockapi::Models::Recipient` + # # `recipient` is a `Knockapi::Recipient` # case recipient - # when Knockapi::Models::User + # when Knockapi::User # puts(recipient.id) - # when Knockapi::Models::Object + # when Knockapi::Object # puts(recipient._typename) # else # puts(recipient) # end module Union include Knockapi::Internal::Type::Converter + include Knockapi::Internal::Util::SorbetRuntimeSupport # @api private # diff --git a/lib/knockapi/internal/util.rb b/lib/knockapi/internal/util.rb index ef63ce15..1a1693c6 100644 --- a/lib/knockapi/internal/util.rb +++ b/lib/knockapi/internal/util.rb @@ -128,6 +128,22 @@ def coerce_hash(input) input.respond_to?(:to_h) ? input.to_h : input end end + + # @api private + # + # @param input [Object] + # + # @raise [ArgumentError] + # @return [Hash{Object=>Object}, nil] + def coerce_hash!(input) + case coerce_hash(input) + in Hash | nil => coerced + coerced + else + message = "Expected a #{Hash} or #{Knockapi::Internal::Type::BaseModel}, got #{data.inspect}" + raise ArgumentError.new(message) + end + end end class << self @@ -454,7 +470,7 @@ def writable_enum(&blk) # @type [Regexp] JSON_CONTENT = %r{^application/(?:vnd(?:\.[^.]+)*\+)?json(?!l)} # @type [Regexp] - JSONL_CONTENT = %r{^application/(?:x-)?jsonl} + JSONL_CONTENT = %r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)} class << self # @api private @@ -519,7 +535,7 @@ class << self filename = ERB::Util.url_encode(val.filename) y << "; filename=\"#{filename}\"" in Pathname | IO - filename = ERB::Util.url_encode(File.basename(val.to_path)) + filename = ERB::Util.url_encode(::File.basename(val.to_path)) y << "; filename=\"#{filename}\"" else end @@ -785,6 +801,62 @@ def decode_sse(lines) end end end + + # @api private + module SorbetRuntimeSupport + class MissingSorbetRuntimeError < ::RuntimeError + end + + # @api private + # + # @return [Hash{Symbol=>Object}] + private def sorbet_runtime_constants = @sorbet_runtime_constants ||= {} + + # @api private + # + # @param name [Symbol] + def const_missing(name) + super unless sorbet_runtime_constants.key?(name) + + unless Object.const_defined?(:T) + message = "Trying to access a Sorbet constant #{name.inspect} without `sorbet-runtime`." + raise MissingSorbetRuntimeError.new(message) + end + + sorbet_runtime_constants.fetch(name).call + end + + # @api private + # + # @param name [Symbol] + # @param blk [Proc] + def define_sorbet_constant!(name, &blk) = sorbet_runtime_constants.store(name, blk) + end + + extend Knockapi::Internal::Util::SorbetRuntimeSupport + + define_sorbet_constant!(:ParsedUri) do + T.type_alias do + { + scheme: T.nilable(String), + host: T.nilable(String), + port: T.nilable(Integer), + path: T.nilable(String), + query: T::Hash[String, T::Array[String]] + } + end + end + + define_sorbet_constant!(:ServerSentEvent) do + T.type_alias do + { + event: T.nilable(String), + data: T.nilable(String), + id: T.nilable(String), + retry: T.nilable(Integer) + } + end + end end end end diff --git a/lib/knockapi/models.rb b/lib/knockapi/models.rb new file mode 100644 index 00000000..165ef281 --- /dev/null +++ b/lib/knockapi/models.rb @@ -0,0 +1,202 @@ +# frozen_string_literal: true + +module Knockapi + [Knockapi::Internal::Type::BaseModel, *Knockapi::Internal::Type::BaseModel.subclasses].each do |cls| + cls.define_sorbet_constant!(:OrHash) { T.type_alias { T.any(cls, Knockapi::Internal::AnyHash) } } + end + + [ + *Knockapi::Internal::Type::Enum.included_modules, + *Knockapi::Internal::Type::Union.included_modules + ].each do |cls| + cls.constants.each do |name| + case cls.const_get(name) + in true | false + cls.define_sorbet_constant!(:TaggedBoolean) { T.type_alias { T.all(T::Boolean, cls) } } + cls.define_sorbet_constant!(:OrBoolean) { T.type_alias { T::Boolean } } + in Integer + cls.define_sorbet_constant!(:TaggedInteger) { T.type_alias { T.all(Integer, cls) } } + cls.define_sorbet_constant!(:OrInteger) { T.type_alias { Integer } } + in Float + cls.define_sorbet_constant!(:TaggedFloat) { T.type_alias { T.all(Float, cls) } } + cls.define_sorbet_constant!(:OrFloat) { T.type_alias { Float } } + in Symbol + cls.define_sorbet_constant!(:TaggedSymbol) { T.type_alias { T.all(Symbol, cls) } } + cls.define_sorbet_constant!(:OrSymbol) { T.type_alias { T.any(Symbol, String) } } + else + end + end + end + + Activity = Knockapi::Models::Activity + + AudienceAddMembersParams = Knockapi::Models::AudienceAddMembersParams + + AudienceListMembersParams = Knockapi::Models::AudienceListMembersParams + + AudienceMember = Knockapi::Models::AudienceMember + + AudienceRemoveMembersParams = Knockapi::Models::AudienceRemoveMembersParams + + BulkOperation = Knockapi::Models::BulkOperation + + BulkOperationGetParams = Knockapi::Models::BulkOperationGetParams + + Channels = Knockapi::Models::Channels + + Condition = Knockapi::Models::Condition + + IdentifyUserRequest = Knockapi::Models::IdentifyUserRequest + + InlineIdentifyUserRequest = Knockapi::Models::InlineIdentifyUserRequest + + InlineObjectRequest = Knockapi::Models::InlineObjectRequest + + InlineTenantRequest = Knockapi::Models::InlineTenantRequest + + Integrations = Knockapi::Models::Integrations + + Message = Knockapi::Models::Message + + MessageArchiveParams = Knockapi::Models::MessageArchiveParams + + MessageDeliveryLog = Knockapi::Models::MessageDeliveryLog + + MessageEvent = Knockapi::Models::MessageEvent + + MessageGetContentParams = Knockapi::Models::MessageGetContentParams + + MessageGetParams = Knockapi::Models::MessageGetParams + + MessageListActivitiesParams = Knockapi::Models::MessageListActivitiesParams + + MessageListDeliveryLogsParams = Knockapi::Models::MessageListDeliveryLogsParams + + MessageListEventsParams = Knockapi::Models::MessageListEventsParams + + MessageListParams = Knockapi::Models::MessageListParams + + MessageMarkAsInteractedParams = Knockapi::Models::MessageMarkAsInteractedParams + + MessageMarkAsReadParams = Knockapi::Models::MessageMarkAsReadParams + + MessageMarkAsSeenParams = Knockapi::Models::MessageMarkAsSeenParams + + MessageMarkAsUnreadParams = Knockapi::Models::MessageMarkAsUnreadParams + + MessageMarkAsUnseenParams = Knockapi::Models::MessageMarkAsUnseenParams + + Messages = Knockapi::Models::Messages + + MessageUnarchiveParams = Knockapi::Models::MessageUnarchiveParams + + Object = Knockapi::Models::Object + + ObjectAddSubscriptionsParams = Knockapi::Models::ObjectAddSubscriptionsParams + + ObjectDeleteParams = Knockapi::Models::ObjectDeleteParams + + ObjectDeleteSubscriptionsParams = Knockapi::Models::ObjectDeleteSubscriptionsParams + + ObjectGetChannelDataParams = Knockapi::Models::ObjectGetChannelDataParams + + ObjectGetParams = Knockapi::Models::ObjectGetParams + + ObjectGetPreferencesParams = Knockapi::Models::ObjectGetPreferencesParams + + ObjectListMessagesParams = Knockapi::Models::ObjectListMessagesParams + + ObjectListParams = Knockapi::Models::ObjectListParams + + ObjectListPreferencesParams = Knockapi::Models::ObjectListPreferencesParams + + ObjectListSchedulesParams = Knockapi::Models::ObjectListSchedulesParams + + ObjectListSubscriptionsParams = Knockapi::Models::ObjectListSubscriptionsParams + + Objects = Knockapi::Models::Objects + + ObjectSetChannelDataParams = Knockapi::Models::ObjectSetChannelDataParams + + ObjectSetParams = Knockapi::Models::ObjectSetParams + + ObjectSetPreferencesParams = Knockapi::Models::ObjectSetPreferencesParams + + ObjectUnsetChannelDataParams = Knockapi::Models::ObjectUnsetChannelDataParams + + PageInfo = Knockapi::Models::PageInfo + + Providers = Knockapi::Models::Providers + + Recipient = Knockapi::Models::Recipient + + RecipientReference = Knockapi::Models::RecipientReference + + RecipientRequest = Knockapi::Models::RecipientRequest + + Recipients = Knockapi::Models::Recipients + + Schedule = Knockapi::Models::Schedule + + ScheduleCreateParams = Knockapi::Models::ScheduleCreateParams + + ScheduleDeleteParams = Knockapi::Models::ScheduleDeleteParams + + ScheduleListParams = Knockapi::Models::ScheduleListParams + + ScheduleRepeatRule = Knockapi::Models::ScheduleRepeatRule + + Schedules = Knockapi::Models::Schedules + + ScheduleUpdateParams = Knockapi::Models::ScheduleUpdateParams + + Tenant = Knockapi::Models::Tenant + + TenantDeleteParams = Knockapi::Models::TenantDeleteParams + + TenantGetParams = Knockapi::Models::TenantGetParams + + TenantListParams = Knockapi::Models::TenantListParams + + TenantRequest = Knockapi::Models::TenantRequest + + Tenants = Knockapi::Models::Tenants + + TenantSetParams = Knockapi::Models::TenantSetParams + + User = Knockapi::Models::User + + UserDeleteParams = Knockapi::Models::UserDeleteParams + + UserGetChannelDataParams = Knockapi::Models::UserGetChannelDataParams + + UserGetParams = Knockapi::Models::UserGetParams + + UserGetPreferencesParams = Knockapi::Models::UserGetPreferencesParams + + UserListMessagesParams = Knockapi::Models::UserListMessagesParams + + UserListParams = Knockapi::Models::UserListParams + + UserListPreferencesParams = Knockapi::Models::UserListPreferencesParams + + UserListSchedulesParams = Knockapi::Models::UserListSchedulesParams + + UserListSubscriptionsParams = Knockapi::Models::UserListSubscriptionsParams + + UserMergeParams = Knockapi::Models::UserMergeParams + + Users = Knockapi::Models::Users + + UserSetChannelDataParams = Knockapi::Models::UserSetChannelDataParams + + UserSetPreferencesParams = Knockapi::Models::UserSetPreferencesParams + + UserUnsetChannelDataParams = Knockapi::Models::UserUnsetChannelDataParams + + UserUpdateParams = Knockapi::Models::UserUpdateParams + + WorkflowCancelParams = Knockapi::Models::WorkflowCancelParams + + WorkflowTriggerParams = Knockapi::Models::WorkflowTriggerParams +end diff --git a/lib/knockapi/models/activity.rb b/lib/knockapi/models/activity.rb index 6ad2fa33..a6a10a6a 100644 --- a/lib/knockapi/models/activity.rb +++ b/lib/knockapi/models/activity.rb @@ -19,8 +19,8 @@ class Activity < Knockapi::Internal::Type::BaseModel # @!attribute actor # A recipient of a notification, which is either a user or an object. # - # @return [Knockapi::Models::User, Knockapi::Models::Object, nil] - optional :actor, union: -> { Knockapi::Models::Recipient }, nil?: true + # @return [Knockapi::User, Knockapi::Object, nil] + optional :actor, union: -> { Knockapi::Recipient }, nil?: true # @!attribute data # The workflow trigger `data` payload associated with the activity. @@ -37,8 +37,8 @@ class Activity < Knockapi::Internal::Type::BaseModel # @!attribute recipient # A recipient of a notification, which is either a user or an object. # - # @return [Knockapi::Models::User, Knockapi::Models::Object, nil] - optional :recipient, union: -> { Knockapi::Models::Recipient } + # @return [Knockapi::User, Knockapi::Object, nil] + optional :recipient, union: -> { Knockapi::Recipient } # @!attribute updated_at # Timestamp when the activity was last updated. @@ -56,13 +56,13 @@ class Activity < Knockapi::Internal::Type::BaseModel # # @param _typename [String] The typename of the schema. # - # @param actor [Knockapi::Models::User, Knockapi::Models::Object, nil] A recipient of a notification, which is either a user or an object. + # @param actor [Knockapi::User, Knockapi::Object, nil] A recipient of a notification, which is either a user or an object. # # @param data [Hash{Symbol=>Object}, nil] The workflow trigger `data` payload associated with the activity. # # @param inserted_at [Time] Timestamp when the activity was created. # - # @param recipient [Knockapi::Models::User, Knockapi::Models::Object] A recipient of a notification, which is either a user or an object. + # @param recipient [Knockapi::User, Knockapi::Object] A recipient of a notification, which is either a user or an object. # # @param updated_at [Time] Timestamp when the activity was last updated. end diff --git a/lib/knockapi/models/audience_add_members_params.rb b/lib/knockapi/models/audience_add_members_params.rb index 994ec3a3..1f214322 100644 --- a/lib/knockapi/models/audience_add_members_params.rb +++ b/lib/knockapi/models/audience_add_members_params.rb @@ -10,20 +10,20 @@ class AudienceAddMembersParams < Knockapi::Internal::Type::BaseModel # @!attribute members # A list of audience members to add. # - # @return [Array] - required :members, - -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Models::AudienceAddMembersParams::Member] } + # @return [Array] + required :members, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::AudienceAddMembersParams::Member] } # @!method initialize(members:, request_options: {}) - # @param members [Array] A list of audience members to add. + # @param members [Array] A list of audience members to add. # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}] class Member < Knockapi::Internal::Type::BaseModel # @!attribute user + # An object containing the user's ID. # - # @return [Knockapi::Models::AudienceAddMembersParams::Member::User] - required :user, -> { Knockapi::Models::AudienceAddMembersParams::Member::User } + # @return [Knockapi::AudienceAddMembersParams::Member::User] + required :user, -> { Knockapi::AudienceAddMembersParams::Member::User } # @!attribute tenant # The unique identifier for the tenant. @@ -34,11 +34,11 @@ class Member < Knockapi::Internal::Type::BaseModel # @!method initialize(user:, tenant: nil) # An audience member. # - # @param user [Knockapi::Models::AudienceAddMembersParams::Member::User] + # @param user [Knockapi::AudienceAddMembersParams::Member::User] An object containing the user's ID. # # @param tenant [String, nil] The unique identifier for the tenant. - # @see Knockapi::Models::AudienceAddMembersParams::Member#user + # @see Knockapi::AudienceAddMembersParams::Member#user class User < Knockapi::Internal::Type::BaseModel # @!attribute id # The ID for the user that you set when identifying them in Knock. @@ -47,6 +47,8 @@ class User < Knockapi::Internal::Type::BaseModel optional :id, String # @!method initialize(id: nil) + # An object containing the user's ID. + # # @param id [String] The ID for the user that you set when identifying them in Knock. end end diff --git a/lib/knockapi/models/audience_add_members_response.rb b/lib/knockapi/models/audience_add_members_response.rb new file mode 100644 index 00000000..f7cff59a --- /dev/null +++ b/lib/knockapi/models/audience_add_members_response.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +module Knockapi + module Models + AudienceAddMembersResponse = String + end +end diff --git a/lib/knockapi/models/audience_list_members_response.rb b/lib/knockapi/models/audience_list_members_response.rb index d3764797..9b146715 100644 --- a/lib/knockapi/models/audience_list_members_response.rb +++ b/lib/knockapi/models/audience_list_members_response.rb @@ -7,21 +7,21 @@ class AudienceListMembersResponse < Knockapi::Internal::Type::BaseModel # @!attribute entries # A list of audience members. # - # @return [Array] - required :entries, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Models::AudienceMember] } + # @return [Array] + required :entries, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::AudienceMember] } # @!attribute page_info # Pagination information for a list of resources. # - # @return [Knockapi::Models::PageInfo] - required :page_info, -> { Knockapi::Models::PageInfo } + # @return [Knockapi::PageInfo] + required :page_info, -> { Knockapi::PageInfo } # @!method initialize(entries:, page_info:) # A paginated list of audience members. # - # @param entries [Array] A list of audience members. + # @param entries [Array] A list of audience members. # - # @param page_info [Knockapi::Models::PageInfo] Pagination information for a list of resources. + # @param page_info [Knockapi::PageInfo] Pagination information for a list of resources. end end end diff --git a/lib/knockapi/models/audience_member.rb b/lib/knockapi/models/audience_member.rb index a5f0d236..fd254d5c 100644 --- a/lib/knockapi/models/audience_member.rb +++ b/lib/knockapi/models/audience_member.rb @@ -20,8 +20,8 @@ class AudienceMember < Knockapi::Internal::Type::BaseModel # receive notifications through Knock. Users are the most common recipients of # notifications and are always referenced by your internal identifier. # - # @return [Knockapi::Models::User] - required :user, -> { Knockapi::Models::User } + # @return [Knockapi::User] + required :user, -> { Knockapi::User } # @!attribute user_id # The ID for the user that you set when identifying them in Knock. @@ -36,8 +36,8 @@ class AudienceMember < Knockapi::Internal::Type::BaseModel optional :tenant, String, nil?: true # @!method initialize(_typename:, added_at:, user:, user_id:, tenant: nil) - # Some parameter documentations has been truncated, see - # {Knockapi::Models::AudienceMember} for more details. + # Some parameter documentations has been truncated, see {Knockapi::AudienceMember} + # for more details. # # An audience member. # @@ -45,8 +45,7 @@ class AudienceMember < Knockapi::Internal::Type::BaseModel # # @param added_at [Time] Timestamp when the resource was created. # - # @param user [Knockapi::Models::User] A [User](/concepts/users) represents an individual in your system who can receiv - # ... + # @param user [Knockapi::User] A [User](/concepts/users) represents an individual in your system who can receiv # # @param user_id [String] The ID for the user that you set when identifying them in Knock. # diff --git a/lib/knockapi/models/audience_remove_members_params.rb b/lib/knockapi/models/audience_remove_members_params.rb index 5aba10ce..6d4164ec 100644 --- a/lib/knockapi/models/audience_remove_members_params.rb +++ b/lib/knockapi/models/audience_remove_members_params.rb @@ -10,20 +10,23 @@ class AudienceRemoveMembersParams < Knockapi::Internal::Type::BaseModel # @!attribute members # A list of audience members to remove. # - # @return [Array] + # @return [Array] required :members, - -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Models::AudienceRemoveMembersParams::Member] } + -> { + Knockapi::Internal::Type::ArrayOf[Knockapi::AudienceRemoveMembersParams::Member] + } # @!method initialize(members:, request_options: {}) - # @param members [Array] A list of audience members to remove. + # @param members [Array] A list of audience members to remove. # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}] class Member < Knockapi::Internal::Type::BaseModel # @!attribute user + # An object containing the user's ID. # - # @return [Knockapi::Models::AudienceRemoveMembersParams::Member::User] - required :user, -> { Knockapi::Models::AudienceRemoveMembersParams::Member::User } + # @return [Knockapi::AudienceRemoveMembersParams::Member::User] + required :user, -> { Knockapi::AudienceRemoveMembersParams::Member::User } # @!attribute tenant # The unique identifier for the tenant. @@ -34,11 +37,11 @@ class Member < Knockapi::Internal::Type::BaseModel # @!method initialize(user:, tenant: nil) # An audience member. # - # @param user [Knockapi::Models::AudienceRemoveMembersParams::Member::User] + # @param user [Knockapi::AudienceRemoveMembersParams::Member::User] An object containing the user's ID. # # @param tenant [String, nil] The unique identifier for the tenant. - # @see Knockapi::Models::AudienceRemoveMembersParams::Member#user + # @see Knockapi::AudienceRemoveMembersParams::Member#user class User < Knockapi::Internal::Type::BaseModel # @!attribute id # The ID for the user that you set when identifying them in Knock. @@ -47,6 +50,8 @@ class User < Knockapi::Internal::Type::BaseModel optional :id, String # @!method initialize(id: nil) + # An object containing the user's ID. + # # @param id [String] The ID for the user that you set when identifying them in Knock. end end diff --git a/lib/knockapi/models/audience_remove_members_response.rb b/lib/knockapi/models/audience_remove_members_response.rb new file mode 100644 index 00000000..f303d823 --- /dev/null +++ b/lib/knockapi/models/audience_remove_members_response.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +module Knockapi + module Models + AudienceRemoveMembersResponse = String + end +end diff --git a/lib/knockapi/models/bulk_operation.rb b/lib/knockapi/models/bulk_operation.rb index d313e0e7..d7ffb7c5 100644 --- a/lib/knockapi/models/bulk_operation.rb +++ b/lib/knockapi/models/bulk_operation.rb @@ -43,8 +43,8 @@ class BulkOperation < Knockapi::Internal::Type::BaseModel # @!attribute status # The status of the bulk operation. # - # @return [Symbol, Knockapi::Models::BulkOperation::Status] - required :status, enum: -> { Knockapi::Models::BulkOperation::Status } + # @return [Symbol, Knockapi::BulkOperation::Status] + required :status, enum: -> { Knockapi::BulkOperation::Status } # @!attribute success_count # The number of successful operations. @@ -73,9 +73,8 @@ class BulkOperation < Knockapi::Internal::Type::BaseModel # @!attribute error_items # A list of items that failed to be processed. # - # @return [Array, nil] - optional :error_items, - -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Models::BulkOperation::ErrorItem] } + # @return [Array, nil] + optional :error_items, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::BulkOperation::ErrorItem] } # @!attribute failed_at # Timestamp when the bulk operation failed. @@ -110,7 +109,7 @@ class BulkOperation < Knockapi::Internal::Type::BaseModel # # @param processed_rows [Integer] The number of rows processed so far. # - # @param status [Symbol, Knockapi::Models::BulkOperation::Status] The status of the bulk operation. + # @param status [Symbol, Knockapi::BulkOperation::Status] The status of the bulk operation. # # @param success_count [Integer] The number of successful operations. # @@ -120,7 +119,7 @@ class BulkOperation < Knockapi::Internal::Type::BaseModel # # @param error_count [Integer] The number of failed operations. # - # @param error_items [Array] A list of items that failed to be processed. + # @param error_items [Array] A list of items that failed to be processed. # # @param failed_at [Time, nil] Timestamp when the bulk operation failed. # @@ -130,7 +129,7 @@ class BulkOperation < Knockapi::Internal::Type::BaseModel # The status of the bulk operation. # - # @see Knockapi::Models::BulkOperation#status + # @see Knockapi::BulkOperation#status module Status extend Knockapi::Internal::Type::Enum diff --git a/lib/knockapi/models/channels/bulk_update_message_status_params.rb b/lib/knockapi/models/channels/bulk_update_message_status_params.rb index 1fee6561..34ce554d 100644 --- a/lib/knockapi/models/channels/bulk_update_message_status_params.rb +++ b/lib/knockapi/models/channels/bulk_update_message_status_params.rb @@ -11,22 +11,24 @@ class BulkUpdateMessageStatusParams < Knockapi::Internal::Type::BaseModel # @!attribute archived # Limits the results to messages with the given archived status. # - # @return [Symbol, Knockapi::Models::Channels::BulkUpdateMessageStatusParams::Archived, nil] - optional :archived, enum: -> { Knockapi::Models::Channels::BulkUpdateMessageStatusParams::Archived } + # @return [Symbol, Knockapi::Channels::BulkUpdateMessageStatusParams::Archived, nil] + optional :archived, enum: -> { Knockapi::Channels::BulkUpdateMessageStatusParams::Archived } # @!attribute delivery_status # Limits the results to messages with the given delivery status. # - # @return [Symbol, Knockapi::Models::Channels::BulkUpdateMessageStatusParams::DeliveryStatus, nil] + # @return [Symbol, Knockapi::Channels::BulkUpdateMessageStatusParams::DeliveryStatus, nil] optional :delivery_status, - enum: -> { Knockapi::Models::Channels::BulkUpdateMessageStatusParams::DeliveryStatus } + enum: -> { + Knockapi::Channels::BulkUpdateMessageStatusParams::DeliveryStatus + } # @!attribute engagement_status # Limits the results to messages with the given engagement status. # - # @return [Symbol, Knockapi::Models::Channels::BulkUpdateMessageStatusParams::EngagementStatus, nil] + # @return [Symbol, Knockapi::Channels::BulkUpdateMessageStatusParams::EngagementStatus, nil] optional :engagement_status, - enum: -> { Knockapi::Models::Channels::BulkUpdateMessageStatusParams::EngagementStatus } + enum: -> { Knockapi::Channels::BulkUpdateMessageStatusParams::EngagementStatus } # @!attribute has_tenant # Limits the results to messages that have a tenant or not. @@ -76,11 +78,11 @@ class BulkUpdateMessageStatusParams < Knockapi::Internal::Type::BaseModel # Some parameter documentations has been truncated, see # {Knockapi::Models::Channels::BulkUpdateMessageStatusParams} for more details. # - # @param archived [Symbol, Knockapi::Models::Channels::BulkUpdateMessageStatusParams::Archived] Limits the results to messages with the given archived status. + # @param archived [Symbol, Knockapi::Channels::BulkUpdateMessageStatusParams::Archived] Limits the results to messages with the given archived status. # - # @param delivery_status [Symbol, Knockapi::Models::Channels::BulkUpdateMessageStatusParams::DeliveryStatus] Limits the results to messages with the given delivery status. + # @param delivery_status [Symbol, Knockapi::Channels::BulkUpdateMessageStatusParams::DeliveryStatus] Limits the results to messages with the given delivery status. # - # @param engagement_status [Symbol, Knockapi::Models::Channels::BulkUpdateMessageStatusParams::EngagementStatus] Limits the results to messages with the given engagement status. + # @param engagement_status [Symbol, Knockapi::Channels::BulkUpdateMessageStatusParams::EngagementStatus] Limits the results to messages with the given engagement status. # # @param has_tenant [Boolean] Limits the results to messages that have a tenant or not. # @@ -93,7 +95,6 @@ class BulkUpdateMessageStatusParams < Knockapi::Internal::Type::BaseModel # @param tenants [Array] Limits the results to messages with the given tenant IDs. # # @param trigger_data [String] Limits the results to only messages that were generated with the given data. See - # ... # # @param workflows [Array] Limits the results to messages with the given workflow keys. # diff --git a/lib/knockapi/models/condition.rb b/lib/knockapi/models/condition.rb index 299dd957..b0d5cfd1 100644 --- a/lib/knockapi/models/condition.rb +++ b/lib/knockapi/models/condition.rb @@ -12,8 +12,8 @@ class Condition < Knockapi::Internal::Type::BaseModel # @!attribute operator # The operator to use in the condition evaluation. # - # @return [Symbol, Knockapi::Models::Condition::Operator] - required :operator, enum: -> { Knockapi::Models::Condition::Operator } + # @return [Symbol, Knockapi::Condition::Operator] + required :operator, enum: -> { Knockapi::Condition::Operator } # @!attribute variable # The variable to be evaluated in the condition. @@ -26,13 +26,13 @@ class Condition < Knockapi::Internal::Type::BaseModel # # @param argument [String, nil] The argument value to compare against in the condition. # - # @param operator [Symbol, Knockapi::Models::Condition::Operator] The operator to use in the condition evaluation. + # @param operator [Symbol, Knockapi::Condition::Operator] The operator to use in the condition evaluation. # # @param variable [String] The variable to be evaluated in the condition. # The operator to use in the condition evaluation. # - # @see Knockapi::Models::Condition#operator + # @see Knockapi::Condition#operator module Operator extend Knockapi::Internal::Type::Enum diff --git a/lib/knockapi/models/identify_user_request.rb b/lib/knockapi/models/identify_user_request.rb index 9fe8ffa3..cdc8b511 100644 --- a/lib/knockapi/models/identify_user_request.rb +++ b/lib/knockapi/models/identify_user_request.rb @@ -12,9 +12,11 @@ class IdentifyUserRequest < Knockapi::Internal::Type::BaseModel # @!attribute channel_data # A request to set channel data for a type of channel inline. # - # @return [Hash{Symbol=>Knockapi::Models::Recipients::ChannelDataRequest}, nil] + # @return [Hash{Symbol=>Knockapi::Recipients::PushChannelData, Knockapi::Recipients::OneSignalChannelData, Knockapi::Recipients::SlackChannelData, Knockapi::Recipients::MsTeamsChannelData, Knockapi::Recipients::DiscordChannelData}, nil] optional :channel_data, - -> { Knockapi::Internal::Type::HashOf[Knockapi::Models::Recipients::ChannelDataRequest] }, + -> { + Knockapi::Internal::Type::HashOf[union: Knockapi::Recipients::InlineChannelDataRequestItem] + }, nil?: true # @!attribute created_at @@ -42,7 +44,7 @@ class IdentifyUserRequest < Knockapi::Internal::Type::BaseModel optional :name, String, nil?: true # @!attribute phone_number - # The [E.164](https://www.twilio.com/docs/glossary/what-e164) phone number of the + # The [E.164](https://www.twilio.com/docs/glossary/what-e164) phone number of the # user (required for SMS channels). # # @return [String, nil] @@ -51,23 +53,23 @@ class IdentifyUserRequest < Knockapi::Internal::Type::BaseModel # @!attribute preferences # Inline set preferences for a recipient, where the key is the preference set id. # - # @return [Hash{Symbol=>Knockapi::Models::Recipients::PreferenceSetRequest}, nil] + # @return [Hash{Symbol=>Knockapi::Recipients::PreferenceSetRequest}, nil] optional :preferences, - -> { Knockapi::Internal::Type::HashOf[Knockapi::Models::Recipients::PreferenceSetRequest] }, + -> { Knockapi::Internal::Type::HashOf[Knockapi::Recipients::PreferenceSetRequest] }, nil?: true # @!attribute timezone - # The timezone of the user. Must be a valid - # [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). - # Used for - # [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients). + # The timezone of the user. Must be a + # valid [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + # Used + # for [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients). # # @return [String, nil] optional :timezone, String, nil?: true # @!method initialize(avatar: nil, channel_data: nil, created_at: nil, email: nil, locale: nil, name: nil, phone_number: nil, preferences: nil, timezone: nil) # Some parameter documentations has been truncated, see - # {Knockapi::Models::IdentifyUserRequest} for more details. + # {Knockapi::IdentifyUserRequest} for more details. # # A set of parameters to identify a user with. Does not include the user ID, as # that's specified elsewhere in the request. You can supply any additional @@ -75,24 +77,21 @@ class IdentifyUserRequest < Knockapi::Internal::Type::BaseModel # # @param avatar [String, nil] URL to the user's avatar image. # - # @param channel_data [Hash{Symbol=>Knockapi::Models::Recipients::ChannelDataRequest}, nil] A request to set channel data for a type of channel inline. + # @param channel_data [Hash{Symbol=>Knockapi::Recipients::PushChannelData, Knockapi::Recipients::OneSignalChannelData, Knockapi::Recipients::SlackChannelData, Knockapi::Recipients::MsTeamsChannelData, Knockapi::Recipients::DiscordChannelData}, nil] A request to set channel data for a type of channel inline. # # @param created_at [Time, nil] The creation date of the user from your system. # # @param email [String, nil] The primary email address for the user. # # @param locale [String, nil] The locale of the user. Used for [message localization](/concepts/translations). - # ... # # @param name [String, nil] Display name of the user. # - # @param phone_number [String, nil] The [E.164](https://www.twilio.com/docs/glossary/what-e164) phone number of the - # ... + # @param phone_number [String, nil] The [E.164](https://www.twilio.com/docs/glossary/what-e164) phone number of the # - # @param preferences [Hash{Symbol=>Knockapi::Models::Recipients::PreferenceSetRequest}, nil] Inline set preferences for a recipient, where the key is the preference set id. + # @param preferences [Hash{Symbol=>Knockapi::Recipients::PreferenceSetRequest}, nil] Inline set preferences for a recipient, where the key is the preference set id. # - # @param timezone [String, nil] The timezone of the user. Must be a valid [tz database time zone string](https:/ - # ... + # @param timezone [String, nil] The timezone of the user. Must be a valid [tz database time zone string](https:/ end end end diff --git a/lib/knockapi/models/inline_identify_user_request.rb b/lib/knockapi/models/inline_identify_user_request.rb index 8925d690..bfc02776 100644 --- a/lib/knockapi/models/inline_identify_user_request.rb +++ b/lib/knockapi/models/inline_identify_user_request.rb @@ -9,12 +9,20 @@ class InlineIdentifyUserRequest < Knockapi::Internal::Type::BaseModel # @return [String] required :id, String + # @!attribute avatar + # URL to the user's avatar image. + # + # @return [String, nil] + optional :avatar, String, nil?: true + # @!attribute channel_data # A request to set channel data for a type of channel inline. # - # @return [Hash{Symbol=>Knockapi::Models::Recipients::ChannelDataRequest}, nil] + # @return [Hash{Symbol=>Knockapi::Recipients::PushChannelData, Knockapi::Recipients::OneSignalChannelData, Knockapi::Recipients::SlackChannelData, Knockapi::Recipients::MsTeamsChannelData, Knockapi::Recipients::DiscordChannelData}, nil] optional :channel_data, - -> { Knockapi::Internal::Type::HashOf[Knockapi::Models::Recipients::ChannelDataRequest] }, + -> { + Knockapi::Internal::Type::HashOf[union: Knockapi::Recipients::InlineChannelDataRequestItem] + }, nil?: true # @!attribute created_at @@ -23,15 +31,52 @@ class InlineIdentifyUserRequest < Knockapi::Internal::Type::BaseModel # @return [Time, nil] optional :created_at, Time, nil?: true + # @!attribute email + # The primary email address for the user. + # + # @return [String, nil] + optional :email, String, nil?: true + + # @!attribute locale + # The locale of the user. Used for [message localization](/concepts/translations). + # + # @return [String, nil] + optional :locale, String, nil?: true + + # @!attribute name + # Display name of the user. + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute phone_number + # The [E.164](https://www.twilio.com/docs/glossary/what-e164) phone number of the + # user (required for SMS channels). + # + # @return [String, nil] + optional :phone_number, String, nil?: true + # @!attribute preferences # Inline set preferences for a recipient, where the key is the preference set id. # - # @return [Hash{Symbol=>Knockapi::Models::Recipients::PreferenceSetRequest}, nil] + # @return [Hash{Symbol=>Knockapi::Recipients::PreferenceSetRequest}, nil] optional :preferences, - -> { Knockapi::Internal::Type::HashOf[Knockapi::Models::Recipients::PreferenceSetRequest] }, + -> { Knockapi::Internal::Type::HashOf[Knockapi::Recipients::PreferenceSetRequest] }, nil?: true - # @!method initialize(id:, channel_data: nil, created_at: nil, preferences: nil) + # @!attribute timezone + # The timezone of the user. Must be a + # valid [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + # Used + # for [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients). + # + # @return [String, nil] + optional :timezone, String, nil?: true + + # @!method initialize(id:, avatar: nil, channel_data: nil, created_at: nil, email: nil, locale: nil, name: nil, phone_number: nil, preferences: nil, timezone: nil) + # Some parameter documentations has been truncated, see + # {Knockapi::InlineIdentifyUserRequest} for more details. + # # A set of parameters to inline-identify a user with. Inline identifying the user # will ensure that the user is available before the request is executed in Knock. # It will perform an upsert for the user you're supplying, replacing any @@ -39,11 +84,23 @@ class InlineIdentifyUserRequest < Knockapi::Internal::Type::BaseModel # # @param id [String] The ID for the user that you set when identifying them in Knock. # - # @param channel_data [Hash{Symbol=>Knockapi::Models::Recipients::ChannelDataRequest}, nil] A request to set channel data for a type of channel inline. + # @param avatar [String, nil] URL to the user's avatar image. + # + # @param channel_data [Hash{Symbol=>Knockapi::Recipients::PushChannelData, Knockapi::Recipients::OneSignalChannelData, Knockapi::Recipients::SlackChannelData, Knockapi::Recipients::MsTeamsChannelData, Knockapi::Recipients::DiscordChannelData}, nil] A request to set channel data for a type of channel inline. # # @param created_at [Time, nil] The creation date of the user from your system. # - # @param preferences [Hash{Symbol=>Knockapi::Models::Recipients::PreferenceSetRequest}, nil] Inline set preferences for a recipient, where the key is the preference set id. + # @param email [String, nil] The primary email address for the user. + # + # @param locale [String, nil] The locale of the user. Used for [message localization](/concepts/translations). + # + # @param name [String, nil] Display name of the user. + # + # @param phone_number [String, nil] The [E.164](https://www.twilio.com/docs/glossary/what-e164) phone number of the + # + # @param preferences [Hash{Symbol=>Knockapi::Recipients::PreferenceSetRequest}, nil] Inline set preferences for a recipient, where the key is the preference set id. + # + # @param timezone [String, nil] The timezone of the user. Must be a valid [tz database time zone string](https:/ end end end diff --git a/lib/knockapi/models/inline_object_request.rb b/lib/knockapi/models/inline_object_request.rb index fd3b3151..b842fe03 100644 --- a/lib/knockapi/models/inline_object_request.rb +++ b/lib/knockapi/models/inline_object_request.rb @@ -18,9 +18,11 @@ class InlineObjectRequest < Knockapi::Internal::Type::BaseModel # @!attribute channel_data # A request to set channel data for a type of channel inline. # - # @return [Hash{Symbol=>Knockapi::Models::Recipients::ChannelDataRequest}, nil] + # @return [Hash{Symbol=>Knockapi::Recipients::PushChannelData, Knockapi::Recipients::OneSignalChannelData, Knockapi::Recipients::SlackChannelData, Knockapi::Recipients::MsTeamsChannelData, Knockapi::Recipients::DiscordChannelData}, nil] optional :channel_data, - -> { Knockapi::Internal::Type::HashOf[Knockapi::Models::Recipients::ChannelDataRequest] }, + -> { + Knockapi::Internal::Type::HashOf[union: Knockapi::Recipients::InlineChannelDataRequestItem] + }, nil?: true # @!attribute created_at @@ -32,9 +34,9 @@ class InlineObjectRequest < Knockapi::Internal::Type::BaseModel # @!attribute preferences # Inline set preferences for a recipient, where the key is the preference set id. # - # @return [Hash{Symbol=>Knockapi::Models::Recipients::PreferenceSetRequest}, nil] + # @return [Hash{Symbol=>Knockapi::Recipients::PreferenceSetRequest}, nil] optional :preferences, - -> { Knockapi::Internal::Type::HashOf[Knockapi::Models::Recipients::PreferenceSetRequest] }, + -> { Knockapi::Internal::Type::HashOf[Knockapi::Recipients::PreferenceSetRequest] }, nil?: true # @!method initialize(id:, collection:, channel_data: nil, created_at: nil, preferences: nil) @@ -44,11 +46,11 @@ class InlineObjectRequest < Knockapi::Internal::Type::BaseModel # # @param collection [String] The collection this object belongs to. # - # @param channel_data [Hash{Symbol=>Knockapi::Models::Recipients::ChannelDataRequest}, nil] A request to set channel data for a type of channel inline. + # @param channel_data [Hash{Symbol=>Knockapi::Recipients::PushChannelData, Knockapi::Recipients::OneSignalChannelData, Knockapi::Recipients::SlackChannelData, Knockapi::Recipients::MsTeamsChannelData, Knockapi::Recipients::DiscordChannelData}, nil] A request to set channel data for a type of channel inline. # # @param created_at [Time, nil] Timestamp when the resource was created. # - # @param preferences [Hash{Symbol=>Knockapi::Models::Recipients::PreferenceSetRequest}, nil] Inline set preferences for a recipient, where the key is the preference set id. + # @param preferences [Hash{Symbol=>Knockapi::Recipients::PreferenceSetRequest}, nil] Inline set preferences for a recipient, where the key is the preference set id. end end end diff --git a/lib/knockapi/models/inline_tenant_request.rb b/lib/knockapi/models/inline_tenant_request.rb index 69784162..a13a1270 100644 --- a/lib/knockapi/models/inline_tenant_request.rb +++ b/lib/knockapi/models/inline_tenant_request.rb @@ -10,10 +10,14 @@ module InlineTenantRequest variant String # A tenant to be set in the system. You can supply any additional properties on the tenant object. - variant -> { Knockapi::Models::TenantRequest } + variant -> { Knockapi::TenantRequest } # @!method self.variants - # @return [Array(String, Knockapi::Models::TenantRequest)] + # @return [Array(String, Knockapi::TenantRequest)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(String, Knockapi::TenantRequest) } + end end end end diff --git a/lib/knockapi/models/message.rb b/lib/knockapi/models/message.rb index fc8e3913..386a95db 100644 --- a/lib/knockapi/models/message.rb +++ b/lib/knockapi/models/message.rb @@ -21,8 +21,8 @@ class Message < Knockapi::Internal::Type::BaseModel # that can contain up to 10 actors if the message is produced from a # [batch](/designing-workflows/batch-function). # - # @return [Array, nil] - optional :actors, -> { Knockapi::Internal::Type::ArrayOf[union: Knockapi::Models::RecipientReference] } + # @return [Array, nil] + optional :actors, -> { Knockapi::Internal::Type::ArrayOf[union: Knockapi::RecipientReference] } # @!attribute archived_at # Timestamp when the message was archived. @@ -55,9 +55,9 @@ class Message < Knockapi::Internal::Type::BaseModel # @!attribute engagement_statuses # A list of engagement statuses. # - # @return [Array, nil] + # @return [Array, nil] optional :engagement_statuses, - -> { Knockapi::Internal::Type::ArrayOf[enum: Knockapi::Models::Message::EngagementStatus] } + -> { Knockapi::Internal::Type::ArrayOf[enum: Knockapi::Message::EngagementStatus] } # @!attribute inserted_at # Timestamp when the resource was created. @@ -93,8 +93,8 @@ class Message < Knockapi::Internal::Type::BaseModel # A reference to a recipient, either a user identifier (string) or an object # reference (ID, collection). # - # @return [String, Knockapi::Models::RecipientReference::ObjectReference, nil] - optional :recipient, union: -> { Knockapi::Models::RecipientReference } + # @return [String, Knockapi::RecipientReference::ObjectReference, nil] + optional :recipient, union: -> { Knockapi::RecipientReference } # @!attribute scheduled_at # Timestamp when the message was scheduled to be sent. @@ -111,14 +111,14 @@ class Message < Knockapi::Internal::Type::BaseModel # @!attribute source # The workflow that triggered the message. # - # @return [Knockapi::Models::Message::Source, nil] - optional :source, -> { Knockapi::Models::Message::Source } + # @return [Knockapi::Message::Source, nil] + optional :source, -> { Knockapi::Message::Source } # @!attribute status # The message delivery status. # - # @return [Symbol, Knockapi::Models::Message::Status, nil] - optional :status, enum: -> { Knockapi::Models::Message::Status } + # @return [Symbol, Knockapi::Message::Status, nil] + optional :status, enum: -> { Knockapi::Message::Status } # @!attribute tenant # The ID of the `tenant` associated with the message. Only present when a `tenant` @@ -142,8 +142,8 @@ class Message < Knockapi::Internal::Type::BaseModel optional :workflow, String, nil?: true # @!method initialize(id: nil, _typename: nil, actors: nil, archived_at: nil, channel_id: nil, clicked_at: nil, data: nil, engagement_statuses: nil, inserted_at: nil, interacted_at: nil, link_clicked_at: nil, metadata: nil, read_at: nil, recipient: nil, scheduled_at: nil, seen_at: nil, source: nil, status: nil, tenant: nil, updated_at: nil, workflow: nil) - # Some parameter documentations has been truncated, see - # {Knockapi::Models::Message} for more details. + # Some parameter documentations has been truncated, see {Knockapi::Message} for + # more details. # # Represents a single message that was generated by a workflow for a given # channel. @@ -152,8 +152,7 @@ class Message < Knockapi::Internal::Type::BaseModel # # @param _typename [String] The typename of the schema. # - # @param actors [Array] One or more actors that are associated with this message. Note: this is a list t - # ... + # @param actors [Array] One or more actors that are associated with this message. Note: this is a list t # # @param archived_at [Time, nil] Timestamp when the message was archived. # @@ -162,9 +161,8 @@ class Message < Knockapi::Internal::Type::BaseModel # @param clicked_at [Time, nil] Timestamp when the message was clicked. # # @param data [Hash{Symbol=>Object}, nil] Data associated with the message’s workflow run. Includes the workflow trigger r - # ... # - # @param engagement_statuses [Array] A list of engagement statuses. + # @param engagement_statuses [Array] A list of engagement statuses. # # @param inserted_at [Time] Timestamp when the resource was created. # @@ -176,19 +174,17 @@ class Message < Knockapi::Internal::Type::BaseModel # # @param read_at [Time, nil] Timestamp when the message was read. # - # @param recipient [String, Knockapi::Models::RecipientReference::ObjectReference] A reference to a recipient, either a user identifier (string) or an object refer - # ... + # @param recipient [String, Knockapi::RecipientReference::ObjectReference] A reference to a recipient, either a user identifier (string) or an object refer # # @param scheduled_at [Time, nil] Timestamp when the message was scheduled to be sent. # # @param seen_at [Time, nil] Timestamp when the message was seen. # - # @param source [Knockapi::Models::Message::Source] The workflow that triggered the message. + # @param source [Knockapi::Message::Source] The workflow that triggered the message. # - # @param status [Symbol, Knockapi::Models::Message::Status] The message delivery status. + # @param status [Symbol, Knockapi::Message::Status] The message delivery status. # # @param tenant [String, nil] The ID of the `tenant` associated with the message. Only present when a `tenant` - # ... # # @param updated_at [Time] The timestamp when the resource was last updated. # @@ -209,7 +205,7 @@ module EngagementStatus # @return [Array] end - # @see Knockapi::Models::Message#source + # @see Knockapi::Message#source class Source < Knockapi::Internal::Type::BaseModel # @!attribute _typename # @@ -248,7 +244,7 @@ class Source < Knockapi::Internal::Type::BaseModel # The message delivery status. # - # @see Knockapi::Models::Message#status + # @see Knockapi::Message#status module Status extend Knockapi::Internal::Type::Enum diff --git a/lib/knockapi/models/message_delivery_log.rb b/lib/knockapi/models/message_delivery_log.rb index 4c606e28..6a8c282a 100644 --- a/lib/knockapi/models/message_delivery_log.rb +++ b/lib/knockapi/models/message_delivery_log.rb @@ -31,14 +31,14 @@ class MessageDeliveryLog < Knockapi::Internal::Type::BaseModel # @!attribute request # A message delivery log request. # - # @return [Knockapi::Models::MessageDeliveryLog::Request] - required :request, -> { Knockapi::Models::MessageDeliveryLog::Request } + # @return [Knockapi::MessageDeliveryLog::Request] + required :request, -> { Knockapi::MessageDeliveryLog::Request } # @!attribute response # A message delivery log response. # - # @return [Knockapi::Models::MessageDeliveryLog::Response] - required :response, -> { Knockapi::Models::MessageDeliveryLog::Response } + # @return [Knockapi::MessageDeliveryLog::Response] + required :response, -> { Knockapi::MessageDeliveryLog::Response } # @!attribute service_name # The name of the service that processed the delivery. @@ -58,19 +58,19 @@ class MessageDeliveryLog < Knockapi::Internal::Type::BaseModel # # @param inserted_at [String] Timestamp when the message delivery log was created. # - # @param request [Knockapi::Models::MessageDeliveryLog::Request] A message delivery log request. + # @param request [Knockapi::MessageDeliveryLog::Request] A message delivery log request. # - # @param response [Knockapi::Models::MessageDeliveryLog::Response] A message delivery log response. + # @param response [Knockapi::MessageDeliveryLog::Response] A message delivery log response. # # @param service_name [String] The name of the service that processed the delivery. - # @see Knockapi::Models::MessageDeliveryLog#request + # @see Knockapi::MessageDeliveryLog#request class Request < Knockapi::Internal::Type::BaseModel # @!attribute body # The body content that was sent with the request. # # @return [String, Hash{Symbol=>Object}, nil] - optional :body, union: -> { Knockapi::Models::MessageDeliveryLog::Request::Body } + optional :body, union: -> { Knockapi::MessageDeliveryLog::Request::Body } # @!attribute headers # The headers that were sent with the request. @@ -87,8 +87,8 @@ class Request < Knockapi::Internal::Type::BaseModel # @!attribute method_ # The HTTP method used for the request. # - # @return [Symbol, Knockapi::Models::MessageDeliveryLog::Request::Method, nil] - optional :method_, enum: -> { Knockapi::Models::MessageDeliveryLog::Request::Method }, api_name: :method + # @return [Symbol, Knockapi::MessageDeliveryLog::Request::Method, nil] + optional :method_, enum: -> { Knockapi::MessageDeliveryLog::Request::Method }, api_name: :method # @!attribute path # The path of the URL that was requested. @@ -111,7 +111,7 @@ class Request < Knockapi::Internal::Type::BaseModel # # @param host [String] The host to which the request was sent. # - # @param method_ [Symbol, Knockapi::Models::MessageDeliveryLog::Request::Method] The HTTP method used for the request. + # @param method_ [Symbol, Knockapi::MessageDeliveryLog::Request::Method] The HTTP method used for the request. # # @param path [String] The path of the URL that was requested. # @@ -119,24 +119,28 @@ class Request < Knockapi::Internal::Type::BaseModel # The body content that was sent with the request. # - # @see Knockapi::Models::MessageDeliveryLog::Request#body + # @see Knockapi::MessageDeliveryLog::Request#body module Body extend Knockapi::Internal::Type::Union variant String - variant -> { Knockapi::Models::MessageDeliveryLog::Request::Body::UnionMember1Map } + variant -> { Knockapi::MessageDeliveryLog::Request::Body::UnionMember1Map } # @!method self.variants # @return [Array(String, Hash{Symbol=>Object})] + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(String, T::Hash[Symbol, T.anything]) } + end + # @type [Knockapi::Internal::Type::Converter] UnionMember1Map = Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown] end # The HTTP method used for the request. # - # @see Knockapi::Models::MessageDeliveryLog::Request#method_ + # @see Knockapi::MessageDeliveryLog::Request#method_ module Method extend Knockapi::Internal::Type::Enum @@ -151,13 +155,13 @@ module Method end end - # @see Knockapi::Models::MessageDeliveryLog#response + # @see Knockapi::MessageDeliveryLog#response class Response < Knockapi::Internal::Type::BaseModel # @!attribute body # The body content that was received with the response. # # @return [String, Hash{Symbol=>Object}, nil] - optional :body, union: -> { Knockapi::Models::MessageDeliveryLog::Response::Body } + optional :body, union: -> { Knockapi::MessageDeliveryLog::Response::Body } # @!attribute headers # The headers that were received with the response. @@ -182,17 +186,21 @@ class Response < Knockapi::Internal::Type::BaseModel # The body content that was received with the response. # - # @see Knockapi::Models::MessageDeliveryLog::Response#body + # @see Knockapi::MessageDeliveryLog::Response#body module Body extend Knockapi::Internal::Type::Union variant String - variant -> { Knockapi::Models::MessageDeliveryLog::Response::Body::UnionMember1Map } + variant -> { Knockapi::MessageDeliveryLog::Response::Body::UnionMember1Map } # @!method self.variants # @return [Array(String, Hash{Symbol=>Object})] + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(String, T::Hash[Symbol, T.anything]) } + end + # @type [Knockapi::Internal::Type::Converter] UnionMember1Map = Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown] end diff --git a/lib/knockapi/models/message_event.rb b/lib/knockapi/models/message_event.rb index b3923bd8..b781d69e 100644 --- a/lib/knockapi/models/message_event.rb +++ b/lib/knockapi/models/message_event.rb @@ -26,14 +26,14 @@ class MessageEvent < Knockapi::Internal::Type::BaseModel # A reference to a recipient, either a user identifier (string) or an object # reference (ID, collection). # - # @return [String, Knockapi::Models::RecipientReference::ObjectReference] - required :recipient, union: -> { Knockapi::Models::RecipientReference } + # @return [String, Knockapi::RecipientReference::ObjectReference] + required :recipient, union: -> { Knockapi::RecipientReference } # @!attribute type # The type of event that occurred. # - # @return [Symbol, Knockapi::Models::MessageEvent::Type] - required :type, enum: -> { Knockapi::Models::MessageEvent::Type } + # @return [Symbol, Knockapi::MessageEvent::Type] + required :type, enum: -> { Knockapi::MessageEvent::Type } # @!attribute data # The data associated with the message event. Only present for some event types. @@ -42,8 +42,8 @@ class MessageEvent < Knockapi::Internal::Type::BaseModel optional :data, Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown], nil?: true # @!method initialize(id:, _typename:, inserted_at:, recipient:, type:, data: nil) - # Some parameter documentations has been truncated, see - # {Knockapi::Models::MessageEvent} for more details. + # Some parameter documentations has been truncated, see {Knockapi::MessageEvent} + # for more details. # # A message event. Occurs when a message # [delivery or engagement status](/send-notifications/message-statuses) changes. @@ -54,16 +54,15 @@ class MessageEvent < Knockapi::Internal::Type::BaseModel # # @param inserted_at [Time] Timestamp when the event was created. # - # @param recipient [String, Knockapi::Models::RecipientReference::ObjectReference] A reference to a recipient, either a user identifier (string) or an object refer - # ... + # @param recipient [String, Knockapi::RecipientReference::ObjectReference] A reference to a recipient, either a user identifier (string) or an object refer # - # @param type [Symbol, Knockapi::Models::MessageEvent::Type] The type of event that occurred. + # @param type [Symbol, Knockapi::MessageEvent::Type] The type of event that occurred. # # @param data [Hash{Symbol=>Object}, nil] The data associated with the message event. Only present for some event types. # The type of event that occurred. # - # @see Knockapi::Models::MessageEvent#type + # @see Knockapi::MessageEvent#type module Type extend Knockapi::Internal::Type::Enum diff --git a/lib/knockapi/models/message_get_content_response.rb b/lib/knockapi/models/message_get_content_response.rb index c68d0aeb..6f5c47c9 100644 --- a/lib/knockapi/models/message_get_content_response.rb +++ b/lib/knockapi/models/message_get_content_response.rb @@ -485,11 +485,32 @@ module Type # @!method self.variants # @return [Array(Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock, Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock)] + + define_sorbet_constant!(:Variants) do + T.type_alias do + T.any( + Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock, + Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock + ) + end + end end end # @!method self.variants # @return [Array(Knockapi::Models::MessageGetContentResponse::Data::MessageEmailContent, Knockapi::Models::MessageGetContentResponse::Data::MessageSMSContent, Knockapi::Models::MessageGetContentResponse::Data::MessagePushContent, Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent, Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent)] + + define_sorbet_constant!(:Variants) do + T.type_alias do + T.any( + Knockapi::Models::MessageGetContentResponse::Data::MessageEmailContent, + Knockapi::Models::MessageGetContentResponse::Data::MessageSMSContent, + Knockapi::Models::MessageGetContentResponse::Data::MessagePushContent, + Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent, + Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent + ) + end + end end end end diff --git a/lib/knockapi/models/message_list_params.rb b/lib/knockapi/models/message_list_params.rb index ad2580c9..73907fbb 100644 --- a/lib/knockapi/models/message_list_params.rb +++ b/lib/knockapi/models/message_list_params.rb @@ -28,14 +28,14 @@ class MessageListParams < Knockapi::Internal::Type::BaseModel # @!attribute engagement_status # Limits the results to messages with the given engagement status. # - # @return [Array, nil] + # @return [Array, nil] optional :engagement_status, - -> { Knockapi::Internal::Type::ArrayOf[enum: Knockapi::Models::MessageListParams::EngagementStatus] } + -> { Knockapi::Internal::Type::ArrayOf[enum: Knockapi::MessageListParams::EngagementStatus] } # @!attribute inserted_at # - # @return [Knockapi::Models::MessageListParams::InsertedAt, nil] - optional :inserted_at, -> { Knockapi::Models::MessageListParams::InsertedAt } + # @return [Knockapi::MessageListParams::InsertedAt, nil] + optional :inserted_at, -> { Knockapi::MessageListParams::InsertedAt } # @!attribute message_ids # Limits the results to only the message IDs given (max 50). Note: when using this @@ -59,9 +59,8 @@ class MessageListParams < Knockapi::Internal::Type::BaseModel # @!attribute status # Limits the results to messages with the given delivery status. # - # @return [Array, nil] - optional :status, - -> { Knockapi::Internal::Type::ArrayOf[enum: Knockapi::Models::MessageListParams::Status] } + # @return [Array, nil] + optional :status, -> { Knockapi::Internal::Type::ArrayOf[enum: Knockapi::MessageListParams::Status] } # @!attribute tenant # Limits the results to items with the corresponding tenant. @@ -106,30 +105,27 @@ class MessageListParams < Knockapi::Internal::Type::BaseModel # # @param channel_id [String] Limits the results to items with the corresponding channel ID. # - # @param engagement_status [Array] Limits the results to messages with the given engagement status. + # @param engagement_status [Array] Limits the results to messages with the given engagement status. # - # @param inserted_at [Knockapi::Models::MessageListParams::InsertedAt] + # @param inserted_at [Knockapi::MessageListParams::InsertedAt] # # @param message_ids [Array] Limits the results to only the message IDs given (max 50). Note: when using this - # ... # # @param page_size [Integer] The number of items per page. # # @param source [String] Limits the results to messages triggered by the given workflow key. # - # @param status [Array] Limits the results to messages with the given delivery status. + # @param status [Array] Limits the results to messages with the given delivery status. # # @param tenant [String] Limits the results to items with the corresponding tenant. # # @param trigger_data [String] Limits the results to only messages that were generated with the given data. See - # ... # # @param workflow_categories [Array] Limits the results to messages related to any of the provided categories. # # @param workflow_recipient_run_id [String] Limits the results to messages for a specific recipient's workflow run. # # @param workflow_run_id [String] Limits the results to messages associated with the top-level workflow run ID ret - # ... # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}] diff --git a/lib/knockapi/models/messages/activity_list_params.rb b/lib/knockapi/models/messages/activity_list_params.rb deleted file mode 100644 index 2d4918f7..00000000 --- a/lib/knockapi/models/messages/activity_list_params.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -module Knockapi - module Models - module Messages - # @see Knockapi::Resources::Messages::Activities#list - class ActivityListParams < Knockapi::Internal::Type::BaseModel - extend Knockapi::Internal::Type::RequestParameters::Converter - include Knockapi::Internal::Type::RequestParameters - - # @!attribute after - # The cursor to fetch entries after. - # - # @return [String, nil] - optional :after, String - - # @!attribute before - # The cursor to fetch entries before. - # - # @return [String, nil] - optional :before, String - - # @!attribute page_size - # The number of items per page. - # - # @return [Integer, nil] - optional :page_size, Integer - - # @!attribute trigger_data - # The trigger data to filter activities by. - # - # @return [String, nil] - optional :trigger_data, String - - # @!method initialize(after: nil, before: nil, page_size: nil, trigger_data: nil, request_options: {}) - # @param after [String] The cursor to fetch entries after. - # - # @param before [String] The cursor to fetch entries before. - # - # @param page_size [Integer] The number of items per page. - # - # @param trigger_data [String] The trigger data to filter activities by. - # - # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}] - end - end - end -end diff --git a/lib/knockapi/models/messages/batch_archive_response.rb b/lib/knockapi/models/messages/batch_archive_response.rb index ee2f4c18..c5e8764f 100644 --- a/lib/knockapi/models/messages/batch_archive_response.rb +++ b/lib/knockapi/models/messages/batch_archive_response.rb @@ -4,7 +4,7 @@ module Knockapi module Models module Messages # @type [Knockapi::Internal::Type::Converter] - BatchArchiveResponse = Knockapi::Internal::Type::ArrayOf[-> { Knockapi::Models::Message }] + BatchArchiveResponse = Knockapi::Internal::Type::ArrayOf[-> { Knockapi::Message }] end end end diff --git a/lib/knockapi/models/messages/batch_get_content_response.rb b/lib/knockapi/models/messages/batch_get_content_response.rb index e00dab6a..0c62129c 100644 --- a/lib/knockapi/models/messages/batch_get_content_response.rb +++ b/lib/knockapi/models/messages/batch_get_content_response.rb @@ -488,11 +488,32 @@ module Type # @!method self.variants # @return [Array(Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock, Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock)] + + define_sorbet_constant!(:Variants) do + T.type_alias do + T.any( + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock, + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock + ) + end + end end end # @!method self.variants # @return [Array(Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageEmailContent, Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageSMSContent, Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessagePushContent, Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageChatContent, Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent)] + + define_sorbet_constant!(:Variants) do + T.type_alias do + T.any( + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageEmailContent, + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageSMSContent, + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessagePushContent, + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageChatContent, + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent + ) + end + end end end diff --git a/lib/knockapi/models/messages/batch_mark_as_interacted_response.rb b/lib/knockapi/models/messages/batch_mark_as_interacted_response.rb index f8408215..ac31f6c7 100644 --- a/lib/knockapi/models/messages/batch_mark_as_interacted_response.rb +++ b/lib/knockapi/models/messages/batch_mark_as_interacted_response.rb @@ -4,7 +4,7 @@ module Knockapi module Models module Messages # @type [Knockapi::Internal::Type::Converter] - BatchMarkAsInteractedResponse = Knockapi::Internal::Type::ArrayOf[-> { Knockapi::Models::Message }] + BatchMarkAsInteractedResponse = Knockapi::Internal::Type::ArrayOf[-> { Knockapi::Message }] end end end diff --git a/lib/knockapi/models/messages/batch_mark_as_read_response.rb b/lib/knockapi/models/messages/batch_mark_as_read_response.rb index 4231c407..70534feb 100644 --- a/lib/knockapi/models/messages/batch_mark_as_read_response.rb +++ b/lib/knockapi/models/messages/batch_mark_as_read_response.rb @@ -4,7 +4,7 @@ module Knockapi module Models module Messages # @type [Knockapi::Internal::Type::Converter] - BatchMarkAsReadResponse = Knockapi::Internal::Type::ArrayOf[-> { Knockapi::Models::Message }] + BatchMarkAsReadResponse = Knockapi::Internal::Type::ArrayOf[-> { Knockapi::Message }] end end end diff --git a/lib/knockapi/models/messages/batch_mark_as_seen_response.rb b/lib/knockapi/models/messages/batch_mark_as_seen_response.rb index ab13c348..c075483e 100644 --- a/lib/knockapi/models/messages/batch_mark_as_seen_response.rb +++ b/lib/knockapi/models/messages/batch_mark_as_seen_response.rb @@ -4,7 +4,7 @@ module Knockapi module Models module Messages # @type [Knockapi::Internal::Type::Converter] - BatchMarkAsSeenResponse = Knockapi::Internal::Type::ArrayOf[-> { Knockapi::Models::Message }] + BatchMarkAsSeenResponse = Knockapi::Internal::Type::ArrayOf[-> { Knockapi::Message }] end end end diff --git a/lib/knockapi/models/messages/batch_mark_as_unread_response.rb b/lib/knockapi/models/messages/batch_mark_as_unread_response.rb index 886a7ae9..8d2fa073 100644 --- a/lib/knockapi/models/messages/batch_mark_as_unread_response.rb +++ b/lib/knockapi/models/messages/batch_mark_as_unread_response.rb @@ -4,7 +4,7 @@ module Knockapi module Models module Messages # @type [Knockapi::Internal::Type::Converter] - BatchMarkAsUnreadResponse = Knockapi::Internal::Type::ArrayOf[-> { Knockapi::Models::Message }] + BatchMarkAsUnreadResponse = Knockapi::Internal::Type::ArrayOf[-> { Knockapi::Message }] end end end diff --git a/lib/knockapi/models/messages/batch_mark_as_unseen_response.rb b/lib/knockapi/models/messages/batch_mark_as_unseen_response.rb index c35f4875..e5c7eb7d 100644 --- a/lib/knockapi/models/messages/batch_mark_as_unseen_response.rb +++ b/lib/knockapi/models/messages/batch_mark_as_unseen_response.rb @@ -4,7 +4,7 @@ module Knockapi module Models module Messages # @type [Knockapi::Internal::Type::Converter] - BatchMarkAsUnseenResponse = Knockapi::Internal::Type::ArrayOf[-> { Knockapi::Models::Message }] + BatchMarkAsUnseenResponse = Knockapi::Internal::Type::ArrayOf[-> { Knockapi::Message }] end end end diff --git a/lib/knockapi/models/messages/batch_unarchive_response.rb b/lib/knockapi/models/messages/batch_unarchive_response.rb index f234ea31..921adf7c 100644 --- a/lib/knockapi/models/messages/batch_unarchive_response.rb +++ b/lib/knockapi/models/messages/batch_unarchive_response.rb @@ -4,7 +4,7 @@ module Knockapi module Models module Messages # @type [Knockapi::Internal::Type::Converter] - BatchUnarchiveResponse = Knockapi::Internal::Type::ArrayOf[-> { Knockapi::Models::Message }] + BatchUnarchiveResponse = Knockapi::Internal::Type::ArrayOf[-> { Knockapi::Message }] end end end diff --git a/lib/knockapi/models/object.rb b/lib/knockapi/models/object.rb index fecd3bd5..be490f8d 100644 --- a/lib/knockapi/models/object.rb +++ b/lib/knockapi/models/object.rb @@ -34,7 +34,13 @@ class Object < Knockapi::Internal::Type::BaseModel # @return [Time, nil] optional :created_at, Time, nil?: true - # @!method initialize(id:, _typename:, collection:, updated_at:, created_at: nil) + # @!attribute properties + # The custom properties associated with the object. + # + # @return [Hash{Symbol=>Object}, nil] + optional :properties, Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown] + + # @!method initialize(id:, _typename:, collection:, updated_at:, created_at: nil, properties: nil) # A custom [Object](/concepts/objects) entity which belongs to a collection. # # @param id [String] Unique identifier for the object. @@ -46,6 +52,8 @@ class Object < Knockapi::Internal::Type::BaseModel # @param updated_at [Time] The timestamp when the resource was last updated. # # @param created_at [Time, nil] Timestamp when the resource was created. + # + # @param properties [Hash{Symbol=>Object}] The custom properties associated with the object. end end end diff --git a/lib/knockapi/models/object_add_subscriptions_params.rb b/lib/knockapi/models/object_add_subscriptions_params.rb index e6c37d67..bc42a015 100644 --- a/lib/knockapi/models/object_add_subscriptions_params.rb +++ b/lib/knockapi/models/object_add_subscriptions_params.rb @@ -11,8 +11,8 @@ class ObjectAddSubscriptionsParams < Knockapi::Internal::Type::BaseModel # The recipients of the subscription. You can subscribe up to 100 recipients to an # object at a time. # - # @return [Array] - required :recipients, -> { Knockapi::Internal::Type::ArrayOf[union: Knockapi::Models::RecipientRequest] } + # @return [Array] + required :recipients, -> { Knockapi::Internal::Type::ArrayOf[union: Knockapi::RecipientRequest] } # @!attribute properties # The custom properties associated with the subscription relationship. @@ -24,8 +24,7 @@ class ObjectAddSubscriptionsParams < Knockapi::Internal::Type::BaseModel # Some parameter documentations has been truncated, see # {Knockapi::Models::ObjectAddSubscriptionsParams} for more details. # - # @param recipients [Array] The recipients of the subscription. You can subscribe up to 100 recipients to an - # ... + # @param recipients [Array] The recipients of the subscription. You can subscribe up to 100 recipients to an # # @param properties [Hash{Symbol=>Object}, nil] The custom properties associated with the subscription relationship. # diff --git a/lib/knockapi/models/object_add_subscriptions_response.rb b/lib/knockapi/models/object_add_subscriptions_response.rb index 15bcb2f3..aa6f6e6c 100644 --- a/lib/knockapi/models/object_add_subscriptions_response.rb +++ b/lib/knockapi/models/object_add_subscriptions_response.rb @@ -4,6 +4,6 @@ module Knockapi module Models # @type [Knockapi::Internal::Type::Converter] ObjectAddSubscriptionsResponse = - Knockapi::Internal::Type::ArrayOf[-> { Knockapi::Models::Recipients::Subscription }] + Knockapi::Internal::Type::ArrayOf[-> { Knockapi::Recipients::Subscription }] end end diff --git a/lib/knockapi/models/object_delete_response.rb b/lib/knockapi/models/object_delete_response.rb new file mode 100644 index 00000000..7a3ce577 --- /dev/null +++ b/lib/knockapi/models/object_delete_response.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +module Knockapi + module Models + ObjectDeleteResponse = String + end +end diff --git a/lib/knockapi/models/object_delete_subscriptions_params.rb b/lib/knockapi/models/object_delete_subscriptions_params.rb index e28e9d04..8c382b36 100644 --- a/lib/knockapi/models/object_delete_subscriptions_params.rb +++ b/lib/knockapi/models/object_delete_subscriptions_params.rb @@ -11,16 +11,14 @@ class ObjectDeleteSubscriptionsParams < Knockapi::Internal::Type::BaseModel # The recipients of the subscription. You can subscribe up to 100 recipients to an # object at a time. # - # @return [Array] - required :recipients, - -> { Knockapi::Internal::Type::ArrayOf[union: Knockapi::Models::RecipientReference] } + # @return [Array] + required :recipients, -> { Knockapi::Internal::Type::ArrayOf[union: Knockapi::RecipientReference] } # @!method initialize(recipients:, request_options: {}) # Some parameter documentations has been truncated, see # {Knockapi::Models::ObjectDeleteSubscriptionsParams} for more details. # - # @param recipients [Array] The recipients of the subscription. You can subscribe up to 100 recipients to an - # ... + # @param recipients [Array] The recipients of the subscription. You can subscribe up to 100 recipients to an # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/knockapi/models/object_delete_subscriptions_response.rb b/lib/knockapi/models/object_delete_subscriptions_response.rb index 15d74536..abd62df1 100644 --- a/lib/knockapi/models/object_delete_subscriptions_response.rb +++ b/lib/knockapi/models/object_delete_subscriptions_response.rb @@ -4,6 +4,6 @@ module Knockapi module Models # @type [Knockapi::Internal::Type::Converter] ObjectDeleteSubscriptionsResponse = - Knockapi::Internal::Type::ArrayOf[-> { Knockapi::Models::Recipients::Subscription }] + Knockapi::Internal::Type::ArrayOf[-> { Knockapi::Recipients::Subscription }] end end diff --git a/lib/knockapi/models/object_list_messages_params.rb b/lib/knockapi/models/object_list_messages_params.rb index e06064df..baedf4ef 100644 --- a/lib/knockapi/models/object_list_messages_params.rb +++ b/lib/knockapi/models/object_list_messages_params.rb @@ -28,14 +28,16 @@ class ObjectListMessagesParams < Knockapi::Internal::Type::BaseModel # @!attribute engagement_status # Limits the results to messages with the given engagement status. # - # @return [Array, nil] + # @return [Array, nil] optional :engagement_status, - -> { Knockapi::Internal::Type::ArrayOf[enum: Knockapi::Models::ObjectListMessagesParams::EngagementStatus] } + -> { + Knockapi::Internal::Type::ArrayOf[enum: Knockapi::ObjectListMessagesParams::EngagementStatus] + } # @!attribute inserted_at # - # @return [Knockapi::Models::ObjectListMessagesParams::InsertedAt, nil] - optional :inserted_at, -> { Knockapi::Models::ObjectListMessagesParams::InsertedAt } + # @return [Knockapi::ObjectListMessagesParams::InsertedAt, nil] + optional :inserted_at, -> { Knockapi::ObjectListMessagesParams::InsertedAt } # @!attribute message_ids # Limits the results to only the message IDs given (max 50). Note: when using this @@ -59,9 +61,9 @@ class ObjectListMessagesParams < Knockapi::Internal::Type::BaseModel # @!attribute status # Limits the results to messages with the given delivery status. # - # @return [Array, nil] + # @return [Array, nil] optional :status, - -> { Knockapi::Internal::Type::ArrayOf[enum: Knockapi::Models::ObjectListMessagesParams::Status] } + -> { Knockapi::Internal::Type::ArrayOf[enum: Knockapi::ObjectListMessagesParams::Status] } # @!attribute tenant # Limits the results to items with the corresponding tenant. @@ -106,30 +108,27 @@ class ObjectListMessagesParams < Knockapi::Internal::Type::BaseModel # # @param channel_id [String] Limits the results to items with the corresponding channel ID. # - # @param engagement_status [Array] Limits the results to messages with the given engagement status. + # @param engagement_status [Array] Limits the results to messages with the given engagement status. # - # @param inserted_at [Knockapi::Models::ObjectListMessagesParams::InsertedAt] + # @param inserted_at [Knockapi::ObjectListMessagesParams::InsertedAt] # # @param message_ids [Array] Limits the results to only the message IDs given (max 50). Note: when using this - # ... # # @param page_size [Integer] The number of items per page. # # @param source [String] Limits the results to messages triggered by the given workflow key. # - # @param status [Array] Limits the results to messages with the given delivery status. + # @param status [Array] Limits the results to messages with the given delivery status. # # @param tenant [String] Limits the results to items with the corresponding tenant. # # @param trigger_data [String] Limits the results to only messages that were generated with the given data. See - # ... # # @param workflow_categories [Array] Limits the results to messages related to any of the provided categories. # # @param workflow_recipient_run_id [String] Limits the results to messages for a specific recipient's workflow run. # # @param workflow_run_id [String] Limits the results to messages associated with the top-level workflow run ID ret - # ... # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}] diff --git a/lib/knockapi/models/object_list_params.rb b/lib/knockapi/models/object_list_params.rb index 8f09a4d8..acbafc25 100644 --- a/lib/knockapi/models/object_list_params.rb +++ b/lib/knockapi/models/object_list_params.rb @@ -22,9 +22,8 @@ class ObjectListParams < Knockapi::Internal::Type::BaseModel # @!attribute include # Includes preferences of the objects in the response. # - # @return [Array, nil] - optional :include, - -> { Knockapi::Internal::Type::ArrayOf[enum: Knockapi::Models::ObjectListParams::Include] } + # @return [Array, nil] + optional :include, -> { Knockapi::Internal::Type::ArrayOf[enum: Knockapi::ObjectListParams::Include] } # @!attribute page_size # The number of items per page. @@ -37,7 +36,7 @@ class ObjectListParams < Knockapi::Internal::Type::BaseModel # # @param before [String] The cursor to fetch entries before. # - # @param include [Array] Includes preferences of the objects in the response. + # @param include [Array] Includes preferences of the objects in the response. # # @param page_size [Integer] The number of items per page. # diff --git a/lib/knockapi/models/object_list_preferences_response.rb b/lib/knockapi/models/object_list_preferences_response.rb index 7125dd0d..b0c2c4b6 100644 --- a/lib/knockapi/models/object_list_preferences_response.rb +++ b/lib/knockapi/models/object_list_preferences_response.rb @@ -4,6 +4,6 @@ module Knockapi module Models # @type [Knockapi::Internal::Type::Converter] ObjectListPreferencesResponse = - Knockapi::Internal::Type::ArrayOf[-> { Knockapi::Models::Recipients::PreferenceSet }] + Knockapi::Internal::Type::ArrayOf[-> { Knockapi::Recipients::PreferenceSet }] end end diff --git a/lib/knockapi/models/object_list_subscriptions_params.rb b/lib/knockapi/models/object_list_subscriptions_params.rb index facd45ae..39cc5d44 100644 --- a/lib/knockapi/models/object_list_subscriptions_params.rb +++ b/lib/knockapi/models/object_list_subscriptions_params.rb @@ -22,24 +22,26 @@ class ObjectListSubscriptionsParams < Knockapi::Internal::Type::BaseModel # @!attribute include # Additional fields to include in the response. # - # @return [Array, nil] + # @return [Array, nil] optional :include, - -> { Knockapi::Internal::Type::ArrayOf[enum: Knockapi::Models::ObjectListSubscriptionsParams::Include] } + -> { + Knockapi::Internal::Type::ArrayOf[enum: Knockapi::ObjectListSubscriptionsParams::Include] + } # @!attribute mode # Mode of the request. `recipient` to list the objects that the provided object is # subscribed to, `object` to list the recipients that subscribe to the provided # object. # - # @return [Symbol, Knockapi::Models::ObjectListSubscriptionsParams::Mode, nil] - optional :mode, enum: -> { Knockapi::Models::ObjectListSubscriptionsParams::Mode } + # @return [Symbol, Knockapi::ObjectListSubscriptionsParams::Mode, nil] + optional :mode, enum: -> { Knockapi::ObjectListSubscriptionsParams::Mode } # @!attribute objects # Objects to filter by (only used if mode is `recipient`). # - # @return [Array, nil] + # @return [Array, nil] optional :objects, - -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Models::ObjectListSubscriptionsParams::Object] } + -> { Knockapi::Internal::Type::ArrayOf[Knockapi::ObjectListSubscriptionsParams::Object] } # @!attribute page_size # The number of items per page. @@ -50,9 +52,8 @@ class ObjectListSubscriptionsParams < Knockapi::Internal::Type::BaseModel # @!attribute recipients # Recipients to filter by (only used if mode is `object`). # - # @return [Array, nil] - optional :recipients, - -> { Knockapi::Internal::Type::ArrayOf[union: Knockapi::Models::RecipientReference] } + # @return [Array, nil] + optional :recipients, -> { Knockapi::Internal::Type::ArrayOf[union: Knockapi::RecipientReference] } # @!method initialize(after: nil, before: nil, include: nil, mode: nil, objects: nil, page_size: nil, recipients: nil, request_options: {}) # Some parameter documentations has been truncated, see @@ -62,16 +63,15 @@ class ObjectListSubscriptionsParams < Knockapi::Internal::Type::BaseModel # # @param before [String] The cursor to fetch entries before. # - # @param include [Array] Additional fields to include in the response. + # @param include [Array] Additional fields to include in the response. # - # @param mode [Symbol, Knockapi::Models::ObjectListSubscriptionsParams::Mode] Mode of the request. `recipient` to list the objects that the provided object is - # ... + # @param mode [Symbol, Knockapi::ObjectListSubscriptionsParams::Mode] Mode of the request. `recipient` to list the objects that the provided object is # - # @param objects [Array] Objects to filter by (only used if mode is `recipient`). + # @param objects [Array] Objects to filter by (only used if mode is `recipient`). # # @param page_size [Integer] The number of items per page. # - # @param recipients [Array] Recipients to filter by (only used if mode is `object`). + # @param recipients [Array] Recipients to filter by (only used if mode is `object`). # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}] diff --git a/lib/knockapi/models/object_set_params.rb b/lib/knockapi/models/object_set_params.rb index 6831cb40..b47525de 100644 --- a/lib/knockapi/models/object_set_params.rb +++ b/lib/knockapi/models/object_set_params.rb @@ -10,9 +10,11 @@ class ObjectSetParams < Knockapi::Internal::Type::BaseModel # @!attribute channel_data # A request to set channel data for a type of channel inline. # - # @return [Hash{Symbol=>Knockapi::Models::Recipients::ChannelDataRequest}, nil] + # @return [Hash{Symbol=>Knockapi::Recipients::PushChannelData, Knockapi::Recipients::OneSignalChannelData, Knockapi::Recipients::SlackChannelData, Knockapi::Recipients::MsTeamsChannelData, Knockapi::Recipients::DiscordChannelData}, nil] optional :channel_data, - -> { Knockapi::Internal::Type::HashOf[Knockapi::Models::Recipients::ChannelDataRequest] } + -> { + Knockapi::Internal::Type::HashOf[union: Knockapi::Recipients::InlineChannelDataRequestItem] + } # @!attribute locale # The locale of the object. Used for @@ -24,15 +26,17 @@ class ObjectSetParams < Knockapi::Internal::Type::BaseModel # @!attribute preferences # Inline set preferences for a recipient, where the key is the preference set id. # - # @return [Hash{Symbol=>Knockapi::Models::Recipients::PreferenceSetRequest}, nil] + # @return [Hash{Symbol=>Knockapi::Recipients::PreferenceSetRequest}, nil] optional :preferences, - -> { Knockapi::Internal::Type::HashOf[Knockapi::Models::Recipients::PreferenceSetRequest] } + -> { + Knockapi::Internal::Type::HashOf[Knockapi::Recipients::PreferenceSetRequest] + } # @!attribute timezone - # The timezone of the object. Must be a valid - # [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). - # Used for - # [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients). + # The timezone of the object. Must be a + # valid [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + # Used + # for [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients). # # @return [String, nil] optional :timezone, String, nil?: true @@ -41,15 +45,13 @@ class ObjectSetParams < Knockapi::Internal::Type::BaseModel # Some parameter documentations has been truncated, see # {Knockapi::Models::ObjectSetParams} for more details. # - # @param channel_data [Hash{Symbol=>Knockapi::Models::Recipients::ChannelDataRequest}] A request to set channel data for a type of channel inline. + # @param channel_data [Hash{Symbol=>Knockapi::Recipients::PushChannelData, Knockapi::Recipients::OneSignalChannelData, Knockapi::Recipients::SlackChannelData, Knockapi::Recipients::MsTeamsChannelData, Knockapi::Recipients::DiscordChannelData}] A request to set channel data for a type of channel inline. # # @param locale [String, nil] The locale of the object. Used for [message localization](/concepts/translations - # ... # - # @param preferences [Hash{Symbol=>Knockapi::Models::Recipients::PreferenceSetRequest}] Inline set preferences for a recipient, where the key is the preference set id. + # @param preferences [Hash{Symbol=>Knockapi::Recipients::PreferenceSetRequest}] Inline set preferences for a recipient, where the key is the preference set id. # - # @param timezone [String, nil] The timezone of the object. Must be a valid [tz database time zone string](https - # ... + # @param timezone [String, nil] The timezone of the object. Must be a valid [tz database time zone string](https # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/knockapi/models/object_unset_channel_data_response.rb b/lib/knockapi/models/object_unset_channel_data_response.rb new file mode 100644 index 00000000..347ba2e3 --- /dev/null +++ b/lib/knockapi/models/object_unset_channel_data_response.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +module Knockapi + module Models + ObjectUnsetChannelDataResponse = String + end +end diff --git a/lib/knockapi/models/objects/bulk_add_subscriptions_params.rb b/lib/knockapi/models/objects/bulk_add_subscriptions_params.rb index ddc6763e..ef07b4af 100644 --- a/lib/knockapi/models/objects/bulk_add_subscriptions_params.rb +++ b/lib/knockapi/models/objects/bulk_add_subscriptions_params.rb @@ -11,12 +11,14 @@ class BulkAddSubscriptionsParams < Knockapi::Internal::Type::BaseModel # @!attribute subscriptions # A list of subscriptions. # - # @return [Array] + # @return [Array] required :subscriptions, - -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Objects::BulkAddSubscriptionsParams::Subscription] } + -> { + Knockapi::Internal::Type::ArrayOf[Knockapi::Objects::BulkAddSubscriptionsParams::Subscription] + } # @!method initialize(subscriptions:, request_options: {}) - # @param subscriptions [Array] A list of subscriptions. + # @param subscriptions [Array] A list of subscriptions. # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}] @@ -25,8 +27,8 @@ class Subscription < Knockapi::Internal::Type::BaseModel # The recipients of the subscription. You can subscribe up to 100 recipients to an # object at a time. # - # @return [Array] - required :recipients, -> { Knockapi::Internal::Type::ArrayOf[union: Knockapi::Models::RecipientRequest] } + # @return [Array] + required :recipients, -> { Knockapi::Internal::Type::ArrayOf[union: Knockapi::RecipientRequest] } # @!attribute properties # The custom properties associated with the subscription relationship. @@ -38,11 +40,9 @@ class Subscription < Knockapi::Internal::Type::BaseModel # @!method initialize(recipients:, properties: nil) # Some parameter documentations has been truncated, see - # {Knockapi::Models::Objects::BulkAddSubscriptionsParams::Subscription} for more - # details. + # {Knockapi::Objects::BulkAddSubscriptionsParams::Subscription} for more details. # - # @param recipients [Array] The recipients of the subscription. You can subscribe up to 100 recipients to an - # ... + # @param recipients [Array] The recipients of the subscription. You can subscribe up to 100 recipients to an # # @param properties [Hash{Symbol=>Object}, nil] The custom properties associated with the subscription relationship. end diff --git a/lib/knockapi/models/objects/bulk_set_params.rb b/lib/knockapi/models/objects/bulk_set_params.rb index e39605fb..5c46ce16 100644 --- a/lib/knockapi/models/objects/bulk_set_params.rb +++ b/lib/knockapi/models/objects/bulk_set_params.rb @@ -11,11 +11,11 @@ class BulkSetParams < Knockapi::Internal::Type::BaseModel # @!attribute objects # A list of objects. # - # @return [Array] - required :objects, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Models::InlineObjectRequest] } + # @return [Array] + required :objects, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::InlineObjectRequest] } # @!method initialize(objects:, request_options: {}) - # @param objects [Array] A list of objects. + # @param objects [Array] A list of objects. # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/knockapi/models/providers/ms_team_list_channels_params.rb b/lib/knockapi/models/providers/ms_team_list_channels_params.rb index f9e136e8..dae6ee55 100644 --- a/lib/knockapi/models/providers/ms_team_list_channels_params.rb +++ b/lib/knockapi/models/providers/ms_team_list_channels_params.rb @@ -22,15 +22,15 @@ class MsTeamListChannelsParams < Knockapi::Internal::Type::BaseModel # @!attribute query_options # - # @return [Knockapi::Models::Providers::MsTeamListChannelsParams::QueryOptions, nil] - optional :query_options, -> { Knockapi::Models::Providers::MsTeamListChannelsParams::QueryOptions } + # @return [Knockapi::Providers::MsTeamListChannelsParams::QueryOptions, nil] + optional :query_options, -> { Knockapi::Providers::MsTeamListChannelsParams::QueryOptions } # @!method initialize(ms_teams_tenant_object:, team_id:, query_options: nil, request_options: {}) # @param ms_teams_tenant_object [String] A JSON encoded string containing the Microsoft Teams tenant object reference. # # @param team_id [String] Microsoft Teams team ID. # - # @param query_options [Knockapi::Models::Providers::MsTeamListChannelsParams::QueryOptions] + # @param query_options [Knockapi::Providers::MsTeamListChannelsParams::QueryOptions] # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}] @@ -51,14 +51,11 @@ class QueryOptions < Knockapi::Internal::Type::BaseModel # @!method initialize(filter: nil, select_: nil) # Some parameter documentations has been truncated, see - # {Knockapi::Models::Providers::MsTeamListChannelsParams::QueryOptions} for more - # details. + # {Knockapi::Providers::MsTeamListChannelsParams::QueryOptions} for more details. # # @param filter [String] [OData param](https://learn.microsoft.com/en-us/graph/query-parameters) passed t - # ... # # @param select_ [String] [OData param](https://learn.microsoft.com/en-us/graph/query-parameters) passed t - # ... end end end diff --git a/lib/knockapi/models/providers/ms_team_list_teams_params.rb b/lib/knockapi/models/providers/ms_team_list_teams_params.rb index 825fd505..0d0dba32 100644 --- a/lib/knockapi/models/providers/ms_team_list_teams_params.rb +++ b/lib/knockapi/models/providers/ms_team_list_teams_params.rb @@ -16,13 +16,13 @@ class MsTeamListTeamsParams < Knockapi::Internal::Type::BaseModel # @!attribute query_options # - # @return [Knockapi::Models::Providers::MsTeamListTeamsParams::QueryOptions, nil] - optional :query_options, -> { Knockapi::Models::Providers::MsTeamListTeamsParams::QueryOptions } + # @return [Knockapi::Providers::MsTeamListTeamsParams::QueryOptions, nil] + optional :query_options, -> { Knockapi::Providers::MsTeamListTeamsParams::QueryOptions } # @!method initialize(ms_teams_tenant_object:, query_options: nil, request_options: {}) # @param ms_teams_tenant_object [String] A JSON encoded string containing the Microsoft Teams tenant object reference. # - # @param query_options [Knockapi::Models::Providers::MsTeamListTeamsParams::QueryOptions] + # @param query_options [Knockapi::Providers::MsTeamListTeamsParams::QueryOptions] # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}] @@ -57,20 +57,15 @@ class QueryOptions < Knockapi::Internal::Type::BaseModel # @!method initialize(filter: nil, select_: nil, skiptoken: nil, top: nil) # Some parameter documentations has been truncated, see - # {Knockapi::Models::Providers::MsTeamListTeamsParams::QueryOptions} for more - # details. + # {Knockapi::Providers::MsTeamListTeamsParams::QueryOptions} for more details. # # @param filter [String] [OData param](https://learn.microsoft.com/en-us/graph/query-parameters) passed t - # ... # # @param select_ [String] [OData param](https://learn.microsoft.com/en-us/graph/query-parameters) passed t - # ... # # @param skiptoken [String] [OData param](https://learn.microsoft.com/en-us/graph/query-parameters) passed t - # ... # # @param top [Integer] [OData param](https://learn.microsoft.com/en-us/graph/query-parameters) passed t - # ... end end end diff --git a/lib/knockapi/models/providers/slack_list_channels_params.rb b/lib/knockapi/models/providers/slack_list_channels_params.rb index 5c3d354e..e2a6409a 100644 --- a/lib/knockapi/models/providers/slack_list_channels_params.rb +++ b/lib/knockapi/models/providers/slack_list_channels_params.rb @@ -16,13 +16,13 @@ class SlackListChannelsParams < Knockapi::Internal::Type::BaseModel # @!attribute query_options # - # @return [Knockapi::Models::Providers::SlackListChannelsParams::QueryOptions, nil] - optional :query_options, -> { Knockapi::Models::Providers::SlackListChannelsParams::QueryOptions } + # @return [Knockapi::Providers::SlackListChannelsParams::QueryOptions, nil] + optional :query_options, -> { Knockapi::Providers::SlackListChannelsParams::QueryOptions } # @!method initialize(access_token_object:, query_options: nil, request_options: {}) # @param access_token_object [String] A JSON encoded string containing the access token object reference. # - # @param query_options [Knockapi::Models::Providers::SlackListChannelsParams::QueryOptions] + # @param query_options [Knockapi::Providers::SlackListChannelsParams::QueryOptions] # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}] @@ -62,11 +62,9 @@ class QueryOptions < Knockapi::Internal::Type::BaseModel # @!method initialize(cursor: nil, exclude_archived: nil, limit: nil, team_id: nil, types: nil) # Some parameter documentations has been truncated, see - # {Knockapi::Models::Providers::SlackListChannelsParams::QueryOptions} for more - # details. + # {Knockapi::Providers::SlackListChannelsParams::QueryOptions} for more details. # # @param cursor [String] Paginate through collections of data by setting the cursor parameter to a next_c - # ... # # @param exclude_archived [Boolean] Set to true to exclude archived channels from the list. # @@ -75,7 +73,6 @@ class QueryOptions < Knockapi::Internal::Type::BaseModel # @param team_id [String] Encoded team ID (T1234) to list channels in, required if org token is used. # # @param types [String] Mix and match channel types by providing a comma-separated list of any combinati - # ... end end end diff --git a/lib/knockapi/models/recipient.rb b/lib/knockapi/models/recipient.rb index af3fd7b3..a0f31975 100644 --- a/lib/knockapi/models/recipient.rb +++ b/lib/knockapi/models/recipient.rb @@ -7,13 +7,17 @@ module Recipient extend Knockapi::Internal::Type::Union # A [User](/concepts/users) represents an individual in your system who can receive notifications through Knock. Users are the most common recipients of notifications and are always referenced by your internal identifier. - variant -> { Knockapi::Models::User } + variant -> { Knockapi::User } # A custom [Object](/concepts/objects) entity which belongs to a collection. - variant -> { Knockapi::Models::Object } + variant -> { Knockapi::Object } # @!method self.variants - # @return [Array(Knockapi::Models::User, Knockapi::Models::Object)] + # @return [Array(Knockapi::User, Knockapi::Object)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(Knockapi::User, Knockapi::Object) } + end end end end diff --git a/lib/knockapi/models/recipient_reference.rb b/lib/knockapi/models/recipient_reference.rb index 2bf199b1..3ac46074 100644 --- a/lib/knockapi/models/recipient_reference.rb +++ b/lib/knockapi/models/recipient_reference.rb @@ -11,7 +11,7 @@ module RecipientReference variant String # A reference to a recipient object. - variant -> { Knockapi::Models::RecipientReference::ObjectReference } + variant -> { Knockapi::RecipientReference::ObjectReference } class ObjectReference < Knockapi::Internal::Type::BaseModel # @!attribute id @@ -35,7 +35,11 @@ class ObjectReference < Knockapi::Internal::Type::BaseModel end # @!method self.variants - # @return [Array(String, Knockapi::Models::RecipientReference::ObjectReference)] + # @return [Array(String, Knockapi::RecipientReference::ObjectReference)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(String, Knockapi::RecipientReference::ObjectReference) } + end end end end diff --git a/lib/knockapi/models/recipient_request.rb b/lib/knockapi/models/recipient_request.rb index 050a3e0f..9e41345c 100644 --- a/lib/knockapi/models/recipient_request.rb +++ b/lib/knockapi/models/recipient_request.rb @@ -12,13 +12,17 @@ module RecipientRequest variant String # A set of parameters to inline-identify a user with. Inline identifying the user will ensure that the user is available before the request is executed in Knock. It will perform an upsert for the user you're supplying, replacing any properties specified. - variant -> { Knockapi::Models::InlineIdentifyUserRequest } + variant -> { Knockapi::InlineIdentifyUserRequest } # A custom [Object](/concepts/objects) entity which belongs to a collection. - variant -> { Knockapi::Models::InlineObjectRequest } + variant -> { Knockapi::InlineObjectRequest } # @!method self.variants - # @return [Array(String, Knockapi::Models::InlineIdentifyUserRequest, Knockapi::Models::InlineObjectRequest)] + # @return [Array(String, Knockapi::InlineIdentifyUserRequest, Knockapi::InlineObjectRequest)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(String, Knockapi::InlineIdentifyUserRequest, Knockapi::InlineObjectRequest) } + end end end end diff --git a/lib/knockapi/models/recipients/channel_data.rb b/lib/knockapi/models/recipients/channel_data.rb index 3ab4358e..511996bf 100644 --- a/lib/knockapi/models/recipients/channel_data.rb +++ b/lib/knockapi/models/recipients/channel_data.rb @@ -19,14 +19,14 @@ class RecipientsChannelData < Knockapi::Internal::Type::BaseModel # @!attribute data # Channel data for a given channel type. # - # @return [Knockapi::Models::Recipients::PushChannelData, Knockapi::Models::Recipients::SlackChannelData, Knockapi::Models::Recipients::MsTeamsChannelData, Knockapi::Models::Recipients::DiscordChannelData, Knockapi::Models::Recipients::OneSignalChannelData] - required :data, union: -> { Knockapi::Models::Recipients::RecipientsChannelData::Data } + # @return [Knockapi::Recipients::PushChannelData, Knockapi::Recipients::SlackChannelData, Knockapi::Recipients::MsTeamsChannelData, Knockapi::Recipients::DiscordChannelData, Knockapi::Recipients::OneSignalChannelData] + required :data, union: -> { Knockapi::Recipients::RecipientsChannelData::Data } # @!attribute provider # The type of provider. # - # @return [Symbol, Knockapi::Models::Recipients::RecipientsChannelData::Provider, nil] - optional :provider, enum: -> { Knockapi::Models::Recipients::RecipientsChannelData::Provider } + # @return [Symbol, Knockapi::Recipients::RecipientsChannelData::Provider, nil] + optional :provider, enum: -> { Knockapi::Recipients::RecipientsChannelData::Provider } # @!method initialize(_typename:, channel_id:, data:, provider: nil) # Channel data for a given channel type. @@ -35,38 +35,50 @@ class RecipientsChannelData < Knockapi::Internal::Type::BaseModel # # @param channel_id [String] The unique identifier for the channel. # - # @param data [Knockapi::Models::Recipients::PushChannelData, Knockapi::Models::Recipients::SlackChannelData, Knockapi::Models::Recipients::MsTeamsChannelData, Knockapi::Models::Recipients::DiscordChannelData, Knockapi::Models::Recipients::OneSignalChannelData] Channel data for a given channel type. + # @param data [Knockapi::Recipients::PushChannelData, Knockapi::Recipients::SlackChannelData, Knockapi::Recipients::MsTeamsChannelData, Knockapi::Recipients::DiscordChannelData, Knockapi::Recipients::OneSignalChannelData] Channel data for a given channel type. # - # @param provider [Symbol, Knockapi::Models::Recipients::RecipientsChannelData::Provider] The type of provider. + # @param provider [Symbol, Knockapi::Recipients::RecipientsChannelData::Provider] The type of provider. # Channel data for a given channel type. # - # @see Knockapi::Models::Recipients::RecipientsChannelData#data + # @see Knockapi::Recipients::RecipientsChannelData#data module Data extend Knockapi::Internal::Type::Union # The content of a push notification. - variant -> { Knockapi::Models::Recipients::PushChannelData } + variant -> { Knockapi::Recipients::PushChannelData } # Slack channel data - variant -> { Knockapi::Models::Recipients::SlackChannelData } + variant -> { Knockapi::Recipients::SlackChannelData } # Microsoft Teams channel connection. - variant -> { Knockapi::Models::Recipients::MsTeamsChannelData } + variant -> { Knockapi::Recipients::MsTeamsChannelData } # Discord channel data. - variant -> { Knockapi::Models::Recipients::DiscordChannelData } + variant -> { Knockapi::Recipients::DiscordChannelData } # OneSignal channel data. - variant -> { Knockapi::Models::Recipients::OneSignalChannelData } + variant -> { Knockapi::Recipients::OneSignalChannelData } # @!method self.variants - # @return [Array(Knockapi::Models::Recipients::PushChannelData, Knockapi::Models::Recipients::SlackChannelData, Knockapi::Models::Recipients::MsTeamsChannelData, Knockapi::Models::Recipients::DiscordChannelData, Knockapi::Models::Recipients::OneSignalChannelData)] + # @return [Array(Knockapi::Recipients::PushChannelData, Knockapi::Recipients::SlackChannelData, Knockapi::Recipients::MsTeamsChannelData, Knockapi::Recipients::DiscordChannelData, Knockapi::Recipients::OneSignalChannelData)] + + define_sorbet_constant!(:Variants) do + T.type_alias do + T.any( + Knockapi::Recipients::PushChannelData, + Knockapi::Recipients::SlackChannelData, + Knockapi::Recipients::MsTeamsChannelData, + Knockapi::Recipients::DiscordChannelData, + Knockapi::Recipients::OneSignalChannelData + ) + end + end end # The type of provider. # - # @see Knockapi::Models::Recipients::RecipientsChannelData#provider + # @see Knockapi::Recipients::RecipientsChannelData#provider module Provider extend Knockapi::Internal::Type::Enum diff --git a/lib/knockapi/models/recipients/channel_data_request.rb b/lib/knockapi/models/recipients/channel_data_request.rb index a418591a..a5862fc1 100644 --- a/lib/knockapi/models/recipients/channel_data_request.rb +++ b/lib/knockapi/models/recipients/channel_data_request.rb @@ -7,37 +7,49 @@ class ChannelDataRequest < Knockapi::Internal::Type::BaseModel # @!attribute data # Channel data for a given channel type. # - # @return [Knockapi::Models::Recipients::PushChannelData, Knockapi::Models::Recipients::OneSignalChannelData, Knockapi::Models::Recipients::SlackChannelData, Knockapi::Models::Recipients::MsTeamsChannelData, Knockapi::Models::Recipients::DiscordChannelData] - required :data, union: -> { Knockapi::Models::Recipients::ChannelDataRequest::Data } + # @return [Knockapi::Recipients::PushChannelData, Knockapi::Recipients::OneSignalChannelData, Knockapi::Recipients::SlackChannelData, Knockapi::Recipients::MsTeamsChannelData, Knockapi::Recipients::DiscordChannelData] + required :data, union: -> { Knockapi::Recipients::ChannelDataRequest::Data } # @!method initialize(data:) # A request to set channel data for a type of channel. # - # @param data [Knockapi::Models::Recipients::PushChannelData, Knockapi::Models::Recipients::OneSignalChannelData, Knockapi::Models::Recipients::SlackChannelData, Knockapi::Models::Recipients::MsTeamsChannelData, Knockapi::Models::Recipients::DiscordChannelData] Channel data for a given channel type. + # @param data [Knockapi::Recipients::PushChannelData, Knockapi::Recipients::OneSignalChannelData, Knockapi::Recipients::SlackChannelData, Knockapi::Recipients::MsTeamsChannelData, Knockapi::Recipients::DiscordChannelData] Channel data for a given channel type. # Channel data for a given channel type. # - # @see Knockapi::Models::Recipients::ChannelDataRequest#data + # @see Knockapi::Recipients::ChannelDataRequest#data module Data extend Knockapi::Internal::Type::Union # The content of a push notification. - variant -> { Knockapi::Models::Recipients::PushChannelData } + variant -> { Knockapi::Recipients::PushChannelData } # OneSignal channel data. - variant -> { Knockapi::Models::Recipients::OneSignalChannelData } + variant -> { Knockapi::Recipients::OneSignalChannelData } # Slack channel data - variant -> { Knockapi::Models::Recipients::SlackChannelData } + variant -> { Knockapi::Recipients::SlackChannelData } # Microsoft Teams channel connection. - variant -> { Knockapi::Models::Recipients::MsTeamsChannelData } + variant -> { Knockapi::Recipients::MsTeamsChannelData } # Discord channel data. - variant -> { Knockapi::Models::Recipients::DiscordChannelData } + variant -> { Knockapi::Recipients::DiscordChannelData } # @!method self.variants - # @return [Array(Knockapi::Models::Recipients::PushChannelData, Knockapi::Models::Recipients::OneSignalChannelData, Knockapi::Models::Recipients::SlackChannelData, Knockapi::Models::Recipients::MsTeamsChannelData, Knockapi::Models::Recipients::DiscordChannelData)] + # @return [Array(Knockapi::Recipients::PushChannelData, Knockapi::Recipients::OneSignalChannelData, Knockapi::Recipients::SlackChannelData, Knockapi::Recipients::MsTeamsChannelData, Knockapi::Recipients::DiscordChannelData)] + + define_sorbet_constant!(:Variants) do + T.type_alias do + T.any( + Knockapi::Recipients::PushChannelData, + Knockapi::Recipients::OneSignalChannelData, + Knockapi::Recipients::SlackChannelData, + Knockapi::Recipients::MsTeamsChannelData, + Knockapi::Recipients::DiscordChannelData + ) + end + end end end end diff --git a/lib/knockapi/models/recipients/discord_channel_data.rb b/lib/knockapi/models/recipients/discord_channel_data.rb index b31271bd..1c6862ff 100644 --- a/lib/knockapi/models/recipients/discord_channel_data.rb +++ b/lib/knockapi/models/recipients/discord_channel_data.rb @@ -7,14 +7,16 @@ class DiscordChannelData < Knockapi::Internal::Type::BaseModel # @!attribute connections # List of Discord channel connections. # - # @return [Array] + # @return [Array] required :connections, - -> { Knockapi::Internal::Type::ArrayOf[union: Knockapi::Models::Recipients::DiscordChannelData::Connection] } + -> { + Knockapi::Internal::Type::ArrayOf[union: Knockapi::Recipients::DiscordChannelData::Connection] + } # @!method initialize(connections:) # Discord channel data. # - # @param connections [Array] List of Discord channel connections. + # @param connections [Array] List of Discord channel connections. # Discord channel connection, either a channel connection or an incoming webhook # connection. @@ -22,10 +24,12 @@ module Connection extend Knockapi::Internal::Type::Union # Discord channel connection. - variant -> { Knockapi::Models::Recipients::DiscordChannelData::Connection::DiscordChannelConnection } + variant -> { Knockapi::Recipients::DiscordChannelData::Connection::DiscordChannelConnection } # Discord incoming webhook connection. - variant -> { Knockapi::Models::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection } + variant -> { + Knockapi::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection + } class DiscordChannelConnection < Knockapi::Internal::Type::BaseModel # @!attribute channel_id @@ -44,16 +48,18 @@ class DiscordIncomingWebhookConnection < Knockapi::Internal::Type::BaseModel # @!attribute incoming_webhook # Discord incoming webhook object. # - # @return [Knockapi::Models::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection::IncomingWebhook] + # @return [Knockapi::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection::IncomingWebhook] required :incoming_webhook, - -> { Knockapi::Models::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection::IncomingWebhook } + -> { + Knockapi::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection::IncomingWebhook + } # @!method initialize(incoming_webhook:) # Discord incoming webhook connection. # - # @param incoming_webhook [Knockapi::Models::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection::IncomingWebhook] Discord incoming webhook object. + # @param incoming_webhook [Knockapi::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection::IncomingWebhook] Discord incoming webhook object. - # @see Knockapi::Models::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection#incoming_webhook + # @see Knockapi::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection#incoming_webhook class IncomingWebhook < Knockapi::Internal::Type::BaseModel # @!attribute url # Incoming webhook URL. @@ -69,7 +75,16 @@ class IncomingWebhook < Knockapi::Internal::Type::BaseModel end # @!method self.variants - # @return [Array(Knockapi::Models::Recipients::DiscordChannelData::Connection::DiscordChannelConnection, Knockapi::Models::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection)] + # @return [Array(Knockapi::Recipients::DiscordChannelData::Connection::DiscordChannelConnection, Knockapi::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection)] + + define_sorbet_constant!(:Variants) do + T.type_alias do + T.any( + Knockapi::Recipients::DiscordChannelData::Connection::DiscordChannelConnection, + Knockapi::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection + ) + end + end end end end diff --git a/lib/knockapi/models/recipients/inline_channel_data_request.rb b/lib/knockapi/models/recipients/inline_channel_data_request.rb index 490ee803..c8d3e0df 100644 --- a/lib/knockapi/models/recipients/inline_channel_data_request.rb +++ b/lib/knockapi/models/recipients/inline_channel_data_request.rb @@ -3,9 +3,44 @@ module Knockapi module Models module Recipients + # Channel data for a given channel type. + module InlineChannelDataRequestItem + extend Knockapi::Internal::Type::Union + + # The content of a push notification. + variant -> { Knockapi::Recipients::PushChannelData } + + # OneSignal channel data. + variant -> { Knockapi::Recipients::OneSignalChannelData } + + # Slack channel data + variant -> { Knockapi::Recipients::SlackChannelData } + + # Microsoft Teams channel connection. + variant -> { Knockapi::Recipients::MsTeamsChannelData } + + # Discord channel data. + variant -> { Knockapi::Recipients::DiscordChannelData } + + # @!method self.variants + # @return [Array(Knockapi::Recipients::PushChannelData, Knockapi::Recipients::OneSignalChannelData, Knockapi::Recipients::SlackChannelData, Knockapi::Recipients::MsTeamsChannelData, Knockapi::Recipients::DiscordChannelData)] + + define_sorbet_constant!(:Variants) do + T.type_alias do + T.any( + Knockapi::Recipients::PushChannelData, + Knockapi::Recipients::OneSignalChannelData, + Knockapi::Recipients::SlackChannelData, + Knockapi::Recipients::MsTeamsChannelData, + Knockapi::Recipients::DiscordChannelData + ) + end + end + end + # @type [Knockapi::Internal::Type::Converter] InlineChannelDataRequest = - Knockapi::Internal::Type::HashOf[-> { Knockapi::Models::Recipients::ChannelDataRequest }] + Knockapi::Internal::Type::HashOf[union: -> { Knockapi::Recipients::InlineChannelDataRequestItem }] end end end diff --git a/lib/knockapi/models/recipients/inline_preference_set_request.rb b/lib/knockapi/models/recipients/inline_preference_set_request.rb index f09ab74e..84309bd7 100644 --- a/lib/knockapi/models/recipients/inline_preference_set_request.rb +++ b/lib/knockapi/models/recipients/inline_preference_set_request.rb @@ -5,7 +5,7 @@ module Models module Recipients # @type [Knockapi::Internal::Type::Converter] InlinePreferenceSetRequest = - Knockapi::Internal::Type::HashOf[-> { Knockapi::Models::Recipients::PreferenceSetRequest }] + Knockapi::Internal::Type::HashOf[-> { Knockapi::Recipients::PreferenceSetRequest }] end end end diff --git a/lib/knockapi/models/recipients/ms_teams_channel_data.rb b/lib/knockapi/models/recipients/ms_teams_channel_data.rb index eaabd765..de13c6a2 100644 --- a/lib/knockapi/models/recipients/ms_teams_channel_data.rb +++ b/lib/knockapi/models/recipients/ms_teams_channel_data.rb @@ -7,9 +7,11 @@ class MsTeamsChannelData < Knockapi::Internal::Type::BaseModel # @!attribute connections # List of Microsoft Teams connections. # - # @return [Array] + # @return [Array] required :connections, - -> { Knockapi::Internal::Type::ArrayOf[union: Knockapi::Models::Recipients::MsTeamsChannelData::Connection] } + -> { + Knockapi::Internal::Type::ArrayOf[union: Knockapi::Recipients::MsTeamsChannelData::Connection] + } # @!attribute ms_teams_tenant_id # Microsoft Teams tenant ID. @@ -20,7 +22,7 @@ class MsTeamsChannelData < Knockapi::Internal::Type::BaseModel # @!method initialize(connections:, ms_teams_tenant_id: nil) # Microsoft Teams channel connection. # - # @param connections [Array] List of Microsoft Teams connections. + # @param connections [Array] List of Microsoft Teams connections. # # @param ms_teams_tenant_id [String, nil] Microsoft Teams tenant ID. @@ -29,10 +31,12 @@ module Connection extend Knockapi::Internal::Type::Union # Microsoft Teams token connection. - variant -> { Knockapi::Models::Recipients::MsTeamsChannelData::Connection::MsTeamsTokenConnection } + variant -> { Knockapi::Recipients::MsTeamsChannelData::Connection::MsTeamsTokenConnection } # Microsoft Teams incoming webhook connection. - variant -> { Knockapi::Models::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection } + variant -> { + Knockapi::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection + } class MsTeamsTokenConnection < Knockapi::Internal::Type::BaseModel # @!attribute ms_teams_channel_id @@ -75,16 +79,18 @@ class MsTeamsIncomingWebhookConnection < Knockapi::Internal::Type::BaseModel # @!attribute incoming_webhook # Microsoft Teams incoming webhook. # - # @return [Knockapi::Models::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection::IncomingWebhook] + # @return [Knockapi::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection::IncomingWebhook] required :incoming_webhook, - -> { Knockapi::Models::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection::IncomingWebhook } + -> { + Knockapi::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection::IncomingWebhook + } # @!method initialize(incoming_webhook:) # Microsoft Teams incoming webhook connection. # - # @param incoming_webhook [Knockapi::Models::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection::IncomingWebhook] Microsoft Teams incoming webhook. + # @param incoming_webhook [Knockapi::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection::IncomingWebhook] Microsoft Teams incoming webhook. - # @see Knockapi::Models::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection#incoming_webhook + # @see Knockapi::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection#incoming_webhook class IncomingWebhook < Knockapi::Internal::Type::BaseModel # @!attribute url # Microsoft Teams incoming webhook URL. @@ -100,7 +106,16 @@ class IncomingWebhook < Knockapi::Internal::Type::BaseModel end # @!method self.variants - # @return [Array(Knockapi::Models::Recipients::MsTeamsChannelData::Connection::MsTeamsTokenConnection, Knockapi::Models::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection)] + # @return [Array(Knockapi::Recipients::MsTeamsChannelData::Connection::MsTeamsTokenConnection, Knockapi::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection)] + + define_sorbet_constant!(:Variants) do + T.type_alias do + T.any( + Knockapi::Recipients::MsTeamsChannelData::Connection::MsTeamsTokenConnection, + Knockapi::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection + ) + end + end end end end diff --git a/lib/knockapi/models/recipients/preference_set.rb b/lib/knockapi/models/recipients/preference_set.rb index 4ffdeb4a..42c1967f 100644 --- a/lib/knockapi/models/recipients/preference_set.rb +++ b/lib/knockapi/models/recipients/preference_set.rb @@ -14,42 +14,44 @@ class PreferenceSet < Knockapi::Internal::Type::BaseModel # An object where the key is the category and the values are the preference # settings for that category. # - # @return [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::PreferenceSet::Category::PreferenceSetWorkflowCategorySettingObject}, nil] + # @return [Hash{Symbol=>Boolean, Knockapi::Recipients::PreferenceSet::Category::PreferenceSetWorkflowCategorySettingObject}, nil] optional :categories, - -> { Knockapi::Internal::Type::HashOf[union: Knockapi::Models::Recipients::PreferenceSet::Category] }, + -> { + Knockapi::Internal::Type::HashOf[union: Knockapi::Recipients::PreferenceSet::Category] + }, nil?: true # @!attribute channel_types # Channel type preferences. # - # @return [Knockapi::Models::Recipients::PreferenceSetChannelTypes, nil] - optional :channel_types, -> { Knockapi::Models::Recipients::PreferenceSetChannelTypes }, nil?: true + # @return [Knockapi::Recipients::PreferenceSetChannelTypes, nil] + optional :channel_types, -> { Knockapi::Recipients::PreferenceSetChannelTypes }, nil?: true # @!attribute workflows # An object where the key is the workflow key and the values are the preference # settings for that workflow. # - # @return [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::PreferenceSet::Workflow::PreferenceSetWorkflowCategorySettingObject}, nil] + # @return [Hash{Symbol=>Boolean, Knockapi::Recipients::PreferenceSet::Workflow::PreferenceSetWorkflowCategorySettingObject}, nil] optional :workflows, - -> { Knockapi::Internal::Type::HashOf[union: Knockapi::Models::Recipients::PreferenceSet::Workflow] }, + -> { + Knockapi::Internal::Type::HashOf[union: Knockapi::Recipients::PreferenceSet::Workflow] + }, nil?: true # @!method initialize(id:, categories: nil, channel_types: nil, workflows: nil) # Some parameter documentations has been truncated, see - # {Knockapi::Models::Recipients::PreferenceSet} for more details. + # {Knockapi::Recipients::PreferenceSet} for more details. # # A preference set represents a specific set of notification preferences for a # recipient. A recipient can have multiple preference sets. # # @param id [String] Unique identifier for the preference set. # - # @param categories [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::PreferenceSet::Category::PreferenceSetWorkflowCategorySettingObject}, nil] An object where the key is the category and the values are the preference settin - # ... + # @param categories [Hash{Symbol=>Boolean, Knockapi::Recipients::PreferenceSet::Category::PreferenceSetWorkflowCategorySettingObject}, nil] An object where the key is the category and the values are the preference settin # - # @param channel_types [Knockapi::Models::Recipients::PreferenceSetChannelTypes, nil] Channel type preferences. + # @param channel_types [Knockapi::Recipients::PreferenceSetChannelTypes, nil] Channel type preferences. # - # @param workflows [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::PreferenceSet::Workflow::PreferenceSetWorkflowCategorySettingObject}, nil] An object where the key is the workflow key and the values are the preference se - # ... + # @param workflows [Hash{Symbol=>Boolean, Knockapi::Recipients::PreferenceSet::Workflow::PreferenceSetWorkflowCategorySettingObject}, nil] An object where the key is the workflow key and the values are the preference se # Workflow or category preferences within a preference set module Category @@ -58,32 +60,43 @@ module Category variant Knockapi::Internal::Type::Boolean # The settings object for a workflow or category, where you can specify channel types or conditions. - variant -> { Knockapi::Models::Recipients::PreferenceSet::Category::PreferenceSetWorkflowCategorySettingObject } + variant -> { + Knockapi::Recipients::PreferenceSet::Category::PreferenceSetWorkflowCategorySettingObject + } class PreferenceSetWorkflowCategorySettingObject < Knockapi::Internal::Type::BaseModel # @!attribute channel_types # Channel type preferences. # - # @return [Knockapi::Models::Recipients::PreferenceSetChannelTypes, nil] - optional :channel_types, -> { Knockapi::Models::Recipients::PreferenceSetChannelTypes }, nil?: true + # @return [Knockapi::Recipients::PreferenceSetChannelTypes, nil] + optional :channel_types, -> { Knockapi::Recipients::PreferenceSetChannelTypes }, nil?: true # @!attribute conditions # A list of conditions to apply to a channel type. # - # @return [Array, nil] - optional :conditions, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Condition] }, nil?: true + # @return [Array, nil] + optional :conditions, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Condition] }, nil?: true # @!method initialize(channel_types: nil, conditions: nil) # The settings object for a workflow or category, where you can specify channel # types or conditions. # - # @param channel_types [Knockapi::Models::Recipients::PreferenceSetChannelTypes, nil] Channel type preferences. + # @param channel_types [Knockapi::Recipients::PreferenceSetChannelTypes, nil] Channel type preferences. # - # @param conditions [Array, nil] A list of conditions to apply to a channel type. + # @param conditions [Array, nil] A list of conditions to apply to a channel type. end # @!method self.variants - # @return [Array(Boolean, Knockapi::Models::Recipients::PreferenceSet::Category::PreferenceSetWorkflowCategorySettingObject)] + # @return [Array(Boolean, Knockapi::Recipients::PreferenceSet::Category::PreferenceSetWorkflowCategorySettingObject)] + + define_sorbet_constant!(:Variants) do + T.type_alias do + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSet::Category::PreferenceSetWorkflowCategorySettingObject + ) + end + end end # Workflow or category preferences within a preference set @@ -93,32 +106,43 @@ module Workflow variant Knockapi::Internal::Type::Boolean # The settings object for a workflow or category, where you can specify channel types or conditions. - variant -> { Knockapi::Models::Recipients::PreferenceSet::Workflow::PreferenceSetWorkflowCategorySettingObject } + variant -> { + Knockapi::Recipients::PreferenceSet::Workflow::PreferenceSetWorkflowCategorySettingObject + } class PreferenceSetWorkflowCategorySettingObject < Knockapi::Internal::Type::BaseModel # @!attribute channel_types # Channel type preferences. # - # @return [Knockapi::Models::Recipients::PreferenceSetChannelTypes, nil] - optional :channel_types, -> { Knockapi::Models::Recipients::PreferenceSetChannelTypes }, nil?: true + # @return [Knockapi::Recipients::PreferenceSetChannelTypes, nil] + optional :channel_types, -> { Knockapi::Recipients::PreferenceSetChannelTypes }, nil?: true # @!attribute conditions # A list of conditions to apply to a channel type. # - # @return [Array, nil] - optional :conditions, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Condition] }, nil?: true + # @return [Array, nil] + optional :conditions, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Condition] }, nil?: true # @!method initialize(channel_types: nil, conditions: nil) # The settings object for a workflow or category, where you can specify channel # types or conditions. # - # @param channel_types [Knockapi::Models::Recipients::PreferenceSetChannelTypes, nil] Channel type preferences. + # @param channel_types [Knockapi::Recipients::PreferenceSetChannelTypes, nil] Channel type preferences. # - # @param conditions [Array, nil] A list of conditions to apply to a channel type. + # @param conditions [Array, nil] A list of conditions to apply to a channel type. end # @!method self.variants - # @return [Array(Boolean, Knockapi::Models::Recipients::PreferenceSet::Workflow::PreferenceSetWorkflowCategorySettingObject)] + # @return [Array(Boolean, Knockapi::Recipients::PreferenceSet::Workflow::PreferenceSetWorkflowCategorySettingObject)] + + define_sorbet_constant!(:Variants) do + T.type_alias do + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSet::Workflow::PreferenceSetWorkflowCategorySettingObject + ) + end + end end end end diff --git a/lib/knockapi/models/recipients/preference_set_channel_type_setting.rb b/lib/knockapi/models/recipients/preference_set_channel_type_setting.rb index 6dc3458d..23a8c429 100644 --- a/lib/knockapi/models/recipients/preference_set_channel_type_setting.rb +++ b/lib/knockapi/models/recipients/preference_set_channel_type_setting.rb @@ -7,14 +7,14 @@ class PreferenceSetChannelTypeSetting < Knockapi::Internal::Type::BaseModel # @!attribute conditions # A list of conditions to apply to a channel type. # - # @return [Array] - required :conditions, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Condition] } + # @return [Array] + required :conditions, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Condition] } # @!method initialize(conditions:) # A set of settings for a channel type. Currently, this can only be a list of # conditions to apply. # - # @param conditions [Array] A list of conditions to apply to a channel type. + # @param conditions [Array] A list of conditions to apply to a channel type. end end end diff --git a/lib/knockapi/models/recipients/preference_set_channel_types.rb b/lib/knockapi/models/recipients/preference_set_channel_types.rb index 5ee82593..e351d069 100644 --- a/lib/knockapi/models/recipients/preference_set_channel_types.rb +++ b/lib/knockapi/models/recipients/preference_set_channel_types.rb @@ -7,142 +7,166 @@ class PreferenceSetChannelTypes < Knockapi::Internal::Type::BaseModel # @!attribute chat # Whether the channel type is enabled for the preference set. # - # @return [Boolean, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting, nil] - optional :chat, union: -> { Knockapi::Models::Recipients::PreferenceSetChannelTypes::Chat } + # @return [Boolean, Knockapi::Recipients::PreferenceSetChannelTypeSetting, nil] + optional :chat, union: -> { Knockapi::Recipients::PreferenceSetChannelTypes::Chat } # @!attribute email # Whether the channel type is enabled for the preference set. # - # @return [Boolean, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting, nil] - optional :email, union: -> { Knockapi::Models::Recipients::PreferenceSetChannelTypes::Email } + # @return [Boolean, Knockapi::Recipients::PreferenceSetChannelTypeSetting, nil] + optional :email, union: -> { Knockapi::Recipients::PreferenceSetChannelTypes::Email } # @!attribute http # Whether the channel type is enabled for the preference set. # - # @return [Boolean, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting, nil] - optional :http, union: -> { Knockapi::Models::Recipients::PreferenceSetChannelTypes::HTTP } + # @return [Boolean, Knockapi::Recipients::PreferenceSetChannelTypeSetting, nil] + optional :http, union: -> { Knockapi::Recipients::PreferenceSetChannelTypes::HTTP } # @!attribute in_app_feed # Whether the channel type is enabled for the preference set. # - # @return [Boolean, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting, nil] - optional :in_app_feed, union: -> { Knockapi::Models::Recipients::PreferenceSetChannelTypes::InAppFeed } + # @return [Boolean, Knockapi::Recipients::PreferenceSetChannelTypeSetting, nil] + optional :in_app_feed, union: -> { Knockapi::Recipients::PreferenceSetChannelTypes::InAppFeed } # @!attribute push # Whether the channel type is enabled for the preference set. # - # @return [Boolean, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting, nil] - optional :push, union: -> { Knockapi::Models::Recipients::PreferenceSetChannelTypes::Push } + # @return [Boolean, Knockapi::Recipients::PreferenceSetChannelTypeSetting, nil] + optional :push, union: -> { Knockapi::Recipients::PreferenceSetChannelTypes::Push } # @!attribute sms # Whether the channel type is enabled for the preference set. # - # @return [Boolean, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting, nil] - optional :sms, union: -> { Knockapi::Models::Recipients::PreferenceSetChannelTypes::SMS } + # @return [Boolean, Knockapi::Recipients::PreferenceSetChannelTypeSetting, nil] + optional :sms, union: -> { Knockapi::Recipients::PreferenceSetChannelTypes::SMS } # @!method initialize(chat: nil, email: nil, http: nil, in_app_feed: nil, push: nil, sms: nil) # Channel type preferences. # - # @param chat [Boolean, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting] Whether the channel type is enabled for the preference set. + # @param chat [Boolean, Knockapi::Recipients::PreferenceSetChannelTypeSetting] Whether the channel type is enabled for the preference set. # - # @param email [Boolean, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting] Whether the channel type is enabled for the preference set. + # @param email [Boolean, Knockapi::Recipients::PreferenceSetChannelTypeSetting] Whether the channel type is enabled for the preference set. # - # @param http [Boolean, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting] Whether the channel type is enabled for the preference set. + # @param http [Boolean, Knockapi::Recipients::PreferenceSetChannelTypeSetting] Whether the channel type is enabled for the preference set. # - # @param in_app_feed [Boolean, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting] Whether the channel type is enabled for the preference set. + # @param in_app_feed [Boolean, Knockapi::Recipients::PreferenceSetChannelTypeSetting] Whether the channel type is enabled for the preference set. # - # @param push [Boolean, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting] Whether the channel type is enabled for the preference set. + # @param push [Boolean, Knockapi::Recipients::PreferenceSetChannelTypeSetting] Whether the channel type is enabled for the preference set. # - # @param sms [Boolean, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting] Whether the channel type is enabled for the preference set. + # @param sms [Boolean, Knockapi::Recipients::PreferenceSetChannelTypeSetting] Whether the channel type is enabled for the preference set. # Whether the channel type is enabled for the preference set. # - # @see Knockapi::Models::Recipients::PreferenceSetChannelTypes#chat + # @see Knockapi::Recipients::PreferenceSetChannelTypes#chat module Chat extend Knockapi::Internal::Type::Union variant Knockapi::Internal::Type::Boolean # A set of settings for a channel type. Currently, this can only be a list of conditions to apply. - variant -> { Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting } + variant -> { Knockapi::Recipients::PreferenceSetChannelTypeSetting } # @!method self.variants - # @return [Array(Boolean, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting)] + # @return [Array(Boolean, Knockapi::Recipients::PreferenceSetChannelTypeSetting)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(T::Boolean, Knockapi::Recipients::PreferenceSetChannelTypeSetting) } + end end # Whether the channel type is enabled for the preference set. # - # @see Knockapi::Models::Recipients::PreferenceSetChannelTypes#email + # @see Knockapi::Recipients::PreferenceSetChannelTypes#email module Email extend Knockapi::Internal::Type::Union variant Knockapi::Internal::Type::Boolean # A set of settings for a channel type. Currently, this can only be a list of conditions to apply. - variant -> { Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting } + variant -> { Knockapi::Recipients::PreferenceSetChannelTypeSetting } # @!method self.variants - # @return [Array(Boolean, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting)] + # @return [Array(Boolean, Knockapi::Recipients::PreferenceSetChannelTypeSetting)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(T::Boolean, Knockapi::Recipients::PreferenceSetChannelTypeSetting) } + end end # Whether the channel type is enabled for the preference set. # - # @see Knockapi::Models::Recipients::PreferenceSetChannelTypes#http + # @see Knockapi::Recipients::PreferenceSetChannelTypes#http module HTTP extend Knockapi::Internal::Type::Union variant Knockapi::Internal::Type::Boolean # A set of settings for a channel type. Currently, this can only be a list of conditions to apply. - variant -> { Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting } + variant -> { Knockapi::Recipients::PreferenceSetChannelTypeSetting } # @!method self.variants - # @return [Array(Boolean, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting)] + # @return [Array(Boolean, Knockapi::Recipients::PreferenceSetChannelTypeSetting)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(T::Boolean, Knockapi::Recipients::PreferenceSetChannelTypeSetting) } + end end # Whether the channel type is enabled for the preference set. # - # @see Knockapi::Models::Recipients::PreferenceSetChannelTypes#in_app_feed + # @see Knockapi::Recipients::PreferenceSetChannelTypes#in_app_feed module InAppFeed extend Knockapi::Internal::Type::Union variant Knockapi::Internal::Type::Boolean # A set of settings for a channel type. Currently, this can only be a list of conditions to apply. - variant -> { Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting } + variant -> { Knockapi::Recipients::PreferenceSetChannelTypeSetting } # @!method self.variants - # @return [Array(Boolean, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting)] + # @return [Array(Boolean, Knockapi::Recipients::PreferenceSetChannelTypeSetting)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(T::Boolean, Knockapi::Recipients::PreferenceSetChannelTypeSetting) } + end end # Whether the channel type is enabled for the preference set. # - # @see Knockapi::Models::Recipients::PreferenceSetChannelTypes#push + # @see Knockapi::Recipients::PreferenceSetChannelTypes#push module Push extend Knockapi::Internal::Type::Union variant Knockapi::Internal::Type::Boolean # A set of settings for a channel type. Currently, this can only be a list of conditions to apply. - variant -> { Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting } + variant -> { Knockapi::Recipients::PreferenceSetChannelTypeSetting } # @!method self.variants - # @return [Array(Boolean, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting)] + # @return [Array(Boolean, Knockapi::Recipients::PreferenceSetChannelTypeSetting)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(T::Boolean, Knockapi::Recipients::PreferenceSetChannelTypeSetting) } + end end # Whether the channel type is enabled for the preference set. # - # @see Knockapi::Models::Recipients::PreferenceSetChannelTypes#sms + # @see Knockapi::Recipients::PreferenceSetChannelTypes#sms module SMS extend Knockapi::Internal::Type::Union variant Knockapi::Internal::Type::Boolean # A set of settings for a channel type. Currently, this can only be a list of conditions to apply. - variant -> { Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting } + variant -> { Knockapi::Recipients::PreferenceSetChannelTypeSetting } # @!method self.variants - # @return [Array(Boolean, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting)] + # @return [Array(Boolean, Knockapi::Recipients::PreferenceSetChannelTypeSetting)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(T::Boolean, Knockapi::Recipients::PreferenceSetChannelTypeSetting) } + end end end end diff --git a/lib/knockapi/models/recipients/preference_set_request.rb b/lib/knockapi/models/recipients/preference_set_request.rb index 9690ba56..42cd581f 100644 --- a/lib/knockapi/models/recipients/preference_set_request.rb +++ b/lib/knockapi/models/recipients/preference_set_request.rb @@ -8,39 +8,41 @@ class PreferenceSetRequest < Knockapi::Internal::Type::BaseModel # An object where the key is the category and the values are the preference # settings for that category. # - # @return [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::PreferenceSetRequest::Category::PreferenceSetWorkflowCategorySettingObject}, nil] + # @return [Hash{Symbol=>Boolean, Knockapi::Recipients::PreferenceSetRequest::Category::PreferenceSetWorkflowCategorySettingObject}, nil] optional :categories, - -> { Knockapi::Internal::Type::HashOf[union: Knockapi::Models::Recipients::PreferenceSetRequest::Category] }, + -> { + Knockapi::Internal::Type::HashOf[union: Knockapi::Recipients::PreferenceSetRequest::Category] + }, nil?: true # @!attribute channel_types # Channel type preferences. # - # @return [Knockapi::Models::Recipients::PreferenceSetChannelTypes, nil] - optional :channel_types, -> { Knockapi::Models::Recipients::PreferenceSetChannelTypes }, nil?: true + # @return [Knockapi::Recipients::PreferenceSetChannelTypes, nil] + optional :channel_types, -> { Knockapi::Recipients::PreferenceSetChannelTypes }, nil?: true # @!attribute workflows # An object where the key is the workflow key and the values are the preference # settings for that workflow. # - # @return [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::PreferenceSetRequest::Workflow::PreferenceSetWorkflowCategorySettingObject}, nil] + # @return [Hash{Symbol=>Boolean, Knockapi::Recipients::PreferenceSetRequest::Workflow::PreferenceSetWorkflowCategorySettingObject}, nil] optional :workflows, - -> { Knockapi::Internal::Type::HashOf[union: Knockapi::Models::Recipients::PreferenceSetRequest::Workflow] }, + -> { + Knockapi::Internal::Type::HashOf[union: Knockapi::Recipients::PreferenceSetRequest::Workflow] + }, nil?: true # @!method initialize(categories: nil, channel_types: nil, workflows: nil) # Some parameter documentations has been truncated, see - # {Knockapi::Models::Recipients::PreferenceSetRequest} for more details. + # {Knockapi::Recipients::PreferenceSetRequest} for more details. # # A request to set a preference set for a recipient. # - # @param categories [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::PreferenceSetRequest::Category::PreferenceSetWorkflowCategorySettingObject}, nil] An object where the key is the category and the values are the preference settin - # ... + # @param categories [Hash{Symbol=>Boolean, Knockapi::Recipients::PreferenceSetRequest::Category::PreferenceSetWorkflowCategorySettingObject}, nil] An object where the key is the category and the values are the preference settin # - # @param channel_types [Knockapi::Models::Recipients::PreferenceSetChannelTypes, nil] Channel type preferences. + # @param channel_types [Knockapi::Recipients::PreferenceSetChannelTypes, nil] Channel type preferences. # - # @param workflows [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::PreferenceSetRequest::Workflow::PreferenceSetWorkflowCategorySettingObject}, nil] An object where the key is the workflow key and the values are the preference se - # ... + # @param workflows [Hash{Symbol=>Boolean, Knockapi::Recipients::PreferenceSetRequest::Workflow::PreferenceSetWorkflowCategorySettingObject}, nil] An object where the key is the workflow key and the values are the preference se # Workflow or category preferences within a preference set module Category @@ -49,32 +51,43 @@ module Category variant Knockapi::Internal::Type::Boolean # The settings object for a workflow or category, where you can specify channel types or conditions. - variant -> { Knockapi::Models::Recipients::PreferenceSetRequest::Category::PreferenceSetWorkflowCategorySettingObject } + variant -> { + Knockapi::Recipients::PreferenceSetRequest::Category::PreferenceSetWorkflowCategorySettingObject + } class PreferenceSetWorkflowCategorySettingObject < Knockapi::Internal::Type::BaseModel # @!attribute channel_types # Channel type preferences. # - # @return [Knockapi::Models::Recipients::PreferenceSetChannelTypes, nil] - optional :channel_types, -> { Knockapi::Models::Recipients::PreferenceSetChannelTypes }, nil?: true + # @return [Knockapi::Recipients::PreferenceSetChannelTypes, nil] + optional :channel_types, -> { Knockapi::Recipients::PreferenceSetChannelTypes }, nil?: true # @!attribute conditions # A list of conditions to apply to a channel type. # - # @return [Array, nil] - optional :conditions, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Condition] }, nil?: true + # @return [Array, nil] + optional :conditions, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Condition] }, nil?: true # @!method initialize(channel_types: nil, conditions: nil) # The settings object for a workflow or category, where you can specify channel # types or conditions. # - # @param channel_types [Knockapi::Models::Recipients::PreferenceSetChannelTypes, nil] Channel type preferences. + # @param channel_types [Knockapi::Recipients::PreferenceSetChannelTypes, nil] Channel type preferences. # - # @param conditions [Array, nil] A list of conditions to apply to a channel type. + # @param conditions [Array, nil] A list of conditions to apply to a channel type. end # @!method self.variants - # @return [Array(Boolean, Knockapi::Models::Recipients::PreferenceSetRequest::Category::PreferenceSetWorkflowCategorySettingObject)] + # @return [Array(Boolean, Knockapi::Recipients::PreferenceSetRequest::Category::PreferenceSetWorkflowCategorySettingObject)] + + define_sorbet_constant!(:Variants) do + T.type_alias do + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetRequest::Category::PreferenceSetWorkflowCategorySettingObject + ) + end + end end # Workflow or category preferences within a preference set @@ -84,32 +97,43 @@ module Workflow variant Knockapi::Internal::Type::Boolean # The settings object for a workflow or category, where you can specify channel types or conditions. - variant -> { Knockapi::Models::Recipients::PreferenceSetRequest::Workflow::PreferenceSetWorkflowCategorySettingObject } + variant -> { + Knockapi::Recipients::PreferenceSetRequest::Workflow::PreferenceSetWorkflowCategorySettingObject + } class PreferenceSetWorkflowCategorySettingObject < Knockapi::Internal::Type::BaseModel # @!attribute channel_types # Channel type preferences. # - # @return [Knockapi::Models::Recipients::PreferenceSetChannelTypes, nil] - optional :channel_types, -> { Knockapi::Models::Recipients::PreferenceSetChannelTypes }, nil?: true + # @return [Knockapi::Recipients::PreferenceSetChannelTypes, nil] + optional :channel_types, -> { Knockapi::Recipients::PreferenceSetChannelTypes }, nil?: true # @!attribute conditions # A list of conditions to apply to a channel type. # - # @return [Array, nil] - optional :conditions, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Condition] }, nil?: true + # @return [Array, nil] + optional :conditions, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Condition] }, nil?: true # @!method initialize(channel_types: nil, conditions: nil) # The settings object for a workflow or category, where you can specify channel # types or conditions. # - # @param channel_types [Knockapi::Models::Recipients::PreferenceSetChannelTypes, nil] Channel type preferences. + # @param channel_types [Knockapi::Recipients::PreferenceSetChannelTypes, nil] Channel type preferences. # - # @param conditions [Array, nil] A list of conditions to apply to a channel type. + # @param conditions [Array, nil] A list of conditions to apply to a channel type. end # @!method self.variants - # @return [Array(Boolean, Knockapi::Models::Recipients::PreferenceSetRequest::Workflow::PreferenceSetWorkflowCategorySettingObject)] + # @return [Array(Boolean, Knockapi::Recipients::PreferenceSetRequest::Workflow::PreferenceSetWorkflowCategorySettingObject)] + + define_sorbet_constant!(:Variants) do + T.type_alias do + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetRequest::Workflow::PreferenceSetWorkflowCategorySettingObject + ) + end + end end end end diff --git a/lib/knockapi/models/recipients/slack_channel_data.rb b/lib/knockapi/models/recipients/slack_channel_data.rb index 708fb505..6e089016 100644 --- a/lib/knockapi/models/recipients/slack_channel_data.rb +++ b/lib/knockapi/models/recipients/slack_channel_data.rb @@ -7,32 +7,34 @@ class SlackChannelData < Knockapi::Internal::Type::BaseModel # @!attribute connections # List of Slack channel connections. # - # @return [Array] + # @return [Array] required :connections, - -> { Knockapi::Internal::Type::ArrayOf[union: Knockapi::Models::Recipients::SlackChannelData::Connection] } + -> { + Knockapi::Internal::Type::ArrayOf[union: Knockapi::Recipients::SlackChannelData::Connection] + } # @!attribute token # A Slack connection token. # - # @return [Knockapi::Models::Recipients::SlackChannelData::Token, nil] - optional :token, -> { Knockapi::Models::Recipients::SlackChannelData::Token }, nil?: true + # @return [Knockapi::Recipients::SlackChannelData::Token, nil] + optional :token, -> { Knockapi::Recipients::SlackChannelData::Token }, nil?: true # @!method initialize(connections:, token: nil) # Slack channel data # - # @param connections [Array] List of Slack channel connections. + # @param connections [Array] List of Slack channel connections. # - # @param token [Knockapi::Models::Recipients::SlackChannelData::Token, nil] A Slack connection token. + # @param token [Knockapi::Recipients::SlackChannelData::Token, nil] A Slack connection token. # A Slack connection, either an access token or an incoming webhook module Connection extend Knockapi::Internal::Type::Union # A Slack connection token. - variant -> { Knockapi::Models::Recipients::SlackChannelData::Connection::SlackTokenConnection } + variant -> { Knockapi::Recipients::SlackChannelData::Connection::SlackTokenConnection } # A Slack connection incoming webhook. - variant -> { Knockapi::Models::Recipients::SlackChannelData::Connection::SlackIncomingWebhookConnection } + variant -> { Knockapi::Recipients::SlackChannelData::Connection::SlackIncomingWebhookConnection } class SlackTokenConnection < Knockapi::Internal::Type::BaseModel # @!attribute access_token @@ -77,10 +79,19 @@ class SlackIncomingWebhookConnection < Knockapi::Internal::Type::BaseModel end # @!method self.variants - # @return [Array(Knockapi::Models::Recipients::SlackChannelData::Connection::SlackTokenConnection, Knockapi::Models::Recipients::SlackChannelData::Connection::SlackIncomingWebhookConnection)] + # @return [Array(Knockapi::Recipients::SlackChannelData::Connection::SlackTokenConnection, Knockapi::Recipients::SlackChannelData::Connection::SlackIncomingWebhookConnection)] + + define_sorbet_constant!(:Variants) do + T.type_alias do + T.any( + Knockapi::Recipients::SlackChannelData::Connection::SlackTokenConnection, + Knockapi::Recipients::SlackChannelData::Connection::SlackIncomingWebhookConnection + ) + end + end end - # @see Knockapi::Models::Recipients::SlackChannelData#token + # @see Knockapi::Recipients::SlackChannelData#token class Token < Knockapi::Internal::Type::BaseModel # @!attribute access_token # A Slack access token. diff --git a/lib/knockapi/models/recipients/subscription.rb b/lib/knockapi/models/recipients/subscription.rb index 6a86b249..8146457b 100644 --- a/lib/knockapi/models/recipients/subscription.rb +++ b/lib/knockapi/models/recipients/subscription.rb @@ -19,14 +19,14 @@ class Subscription < Knockapi::Internal::Type::BaseModel # @!attribute object # A custom [Object](/concepts/objects) entity which belongs to a collection. # - # @return [Knockapi::Models::Object] - required :object, -> { Knockapi::Models::Object } + # @return [Knockapi::Object] + required :object, -> { Knockapi::Object } # @!attribute recipient # A recipient of a notification, which is either a user or an object. # - # @return [Knockapi::Models::User, Knockapi::Models::Object] - required :recipient, union: -> { Knockapi::Models::Recipient } + # @return [Knockapi::User, Knockapi::Object] + required :recipient, union: -> { Knockapi::Recipient } # @!attribute updated_at # The timestamp when the resource was last updated. @@ -47,9 +47,9 @@ class Subscription < Knockapi::Internal::Type::BaseModel # # @param inserted_at [Time] Timestamp when the resource was created. # - # @param object [Knockapi::Models::Object] A custom [Object](/concepts/objects) entity which belongs to a collection. + # @param object [Knockapi::Object] A custom [Object](/concepts/objects) entity which belongs to a collection. # - # @param recipient [Knockapi::Models::User, Knockapi::Models::Object] A recipient of a notification, which is either a user or an object. + # @param recipient [Knockapi::User, Knockapi::Object] A recipient of a notification, which is either a user or an object. # # @param updated_at [Time] The timestamp when the resource was last updated. # diff --git a/lib/knockapi/models/schedule.rb b/lib/knockapi/models/schedule.rb index b5c2e83c..5edc81a6 100644 --- a/lib/knockapi/models/schedule.rb +++ b/lib/knockapi/models/schedule.rb @@ -19,14 +19,14 @@ class Schedule < Knockapi::Internal::Type::BaseModel # @!attribute recipient # A recipient of a notification, which is either a user or an object. # - # @return [Knockapi::Models::User, Knockapi::Models::Object] - required :recipient, union: -> { Knockapi::Models::Recipient } + # @return [Knockapi::User, Knockapi::Object] + required :recipient, union: -> { Knockapi::Recipient } # @!attribute repeats # The repeat rule for the schedule. # - # @return [Array] - required :repeats, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Models::ScheduleRepeatRule] } + # @return [Array] + required :repeats, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::ScheduleRepeatRule] } # @!attribute updated_at # The timestamp when the resource was last updated. @@ -49,8 +49,8 @@ class Schedule < Knockapi::Internal::Type::BaseModel # @!attribute actor # A recipient of a notification, which is either a user or an object. # - # @return [Knockapi::Models::User, Knockapi::Models::Object, nil] - optional :actor, union: -> { Knockapi::Models::Recipient }, nil?: true + # @return [Knockapi::User, Knockapi::Object, nil] + optional :actor, union: -> { Knockapi::Recipient }, nil?: true # @!attribute data # An optional map of data to pass into the workflow execution. @@ -79,8 +79,8 @@ class Schedule < Knockapi::Internal::Type::BaseModel optional :tenant, String, nil?: true # @!method initialize(id:, inserted_at:, recipient:, repeats:, updated_at:, workflow:, _typename: nil, actor: nil, data: nil, last_occurrence_at: nil, next_occurrence_at: nil, tenant: nil) - # Some parameter documentations has been truncated, see - # {Knockapi::Models::Schedule} for more details. + # Some parameter documentations has been truncated, see {Knockapi::Schedule} for + # more details. # # A schedule represents a recurring workflow execution. # @@ -88,9 +88,9 @@ class Schedule < Knockapi::Internal::Type::BaseModel # # @param inserted_at [Time] Timestamp when the resource was created. # - # @param recipient [Knockapi::Models::User, Knockapi::Models::Object] A recipient of a notification, which is either a user or an object. + # @param recipient [Knockapi::User, Knockapi::Object] A recipient of a notification, which is either a user or an object. # - # @param repeats [Array] The repeat rule for the schedule. + # @param repeats [Array] The repeat rule for the schedule. # # @param updated_at [Time] The timestamp when the resource was last updated. # @@ -98,7 +98,7 @@ class Schedule < Knockapi::Internal::Type::BaseModel # # @param _typename [String] The typename of the schema. # - # @param actor [Knockapi::Models::User, Knockapi::Models::Object, nil] A recipient of a notification, which is either a user or an object. + # @param actor [Knockapi::User, Knockapi::Object, nil] A recipient of a notification, which is either a user or an object. # # @param data [Hash{Symbol=>Object}, nil] An optional map of data to pass into the workflow execution. # @@ -107,7 +107,6 @@ class Schedule < Knockapi::Internal::Type::BaseModel # @param next_occurrence_at [Time, nil] The next occurrence of the schedule. # # @param tenant [String, nil] The tenant to trigger the workflow for. Triggering with a tenant will use any te - # ... end end end diff --git a/lib/knockapi/models/schedule_create_params.rb b/lib/knockapi/models/schedule_create_params.rb index e117cc70..99ef08a8 100644 --- a/lib/knockapi/models/schedule_create_params.rb +++ b/lib/knockapi/models/schedule_create_params.rb @@ -8,17 +8,16 @@ class ScheduleCreateParams < Knockapi::Internal::Type::BaseModel include Knockapi::Internal::Type::RequestParameters # @!attribute recipients - # The recipients to trigger the workflow for. Can inline identify users, objects, - # or use a list of user IDs. Limited to 1,000 recipients. + # The recipients to set the schedule for. Limited to 100 recipients per request. # - # @return [Array] - required :recipients, -> { Knockapi::Internal::Type::ArrayOf[union: Knockapi::Models::RecipientRequest] } + # @return [Array] + required :recipients, -> { Knockapi::Internal::Type::ArrayOf[union: Knockapi::RecipientRequest] } # @!attribute repeats # The repeat rule for the schedule. # - # @return [Array] - required :repeats, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Models::ScheduleRepeatRule] } + # @return [Array] + required :repeats, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::ScheduleRepeatRule] } # @!attribute workflow # The key of the workflow. @@ -47,17 +46,13 @@ class ScheduleCreateParams < Knockapi::Internal::Type::BaseModel # @!attribute tenant # An request to set a tenant inline. # - # @return [String, Knockapi::Models::TenantRequest, nil] - optional :tenant, union: -> { Knockapi::Models::InlineTenantRequest }, nil?: true + # @return [String, Knockapi::TenantRequest, nil] + optional :tenant, union: -> { Knockapi::InlineTenantRequest }, nil?: true # @!method initialize(recipients:, repeats:, workflow:, data: nil, ending_at: nil, scheduled_at: nil, tenant: nil, request_options: {}) - # Some parameter documentations has been truncated, see - # {Knockapi::Models::ScheduleCreateParams} for more details. + # @param recipients [Array] The recipients to set the schedule for. Limited to 100 recipients per request. # - # @param recipients [Array] The recipients to trigger the workflow for. Can inline identify users, objects, - # ... - # - # @param repeats [Array] The repeat rule for the schedule. + # @param repeats [Array] The repeat rule for the schedule. # # @param workflow [String] The key of the workflow. # @@ -67,7 +62,7 @@ class ScheduleCreateParams < Knockapi::Internal::Type::BaseModel # # @param scheduled_at [Time, nil] The starting date and time for the schedule. # - # @param tenant [String, Knockapi::Models::TenantRequest, nil] An request to set a tenant inline. + # @param tenant [String, Knockapi::TenantRequest, nil] An request to set a tenant inline. # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/knockapi/models/schedule_create_response.rb b/lib/knockapi/models/schedule_create_response.rb index 253847fd..d001c8d7 100644 --- a/lib/knockapi/models/schedule_create_response.rb +++ b/lib/knockapi/models/schedule_create_response.rb @@ -3,6 +3,6 @@ module Knockapi module Models # @type [Knockapi::Internal::Type::Converter] - ScheduleCreateResponse = Knockapi::Internal::Type::ArrayOf[-> { Knockapi::Models::Schedule }] + ScheduleCreateResponse = Knockapi::Internal::Type::ArrayOf[-> { Knockapi::Schedule }] end end diff --git a/lib/knockapi/models/schedule_delete_response.rb b/lib/knockapi/models/schedule_delete_response.rb index 838c3e7a..e28e35e6 100644 --- a/lib/knockapi/models/schedule_delete_response.rb +++ b/lib/knockapi/models/schedule_delete_response.rb @@ -3,6 +3,6 @@ module Knockapi module Models # @type [Knockapi::Internal::Type::Converter] - ScheduleDeleteResponse = Knockapi::Internal::Type::ArrayOf[-> { Knockapi::Models::Schedule }] + ScheduleDeleteResponse = Knockapi::Internal::Type::ArrayOf[-> { Knockapi::Schedule }] end end diff --git a/lib/knockapi/models/schedule_repeat_rule.rb b/lib/knockapi/models/schedule_repeat_rule.rb index 55bb623a..e6353197 100644 --- a/lib/knockapi/models/schedule_repeat_rule.rb +++ b/lib/knockapi/models/schedule_repeat_rule.rb @@ -12,8 +12,8 @@ class ScheduleRepeatRule < Knockapi::Internal::Type::BaseModel # @!attribute frequency # The frequency of the schedule. # - # @return [Symbol, Knockapi::Models::ScheduleRepeatRule::Frequency] - required :frequency, enum: -> { Knockapi::Models::ScheduleRepeatRule::Frequency } + # @return [Symbol, Knockapi::ScheduleRepeatRule::Frequency] + required :frequency, enum: -> { Knockapi::ScheduleRepeatRule::Frequency } # @!attribute day_of_month # The day of the month to repeat the schedule. @@ -24,9 +24,9 @@ class ScheduleRepeatRule < Knockapi::Internal::Type::BaseModel # @!attribute days # The days of the week to repeat the schedule. # - # @return [Array, nil] + # @return [Array, nil] optional :days, - -> { Knockapi::Internal::Type::ArrayOf[enum: Knockapi::Models::ScheduleRepeatRule::Day] }, + -> { Knockapi::Internal::Type::ArrayOf[enum: Knockapi::ScheduleRepeatRule::Day] }, nil?: true # @!attribute hours @@ -52,11 +52,11 @@ class ScheduleRepeatRule < Knockapi::Internal::Type::BaseModel # # @param _typename [String] The typename of the schema. # - # @param frequency [Symbol, Knockapi::Models::ScheduleRepeatRule::Frequency] The frequency of the schedule. + # @param frequency [Symbol, Knockapi::ScheduleRepeatRule::Frequency] The frequency of the schedule. # # @param day_of_month [Integer, nil] The day of the month to repeat the schedule. # - # @param days [Array, nil] The days of the week to repeat the schedule. + # @param days [Array, nil] The days of the week to repeat the schedule. # # @param hours [Integer, nil] The hour of the day to repeat the schedule. # @@ -66,7 +66,7 @@ class ScheduleRepeatRule < Knockapi::Internal::Type::BaseModel # The frequency of the schedule. # - # @see Knockapi::Models::ScheduleRepeatRule#frequency + # @see Knockapi::ScheduleRepeatRule#frequency module Frequency extend Knockapi::Internal::Type::Enum diff --git a/lib/knockapi/models/schedule_update_params.rb b/lib/knockapi/models/schedule_update_params.rb index f132ac61..0c6c2240 100644 --- a/lib/knockapi/models/schedule_update_params.rb +++ b/lib/knockapi/models/schedule_update_params.rb @@ -17,8 +17,8 @@ class ScheduleUpdateParams < Knockapi::Internal::Type::BaseModel # A reference to a recipient, either a user identifier (string) or an object # reference (ID, collection). # - # @return [String, Knockapi::Models::RecipientReference::ObjectReference, nil] - optional :actor, union: -> { Knockapi::Models::RecipientReference }, nil?: true + # @return [String, Knockapi::RecipientReference::ObjectReference, nil] + optional :actor, union: -> { Knockapi::RecipientReference }, nil?: true # @!attribute data # An optional map of data to pass into the workflow execution. @@ -35,8 +35,8 @@ class ScheduleUpdateParams < Knockapi::Internal::Type::BaseModel # @!attribute repeats # The repeat rule for the schedule. # - # @return [Array, nil] - optional :repeats, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Models::ScheduleRepeatRule] } + # @return [Array, nil] + optional :repeats, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::ScheduleRepeatRule] } # @!attribute scheduled_at # The starting date and time for the schedule. @@ -47,8 +47,8 @@ class ScheduleUpdateParams < Knockapi::Internal::Type::BaseModel # @!attribute tenant # An request to set a tenant inline. # - # @return [String, Knockapi::Models::TenantRequest, nil] - optional :tenant, union: -> { Knockapi::Models::InlineTenantRequest }, nil?: true + # @return [String, Knockapi::TenantRequest, nil] + optional :tenant, union: -> { Knockapi::InlineTenantRequest }, nil?: true # @!method initialize(schedule_ids:, actor: nil, data: nil, ending_at: nil, repeats: nil, scheduled_at: nil, tenant: nil, request_options: {}) # Some parameter documentations has been truncated, see @@ -56,18 +56,17 @@ class ScheduleUpdateParams < Knockapi::Internal::Type::BaseModel # # @param schedule_ids [Array] A list of schedule IDs. # - # @param actor [String, Knockapi::Models::RecipientReference::ObjectReference, nil] A reference to a recipient, either a user identifier (string) or an object refer - # ... + # @param actor [String, Knockapi::RecipientReference::ObjectReference, nil] A reference to a recipient, either a user identifier (string) or an object refer # # @param data [Hash{Symbol=>Object}, nil] An optional map of data to pass into the workflow execution. # # @param ending_at [Time, nil] The ending date and time for the schedule. # - # @param repeats [Array] The repeat rule for the schedule. + # @param repeats [Array] The repeat rule for the schedule. # # @param scheduled_at [Time, nil] The starting date and time for the schedule. # - # @param tenant [String, Knockapi::Models::TenantRequest, nil] An request to set a tenant inline. + # @param tenant [String, Knockapi::TenantRequest, nil] An request to set a tenant inline. # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/knockapi/models/schedule_update_response.rb b/lib/knockapi/models/schedule_update_response.rb index bbfb4b68..2c132d39 100644 --- a/lib/knockapi/models/schedule_update_response.rb +++ b/lib/knockapi/models/schedule_update_response.rb @@ -3,6 +3,6 @@ module Knockapi module Models # @type [Knockapi::Internal::Type::Converter] - ScheduleUpdateResponse = Knockapi::Internal::Type::ArrayOf[-> { Knockapi::Models::Schedule }] + ScheduleUpdateResponse = Knockapi::Internal::Type::ArrayOf[-> { Knockapi::Schedule }] end end diff --git a/lib/knockapi/models/schedules/bulk_create_params.rb b/lib/knockapi/models/schedules/bulk_create_params.rb index 8ba61771..931092ce 100644 --- a/lib/knockapi/models/schedules/bulk_create_params.rb +++ b/lib/knockapi/models/schedules/bulk_create_params.rb @@ -11,12 +11,12 @@ class BulkCreateParams < Knockapi::Internal::Type::BaseModel # @!attribute schedules # A list of schedules. # - # @return [Array] + # @return [Array] required :schedules, - -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Schedules::BulkCreateParams::Schedule] } + -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Schedules::BulkCreateParams::Schedule] } # @!method initialize(schedules:, request_options: {}) - # @param schedules [Array] A list of schedules. + # @param schedules [Array] A list of schedules. # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}] @@ -32,8 +32,8 @@ class Schedule < Knockapi::Internal::Type::BaseModel # (string), an inline user request (object), or an inline object request, which is # determined by the presence of a `collection` property. # - # @return [String, Knockapi::Models::InlineIdentifyUserRequest, Knockapi::Models::InlineObjectRequest, nil] - optional :actor, union: -> { Knockapi::Models::RecipientRequest }, nil?: true + # @return [String, Knockapi::InlineIdentifyUserRequest, Knockapi::InlineObjectRequest, nil] + optional :actor, union: -> { Knockapi::RecipientRequest }, nil?: true # @!attribute data # An optional map of data to pass into the workflow execution. @@ -52,14 +52,14 @@ class Schedule < Knockapi::Internal::Type::BaseModel # (string), an inline user request (object), or an inline object request, which is # determined by the presence of a `collection` property. # - # @return [String, Knockapi::Models::InlineIdentifyUserRequest, Knockapi::Models::InlineObjectRequest, nil] - optional :recipient, union: -> { Knockapi::Models::RecipientRequest } + # @return [String, Knockapi::InlineIdentifyUserRequest, Knockapi::InlineObjectRequest, nil] + optional :recipient, union: -> { Knockapi::RecipientRequest } # @!attribute repeats # The repeat rule for the schedule. # - # @return [Array, nil] - optional :repeats, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Models::ScheduleRepeatRule] } + # @return [Array, nil] + optional :repeats, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::ScheduleRepeatRule] } # @!attribute scheduled_at # The starting date and time for the schedule. @@ -70,32 +70,30 @@ class Schedule < Knockapi::Internal::Type::BaseModel # @!attribute tenant # An request to set a tenant inline. # - # @return [String, Knockapi::Models::TenantRequest, nil] - optional :tenant, union: -> { Knockapi::Models::InlineTenantRequest }, nil?: true + # @return [String, Knockapi::TenantRequest, nil] + optional :tenant, union: -> { Knockapi::InlineTenantRequest }, nil?: true # @!method initialize(workflow:, actor: nil, data: nil, ending_at: nil, recipient: nil, repeats: nil, scheduled_at: nil, tenant: nil) # Some parameter documentations has been truncated, see - # {Knockapi::Models::Schedules::BulkCreateParams::Schedule} for more details. + # {Knockapi::Schedules::BulkCreateParams::Schedule} for more details. # # A schedule represents a recurring workflow execution. # # @param workflow [String] The key of the workflow. # - # @param actor [String, Knockapi::Models::InlineIdentifyUserRequest, Knockapi::Models::InlineObjectRequest, nil] Specifies a recipient in a request. This can either be a user identifier (string - # ... + # @param actor [String, Knockapi::InlineIdentifyUserRequest, Knockapi::InlineObjectRequest, nil] Specifies a recipient in a request. This can either be a user identifier (string # # @param data [Hash{Symbol=>Object}, nil] An optional map of data to pass into the workflow execution. # # @param ending_at [Time, nil] The ending date and time for the schedule. # - # @param recipient [String, Knockapi::Models::InlineIdentifyUserRequest, Knockapi::Models::InlineObjectRequest] Specifies a recipient in a request. This can either be a user identifier (string - # ... + # @param recipient [String, Knockapi::InlineIdentifyUserRequest, Knockapi::InlineObjectRequest] Specifies a recipient in a request. This can either be a user identifier (string # - # @param repeats [Array] The repeat rule for the schedule. + # @param repeats [Array] The repeat rule for the schedule. # # @param scheduled_at [Time, nil] The starting date and time for the schedule. # - # @param tenant [String, Knockapi::Models::TenantRequest, nil] An request to set a tenant inline. + # @param tenant [String, Knockapi::TenantRequest, nil] An request to set a tenant inline. end end end diff --git a/lib/knockapi/models/tenant.rb b/lib/knockapi/models/tenant.rb index 12bbe719..ce2f6f97 100644 --- a/lib/knockapi/models/tenant.rb +++ b/lib/knockapi/models/tenant.rb @@ -25,8 +25,8 @@ class Tenant < Knockapi::Internal::Type::BaseModel # @!attribute settings # The settings for the tenant. Includes branding and preference set. # - # @return [Knockapi::Models::Tenant::Settings, nil] - optional :settings, -> { Knockapi::Models::Tenant::Settings }, nil?: true + # @return [Knockapi::Tenant::Settings, nil] + optional :settings, -> { Knockapi::Tenant::Settings }, nil?: true # @!method initialize(id:, _typename:, name: nil, settings: nil) # A tenant entity. @@ -37,35 +37,34 @@ class Tenant < Knockapi::Internal::Type::BaseModel # # @param name [String, nil] An optional name for the tenant. # - # @param settings [Knockapi::Models::Tenant::Settings, nil] The settings for the tenant. Includes branding and preference set. + # @param settings [Knockapi::Tenant::Settings, nil] The settings for the tenant. Includes branding and preference set. - # @see Knockapi::Models::Tenant#settings + # @see Knockapi::Tenant#settings class Settings < Knockapi::Internal::Type::BaseModel # @!attribute branding # The branding for the tenant. # - # @return [Knockapi::Models::Tenant::Settings::Branding, nil] - optional :branding, -> { Knockapi::Models::Tenant::Settings::Branding }, nil?: true + # @return [Knockapi::Tenant::Settings::Branding, nil] + optional :branding, -> { Knockapi::Tenant::Settings::Branding }, nil?: true # @!attribute preference_set # A preference set represents a specific set of notification preferences for a # recipient. A recipient can have multiple preference sets. # - # @return [Knockapi::Models::Recipients::PreferenceSet, nil] - optional :preference_set, -> { Knockapi::Models::Recipients::PreferenceSet }, nil?: true + # @return [Knockapi::Recipients::PreferenceSet, nil] + optional :preference_set, -> { Knockapi::Recipients::PreferenceSet }, nil?: true # @!method initialize(branding: nil, preference_set: nil) # Some parameter documentations has been truncated, see - # {Knockapi::Models::Tenant::Settings} for more details. + # {Knockapi::Tenant::Settings} for more details. # # The settings for the tenant. Includes branding and preference set. # - # @param branding [Knockapi::Models::Tenant::Settings::Branding, nil] The branding for the tenant. + # @param branding [Knockapi::Tenant::Settings::Branding, nil] The branding for the tenant. # - # @param preference_set [Knockapi::Models::Recipients::PreferenceSet, nil] A preference set represents a specific set of notification preferences for a rec - # ... + # @param preference_set [Knockapi::Recipients::PreferenceSet, nil] A preference set represents a specific set of notification preferences for a rec - # @see Knockapi::Models::Tenant::Settings#branding + # @see Knockapi::Tenant::Settings#branding class Branding < Knockapi::Internal::Type::BaseModel # @!attribute icon_url # The icon URL for the tenant. Must point to a valid image with an image MIME @@ -95,15 +94,13 @@ class Branding < Knockapi::Internal::Type::BaseModel # @!method initialize(icon_url: nil, logo_url: nil, primary_color: nil, primary_color_contrast: nil) # Some parameter documentations has been truncated, see - # {Knockapi::Models::Tenant::Settings::Branding} for more details. + # {Knockapi::Tenant::Settings::Branding} for more details. # # The branding for the tenant. # # @param icon_url [String, nil] The icon URL for the tenant. Must point to a valid image with an image MIME type - # ... # # @param logo_url [String, nil] The logo URL for the tenant. Must point to a valid image with an image MIME type - # ... # # @param primary_color [String, nil] The primary color for the tenant, provided as a hex value. # diff --git a/lib/knockapi/models/tenant_delete_response.rb b/lib/knockapi/models/tenant_delete_response.rb new file mode 100644 index 00000000..b49091b6 --- /dev/null +++ b/lib/knockapi/models/tenant_delete_response.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +module Knockapi + module Models + TenantDeleteResponse = String + end +end diff --git a/lib/knockapi/models/tenant_request.rb b/lib/knockapi/models/tenant_request.rb index bde11864..e1100181 100644 --- a/lib/knockapi/models/tenant_request.rb +++ b/lib/knockapi/models/tenant_request.rb @@ -12,24 +12,26 @@ class TenantRequest < Knockapi::Internal::Type::BaseModel # @!attribute channel_data # A request to set channel data for a type of channel inline. # - # @return [Hash{Symbol=>Knockapi::Models::Recipients::ChannelDataRequest}, nil] + # @return [Hash{Symbol=>Knockapi::Recipients::PushChannelData, Knockapi::Recipients::OneSignalChannelData, Knockapi::Recipients::SlackChannelData, Knockapi::Recipients::MsTeamsChannelData, Knockapi::Recipients::DiscordChannelData}, nil] optional :channel_data, - -> { Knockapi::Internal::Type::HashOf[Knockapi::Models::Recipients::ChannelDataRequest] }, + -> { + Knockapi::Internal::Type::HashOf[union: Knockapi::Recipients::InlineChannelDataRequestItem] + }, nil?: true # @!attribute preferences # Inline set preferences for a recipient, where the key is the preference set id. # - # @return [Hash{Symbol=>Knockapi::Models::Recipients::PreferenceSetRequest}, nil] + # @return [Hash{Symbol=>Knockapi::Recipients::PreferenceSetRequest}, nil] optional :preferences, - -> { Knockapi::Internal::Type::HashOf[Knockapi::Models::Recipients::PreferenceSetRequest] }, + -> { Knockapi::Internal::Type::HashOf[Knockapi::Recipients::PreferenceSetRequest] }, nil?: true # @!attribute settings # The settings for the tenant. Includes branding and preference set. # - # @return [Knockapi::Models::TenantRequest::Settings, nil] - optional :settings, -> { Knockapi::Models::TenantRequest::Settings } + # @return [Knockapi::TenantRequest::Settings, nil] + optional :settings, -> { Knockapi::TenantRequest::Settings } # @!method initialize(id:, channel_data: nil, preferences: nil, settings: nil) # A tenant to be set in the system. You can supply any additional properties on @@ -37,34 +39,34 @@ class TenantRequest < Knockapi::Internal::Type::BaseModel # # @param id [String] The unique identifier for the tenant. # - # @param channel_data [Hash{Symbol=>Knockapi::Models::Recipients::ChannelDataRequest}, nil] A request to set channel data for a type of channel inline. + # @param channel_data [Hash{Symbol=>Knockapi::Recipients::PushChannelData, Knockapi::Recipients::OneSignalChannelData, Knockapi::Recipients::SlackChannelData, Knockapi::Recipients::MsTeamsChannelData, Knockapi::Recipients::DiscordChannelData}, nil] A request to set channel data for a type of channel inline. # - # @param preferences [Hash{Symbol=>Knockapi::Models::Recipients::PreferenceSetRequest}, nil] Inline set preferences for a recipient, where the key is the preference set id. + # @param preferences [Hash{Symbol=>Knockapi::Recipients::PreferenceSetRequest}, nil] Inline set preferences for a recipient, where the key is the preference set id. # - # @param settings [Knockapi::Models::TenantRequest::Settings] The settings for the tenant. Includes branding and preference set. + # @param settings [Knockapi::TenantRequest::Settings] The settings for the tenant. Includes branding and preference set. - # @see Knockapi::Models::TenantRequest#settings + # @see Knockapi::TenantRequest#settings class Settings < Knockapi::Internal::Type::BaseModel # @!attribute branding # The branding for the tenant. # - # @return [Knockapi::Models::TenantRequest::Settings::Branding, nil] - optional :branding, -> { Knockapi::Models::TenantRequest::Settings::Branding } + # @return [Knockapi::TenantRequest::Settings::Branding, nil] + optional :branding, -> { Knockapi::TenantRequest::Settings::Branding } # @!attribute preference_set # A request to set a preference set for a recipient. # - # @return [Knockapi::Models::Recipients::PreferenceSetRequest, nil] - optional :preference_set, -> { Knockapi::Models::Recipients::PreferenceSetRequest }, nil?: true + # @return [Knockapi::Recipients::PreferenceSetRequest, nil] + optional :preference_set, -> { Knockapi::Recipients::PreferenceSetRequest }, nil?: true # @!method initialize(branding: nil, preference_set: nil) # The settings for the tenant. Includes branding and preference set. # - # @param branding [Knockapi::Models::TenantRequest::Settings::Branding] The branding for the tenant. + # @param branding [Knockapi::TenantRequest::Settings::Branding] The branding for the tenant. # - # @param preference_set [Knockapi::Models::Recipients::PreferenceSetRequest, nil] A request to set a preference set for a recipient. + # @param preference_set [Knockapi::Recipients::PreferenceSetRequest, nil] A request to set a preference set for a recipient. - # @see Knockapi::Models::TenantRequest::Settings#branding + # @see Knockapi::TenantRequest::Settings#branding class Branding < Knockapi::Internal::Type::BaseModel # @!attribute icon_url # The icon URL for the tenant. Must point to a valid image with an image MIME @@ -94,15 +96,13 @@ class Branding < Knockapi::Internal::Type::BaseModel # @!method initialize(icon_url: nil, logo_url: nil, primary_color: nil, primary_color_contrast: nil) # Some parameter documentations has been truncated, see - # {Knockapi::Models::TenantRequest::Settings::Branding} for more details. + # {Knockapi::TenantRequest::Settings::Branding} for more details. # # The branding for the tenant. # # @param icon_url [String, nil] The icon URL for the tenant. Must point to a valid image with an image MIME type - # ... # # @param logo_url [String, nil] The logo URL for the tenant. Must point to a valid image with an image MIME type - # ... # # @param primary_color [String, nil] The primary color for the tenant, provided as a hex value. # diff --git a/lib/knockapi/models/tenant_set_params.rb b/lib/knockapi/models/tenant_set_params.rb index eebbe4c9..762231dd 100644 --- a/lib/knockapi/models/tenant_set_params.rb +++ b/lib/knockapi/models/tenant_set_params.rb @@ -10,31 +10,33 @@ class TenantSetParams < Knockapi::Internal::Type::BaseModel # @!attribute channel_data # A request to set channel data for a type of channel inline. # - # @return [Hash{Symbol=>Knockapi::Models::Recipients::ChannelDataRequest}, nil] + # @return [Hash{Symbol=>Knockapi::Recipients::PushChannelData, Knockapi::Recipients::OneSignalChannelData, Knockapi::Recipients::SlackChannelData, Knockapi::Recipients::MsTeamsChannelData, Knockapi::Recipients::DiscordChannelData}, nil] optional :channel_data, - -> { Knockapi::Internal::Type::HashOf[Knockapi::Models::Recipients::ChannelDataRequest] }, + -> { + Knockapi::Internal::Type::HashOf[union: Knockapi::Recipients::InlineChannelDataRequestItem] + }, nil?: true # @!attribute preferences # Inline set preferences for a recipient, where the key is the preference set id. # - # @return [Hash{Symbol=>Knockapi::Models::Recipients::PreferenceSetRequest}, nil] + # @return [Hash{Symbol=>Knockapi::Recipients::PreferenceSetRequest}, nil] optional :preferences, - -> { Knockapi::Internal::Type::HashOf[Knockapi::Models::Recipients::PreferenceSetRequest] }, + -> { Knockapi::Internal::Type::HashOf[Knockapi::Recipients::PreferenceSetRequest] }, nil?: true # @!attribute settings # The settings for the tenant. Includes branding and preference set. # - # @return [Knockapi::Models::TenantSetParams::Settings, nil] - optional :settings, -> { Knockapi::Models::TenantSetParams::Settings } + # @return [Knockapi::TenantSetParams::Settings, nil] + optional :settings, -> { Knockapi::TenantSetParams::Settings } # @!method initialize(channel_data: nil, preferences: nil, settings: nil, request_options: {}) - # @param channel_data [Hash{Symbol=>Knockapi::Models::Recipients::ChannelDataRequest}, nil] A request to set channel data for a type of channel inline. + # @param channel_data [Hash{Symbol=>Knockapi::Recipients::PushChannelData, Knockapi::Recipients::OneSignalChannelData, Knockapi::Recipients::SlackChannelData, Knockapi::Recipients::MsTeamsChannelData, Knockapi::Recipients::DiscordChannelData}, nil] A request to set channel data for a type of channel inline. # - # @param preferences [Hash{Symbol=>Knockapi::Models::Recipients::PreferenceSetRequest}, nil] Inline set preferences for a recipient, where the key is the preference set id. + # @param preferences [Hash{Symbol=>Knockapi::Recipients::PreferenceSetRequest}, nil] Inline set preferences for a recipient, where the key is the preference set id. # - # @param settings [Knockapi::Models::TenantSetParams::Settings] The settings for the tenant. Includes branding and preference set. + # @param settings [Knockapi::TenantSetParams::Settings] The settings for the tenant. Includes branding and preference set. # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}] @@ -42,23 +44,23 @@ class Settings < Knockapi::Internal::Type::BaseModel # @!attribute branding # The branding for the tenant. # - # @return [Knockapi::Models::TenantSetParams::Settings::Branding, nil] - optional :branding, -> { Knockapi::Models::TenantSetParams::Settings::Branding } + # @return [Knockapi::TenantSetParams::Settings::Branding, nil] + optional :branding, -> { Knockapi::TenantSetParams::Settings::Branding } # @!attribute preference_set # A request to set a preference set for a recipient. # - # @return [Knockapi::Models::Recipients::PreferenceSetRequest, nil] - optional :preference_set, -> { Knockapi::Models::Recipients::PreferenceSetRequest }, nil?: true + # @return [Knockapi::Recipients::PreferenceSetRequest, nil] + optional :preference_set, -> { Knockapi::Recipients::PreferenceSetRequest }, nil?: true # @!method initialize(branding: nil, preference_set: nil) # The settings for the tenant. Includes branding and preference set. # - # @param branding [Knockapi::Models::TenantSetParams::Settings::Branding] The branding for the tenant. + # @param branding [Knockapi::TenantSetParams::Settings::Branding] The branding for the tenant. # - # @param preference_set [Knockapi::Models::Recipients::PreferenceSetRequest, nil] A request to set a preference set for a recipient. + # @param preference_set [Knockapi::Recipients::PreferenceSetRequest, nil] A request to set a preference set for a recipient. - # @see Knockapi::Models::TenantSetParams::Settings#branding + # @see Knockapi::TenantSetParams::Settings#branding class Branding < Knockapi::Internal::Type::BaseModel # @!attribute icon_url # The icon URL for the tenant. Must point to a valid image with an image MIME @@ -88,15 +90,13 @@ class Branding < Knockapi::Internal::Type::BaseModel # @!method initialize(icon_url: nil, logo_url: nil, primary_color: nil, primary_color_contrast: nil) # Some parameter documentations has been truncated, see - # {Knockapi::Models::TenantSetParams::Settings::Branding} for more details. + # {Knockapi::TenantSetParams::Settings::Branding} for more details. # # The branding for the tenant. # # @param icon_url [String, nil] The icon URL for the tenant. Must point to a valid image with an image MIME type - # ... # # @param logo_url [String, nil] The logo URL for the tenant. Must point to a valid image with an image MIME type - # ... # # @param primary_color [String, nil] The primary color for the tenant, provided as a hex value. # diff --git a/lib/knockapi/models/tenants/bulk_set_params.rb b/lib/knockapi/models/tenants/bulk_set_params.rb index 16b6fdc9..810671b5 100644 --- a/lib/knockapi/models/tenants/bulk_set_params.rb +++ b/lib/knockapi/models/tenants/bulk_set_params.rb @@ -11,11 +11,11 @@ class BulkSetParams < Knockapi::Internal::Type::BaseModel # @!attribute tenants # The tenants to be upserted. # - # @return [Array] - required :tenants, -> { Knockapi::Internal::Type::ArrayOf[union: Knockapi::Models::InlineTenantRequest] } + # @return [Array] + required :tenants, -> { Knockapi::Internal::Type::ArrayOf[union: Knockapi::InlineTenantRequest] } # @!method initialize(tenants:, request_options: {}) - # @param tenants [Array] The tenants to be upserted. + # @param tenants [Array] The tenants to be upserted. # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/knockapi/models/user.rb b/lib/knockapi/models/user.rb index 850b5a0c..383ef5a5 100644 --- a/lib/knockapi/models/user.rb +++ b/lib/knockapi/models/user.rb @@ -47,24 +47,24 @@ class User < Knockapi::Internal::Type::BaseModel optional :name, String, nil?: true # @!attribute phone_number - # The [E.164](https://www.twilio.com/docs/glossary/what-e164) phone number of the + # The [E.164](https://www.twilio.com/docs/glossary/what-e164) phone number of the # user (required for SMS channels). # # @return [String, nil] optional :phone_number, String, nil?: true # @!attribute timezone - # The timezone of the user. Must be a valid - # [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). - # Used for - # [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients). + # The timezone of the user. Must be a + # valid [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + # Used + # for [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients). # # @return [String, nil] optional :timezone, String, nil?: true # @!method initialize(id:, _typename:, updated_at:, avatar: nil, created_at: nil, email: nil, name: nil, phone_number: nil, timezone: nil) - # Some parameter documentations has been truncated, see {Knockapi::Models::User} - # for more details. + # Some parameter documentations has been truncated, see {Knockapi::User} for more + # details. # # A [User](/concepts/users) represents an individual in your system who can # receive notifications through Knock. Users are the most common recipients of @@ -84,11 +84,9 @@ class User < Knockapi::Internal::Type::BaseModel # # @param name [String, nil] Display name of the user. # - # @param phone_number [String, nil] The [E.164](https://www.twilio.com/docs/glossary/what-e164) phone number of the - # ... + # @param phone_number [String, nil] The [E.164](https://www.twilio.com/docs/glossary/what-e164) phone number of the # - # @param timezone [String, nil] The timezone of the user. Must be a valid [tz database time zone string](https:/ - # ... + # @param timezone [String, nil] The timezone of the user. Must be a valid [tz database time zone string](https:/ end end end diff --git a/lib/knockapi/models/user_delete_response.rb b/lib/knockapi/models/user_delete_response.rb new file mode 100644 index 00000000..10b609ee --- /dev/null +++ b/lib/knockapi/models/user_delete_response.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +module Knockapi + module Models + UserDeleteResponse = String + end +end diff --git a/lib/knockapi/models/user_list_messages_params.rb b/lib/knockapi/models/user_list_messages_params.rb index 8048a475..f395de3e 100644 --- a/lib/knockapi/models/user_list_messages_params.rb +++ b/lib/knockapi/models/user_list_messages_params.rb @@ -28,14 +28,16 @@ class UserListMessagesParams < Knockapi::Internal::Type::BaseModel # @!attribute engagement_status # Limits the results to messages with the given engagement status. # - # @return [Array, nil] + # @return [Array, nil] optional :engagement_status, - -> { Knockapi::Internal::Type::ArrayOf[enum: Knockapi::Models::UserListMessagesParams::EngagementStatus] } + -> { + Knockapi::Internal::Type::ArrayOf[enum: Knockapi::UserListMessagesParams::EngagementStatus] + } # @!attribute inserted_at # - # @return [Knockapi::Models::UserListMessagesParams::InsertedAt, nil] - optional :inserted_at, -> { Knockapi::Models::UserListMessagesParams::InsertedAt } + # @return [Knockapi::UserListMessagesParams::InsertedAt, nil] + optional :inserted_at, -> { Knockapi::UserListMessagesParams::InsertedAt } # @!attribute message_ids # Limits the results to only the message IDs given (max 50). Note: when using this @@ -59,9 +61,11 @@ class UserListMessagesParams < Knockapi::Internal::Type::BaseModel # @!attribute status # Limits the results to messages with the given delivery status. # - # @return [Array, nil] + # @return [Array, nil] optional :status, - -> { Knockapi::Internal::Type::ArrayOf[enum: Knockapi::Models::UserListMessagesParams::Status] } + -> { + Knockapi::Internal::Type::ArrayOf[enum: Knockapi::UserListMessagesParams::Status] + } # @!attribute tenant # Limits the results to items with the corresponding tenant. @@ -106,30 +110,27 @@ class UserListMessagesParams < Knockapi::Internal::Type::BaseModel # # @param channel_id [String] Limits the results to items with the corresponding channel ID. # - # @param engagement_status [Array] Limits the results to messages with the given engagement status. + # @param engagement_status [Array] Limits the results to messages with the given engagement status. # - # @param inserted_at [Knockapi::Models::UserListMessagesParams::InsertedAt] + # @param inserted_at [Knockapi::UserListMessagesParams::InsertedAt] # # @param message_ids [Array] Limits the results to only the message IDs given (max 50). Note: when using this - # ... # # @param page_size [Integer] The number of items per page. # # @param source [String] Limits the results to messages triggered by the given workflow key. # - # @param status [Array] Limits the results to messages with the given delivery status. + # @param status [Array] Limits the results to messages with the given delivery status. # # @param tenant [String] Limits the results to items with the corresponding tenant. # # @param trigger_data [String] Limits the results to only messages that were generated with the given data. See - # ... # # @param workflow_categories [Array] Limits the results to messages related to any of the provided categories. # # @param workflow_recipient_run_id [String] Limits the results to messages for a specific recipient's workflow run. # # @param workflow_run_id [String] Limits the results to messages associated with the top-level workflow run ID ret - # ... # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}] diff --git a/lib/knockapi/models/user_list_params.rb b/lib/knockapi/models/user_list_params.rb index 225fbd60..747fa49f 100644 --- a/lib/knockapi/models/user_list_params.rb +++ b/lib/knockapi/models/user_list_params.rb @@ -22,9 +22,8 @@ class UserListParams < Knockapi::Internal::Type::BaseModel # @!attribute include # Associated resources to include in the response. # - # @return [Array, nil] - optional :include, - -> { Knockapi::Internal::Type::ArrayOf[enum: Knockapi::Models::UserListParams::Include] } + # @return [Array, nil] + optional :include, -> { Knockapi::Internal::Type::ArrayOf[enum: Knockapi::UserListParams::Include] } # @!attribute page_size # The number of items per page. @@ -37,7 +36,7 @@ class UserListParams < Knockapi::Internal::Type::BaseModel # # @param before [String] The cursor to fetch entries before. # - # @param include [Array] Associated resources to include in the response. + # @param include [Array] Associated resources to include in the response. # # @param page_size [Integer] The number of items per page. # diff --git a/lib/knockapi/models/user_list_preferences_response.rb b/lib/knockapi/models/user_list_preferences_response.rb index b65ebb37..0de12883 100644 --- a/lib/knockapi/models/user_list_preferences_response.rb +++ b/lib/knockapi/models/user_list_preferences_response.rb @@ -4,6 +4,6 @@ module Knockapi module Models # @type [Knockapi::Internal::Type::Converter] UserListPreferencesResponse = - Knockapi::Internal::Type::ArrayOf[-> { Knockapi::Models::Recipients::PreferenceSet }] + Knockapi::Internal::Type::ArrayOf[-> { Knockapi::Recipients::PreferenceSet }] end end diff --git a/lib/knockapi/models/user_list_subscriptions_params.rb b/lib/knockapi/models/user_list_subscriptions_params.rb index 06f2df71..a662995b 100644 --- a/lib/knockapi/models/user_list_subscriptions_params.rb +++ b/lib/knockapi/models/user_list_subscriptions_params.rb @@ -22,9 +22,9 @@ class UserListSubscriptionsParams < Knockapi::Internal::Type::BaseModel # @!attribute include # Associated resources to include in the response. # - # @return [Array, nil] + # @return [Array, nil] optional :include, - -> { Knockapi::Internal::Type::ArrayOf[enum: Knockapi::Models::UserListSubscriptionsParams::Include] } + -> { Knockapi::Internal::Type::ArrayOf[enum: Knockapi::UserListSubscriptionsParams::Include] } # @!attribute objects # Only returns subscriptions for the specified object GIDs. @@ -43,7 +43,7 @@ class UserListSubscriptionsParams < Knockapi::Internal::Type::BaseModel # # @param before [String] The cursor to fetch entries before. # - # @param include [Array] Associated resources to include in the response. + # @param include [Array] Associated resources to include in the response. # # @param objects [Array] Only returns subscriptions for the specified object GIDs. # diff --git a/lib/knockapi/models/user_unset_channel_data_response.rb b/lib/knockapi/models/user_unset_channel_data_response.rb new file mode 100644 index 00000000..1f65d631 --- /dev/null +++ b/lib/knockapi/models/user_unset_channel_data_response.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +module Knockapi + module Models + UserUnsetChannelDataResponse = String + end +end diff --git a/lib/knockapi/models/users/bulk_identify_params.rb b/lib/knockapi/models/users/bulk_identify_params.rb index 1818396d..7ef5bda7 100644 --- a/lib/knockapi/models/users/bulk_identify_params.rb +++ b/lib/knockapi/models/users/bulk_identify_params.rb @@ -11,11 +11,11 @@ class BulkIdentifyParams < Knockapi::Internal::Type::BaseModel # @!attribute users # A list of users. # - # @return [Array] - required :users, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Models::InlineIdentifyUserRequest] } + # @return [Array] + required :users, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::InlineIdentifyUserRequest] } # @!method initialize(users:, request_options: {}) - # @param users [Array] A list of users. + # @param users [Array] A list of users. # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/knockapi/models/users/bulk_set_preferences_params.rb b/lib/knockapi/models/users/bulk_set_preferences_params.rb index 58becfcc..7afddbe4 100644 --- a/lib/knockapi/models/users/bulk_set_preferences_params.rb +++ b/lib/knockapi/models/users/bulk_set_preferences_params.rb @@ -11,8 +11,8 @@ class BulkSetPreferencesParams < Knockapi::Internal::Type::BaseModel # @!attribute preferences # A request to set a preference set for a recipient. # - # @return [Knockapi::Models::Recipients::PreferenceSetRequest] - required :preferences, -> { Knockapi::Models::Recipients::PreferenceSetRequest } + # @return [Knockapi::Recipients::PreferenceSetRequest] + required :preferences, -> { Knockapi::Recipients::PreferenceSetRequest } # @!attribute user_ids # A list of user IDs. @@ -21,7 +21,7 @@ class BulkSetPreferencesParams < Knockapi::Internal::Type::BaseModel required :user_ids, Knockapi::Internal::Type::ArrayOf[String] # @!method initialize(preferences:, user_ids:, request_options: {}) - # @param preferences [Knockapi::Models::Recipients::PreferenceSetRequest] A request to set a preference set for a recipient. + # @param preferences [Knockapi::Recipients::PreferenceSetRequest] A request to set a preference set for a recipient. # # @param user_ids [Array] A list of user IDs. # diff --git a/lib/knockapi/models/users/feed_list_items_params.rb b/lib/knockapi/models/users/feed_list_items_params.rb index b37769e7..8309168b 100644 --- a/lib/knockapi/models/users/feed_list_items_params.rb +++ b/lib/knockapi/models/users/feed_list_items_params.rb @@ -17,8 +17,8 @@ class FeedListItemsParams < Knockapi::Internal::Type::BaseModel # @!attribute archived # The archived status of the feed items. # - # @return [Symbol, Knockapi::Models::Users::FeedListItemsParams::Archived, nil] - optional :archived, enum: -> { Knockapi::Models::Users::FeedListItemsParams::Archived } + # @return [Symbol, Knockapi::Users::FeedListItemsParams::Archived, nil] + optional :archived, enum: -> { Knockapi::Users::FeedListItemsParams::Archived } # @!attribute before # The cursor to fetch entries before. @@ -47,8 +47,8 @@ class FeedListItemsParams < Knockapi::Internal::Type::BaseModel # @!attribute status # The status of the feed items. # - # @return [Symbol, Knockapi::Models::Users::FeedListItemsParams::Status, nil] - optional :status, enum: -> { Knockapi::Models::Users::FeedListItemsParams::Status } + # @return [Symbol, Knockapi::Users::FeedListItemsParams::Status, nil] + optional :status, enum: -> { Knockapi::Users::FeedListItemsParams::Status } # @!attribute tenant # The tenant associated with the feed items. @@ -71,7 +71,7 @@ class FeedListItemsParams < Knockapi::Internal::Type::BaseModel # @!method initialize(after: nil, archived: nil, before: nil, has_tenant: nil, page_size: nil, source: nil, status: nil, tenant: nil, trigger_data: nil, workflow_categories: nil, request_options: {}) # @param after [String] The cursor to fetch entries after. # - # @param archived [Symbol, Knockapi::Models::Users::FeedListItemsParams::Archived] The archived status of the feed items. + # @param archived [Symbol, Knockapi::Users::FeedListItemsParams::Archived] The archived status of the feed items. # # @param before [String] The cursor to fetch entries before. # @@ -81,7 +81,7 @@ class FeedListItemsParams < Knockapi::Internal::Type::BaseModel # # @param source [String] The source of the feed items. # - # @param status [Symbol, Knockapi::Models::Users::FeedListItemsParams::Status] The status of the feed items. + # @param status [Symbol, Knockapi::Users::FeedListItemsParams::Status] The status of the feed items. # # @param tenant [String] The tenant associated with the feed items. # diff --git a/lib/knockapi/models/users/feed_list_items_response.rb b/lib/knockapi/models/users/feed_list_items_response.rb index dac991d3..ffaf255b 100644 --- a/lib/knockapi/models/users/feed_list_items_response.rb +++ b/lib/knockapi/models/users/feed_list_items_response.rb @@ -20,14 +20,14 @@ class FeedListItemsResponse < Knockapi::Internal::Type::BaseModel # @!attribute activities # List of activities associated with this feed item. # - # @return [Array] - required :activities, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Activity] } + # @return [Array] + required :activities, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Activity] } # @!attribute actors # List of actors associated with this feed item. # - # @return [Array] - required :actors, -> { Knockapi::Internal::Type::ArrayOf[union: Knockapi::Models::Recipient] } + # @return [Array] + required :actors, -> { Knockapi::Internal::Type::ArrayOf[union: Knockapi::Recipient] } # @!attribute blocks # Content blocks that make up the feed item. @@ -121,9 +121,9 @@ class FeedListItemsResponse < Knockapi::Internal::Type::BaseModel # # @param _typename [String] The typename of the schema. # - # @param activities [Array] List of activities associated with this feed item. + # @param activities [Array] List of activities associated with this feed item. # - # @param actors [Array] List of actors associated with this feed item. + # @param actors [Array] List of actors associated with this feed item. # # @param blocks [Array] Content blocks that make up the feed item. # @@ -288,6 +288,15 @@ module Type # @!method self.variants # @return [Array(Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedContentBlock, Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedButtonSetBlock)] + + define_sorbet_constant!(:Variants) do + T.type_alias do + T.any( + Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedContentBlock, + Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedButtonSetBlock + ) + end + end end # @see Knockapi::Models::Users::FeedListItemsResponse#source diff --git a/lib/knockapi/models/workflow_cancel_params.rb b/lib/knockapi/models/workflow_cancel_params.rb index 04216641..f4fc8749 100644 --- a/lib/knockapi/models/workflow_cancel_params.rb +++ b/lib/knockapi/models/workflow_cancel_params.rb @@ -21,9 +21,9 @@ class WorkflowCancelParams < Knockapi::Internal::Type::BaseModel # A list of recipients to cancel the notification for. If omitted, cancels for all # recipients associated with the cancellation key. # - # @return [Array, nil] + # @return [Array, nil] optional :recipients, - -> { Knockapi::Internal::Type::ArrayOf[union: Knockapi::Models::RecipientReference] }, + -> { Knockapi::Internal::Type::ArrayOf[union: Knockapi::RecipientReference] }, nil?: true # @!method initialize(cancellation_key:, recipients: nil, request_options: {}) @@ -31,10 +31,8 @@ class WorkflowCancelParams < Knockapi::Internal::Type::BaseModel # {Knockapi::Models::WorkflowCancelParams} for more details. # # @param cancellation_key [String] An optional key that is used to reference a specific workflow trigger request wh - # ... # - # @param recipients [Array, nil] A list of recipients to cancel the notification for. If omitted, cancels for all - # ... + # @param recipients [Array, nil] A list of recipients to cancel the notification for. If omitted, cancels for all # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/knockapi/models/workflow_cancel_response.rb b/lib/knockapi/models/workflow_cancel_response.rb new file mode 100644 index 00000000..2f34bd66 --- /dev/null +++ b/lib/knockapi/models/workflow_cancel_response.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +module Knockapi + module Models + WorkflowCancelResponse = String + end +end diff --git a/lib/knockapi/models/workflow_trigger_params.rb b/lib/knockapi/models/workflow_trigger_params.rb index ddd94224..3493d310 100644 --- a/lib/knockapi/models/workflow_trigger_params.rb +++ b/lib/knockapi/models/workflow_trigger_params.rb @@ -11,16 +11,16 @@ class WorkflowTriggerParams < Knockapi::Internal::Type::BaseModel # The recipients to trigger the workflow for. Can inline identify users, objects, # or use a list of user IDs. Limited to 1,000 recipients. # - # @return [Array] - required :recipients, -> { Knockapi::Internal::Type::ArrayOf[union: Knockapi::Models::RecipientRequest] } + # @return [Array] + required :recipients, -> { Knockapi::Internal::Type::ArrayOf[union: Knockapi::RecipientRequest] } # @!attribute actor # Specifies a recipient in a request. This can either be a user identifier # (string), an inline user request (object), or an inline object request, which is # determined by the presence of a `collection` property. # - # @return [String, Knockapi::Models::InlineIdentifyUserRequest, Knockapi::Models::InlineObjectRequest, nil] - optional :actor, union: -> { Knockapi::Models::RecipientRequest }, nil?: true + # @return [String, Knockapi::InlineIdentifyUserRequest, Knockapi::InlineObjectRequest, nil] + optional :actor, union: -> { Knockapi::RecipientRequest }, nil?: true # @!attribute cancellation_key # An optional key that is used to reference a specific workflow trigger request @@ -41,25 +41,22 @@ class WorkflowTriggerParams < Knockapi::Internal::Type::BaseModel # @!attribute tenant # An request to set a tenant inline. # - # @return [String, Knockapi::Models::TenantRequest, nil] - optional :tenant, union: -> { Knockapi::Models::InlineTenantRequest }, nil?: true + # @return [String, Knockapi::TenantRequest, nil] + optional :tenant, union: -> { Knockapi::InlineTenantRequest }, nil?: true # @!method initialize(recipients:, actor: nil, cancellation_key: nil, data: nil, tenant: nil, request_options: {}) # Some parameter documentations has been truncated, see # {Knockapi::Models::WorkflowTriggerParams} for more details. # - # @param recipients [Array] The recipients to trigger the workflow for. Can inline identify users, objects, - # ... + # @param recipients [Array] The recipients to trigger the workflow for. Can inline identify users, objects, # - # @param actor [String, Knockapi::Models::InlineIdentifyUserRequest, Knockapi::Models::InlineObjectRequest, nil] Specifies a recipient in a request. This can either be a user identifier (string - # ... + # @param actor [String, Knockapi::InlineIdentifyUserRequest, Knockapi::InlineObjectRequest, nil] Specifies a recipient in a request. This can either be a user identifier (string # # @param cancellation_key [String, nil] An optional key that is used to reference a specific workflow trigger request wh - # ... # # @param data [Hash{Symbol=>Object}, nil] An optional map of data to pass into the workflow execution. # - # @param tenant [String, Knockapi::Models::TenantRequest, nil] An request to set a tenant inline. + # @param tenant [String, Knockapi::TenantRequest, nil] An request to set a tenant inline. # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/knockapi/models/workflow_trigger_response.rb b/lib/knockapi/models/workflow_trigger_response.rb index ef3881e9..cd72a482 100644 --- a/lib/knockapi/models/workflow_trigger_response.rb +++ b/lib/knockapi/models/workflow_trigger_response.rb @@ -18,7 +18,6 @@ class WorkflowTriggerResponse < Knockapi::Internal::Type::BaseModel # The response from triggering a workflow. # # @param workflow_run_id [String] This value allows you to track individual messages associated with this trigger - # ... end end end diff --git a/lib/knockapi/request_options.rb b/lib/knockapi/request_options.rb index 88f525e6..8725aecd 100644 --- a/lib/knockapi/request_options.rb +++ b/lib/knockapi/request_options.rb @@ -69,5 +69,9 @@ def self.validate!(opts) # Returns a new instance of RequestOptions. # # @param values [Hash{Symbol=>Object}] + + define_sorbet_constant!(:OrHash) do + T.type_alias { T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) } + end end end diff --git a/lib/knockapi/resources/audiences.rb b/lib/knockapi/resources/audiences.rb index 4e9541c6..84fe2fe1 100644 --- a/lib/knockapi/resources/audiences.rb +++ b/lib/knockapi/resources/audiences.rb @@ -9,7 +9,7 @@ class Audiences # # @param key [String] The key of the audience. # - # @param members [Array] A list of audience members to add. + # @param members [Array] A list of audience members to add. # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -17,7 +17,7 @@ class Audiences # # @see Knockapi::Models::AudienceAddMembersParams def add_members(key, params) - parsed, options = Knockapi::Models::AudienceAddMembersParams.dump_request(params) + parsed, options = Knockapi::AudienceAddMembersParams.dump_request(params) @client.request( method: :post, path: ["v1/audiences/%1$s/members", key], @@ -53,7 +53,7 @@ def list_members(key, params = {}) # # @param key [String] The key of the audience. # - # @param members [Array] A list of audience members to remove. + # @param members [Array] A list of audience members to remove. # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -61,7 +61,7 @@ def list_members(key, params = {}) # # @see Knockapi::Models::AudienceRemoveMembersParams def remove_members(key, params) - parsed, options = Knockapi::Models::AudienceRemoveMembersParams.dump_request(params) + parsed, options = Knockapi::AudienceRemoveMembersParams.dump_request(params) @client.request( method: :delete, path: ["v1/audiences/%1$s/members", key], diff --git a/lib/knockapi/resources/bulk_operations.rb b/lib/knockapi/resources/bulk_operations.rb index ae239c3a..6e2cfa0f 100644 --- a/lib/knockapi/resources/bulk_operations.rb +++ b/lib/knockapi/resources/bulk_operations.rb @@ -11,14 +11,14 @@ class BulkOperations # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Models::BulkOperation] + # @return [Knockapi::BulkOperation] # # @see Knockapi::Models::BulkOperationGetParams def get(id, params = {}) @client.request( method: :get, path: ["v1/bulk_operations/%1$s", id], - model: Knockapi::Models::BulkOperation, + model: Knockapi::BulkOperation, options: params[:request_options] ) end diff --git a/lib/knockapi/resources/channels/bulk.rb b/lib/knockapi/resources/channels/bulk.rb index dc28a68d..0d779066 100644 --- a/lib/knockapi/resources/channels/bulk.rb +++ b/lib/knockapi/resources/channels/bulk.rb @@ -16,13 +16,13 @@ class Bulk # # @param channel_id [String] The ID of the channel to update messages for. # - # @param action [Symbol, Knockapi::Models::Channels::BulkUpdateMessageStatusParams::Action] The target status to be applied to the messages. + # @param action [Symbol, Knockapi::Channels::BulkUpdateMessageStatusParams::Action] The target status to be applied to the messages. # - # @param archived [Symbol, Knockapi::Models::Channels::BulkUpdateMessageStatusParams::Archived] Limits the results to messages with the given archived status. + # @param archived [Symbol, Knockapi::Channels::BulkUpdateMessageStatusParams::Archived] Limits the results to messages with the given archived status. # - # @param delivery_status [Symbol, Knockapi::Models::Channels::BulkUpdateMessageStatusParams::DeliveryStatus] Limits the results to messages with the given delivery status. + # @param delivery_status [Symbol, Knockapi::Channels::BulkUpdateMessageStatusParams::DeliveryStatus] Limits the results to messages with the given delivery status. # - # @param engagement_status [Symbol, Knockapi::Models::Channels::BulkUpdateMessageStatusParams::EngagementStatus] Limits the results to messages with the given engagement status. + # @param engagement_status [Symbol, Knockapi::Channels::BulkUpdateMessageStatusParams::EngagementStatus] Limits the results to messages with the given engagement status. # # @param has_tenant [Boolean] Limits the results to messages that have a tenant or not. # @@ -35,22 +35,21 @@ class Bulk # @param tenants [Array] Limits the results to messages with the given tenant IDs. # # @param trigger_data [String] Limits the results to only messages that were generated with the given data. See - # ... # # @param workflows [Array] Limits the results to messages with the given workflow keys. # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Models::BulkOperation] + # @return [Knockapi::BulkOperation] # # @see Knockapi::Models::Channels::BulkUpdateMessageStatusParams def update_message_status(channel_id, action, params = {}) - parsed, options = Knockapi::Models::Channels::BulkUpdateMessageStatusParams.dump_request(params) + parsed, options = Knockapi::Channels::BulkUpdateMessageStatusParams.dump_request(params) @client.request( method: :post, path: ["v1/channels/%1$s/messages/bulk/%2$s", channel_id, action], body: parsed, - model: Knockapi::Models::BulkOperation, + model: Knockapi::BulkOperation, options: options ) end diff --git a/lib/knockapi/resources/integrations/census.rb b/lib/knockapi/resources/integrations/census.rb index 2bf4bc08..10ba5160 100644 --- a/lib/knockapi/resources/integrations/census.rb +++ b/lib/knockapi/resources/integrations/census.rb @@ -22,7 +22,7 @@ class Census # # @see Knockapi::Models::Integrations::CensusCustomDestinationParams def custom_destination(params) - parsed, options = Knockapi::Models::Integrations::CensusCustomDestinationParams.dump_request(params) + parsed, options = Knockapi::Integrations::CensusCustomDestinationParams.dump_request(params) @client.request( method: :post, path: "v1/integrations/census/custom-destination", diff --git a/lib/knockapi/resources/integrations/hightouch.rb b/lib/knockapi/resources/integrations/hightouch.rb index 5bb78397..d82d48b4 100644 --- a/lib/knockapi/resources/integrations/hightouch.rb +++ b/lib/knockapi/resources/integrations/hightouch.rb @@ -22,7 +22,7 @@ class Hightouch # # @see Knockapi::Models::Integrations::HightouchEmbeddedDestinationParams def embedded_destination(params) - parsed, options = Knockapi::Models::Integrations::HightouchEmbeddedDestinationParams.dump_request(params) + parsed, options = Knockapi::Integrations::HightouchEmbeddedDestinationParams.dump_request(params) @client.request( method: :post, path: "v1/integrations/hightouch/embedded-destination", diff --git a/lib/knockapi/resources/messages.rb b/lib/knockapi/resources/messages.rb index 133734ef..6875f88d 100644 --- a/lib/knockapi/resources/messages.rb +++ b/lib/knockapi/resources/messages.rb @@ -6,9 +6,6 @@ class Messages # @return [Knockapi::Resources::Messages::Batch] attr_reader :batch - # @return [Knockapi::Resources::Messages::Activities] - attr_reader :activities - # Some parameter documentations has been truncated, see # {Knockapi::Models::MessageListParams} for more details. # @@ -22,44 +19,41 @@ class Messages # # @param channel_id [String] Limits the results to items with the corresponding channel ID. # - # @param engagement_status [Array] Limits the results to messages with the given engagement status. + # @param engagement_status [Array] Limits the results to messages with the given engagement status. # - # @param inserted_at [Knockapi::Models::MessageListParams::InsertedAt] + # @param inserted_at [Knockapi::MessageListParams::InsertedAt] # # @param message_ids [Array] Limits the results to only the message IDs given (max 50). Note: when using this - # ... # # @param page_size [Integer] The number of items per page. # # @param source [String] Limits the results to messages triggered by the given workflow key. # - # @param status [Array] Limits the results to messages with the given delivery status. + # @param status [Array] Limits the results to messages with the given delivery status. # # @param tenant [String] Limits the results to items with the corresponding tenant. # # @param trigger_data [String] Limits the results to only messages that were generated with the given data. See - # ... # # @param workflow_categories [Array] Limits the results to messages related to any of the provided categories. # # @param workflow_recipient_run_id [String] Limits the results to messages for a specific recipient's workflow run. # # @param workflow_run_id [String] Limits the results to messages associated with the top-level workflow run ID ret - # ... # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Internal::EntriesCursor] + # @return [Knockapi::Internal::EntriesCursor] # # @see Knockapi::Models::MessageListParams def list(params = {}) - parsed, options = Knockapi::Models::MessageListParams.dump_request(params) + parsed, options = Knockapi::MessageListParams.dump_request(params) @client.request( method: :get, path: "v1/messages", query: parsed, page: Knockapi::Internal::EntriesCursor, - model: Knockapi::Models::Message, + model: Knockapi::Message, options: options ) end @@ -73,14 +67,14 @@ def list(params = {}) # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Models::Message] + # @return [Knockapi::Message] # # @see Knockapi::Models::MessageArchiveParams def archive(message_id, params = {}) @client.request( method: :put, path: ["v1/messages/%1$s/archived", message_id], - model: Knockapi::Models::Message, + model: Knockapi::Message, options: params[:request_options] ) end @@ -93,14 +87,14 @@ def archive(message_id, params = {}) # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Models::Message] + # @return [Knockapi::Message] # # @see Knockapi::Models::MessageGetParams def get(message_id, params = {}) @client.request( method: :get, path: ["v1/messages/%1$s", message_id], - model: Knockapi::Models::Message, + model: Knockapi::Message, options: params[:request_options] ) end @@ -142,17 +136,17 @@ def get_content(message_id, params = {}) # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Internal::ItemsCursor] + # @return [Knockapi::Internal::ItemsCursor] # # @see Knockapi::Models::MessageListActivitiesParams def list_activities(message_id, params = {}) - parsed, options = Knockapi::Models::MessageListActivitiesParams.dump_request(params) + parsed, options = Knockapi::MessageListActivitiesParams.dump_request(params) @client.request( method: :get, path: ["v1/messages/%1$s/activities", message_id], query: parsed, page: Knockapi::Internal::ItemsCursor, - model: Knockapi::Models::Activity, + model: Knockapi::Activity, options: options ) end @@ -171,17 +165,17 @@ def list_activities(message_id, params = {}) # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Internal::EntriesCursor] + # @return [Knockapi::Internal::EntriesCursor] # # @see Knockapi::Models::MessageListDeliveryLogsParams def list_delivery_logs(message_id, params = {}) - parsed, options = Knockapi::Models::MessageListDeliveryLogsParams.dump_request(params) + parsed, options = Knockapi::MessageListDeliveryLogsParams.dump_request(params) @client.request( method: :get, path: ["v1/messages/%1$s/delivery_logs", message_id], query: parsed, page: Knockapi::Internal::EntriesCursor, - model: Knockapi::Models::MessageDeliveryLog, + model: Knockapi::MessageDeliveryLog, options: options ) end @@ -200,17 +194,17 @@ def list_delivery_logs(message_id, params = {}) # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Internal::EntriesCursor] + # @return [Knockapi::Internal::EntriesCursor] # # @see Knockapi::Models::MessageListEventsParams def list_events(message_id, params = {}) - parsed, options = Knockapi::Models::MessageListEventsParams.dump_request(params) + parsed, options = Knockapi::MessageListEventsParams.dump_request(params) @client.request( method: :get, path: ["v1/messages/%1$s/events", message_id], query: parsed, page: Knockapi::Internal::EntriesCursor, - model: Knockapi::Models::MessageEvent, + model: Knockapi::MessageEvent, options: options ) end @@ -229,16 +223,16 @@ def list_events(message_id, params = {}) # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Models::Message] + # @return [Knockapi::Message] # # @see Knockapi::Models::MessageMarkAsInteractedParams def mark_as_interacted(message_id, params = {}) - parsed, options = Knockapi::Models::MessageMarkAsInteractedParams.dump_request(params) + parsed, options = Knockapi::MessageMarkAsInteractedParams.dump_request(params) @client.request( method: :put, path: ["v1/messages/%1$s/interacted", message_id], body: parsed, - model: Knockapi::Models::Message, + model: Knockapi::Message, options: options ) end @@ -253,14 +247,14 @@ def mark_as_interacted(message_id, params = {}) # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Models::Message] + # @return [Knockapi::Message] # # @see Knockapi::Models::MessageMarkAsReadParams def mark_as_read(message_id, params = {}) @client.request( method: :put, path: ["v1/messages/%1$s/read", message_id], - model: Knockapi::Models::Message, + model: Knockapi::Message, options: params[:request_options] ) end @@ -275,14 +269,14 @@ def mark_as_read(message_id, params = {}) # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Models::Message] + # @return [Knockapi::Message] # # @see Knockapi::Models::MessageMarkAsSeenParams def mark_as_seen(message_id, params = {}) @client.request( method: :put, path: ["v1/messages/%1$s/seen", message_id], - model: Knockapi::Models::Message, + model: Knockapi::Message, options: params[:request_options] ) end @@ -297,14 +291,14 @@ def mark_as_seen(message_id, params = {}) # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Models::Message] + # @return [Knockapi::Message] # # @see Knockapi::Models::MessageMarkAsUnreadParams def mark_as_unread(message_id, params = {}) @client.request( method: :delete, path: ["v1/messages/%1$s/read", message_id], - model: Knockapi::Models::Message, + model: Knockapi::Message, options: params[:request_options] ) end @@ -319,14 +313,14 @@ def mark_as_unread(message_id, params = {}) # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Models::Message] + # @return [Knockapi::Message] # # @see Knockapi::Models::MessageMarkAsUnseenParams def mark_as_unseen(message_id, params = {}) @client.request( method: :delete, path: ["v1/messages/%1$s/seen", message_id], - model: Knockapi::Models::Message, + model: Knockapi::Message, options: params[:request_options] ) end @@ -340,14 +334,14 @@ def mark_as_unseen(message_id, params = {}) # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Models::Message] + # @return [Knockapi::Message] # # @see Knockapi::Models::MessageUnarchiveParams def unarchive(message_id, params = {}) @client.request( method: :delete, path: ["v1/messages/%1$s/archived", message_id], - model: Knockapi::Models::Message, + model: Knockapi::Message, options: params[:request_options] ) end @@ -358,7 +352,6 @@ def unarchive(message_id, params = {}) def initialize(client:) @client = client @batch = Knockapi::Resources::Messages::Batch.new(client: client) - @activities = Knockapi::Resources::Messages::Activities.new(client: client) end end end diff --git a/lib/knockapi/resources/messages/activities.rb b/lib/knockapi/resources/messages/activities.rb deleted file mode 100644 index 3d98638b..00000000 --- a/lib/knockapi/resources/messages/activities.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -module Knockapi - module Resources - class Messages - class Activities - # Returns a paginated list of activities for the specified message. - # - # @overload list(message_id, after: nil, before: nil, page_size: nil, trigger_data: nil, request_options: {}) - # - # @param message_id [String] The ID of the message to fetch activities for. - # - # @param after [String] The cursor to fetch entries after. - # - # @param before [String] The cursor to fetch entries before. - # - # @param page_size [Integer] The number of items per page. - # - # @param trigger_data [String] The trigger data to filter activities by. - # - # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [Knockapi::Internal::ItemsCursor] - # - # @see Knockapi::Models::Messages::ActivityListParams - def list(message_id, params = {}) - parsed, options = Knockapi::Models::Messages::ActivityListParams.dump_request(params) - @client.request( - method: :get, - path: ["v1/messages/%1$s/activities", message_id], - query: parsed, - page: Knockapi::Internal::ItemsCursor, - model: Knockapi::Models::Activity, - options: options - ) - end - - # @api private - # - # @param client [Knockapi::Client] - def initialize(client:) - @client = client - end - end - end - end -end diff --git a/lib/knockapi/resources/messages/batch.rb b/lib/knockapi/resources/messages/batch.rb index dd97c06a..ab80a0c5 100644 --- a/lib/knockapi/resources/messages/batch.rb +++ b/lib/knockapi/resources/messages/batch.rb @@ -13,16 +13,16 @@ class Batch # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Array] + # @return [Array] # # @see Knockapi::Models::Messages::BatchArchiveParams def archive(params) - parsed, options = Knockapi::Models::Messages::BatchArchiveParams.dump_request(params) + parsed, options = Knockapi::Messages::BatchArchiveParams.dump_request(params) @client.request( method: :post, path: "v1/messages/batch/archived", body: parsed, - model: Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Message], + model: Knockapi::Internal::Type::ArrayOf[Knockapi::Message], options: options ) end @@ -39,7 +39,7 @@ def archive(params) # # @see Knockapi::Models::Messages::BatchGetContentParams def get_content(params) - parsed, options = Knockapi::Models::Messages::BatchGetContentParams.dump_request(params) + parsed, options = Knockapi::Messages::BatchGetContentParams.dump_request(params) @client.request( method: :get, path: "v1/messages/batch/content", @@ -63,16 +63,16 @@ def get_content(params) # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Array] + # @return [Array] # # @see Knockapi::Models::Messages::BatchMarkAsInteractedParams def mark_as_interacted(params) - parsed, options = Knockapi::Models::Messages::BatchMarkAsInteractedParams.dump_request(params) + parsed, options = Knockapi::Messages::BatchMarkAsInteractedParams.dump_request(params) @client.request( method: :post, path: "v1/messages/batch/interacted", body: parsed, - model: Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Message], + model: Knockapi::Internal::Type::ArrayOf[Knockapi::Message], options: options ) end @@ -86,16 +86,16 @@ def mark_as_interacted(params) # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Array] + # @return [Array] # # @see Knockapi::Models::Messages::BatchMarkAsReadParams def mark_as_read(params) - parsed, options = Knockapi::Models::Messages::BatchMarkAsReadParams.dump_request(params) + parsed, options = Knockapi::Messages::BatchMarkAsReadParams.dump_request(params) @client.request( method: :post, path: "v1/messages/batch/read", body: parsed, - model: Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Message], + model: Knockapi::Internal::Type::ArrayOf[Knockapi::Message], options: options ) end @@ -110,16 +110,16 @@ def mark_as_read(params) # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Array] + # @return [Array] # # @see Knockapi::Models::Messages::BatchMarkAsSeenParams def mark_as_seen(params) - parsed, options = Knockapi::Models::Messages::BatchMarkAsSeenParams.dump_request(params) + parsed, options = Knockapi::Messages::BatchMarkAsSeenParams.dump_request(params) @client.request( method: :post, path: "v1/messages/batch/seen", body: parsed, - model: Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Message], + model: Knockapi::Internal::Type::ArrayOf[Knockapi::Message], options: options ) end @@ -134,16 +134,16 @@ def mark_as_seen(params) # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Array] + # @return [Array] # # @see Knockapi::Models::Messages::BatchMarkAsUnreadParams def mark_as_unread(params) - parsed, options = Knockapi::Models::Messages::BatchMarkAsUnreadParams.dump_request(params) + parsed, options = Knockapi::Messages::BatchMarkAsUnreadParams.dump_request(params) @client.request( method: :post, path: "v1/messages/batch/unread", body: parsed, - model: Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Message], + model: Knockapi::Internal::Type::ArrayOf[Knockapi::Message], options: options ) end @@ -158,16 +158,16 @@ def mark_as_unread(params) # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Array] + # @return [Array] # # @see Knockapi::Models::Messages::BatchMarkAsUnseenParams def mark_as_unseen(params) - parsed, options = Knockapi::Models::Messages::BatchMarkAsUnseenParams.dump_request(params) + parsed, options = Knockapi::Messages::BatchMarkAsUnseenParams.dump_request(params) @client.request( method: :post, path: "v1/messages/batch/unseen", body: parsed, - model: Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Message], + model: Knockapi::Internal::Type::ArrayOf[Knockapi::Message], options: options ) end @@ -182,16 +182,16 @@ def mark_as_unseen(params) # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Array] + # @return [Array] # # @see Knockapi::Models::Messages::BatchUnarchiveParams def unarchive(params) - parsed, options = Knockapi::Models::Messages::BatchUnarchiveParams.dump_request(params) + parsed, options = Knockapi::Messages::BatchUnarchiveParams.dump_request(params) @client.request( method: :post, path: "v1/messages/batch/unarchived", body: parsed, - model: Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Message], + model: Knockapi::Internal::Type::ArrayOf[Knockapi::Message], options: options ) end diff --git a/lib/knockapi/resources/objects.rb b/lib/knockapi/resources/objects.rb index 2790a5e3..324e37e6 100644 --- a/lib/knockapi/resources/objects.rb +++ b/lib/knockapi/resources/objects.rb @@ -17,23 +17,23 @@ class Objects # # @param before [String] The cursor to fetch entries before. # - # @param include [Array] Includes preferences of the objects in the response. + # @param include [Array] Includes preferences of the objects in the response. # # @param page_size [Integer] The number of items per page. # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Internal::EntriesCursor] + # @return [Knockapi::Internal::EntriesCursor] # # @see Knockapi::Models::ObjectListParams def list(collection, params = {}) - parsed, options = Knockapi::Models::ObjectListParams.dump_request(params) + parsed, options = Knockapi::ObjectListParams.dump_request(params) @client.request( method: :get, path: ["v1/objects/%1$s", collection], query: parsed, page: Knockapi::Internal::EntriesCursor, - model: Knockapi::Models::Object, + model: Knockapi::Object, options: options ) end @@ -75,23 +75,22 @@ def delete(collection, id, params = {}) # # @param object_id_ [String] Unique identifier for the object. # - # @param recipients [Array] The recipients of the subscription. You can subscribe up to 100 recipients to an - # ... + # @param recipients [Array] The recipients of the subscription. You can subscribe up to 100 recipients to an # # @param properties [Hash{Symbol=>Object}, nil] The custom properties associated with the subscription relationship. # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Array] + # @return [Array] # # @see Knockapi::Models::ObjectAddSubscriptionsParams def add_subscriptions(collection, object_id_, params) - parsed, options = Knockapi::Models::ObjectAddSubscriptionsParams.dump_request(params) + parsed, options = Knockapi::ObjectAddSubscriptionsParams.dump_request(params) @client.request( method: :post, path: ["v1/objects/%1$s/%2$s/subscriptions", collection, object_id_], body: parsed, - model: Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Recipients::Subscription], + model: Knockapi::Internal::Type::ArrayOf[Knockapi::Recipients::Subscription], options: options ) end @@ -108,21 +107,20 @@ def add_subscriptions(collection, object_id_, params) # # @param object_id_ [String] Unique identifier for the object. # - # @param recipients [Array] The recipients of the subscription. You can subscribe up to 100 recipients to an - # ... + # @param recipients [Array] The recipients of the subscription. You can subscribe up to 100 recipients to an # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Array] + # @return [Array] # # @see Knockapi::Models::ObjectDeleteSubscriptionsParams def delete_subscriptions(collection, object_id_, params) - parsed, options = Knockapi::Models::ObjectDeleteSubscriptionsParams.dump_request(params) + parsed, options = Knockapi::ObjectDeleteSubscriptionsParams.dump_request(params) @client.request( method: :delete, path: ["v1/objects/%1$s/%2$s/subscriptions", collection, object_id_], body: parsed, - model: Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Recipients::Subscription], + model: Knockapi::Internal::Type::ArrayOf[Knockapi::Recipients::Subscription], options: options ) end @@ -138,14 +136,14 @@ def delete_subscriptions(collection, object_id_, params) # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Models::Object] + # @return [Knockapi::Object] # # @see Knockapi::Models::ObjectGetParams def get(collection, id, params = {}) @client.request( method: :get, path: ["v1/objects/%1$s/%2$s", collection, id], - model: Knockapi::Models::Object, + model: Knockapi::Object, options: params[:request_options] ) end @@ -162,14 +160,14 @@ def get(collection, id, params = {}) # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Models::Recipients::RecipientsChannelData] + # @return [Knockapi::Recipients::RecipientsChannelData] # # @see Knockapi::Models::ObjectGetChannelDataParams def get_channel_data(collection, object_id_, channel_id, params = {}) @client.request( method: :get, path: ["v1/objects/%1$s/%2$s/channel_data/%3$s", collection, object_id_, channel_id], - model: Knockapi::Models::Recipients::RecipientsChannelData, + model: Knockapi::Recipients::RecipientsChannelData, options: params[:request_options] ) end @@ -186,14 +184,14 @@ def get_channel_data(collection, object_id_, channel_id, params = {}) # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Models::Recipients::PreferenceSet] + # @return [Knockapi::Recipients::PreferenceSet] # # @see Knockapi::Models::ObjectGetPreferencesParams def get_preferences(collection, object_id_, id, params = {}) @client.request( method: :get, path: ["v1/objects/%1$s/%2$s/preferences/%3$s", collection, object_id_, id], - model: Knockapi::Models::Recipients::PreferenceSet, + model: Knockapi::Recipients::PreferenceSet, options: params[:request_options] ) end @@ -217,44 +215,41 @@ def get_preferences(collection, object_id_, id, params = {}) # # @param channel_id [String] Limits the results to items with the corresponding channel ID. # - # @param engagement_status [Array] Limits the results to messages with the given engagement status. + # @param engagement_status [Array] Limits the results to messages with the given engagement status. # - # @param inserted_at [Knockapi::Models::ObjectListMessagesParams::InsertedAt] + # @param inserted_at [Knockapi::ObjectListMessagesParams::InsertedAt] # # @param message_ids [Array] Limits the results to only the message IDs given (max 50). Note: when using this - # ... # # @param page_size [Integer] The number of items per page. # # @param source [String] Limits the results to messages triggered by the given workflow key. # - # @param status [Array] Limits the results to messages with the given delivery status. + # @param status [Array] Limits the results to messages with the given delivery status. # # @param tenant [String] Limits the results to items with the corresponding tenant. # # @param trigger_data [String] Limits the results to only messages that were generated with the given data. See - # ... # # @param workflow_categories [Array] Limits the results to messages related to any of the provided categories. # # @param workflow_recipient_run_id [String] Limits the results to messages for a specific recipient's workflow run. # # @param workflow_run_id [String] Limits the results to messages associated with the top-level workflow run ID ret - # ... # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Internal::EntriesCursor] + # @return [Knockapi::Internal::EntriesCursor] # # @see Knockapi::Models::ObjectListMessagesParams def list_messages(collection, id, params = {}) - parsed, options = Knockapi::Models::ObjectListMessagesParams.dump_request(params) + parsed, options = Knockapi::ObjectListMessagesParams.dump_request(params) @client.request( method: :get, path: ["v1/objects/%1$s/%2$s/messages", collection, id], query: parsed, page: Knockapi::Internal::EntriesCursor, - model: Knockapi::Models::Message, + model: Knockapi::Message, options: options ) end @@ -269,14 +264,14 @@ def list_messages(collection, id, params = {}) # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Array] + # @return [Array] # # @see Knockapi::Models::ObjectListPreferencesParams def list_preferences(collection, object_id_, params = {}) @client.request( method: :get, path: ["v1/objects/%1$s/%2$s/preferences", collection, object_id_], - model: Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Recipients::PreferenceSet], + model: Knockapi::Internal::Type::ArrayOf[Knockapi::Recipients::PreferenceSet], options: params[:request_options] ) end @@ -301,17 +296,17 @@ def list_preferences(collection, object_id_, params = {}) # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Internal::EntriesCursor] + # @return [Knockapi::Internal::EntriesCursor] # # @see Knockapi::Models::ObjectListSchedulesParams def list_schedules(collection, id, params = {}) - parsed, options = Knockapi::Models::ObjectListSchedulesParams.dump_request(params) + parsed, options = Knockapi::ObjectListSchedulesParams.dump_request(params) @client.request( method: :get, path: ["v1/objects/%1$s/%2$s/schedules", collection, id], query: parsed, page: Knockapi::Internal::EntriesCursor, - model: Knockapi::Models::Schedule, + model: Knockapi::Schedule, options: options ) end @@ -333,30 +328,29 @@ def list_schedules(collection, id, params = {}) # # @param before [String] The cursor to fetch entries before. # - # @param include [Array] Additional fields to include in the response. + # @param include [Array] Additional fields to include in the response. # - # @param mode [Symbol, Knockapi::Models::ObjectListSubscriptionsParams::Mode] Mode of the request. `recipient` to list the objects that the provided object is - # ... + # @param mode [Symbol, Knockapi::ObjectListSubscriptionsParams::Mode] Mode of the request. `recipient` to list the objects that the provided object is # - # @param objects [Array] Objects to filter by (only used if mode is `recipient`). + # @param objects [Array] Objects to filter by (only used if mode is `recipient`). # # @param page_size [Integer] The number of items per page. # - # @param recipients [Array] Recipients to filter by (only used if mode is `object`). + # @param recipients [Array] Recipients to filter by (only used if mode is `object`). # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Internal::EntriesCursor] + # @return [Knockapi::Internal::EntriesCursor] # # @see Knockapi::Models::ObjectListSubscriptionsParams def list_subscriptions(collection, object_id_, params = {}) - parsed, options = Knockapi::Models::ObjectListSubscriptionsParams.dump_request(params) + parsed, options = Knockapi::ObjectListSubscriptionsParams.dump_request(params) @client.request( method: :get, path: ["v1/objects/%1$s/%2$s/subscriptions", collection, object_id_], query: parsed, page: Knockapi::Internal::EntriesCursor, - model: Knockapi::Models::Recipients::Subscription, + model: Knockapi::Recipients::Subscription, options: options ) end @@ -374,28 +368,26 @@ def list_subscriptions(collection, object_id_, params = {}) # # @param id [String] Unique identifier for the object. # - # @param channel_data [Hash{Symbol=>Knockapi::Models::Recipients::ChannelDataRequest}] A request to set channel data for a type of channel inline. + # @param channel_data [Hash{Symbol=>Knockapi::Recipients::PushChannelData, Knockapi::Recipients::OneSignalChannelData, Knockapi::Recipients::SlackChannelData, Knockapi::Recipients::MsTeamsChannelData, Knockapi::Recipients::DiscordChannelData}] A request to set channel data for a type of channel inline. # # @param locale [String, nil] The locale of the object. Used for [message localization](/concepts/translations - # ... # - # @param preferences [Hash{Symbol=>Knockapi::Models::Recipients::PreferenceSetRequest}] Inline set preferences for a recipient, where the key is the preference set id. + # @param preferences [Hash{Symbol=>Knockapi::Recipients::PreferenceSetRequest}] Inline set preferences for a recipient, where the key is the preference set id. # - # @param timezone [String, nil] The timezone of the object. Must be a valid [tz database time zone string](https - # ... + # @param timezone [String, nil] The timezone of the object. Must be a valid [tz database time zone string](https # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Models::Object] + # @return [Knockapi::Object] # # @see Knockapi::Models::ObjectSetParams def set(collection, id, params = {}) - parsed, options = Knockapi::Models::ObjectSetParams.dump_request(params) + parsed, options = Knockapi::ObjectSetParams.dump_request(params) @client.request( method: :put, path: ["v1/objects/%1$s/%2$s", collection, id], body: parsed, - model: Knockapi::Models::Object, + model: Knockapi::Object, options: options ) end @@ -412,20 +404,20 @@ def set(collection, id, params = {}) # # @param channel_id [String] The unique identifier for the channel. # - # @param data [Knockapi::Models::Recipients::PushChannelData, Knockapi::Models::Recipients::OneSignalChannelData, Knockapi::Models::Recipients::SlackChannelData, Knockapi::Models::Recipients::MsTeamsChannelData, Knockapi::Models::Recipients::DiscordChannelData] Channel data for a given channel type. + # @param data [Knockapi::Recipients::PushChannelData, Knockapi::Recipients::OneSignalChannelData, Knockapi::Recipients::SlackChannelData, Knockapi::Recipients::MsTeamsChannelData, Knockapi::Recipients::DiscordChannelData] Channel data for a given channel type. # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Models::Recipients::RecipientsChannelData] + # @return [Knockapi::Recipients::RecipientsChannelData] # # @see Knockapi::Models::ObjectSetChannelDataParams def set_channel_data(collection, object_id_, channel_id, params) - parsed, options = Knockapi::Models::ObjectSetChannelDataParams.dump_request(params) + parsed, options = Knockapi::ObjectSetChannelDataParams.dump_request(params) @client.request( method: :put, path: ["v1/objects/%1$s/%2$s/channel_data/%3$s", collection, object_id_, channel_id], body: parsed, - model: Knockapi::Models::Recipients::RecipientsChannelData, + model: Knockapi::Recipients::RecipientsChannelData, options: options ) end @@ -448,26 +440,24 @@ def set_channel_data(collection, object_id_, channel_id, params) # # @param id [String] Unique identifier for the preference set. # - # @param categories [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::PreferenceSetRequest::Category::PreferenceSetWorkflowCategorySettingObject}, nil] An object where the key is the category and the values are the preference settin - # ... + # @param categories [Hash{Symbol=>Boolean, Knockapi::Recipients::PreferenceSetRequest::Category::PreferenceSetWorkflowCategorySettingObject}, nil] An object where the key is the category and the values are the preference settin # - # @param channel_types [Knockapi::Models::Recipients::PreferenceSetChannelTypes, nil] Channel type preferences. + # @param channel_types [Knockapi::Recipients::PreferenceSetChannelTypes, nil] Channel type preferences. # - # @param workflows [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::PreferenceSetRequest::Workflow::PreferenceSetWorkflowCategorySettingObject}, nil] An object where the key is the workflow key and the values are the preference se - # ... + # @param workflows [Hash{Symbol=>Boolean, Knockapi::Recipients::PreferenceSetRequest::Workflow::PreferenceSetWorkflowCategorySettingObject}, nil] An object where the key is the workflow key and the values are the preference se # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Models::Recipients::PreferenceSet] + # @return [Knockapi::Recipients::PreferenceSet] # # @see Knockapi::Models::ObjectSetPreferencesParams def set_preferences(collection, object_id_, id, params = {}) - parsed, options = Knockapi::Models::ObjectSetPreferencesParams.dump_request(params) + parsed, options = Knockapi::ObjectSetPreferencesParams.dump_request(params) @client.request( method: :put, path: ["v1/objects/%1$s/%2$s/preferences/%3$s", collection, object_id_, id], body: parsed, - model: Knockapi::Models::Recipients::PreferenceSet, + model: Knockapi::Recipients::PreferenceSet, options: options ) end diff --git a/lib/knockapi/resources/objects/bulk.rb b/lib/knockapi/resources/objects/bulk.rb index ed63a9e1..e4c2b606 100644 --- a/lib/knockapi/resources/objects/bulk.rb +++ b/lib/knockapi/resources/objects/bulk.rb @@ -14,16 +14,16 @@ class Bulk # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Models::BulkOperation] + # @return [Knockapi::BulkOperation] # # @see Knockapi::Models::Objects::BulkDeleteParams def delete(collection, params) - parsed, options = Knockapi::Models::Objects::BulkDeleteParams.dump_request(params) + parsed, options = Knockapi::Objects::BulkDeleteParams.dump_request(params) @client.request( method: :post, path: ["v1/objects/%1$s/bulk/delete", collection], body: parsed, - model: Knockapi::Models::BulkOperation, + model: Knockapi::BulkOperation, options: options ) end @@ -38,20 +38,20 @@ def delete(collection, params) # # @param collection [String] The collection this object belongs to. # - # @param subscriptions [Array] A list of subscriptions. + # @param subscriptions [Array] A list of subscriptions. # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Models::BulkOperation] + # @return [Knockapi::BulkOperation] # # @see Knockapi::Models::Objects::BulkAddSubscriptionsParams def add_subscriptions(collection, params) - parsed, options = Knockapi::Models::Objects::BulkAddSubscriptionsParams.dump_request(params) + parsed, options = Knockapi::Objects::BulkAddSubscriptionsParams.dump_request(params) @client.request( method: :post, path: ["v1/objects/%1$s/bulk/subscriptions/add", collection], body: parsed, - model: Knockapi::Models::BulkOperation, + model: Knockapi::BulkOperation, options: options ) end @@ -62,20 +62,20 @@ def add_subscriptions(collection, params) # # @param collection [String] The collection this object belongs to. # - # @param objects [Array] A list of objects. + # @param objects [Array] A list of objects. # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Models::BulkOperation] + # @return [Knockapi::BulkOperation] # # @see Knockapi::Models::Objects::BulkSetParams def set(collection, params) - parsed, options = Knockapi::Models::Objects::BulkSetParams.dump_request(params) + parsed, options = Knockapi::Objects::BulkSetParams.dump_request(params) @client.request( method: :post, path: ["v1/objects/%1$s/bulk/set", collection], body: parsed, - model: Knockapi::Models::BulkOperation, + model: Knockapi::BulkOperation, options: options ) end diff --git a/lib/knockapi/resources/providers/ms_teams.rb b/lib/knockapi/resources/providers/ms_teams.rb index 407efbe1..e9d9cd56 100644 --- a/lib/knockapi/resources/providers/ms_teams.rb +++ b/lib/knockapi/resources/providers/ms_teams.rb @@ -19,7 +19,7 @@ class MsTeams # # @see Knockapi::Models::Providers::MsTeamCheckAuthParams def check_auth(channel_id, params) - parsed, options = Knockapi::Models::Providers::MsTeamCheckAuthParams.dump_request(params) + parsed, options = Knockapi::Providers::MsTeamCheckAuthParams.dump_request(params) @client.request( method: :get, path: ["v1/providers/ms-teams/%1$s/auth_check", channel_id], @@ -40,7 +40,7 @@ def check_auth(channel_id, params) # # @param team_id [String] Microsoft Teams team ID. # - # @param query_options [Knockapi::Models::Providers::MsTeamListChannelsParams::QueryOptions] + # @param query_options [Knockapi::Providers::MsTeamListChannelsParams::QueryOptions] # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -48,7 +48,7 @@ def check_auth(channel_id, params) # # @see Knockapi::Models::Providers::MsTeamListChannelsParams def list_channels(channel_id, params) - parsed, options = Knockapi::Models::Providers::MsTeamListChannelsParams.dump_request(params) + parsed, options = Knockapi::Providers::MsTeamListChannelsParams.dump_request(params) @client.request( method: :get, path: ["v1/providers/ms-teams/%1$s/channels", channel_id], @@ -67,7 +67,7 @@ def list_channels(channel_id, params) # # @param ms_teams_tenant_object [String] A JSON encoded string containing the Microsoft Teams tenant object reference. # - # @param query_options [Knockapi::Models::Providers::MsTeamListTeamsParams::QueryOptions] + # @param query_options [Knockapi::Providers::MsTeamListTeamsParams::QueryOptions] # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -75,7 +75,7 @@ def list_channels(channel_id, params) # # @see Knockapi::Models::Providers::MsTeamListTeamsParams def list_teams(channel_id, params) - parsed, options = Knockapi::Models::Providers::MsTeamListTeamsParams.dump_request(params) + parsed, options = Knockapi::Providers::MsTeamListTeamsParams.dump_request(params) @client.request( method: :get, path: ["v1/providers/ms-teams/%1$s/teams", channel_id], @@ -100,7 +100,7 @@ def list_teams(channel_id, params) # # @see Knockapi::Models::Providers::MsTeamRevokeAccessParams def revoke_access(channel_id, params) - parsed, options = Knockapi::Models::Providers::MsTeamRevokeAccessParams.dump_request(params) + parsed, options = Knockapi::Providers::MsTeamRevokeAccessParams.dump_request(params) @client.request( method: :put, path: ["v1/providers/ms-teams/%1$s/revoke_access", channel_id], diff --git a/lib/knockapi/resources/providers/slack.rb b/lib/knockapi/resources/providers/slack.rb index b13a6ba7..3febd691 100644 --- a/lib/knockapi/resources/providers/slack.rb +++ b/lib/knockapi/resources/providers/slack.rb @@ -18,7 +18,7 @@ class Slack # # @see Knockapi::Models::Providers::SlackCheckAuthParams def check_auth(channel_id, params) - parsed, options = Knockapi::Models::Providers::SlackCheckAuthParams.dump_request(params) + parsed, options = Knockapi::Providers::SlackCheckAuthParams.dump_request(params) @client.request( method: :get, path: ["v1/providers/slack/%1$s/auth_check", channel_id], @@ -36,7 +36,7 @@ def check_auth(channel_id, params) # # @param access_token_object [String] A JSON encoded string containing the access token object reference. # - # @param query_options [Knockapi::Models::Providers::SlackListChannelsParams::QueryOptions] + # @param query_options [Knockapi::Providers::SlackListChannelsParams::QueryOptions] # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -44,7 +44,7 @@ def check_auth(channel_id, params) # # @see Knockapi::Models::Providers::SlackListChannelsParams def list_channels(channel_id, params) - parsed, options = Knockapi::Models::Providers::SlackListChannelsParams.dump_request(params) + parsed, options = Knockapi::Providers::SlackListChannelsParams.dump_request(params) @client.request( method: :get, path: ["v1/providers/slack/%1$s/channels", channel_id], @@ -69,7 +69,7 @@ def list_channels(channel_id, params) # # @see Knockapi::Models::Providers::SlackRevokeAccessParams def revoke_access(channel_id, params) - parsed, options = Knockapi::Models::Providers::SlackRevokeAccessParams.dump_request(params) + parsed, options = Knockapi::Providers::SlackRevokeAccessParams.dump_request(params) @client.request( method: :put, path: ["v1/providers/slack/%1$s/revoke_access", channel_id], diff --git a/lib/knockapi/resources/schedules.rb b/lib/knockapi/resources/schedules.rb index b1cceeef..7e43ef78 100644 --- a/lib/knockapi/resources/schedules.rb +++ b/lib/knockapi/resources/schedules.rb @@ -6,9 +6,6 @@ class Schedules # @return [Knockapi::Resources::Schedules::Bulk] attr_reader :bulk - # Some parameter documentations has been truncated, see - # {Knockapi::Models::ScheduleCreateParams} for more details. - # # Creates one or more schedules for a workflow with the specified recipients, # timing, and data. Schedules can be one-time or recurring. This endpoint also # handles @@ -17,10 +14,9 @@ class Schedules # # @overload create(recipients:, repeats:, workflow:, data: nil, ending_at: nil, scheduled_at: nil, tenant: nil, request_options: {}) # - # @param recipients [Array] The recipients to trigger the workflow for. Can inline identify users, objects, - # ... + # @param recipients [Array] The recipients to set the schedule for. Limited to 100 recipients per request. # - # @param repeats [Array] The repeat rule for the schedule. + # @param repeats [Array] The repeat rule for the schedule. # # @param workflow [String] The key of the workflow. # @@ -30,20 +26,20 @@ class Schedules # # @param scheduled_at [Time, nil] The starting date and time for the schedule. # - # @param tenant [String, Knockapi::Models::TenantRequest, nil] An request to set a tenant inline. + # @param tenant [String, Knockapi::TenantRequest, nil] An request to set a tenant inline. # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Array] + # @return [Array] # # @see Knockapi::Models::ScheduleCreateParams def create(params) - parsed, options = Knockapi::Models::ScheduleCreateParams.dump_request(params) + parsed, options = Knockapi::ScheduleCreateParams.dump_request(params) @client.request( method: :post, path: "v1/schedules", body: parsed, - model: Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Schedule], + model: Knockapi::Internal::Type::ArrayOf[Knockapi::Schedule], options: options ) end @@ -61,31 +57,30 @@ def create(params) # # @param schedule_ids [Array] A list of schedule IDs. # - # @param actor [String, Knockapi::Models::RecipientReference::ObjectReference, nil] A reference to a recipient, either a user identifier (string) or an object refer - # ... + # @param actor [String, Knockapi::RecipientReference::ObjectReference, nil] A reference to a recipient, either a user identifier (string) or an object refer # # @param data [Hash{Symbol=>Object}, nil] An optional map of data to pass into the workflow execution. # # @param ending_at [Time, nil] The ending date and time for the schedule. # - # @param repeats [Array] The repeat rule for the schedule. + # @param repeats [Array] The repeat rule for the schedule. # # @param scheduled_at [Time, nil] The starting date and time for the schedule. # - # @param tenant [String, Knockapi::Models::TenantRequest, nil] An request to set a tenant inline. + # @param tenant [String, Knockapi::TenantRequest, nil] An request to set a tenant inline. # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Array] + # @return [Array] # # @see Knockapi::Models::ScheduleUpdateParams def update(params) - parsed, options = Knockapi::Models::ScheduleUpdateParams.dump_request(params) + parsed, options = Knockapi::ScheduleUpdateParams.dump_request(params) @client.request( method: :put, path: "v1/schedules", body: parsed, - model: Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Schedule], + model: Knockapi::Internal::Type::ArrayOf[Knockapi::Schedule], options: options ) end @@ -109,17 +104,17 @@ def update(params) # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Internal::EntriesCursor] + # @return [Knockapi::Internal::EntriesCursor] # # @see Knockapi::Models::ScheduleListParams def list(params) - parsed, options = Knockapi::Models::ScheduleListParams.dump_request(params) + parsed, options = Knockapi::ScheduleListParams.dump_request(params) @client.request( method: :get, path: "v1/schedules", query: parsed, page: Knockapi::Internal::EntriesCursor, - model: Knockapi::Models::Schedule, + model: Knockapi::Schedule, options: options ) end @@ -133,16 +128,16 @@ def list(params) # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Array] + # @return [Array] # # @see Knockapi::Models::ScheduleDeleteParams def delete(params) - parsed, options = Knockapi::Models::ScheduleDeleteParams.dump_request(params) + parsed, options = Knockapi::ScheduleDeleteParams.dump_request(params) @client.request( method: :delete, path: "v1/schedules", body: parsed, - model: Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Schedule], + model: Knockapi::Internal::Type::ArrayOf[Knockapi::Schedule], options: options ) end diff --git a/lib/knockapi/resources/schedules/bulk.rb b/lib/knockapi/resources/schedules/bulk.rb index d1455734..2bab223e 100644 --- a/lib/knockapi/resources/schedules/bulk.rb +++ b/lib/knockapi/resources/schedules/bulk.rb @@ -10,20 +10,20 @@ class Bulk # # @overload create(schedules:, request_options: {}) # - # @param schedules [Array] A list of schedules. + # @param schedules [Array] A list of schedules. # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Models::BulkOperation] + # @return [Knockapi::BulkOperation] # # @see Knockapi::Models::Schedules::BulkCreateParams def create(params) - parsed, options = Knockapi::Models::Schedules::BulkCreateParams.dump_request(params) + parsed, options = Knockapi::Schedules::BulkCreateParams.dump_request(params) @client.request( method: :post, path: "v1/schedules/bulk/create", body: parsed, - model: Knockapi::Models::BulkOperation, + model: Knockapi::BulkOperation, options: options ) end diff --git a/lib/knockapi/resources/tenants.rb b/lib/knockapi/resources/tenants.rb index b434dc71..5f525f97 100644 --- a/lib/knockapi/resources/tenants.rb +++ b/lib/knockapi/resources/tenants.rb @@ -22,17 +22,17 @@ class Tenants # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Internal::EntriesCursor] + # @return [Knockapi::Internal::EntriesCursor] # # @see Knockapi::Models::TenantListParams def list(params = {}) - parsed, options = Knockapi::Models::TenantListParams.dump_request(params) + parsed, options = Knockapi::TenantListParams.dump_request(params) @client.request( method: :get, path: "v1/tenants", query: parsed, page: Knockapi::Internal::EntriesCursor, - model: Knockapi::Models::Tenant, + model: Knockapi::Tenant, options: options ) end @@ -65,14 +65,14 @@ def delete(id, params = {}) # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Models::Tenant] + # @return [Knockapi::Tenant] # # @see Knockapi::Models::TenantGetParams def get(id, params = {}) @client.request( method: :get, path: ["v1/tenants/%1$s", id], - model: Knockapi::Models::Tenant, + model: Knockapi::Tenant, options: params[:request_options] ) end @@ -84,24 +84,24 @@ def get(id, params = {}) # # @param id [String] The unique identifier for the tenant. # - # @param channel_data [Hash{Symbol=>Knockapi::Models::Recipients::ChannelDataRequest}, nil] A request to set channel data for a type of channel inline. + # @param channel_data [Hash{Symbol=>Knockapi::Recipients::PushChannelData, Knockapi::Recipients::OneSignalChannelData, Knockapi::Recipients::SlackChannelData, Knockapi::Recipients::MsTeamsChannelData, Knockapi::Recipients::DiscordChannelData}, nil] A request to set channel data for a type of channel inline. # - # @param preferences [Hash{Symbol=>Knockapi::Models::Recipients::PreferenceSetRequest}, nil] Inline set preferences for a recipient, where the key is the preference set id. + # @param preferences [Hash{Symbol=>Knockapi::Recipients::PreferenceSetRequest}, nil] Inline set preferences for a recipient, where the key is the preference set id. # - # @param settings [Knockapi::Models::TenantSetParams::Settings] The settings for the tenant. Includes branding and preference set. + # @param settings [Knockapi::TenantSetParams::Settings] The settings for the tenant. Includes branding and preference set. # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Models::Tenant] + # @return [Knockapi::Tenant] # # @see Knockapi::Models::TenantSetParams def set(id, params = {}) - parsed, options = Knockapi::Models::TenantSetParams.dump_request(params) + parsed, options = Knockapi::TenantSetParams.dump_request(params) @client.request( method: :put, path: ["v1/tenants/%1$s", id], body: parsed, - model: Knockapi::Models::Tenant, + model: Knockapi::Tenant, options: options ) end diff --git a/lib/knockapi/resources/tenants/bulk.rb b/lib/knockapi/resources/tenants/bulk.rb index 5d786524..4cdf4ec2 100644 --- a/lib/knockapi/resources/tenants/bulk.rb +++ b/lib/knockapi/resources/tenants/bulk.rb @@ -12,16 +12,16 @@ class Bulk # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Models::BulkOperation] + # @return [Knockapi::BulkOperation] # # @see Knockapi::Models::Tenants::BulkDeleteParams def delete(params) - parsed, options = Knockapi::Models::Tenants::BulkDeleteParams.dump_request(params) + parsed, options = Knockapi::Tenants::BulkDeleteParams.dump_request(params) @client.request( method: :post, path: "v1/tenants/bulk/delete", query: parsed, - model: Knockapi::Models::BulkOperation, + model: Knockapi::BulkOperation, options: options ) end @@ -30,20 +30,20 @@ def delete(params) # # @overload set(tenants:, request_options: {}) # - # @param tenants [Array] The tenants to be upserted. + # @param tenants [Array] The tenants to be upserted. # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Models::BulkOperation] + # @return [Knockapi::BulkOperation] # # @see Knockapi::Models::Tenants::BulkSetParams def set(params) - parsed, options = Knockapi::Models::Tenants::BulkSetParams.dump_request(params) + parsed, options = Knockapi::Tenants::BulkSetParams.dump_request(params) @client.request( method: :post, path: "v1/tenants/bulk/set", body: parsed, - model: Knockapi::Models::BulkOperation, + model: Knockapi::BulkOperation, options: options ) end diff --git a/lib/knockapi/resources/users.rb b/lib/knockapi/resources/users.rb index 599cd499..341bbd90 100644 --- a/lib/knockapi/resources/users.rb +++ b/lib/knockapi/resources/users.rb @@ -25,37 +25,34 @@ class Users # # @param avatar [String, nil] URL to the user's avatar image. # - # @param channel_data [Hash{Symbol=>Knockapi::Models::Recipients::ChannelDataRequest}, nil] A request to set channel data for a type of channel inline. + # @param channel_data [Hash{Symbol=>Knockapi::Recipients::PushChannelData, Knockapi::Recipients::OneSignalChannelData, Knockapi::Recipients::SlackChannelData, Knockapi::Recipients::MsTeamsChannelData, Knockapi::Recipients::DiscordChannelData}, nil] A request to set channel data for a type of channel inline. # # @param created_at [Time, nil] The creation date of the user from your system. # # @param email [String, nil] The primary email address for the user. # # @param locale [String, nil] The locale of the user. Used for [message localization](/concepts/translations). - # ... # # @param name [String, nil] Display name of the user. # - # @param phone_number [String, nil] The [E.164](https://www.twilio.com/docs/glossary/what-e164) phone number of the - # ... + # @param phone_number [String, nil] The [E.164](https://www.twilio.com/docs/glossary/what-e164) phone number of the # - # @param preferences [Hash{Symbol=>Knockapi::Models::Recipients::PreferenceSetRequest}, nil] Inline set preferences for a recipient, where the key is the preference set id. + # @param preferences [Hash{Symbol=>Knockapi::Recipients::PreferenceSetRequest}, nil] Inline set preferences for a recipient, where the key is the preference set id. # - # @param timezone [String, nil] The timezone of the user. Must be a valid [tz database time zone string](https:/ - # ... + # @param timezone [String, nil] The timezone of the user. Must be a valid [tz database time zone string](https:/ # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Models::User] + # @return [Knockapi::User] # # @see Knockapi::Models::UserUpdateParams def update(user_id, params = {}) - parsed, options = Knockapi::Models::UserUpdateParams.dump_request(params) + parsed, options = Knockapi::UserUpdateParams.dump_request(params) @client.request( method: :put, path: ["v1/users/%1$s", user_id], body: parsed, - model: Knockapi::Models::User, + model: Knockapi::User, options: options ) end @@ -69,23 +66,23 @@ def update(user_id, params = {}) # # @param before [String] The cursor to fetch entries before. # - # @param include [Array] Associated resources to include in the response. + # @param include [Array] Associated resources to include in the response. # # @param page_size [Integer] The number of items per page. # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Internal::EntriesCursor] + # @return [Knockapi::Internal::EntriesCursor] # # @see Knockapi::Models::UserListParams def list(params = {}) - parsed, options = Knockapi::Models::UserListParams.dump_request(params) + parsed, options = Knockapi::UserListParams.dump_request(params) @client.request( method: :get, path: "v1/users", query: parsed, page: Knockapi::Internal::EntriesCursor, - model: Knockapi::Models::User, + model: Knockapi::User, options: options ) end @@ -118,14 +115,14 @@ def delete(user_id, params = {}) # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Models::User] + # @return [Knockapi::User] # # @see Knockapi::Models::UserGetParams def get(user_id, params = {}) @client.request( method: :get, path: ["v1/users/%1$s", user_id], - model: Knockapi::Models::User, + model: Knockapi::User, options: params[:request_options] ) end @@ -140,14 +137,14 @@ def get(user_id, params = {}) # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Models::Recipients::RecipientsChannelData] + # @return [Knockapi::Recipients::RecipientsChannelData] # # @see Knockapi::Models::UserGetChannelDataParams def get_channel_data(user_id, channel_id, params = {}) @client.request( method: :get, path: ["v1/users/%1$s/channel_data/%2$s", user_id, channel_id], - model: Knockapi::Models::Recipients::RecipientsChannelData, + model: Knockapi::Recipients::RecipientsChannelData, options: params[:request_options] ) end @@ -165,16 +162,16 @@ def get_channel_data(user_id, channel_id, params = {}) # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Models::Recipients::PreferenceSet] + # @return [Knockapi::Recipients::PreferenceSet] # # @see Knockapi::Models::UserGetPreferencesParams def get_preferences(user_id, id, params = {}) - parsed, options = Knockapi::Models::UserGetPreferencesParams.dump_request(params) + parsed, options = Knockapi::UserGetPreferencesParams.dump_request(params) @client.request( method: :get, path: ["v1/users/%1$s/preferences/%2$s", user_id, id], query: parsed, - model: Knockapi::Models::Recipients::PreferenceSet, + model: Knockapi::Recipients::PreferenceSet, options: options ) end @@ -196,44 +193,41 @@ def get_preferences(user_id, id, params = {}) # # @param channel_id [String] Limits the results to items with the corresponding channel ID. # - # @param engagement_status [Array] Limits the results to messages with the given engagement status. + # @param engagement_status [Array] Limits the results to messages with the given engagement status. # - # @param inserted_at [Knockapi::Models::UserListMessagesParams::InsertedAt] + # @param inserted_at [Knockapi::UserListMessagesParams::InsertedAt] # # @param message_ids [Array] Limits the results to only the message IDs given (max 50). Note: when using this - # ... # # @param page_size [Integer] The number of items per page. # # @param source [String] Limits the results to messages triggered by the given workflow key. # - # @param status [Array] Limits the results to messages with the given delivery status. + # @param status [Array] Limits the results to messages with the given delivery status. # # @param tenant [String] Limits the results to items with the corresponding tenant. # # @param trigger_data [String] Limits the results to only messages that were generated with the given data. See - # ... # # @param workflow_categories [Array] Limits the results to messages related to any of the provided categories. # # @param workflow_recipient_run_id [String] Limits the results to messages for a specific recipient's workflow run. # # @param workflow_run_id [String] Limits the results to messages associated with the top-level workflow run ID ret - # ... # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Internal::EntriesCursor] + # @return [Knockapi::Internal::EntriesCursor] # # @see Knockapi::Models::UserListMessagesParams def list_messages(user_id, params = {}) - parsed, options = Knockapi::Models::UserListMessagesParams.dump_request(params) + parsed, options = Knockapi::UserListMessagesParams.dump_request(params) @client.request( method: :get, path: ["v1/users/%1$s/messages", user_id], query: parsed, page: Knockapi::Internal::EntriesCursor, - model: Knockapi::Models::Message, + model: Knockapi::Message, options: options ) end @@ -246,14 +240,14 @@ def list_messages(user_id, params = {}) # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Array] + # @return [Array] # # @see Knockapi::Models::UserListPreferencesParams def list_preferences(user_id, params = {}) @client.request( method: :get, path: ["v1/users/%1$s/preferences", user_id], - model: Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Recipients::PreferenceSet], + model: Knockapi::Internal::Type::ArrayOf[Knockapi::Recipients::PreferenceSet], options: params[:request_options] ) end @@ -276,17 +270,17 @@ def list_preferences(user_id, params = {}) # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Internal::EntriesCursor] + # @return [Knockapi::Internal::EntriesCursor] # # @see Knockapi::Models::UserListSchedulesParams def list_schedules(user_id, params = {}) - parsed, options = Knockapi::Models::UserListSchedulesParams.dump_request(params) + parsed, options = Knockapi::UserListSchedulesParams.dump_request(params) @client.request( method: :get, path: ["v1/users/%1$s/schedules", user_id], query: parsed, page: Knockapi::Internal::EntriesCursor, - model: Knockapi::Models::Schedule, + model: Knockapi::Schedule, options: options ) end @@ -302,7 +296,7 @@ def list_schedules(user_id, params = {}) # # @param before [String] The cursor to fetch entries before. # - # @param include [Array] Associated resources to include in the response. + # @param include [Array] Associated resources to include in the response. # # @param objects [Array] Only returns subscriptions for the specified object GIDs. # @@ -310,17 +304,17 @@ def list_schedules(user_id, params = {}) # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Internal::EntriesCursor] + # @return [Knockapi::Internal::EntriesCursor] # # @see Knockapi::Models::UserListSubscriptionsParams def list_subscriptions(user_id, params = {}) - parsed, options = Knockapi::Models::UserListSubscriptionsParams.dump_request(params) + parsed, options = Knockapi::UserListSubscriptionsParams.dump_request(params) @client.request( method: :get, path: ["v1/users/%1$s/subscriptions", user_id], query: parsed, page: Knockapi::Internal::EntriesCursor, - model: Knockapi::Models::Recipients::Subscription, + model: Knockapi::Recipients::Subscription, options: options ) end @@ -336,16 +330,16 @@ def list_subscriptions(user_id, params = {}) # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Models::User] + # @return [Knockapi::User] # # @see Knockapi::Models::UserMergeParams def merge(user_id, params) - parsed, options = Knockapi::Models::UserMergeParams.dump_request(params) + parsed, options = Knockapi::UserMergeParams.dump_request(params) @client.request( method: :post, path: ["v1/users/%1$s/merge", user_id], body: parsed, - model: Knockapi::Models::User, + model: Knockapi::User, options: options ) end @@ -358,20 +352,20 @@ def merge(user_id, params) # # @param channel_id [String] The unique identifier for the channel. # - # @param data [Knockapi::Models::Recipients::PushChannelData, Knockapi::Models::Recipients::OneSignalChannelData, Knockapi::Models::Recipients::SlackChannelData, Knockapi::Models::Recipients::MsTeamsChannelData, Knockapi::Models::Recipients::DiscordChannelData] Channel data for a given channel type. + # @param data [Knockapi::Recipients::PushChannelData, Knockapi::Recipients::OneSignalChannelData, Knockapi::Recipients::SlackChannelData, Knockapi::Recipients::MsTeamsChannelData, Knockapi::Recipients::DiscordChannelData] Channel data for a given channel type. # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Models::Recipients::RecipientsChannelData] + # @return [Knockapi::Recipients::RecipientsChannelData] # # @see Knockapi::Models::UserSetChannelDataParams def set_channel_data(user_id, channel_id, params) - parsed, options = Knockapi::Models::UserSetChannelDataParams.dump_request(params) + parsed, options = Knockapi::UserSetChannelDataParams.dump_request(params) @client.request( method: :put, path: ["v1/users/%1$s/channel_data/%2$s", user_id, channel_id], body: parsed, - model: Knockapi::Models::Recipients::RecipientsChannelData, + model: Knockapi::Recipients::RecipientsChannelData, options: options ) end @@ -388,26 +382,24 @@ def set_channel_data(user_id, channel_id, params) # # @param id [String] Unique identifier for the preference set. # - # @param categories [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::PreferenceSetRequest::Category::PreferenceSetWorkflowCategorySettingObject}, nil] An object where the key is the category and the values are the preference settin - # ... + # @param categories [Hash{Symbol=>Boolean, Knockapi::Recipients::PreferenceSetRequest::Category::PreferenceSetWorkflowCategorySettingObject}, nil] An object where the key is the category and the values are the preference settin # - # @param channel_types [Knockapi::Models::Recipients::PreferenceSetChannelTypes, nil] Channel type preferences. + # @param channel_types [Knockapi::Recipients::PreferenceSetChannelTypes, nil] Channel type preferences. # - # @param workflows [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::PreferenceSetRequest::Workflow::PreferenceSetWorkflowCategorySettingObject}, nil] An object where the key is the workflow key and the values are the preference se - # ... + # @param workflows [Hash{Symbol=>Boolean, Knockapi::Recipients::PreferenceSetRequest::Workflow::PreferenceSetWorkflowCategorySettingObject}, nil] An object where the key is the workflow key and the values are the preference se # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Models::Recipients::PreferenceSet] + # @return [Knockapi::Recipients::PreferenceSet] # # @see Knockapi::Models::UserSetPreferencesParams def set_preferences(user_id, id, params = {}) - parsed, options = Knockapi::Models::UserSetPreferencesParams.dump_request(params) + parsed, options = Knockapi::UserSetPreferencesParams.dump_request(params) @client.request( method: :put, path: ["v1/users/%1$s/preferences/%2$s", user_id, id], body: parsed, - model: Knockapi::Models::Recipients::PreferenceSet, + model: Knockapi::Recipients::PreferenceSet, options: options ) end diff --git a/lib/knockapi/resources/users/bulk.rb b/lib/knockapi/resources/users/bulk.rb index 8865d0a3..34e581a8 100644 --- a/lib/knockapi/resources/users/bulk.rb +++ b/lib/knockapi/resources/users/bulk.rb @@ -13,16 +13,16 @@ class Bulk # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Models::BulkOperation] + # @return [Knockapi::BulkOperation] # # @see Knockapi::Models::Users::BulkDeleteParams def delete(params) - parsed, options = Knockapi::Models::Users::BulkDeleteParams.dump_request(params) + parsed, options = Knockapi::Users::BulkDeleteParams.dump_request(params) @client.request( method: :post, path: "v1/users/bulk/delete", body: parsed, - model: Knockapi::Models::BulkOperation, + model: Knockapi::BulkOperation, options: options ) end @@ -33,20 +33,20 @@ def delete(params) # # @overload identify(users:, request_options: {}) # - # @param users [Array] A list of users. + # @param users [Array] A list of users. # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Models::BulkOperation] + # @return [Knockapi::BulkOperation] # # @see Knockapi::Models::Users::BulkIdentifyParams def identify(params) - parsed, options = Knockapi::Models::Users::BulkIdentifyParams.dump_request(params) + parsed, options = Knockapi::Users::BulkIdentifyParams.dump_request(params) @client.request( method: :post, path: "v1/users/bulk/identify", body: parsed, - model: Knockapi::Models::BulkOperation, + model: Knockapi::BulkOperation, options: options ) end @@ -57,22 +57,22 @@ def identify(params) # # @overload set_preferences(preferences:, user_ids:, request_options: {}) # - # @param preferences [Knockapi::Models::Recipients::PreferenceSetRequest] A request to set a preference set for a recipient. + # @param preferences [Knockapi::Recipients::PreferenceSetRequest] A request to set a preference set for a recipient. # # @param user_ids [Array] A list of user IDs. # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Knockapi::Models::BulkOperation] + # @return [Knockapi::BulkOperation] # # @see Knockapi::Models::Users::BulkSetPreferencesParams def set_preferences(params) - parsed, options = Knockapi::Models::Users::BulkSetPreferencesParams.dump_request(params) + parsed, options = Knockapi::Users::BulkSetPreferencesParams.dump_request(params) @client.request( method: :post, path: "v1/users/bulk/preferences", body: parsed, - model: Knockapi::Models::BulkOperation, + model: Knockapi::BulkOperation, options: options ) end diff --git a/lib/knockapi/resources/users/feeds.rb b/lib/knockapi/resources/users/feeds.rb index 62710bfe..ef942c6b 100644 --- a/lib/knockapi/resources/users/feeds.rb +++ b/lib/knockapi/resources/users/feeds.rb @@ -37,7 +37,7 @@ def get_settings(user_id, id, params = {}) # # @param after [String] The cursor to fetch entries after. # - # @param archived [Symbol, Knockapi::Models::Users::FeedListItemsParams::Archived] The archived status of the feed items. + # @param archived [Symbol, Knockapi::Users::FeedListItemsParams::Archived] The archived status of the feed items. # # @param before [String] The cursor to fetch entries before. # @@ -47,7 +47,7 @@ def get_settings(user_id, id, params = {}) # # @param source [String] The source of the feed items. # - # @param status [Symbol, Knockapi::Models::Users::FeedListItemsParams::Status] The status of the feed items. + # @param status [Symbol, Knockapi::Users::FeedListItemsParams::Status] The status of the feed items. # # @param tenant [String] The tenant associated with the feed items. # @@ -61,7 +61,7 @@ def get_settings(user_id, id, params = {}) # # @see Knockapi::Models::Users::FeedListItemsParams def list_items(user_id, id, params = {}) - parsed, options = Knockapi::Models::Users::FeedListItemsParams.dump_request(params) + parsed, options = Knockapi::Users::FeedListItemsParams.dump_request(params) @client.request( method: :get, path: ["v1/users/%1$s/feeds/%2$s", user_id, id], diff --git a/lib/knockapi/resources/users/guides.rb b/lib/knockapi/resources/users/guides.rb index 5bfceba9..bdeb9e4a 100644 --- a/lib/knockapi/resources/users/guides.rb +++ b/lib/knockapi/resources/users/guides.rb @@ -24,7 +24,7 @@ class Guides # # @see Knockapi::Models::Users::GuideGetChannelParams def get_channel(user_id, channel_id, params = {}) - parsed, options = Knockapi::Models::Users::GuideGetChannelParams.dump_request(params) + parsed, options = Knockapi::Users::GuideGetChannelParams.dump_request(params) @client.request( method: :get, path: ["v1/users/%1$s/guides/%2$s", user_id, channel_id], @@ -67,7 +67,7 @@ def get_channel(user_id, channel_id, params = {}) # # @see Knockapi::Models::Users::GuideMarkMessageAsArchivedParams def mark_message_as_archived(user_id, message_id, params) - parsed, options = Knockapi::Models::Users::GuideMarkMessageAsArchivedParams.dump_request(params) + parsed, options = Knockapi::Users::GuideMarkMessageAsArchivedParams.dump_request(params) @client.request( method: :put, path: ["v1/users/%1$s/guides/messages/%2$s/archived", user_id, message_id], @@ -110,7 +110,7 @@ def mark_message_as_archived(user_id, message_id, params) # # @see Knockapi::Models::Users::GuideMarkMessageAsInteractedParams def mark_message_as_interacted(user_id, message_id, params) - parsed, options = Knockapi::Models::Users::GuideMarkMessageAsInteractedParams.dump_request(params) + parsed, options = Knockapi::Users::GuideMarkMessageAsInteractedParams.dump_request(params) @client.request( method: :put, path: ["v1/users/%1$s/guides/messages/%2$s/interacted", user_id, message_id], @@ -153,7 +153,7 @@ def mark_message_as_interacted(user_id, message_id, params) # # @see Knockapi::Models::Users::GuideMarkMessageAsSeenParams def mark_message_as_seen(user_id, message_id, params) - parsed, options = Knockapi::Models::Users::GuideMarkMessageAsSeenParams.dump_request(params) + parsed, options = Knockapi::Users::GuideMarkMessageAsSeenParams.dump_request(params) @client.request( method: :put, path: ["v1/users/%1$s/guides/messages/%2$s/seen", user_id, message_id], diff --git a/lib/knockapi/resources/workflows.rb b/lib/knockapi/resources/workflows.rb index a62a31d2..a20db055 100644 --- a/lib/knockapi/resources/workflows.rb +++ b/lib/knockapi/resources/workflows.rb @@ -15,10 +15,8 @@ class Workflows # @param key [String] The key of the workflow to cancel. # # @param cancellation_key [String] An optional key that is used to reference a specific workflow trigger request wh - # ... # - # @param recipients [Array, nil] A list of recipients to cancel the notification for. If omitted, cancels for all - # ... + # @param recipients [Array, nil] A list of recipients to cancel the notification for. If omitted, cancels for all # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -26,7 +24,7 @@ class Workflows # # @see Knockapi::Models::WorkflowCancelParams def cancel(key, params) - parsed, options = Knockapi::Models::WorkflowCancelParams.dump_request(params) + parsed, options = Knockapi::WorkflowCancelParams.dump_request(params) @client.request( method: :post, path: ["v1/workflows/%1$s/cancel", key], @@ -49,18 +47,15 @@ def cancel(key, params) # # @param key [String] Key of the workflow to trigger. # - # @param recipients [Array] The recipients to trigger the workflow for. Can inline identify users, objects, - # ... + # @param recipients [Array] The recipients to trigger the workflow for. Can inline identify users, objects, # - # @param actor [String, Knockapi::Models::InlineIdentifyUserRequest, Knockapi::Models::InlineObjectRequest, nil] Specifies a recipient in a request. This can either be a user identifier (string - # ... + # @param actor [String, Knockapi::InlineIdentifyUserRequest, Knockapi::InlineObjectRequest, nil] Specifies a recipient in a request. This can either be a user identifier (string # # @param cancellation_key [String, nil] An optional key that is used to reference a specific workflow trigger request wh - # ... # # @param data [Hash{Symbol=>Object}, nil] An optional map of data to pass into the workflow execution. # - # @param tenant [String, Knockapi::Models::TenantRequest, nil] An request to set a tenant inline. + # @param tenant [String, Knockapi::TenantRequest, nil] An request to set a tenant inline. # # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -68,7 +63,7 @@ def cancel(key, params) # # @see Knockapi::Models::WorkflowTriggerParams def trigger(key, params) - parsed, options = Knockapi::Models::WorkflowTriggerParams.dump_request(params) + parsed, options = Knockapi::WorkflowTriggerParams.dump_request(params) @client.request( method: :post, path: ["v1/workflows/%1$s/trigger", key], diff --git a/lib/knockapi/version.rb b/lib/knockapi/version.rb index bf31607c..48afbb80 100644 --- a/lib/knockapi/version.rb +++ b/lib/knockapi/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Knockapi - VERSION = "1.0.0" + VERSION = "1.1.0" end diff --git a/rbi/knockapi/client.rbi b/rbi/knockapi/client.rbi index 157a6c15..f5c3888b 100644 --- a/rbi/knockapi/client.rbi +++ b/rbi/knockapi/client.rbi @@ -54,7 +54,8 @@ module Knockapi # @api private sig { override.returns(T::Hash[String, String]) } - private def auth_headers; end + private def auth_headers + end # Creates and returns a new client for interacting with the API. sig do @@ -65,8 +66,7 @@ module Knockapi timeout: Float, initial_retry_delay: Float, max_retry_delay: Float - ) - .returns(T.attached_class) + ).returns(T.attached_class) end def self.new( # Defaults to `ENV["KNOCK_API_KEY"]` @@ -79,6 +79,7 @@ module Knockapi timeout: Knockapi::Client::DEFAULT_TIMEOUT_IN_SECONDS, initial_retry_delay: Knockapi::Client::DEFAULT_INITIAL_RETRY_DELAY, max_retry_delay: Knockapi::Client::DEFAULT_MAX_RETRY_DELAY - ); end + ) + end end end diff --git a/rbi/knockapi/errors.rbi b/rbi/knockapi/errors.rbi index c2d7dacc..c8c8aa3b 100644 --- a/rbi/knockapi/errors.rbi +++ b/rbi/knockapi/errors.rbi @@ -29,10 +29,17 @@ module Knockapi request: NilClass, response: NilClass, message: T.nilable(String) - ) - .returns(T.attached_class) + ).returns(T.attached_class) + end + def self.new( + url:, + status: nil, + body: nil, + request: nil, + response: nil, + message: nil + ) end - def self.new(url:, status: nil, body: nil, request: nil, response: nil, message: nil); end end class APIConnectionError < Knockapi::Errors::APIError @@ -51,10 +58,16 @@ module Knockapi request: NilClass, response: NilClass, message: T.nilable(String) - ) - .returns(T.attached_class) + ).returns(T.attached_class) end - def self.new(url:, status: nil, body: nil, request: nil, response: nil, message: "Connection error.") + def self.new( + url:, + status: nil, + body: nil, + request: nil, + response: nil, + message: "Connection error." + ) end end @@ -68,10 +81,16 @@ module Knockapi request: NilClass, response: NilClass, message: T.nilable(String) - ) - .returns(T.attached_class) + ).returns(T.attached_class) end - def self.new(url:, status: nil, body: nil, request: nil, response: nil, message: "Request timed out.") + def self.new( + url:, + status: nil, + body: nil, + request: nil, + response: nil, + message: "Request timed out." + ) end end @@ -85,10 +104,10 @@ module Knockapi request: NilClass, response: NilClass, message: T.nilable(String) - ) - .returns(T.attached_class) + ).returns(T.attached_class) + end + def self.for(url:, status:, body:, request:, response:, message: nil) end - def self.for(url:, status:, body:, request:, response:, message: nil); end sig { returns(Integer) } attr_accessor :status @@ -102,10 +121,10 @@ module Knockapi request: NilClass, response: NilClass, message: T.nilable(String) - ) - .returns(T.attached_class) + ).returns(T.attached_class) + end + def self.new(url:, status:, body:, request:, response:, message: nil) end - def self.new(url:, status:, body:, request:, response:, message: nil); end end class BadRequestError < Knockapi::Errors::APIStatusError @@ -137,7 +156,7 @@ module Knockapi end class InternalServerError < Knockapi::Errors::APIStatusError - HTTP_STATUS = T.let(500.., T::Range[Integer]) + HTTP_STATUS = T.let((500..), T::Range[Integer]) end end end diff --git a/rbi/knockapi/file_part.rbi b/rbi/knockapi/file_part.rbi index 52367679..53793126 100644 --- a/rbi/knockapi/file_part.rbi +++ b/rbi/knockapi/file_part.rbi @@ -13,22 +13,25 @@ module Knockapi # @api private sig { returns(String) } - private def read; end + private def read + end sig { params(a: T.anything).returns(String) } - def to_json(*a); end + def to_json(*a) + end sig { params(a: T.anything).returns(String) } - def to_yaml(*a); end + def to_yaml(*a) + end sig do params( content: T.any(Pathname, StringIO, IO, String), filename: T.nilable(String), content_type: T.nilable(String) - ) - .returns(T.attached_class) + ).returns(T.attached_class) + end + def self.new(content, filename: nil, content_type: nil) end - def self.new(content, filename: nil, content_type: nil); end end end diff --git a/rbi/knockapi/internal.rbi b/rbi/knockapi/internal.rbi index a29cdddf..8a1be7e0 100644 --- a/rbi/knockapi/internal.rbi +++ b/rbi/knockapi/internal.rbi @@ -2,6 +2,8 @@ module Knockapi module Internal + extend Knockapi::Internal::Util::SorbetRuntimeSupport + # Due to the current WIP status of Shapes support in Sorbet, types referencing # this alias might be refined in the future. AnyHash = T.type_alias { T::Hash[Symbol, T.anything] } diff --git a/rbi/knockapi/internal/entries_cursor.rbi b/rbi/knockapi/internal/entries_cursor.rbi index ead2f460..20e96c23 100644 --- a/rbi/knockapi/internal/entries_cursor.rbi +++ b/rbi/knockapi/internal/entries_cursor.rbi @@ -15,9 +15,12 @@ module Knockapi # @api private sig { returns(String) } - def inspect; end + def inspect + end class PageInfo < Knockapi::Internal::Type::BaseModel + OrHash = T.type_alias { T.any(PageInfo, Knockapi::Internal::AnyHash) } + sig { returns(T.nilable(String)) } attr_reader :after @@ -25,10 +28,12 @@ module Knockapi attr_writer :after sig { params(after: String).returns(T.attached_class) } - def self.new(after: nil); end + def self.new(after: nil) + end - sig { override.returns({after: String}) } - def to_hash; end + sig { override.returns({ after: String }) } + def to_hash + end end end end diff --git a/rbi/knockapi/internal/items_cursor.rbi b/rbi/knockapi/internal/items_cursor.rbi index ba4af0a6..3b5dd8cd 100644 --- a/rbi/knockapi/internal/items_cursor.rbi +++ b/rbi/knockapi/internal/items_cursor.rbi @@ -15,9 +15,12 @@ module Knockapi # @api private sig { returns(String) } - def inspect; end + def inspect + end class PageInfo < Knockapi::Internal::Type::BaseModel + OrHash = T.type_alias { T.any(PageInfo, Knockapi::Internal::AnyHash) } + sig { returns(T.nilable(String)) } attr_reader :after @@ -25,10 +28,12 @@ module Knockapi attr_writer :after sig { params(after: String).returns(T.attached_class) } - def self.new(after: nil); end + def self.new(after: nil) + end - sig { override.returns({after: String}) } - def to_hash; end + sig { override.returns({ after: String }) } + def to_hash + end end end end diff --git a/rbi/knockapi/internal/ms_teams_pagination.rbi b/rbi/knockapi/internal/ms_teams_pagination.rbi index 9dbba4aa..6d954a21 100644 --- a/rbi/knockapi/internal/ms_teams_pagination.rbi +++ b/rbi/knockapi/internal/ms_teams_pagination.rbi @@ -15,7 +15,8 @@ module Knockapi # @api private sig { returns(String) } - def inspect; end + def inspect + end end end end diff --git a/rbi/knockapi/internal/slack_channels_cursor.rbi b/rbi/knockapi/internal/slack_channels_cursor.rbi index fe3b754e..15c17ca8 100644 --- a/rbi/knockapi/internal/slack_channels_cursor.rbi +++ b/rbi/knockapi/internal/slack_channels_cursor.rbi @@ -15,7 +15,8 @@ module Knockapi # @api private sig { returns(String) } - def inspect; end + def inspect + end end end end diff --git a/rbi/knockapi/internal/transport/base_client.rbi b/rbi/knockapi/internal/transport/base_client.rbi index dea66f99..c34bd594 100644 --- a/rbi/knockapi/internal/transport/base_client.rbi +++ b/rbi/knockapi/internal/transport/base_client.rbi @@ -5,41 +5,57 @@ module Knockapi module Transport # @api private class BaseClient + extend Knockapi::Internal::Util::SorbetRuntimeSupport + abstract! - RequestComponentsShape = + RequestComponents = T.type_alias do { method: Symbol, path: T.any(String, T::Array[String]), - query: T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))]), - headers: T.nilable( - T::Hash[String, - T.nilable( - T.any( - String, - Integer, - T::Array[T.nilable(T.any(String, Integer))] - ) - )] - ), + query: + T.nilable( + T::Hash[String, T.nilable(T.any(T::Array[String], String))] + ), + headers: + T.nilable( + T::Hash[ + String, + T.nilable( + T.any( + String, + Integer, + T::Array[T.nilable(T.any(String, Integer))] + ) + ) + ] + ), body: T.nilable(T.anything), - unwrap: T.nilable( - T.any( - Symbol, - Integer, - T::Array[T.any(Symbol, Integer)], - T.proc.params(arg0: T.anything).returns(T.anything) - ) - ), - page: T.nilable(T::Class[Knockapi::Internal::Type::BasePage[Knockapi::Internal::Type::BaseModel]]), + unwrap: + T.nilable( + T.any( + Symbol, + Integer, + T::Array[T.any(Symbol, Integer)], + T.proc.params(arg0: T.anything).returns(T.anything) + ) + ), + page: + T.nilable( + T::Class[ + Knockapi::Internal::Type::BasePage[ + Knockapi::Internal::Type::BaseModel + ] + ] + ), stream: T.nilable(T::Class[T.anything]), model: T.nilable(Knockapi::Internal::Type::Converter::Input), - options: T.nilable(Knockapi::RequestOpts) + options: T.nilable(Knockapi::RequestOptions::OrHash) } end - RequestInputShape = + RequestInput = T.type_alias do { method: Symbol, @@ -58,43 +74,67 @@ module Knockapi class << self # @api private - sig { params(req: Knockapi::Internal::Transport::BaseClient::RequestComponentsShape).void } - def validate!(req); end + sig do + params( + req: Knockapi::Internal::Transport::BaseClient::RequestComponents + ).void + end + def validate!(req) + end # @api private sig do params( status: Integer, - headers: T.any( - T::Hash[String, String], - Net::HTTPHeader - ) + headers: T.any(T::Hash[String, String], Net::HTTPHeader) ).returns(T::Boolean) end - def should_retry?(status, headers:); end + def should_retry?(status, headers:) + end # @api private sig do params( - request: Knockapi::Internal::Transport::BaseClient::RequestInputShape, + request: Knockapi::Internal::Transport::BaseClient::RequestInput, status: Integer, response_headers: T.any(T::Hash[String, String], Net::HTTPHeader) - ) - .returns(Knockapi::Internal::Transport::BaseClient::RequestInputShape) + ).returns(Knockapi::Internal::Transport::BaseClient::RequestInput) + end + def follow_redirect(request, status:, response_headers:) end - def follow_redirect(request, status:, response_headers:); end # @api private sig do params( status: T.any(Integer, Knockapi::Errors::APIConnectionError), stream: T.nilable(T::Enumerable[String]) - ) - .void + ).void + end + def reap_connection!(status, stream:) end - def reap_connection!(status, stream:); end end + sig { returns(URI::Generic) } + attr_reader :base_url + + sig { returns(Float) } + attr_reader :timeout + + sig { returns(Integer) } + attr_reader :max_retries + + sig { returns(Float) } + attr_reader :initial_retry_delay + + sig { returns(Float) } + attr_reader :max_retry_delay + + sig { returns(T::Hash[String, String]) } + attr_reader :headers + + sig { returns(T.nilable(String)) } + attr_reader :idempotency_header + # @api private sig { returns(Knockapi::Internal::Transport::PooledNetRequester) } attr_reader :requester @@ -107,11 +147,19 @@ module Knockapi max_retries: Integer, initial_retry_delay: Float, max_retry_delay: Float, - headers: T::Hash[String, - T.nilable(T.any(String, Integer, T::Array[T.nilable(T.any(String, Integer))]))], + headers: + T::Hash[ + String, + T.nilable( + T.any( + String, + Integer, + T::Array[T.nilable(T.any(String, Integer))] + ) + ) + ], idempotency_header: T.nilable(String) - ) - .returns(T.attached_class) + ).returns(T.attached_class) end def self.new( base_url:, @@ -121,41 +169,57 @@ module Knockapi max_retry_delay: 0.0, headers: {}, idempotency_header: nil - ); end + ) + end + # @api private sig { overridable.returns(T::Hash[String, String]) } - private def auth_headers; end + private def auth_headers + end # @api private sig { returns(String) } - private def generate_idempotency_key; end + private def generate_idempotency_key + end # @api private sig do overridable .params( - req: Knockapi::Internal::Transport::BaseClient::RequestComponentsShape, + req: Knockapi::Internal::Transport::BaseClient::RequestComponents, opts: Knockapi::Internal::AnyHash ) - .returns(Knockapi::Internal::Transport::BaseClient::RequestInputShape) + .returns(Knockapi::Internal::Transport::BaseClient::RequestInput) + end + private def build_request(req, opts) end - private def build_request(req, opts); end # @api private - sig { params(headers: T::Hash[String, String], retry_count: Integer).returns(Float) } - private def retry_delay(headers, retry_count:); end + sig do + params( + headers: T::Hash[String, String], + retry_count: Integer + ).returns(Float) + end + private def retry_delay(headers, retry_count:) + end # @api private sig do params( - request: Knockapi::Internal::Transport::BaseClient::RequestInputShape, + request: Knockapi::Internal::Transport::BaseClient::RequestInput, redirect_count: Integer, retry_count: Integer, send_retry_header: T::Boolean - ) - .returns([Integer, Net::HTTPResponse, T::Enumerable[String]]) + ).returns([Integer, Net::HTTPResponse, T::Enumerable[String]]) + end + private def send_request( + request, + redirect_count:, + retry_count:, + send_retry_header: + ) end - private def send_request(request, redirect_count:, retry_count:, send_retry_header:); end # Execute the request specified by `req`. This is the method that all resource # methods call into. @@ -165,32 +229,45 @@ module Knockapi params( method: Symbol, path: T.any(String, T::Array[String]), - query: T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))]), - headers: T.nilable( - T::Hash[String, - T.nilable( - T.any( - String, - Integer, - T::Array[T.nilable(T.any(String, Integer))] - ) - )] - ), + query: + T.nilable( + T::Hash[String, T.nilable(T.any(T::Array[String], String))] + ), + headers: + T.nilable( + T::Hash[ + String, + T.nilable( + T.any( + String, + Integer, + T::Array[T.nilable(T.any(String, Integer))] + ) + ) + ] + ), body: T.nilable(T.anything), - unwrap: T.nilable( - T.any( - Symbol, - Integer, - T::Array[T.any(Symbol, Integer)], - T.proc.params(arg0: T.anything).returns(T.anything) - ) - ), - page: T.nilable(T::Class[Knockapi::Internal::Type::BasePage[Knockapi::Internal::Type::BaseModel]]), + unwrap: + T.nilable( + T.any( + Symbol, + Integer, + T::Array[T.any(Symbol, Integer)], + T.proc.params(arg0: T.anything).returns(T.anything) + ) + ), + page: + T.nilable( + T::Class[ + Knockapi::Internal::Type::BasePage[ + Knockapi::Internal::Type::BaseModel + ] + ] + ), stream: T.nilable(T::Class[T.anything]), model: T.nilable(Knockapi::Internal::Type::Converter::Input), - options: T.nilable(Knockapi::RequestOpts) - ) - .returns(T.anything) + options: T.nilable(Knockapi::RequestOptions::OrHash) + ).returns(T.anything) end def request( method, @@ -203,10 +280,13 @@ module Knockapi stream: nil, model: Knockapi::Internal::Type::Unknown, options: {} - ); end + ) + end + # @api private sig { returns(String) } - def inspect; end + def inspect + end end end end diff --git a/rbi/knockapi/internal/transport/pooled_net_requester.rbi b/rbi/knockapi/internal/transport/pooled_net_requester.rbi index 3bc54b44..3bba41a7 100644 --- a/rbi/knockapi/internal/transport/pooled_net_requester.rbi +++ b/rbi/knockapi/internal/transport/pooled_net_requester.rbi @@ -5,7 +5,9 @@ module Knockapi module Transport # @api private class PooledNetRequester - RequestShape = + extend Knockapi::Internal::Util::SorbetRuntimeSupport + + Request = T.type_alias do { method: Symbol, @@ -20,40 +22,57 @@ module Knockapi # https://github.com/golang/go/blob/c8eced8580028328fde7c03cbfcb720ce15b2358/src/net/http/transport.go#L49 KEEP_ALIVE_TIMEOUT = 30 + DEFAULT_MAX_CONNECTIONS = T.let(T.unsafe(nil), Integer) + class << self # @api private sig { params(url: URI::Generic).returns(Net::HTTP) } - def connect(url); end + def connect(url) + end # @api private sig { params(conn: Net::HTTP, deadline: Float).void } - def calibrate_socket_timeout(conn, deadline); end + def calibrate_socket_timeout(conn, deadline) + end # @api private sig do params( - request: Knockapi::Internal::Transport::PooledNetRequester::RequestShape, + request: + Knockapi::Internal::Transport::PooledNetRequester::Request, blk: T.proc.params(arg0: String).void - ) - .returns([Net::HTTPGenericRequest, T.proc.void]) + ).returns([Net::HTTPGenericRequest, T.proc.void]) + end + def build_request(request, &blk) end - def build_request(request, &blk); end end # @api private - sig { params(url: URI::Generic, deadline: Float, blk: T.proc.params(arg0: Net::HTTP).void).void } - private def with_pool(url, deadline:, &blk); end + sig do + params( + url: URI::Generic, + deadline: Float, + blk: T.proc.params(arg0: Net::HTTP).void + ).void + end + private def with_pool(url, deadline:, &blk) + end # @api private sig do - params(request: Knockapi::Internal::Transport::PooledNetRequester::RequestShape) - .returns([Integer, Net::HTTPResponse, T::Enumerable[String]]) + params( + request: Knockapi::Internal::Transport::PooledNetRequester::Request + ).returns([Integer, Net::HTTPResponse, T::Enumerable[String]]) + end + def execute(request) end - def execute(request); end # @api private sig { params(size: Integer).returns(T.attached_class) } - def self.new(size: Etc.nprocessors); end + def self.new( + size: Knockapi::Internal::Transport::PooledNetRequester::DEFAULT_MAX_CONNECTIONS + ) + end end end end diff --git a/rbi/knockapi/internal/type/array_of.rbi b/rbi/knockapi/internal/type/array_of.rbi index 898e7223..5b044fba 100644 --- a/rbi/knockapi/internal/type/array_of.rbi +++ b/rbi/knockapi/internal/type/array_of.rbi @@ -15,25 +15,29 @@ module Knockapi sig do params( - type_info: T.any( - Knockapi::Internal::AnyHash, - T.proc.returns(Knockapi::Internal::Type::Converter::Input), - Knockapi::Internal::Type::Converter::Input - ), + type_info: + T.any( + Knockapi::Internal::AnyHash, + T.proc.returns(Knockapi::Internal::Type::Converter::Input), + Knockapi::Internal::Type::Converter::Input + ), spec: Knockapi::Internal::AnyHash - ) - .returns(T.attached_class) + ).returns(T.attached_class) + end + def self.[](type_info, spec = {}) end - def self.[](type_info, spec = {}); end sig { params(other: T.anything).returns(T::Boolean) } - def ===(other); end + def ===(other) + end sig { params(other: T.anything).returns(T::Boolean) } - def ==(other); end + def ==(other) + end sig { returns(Integer) } - def hash; end + def hash + end # @api private sig do @@ -44,7 +48,8 @@ module Knockapi ) .returns(T.any(T::Array[T.anything], T.anything)) end - def coerce(value, state:); end + def coerce(value, state:) + end # @api private sig do @@ -55,33 +60,38 @@ module Knockapi ) .returns(T.any(T::Array[T.anything], T.anything)) end - def dump(value, state:); end + def dump(value, state:) + end # @api private sig { returns(Elem) } - protected def item_type; end + protected def item_type + end # @api private sig { returns(T::Boolean) } - protected def nilable?; end + protected def nilable? + end # @api private sig do params( - type_info: T.any( - Knockapi::Internal::AnyHash, - T.proc.returns(Knockapi::Internal::Type::Converter::Input), - Knockapi::Internal::Type::Converter::Input - ), + type_info: + T.any( + Knockapi::Internal::AnyHash, + T.proc.returns(Knockapi::Internal::Type::Converter::Input), + Knockapi::Internal::Type::Converter::Input + ), spec: Knockapi::Internal::AnyHash - ) - .void + ).void + end + def initialize(type_info, spec = {}) end - def initialize(type_info, spec = {}); end # @api private sig { params(depth: Integer).returns(String) } - def inspect(depth: 0); end + def inspect(depth: 0) + end end end end diff --git a/rbi/knockapi/internal/type/base_model.rbi b/rbi/knockapi/internal/type/base_model.rbi index 6574a464..19b335cb 100644 --- a/rbi/knockapi/internal/type/base_model.rbi +++ b/rbi/knockapi/internal/type/base_model.rbi @@ -5,30 +5,53 @@ module Knockapi module Type class BaseModel extend Knockapi::Internal::Type::Converter + extend Knockapi::Internal::Util::SorbetRuntimeSupport abstract! - KnownFieldShape = T.type_alias do - {mode: T.nilable(Symbol), required: T::Boolean, nilable: T::Boolean} - end + KnownField = + T.type_alias do + { + mode: T.nilable(Symbol), + required: T::Boolean, + nilable: T::Boolean + } + end + + OrHash = + T.type_alias do + T.any( + Knockapi::Internal::Type::BaseModel, + Knockapi::Internal::AnyHash + ) + end class << self # @api private # # Assumes superclass fields are totally defined before fields are accessed / # defined on subclasses. + sig { params(child: T.self_type).void } + def inherited(child) + end + + # @api private sig do returns( T::Hash[ Symbol, T.all( - Knockapi::Internal::Type::BaseModel::KnownFieldShape, - {type_fn: T.proc.returns(Knockapi::Internal::Type::Converter::Input)} + Knockapi::Internal::Type::BaseModel::KnownField, + { + type_fn: + T.proc.returns(Knockapi::Internal::Type::Converter::Input) + } ) ] ) end - def known_fields; end + def known_fields + end # @api private sig do @@ -36,119 +59,156 @@ module Knockapi T::Hash[ Symbol, T.all( - Knockapi::Internal::Type::BaseModel::KnownFieldShape, - {type: Knockapi::Internal::Type::Converter::Input} + Knockapi::Internal::Type::BaseModel::KnownField, + { type: Knockapi::Internal::Type::Converter::Input } ) ] ) end - def fields; end + def fields + end # @api private sig do params( name_sym: Symbol, required: T::Boolean, - type_info: T.any( - { - const: T.nilable(T.any(NilClass, T::Boolean, Integer, Float, Symbol)), - enum: T.nilable(T.proc.returns(Knockapi::Internal::Type::Converter::Input)), - union: T.nilable(T.proc.returns(Knockapi::Internal::Type::Converter::Input)), - api_name: Symbol, - nil?: T::Boolean - }, - T.proc.returns(Knockapi::Internal::Type::Converter::Input), - Knockapi::Internal::Type::Converter::Input - ), + type_info: + T.any( + { + const: + T.nilable( + T.any(NilClass, T::Boolean, Integer, Float, Symbol) + ), + enum: + T.nilable( + T.proc.returns( + Knockapi::Internal::Type::Converter::Input + ) + ), + union: + T.nilable( + T.proc.returns( + Knockapi::Internal::Type::Converter::Input + ) + ), + api_name: Symbol, + nil?: T::Boolean + }, + T.proc.returns(Knockapi::Internal::Type::Converter::Input), + Knockapi::Internal::Type::Converter::Input + ), spec: Knockapi::Internal::AnyHash - ) - .void + ).void + end + private def add_field(name_sym, required:, type_info:, spec:) end - private def add_field(name_sym, required:, type_info:, spec:); end # @api private sig do params( name_sym: Symbol, - type_info: T.any( - Knockapi::Internal::AnyHash, - T.proc.returns(Knockapi::Internal::Type::Converter::Input), - Knockapi::Internal::Type::Converter::Input - ), + type_info: + T.any( + Knockapi::Internal::AnyHash, + T.proc.returns(Knockapi::Internal::Type::Converter::Input), + Knockapi::Internal::Type::Converter::Input + ), spec: Knockapi::Internal::AnyHash - ) - .void + ).void + end + def required(name_sym, type_info, spec = {}) end - def required(name_sym, type_info, spec = {}); end # @api private sig do params( name_sym: Symbol, - type_info: T.any( - Knockapi::Internal::AnyHash, - T.proc.returns(Knockapi::Internal::Type::Converter::Input), - Knockapi::Internal::Type::Converter::Input - ), + type_info: + T.any( + Knockapi::Internal::AnyHash, + T.proc.returns(Knockapi::Internal::Type::Converter::Input), + Knockapi::Internal::Type::Converter::Input + ), spec: Knockapi::Internal::AnyHash - ) - .void + ).void + end + def optional(name_sym, type_info, spec = {}) end - def optional(name_sym, type_info, spec = {}); end # @api private # # `request_only` attributes not excluded from `.#coerce` when receiving responses # even if well behaved servers should not send them sig { params(blk: T.proc.void).void } - private def request_only(&blk); end + private def request_only(&blk) + end # @api private # # `response_only` attributes are omitted from `.#dump` when making requests sig { params(blk: T.proc.void).void } - private def response_only(&blk); end + private def response_only(&blk) + end sig { params(other: T.anything).returns(T::Boolean) } - def ==(other); end + def ==(other) + end sig { returns(Integer) } - def hash; end + def hash + end end sig { params(other: T.anything).returns(T::Boolean) } - def ==(other); end + def ==(other) + end sig { returns(Integer) } - def hash; end + def hash + end class << self # @api private sig do override .params( - value: T.any( - Knockapi::Internal::Type::BaseModel, - T::Hash[T.anything, T.anything], - T.anything - ), + value: + T.any( + Knockapi::Internal::Type::BaseModel, + T::Hash[T.anything, T.anything], + T.anything + ), state: Knockapi::Internal::Type::Converter::CoerceState ) .returns(T.any(T.attached_class, T.anything)) end - def coerce(value, state:); end + def coerce(value, state:) + end # @api private sig do override - .params(value: T.any( - T.attached_class, - T.anything - ), - state: Knockapi::Internal::Type::Converter::DumpState) + .params( + value: T.any(T.attached_class, T.anything), + state: Knockapi::Internal::Type::Converter::DumpState + ) .returns(T.any(T::Hash[T.anything, T.anything], T.anything)) end - def dump(value, state:); end + def dump(value, state:) + end + end + + class << self + # @api private + sig do + params( + model: Knockapi::Internal::Type::BaseModel, + convert: T::Boolean + ).returns(Knockapi::Internal::AnyHash) + end + def recursively_to_h(model, convert:) + end end # Returns the raw value associated with the given key, if found. Otherwise, nil is @@ -158,7 +218,8 @@ module Knockapi # undocumented features. This method does not parse response data into # higher-level types. Lookup by anything other than a Symbol is an ArgumentError. sig { params(key: Symbol).returns(T.nilable(T.anything)) } - def [](key); end + def [](key) + end # Returns a Hash of the data underlying this object. O(1) # @@ -169,7 +230,8 @@ module Knockapi # This method is not recursive. The returned value is shared by the object, so it # should not be mutated. sig { overridable.returns(Knockapi::Internal::AnyHash) } - def to_h; end + def to_h + end # Returns a Hash of the data underlying this object. O(1) # @@ -180,39 +242,55 @@ module Knockapi # This method is not recursive. The returned value is shared by the object, so it # should not be mutated. sig { overridable.returns(Knockapi::Internal::AnyHash) } - def to_hash; end + def to_hash + end - sig { params(keys: T.nilable(T::Array[Symbol])).returns(Knockapi::Internal::AnyHash) } - def deconstruct_keys(keys); end + # In addition to the behaviour of `#to_h`, this method will recursively call + # `#to_h` on nested models. + sig { overridable.returns(Knockapi::Internal::AnyHash) } + def deep_to_h + end - class << self - # @api private - sig { params(model: Knockapi::Internal::Type::BaseModel).returns(Knockapi::Internal::AnyHash) } - def walk(model); end + sig do + params(keys: T.nilable(T::Array[Symbol])).returns( + Knockapi::Internal::AnyHash + ) + end + def deconstruct_keys(keys) end sig { params(a: T.anything).returns(String) } - def to_json(*a); end + def to_json(*a) + end sig { params(a: T.anything).returns(String) } - def to_yaml(*a); end + def to_yaml(*a) + end # Create a new instance of a model. - sig { params(data: T.any(T::Hash[Symbol, T.anything], T.self_type)).returns(T.attached_class) } - def self.new(data = {}); end + sig do + params(data: T.any(T::Hash[Symbol, T.anything], T.self_type)).returns( + T.attached_class + ) + end + def self.new(data = {}) + end class << self # @api private sig { params(depth: Integer).returns(String) } - def inspect(depth: 0); end + def inspect(depth: 0) + end end sig { returns(String) } - def to_s; end + def to_s + end # @api private sig { returns(String) } - def inspect; end + def inspect + end end end end diff --git a/rbi/knockapi/internal/type/base_page.rbi b/rbi/knockapi/internal/type/base_page.rbi index f8b801d4..14a250da 100644 --- a/rbi/knockapi/internal/type/base_page.rbi +++ b/rbi/knockapi/internal/type/base_page.rbi @@ -10,28 +10,32 @@ module Knockapi Elem = type_member(:out) sig { overridable.returns(T::Boolean) } - def next_page?; end + def next_page? + end sig { overridable.returns(T.self_type) } - def next_page; end + def next_page + end sig { overridable.params(blk: T.proc.params(arg0: Elem).void).void } - def auto_paging_each(&blk); end + def auto_paging_each(&blk) + end sig { returns(T::Enumerable[Elem]) } - def to_enum; end + def to_enum + end # @api private sig do params( client: Knockapi::Internal::Transport::BaseClient, - req: Knockapi::Internal::Transport::BaseClient::RequestComponentsShape, + req: Knockapi::Internal::Transport::BaseClient::RequestComponents, headers: T.any(T::Hash[String, String], Net::HTTPHeader), page_data: T.anything - ) - .void + ).void + end + def initialize(client:, req:, headers:, page_data:) end - def initialize(client:, req:, headers:, page_data:); end end end end diff --git a/rbi/knockapi/internal/type/boolean.rbi b/rbi/knockapi/internal/type/boolean.rbi index 39e26dd8..5317e35d 100644 --- a/rbi/knockapi/internal/type/boolean.rbi +++ b/rbi/knockapi/internal/type/boolean.rbi @@ -12,35 +12,37 @@ module Knockapi abstract! sig { params(other: T.anything).returns(T::Boolean) } - def self.===(other); end + def self.===(other) + end sig { params(other: T.anything).returns(T::Boolean) } - def self.==(other); end + def self.==(other) + end class << self # @api private sig do override - .params(value: T.any( - T::Boolean, - T.anything - ), - state: Knockapi::Internal::Type::Converter::CoerceState) + .params( + value: T.any(T::Boolean, T.anything), + state: Knockapi::Internal::Type::Converter::CoerceState + ) .returns(T.any(T::Boolean, T.anything)) end - def coerce(value, state:); end + def coerce(value, state:) + end # @api private sig do override - .params(value: T.any( - T::Boolean, - T.anything - ), - state: Knockapi::Internal::Type::Converter::DumpState) + .params( + value: T.any(T::Boolean, T.anything), + state: Knockapi::Internal::Type::Converter::DumpState + ) .returns(T.any(T::Boolean, T.anything)) end - def dump(value, state:); end + def dump(value, state:) + end end end end diff --git a/rbi/knockapi/internal/type/converter.rbi b/rbi/knockapi/internal/type/converter.rbi index 64cb7921..8119210c 100644 --- a/rbi/knockapi/internal/type/converter.rbi +++ b/rbi/knockapi/internal/type/converter.rbi @@ -5,56 +5,88 @@ module Knockapi module Type # @api private module Converter - Input = T.type_alias { T.any(Knockapi::Internal::Type::Converter, T::Class[T.anything]) } + extend Knockapi::Internal::Util::SorbetRuntimeSupport + + Input = + T.type_alias do + T.any(Knockapi::Internal::Type::Converter, T::Class[T.anything]) + end CoerceState = T.type_alias do { strictness: T.any(T::Boolean, Symbol), - exactness: {yes: Integer, no: Integer, maybe: Integer}, + exactness: { + yes: Integer, + no: Integer, + maybe: Integer + }, branched: Integer } end - DumpState = T.type_alias { {can_retry: T::Boolean} } + DumpState = T.type_alias { { can_retry: T::Boolean } } # @api private sig do overridable - .params(value: T.anything, state: Knockapi::Internal::Type::Converter::CoerceState) + .params( + value: T.anything, + state: Knockapi::Internal::Type::Converter::CoerceState + ) .returns(T.anything) end - def coerce(value, state:); end + def coerce(value, state:) + end # @api private sig do overridable - .params(value: T.anything, state: Knockapi::Internal::Type::Converter::DumpState) + .params( + value: T.anything, + state: Knockapi::Internal::Type::Converter::DumpState + ) .returns(T.anything) end - def dump(value, state:); end + def dump(value, state:) + end # @api private sig { params(depth: Integer).returns(String) } - def inspect(depth: 0); end + def inspect(depth: 0) + end class << self # @api private sig do params( - spec: T.any( - { - const: T.nilable(T.any(NilClass, T::Boolean, Integer, Float, Symbol)), - enum: T.nilable(T.proc.returns(Knockapi::Internal::Type::Converter::Input)), - union: T.nilable(T.proc.returns(Knockapi::Internal::Type::Converter::Input)) - }, - T.proc.returns(Knockapi::Internal::Type::Converter::Input), - Knockapi::Internal::Type::Converter::Input - ) - ) - .returns(T.proc.returns(T.anything)) + spec: + T.any( + { + const: + T.nilable( + T.any(NilClass, T::Boolean, Integer, Float, Symbol) + ), + enum: + T.nilable( + T.proc.returns( + Knockapi::Internal::Type::Converter::Input + ) + ), + union: + T.nilable( + T.proc.returns( + Knockapi::Internal::Type::Converter::Input + ) + ) + }, + T.proc.returns(Knockapi::Internal::Type::Converter::Input), + Knockapi::Internal::Type::Converter::Input + ) + ).returns(T.proc.returns(T.anything)) + end + def self.type_info(spec) end - def self.type_info(spec); end # @api private # @@ -72,8 +104,7 @@ module Knockapi target: Knockapi::Internal::Type::Converter::Input, value: T.anything, state: Knockapi::Internal::Type::Converter::CoerceState - ) - .returns(T.anything) + ).returns(T.anything) end def self.coerce( target, @@ -97,22 +128,33 @@ module Knockapi # - `no`: the value cannot be converted to the target type. # # See implementation below for more details. - state: {strictness: true, exactness: {yes: 0, no: 0, maybe: 0}, branched: 0} - ); end + state: { + strictness: true, + exactness: { + yes: 0, + no: 0, + maybe: 0 + }, + branched: 0 + } + ) + end + # @api private sig do params( target: Knockapi::Internal::Type::Converter::Input, value: T.anything, state: Knockapi::Internal::Type::Converter::DumpState - ) - .returns(T.anything) + ).returns(T.anything) + end + def self.dump(target, value, state: { can_retry: true }) end - def self.dump(target, value, state: {can_retry: true}); end # @api private sig { params(target: T.anything, depth: Integer).returns(String) } - def self.inspect(target, depth:); end + def self.inspect(target, depth:) + end end end end diff --git a/rbi/knockapi/internal/type/enum.rbi b/rbi/knockapi/internal/type/enum.rbi index 402c9e8b..3aa6b5b6 100644 --- a/rbi/knockapi/internal/type/enum.rbi +++ b/rbi/knockapi/internal/type/enum.rbi @@ -17,19 +17,28 @@ module Knockapi # values safely. module Enum include Knockapi::Internal::Type::Converter + include Knockapi::Internal::Util::SorbetRuntimeSupport # All of the valid Symbol values for this enum. - sig { overridable.returns(T::Array[T.any(NilClass, T::Boolean, Integer, Float, Symbol)]) } - def values; end + sig do + overridable.returns( + T::Array[T.any(NilClass, T::Boolean, Integer, Float, Symbol)] + ) + end + def values + end sig { params(other: T.anything).returns(T::Boolean) } - def ===(other); end + def ===(other) + end sig { params(other: T.anything).returns(T::Boolean) } - def ==(other); end + def ==(other) + end sig { returns(Integer) } - def hash; end + def hash + end # @api private # @@ -37,27 +46,31 @@ module Knockapi # of the enum. sig do override - .params(value: T.any( - String, - Symbol, - T.anything - ), - state: Knockapi::Internal::Type::Converter::CoerceState) + .params( + value: T.any(String, Symbol, T.anything), + state: Knockapi::Internal::Type::Converter::CoerceState + ) .returns(T.any(Symbol, T.anything)) end - def coerce(value, state:); end + def coerce(value, state:) + end # @api private sig do override - .params(value: T.any(Symbol, T.anything), state: Knockapi::Internal::Type::Converter::DumpState) + .params( + value: T.any(Symbol, T.anything), + state: Knockapi::Internal::Type::Converter::DumpState + ) .returns(T.any(Symbol, T.anything)) end - def dump(value, state:); end + def dump(value, state:) + end # @api private sig { params(depth: Integer).returns(String) } - def inspect(depth: 0); end + def inspect(depth: 0) + end end end end diff --git a/rbi/knockapi/internal/type/file_input.rbi b/rbi/knockapi/internal/type/file_input.rbi index 84017d9f..9ab48d0b 100644 --- a/rbi/knockapi/internal/type/file_input.rbi +++ b/rbi/knockapi/internal/type/file_input.rbi @@ -16,10 +16,12 @@ module Knockapi abstract! sig { params(other: T.anything).returns(T::Boolean) } - def self.===(other); end + def self.===(other) + end sig { params(other: T.anything).returns(T::Boolean) } - def self.==(other); end + def self.==(other) + end class << self # @api private @@ -31,7 +33,8 @@ module Knockapi ) .returns(T.any(StringIO, T.anything)) end - def coerce(value, state:); end + def coerce(value, state:) + end # @api private sig do @@ -42,7 +45,8 @@ module Knockapi ) .returns(T.any(Pathname, StringIO, IO, String, T.anything)) end - def dump(value, state:); end + def dump(value, state:) + end end end end diff --git a/rbi/knockapi/internal/type/hash_of.rbi b/rbi/knockapi/internal/type/hash_of.rbi index 7c9d6adf..caa8369e 100644 --- a/rbi/knockapi/internal/type/hash_of.rbi +++ b/rbi/knockapi/internal/type/hash_of.rbi @@ -15,25 +15,29 @@ module Knockapi sig do params( - type_info: T.any( - Knockapi::Internal::AnyHash, - T.proc.returns(Knockapi::Internal::Type::Converter::Input), - Knockapi::Internal::Type::Converter::Input - ), + type_info: + T.any( + Knockapi::Internal::AnyHash, + T.proc.returns(Knockapi::Internal::Type::Converter::Input), + Knockapi::Internal::Type::Converter::Input + ), spec: Knockapi::Internal::AnyHash - ) - .returns(T.attached_class) + ).returns(T.attached_class) + end + def self.[](type_info, spec = {}) end - def self.[](type_info, spec = {}); end sig { params(other: T.anything).returns(T::Boolean) } - def ===(other); end + def ===(other) + end sig { params(other: T.anything).returns(T::Boolean) } - def ==(other); end + def ==(other) + end sig { returns(Integer) } - def hash; end + def hash + end # @api private sig do @@ -44,7 +48,8 @@ module Knockapi ) .returns(T.any(Knockapi::Internal::AnyHash, T.anything)) end - def coerce(value, state:); end + def coerce(value, state:) + end # @api private sig do @@ -55,33 +60,38 @@ module Knockapi ) .returns(T.any(Knockapi::Internal::AnyHash, T.anything)) end - def dump(value, state:); end + def dump(value, state:) + end # @api private sig { returns(Elem) } - protected def item_type; end + protected def item_type + end # @api private sig { returns(T::Boolean) } - protected def nilable?; end + protected def nilable? + end # @api private sig do params( - type_info: T.any( - Knockapi::Internal::AnyHash, - T.proc.returns(Knockapi::Internal::Type::Converter::Input), - Knockapi::Internal::Type::Converter::Input - ), + type_info: + T.any( + Knockapi::Internal::AnyHash, + T.proc.returns(Knockapi::Internal::Type::Converter::Input), + Knockapi::Internal::Type::Converter::Input + ), spec: Knockapi::Internal::AnyHash - ) - .void + ).void + end + def initialize(type_info, spec = {}) end - def initialize(type_info, spec = {}); end # @api private sig { params(depth: Integer).returns(String) } - def inspect(depth: 0); end + def inspect(depth: 0) + end end end end diff --git a/rbi/knockapi/internal/type/request_parameters.rbi b/rbi/knockapi/internal/type/request_parameters.rbi index b627b78c..3f4f4a0b 100644 --- a/rbi/knockapi/internal/type/request_parameters.rbi +++ b/rbi/knockapi/internal/type/request_parameters.rbi @@ -6,14 +6,22 @@ module Knockapi # @api private module RequestParameters # Options to specify HTTP behaviour for this request. - sig { returns(Knockapi::RequestOpts) } - attr_accessor :request_options + sig { returns(Knockapi::RequestOptions) } + attr_reader :request_options + + sig { params(request_options: Knockapi::RequestOptions::OrHash).void } + attr_writer :request_options # @api private module Converter # @api private - sig { params(params: T.anything).returns([T.anything, Knockapi::Internal::AnyHash]) } - def dump_request(params); end + sig do + params(params: T.anything).returns( + [T.anything, Knockapi::Internal::AnyHash] + ) + end + def dump_request(params) + end end end end diff --git a/rbi/knockapi/internal/type/union.rbi b/rbi/knockapi/internal/type/union.rbi index adfe19a4..1476ffc4 100644 --- a/rbi/knockapi/internal/type/union.rbi +++ b/rbi/knockapi/internal/type/union.rbi @@ -6,69 +6,105 @@ module Knockapi # @api private module Union include Knockapi::Internal::Type::Converter + include Knockapi::Internal::Util::SorbetRuntimeSupport # @api private # # All of the specified variant info for this union. sig do - returns(T::Array[[T.nilable(Symbol), T.proc.returns(Knockapi::Internal::Type::Converter::Input)]]) + returns( + T::Array[ + [ + T.nilable(Symbol), + T.proc.returns(Knockapi::Internal::Type::Converter::Input) + ] + ] + ) + end + private def known_variants end - private def known_variants; end # @api private sig { returns(T::Array[[T.nilable(Symbol), T.anything]]) } - protected def derefed_variants; end + protected def derefed_variants + end # All of the specified variants for this union. sig { overridable.returns(T::Array[T.anything]) } - def variants; end + def variants + end # @api private sig { params(property: Symbol).void } - private def discriminator(property); end + private def discriminator(property) + end # @api private sig do params( - key: T.any(Symbol, Knockapi::Internal::AnyHash, T.proc.returns(T.anything), T.anything), - spec: T.any(Knockapi::Internal::AnyHash, T.proc.returns(T.anything), T.anything) - ) - .void + key: + T.any( + Symbol, + Knockapi::Internal::AnyHash, + T.proc.returns(T.anything), + T.anything + ), + spec: + T.any( + Knockapi::Internal::AnyHash, + T.proc.returns(T.anything), + T.anything + ) + ).void + end + private def variant(key, spec = nil) end - private def variant(key, spec = nil); end # @api private sig { params(value: T.anything).returns(T.nilable(T.anything)) } - private def resolve_variant(value); end + private def resolve_variant(value) + end sig { params(other: T.anything).returns(T::Boolean) } - def ===(other); end + def ===(other) + end sig { params(other: T.anything).returns(T::Boolean) } - def ==(other); end + def ==(other) + end sig { returns(Integer) } - def hash; end + def hash + end # @api private sig do override - .params(value: T.anything, state: Knockapi::Internal::Type::Converter::CoerceState) + .params( + value: T.anything, + state: Knockapi::Internal::Type::Converter::CoerceState + ) .returns(T.anything) end - def coerce(value, state:); end + def coerce(value, state:) + end # @api private sig do override - .params(value: T.anything, state: Knockapi::Internal::Type::Converter::DumpState) + .params( + value: T.anything, + state: Knockapi::Internal::Type::Converter::DumpState + ) .returns(T.anything) end - def dump(value, state:); end + def dump(value, state:) + end # @api private sig { params(depth: Integer).returns(String) } - def inspect(depth: 0); end + def inspect(depth: 0) + end end end end diff --git a/rbi/knockapi/internal/type/unknown.rbi b/rbi/knockapi/internal/type/unknown.rbi index e5ae9945..069ba906 100644 --- a/rbi/knockapi/internal/type/unknown.rbi +++ b/rbi/knockapi/internal/type/unknown.rbi @@ -12,27 +12,37 @@ module Knockapi abstract! sig { params(other: T.anything).returns(T::Boolean) } - def self.===(other); end + def self.===(other) + end sig { params(other: T.anything).returns(T::Boolean) } - def self.==(other); end + def self.==(other) + end class << self # @api private sig do override - .params(value: T.anything, state: Knockapi::Internal::Type::Converter::CoerceState) + .params( + value: T.anything, + state: Knockapi::Internal::Type::Converter::CoerceState + ) .returns(T.anything) end - def coerce(value, state:); end + def coerce(value, state:) + end # @api private sig do override - .params(value: T.anything, state: Knockapi::Internal::Type::Converter::DumpState) + .params( + value: T.anything, + state: Knockapi::Internal::Type::Converter::DumpState + ) .returns(T.anything) end - def dump(value, state:); end + def dump(value, state:) + end end end end diff --git a/rbi/knockapi/internal/util.rbi b/rbi/knockapi/internal/util.rbi index 33f64b2e..510fd7ee 100644 --- a/rbi/knockapi/internal/util.rbi +++ b/rbi/knockapi/internal/util.rbi @@ -4,58 +4,106 @@ module Knockapi module Internal # @api private module Util + extend Knockapi::Internal::Util::SorbetRuntimeSupport + # @api private sig { returns(Float) } - def self.monotonic_secs; end + def self.monotonic_secs + end class << self # @api private sig { returns(String) } - def arch; end + def arch + end # @api private sig { returns(String) } - def os; end + def os + end end class << self # @api private sig { params(input: T.anything).returns(T::Boolean) } - def primitive?(input); end + def primitive?(input) + end + + # @api private + sig do + params(input: T.any(String, T::Boolean)).returns( + T.any(T::Boolean, T.anything) + ) + end + def coerce_boolean(input) + end # @api private - sig { params(input: T.any(String, T::Boolean)).returns(T.any(T::Boolean, T.anything)) } - def coerce_boolean(input); end + sig do + params(input: T.any(String, T::Boolean)).returns( + T.nilable(T::Boolean) + ) + end + def coerce_boolean!(input) + end # @api private - sig { params(input: T.any(String, T::Boolean)).returns(T.nilable(T::Boolean)) } - def coerce_boolean!(input); end + sig do + params(input: T.any(String, Integer)).returns( + T.any(Integer, T.anything) + ) + end + def coerce_integer(input) + end # @api private - sig { params(input: T.any(String, Integer)).returns(T.any(Integer, T.anything)) } - def coerce_integer(input); end + sig do + params(input: T.any(String, Integer, Float)).returns( + T.any(Float, T.anything) + ) + end + def coerce_float(input) + end # @api private - sig { params(input: T.any(String, Integer, Float)).returns(T.any(Float, T.anything)) } - def coerce_float(input); end + sig do + params(input: T.anything).returns( + T.any(T::Hash[T.anything, T.anything], T.anything) + ) + end + def coerce_hash(input) + end # @api private - sig { params(input: T.anything).returns(T.any(T::Hash[T.anything, T.anything], T.anything)) } - def coerce_hash(input); end + sig do + params(input: T.anything).returns( + T.nilable(T::Hash[T.anything, T.anything]) + ) + end + def coerce_hash!(input) + end end class << self # @api private - sig { params(lhs: T.anything, rhs: T.anything, concat: T::Boolean).returns(T.anything) } - private def deep_merge_lr(lhs, rhs, concat: false); end + sig do + params(lhs: T.anything, rhs: T.anything, concat: T::Boolean).returns( + T.anything + ) + end + private def deep_merge_lr(lhs, rhs, concat: false) + end # @api private # # Recursively merge one hash with another. If the values at a given key are not # both hashes, just take the new value. sig do - params(values: T::Array[T.anything], sentinel: T.nilable(T.anything), concat: T::Boolean) - .returns(T.anything) + params( + values: T::Array[T.anything], + sentinel: T.nilable(T.anything), + concat: T::Boolean + ).returns(T.anything) end def deep_merge( *values, @@ -63,50 +111,70 @@ module Knockapi sentinel: nil, # whether to merge sequences by concatenation. concat: false - ); end + ) + end + # @api private sig do params( - data: T.any(Knockapi::Internal::AnyHash, T::Array[T.anything], T.anything), - pick: T.nilable( + data: T.any( - Symbol, - Integer, - T::Array[T.any(Symbol, Integer)], - T.proc.params(arg0: T.anything).returns(T.anything) - ) - ), + Knockapi::Internal::AnyHash, + T::Array[T.anything], + T.anything + ), + pick: + T.nilable( + T.any( + Symbol, + Integer, + T::Array[T.any(Symbol, Integer)], + T.proc.params(arg0: T.anything).returns(T.anything) + ) + ), blk: T.nilable(T.proc.returns(T.anything)) - ) - .returns(T.nilable(T.anything)) + ).returns(T.nilable(T.anything)) + end + def dig(data, pick, &blk) end - def dig(data, pick, &blk); end end class << self # @api private sig { params(uri: URI::Generic).returns(String) } - def uri_origin(uri); end + def uri_origin(uri) + end # @api private sig { params(path: T.any(String, T::Array[String])).returns(String) } - def interpolate_path(path); end + def interpolate_path(path) + end end class << self # @api private - sig { params(query: T.nilable(String)).returns(T::Hash[String, T::Array[String]]) } - def decode_query(query); end + sig do + params(query: T.nilable(String)).returns( + T::Hash[String, T::Array[String]] + ) + end + def decode_query(query) + end # @api private sig do - params(query: T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))])) - .returns(T.nilable(String)) + params( + query: + T.nilable( + T::Hash[String, T.nilable(T.any(T::Array[String], String))] + ) + ).returns(T.nilable(String)) + end + def encode_query(query) end - def encode_query(query); end end - ParsedUriShape = + ParsedUri = T.type_alias do { scheme: T.nilable(String), @@ -119,31 +187,53 @@ module Knockapi class << self # @api private - sig { params(url: T.any(URI::Generic, String)).returns(Knockapi::Internal::Util::ParsedUriShape) } - def parse_uri(url); end + sig do + params(url: T.any(URI::Generic, String)).returns( + Knockapi::Internal::Util::ParsedUri + ) + end + def parse_uri(url) + end # @api private - sig { params(parsed: Knockapi::Internal::Util::ParsedUriShape).returns(URI::Generic) } - def unparse_uri(parsed); end + sig do + params(parsed: Knockapi::Internal::Util::ParsedUri).returns( + URI::Generic + ) + end + def unparse_uri(parsed) + end # @api private sig do - params(lhs: Knockapi::Internal::Util::ParsedUriShape, rhs: Knockapi::Internal::Util::ParsedUriShape) - .returns(URI::Generic) + params( + lhs: Knockapi::Internal::Util::ParsedUri, + rhs: Knockapi::Internal::Util::ParsedUri + ).returns(URI::Generic) + end + def join_parsed_uri(lhs, rhs) end - def join_parsed_uri(lhs, rhs); end end class << self # @api private sig do params( - headers: T::Hash[String, - T.nilable(T.any(String, Integer, T::Array[T.nilable(T.any(String, Integer))]))] - ) - .returns(T::Hash[String, String]) + headers: + T::Hash[ + String, + T.nilable( + T.any( + String, + Integer, + T::Array[T.nilable(T.any(String, Integer))] + ) + ) + ] + ).returns(T::Hash[String, String]) + end + def normalized_headers(*headers) end - def normalized_headers(*headers); end end # @api private @@ -152,38 +242,54 @@ module Knockapi class ReadIOAdapter # @api private sig { returns(T.nilable(T::Boolean)) } - def close?; end + def close? + end # @api private sig { void } - def close; end + def close + end # @api private sig { params(max_len: T.nilable(Integer)).returns(String) } - private def read_enum(max_len); end + private def read_enum(max_len) + end # @api private - sig { params(max_len: T.nilable(Integer), out_string: T.nilable(String)).returns(T.nilable(String)) } - def read(max_len = nil, out_string = nil); end + sig do + params( + max_len: T.nilable(Integer), + out_string: T.nilable(String) + ).returns(T.nilable(String)) + end + def read(max_len = nil, out_string = nil) + end # @api private sig do params( src: T.any(String, Pathname, StringIO, T::Enumerable[String]), blk: T.proc.params(arg0: String).void - ) - .returns(T.attached_class) + ).returns(T.attached_class) + end + def self.new(src, &blk) end - def self.new(src, &blk); end end class << self - sig { params(blk: T.proc.params(y: Enumerator::Yielder).void).returns(T::Enumerable[String]) } - def writable_enum(&blk); end + sig do + params(blk: T.proc.params(y: Enumerator::Yielder).void).returns( + T::Enumerable[String] + ) + end + def writable_enum(&blk) + end end - JSON_CONTENT = T.let(%r{^application/(?:vnd(?:\.[^.]+)*\+)?json(?!l)}, Regexp) - JSONL_CONTENT = T.let(%r{^application/(?:x-)?jsonl}, Regexp) + JSON_CONTENT = + T.let(%r{^application/(?:vnd(?:\.[^.]+)*\+)?json(?!l)}, Regexp) + JSONL_CONTENT = + T.let(%r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)}, Regexp) class << self # @api private @@ -193,10 +299,15 @@ module Knockapi val: T.anything, closing: T::Array[T.proc.void], content_type: T.nilable(String) - ) - .void + ).void + end + private def write_multipart_content( + y, + val:, + closing:, + content_type: nil + ) end - private def write_multipart_content(y, val:, closing:, content_type: nil); end # @api private sig do @@ -206,24 +317,33 @@ module Knockapi key: T.any(Symbol, String), val: T.anything, closing: T::Array[T.proc.void] - ) - .void + ).void + end + private def write_multipart_chunk(y, boundary:, key:, val:, closing:) end - private def write_multipart_chunk(y, boundary:, key:, val:, closing:); end # @api private - sig { params(body: T.anything).returns([String, T::Enumerable[String]]) } - private def encode_multipart_streaming(body); end + sig do + params(body: T.anything).returns([String, T::Enumerable[String]]) + end + private def encode_multipart_streaming(body) + end # @api private - sig { params(headers: T::Hash[String, String], body: T.anything).returns(T.anything) } - def encode_content(headers, body); end + sig do + params(headers: T::Hash[String, String], body: T.anything).returns( + T.anything + ) + end + def encode_content(headers, body) + end # @api private # # https://www.iana.org/assignments/character-sets/character-sets.xhtml sig { params(content_type: String, text: String).void } - def force_charset!(content_type, text:); end + def force_charset!(content_type, text:) + end # @api private # @@ -233,10 +353,10 @@ module Knockapi headers: T.any(T::Hash[String, String], Net::HTTPHeader), stream: T::Enumerable[String], suppress_error: T::Boolean - ) - .returns(T.anything) + ).returns(T.anything) + end + def decode_content(headers, stream:, suppress_error: false) end - def decode_content(headers, stream:, suppress_error: false); end end class << self @@ -244,24 +364,29 @@ module Knockapi # # https://doc.rust-lang.org/std/iter/trait.FusedIterator.html sig do - params(enum: T::Enumerable[T.anything], external: T::Boolean, close: T.proc.void) - .returns(T::Enumerable[T.anything]) + params( + enum: T::Enumerable[T.anything], + external: T::Boolean, + close: T.proc.void + ).returns(T::Enumerable[T.anything]) + end + def fused_enum(enum, external: false, &close) end - def fused_enum(enum, external: false, &close); end # @api private sig { params(enum: T.nilable(T::Enumerable[T.anything])).void } - def close_fused!(enum); end + def close_fused!(enum) + end # @api private sig do params( enum: T.nilable(T::Enumerable[T.anything]), blk: T.proc.params(arg0: Enumerator::Yielder).void - ) - .returns(T::Enumerable[T.anything]) + ).returns(T::Enumerable[T.anything]) + end + def chain_fused(enum, &blk) end - def chain_fused(enum, &blk); end end ServerSentEvent = @@ -281,8 +406,11 @@ module Knockapi # # This decoder is responsible for reassembling lines split across multiple # fragments. - sig { params(enum: T::Enumerable[String]).returns(T::Enumerable[String]) } - def decode_lines(enum); end + sig do + params(enum: T::Enumerable[String]).returns(T::Enumerable[String]) + end + def decode_lines(enum) + end # @api private # @@ -290,9 +418,33 @@ module Knockapi # # Assumes that `lines` has been decoded with `#decode_lines`. sig do - params(lines: T::Enumerable[String]).returns(T::Enumerable[Knockapi::Internal::Util::ServerSentEvent]) + params(lines: T::Enumerable[String]).returns( + T::Enumerable[Knockapi::Internal::Util::ServerSentEvent] + ) + end + def decode_sse(lines) + end + end + + # @api private + module SorbetRuntimeSupport + class MissingSorbetRuntimeError < ::RuntimeError + end + + # @api private + sig { returns(T::Hash[Symbol, T.anything]) } + private def sorbet_runtime_constants + end + + # @api private + sig { params(name: Symbol).void } + def const_missing(name) + end + + # @api private + sig { params(name: Symbol, blk: T.proc.returns(T.anything)).void } + def define_sorbet_constant!(name, &blk) end - def decode_sse(lines); end end end end diff --git a/rbi/knockapi/models.rbi b/rbi/knockapi/models.rbi new file mode 100644 index 00000000..c9ede6d0 --- /dev/null +++ b/rbi/knockapi/models.rbi @@ -0,0 +1,179 @@ +# typed: strong + +module Knockapi + Activity = Knockapi::Models::Activity + + AudienceAddMembersParams = Knockapi::Models::AudienceAddMembersParams + + AudienceListMembersParams = Knockapi::Models::AudienceListMembersParams + + AudienceMember = Knockapi::Models::AudienceMember + + AudienceRemoveMembersParams = Knockapi::Models::AudienceRemoveMembersParams + + BulkOperation = Knockapi::Models::BulkOperation + + BulkOperationGetParams = Knockapi::Models::BulkOperationGetParams + + Channels = Knockapi::Models::Channels + + Condition = Knockapi::Models::Condition + + IdentifyUserRequest = Knockapi::Models::IdentifyUserRequest + + InlineIdentifyUserRequest = Knockapi::Models::InlineIdentifyUserRequest + + InlineObjectRequest = Knockapi::Models::InlineObjectRequest + + InlineTenantRequest = Knockapi::Models::InlineTenantRequest + + Integrations = Knockapi::Models::Integrations + + Message = Knockapi::Models::Message + + MessageArchiveParams = Knockapi::Models::MessageArchiveParams + + MessageDeliveryLog = Knockapi::Models::MessageDeliveryLog + + MessageEvent = Knockapi::Models::MessageEvent + + MessageGetContentParams = Knockapi::Models::MessageGetContentParams + + MessageGetParams = Knockapi::Models::MessageGetParams + + MessageListActivitiesParams = Knockapi::Models::MessageListActivitiesParams + + MessageListDeliveryLogsParams = + Knockapi::Models::MessageListDeliveryLogsParams + + MessageListEventsParams = Knockapi::Models::MessageListEventsParams + + MessageListParams = Knockapi::Models::MessageListParams + + MessageMarkAsInteractedParams = + Knockapi::Models::MessageMarkAsInteractedParams + + MessageMarkAsReadParams = Knockapi::Models::MessageMarkAsReadParams + + MessageMarkAsSeenParams = Knockapi::Models::MessageMarkAsSeenParams + + MessageMarkAsUnreadParams = Knockapi::Models::MessageMarkAsUnreadParams + + MessageMarkAsUnseenParams = Knockapi::Models::MessageMarkAsUnseenParams + + Messages = Knockapi::Models::Messages + + MessageUnarchiveParams = Knockapi::Models::MessageUnarchiveParams + + Object = Knockapi::Models::Object + + ObjectAddSubscriptionsParams = Knockapi::Models::ObjectAddSubscriptionsParams + + ObjectDeleteParams = Knockapi::Models::ObjectDeleteParams + + ObjectDeleteSubscriptionsParams = + Knockapi::Models::ObjectDeleteSubscriptionsParams + + ObjectGetChannelDataParams = Knockapi::Models::ObjectGetChannelDataParams + + ObjectGetParams = Knockapi::Models::ObjectGetParams + + ObjectGetPreferencesParams = Knockapi::Models::ObjectGetPreferencesParams + + ObjectListMessagesParams = Knockapi::Models::ObjectListMessagesParams + + ObjectListParams = Knockapi::Models::ObjectListParams + + ObjectListPreferencesParams = Knockapi::Models::ObjectListPreferencesParams + + ObjectListSchedulesParams = Knockapi::Models::ObjectListSchedulesParams + + ObjectListSubscriptionsParams = + Knockapi::Models::ObjectListSubscriptionsParams + + Objects = Knockapi::Models::Objects + + ObjectSetChannelDataParams = Knockapi::Models::ObjectSetChannelDataParams + + ObjectSetParams = Knockapi::Models::ObjectSetParams + + ObjectSetPreferencesParams = Knockapi::Models::ObjectSetPreferencesParams + + ObjectUnsetChannelDataParams = Knockapi::Models::ObjectUnsetChannelDataParams + + PageInfo = Knockapi::Models::PageInfo + + Providers = Knockapi::Models::Providers + + Recipient = Knockapi::Models::Recipient + + RecipientReference = Knockapi::Models::RecipientReference + + RecipientRequest = Knockapi::Models::RecipientRequest + + Recipients = Knockapi::Models::Recipients + + Schedule = Knockapi::Models::Schedule + + ScheduleCreateParams = Knockapi::Models::ScheduleCreateParams + + ScheduleDeleteParams = Knockapi::Models::ScheduleDeleteParams + + ScheduleListParams = Knockapi::Models::ScheduleListParams + + ScheduleRepeatRule = Knockapi::Models::ScheduleRepeatRule + + Schedules = Knockapi::Models::Schedules + + ScheduleUpdateParams = Knockapi::Models::ScheduleUpdateParams + + Tenant = Knockapi::Models::Tenant + + TenantDeleteParams = Knockapi::Models::TenantDeleteParams + + TenantGetParams = Knockapi::Models::TenantGetParams + + TenantListParams = Knockapi::Models::TenantListParams + + TenantRequest = Knockapi::Models::TenantRequest + + Tenants = Knockapi::Models::Tenants + + TenantSetParams = Knockapi::Models::TenantSetParams + + User = Knockapi::Models::User + + UserDeleteParams = Knockapi::Models::UserDeleteParams + + UserGetChannelDataParams = Knockapi::Models::UserGetChannelDataParams + + UserGetParams = Knockapi::Models::UserGetParams + + UserGetPreferencesParams = Knockapi::Models::UserGetPreferencesParams + + UserListMessagesParams = Knockapi::Models::UserListMessagesParams + + UserListParams = Knockapi::Models::UserListParams + + UserListPreferencesParams = Knockapi::Models::UserListPreferencesParams + + UserListSchedulesParams = Knockapi::Models::UserListSchedulesParams + + UserListSubscriptionsParams = Knockapi::Models::UserListSubscriptionsParams + + UserMergeParams = Knockapi::Models::UserMergeParams + + Users = Knockapi::Models::Users + + UserSetChannelDataParams = Knockapi::Models::UserSetChannelDataParams + + UserSetPreferencesParams = Knockapi::Models::UserSetPreferencesParams + + UserUnsetChannelDataParams = Knockapi::Models::UserUnsetChannelDataParams + + UserUpdateParams = Knockapi::Models::UserUpdateParams + + WorkflowCancelParams = Knockapi::Models::WorkflowCancelParams + + WorkflowTriggerParams = Knockapi::Models::WorkflowTriggerParams +end diff --git a/rbi/knockapi/models/activity.rbi b/rbi/knockapi/models/activity.rbi index fd88dbfe..8d68045d 100644 --- a/rbi/knockapi/models/activity.rbi +++ b/rbi/knockapi/models/activity.rbi @@ -3,6 +3,9 @@ module Knockapi module Models class Activity < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Knockapi::Activity, Knockapi::Internal::AnyHash) } + # Unique identifier for the activity. sig { returns(T.nilable(String)) } attr_reader :id @@ -18,7 +21,7 @@ module Knockapi attr_writer :_typename # A recipient of a notification, which is either a user or an object. - sig { returns(T.nilable(T.any(Knockapi::Models::User, Knockapi::Models::Object))) } + sig { returns(T.nilable(T.any(Knockapi::User, Knockapi::Object))) } attr_accessor :actor # The workflow trigger `data` payload associated with the activity. @@ -33,12 +36,13 @@ module Knockapi attr_writer :inserted_at # A recipient of a notification, which is either a user or an object. - sig { returns(T.nilable(T.any(Knockapi::Models::User, Knockapi::Models::Object))) } + sig { returns(T.nilable(T.any(Knockapi::User, Knockapi::Object))) } attr_reader :recipient sig do - params(recipient: T.any(Knockapi::Models::User, Knockapi::Internal::AnyHash, Knockapi::Models::Object)) - .void + params( + recipient: T.any(Knockapi::User::OrHash, Knockapi::Object::OrHash) + ).void end attr_writer :recipient @@ -57,13 +61,13 @@ module Knockapi params( id: String, _typename: String, - actor: T.nilable(T.any(Knockapi::Models::User, Knockapi::Internal::AnyHash, Knockapi::Models::Object)), + actor: + T.nilable(T.any(Knockapi::User::OrHash, Knockapi::Object::OrHash)), data: T.nilable(T::Hash[Symbol, T.anything]), inserted_at: Time, - recipient: T.any(Knockapi::Models::User, Knockapi::Internal::AnyHash, Knockapi::Models::Object), + recipient: T.any(Knockapi::User::OrHash, Knockapi::Object::OrHash), updated_at: Time - ) - .returns(T.attached_class) + ).returns(T.attached_class) end def self.new( # Unique identifier for the activity. @@ -80,22 +84,24 @@ module Knockapi recipient: nil, # Timestamp when the activity was last updated. updated_at: nil - ); end + ) + end + sig do - override - .returns( - { - id: String, - _typename: String, - actor: T.nilable(T.any(Knockapi::Models::User, Knockapi::Models::Object)), - data: T.nilable(T::Hash[Symbol, T.anything]), - inserted_at: Time, - recipient: T.any(Knockapi::Models::User, Knockapi::Models::Object), - updated_at: Time - } - ) + override.returns( + { + id: String, + _typename: String, + actor: T.nilable(T.any(Knockapi::User, Knockapi::Object)), + data: T.nilable(T::Hash[Symbol, T.anything]), + inserted_at: Time, + recipient: T.any(Knockapi::User, Knockapi::Object), + updated_at: Time + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/audience_add_members_params.rbi b/rbi/knockapi/models/audience_add_members_params.rbi index aee3219e..9b4238b3 100644 --- a/rbi/knockapi/models/audience_add_members_params.rbi +++ b/rbi/knockapi/models/audience_add_members_params.rbi @@ -6,40 +6,56 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any(Knockapi::AudienceAddMembersParams, Knockapi::Internal::AnyHash) + end + # A list of audience members to add. - sig { returns(T::Array[Knockapi::Models::AudienceAddMembersParams::Member]) } + sig { returns(T::Array[Knockapi::AudienceAddMembersParams::Member]) } attr_accessor :members sig do params( - members: T::Array[T.any(Knockapi::Models::AudienceAddMembersParams::Member, Knockapi::Internal::AnyHash)], - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + members: T::Array[Knockapi::AudienceAddMembersParams::Member::OrHash], + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # A list of audience members to add. members:, request_options: {} - ); end + ) + end + sig do - override - .returns( - { - members: T::Array[Knockapi::Models::AudienceAddMembersParams::Member], - request_options: Knockapi::RequestOptions - } - ) + override.returns( + { + members: T::Array[Knockapi::AudienceAddMembersParams::Member], + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end class Member < Knockapi::Internal::Type::BaseModel - sig { returns(Knockapi::Models::AudienceAddMembersParams::Member::User) } + OrHash = + T.type_alias do + T.any( + Knockapi::AudienceAddMembersParams::Member, + Knockapi::Internal::AnyHash + ) + end + + # An object containing the user's ID. + sig { returns(Knockapi::AudienceAddMembersParams::Member::User) } attr_reader :user sig do - params(user: T.any(Knockapi::Models::AudienceAddMembersParams::Member::User, Knockapi::Internal::AnyHash)) - .void + params( + user: Knockapi::AudienceAddMembersParams::Member::User::OrHash + ).void end attr_writer :user @@ -50,23 +66,38 @@ module Knockapi # An audience member. sig do params( - user: T.any(Knockapi::Models::AudienceAddMembersParams::Member::User, Knockapi::Internal::AnyHash), + user: Knockapi::AudienceAddMembersParams::Member::User::OrHash, tenant: T.nilable(String) - ) - .returns(T.attached_class) + ).returns(T.attached_class) end def self.new( + # An object containing the user's ID. user:, # The unique identifier for the tenant. tenant: nil - ); end + ) + end + sig do - override - .returns({user: Knockapi::Models::AudienceAddMembersParams::Member::User, tenant: T.nilable(String)}) + override.returns( + { + user: Knockapi::AudienceAddMembersParams::Member::User, + tenant: T.nilable(String) + } + ) + end + def to_hash end - def to_hash; end class User < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::AudienceAddMembersParams::Member::User, + Knockapi::Internal::AnyHash + ) + end + # The ID for the user that you set when identifying them in Knock. sig { returns(T.nilable(String)) } attr_reader :id @@ -74,13 +105,17 @@ module Knockapi sig { params(id: String).void } attr_writer :id + # An object containing the user's ID. sig { params(id: String).returns(T.attached_class) } def self.new( # The ID for the user that you set when identifying them in Knock. id: nil - ); end - sig { override.returns({id: String}) } - def to_hash; end + ) + end + + sig { override.returns({ id: String }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/audience_add_members_response.rbi b/rbi/knockapi/models/audience_add_members_response.rbi new file mode 100644 index 00000000..5f9b7f6e --- /dev/null +++ b/rbi/knockapi/models/audience_add_members_response.rbi @@ -0,0 +1,7 @@ +# typed: strong + +module Knockapi + module Models + AudienceAddMembersResponse = String + end +end diff --git a/rbi/knockapi/models/audience_list_members_params.rbi b/rbi/knockapi/models/audience_list_members_params.rbi index a2cd2876..0dd524ab 100644 --- a/rbi/knockapi/models/audience_list_members_params.rbi +++ b/rbi/knockapi/models/audience_list_members_params.rbi @@ -6,14 +6,25 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::AudienceListMembersParams, + Knockapi::Internal::AnyHash + ) + end + sig do - params(request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash)) - .returns(T.attached_class) + params(request_options: Knockapi::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) end - def self.new(request_options: {}); end - sig { override.returns({request_options: Knockapi::RequestOptions}) } - def to_hash; end + sig { override.returns({ request_options: Knockapi::RequestOptions }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/audience_list_members_response.rbi b/rbi/knockapi/models/audience_list_members_response.rbi index c5b7a79e..fda76dac 100644 --- a/rbi/knockapi/models/audience_list_members_response.rbi +++ b/rbi/knockapi/models/audience_list_members_response.rbi @@ -3,36 +3,50 @@ module Knockapi module Models class AudienceListMembersResponse < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::AudienceListMembersResponse, + Knockapi::Internal::AnyHash + ) + end + # A list of audience members. - sig { returns(T::Array[Knockapi::Models::AudienceMember]) } + sig { returns(T::Array[Knockapi::AudienceMember]) } attr_accessor :entries # Pagination information for a list of resources. - sig { returns(Knockapi::Models::PageInfo) } + sig { returns(Knockapi::PageInfo) } attr_reader :page_info - sig { params(page_info: T.any(Knockapi::Models::PageInfo, Knockapi::Internal::AnyHash)).void } + sig { params(page_info: Knockapi::PageInfo::OrHash).void } attr_writer :page_info # A paginated list of audience members. sig do params( - entries: T::Array[T.any(Knockapi::Models::AudienceMember, Knockapi::Internal::AnyHash)], - page_info: T.any(Knockapi::Models::PageInfo, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + entries: T::Array[Knockapi::AudienceMember::OrHash], + page_info: Knockapi::PageInfo::OrHash + ).returns(T.attached_class) end def self.new( # A list of audience members. entries:, # Pagination information for a list of resources. page_info: - ); end + ) + end + sig do - override - .returns({entries: T::Array[Knockapi::Models::AudienceMember], page_info: Knockapi::Models::PageInfo}) + override.returns( + { + entries: T::Array[Knockapi::AudienceMember], + page_info: Knockapi::PageInfo + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/audience_member.rbi b/rbi/knockapi/models/audience_member.rbi index 3ca2b6a5..3d09f5f3 100644 --- a/rbi/knockapi/models/audience_member.rbi +++ b/rbi/knockapi/models/audience_member.rbi @@ -3,6 +3,11 @@ module Knockapi module Models class AudienceMember < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Knockapi::AudienceMember, Knockapi::Internal::AnyHash) + end + # The typename of the schema. sig { returns(String) } attr_accessor :_typename @@ -14,10 +19,10 @@ module Knockapi # A [User](/concepts/users) represents an individual in your system who can # receive notifications through Knock. Users are the most common recipients of # notifications and are always referenced by your internal identifier. - sig { returns(Knockapi::Models::User) } + sig { returns(Knockapi::User) } attr_reader :user - sig { params(user: T.any(Knockapi::Models::User, Knockapi::Internal::AnyHash)).void } + sig { params(user: Knockapi::User::OrHash).void } attr_writer :user # The ID for the user that you set when identifying them in Knock. @@ -33,11 +38,10 @@ module Knockapi params( _typename: String, added_at: Time, - user: T.any(Knockapi::Models::User, Knockapi::Internal::AnyHash), + user: Knockapi::User::OrHash, user_id: String, tenant: T.nilable(String) - ) - .returns(T.attached_class) + ).returns(T.attached_class) end def self.new( # The typename of the schema. @@ -52,14 +56,22 @@ module Knockapi user_id:, # The unique identifier for the tenant. tenant: nil - ); end + ) + end + sig do - override - .returns( - {_typename: String, added_at: Time, user: Knockapi::Models::User, user_id: String, tenant: T.nilable(String)} - ) + override.returns( + { + _typename: String, + added_at: Time, + user: Knockapi::User, + user_id: String, + tenant: T.nilable(String) + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/audience_remove_members_params.rbi b/rbi/knockapi/models/audience_remove_members_params.rbi index 0ccc3eea..cc7f5a78 100644 --- a/rbi/knockapi/models/audience_remove_members_params.rbi +++ b/rbi/knockapi/models/audience_remove_members_params.rbi @@ -6,42 +6,60 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::AudienceRemoveMembersParams, + Knockapi::Internal::AnyHash + ) + end + # A list of audience members to remove. - sig { returns(T::Array[Knockapi::Models::AudienceRemoveMembersParams::Member]) } + sig { returns(T::Array[Knockapi::AudienceRemoveMembersParams::Member]) } attr_accessor :members sig do params( - members: T::Array[T.any(Knockapi::Models::AudienceRemoveMembersParams::Member, Knockapi::Internal::AnyHash)], - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + members: + T::Array[Knockapi::AudienceRemoveMembersParams::Member::OrHash], + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # A list of audience members to remove. members:, request_options: {} - ); end + ) + end + sig do - override - .returns( - { - members: T::Array[Knockapi::Models::AudienceRemoveMembersParams::Member], - request_options: Knockapi::RequestOptions - } - ) + override.returns( + { + members: T::Array[Knockapi::AudienceRemoveMembersParams::Member], + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end class Member < Knockapi::Internal::Type::BaseModel - sig { returns(Knockapi::Models::AudienceRemoveMembersParams::Member::User) } + OrHash = + T.type_alias do + T.any( + Knockapi::AudienceRemoveMembersParams::Member, + Knockapi::Internal::AnyHash + ) + end + + # An object containing the user's ID. + sig { returns(Knockapi::AudienceRemoveMembersParams::Member::User) } attr_reader :user sig do params( - user: T.any(Knockapi::Models::AudienceRemoveMembersParams::Member::User, Knockapi::Internal::AnyHash) - ) - .void + user: Knockapi::AudienceRemoveMembersParams::Member::User::OrHash + ).void end attr_writer :user @@ -52,23 +70,38 @@ module Knockapi # An audience member. sig do params( - user: T.any(Knockapi::Models::AudienceRemoveMembersParams::Member::User, Knockapi::Internal::AnyHash), + user: Knockapi::AudienceRemoveMembersParams::Member::User::OrHash, tenant: T.nilable(String) - ) - .returns(T.attached_class) + ).returns(T.attached_class) end def self.new( + # An object containing the user's ID. user:, # The unique identifier for the tenant. tenant: nil - ); end + ) + end + sig do - override - .returns({user: Knockapi::Models::AudienceRemoveMembersParams::Member::User, tenant: T.nilable(String)}) + override.returns( + { + user: Knockapi::AudienceRemoveMembersParams::Member::User, + tenant: T.nilable(String) + } + ) + end + def to_hash end - def to_hash; end class User < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::AudienceRemoveMembersParams::Member::User, + Knockapi::Internal::AnyHash + ) + end + # The ID for the user that you set when identifying them in Knock. sig { returns(T.nilable(String)) } attr_reader :id @@ -76,13 +109,17 @@ module Knockapi sig { params(id: String).void } attr_writer :id + # An object containing the user's ID. sig { params(id: String).returns(T.attached_class) } def self.new( # The ID for the user that you set when identifying them in Knock. id: nil - ); end - sig { override.returns({id: String}) } - def to_hash; end + ) + end + + sig { override.returns({ id: String }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/audience_remove_members_response.rbi b/rbi/knockapi/models/audience_remove_members_response.rbi new file mode 100644 index 00000000..d53d6fc0 --- /dev/null +++ b/rbi/knockapi/models/audience_remove_members_response.rbi @@ -0,0 +1,7 @@ +# typed: strong + +module Knockapi + module Models + AudienceRemoveMembersResponse = String + end +end diff --git a/rbi/knockapi/models/bulk_operation.rbi b/rbi/knockapi/models/bulk_operation.rbi index 244e9aa9..3b95feb5 100644 --- a/rbi/knockapi/models/bulk_operation.rbi +++ b/rbi/knockapi/models/bulk_operation.rbi @@ -3,6 +3,11 @@ module Knockapi module Models class BulkOperation < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Knockapi::BulkOperation, Knockapi::Internal::AnyHash) + end + # Unique identifier for the bulk operation. sig { returns(String) } attr_accessor :id @@ -28,7 +33,7 @@ module Knockapi attr_accessor :processed_rows # The status of the bulk operation. - sig { returns(Knockapi::Models::BulkOperation::Status::TaggedSymbol) } + sig { returns(Knockapi::BulkOperation::Status::TaggedSymbol) } attr_accessor :status # The number of successful operations. @@ -51,14 +56,13 @@ module Knockapi attr_writer :error_count # A list of items that failed to be processed. - sig { returns(T.nilable(T::Array[Knockapi::Models::BulkOperation::ErrorItem])) } + sig { returns(T.nilable(T::Array[Knockapi::BulkOperation::ErrorItem])) } attr_reader :error_items sig do params( - error_items: T::Array[T.any(Knockapi::Models::BulkOperation::ErrorItem, Knockapi::Internal::AnyHash)] - ) - .void + error_items: T::Array[Knockapi::BulkOperation::ErrorItem::OrHash] + ).void end attr_writer :error_items @@ -86,17 +90,16 @@ module Knockapi inserted_at: Time, name: String, processed_rows: Integer, - status: Knockapi::Models::BulkOperation::Status::OrSymbol, + status: Knockapi::BulkOperation::Status::OrSymbol, success_count: Integer, updated_at: Time, completed_at: T.nilable(Time), error_count: Integer, - error_items: T::Array[T.any(Knockapi::Models::BulkOperation::ErrorItem, Knockapi::Internal::AnyHash)], + error_items: T::Array[Knockapi::BulkOperation::ErrorItem::OrHash], failed_at: T.nilable(Time), progress_path: String, started_at: T.nilable(Time) - ) - .returns(T.attached_class) + ).returns(T.attached_class) end def self.new( # Unique identifier for the bulk operation. @@ -129,48 +132,66 @@ module Knockapi progress_path: nil, # Timestamp when the bulk operation was started. started_at: nil - ); end + ) + end + sig do - override - .returns( - { - id: String, - _typename: String, - estimated_total_rows: Integer, - inserted_at: Time, - name: String, - processed_rows: Integer, - status: Knockapi::Models::BulkOperation::Status::TaggedSymbol, - success_count: Integer, - updated_at: Time, - completed_at: T.nilable(Time), - error_count: Integer, - error_items: T::Array[Knockapi::Models::BulkOperation::ErrorItem], - failed_at: T.nilable(Time), - progress_path: String, - started_at: T.nilable(Time) - } - ) + override.returns( + { + id: String, + _typename: String, + estimated_total_rows: Integer, + inserted_at: Time, + name: String, + processed_rows: Integer, + status: Knockapi::BulkOperation::Status::TaggedSymbol, + success_count: Integer, + updated_at: Time, + completed_at: T.nilable(Time), + error_count: Integer, + error_items: T::Array[Knockapi::BulkOperation::ErrorItem], + failed_at: T.nilable(Time), + progress_path: String, + started_at: T.nilable(Time) + } + ) + end + def to_hash end - def to_hash; end # The status of the bulk operation. module Status extend Knockapi::Internal::Type::Enum - TaggedSymbol = T.type_alias { T.all(Symbol, Knockapi::Models::BulkOperation::Status) } + TaggedSymbol = + T.type_alias { T.all(Symbol, Knockapi::BulkOperation::Status) } OrSymbol = T.type_alias { T.any(Symbol, String) } - QUEUED = T.let(:queued, Knockapi::Models::BulkOperation::Status::TaggedSymbol) - PROCESSING = T.let(:processing, Knockapi::Models::BulkOperation::Status::TaggedSymbol) - COMPLETED = T.let(:completed, Knockapi::Models::BulkOperation::Status::TaggedSymbol) - FAILED = T.let(:failed, Knockapi::Models::BulkOperation::Status::TaggedSymbol) + QUEUED = T.let(:queued, Knockapi::BulkOperation::Status::TaggedSymbol) + PROCESSING = + T.let(:processing, Knockapi::BulkOperation::Status::TaggedSymbol) + COMPLETED = + T.let(:completed, Knockapi::BulkOperation::Status::TaggedSymbol) + FAILED = T.let(:failed, Knockapi::BulkOperation::Status::TaggedSymbol) - sig { override.returns(T::Array[Knockapi::Models::BulkOperation::Status::TaggedSymbol]) } - def self.values; end + sig do + override.returns( + T::Array[Knockapi::BulkOperation::Status::TaggedSymbol] + ) + end + def self.values + end end class ErrorItem < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::BulkOperation::ErrorItem, + Knockapi::Internal::AnyHash + ) + end + # Unique identifier for the object. sig { returns(String) } attr_accessor :id @@ -179,15 +200,22 @@ module Knockapi sig { returns(T.nilable(String)) } attr_accessor :collection - sig { params(id: String, collection: T.nilable(String)).returns(T.attached_class) } + sig do + params(id: String, collection: T.nilable(String)).returns( + T.attached_class + ) + end def self.new( # Unique identifier for the object. id:, # The collection this object belongs to. collection: nil - ); end - sig { override.returns({id: String, collection: T.nilable(String)}) } - def to_hash; end + ) + end + + sig { override.returns({ id: String, collection: T.nilable(String) }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/bulk_operation_get_params.rbi b/rbi/knockapi/models/bulk_operation_get_params.rbi index 164ee1de..1152298a 100644 --- a/rbi/knockapi/models/bulk_operation_get_params.rbi +++ b/rbi/knockapi/models/bulk_operation_get_params.rbi @@ -6,14 +6,22 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any(Knockapi::BulkOperationGetParams, Knockapi::Internal::AnyHash) + end + sig do - params(request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash)) - .returns(T.attached_class) + params(request_options: Knockapi::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) end - def self.new(request_options: {}); end - sig { override.returns({request_options: Knockapi::RequestOptions}) } - def to_hash; end + sig { override.returns({ request_options: Knockapi::RequestOptions }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/channels/bulk_update_message_status_params.rbi b/rbi/knockapi/models/channels/bulk_update_message_status_params.rbi index 372218c1..3cf435d4 100644 --- a/rbi/knockapi/models/channels/bulk_update_message_status_params.rbi +++ b/rbi/knockapi/models/channels/bulk_update_message_status_params.rbi @@ -7,34 +7,65 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::Channels::BulkUpdateMessageStatusParams, + Knockapi::Internal::AnyHash + ) + end + # Limits the results to messages with the given archived status. - sig { returns(T.nilable(Knockapi::Models::Channels::BulkUpdateMessageStatusParams::Archived::OrSymbol)) } + sig do + returns( + T.nilable( + Knockapi::Channels::BulkUpdateMessageStatusParams::Archived::OrSymbol + ) + ) + end attr_reader :archived - sig { params(archived: Knockapi::Models::Channels::BulkUpdateMessageStatusParams::Archived::OrSymbol).void } + sig do + params( + archived: + Knockapi::Channels::BulkUpdateMessageStatusParams::Archived::OrSymbol + ).void + end attr_writer :archived # Limits the results to messages with the given delivery status. - sig { returns(T.nilable(Knockapi::Models::Channels::BulkUpdateMessageStatusParams::DeliveryStatus::OrSymbol)) } + sig do + returns( + T.nilable( + Knockapi::Channels::BulkUpdateMessageStatusParams::DeliveryStatus::OrSymbol + ) + ) + end attr_reader :delivery_status sig do params( - delivery_status: Knockapi::Models::Channels::BulkUpdateMessageStatusParams::DeliveryStatus::OrSymbol - ) - .void + delivery_status: + Knockapi::Channels::BulkUpdateMessageStatusParams::DeliveryStatus::OrSymbol + ).void end attr_writer :delivery_status # Limits the results to messages with the given engagement status. - sig { returns(T.nilable(Knockapi::Models::Channels::BulkUpdateMessageStatusParams::EngagementStatus::OrSymbol)) } + sig do + returns( + T.nilable( + Knockapi::Channels::BulkUpdateMessageStatusParams::EngagementStatus::OrSymbol + ) + ) + end attr_reader :engagement_status sig do params( - engagement_status: Knockapi::Models::Channels::BulkUpdateMessageStatusParams::EngagementStatus::OrSymbol - ) - .void + engagement_status: + Knockapi::Channels::BulkUpdateMessageStatusParams::EngagementStatus::OrSymbol + ).void end attr_writer :engagement_status @@ -91,9 +122,12 @@ module Knockapi sig do params( - archived: Knockapi::Models::Channels::BulkUpdateMessageStatusParams::Archived::OrSymbol, - delivery_status: Knockapi::Models::Channels::BulkUpdateMessageStatusParams::DeliveryStatus::OrSymbol, - engagement_status: Knockapi::Models::Channels::BulkUpdateMessageStatusParams::EngagementStatus::OrSymbol, + archived: + Knockapi::Channels::BulkUpdateMessageStatusParams::Archived::OrSymbol, + delivery_status: + Knockapi::Channels::BulkUpdateMessageStatusParams::DeliveryStatus::OrSymbol, + engagement_status: + Knockapi::Channels::BulkUpdateMessageStatusParams::EngagementStatus::OrSymbol, has_tenant: T::Boolean, newer_than: Time, older_than: Time, @@ -101,9 +135,8 @@ module Knockapi tenants: T::Array[String], trigger_data: String, workflows: T::Array[String], - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # Limits the results to messages with the given archived status. @@ -129,54 +162,104 @@ module Knockapi # Limits the results to messages with the given workflow keys. workflows: nil, request_options: {} - ); end + ) + end + sig do - override - .returns( - { - archived: Knockapi::Models::Channels::BulkUpdateMessageStatusParams::Archived::OrSymbol, - delivery_status: Knockapi::Models::Channels::BulkUpdateMessageStatusParams::DeliveryStatus::OrSymbol, - engagement_status: Knockapi::Models::Channels::BulkUpdateMessageStatusParams::EngagementStatus::OrSymbol, - has_tenant: T::Boolean, - newer_than: Time, - older_than: Time, - recipient_ids: T::Array[String], - tenants: T::Array[String], - trigger_data: String, - workflows: T::Array[String], - request_options: Knockapi::RequestOptions - } - ) + override.returns( + { + archived: + Knockapi::Channels::BulkUpdateMessageStatusParams::Archived::OrSymbol, + delivery_status: + Knockapi::Channels::BulkUpdateMessageStatusParams::DeliveryStatus::OrSymbol, + engagement_status: + Knockapi::Channels::BulkUpdateMessageStatusParams::EngagementStatus::OrSymbol, + has_tenant: T::Boolean, + newer_than: Time, + older_than: Time, + recipient_ids: T::Array[String], + tenants: T::Array[String], + trigger_data: String, + workflows: T::Array[String], + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end module Action extend Knockapi::Internal::Type::Enum TaggedSymbol = - T.type_alias { T.all(Symbol, Knockapi::Models::Channels::BulkUpdateMessageStatusParams::Action) } + T.type_alias do + T.all( + Symbol, + Knockapi::Channels::BulkUpdateMessageStatusParams::Action + ) + end OrSymbol = T.type_alias { T.any(Symbol, String) } - SEEN = T.let(:seen, Knockapi::Models::Channels::BulkUpdateMessageStatusParams::Action::TaggedSymbol) - UNSEEN = T.let(:unseen, Knockapi::Models::Channels::BulkUpdateMessageStatusParams::Action::TaggedSymbol) - READ = T.let(:read, Knockapi::Models::Channels::BulkUpdateMessageStatusParams::Action::TaggedSymbol) - UNREAD = T.let(:unread, Knockapi::Models::Channels::BulkUpdateMessageStatusParams::Action::TaggedSymbol) + SEEN = + T.let( + :seen, + Knockapi::Channels::BulkUpdateMessageStatusParams::Action::TaggedSymbol + ) + UNSEEN = + T.let( + :unseen, + Knockapi::Channels::BulkUpdateMessageStatusParams::Action::TaggedSymbol + ) + READ = + T.let( + :read, + Knockapi::Channels::BulkUpdateMessageStatusParams::Action::TaggedSymbol + ) + UNREAD = + T.let( + :unread, + Knockapi::Channels::BulkUpdateMessageStatusParams::Action::TaggedSymbol + ) ARCHIVED = - T.let(:archived, Knockapi::Models::Channels::BulkUpdateMessageStatusParams::Action::TaggedSymbol) + T.let( + :archived, + Knockapi::Channels::BulkUpdateMessageStatusParams::Action::TaggedSymbol + ) UNARCHIVED = - T.let(:unarchived, Knockapi::Models::Channels::BulkUpdateMessageStatusParams::Action::TaggedSymbol) + T.let( + :unarchived, + Knockapi::Channels::BulkUpdateMessageStatusParams::Action::TaggedSymbol + ) INTERACTED = - T.let(:interacted, Knockapi::Models::Channels::BulkUpdateMessageStatusParams::Action::TaggedSymbol) + T.let( + :interacted, + Knockapi::Channels::BulkUpdateMessageStatusParams::Action::TaggedSymbol + ) ARCHIVE = - T.let(:archive, Knockapi::Models::Channels::BulkUpdateMessageStatusParams::Action::TaggedSymbol) + T.let( + :archive, + Knockapi::Channels::BulkUpdateMessageStatusParams::Action::TaggedSymbol + ) UNARCHIVE = - T.let(:unarchive, Knockapi::Models::Channels::BulkUpdateMessageStatusParams::Action::TaggedSymbol) - DELETE = T.let(:delete, Knockapi::Models::Channels::BulkUpdateMessageStatusParams::Action::TaggedSymbol) + T.let( + :unarchive, + Knockapi::Channels::BulkUpdateMessageStatusParams::Action::TaggedSymbol + ) + DELETE = + T.let( + :delete, + Knockapi::Channels::BulkUpdateMessageStatusParams::Action::TaggedSymbol + ) sig do - override.returns(T::Array[Knockapi::Models::Channels::BulkUpdateMessageStatusParams::Action::TaggedSymbol]) + override.returns( + T::Array[ + Knockapi::Channels::BulkUpdateMessageStatusParams::Action::TaggedSymbol + ] + ) + end + def self.values end - def self.values; end end # Limits the results to messages with the given archived status. @@ -184,20 +267,39 @@ module Knockapi extend Knockapi::Internal::Type::Enum TaggedSymbol = - T.type_alias { T.all(Symbol, Knockapi::Models::Channels::BulkUpdateMessageStatusParams::Archived) } + T.type_alias do + T.all( + Symbol, + Knockapi::Channels::BulkUpdateMessageStatusParams::Archived + ) + end OrSymbol = T.type_alias { T.any(Symbol, String) } EXCLUDE = - T.let(:exclude, Knockapi::Models::Channels::BulkUpdateMessageStatusParams::Archived::TaggedSymbol) + T.let( + :exclude, + Knockapi::Channels::BulkUpdateMessageStatusParams::Archived::TaggedSymbol + ) INCLUDE = - T.let(:include, Knockapi::Models::Channels::BulkUpdateMessageStatusParams::Archived::TaggedSymbol) - ONLY = T.let(:only, Knockapi::Models::Channels::BulkUpdateMessageStatusParams::Archived::TaggedSymbol) + T.let( + :include, + Knockapi::Channels::BulkUpdateMessageStatusParams::Archived::TaggedSymbol + ) + ONLY = + T.let( + :only, + Knockapi::Channels::BulkUpdateMessageStatusParams::Archived::TaggedSymbol + ) sig do - override - .returns(T::Array[Knockapi::Models::Channels::BulkUpdateMessageStatusParams::Archived::TaggedSymbol]) + override.returns( + T::Array[ + Knockapi::Channels::BulkUpdateMessageStatusParams::Archived::TaggedSymbol + ] + ) + end + def self.values end - def self.values; end end # Limits the results to messages with the given delivery status. @@ -205,35 +307,59 @@ module Knockapi extend Knockapi::Internal::Type::Enum TaggedSymbol = - T.type_alias { T.all(Symbol, Knockapi::Models::Channels::BulkUpdateMessageStatusParams::DeliveryStatus) } + T.type_alias do + T.all( + Symbol, + Knockapi::Channels::BulkUpdateMessageStatusParams::DeliveryStatus + ) + end OrSymbol = T.type_alias { T.any(Symbol, String) } QUEUED = - T.let(:queued, Knockapi::Models::Channels::BulkUpdateMessageStatusParams::DeliveryStatus::TaggedSymbol) + T.let( + :queued, + Knockapi::Channels::BulkUpdateMessageStatusParams::DeliveryStatus::TaggedSymbol + ) SENT = - T.let(:sent, Knockapi::Models::Channels::BulkUpdateMessageStatusParams::DeliveryStatus::TaggedSymbol) + T.let( + :sent, + Knockapi::Channels::BulkUpdateMessageStatusParams::DeliveryStatus::TaggedSymbol + ) DELIVERED = - T.let(:delivered, Knockapi::Models::Channels::BulkUpdateMessageStatusParams::DeliveryStatus::TaggedSymbol) + T.let( + :delivered, + Knockapi::Channels::BulkUpdateMessageStatusParams::DeliveryStatus::TaggedSymbol + ) DELIVERY_ATTEMPTED = T.let( :delivery_attempted, - Knockapi::Models::Channels::BulkUpdateMessageStatusParams::DeliveryStatus::TaggedSymbol + Knockapi::Channels::BulkUpdateMessageStatusParams::DeliveryStatus::TaggedSymbol ) UNDELIVERED = T.let( :undelivered, - Knockapi::Models::Channels::BulkUpdateMessageStatusParams::DeliveryStatus::TaggedSymbol + Knockapi::Channels::BulkUpdateMessageStatusParams::DeliveryStatus::TaggedSymbol ) NOT_SENT = - T.let(:not_sent, Knockapi::Models::Channels::BulkUpdateMessageStatusParams::DeliveryStatus::TaggedSymbol) + T.let( + :not_sent, + Knockapi::Channels::BulkUpdateMessageStatusParams::DeliveryStatus::TaggedSymbol + ) BOUNCED = - T.let(:bounced, Knockapi::Models::Channels::BulkUpdateMessageStatusParams::DeliveryStatus::TaggedSymbol) + T.let( + :bounced, + Knockapi::Channels::BulkUpdateMessageStatusParams::DeliveryStatus::TaggedSymbol + ) sig do - override - .returns(T::Array[Knockapi::Models::Channels::BulkUpdateMessageStatusParams::DeliveryStatus::TaggedSymbol]) + override.returns( + T::Array[ + Knockapi::Channels::BulkUpdateMessageStatusParams::DeliveryStatus::TaggedSymbol + ] + ) + end + def self.values end - def self.values; end end # Limits the results to messages with the given engagement status. @@ -241,45 +367,64 @@ module Knockapi extend Knockapi::Internal::Type::Enum TaggedSymbol = - T.type_alias { T.all(Symbol, Knockapi::Models::Channels::BulkUpdateMessageStatusParams::EngagementStatus) } + T.type_alias do + T.all( + Symbol, + Knockapi::Channels::BulkUpdateMessageStatusParams::EngagementStatus + ) + end OrSymbol = T.type_alias { T.any(Symbol, String) } SEEN = - T.let(:seen, Knockapi::Models::Channels::BulkUpdateMessageStatusParams::EngagementStatus::TaggedSymbol) + T.let( + :seen, + Knockapi::Channels::BulkUpdateMessageStatusParams::EngagementStatus::TaggedSymbol + ) UNSEEN = - T.let(:unseen, Knockapi::Models::Channels::BulkUpdateMessageStatusParams::EngagementStatus::TaggedSymbol) + T.let( + :unseen, + Knockapi::Channels::BulkUpdateMessageStatusParams::EngagementStatus::TaggedSymbol + ) READ = - T.let(:read, Knockapi::Models::Channels::BulkUpdateMessageStatusParams::EngagementStatus::TaggedSymbol) + T.let( + :read, + Knockapi::Channels::BulkUpdateMessageStatusParams::EngagementStatus::TaggedSymbol + ) UNREAD = - T.let(:unread, Knockapi::Models::Channels::BulkUpdateMessageStatusParams::EngagementStatus::TaggedSymbol) + T.let( + :unread, + Knockapi::Channels::BulkUpdateMessageStatusParams::EngagementStatus::TaggedSymbol + ) ARCHIVED = T.let( :archived, - Knockapi::Models::Channels::BulkUpdateMessageStatusParams::EngagementStatus::TaggedSymbol + Knockapi::Channels::BulkUpdateMessageStatusParams::EngagementStatus::TaggedSymbol ) UNARCHIVED = T.let( :unarchived, - Knockapi::Models::Channels::BulkUpdateMessageStatusParams::EngagementStatus::TaggedSymbol + Knockapi::Channels::BulkUpdateMessageStatusParams::EngagementStatus::TaggedSymbol ) LINK_CLICKED = T.let( :link_clicked, - Knockapi::Models::Channels::BulkUpdateMessageStatusParams::EngagementStatus::TaggedSymbol + Knockapi::Channels::BulkUpdateMessageStatusParams::EngagementStatus::TaggedSymbol ) INTERACTED = T.let( :interacted, - Knockapi::Models::Channels::BulkUpdateMessageStatusParams::EngagementStatus::TaggedSymbol + Knockapi::Channels::BulkUpdateMessageStatusParams::EngagementStatus::TaggedSymbol ) sig do - override - .returns( - T::Array[Knockapi::Models::Channels::BulkUpdateMessageStatusParams::EngagementStatus::TaggedSymbol] - ) + override.returns( + T::Array[ + Knockapi::Channels::BulkUpdateMessageStatusParams::EngagementStatus::TaggedSymbol + ] + ) + end + def self.values end - def self.values; end end end end diff --git a/rbi/knockapi/models/condition.rbi b/rbi/knockapi/models/condition.rbi index 79b5587c..fcec3acd 100644 --- a/rbi/knockapi/models/condition.rbi +++ b/rbi/knockapi/models/condition.rbi @@ -3,12 +3,15 @@ module Knockapi module Models class Condition < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Knockapi::Condition, Knockapi::Internal::AnyHash) } + # The argument value to compare against in the condition. sig { returns(T.nilable(String)) } attr_accessor :argument # The operator to use in the condition evaluation. - sig { returns(Knockapi::Models::Condition::Operator::OrSymbol) } + sig { returns(Knockapi::Condition::Operator::OrSymbol) } attr_accessor :operator # The variable to be evaluated in the condition. @@ -19,10 +22,9 @@ module Knockapi sig do params( argument: T.nilable(String), - operator: Knockapi::Models::Condition::Operator::OrSymbol, + operator: Knockapi::Condition::Operator::OrSymbol, variable: String - ) - .returns(T.attached_class) + ).returns(T.attached_class) end def self.new( # The argument value to compare against in the condition. @@ -31,46 +33,91 @@ module Knockapi operator:, # The variable to be evaluated in the condition. variable: - ); end + ) + end + sig do - override - .returns( - {argument: T.nilable(String), operator: Knockapi::Models::Condition::Operator::OrSymbol, variable: String} - ) + override.returns( + { + argument: T.nilable(String), + operator: Knockapi::Condition::Operator::OrSymbol, + variable: String + } + ) + end + def to_hash end - def to_hash; end # The operator to use in the condition evaluation. module Operator extend Knockapi::Internal::Type::Enum - TaggedSymbol = T.type_alias { T.all(Symbol, Knockapi::Models::Condition::Operator) } + TaggedSymbol = + T.type_alias { T.all(Symbol, Knockapi::Condition::Operator) } OrSymbol = T.type_alias { T.any(Symbol, String) } - EQUAL_TO = T.let(:equal_to, Knockapi::Models::Condition::Operator::TaggedSymbol) - NOT_EQUAL_TO = T.let(:not_equal_to, Knockapi::Models::Condition::Operator::TaggedSymbol) - GREATER_THAN = T.let(:greater_than, Knockapi::Models::Condition::Operator::TaggedSymbol) - LESS_THAN = T.let(:less_than, Knockapi::Models::Condition::Operator::TaggedSymbol) + EQUAL_TO = T.let(:equal_to, Knockapi::Condition::Operator::TaggedSymbol) + NOT_EQUAL_TO = + T.let(:not_equal_to, Knockapi::Condition::Operator::TaggedSymbol) + GREATER_THAN = + T.let(:greater_than, Knockapi::Condition::Operator::TaggedSymbol) + LESS_THAN = + T.let(:less_than, Knockapi::Condition::Operator::TaggedSymbol) GREATER_THAN_OR_EQUAL_TO = - T.let(:greater_than_or_equal_to, Knockapi::Models::Condition::Operator::TaggedSymbol) + T.let( + :greater_than_or_equal_to, + Knockapi::Condition::Operator::TaggedSymbol + ) LESS_THAN_OR_EQUAL_TO = - T.let(:less_than_or_equal_to, Knockapi::Models::Condition::Operator::TaggedSymbol) - CONTAINS = T.let(:contains, Knockapi::Models::Condition::Operator::TaggedSymbol) - NOT_CONTAINS = T.let(:not_contains, Knockapi::Models::Condition::Operator::TaggedSymbol) - EMPTY = T.let(:empty, Knockapi::Models::Condition::Operator::TaggedSymbol) - NOT_EMPTY = T.let(:not_empty, Knockapi::Models::Condition::Operator::TaggedSymbol) - CONTAINS_ALL = T.let(:contains_all, Knockapi::Models::Condition::Operator::TaggedSymbol) - IS_TIMESTAMP = T.let(:is_timestamp, Knockapi::Models::Condition::Operator::TaggedSymbol) - IS_NOT_TIMESTAMP = T.let(:is_not_timestamp, Knockapi::Models::Condition::Operator::TaggedSymbol) - IS_TIMESTAMP_AFTER = T.let(:is_timestamp_after, Knockapi::Models::Condition::Operator::TaggedSymbol) - IS_TIMESTAMP_BEFORE = T.let(:is_timestamp_before, Knockapi::Models::Condition::Operator::TaggedSymbol) - IS_TIMESTAMP_BETWEEN = T.let(:is_timestamp_between, Knockapi::Models::Condition::Operator::TaggedSymbol) - IS_AUDIENCE_MEMBER = T.let(:is_audience_member, Knockapi::Models::Condition::Operator::TaggedSymbol) + T.let( + :less_than_or_equal_to, + Knockapi::Condition::Operator::TaggedSymbol + ) + CONTAINS = T.let(:contains, Knockapi::Condition::Operator::TaggedSymbol) + NOT_CONTAINS = + T.let(:not_contains, Knockapi::Condition::Operator::TaggedSymbol) + EMPTY = T.let(:empty, Knockapi::Condition::Operator::TaggedSymbol) + NOT_EMPTY = + T.let(:not_empty, Knockapi::Condition::Operator::TaggedSymbol) + CONTAINS_ALL = + T.let(:contains_all, Knockapi::Condition::Operator::TaggedSymbol) + IS_TIMESTAMP = + T.let(:is_timestamp, Knockapi::Condition::Operator::TaggedSymbol) + IS_NOT_TIMESTAMP = + T.let(:is_not_timestamp, Knockapi::Condition::Operator::TaggedSymbol) + IS_TIMESTAMP_AFTER = + T.let( + :is_timestamp_after, + Knockapi::Condition::Operator::TaggedSymbol + ) + IS_TIMESTAMP_BEFORE = + T.let( + :is_timestamp_before, + Knockapi::Condition::Operator::TaggedSymbol + ) + IS_TIMESTAMP_BETWEEN = + T.let( + :is_timestamp_between, + Knockapi::Condition::Operator::TaggedSymbol + ) + IS_AUDIENCE_MEMBER = + T.let( + :is_audience_member, + Knockapi::Condition::Operator::TaggedSymbol + ) IS_NOT_AUDIENCE_MEMBER = - T.let(:is_not_audience_member, Knockapi::Models::Condition::Operator::TaggedSymbol) + T.let( + :is_not_audience_member, + Knockapi::Condition::Operator::TaggedSymbol + ) - sig { override.returns(T::Array[Knockapi::Models::Condition::Operator::TaggedSymbol]) } - def self.values; end + sig do + override.returns( + T::Array[Knockapi::Condition::Operator::TaggedSymbol] + ) + end + def self.values + end end end end diff --git a/rbi/knockapi/models/identify_user_request.rbi b/rbi/knockapi/models/identify_user_request.rbi index fa746d9f..b9898748 100644 --- a/rbi/knockapi/models/identify_user_request.rbi +++ b/rbi/knockapi/models/identify_user_request.rbi @@ -3,12 +3,32 @@ module Knockapi module Models class IdentifyUserRequest < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Knockapi::IdentifyUserRequest, Knockapi::Internal::AnyHash) + end + # URL to the user's avatar image. sig { returns(T.nilable(String)) } attr_accessor :avatar # A request to set channel data for a type of channel inline. - sig { returns(T.nilable(T::Hash[Symbol, Knockapi::Models::Recipients::ChannelDataRequest])) } + sig do + returns( + T.nilable( + T::Hash[ + Symbol, + T.any( + Knockapi::Recipients::PushChannelData, + Knockapi::Recipients::OneSignalChannelData, + Knockapi::Recipients::SlackChannelData, + Knockapi::Recipients::MsTeamsChannelData, + Knockapi::Recipients::DiscordChannelData + ) + ] + ) + ) + end attr_accessor :channel_data # The creation date of the user from your system. @@ -27,19 +47,23 @@ module Knockapi sig { returns(T.nilable(String)) } attr_accessor :name - # The [E.164](https://www.twilio.com/docs/glossary/what-e164) phone number of the + # The [E.164](https://www.twilio.com/docs/glossary/what-e164) phone number of the # user (required for SMS channels). sig { returns(T.nilable(String)) } attr_accessor :phone_number # Inline set preferences for a recipient, where the key is the preference set id. - sig { returns(T.nilable(T::Hash[Symbol, Knockapi::Models::Recipients::PreferenceSetRequest])) } + sig do + returns( + T.nilable(T::Hash[Symbol, Knockapi::Recipients::PreferenceSetRequest]) + ) + end attr_accessor :preferences - # The timezone of the user. Must be a valid - # [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). - # Used for - # [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients). + # The timezone of the user. Must be a + # valid [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + # Used + # for [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients). sig { returns(T.nilable(String)) } attr_accessor :timezone @@ -49,20 +73,33 @@ module Knockapi sig do params( avatar: T.nilable(String), - channel_data: T.nilable( - T::Hash[Symbol, T.any(Knockapi::Models::Recipients::ChannelDataRequest, Knockapi::Internal::AnyHash)] - ), + channel_data: + T.nilable( + T::Hash[ + Symbol, + T.any( + Knockapi::Recipients::PushChannelData::OrHash, + Knockapi::Recipients::OneSignalChannelData::OrHash, + Knockapi::Recipients::SlackChannelData::OrHash, + Knockapi::Recipients::MsTeamsChannelData::OrHash, + Knockapi::Recipients::DiscordChannelData::OrHash + ) + ] + ), created_at: T.nilable(Time), email: T.nilable(String), locale: T.nilable(String), name: T.nilable(String), phone_number: T.nilable(String), - preferences: T.nilable( - T::Hash[Symbol, T.any(Knockapi::Models::Recipients::PreferenceSetRequest, Knockapi::Internal::AnyHash)] - ), + preferences: + T.nilable( + T::Hash[ + Symbol, + Knockapi::Recipients::PreferenceSetRequest::OrHash + ] + ), timezone: T.nilable(String) - ) - .returns(T.attached_class) + ).returns(T.attached_class) end def self.new( # URL to the user's avatar image. @@ -77,34 +114,51 @@ module Knockapi locale: nil, # Display name of the user. name: nil, - # The [E.164](https://www.twilio.com/docs/glossary/what-e164) phone number of the + # The [E.164](https://www.twilio.com/docs/glossary/what-e164) phone number of the # user (required for SMS channels). phone_number: nil, # Inline set preferences for a recipient, where the key is the preference set id. preferences: nil, - # The timezone of the user. Must be a valid - # [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). - # Used for - # [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients). + # The timezone of the user. Must be a + # valid [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + # Used + # for [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients). timezone: nil - ); end + ) + end + sig do - override - .returns( - { - avatar: T.nilable(String), - channel_data: T.nilable(T::Hash[Symbol, Knockapi::Models::Recipients::ChannelDataRequest]), - created_at: T.nilable(Time), - email: T.nilable(String), - locale: T.nilable(String), - name: T.nilable(String), - phone_number: T.nilable(String), - preferences: T.nilable(T::Hash[Symbol, Knockapi::Models::Recipients::PreferenceSetRequest]), - timezone: T.nilable(String) - } - ) + override.returns( + { + avatar: T.nilable(String), + channel_data: + T.nilable( + T::Hash[ + Symbol, + T.any( + Knockapi::Recipients::PushChannelData, + Knockapi::Recipients::OneSignalChannelData, + Knockapi::Recipients::SlackChannelData, + Knockapi::Recipients::MsTeamsChannelData, + Knockapi::Recipients::DiscordChannelData + ) + ] + ), + created_at: T.nilable(Time), + email: T.nilable(String), + locale: T.nilable(String), + name: T.nilable(String), + phone_number: T.nilable(String), + preferences: + T.nilable( + T::Hash[Symbol, Knockapi::Recipients::PreferenceSetRequest] + ), + timezone: T.nilable(String) + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/inline_identify_user_request.rbi b/rbi/knockapi/models/inline_identify_user_request.rbi index 4bd6c870..68029d16 100644 --- a/rbi/knockapi/models/inline_identify_user_request.rbi +++ b/rbi/knockapi/models/inline_identify_user_request.rbi @@ -3,22 +3,77 @@ module Knockapi module Models class InlineIdentifyUserRequest < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::InlineIdentifyUserRequest, + Knockapi::Internal::AnyHash + ) + end + # The ID for the user that you set when identifying them in Knock. sig { returns(String) } attr_accessor :id + # URL to the user's avatar image. + sig { returns(T.nilable(String)) } + attr_accessor :avatar + # A request to set channel data for a type of channel inline. - sig { returns(T.nilable(T::Hash[Symbol, Knockapi::Models::Recipients::ChannelDataRequest])) } + sig do + returns( + T.nilable( + T::Hash[ + Symbol, + T.any( + Knockapi::Recipients::PushChannelData, + Knockapi::Recipients::OneSignalChannelData, + Knockapi::Recipients::SlackChannelData, + Knockapi::Recipients::MsTeamsChannelData, + Knockapi::Recipients::DiscordChannelData + ) + ] + ) + ) + end attr_accessor :channel_data # The creation date of the user from your system. sig { returns(T.nilable(Time)) } attr_accessor :created_at + # The primary email address for the user. + sig { returns(T.nilable(String)) } + attr_accessor :email + + # The locale of the user. Used for [message localization](/concepts/translations). + sig { returns(T.nilable(String)) } + attr_accessor :locale + + # Display name of the user. + sig { returns(T.nilable(String)) } + attr_accessor :name + + # The [E.164](https://www.twilio.com/docs/glossary/what-e164) phone number of the + # user (required for SMS channels). + sig { returns(T.nilable(String)) } + attr_accessor :phone_number + # Inline set preferences for a recipient, where the key is the preference set id. - sig { returns(T.nilable(T::Hash[Symbol, Knockapi::Models::Recipients::PreferenceSetRequest])) } + sig do + returns( + T.nilable(T::Hash[Symbol, Knockapi::Recipients::PreferenceSetRequest]) + ) + end attr_accessor :preferences + # The timezone of the user. Must be a + # valid [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + # Used + # for [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients). + sig { returns(T.nilable(String)) } + attr_accessor :timezone + # A set of parameters to inline-identify a user with. Inline identifying the user # will ensure that the user is available before the request is executed in Knock. # It will perform an upsert for the user you're supplying, replacing any @@ -26,38 +81,96 @@ module Knockapi sig do params( id: String, - channel_data: T.nilable( - T::Hash[Symbol, T.any(Knockapi::Models::Recipients::ChannelDataRequest, Knockapi::Internal::AnyHash)] - ), + avatar: T.nilable(String), + channel_data: + T.nilable( + T::Hash[ + Symbol, + T.any( + Knockapi::Recipients::PushChannelData::OrHash, + Knockapi::Recipients::OneSignalChannelData::OrHash, + Knockapi::Recipients::SlackChannelData::OrHash, + Knockapi::Recipients::MsTeamsChannelData::OrHash, + Knockapi::Recipients::DiscordChannelData::OrHash + ) + ] + ), created_at: T.nilable(Time), - preferences: T.nilable( - T::Hash[Symbol, T.any(Knockapi::Models::Recipients::PreferenceSetRequest, Knockapi::Internal::AnyHash)] - ) - ) - .returns(T.attached_class) + email: T.nilable(String), + locale: T.nilable(String), + name: T.nilable(String), + phone_number: T.nilable(String), + preferences: + T.nilable( + T::Hash[ + Symbol, + Knockapi::Recipients::PreferenceSetRequest::OrHash + ] + ), + timezone: T.nilable(String) + ).returns(T.attached_class) end def self.new( # The ID for the user that you set when identifying them in Knock. id:, + # URL to the user's avatar image. + avatar: nil, # A request to set channel data for a type of channel inline. channel_data: nil, # The creation date of the user from your system. created_at: nil, + # The primary email address for the user. + email: nil, + # The locale of the user. Used for [message localization](/concepts/translations). + locale: nil, + # Display name of the user. + name: nil, + # The [E.164](https://www.twilio.com/docs/glossary/what-e164) phone number of the + # user (required for SMS channels). + phone_number: nil, # Inline set preferences for a recipient, where the key is the preference set id. - preferences: nil - ); end + preferences: nil, + # The timezone of the user. Must be a + # valid [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + # Used + # for [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients). + timezone: nil + ) + end + sig do - override - .returns( - { - id: String, - channel_data: T.nilable(T::Hash[Symbol, Knockapi::Models::Recipients::ChannelDataRequest]), - created_at: T.nilable(Time), - preferences: T.nilable(T::Hash[Symbol, Knockapi::Models::Recipients::PreferenceSetRequest]) - } - ) + override.returns( + { + id: String, + avatar: T.nilable(String), + channel_data: + T.nilable( + T::Hash[ + Symbol, + T.any( + Knockapi::Recipients::PushChannelData, + Knockapi::Recipients::OneSignalChannelData, + Knockapi::Recipients::SlackChannelData, + Knockapi::Recipients::MsTeamsChannelData, + Knockapi::Recipients::DiscordChannelData + ) + ] + ), + created_at: T.nilable(Time), + email: T.nilable(String), + locale: T.nilable(String), + name: T.nilable(String), + phone_number: T.nilable(String), + preferences: + T.nilable( + T::Hash[Symbol, Knockapi::Recipients::PreferenceSetRequest] + ), + timezone: T.nilable(String) + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/inline_object_request.rbi b/rbi/knockapi/models/inline_object_request.rbi index df3f7b1d..dc12e722 100644 --- a/rbi/knockapi/models/inline_object_request.rbi +++ b/rbi/knockapi/models/inline_object_request.rbi @@ -3,6 +3,11 @@ module Knockapi module Models class InlineObjectRequest < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Knockapi::InlineObjectRequest, Knockapi::Internal::AnyHash) + end + # Unique identifier for the object. sig { returns(String) } attr_accessor :id @@ -12,7 +17,22 @@ module Knockapi attr_accessor :collection # A request to set channel data for a type of channel inline. - sig { returns(T.nilable(T::Hash[Symbol, Knockapi::Models::Recipients::ChannelDataRequest])) } + sig do + returns( + T.nilable( + T::Hash[ + Symbol, + T.any( + Knockapi::Recipients::PushChannelData, + Knockapi::Recipients::OneSignalChannelData, + Knockapi::Recipients::SlackChannelData, + Knockapi::Recipients::MsTeamsChannelData, + Knockapi::Recipients::DiscordChannelData + ) + ] + ) + ) + end attr_accessor :channel_data # Timestamp when the resource was created. @@ -20,7 +40,11 @@ module Knockapi attr_accessor :created_at # Inline set preferences for a recipient, where the key is the preference set id. - sig { returns(T.nilable(T::Hash[Symbol, Knockapi::Models::Recipients::PreferenceSetRequest])) } + sig do + returns( + T.nilable(T::Hash[Symbol, Knockapi::Recipients::PreferenceSetRequest]) + ) + end attr_accessor :preferences # A custom [Object](/concepts/objects) entity which belongs to a collection. @@ -28,15 +52,28 @@ module Knockapi params( id: String, collection: String, - channel_data: T.nilable( - T::Hash[Symbol, T.any(Knockapi::Models::Recipients::ChannelDataRequest, Knockapi::Internal::AnyHash)] - ), + channel_data: + T.nilable( + T::Hash[ + Symbol, + T.any( + Knockapi::Recipients::PushChannelData::OrHash, + Knockapi::Recipients::OneSignalChannelData::OrHash, + Knockapi::Recipients::SlackChannelData::OrHash, + Knockapi::Recipients::MsTeamsChannelData::OrHash, + Knockapi::Recipients::DiscordChannelData::OrHash + ) + ] + ), created_at: T.nilable(Time), - preferences: T.nilable( - T::Hash[Symbol, T.any(Knockapi::Models::Recipients::PreferenceSetRequest, Knockapi::Internal::AnyHash)] - ) - ) - .returns(T.attached_class) + preferences: + T.nilable( + T::Hash[ + Symbol, + Knockapi::Recipients::PreferenceSetRequest::OrHash + ] + ) + ).returns(T.attached_class) end def self.new( # Unique identifier for the object. @@ -49,20 +86,37 @@ module Knockapi created_at: nil, # Inline set preferences for a recipient, where the key is the preference set id. preferences: nil - ); end + ) + end + sig do - override - .returns( - { - id: String, - collection: String, - channel_data: T.nilable(T::Hash[Symbol, Knockapi::Models::Recipients::ChannelDataRequest]), - created_at: T.nilable(Time), - preferences: T.nilable(T::Hash[Symbol, Knockapi::Models::Recipients::PreferenceSetRequest]) - } - ) + override.returns( + { + id: String, + collection: String, + channel_data: + T.nilable( + T::Hash[ + Symbol, + T.any( + Knockapi::Recipients::PushChannelData, + Knockapi::Recipients::OneSignalChannelData, + Knockapi::Recipients::SlackChannelData, + Knockapi::Recipients::MsTeamsChannelData, + Knockapi::Recipients::DiscordChannelData + ) + ] + ), + created_at: T.nilable(Time), + preferences: + T.nilable( + T::Hash[Symbol, Knockapi::Recipients::PreferenceSetRequest] + ) + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/inline_tenant_request.rbi b/rbi/knockapi/models/inline_tenant_request.rbi index aedabdb1..f57f10aa 100644 --- a/rbi/knockapi/models/inline_tenant_request.rbi +++ b/rbi/knockapi/models/inline_tenant_request.rbi @@ -6,8 +6,13 @@ module Knockapi module InlineTenantRequest extend Knockapi::Internal::Type::Union - sig { override.returns([String, Knockapi::Models::TenantRequest]) } - def self.variants; end + Variants = T.type_alias { T.any(String, Knockapi::TenantRequest) } + + sig do + override.returns(T::Array[Knockapi::InlineTenantRequest::Variants]) + end + def self.variants + end end end end diff --git a/rbi/knockapi/models/integrations/census_custom_destination_params.rbi b/rbi/knockapi/models/integrations/census_custom_destination_params.rbi index 77fa9da2..d279981f 100644 --- a/rbi/knockapi/models/integrations/census_custom_destination_params.rbi +++ b/rbi/knockapi/models/integrations/census_custom_destination_params.rbi @@ -7,6 +7,14 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::Integrations::CensusCustomDestinationParams, + Knockapi::Internal::AnyHash + ) + end + # The unique identifier for the RPC request. sig { returns(String) } attr_accessor :id @@ -32,9 +40,8 @@ module Knockapi jsonrpc: String, method_: String, params: T::Hash[Symbol, T.anything], - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # The unique identifier for the RPC request. @@ -46,20 +53,22 @@ module Knockapi # The parameters for the method. params: nil, request_options: {} - ); end + ) + end + sig do - override - .returns( - { - id: String, - jsonrpc: String, - method_: String, - params: T::Hash[Symbol, T.anything], - request_options: Knockapi::RequestOptions - } - ) + override.returns( + { + id: String, + jsonrpc: String, + method_: String, + params: T::Hash[Symbol, T.anything], + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/integrations/census_custom_destination_response.rbi b/rbi/knockapi/models/integrations/census_custom_destination_response.rbi index 79574ce9..1c086ea2 100644 --- a/rbi/knockapi/models/integrations/census_custom_destination_response.rbi +++ b/rbi/knockapi/models/integrations/census_custom_destination_response.rbi @@ -4,6 +4,14 @@ module Knockapi module Models module Integrations class CensusCustomDestinationResponse < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::Integrations::CensusCustomDestinationResponse, + Knockapi::Internal::AnyHash + ) + end + # The request ID. sig { returns(T.nilable(String)) } attr_reader :id @@ -18,15 +26,24 @@ module Knockapi sig { params(result: T::Hash[Symbol, T.anything]).void } attr_writer :result - sig { params(id: String, result: T::Hash[Symbol, T.anything]).returns(T.attached_class) } + sig do + params(id: String, result: T::Hash[Symbol, T.anything]).returns( + T.attached_class + ) + end def self.new( # The request ID. id: nil, # The result of the RPC call. result: nil - ); end - sig { override.returns({id: String, result: T::Hash[Symbol, T.anything]}) } - def to_hash; end + ) + end + + sig do + override.returns({ id: String, result: T::Hash[Symbol, T.anything] }) + end + def to_hash + end end end end diff --git a/rbi/knockapi/models/integrations/hightouch_embedded_destination_params.rbi b/rbi/knockapi/models/integrations/hightouch_embedded_destination_params.rbi index fcbe1b28..f61b6f4e 100644 --- a/rbi/knockapi/models/integrations/hightouch_embedded_destination_params.rbi +++ b/rbi/knockapi/models/integrations/hightouch_embedded_destination_params.rbi @@ -7,6 +7,14 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::Integrations::HightouchEmbeddedDestinationParams, + Knockapi::Internal::AnyHash + ) + end + # The unique identifier for the RPC request. sig { returns(String) } attr_accessor :id @@ -32,9 +40,8 @@ module Knockapi jsonrpc: String, method_: String, params: T::Hash[Symbol, T.anything], - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # The unique identifier for the RPC request. @@ -46,20 +53,22 @@ module Knockapi # The parameters for the method. params: nil, request_options: {} - ); end + ) + end + sig do - override - .returns( - { - id: String, - jsonrpc: String, - method_: String, - params: T::Hash[Symbol, T.anything], - request_options: Knockapi::RequestOptions - } - ) + override.returns( + { + id: String, + jsonrpc: String, + method_: String, + params: T::Hash[Symbol, T.anything], + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/integrations/hightouch_embedded_destination_response.rbi b/rbi/knockapi/models/integrations/hightouch_embedded_destination_response.rbi index 891b33ca..d26196e8 100644 --- a/rbi/knockapi/models/integrations/hightouch_embedded_destination_response.rbi +++ b/rbi/knockapi/models/integrations/hightouch_embedded_destination_response.rbi @@ -4,6 +4,14 @@ module Knockapi module Models module Integrations class HightouchEmbeddedDestinationResponse < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::Integrations::HightouchEmbeddedDestinationResponse, + Knockapi::Internal::AnyHash + ) + end + # The request ID. sig { returns(T.nilable(String)) } attr_reader :id @@ -18,15 +26,24 @@ module Knockapi sig { params(result: T::Hash[Symbol, T.anything]).void } attr_writer :result - sig { params(id: String, result: T::Hash[Symbol, T.anything]).returns(T.attached_class) } + sig do + params(id: String, result: T::Hash[Symbol, T.anything]).returns( + T.attached_class + ) + end def self.new( # The request ID. id: nil, # The result of the RPC call. result: nil - ); end - sig { override.returns({id: String, result: T::Hash[Symbol, T.anything]}) } - def to_hash; end + ) + end + + sig do + override.returns({ id: String, result: T::Hash[Symbol, T.anything] }) + end + def to_hash + end end end end diff --git a/rbi/knockapi/models/message.rbi b/rbi/knockapi/models/message.rbi index 39fb7940..b03b06a1 100644 --- a/rbi/knockapi/models/message.rbi +++ b/rbi/knockapi/models/message.rbi @@ -3,6 +3,9 @@ module Knockapi module Models class Message < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Knockapi::Message, Knockapi::Internal::AnyHash) } + # The unique identifier for the message. sig { returns(T.nilable(String)) } attr_reader :id @@ -20,14 +23,27 @@ module Knockapi # One or more actors that are associated with this message. Note: this is a list # that can contain up to 10 actors if the message is produced from a # [batch](/designing-workflows/batch-function). - sig { returns(T.nilable(T::Array[T.any(String, Knockapi::Models::RecipientReference::ObjectReference)])) } + sig do + returns( + T.nilable( + T::Array[ + T.any(String, Knockapi::RecipientReference::ObjectReference) + ] + ) + ) + end attr_reader :actors sig do params( - actors: T::Array[T.any(String, Knockapi::Models::RecipientReference::ObjectReference, Knockapi::Internal::AnyHash)] - ) - .void + actors: + T::Array[ + T.any( + String, + Knockapi::RecipientReference::ObjectReference::OrHash + ) + ] + ).void end attr_writer :actors @@ -55,10 +71,19 @@ module Knockapi attr_accessor :data # A list of engagement statuses. - sig { returns(T.nilable(T::Array[Knockapi::Models::Message::EngagementStatus::TaggedSymbol])) } + sig do + returns( + T.nilable(T::Array[Knockapi::Message::EngagementStatus::TaggedSymbol]) + ) + end attr_reader :engagement_statuses - sig { params(engagement_statuses: T::Array[Knockapi::Models::Message::EngagementStatus::OrSymbol]).void } + sig do + params( + engagement_statuses: + T::Array[Knockapi::Message::EngagementStatus::OrSymbol] + ).void + end attr_writer :engagement_statuses # Timestamp when the resource was created. @@ -86,14 +111,20 @@ module Knockapi # A reference to a recipient, either a user identifier (string) or an object # reference (ID, collection). - sig { returns(T.nilable(T.any(String, Knockapi::Models::RecipientReference::ObjectReference))) } + sig do + returns( + T.nilable( + T.any(String, Knockapi::RecipientReference::ObjectReference) + ) + ) + end attr_reader :recipient sig do params( - recipient: T.any(String, Knockapi::Models::RecipientReference::ObjectReference, Knockapi::Internal::AnyHash) - ) - .void + recipient: + T.any(String, Knockapi::RecipientReference::ObjectReference::OrHash) + ).void end attr_writer :recipient @@ -106,17 +137,17 @@ module Knockapi attr_accessor :seen_at # The workflow that triggered the message. - sig { returns(T.nilable(Knockapi::Models::Message::Source)) } + sig { returns(T.nilable(Knockapi::Message::Source)) } attr_reader :source - sig { params(source: T.any(Knockapi::Models::Message::Source, Knockapi::Internal::AnyHash)).void } + sig { params(source: Knockapi::Message::Source::OrHash).void } attr_writer :source # The message delivery status. - sig { returns(T.nilable(Knockapi::Models::Message::Status::TaggedSymbol)) } + sig { returns(T.nilable(Knockapi::Message::Status::TaggedSymbol)) } attr_reader :status - sig { params(status: Knockapi::Models::Message::Status::OrSymbol).void } + sig { params(status: Knockapi::Message::Status::OrSymbol).void } attr_writer :status # The ID of the `tenant` associated with the message. Only present when a `tenant` @@ -141,27 +172,37 @@ module Knockapi params( id: String, _typename: String, - actors: T::Array[T.any(String, Knockapi::Models::RecipientReference::ObjectReference, Knockapi::Internal::AnyHash)], + actors: + T::Array[ + T.any( + String, + Knockapi::RecipientReference::ObjectReference::OrHash + ) + ], archived_at: T.nilable(Time), channel_id: String, clicked_at: T.nilable(Time), data: T.nilable(T::Hash[Symbol, T.anything]), - engagement_statuses: T::Array[Knockapi::Models::Message::EngagementStatus::OrSymbol], + engagement_statuses: + T::Array[Knockapi::Message::EngagementStatus::OrSymbol], inserted_at: Time, interacted_at: T.nilable(Time), link_clicked_at: T.nilable(Time), metadata: T.nilable(T::Hash[Symbol, T.anything]), read_at: T.nilable(Time), - recipient: T.any(String, Knockapi::Models::RecipientReference::ObjectReference, Knockapi::Internal::AnyHash), + recipient: + T.any( + String, + Knockapi::RecipientReference::ObjectReference::OrHash + ), scheduled_at: T.nilable(Time), seen_at: T.nilable(Time), - source: T.any(Knockapi::Models::Message::Source, Knockapi::Internal::AnyHash), - status: Knockapi::Models::Message::Status::OrSymbol, + source: Knockapi::Message::Source::OrHash, + status: Knockapi::Message::Status::OrSymbol, tenant: T.nilable(String), updated_at: Time, workflow: T.nilable(String) - ) - .returns(T.attached_class) + ).returns(T.attached_class) end def self.new( # The unique identifier for the message. @@ -214,56 +255,80 @@ module Knockapi updated_at: nil, # The key of the workflow that generated the message. workflow: nil - ); end + ) + end + sig do - override - .returns( - { - id: String, - _typename: String, - actors: T::Array[T.any(String, Knockapi::Models::RecipientReference::ObjectReference)], - archived_at: T.nilable(Time), - channel_id: String, - clicked_at: T.nilable(Time), - data: T.nilable(T::Hash[Symbol, T.anything]), - engagement_statuses: T::Array[Knockapi::Models::Message::EngagementStatus::TaggedSymbol], - inserted_at: Time, - interacted_at: T.nilable(Time), - link_clicked_at: T.nilable(Time), - metadata: T.nilable(T::Hash[Symbol, T.anything]), - read_at: T.nilable(Time), - recipient: T.any(String, Knockapi::Models::RecipientReference::ObjectReference), - scheduled_at: T.nilable(Time), - seen_at: T.nilable(Time), - source: Knockapi::Models::Message::Source, - status: Knockapi::Models::Message::Status::TaggedSymbol, - tenant: T.nilable(String), - updated_at: Time, - workflow: T.nilable(String) - } - ) + override.returns( + { + id: String, + _typename: String, + actors: + T::Array[ + T.any(String, Knockapi::RecipientReference::ObjectReference) + ], + archived_at: T.nilable(Time), + channel_id: String, + clicked_at: T.nilable(Time), + data: T.nilable(T::Hash[Symbol, T.anything]), + engagement_statuses: + T::Array[Knockapi::Message::EngagementStatus::TaggedSymbol], + inserted_at: Time, + interacted_at: T.nilable(Time), + link_clicked_at: T.nilable(Time), + metadata: T.nilable(T::Hash[Symbol, T.anything]), + read_at: T.nilable(Time), + recipient: + T.any(String, Knockapi::RecipientReference::ObjectReference), + scheduled_at: T.nilable(Time), + seen_at: T.nilable(Time), + source: Knockapi::Message::Source, + status: Knockapi::Message::Status::TaggedSymbol, + tenant: T.nilable(String), + updated_at: Time, + workflow: T.nilable(String) + } + ) + end + def to_hash end - def to_hash; end # An engagement status for a message. Can be one of: read, seen, interacted, # link_clicked, archived. module EngagementStatus extend Knockapi::Internal::Type::Enum - TaggedSymbol = T.type_alias { T.all(Symbol, Knockapi::Models::Message::EngagementStatus) } + TaggedSymbol = + T.type_alias { T.all(Symbol, Knockapi::Message::EngagementStatus) } OrSymbol = T.type_alias { T.any(Symbol, String) } - SEEN = T.let(:seen, Knockapi::Models::Message::EngagementStatus::TaggedSymbol) - READ = T.let(:read, Knockapi::Models::Message::EngagementStatus::TaggedSymbol) - INTERACTED = T.let(:interacted, Knockapi::Models::Message::EngagementStatus::TaggedSymbol) - LINK_CLICKED = T.let(:link_clicked, Knockapi::Models::Message::EngagementStatus::TaggedSymbol) - ARCHIVED = T.let(:archived, Knockapi::Models::Message::EngagementStatus::TaggedSymbol) + SEEN = T.let(:seen, Knockapi::Message::EngagementStatus::TaggedSymbol) + READ = T.let(:read, Knockapi::Message::EngagementStatus::TaggedSymbol) + INTERACTED = + T.let(:interacted, Knockapi::Message::EngagementStatus::TaggedSymbol) + LINK_CLICKED = + T.let( + :link_clicked, + Knockapi::Message::EngagementStatus::TaggedSymbol + ) + ARCHIVED = + T.let(:archived, Knockapi::Message::EngagementStatus::TaggedSymbol) - sig { override.returns(T::Array[Knockapi::Models::Message::EngagementStatus::TaggedSymbol]) } - def self.values; end + sig do + override.returns( + T::Array[Knockapi::Message::EngagementStatus::TaggedSymbol] + ) + end + def self.values + end end class Source < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Knockapi::Message::Source, Knockapi::Internal::AnyHash) + end + sig { returns(String) } attr_accessor :_typename @@ -281,8 +346,12 @@ module Knockapi # The workflow that triggered the message. sig do - params(_typename: String, categories: T::Array[String], key: String, version_id: String) - .returns(T.attached_class) + params( + _typename: String, + categories: T::Array[String], + key: String, + version_id: String + ).returns(T.attached_class) end def self.new( _typename:, @@ -292,30 +361,45 @@ module Knockapi key:, # The ID of the version of the workflow that triggered the message. version_id: - ); end + ) + end + sig do - override.returns({_typename: String, categories: T::Array[String], key: String, version_id: String}) + override.returns( + { + _typename: String, + categories: T::Array[String], + key: String, + version_id: String + } + ) + end + def to_hash end - def to_hash; end end # The message delivery status. module Status extend Knockapi::Internal::Type::Enum - TaggedSymbol = T.type_alias { T.all(Symbol, Knockapi::Models::Message::Status) } + TaggedSymbol = T.type_alias { T.all(Symbol, Knockapi::Message::Status) } OrSymbol = T.type_alias { T.any(Symbol, String) } - QUEUED = T.let(:queued, Knockapi::Models::Message::Status::TaggedSymbol) - SENT = T.let(:sent, Knockapi::Models::Message::Status::TaggedSymbol) - DELIVERED = T.let(:delivered, Knockapi::Models::Message::Status::TaggedSymbol) - DELIVERY_ATTEMPTED = T.let(:delivery_attempted, Knockapi::Models::Message::Status::TaggedSymbol) - UNDELIVERED = T.let(:undelivered, Knockapi::Models::Message::Status::TaggedSymbol) - NOT_SENT = T.let(:not_sent, Knockapi::Models::Message::Status::TaggedSymbol) - BOUNCED = T.let(:bounced, Knockapi::Models::Message::Status::TaggedSymbol) + QUEUED = T.let(:queued, Knockapi::Message::Status::TaggedSymbol) + SENT = T.let(:sent, Knockapi::Message::Status::TaggedSymbol) + DELIVERED = T.let(:delivered, Knockapi::Message::Status::TaggedSymbol) + DELIVERY_ATTEMPTED = + T.let(:delivery_attempted, Knockapi::Message::Status::TaggedSymbol) + UNDELIVERED = + T.let(:undelivered, Knockapi::Message::Status::TaggedSymbol) + NOT_SENT = T.let(:not_sent, Knockapi::Message::Status::TaggedSymbol) + BOUNCED = T.let(:bounced, Knockapi::Message::Status::TaggedSymbol) - sig { override.returns(T::Array[Knockapi::Models::Message::Status::TaggedSymbol]) } - def self.values; end + sig do + override.returns(T::Array[Knockapi::Message::Status::TaggedSymbol]) + end + def self.values + end end end end diff --git a/rbi/knockapi/models/message_archive_params.rbi b/rbi/knockapi/models/message_archive_params.rbi index f6e2b2fe..26547aa1 100644 --- a/rbi/knockapi/models/message_archive_params.rbi +++ b/rbi/knockapi/models/message_archive_params.rbi @@ -6,14 +6,22 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any(Knockapi::MessageArchiveParams, Knockapi::Internal::AnyHash) + end + sig do - params(request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash)) - .returns(T.attached_class) + params(request_options: Knockapi::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) end - def self.new(request_options: {}); end - sig { override.returns({request_options: Knockapi::RequestOptions}) } - def to_hash; end + sig { override.returns({ request_options: Knockapi::RequestOptions }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/message_delivery_log.rbi b/rbi/knockapi/models/message_delivery_log.rbi index 1377e6f0..fffd2238 100644 --- a/rbi/knockapi/models/message_delivery_log.rbi +++ b/rbi/knockapi/models/message_delivery_log.rbi @@ -3,6 +3,11 @@ module Knockapi module Models class MessageDeliveryLog < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Knockapi::MessageDeliveryLog, Knockapi::Internal::AnyHash) + end + # The unique identifier for the message delivery log. sig { returns(String) } attr_accessor :id @@ -20,17 +25,21 @@ module Knockapi attr_accessor :inserted_at # A message delivery log request. - sig { returns(Knockapi::Models::MessageDeliveryLog::Request) } + sig { returns(Knockapi::MessageDeliveryLog::Request) } attr_reader :request - sig { params(request: T.any(Knockapi::Models::MessageDeliveryLog::Request, Knockapi::Internal::AnyHash)).void } + sig do + params(request: Knockapi::MessageDeliveryLog::Request::OrHash).void + end attr_writer :request # A message delivery log response. - sig { returns(Knockapi::Models::MessageDeliveryLog::Response) } + sig { returns(Knockapi::MessageDeliveryLog::Response) } attr_reader :response - sig { params(response: T.any(Knockapi::Models::MessageDeliveryLog::Response, Knockapi::Internal::AnyHash)).void } + sig do + params(response: Knockapi::MessageDeliveryLog::Response::OrHash).void + end attr_writer :response # The name of the service that processed the delivery. @@ -45,11 +54,10 @@ module Knockapi _typename: String, environment_id: String, inserted_at: String, - request: T.any(Knockapi::Models::MessageDeliveryLog::Request, Knockapi::Internal::AnyHash), - response: T.any(Knockapi::Models::MessageDeliveryLog::Response, Knockapi::Internal::AnyHash), + request: Knockapi::MessageDeliveryLog::Request::OrHash, + response: Knockapi::MessageDeliveryLog::Response::OrHash, service_name: String - ) - .returns(T.attached_class) + ).returns(T.attached_class) end def self.new( # The unique identifier for the message delivery log. @@ -66,24 +74,34 @@ module Knockapi response:, # The name of the service that processed the delivery. service_name: - ); end + ) + end + sig do - override - .returns( - { - id: String, - _typename: String, - environment_id: String, - inserted_at: String, - request: Knockapi::Models::MessageDeliveryLog::Request, - response: Knockapi::Models::MessageDeliveryLog::Response, - service_name: String - } - ) + override.returns( + { + id: String, + _typename: String, + environment_id: String, + inserted_at: String, + request: Knockapi::MessageDeliveryLog::Request, + response: Knockapi::MessageDeliveryLog::Response, + service_name: String + } + ) + end + def to_hash end - def to_hash; end class Request < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::MessageDeliveryLog::Request, + Knockapi::Internal::AnyHash + ) + end + # The body content that was sent with the request. sig { returns(T.nilable(T.any(String, T::Hash[Symbol, T.anything]))) } attr_reader :body @@ -103,10 +121,20 @@ module Knockapi attr_writer :host # The HTTP method used for the request. - sig { returns(T.nilable(Knockapi::Models::MessageDeliveryLog::Request::Method::TaggedSymbol)) } + sig do + returns( + T.nilable( + Knockapi::MessageDeliveryLog::Request::Method::TaggedSymbol + ) + ) + end attr_reader :method_ - sig { params(method_: Knockapi::Models::MessageDeliveryLog::Request::Method::OrSymbol).void } + sig do + params( + method_: Knockapi::MessageDeliveryLog::Request::Method::OrSymbol + ).void + end attr_writer :method_ # The path of the URL that was requested. @@ -126,11 +154,10 @@ module Knockapi body: T.any(String, T::Hash[Symbol, T.anything]), headers: T.nilable(T::Hash[Symbol, T.anything]), host: String, - method_: Knockapi::Models::MessageDeliveryLog::Request::Method::OrSymbol, + method_: Knockapi::MessageDeliveryLog::Request::Method::OrSymbol, path: String, query: T.nilable(String) - ) - .returns(T.attached_class) + ).returns(T.attached_class) end def self.new( # The body content that was sent with the request. @@ -145,32 +172,44 @@ module Knockapi path: nil, # The query string of the URL that was requested. query: nil - ); end + ) + end + sig do - override - .returns( - { - body: T.any(String, T::Hash[Symbol, T.anything]), - headers: T.nilable(T::Hash[Symbol, T.anything]), - host: String, - method_: Knockapi::Models::MessageDeliveryLog::Request::Method::TaggedSymbol, - path: String, - query: T.nilable(String) - } - ) + override.returns( + { + body: T.any(String, T::Hash[Symbol, T.anything]), + headers: T.nilable(T::Hash[Symbol, T.anything]), + host: String, + method_: + Knockapi::MessageDeliveryLog::Request::Method::TaggedSymbol, + path: String, + query: T.nilable(String) + } + ) + end + def to_hash end - def to_hash; end # The body content that was sent with the request. module Body extend Knockapi::Internal::Type::Union - sig { override.returns([String, T::Hash[Symbol, T.anything]]) } - def self.variants; end + Variants = T.type_alias { T.any(String, T::Hash[Symbol, T.anything]) } + + sig do + override.returns( + T::Array[Knockapi::MessageDeliveryLog::Request::Body::Variants] + ) + end + def self.variants + end UnionMember1Map = T.let( - Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown], + Knockapi::Internal::Type::HashOf[ + Knockapi::Internal::Type::Unknown + ], Knockapi::Internal::Type::Converter ) end @@ -179,21 +218,59 @@ module Knockapi module Method extend Knockapi::Internal::Type::Enum - TaggedSymbol = T.type_alias { T.all(Symbol, Knockapi::Models::MessageDeliveryLog::Request::Method) } + TaggedSymbol = + T.type_alias do + T.all(Symbol, Knockapi::MessageDeliveryLog::Request::Method) + end OrSymbol = T.type_alias { T.any(Symbol, String) } - GET = T.let(:GET, Knockapi::Models::MessageDeliveryLog::Request::Method::TaggedSymbol) - POST = T.let(:POST, Knockapi::Models::MessageDeliveryLog::Request::Method::TaggedSymbol) - PUT = T.let(:PUT, Knockapi::Models::MessageDeliveryLog::Request::Method::TaggedSymbol) - DELETE = T.let(:DELETE, Knockapi::Models::MessageDeliveryLog::Request::Method::TaggedSymbol) - PATCH = T.let(:PATCH, Knockapi::Models::MessageDeliveryLog::Request::Method::TaggedSymbol) + GET = + T.let( + :GET, + Knockapi::MessageDeliveryLog::Request::Method::TaggedSymbol + ) + POST = + T.let( + :POST, + Knockapi::MessageDeliveryLog::Request::Method::TaggedSymbol + ) + PUT = + T.let( + :PUT, + Knockapi::MessageDeliveryLog::Request::Method::TaggedSymbol + ) + DELETE = + T.let( + :DELETE, + Knockapi::MessageDeliveryLog::Request::Method::TaggedSymbol + ) + PATCH = + T.let( + :PATCH, + Knockapi::MessageDeliveryLog::Request::Method::TaggedSymbol + ) - sig { override.returns(T::Array[Knockapi::Models::MessageDeliveryLog::Request::Method::TaggedSymbol]) } - def self.values; end + sig do + override.returns( + T::Array[ + Knockapi::MessageDeliveryLog::Request::Method::TaggedSymbol + ] + ) + end + def self.values + end end end class Response < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::MessageDeliveryLog::Response, + Knockapi::Internal::AnyHash + ) + end + # The body content that was received with the response. sig { returns(T.nilable(T.any(String, T::Hash[Symbol, T.anything]))) } attr_reader :body @@ -218,8 +295,7 @@ module Knockapi body: T.any(String, T::Hash[Symbol, T.anything]), headers: T.nilable(T::Hash[Symbol, T.anything]), status: Integer - ) - .returns(T.attached_class) + ).returns(T.attached_class) end def self.new( # The body content that was received with the response. @@ -228,29 +304,40 @@ module Knockapi headers: nil, # The HTTP status code of the response. status: nil - ); end + ) + end + sig do - override - .returns( - { - body: T.any(String, T::Hash[Symbol, T.anything]), - headers: T.nilable(T::Hash[Symbol, T.anything]), - status: Integer - } - ) + override.returns( + { + body: T.any(String, T::Hash[Symbol, T.anything]), + headers: T.nilable(T::Hash[Symbol, T.anything]), + status: Integer + } + ) + end + def to_hash end - def to_hash; end # The body content that was received with the response. module Body extend Knockapi::Internal::Type::Union - sig { override.returns([String, T::Hash[Symbol, T.anything]]) } - def self.variants; end + Variants = T.type_alias { T.any(String, T::Hash[Symbol, T.anything]) } + + sig do + override.returns( + T::Array[Knockapi::MessageDeliveryLog::Response::Body::Variants] + ) + end + def self.variants + end UnionMember1Map = T.let( - Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown], + Knockapi::Internal::Type::HashOf[ + Knockapi::Internal::Type::Unknown + ], Knockapi::Internal::Type::Converter ) end diff --git a/rbi/knockapi/models/message_event.rbi b/rbi/knockapi/models/message_event.rbi index df65b4bc..fb0f1a0b 100644 --- a/rbi/knockapi/models/message_event.rbi +++ b/rbi/knockapi/models/message_event.rbi @@ -3,6 +3,11 @@ module Knockapi module Models class MessageEvent < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Knockapi::MessageEvent, Knockapi::Internal::AnyHash) + end + # The unique identifier for the message event. sig { returns(String) } attr_accessor :id @@ -17,11 +22,13 @@ module Knockapi # A reference to a recipient, either a user identifier (string) or an object # reference (ID, collection). - sig { returns(T.any(String, Knockapi::Models::RecipientReference::ObjectReference)) } + sig do + returns(T.any(String, Knockapi::RecipientReference::ObjectReference)) + end attr_accessor :recipient # The type of event that occurred. - sig { returns(Knockapi::Models::MessageEvent::Type::TaggedSymbol) } + sig { returns(Knockapi::MessageEvent::Type::TaggedSymbol) } attr_accessor :type # The data associated with the message event. Only present for some event types. @@ -35,11 +42,14 @@ module Knockapi id: String, _typename: String, inserted_at: Time, - recipient: T.any(String, Knockapi::Models::RecipientReference::ObjectReference, Knockapi::Internal::AnyHash), - type: Knockapi::Models::MessageEvent::Type::OrSymbol, + recipient: + T.any( + String, + Knockapi::RecipientReference::ObjectReference::OrHash + ), + type: Knockapi::MessageEvent::Type::OrSymbol, data: T.nilable(T::Hash[Symbol, T.anything]) - ) - .returns(T.attached_class) + ).returns(T.attached_class) end def self.new( # The unique identifier for the message event. @@ -55,48 +65,87 @@ module Knockapi type:, # The data associated with the message event. Only present for some event types. data: nil - ); end + ) + end + sig do - override - .returns( - { - id: String, - _typename: String, - inserted_at: Time, - recipient: T.any(String, Knockapi::Models::RecipientReference::ObjectReference), - type: Knockapi::Models::MessageEvent::Type::TaggedSymbol, - data: T.nilable(T::Hash[Symbol, T.anything]) - } - ) + override.returns( + { + id: String, + _typename: String, + inserted_at: Time, + recipient: + T.any(String, Knockapi::RecipientReference::ObjectReference), + type: Knockapi::MessageEvent::Type::TaggedSymbol, + data: T.nilable(T::Hash[Symbol, T.anything]) + } + ) + end + def to_hash end - def to_hash; end # The type of event that occurred. module Type extend Knockapi::Internal::Type::Enum - TaggedSymbol = T.type_alias { T.all(Symbol, Knockapi::Models::MessageEvent::Type) } + TaggedSymbol = + T.type_alias { T.all(Symbol, Knockapi::MessageEvent::Type) } OrSymbol = T.type_alias { T.any(Symbol, String) } - MESSAGE_ARCHIVED = T.let(:"message.archived", Knockapi::Models::MessageEvent::Type::TaggedSymbol) - MESSAGE_BOUNCED = T.let(:"message.bounced", Knockapi::Models::MessageEvent::Type::TaggedSymbol) - MESSAGE_DELIVERED = T.let(:"message.delivered", Knockapi::Models::MessageEvent::Type::TaggedSymbol) + MESSAGE_ARCHIVED = + T.let(:"message.archived", Knockapi::MessageEvent::Type::TaggedSymbol) + MESSAGE_BOUNCED = + T.let(:"message.bounced", Knockapi::MessageEvent::Type::TaggedSymbol) + MESSAGE_DELIVERED = + T.let( + :"message.delivered", + Knockapi::MessageEvent::Type::TaggedSymbol + ) MESSAGE_DELIVERY_ATTEMPTED = - T.let(:"message.delivery_attempted", Knockapi::Models::MessageEvent::Type::TaggedSymbol) - MESSAGE_INTERACTED = T.let(:"message.interacted", Knockapi::Models::MessageEvent::Type::TaggedSymbol) - MESSAGE_LINK_CLICKED = T.let(:"message.link_clicked", Knockapi::Models::MessageEvent::Type::TaggedSymbol) - MESSAGE_NOT_SENT = T.let(:"message.not_sent", Knockapi::Models::MessageEvent::Type::TaggedSymbol) - MESSAGE_QUEUED = T.let(:"message.queued", Knockapi::Models::MessageEvent::Type::TaggedSymbol) - MESSAGE_READ = T.let(:"message.read", Knockapi::Models::MessageEvent::Type::TaggedSymbol) - MESSAGE_SEEN = T.let(:"message.seen", Knockapi::Models::MessageEvent::Type::TaggedSymbol) - MESSAGE_SENT = T.let(:"message.sent", Knockapi::Models::MessageEvent::Type::TaggedSymbol) - MESSAGE_UNARCHIVED = T.let(:"message.unarchived", Knockapi::Models::MessageEvent::Type::TaggedSymbol) - MESSAGE_UNDELIVERED = T.let(:"message.undelivered", Knockapi::Models::MessageEvent::Type::TaggedSymbol) - MESSAGE_UNREAD = T.let(:"message.unread", Knockapi::Models::MessageEvent::Type::TaggedSymbol) - MESSAGE_UNSEEN = T.let(:"message.unseen", Knockapi::Models::MessageEvent::Type::TaggedSymbol) + T.let( + :"message.delivery_attempted", + Knockapi::MessageEvent::Type::TaggedSymbol + ) + MESSAGE_INTERACTED = + T.let( + :"message.interacted", + Knockapi::MessageEvent::Type::TaggedSymbol + ) + MESSAGE_LINK_CLICKED = + T.let( + :"message.link_clicked", + Knockapi::MessageEvent::Type::TaggedSymbol + ) + MESSAGE_NOT_SENT = + T.let(:"message.not_sent", Knockapi::MessageEvent::Type::TaggedSymbol) + MESSAGE_QUEUED = + T.let(:"message.queued", Knockapi::MessageEvent::Type::TaggedSymbol) + MESSAGE_READ = + T.let(:"message.read", Knockapi::MessageEvent::Type::TaggedSymbol) + MESSAGE_SEEN = + T.let(:"message.seen", Knockapi::MessageEvent::Type::TaggedSymbol) + MESSAGE_SENT = + T.let(:"message.sent", Knockapi::MessageEvent::Type::TaggedSymbol) + MESSAGE_UNARCHIVED = + T.let( + :"message.unarchived", + Knockapi::MessageEvent::Type::TaggedSymbol + ) + MESSAGE_UNDELIVERED = + T.let( + :"message.undelivered", + Knockapi::MessageEvent::Type::TaggedSymbol + ) + MESSAGE_UNREAD = + T.let(:"message.unread", Knockapi::MessageEvent::Type::TaggedSymbol) + MESSAGE_UNSEEN = + T.let(:"message.unseen", Knockapi::MessageEvent::Type::TaggedSymbol) - sig { override.returns(T::Array[Knockapi::Models::MessageEvent::Type::TaggedSymbol]) } - def self.values; end + sig do + override.returns(T::Array[Knockapi::MessageEvent::Type::TaggedSymbol]) + end + def self.values + end end end end diff --git a/rbi/knockapi/models/message_get_content_params.rbi b/rbi/knockapi/models/message_get_content_params.rbi index f451180e..55632104 100644 --- a/rbi/knockapi/models/message_get_content_params.rbi +++ b/rbi/knockapi/models/message_get_content_params.rbi @@ -6,14 +6,22 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any(Knockapi::MessageGetContentParams, Knockapi::Internal::AnyHash) + end + sig do - params(request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash)) - .returns(T.attached_class) + params(request_options: Knockapi::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) end - def self.new(request_options: {}); end - sig { override.returns({request_options: Knockapi::RequestOptions}) } - def to_hash; end + sig { override.returns({ request_options: Knockapi::RequestOptions }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/message_get_content_response.rbi b/rbi/knockapi/models/message_get_content_response.rbi index 214fd1ae..d52610a1 100644 --- a/rbi/knockapi/models/message_get_content_response.rbi +++ b/rbi/knockapi/models/message_get_content_response.rbi @@ -3,6 +3,14 @@ module Knockapi module Models class MessageGetContentResponse < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::MessageGetContentResponse, + Knockapi::Internal::AnyHash + ) + end + # The typename of the schema. sig { returns(String) } attr_accessor :_typename @@ -33,18 +41,17 @@ module Knockapi sig do params( _typename: String, - data: T.any( - Knockapi::Models::MessageGetContentResponse::Data::MessageEmailContent, - Knockapi::Internal::AnyHash, - Knockapi::Models::MessageGetContentResponse::Data::MessageSMSContent, - Knockapi::Models::MessageGetContentResponse::Data::MessagePushContent, - Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent, - Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent - ), + data: + T.any( + Knockapi::Models::MessageGetContentResponse::Data::MessageEmailContent::OrHash, + Knockapi::Models::MessageGetContentResponse::Data::MessageSMSContent::OrHash, + Knockapi::Models::MessageGetContentResponse::Data::MessagePushContent::OrHash, + Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent::OrHash, + Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::OrHash + ), inserted_at: Time, message_id: String - ) - .returns(T.attached_class) + ).returns(T.attached_class) end def self.new( # The typename of the schema. @@ -55,31 +62,53 @@ module Knockapi inserted_at:, # The unique identifier for the message content. message_id: - ); end + ) + end + sig do - override - .returns( - { - _typename: String, - data: T.any( + override.returns( + { + _typename: String, + data: + T.any( Knockapi::Models::MessageGetContentResponse::Data::MessageEmailContent, Knockapi::Models::MessageGetContentResponse::Data::MessageSMSContent, Knockapi::Models::MessageGetContentResponse::Data::MessagePushContent, Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent, Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent ), - inserted_at: Time, - message_id: String - } - ) + inserted_at: Time, + message_id: String + } + ) + end + def to_hash end - def to_hash; end # Content data specific to the channel type. module Data extend Knockapi::Internal::Type::Union + Variants = + T.type_alias do + T.any( + Knockapi::Models::MessageGetContentResponse::Data::MessageEmailContent, + Knockapi::Models::MessageGetContentResponse::Data::MessageSMSContent, + Knockapi::Models::MessageGetContentResponse::Data::MessagePushContent, + Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent, + Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent + ) + end + class MessageEmailContent < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::MessageGetContentResponse::Data::MessageEmailContent, + Knockapi::Internal::AnyHash + ) + end + # The typename of the schema. sig { returns(String) } attr_accessor :_typename @@ -128,8 +157,7 @@ module Knockapi bcc: T.nilable(String), cc: T.nilable(String), reply_to: T.nilable(String) - ) - .returns(T.attached_class) + ).returns(T.attached_class) end def self.new( # The typename of the schema. @@ -150,27 +178,37 @@ module Knockapi cc: nil, # The reply-to email address. reply_to: nil - ); end + ) + end + sig do - override - .returns( - { - _typename: String, - from: String, - html_body: String, - subject_line: String, - text_body: String, - to: String, - bcc: T.nilable(String), - cc: T.nilable(String), - reply_to: T.nilable(String) - } - ) + override.returns( + { + _typename: String, + from: String, + html_body: String, + subject_line: String, + text_body: String, + to: String, + bcc: T.nilable(String), + cc: T.nilable(String), + reply_to: T.nilable(String) + } + ) + end + def to_hash end - def to_hash; end end class MessageSMSContent < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::MessageGetContentResponse::Data::MessageSMSContent, + Knockapi::Internal::AnyHash + ) + end + # The typename of the schema. sig { returns(String) } attr_accessor :_typename @@ -184,7 +222,11 @@ module Knockapi attr_accessor :to # The content of an SMS message. - sig { params(_typename: String, body: String, to: String).returns(T.attached_class) } + sig do + params(_typename: String, body: String, to: String).returns( + T.attached_class + ) + end def self.new( # The typename of the schema. _typename:, @@ -192,12 +234,25 @@ module Knockapi body:, # The phone number the SMS was sent to. to: - ); end - sig { override.returns({_typename: String, body: String, to: String}) } - def to_hash; end + ) + end + + sig do + override.returns({ _typename: String, body: String, to: String }) + end + def to_hash + end end class MessagePushContent < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::MessageGetContentResponse::Data::MessagePushContent, + Knockapi::Internal::AnyHash + ) + end + # The device token to send the push notification to. sig { returns(String) } attr_accessor :token @@ -226,8 +281,7 @@ module Knockapi body: String, title: String, data: T.nilable(T::Hash[Symbol, T.anything]) - ) - .returns(T.attached_class) + ).returns(T.attached_class) end def self.new( # The device token to send the push notification to. @@ -240,23 +294,33 @@ module Knockapi title:, # Additional data payload for the push notification. data: nil - ); end + ) + end + sig do - override - .returns( - { - token: String, - _typename: String, - body: String, - title: String, - data: T.nilable(T::Hash[Symbol, T.anything]) - } - ) + override.returns( + { + token: String, + _typename: String, + body: String, + title: String, + data: T.nilable(T::Hash[Symbol, T.anything]) + } + ) + end + def to_hash end - def to_hash; end end class MessageChatContent < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent, + Knockapi::Internal::AnyHash + ) + end + # The typename of the schema. sig { returns(String) } attr_accessor :_typename @@ -266,17 +330,18 @@ module Knockapi attr_accessor :connection # The template structure for the chat message. - sig { returns(Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent::Template) } + sig do + returns( + Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent::Template + ) + end attr_reader :template sig do params( - template: T.any( - Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent::Template, - Knockapi::Internal::AnyHash - ) - ) - .void + template: + Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent::Template::OrHash + ).void end attr_writer :template @@ -289,13 +354,10 @@ module Knockapi params( _typename: String, connection: T::Hash[Symbol, T.anything], - template: T.any( - Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent::Template, - Knockapi::Internal::AnyHash - ), + template: + Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent::Template::OrHash, metadata: T.nilable(T::Hash[Symbol, T.anything]) - ) - .returns(T.attached_class) + ).returns(T.attached_class) end def self.new( # The typename of the schema. @@ -306,26 +368,39 @@ module Knockapi template:, # Additional metadata associated with the chat message. metadata: nil - ); end + ) + end + sig do - override - .returns( - { - _typename: String, - connection: T::Hash[Symbol, T.anything], - template: Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent::Template, - metadata: T.nilable(T::Hash[Symbol, T.anything]) - } - ) + override.returns( + { + _typename: String, + connection: T::Hash[Symbol, T.anything], + template: + Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent::Template, + metadata: T.nilable(T::Hash[Symbol, T.anything]) + } + ) + end + def to_hash end - def to_hash; end class Template < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent::Template, + Knockapi::Internal::AnyHash + ) + end + # The blocks of the message in a chat. sig do returns( T.nilable( - T::Array[Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent::Template::Block] + T::Array[ + Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent::Template::Block + ] ) ) end @@ -342,18 +417,15 @@ module Knockapi # The template structure for the chat message. sig do params( - blocks: T.nilable( - T::Array[ - T.any( - Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent::Template::Block, - Knockapi::Internal::AnyHash - ) - ] - ), + blocks: + T.nilable( + T::Array[ + Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent::Template::Block::OrHash + ] + ), json_content: T.nilable(T::Hash[Symbol, T.anything]), summary: T.nilable(String) - ) - .returns(T.attached_class) + ).returns(T.attached_class) end def self.new( # The blocks of the message in a chat. @@ -362,22 +434,35 @@ module Knockapi json_content: nil, # The summary of the chat message. summary: nil - ); end + ) + end + sig do - override - .returns( - { - blocks: T.nilable( - T::Array[Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent::Template::Block] + override.returns( + { + blocks: + T.nilable( + T::Array[ + Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent::Template::Block + ] ), - json_content: T.nilable(T::Hash[Symbol, T.anything]), - summary: T.nilable(String) - } - ) + json_content: T.nilable(T::Hash[Symbol, T.anything]), + summary: T.nilable(String) + } + ) + end + def to_hash end - def to_hash; end class Block < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent::Template::Block, + Knockapi::Internal::AnyHash + ) + end + # The actual content of the block. sig { returns(String) } attr_accessor :content @@ -399,9 +484,9 @@ module Knockapi params( content: String, name: String, - type: Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent::Template::Block::Type::OrSymbol - ) - .returns(T.attached_class) + type: + Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent::Template::Block::Type::OrSymbol + ).returns(T.attached_class) end def self.new( # The actual content of the block. @@ -410,18 +495,21 @@ module Knockapi name:, # The type of block in a message in a chat (text or markdown). type: - ); end + ) + end + sig do - override - .returns( - { - content: String, - name: String, - type: Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent::Template::Block::Type::TaggedSymbol - } - ) + override.returns( + { + content: String, + name: String, + type: + Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent::Template::Block::Type::TaggedSymbol + } + ) + end + def to_hash end - def to_hash; end # The type of block in a message in a chat (text or markdown). module Type @@ -429,7 +517,10 @@ module Knockapi TaggedSymbol = T.type_alias do - T.all(Symbol, Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent::Template::Block::Type) + T.all( + Symbol, + Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent::Template::Block::Type + ) end OrSymbol = T.type_alias { T.any(Symbol, String) } @@ -445,18 +536,28 @@ module Knockapi ) sig do - override - .returns( - T::Array[Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent::Template::Block::Type::TaggedSymbol] - ) + override.returns( + T::Array[ + Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent::Template::Block::Type::TaggedSymbol + ] + ) + end + def self.values end - def self.values; end end end end end class MessageInAppFeedContent < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent, + Knockapi::Internal::AnyHash + ) + end + # The typename of the schema. sig { returns(String) } attr_accessor :_typename @@ -478,43 +579,61 @@ module Knockapi sig do params( _typename: String, - blocks: T::Array[ - T.any( - Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock, - Knockapi::Internal::AnyHash, - Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock - ) - ] - ) - .returns(T.attached_class) + blocks: + T::Array[ + T.any( + Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock::OrHash, + Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock::OrHash + ) + ] + ).returns(T.attached_class) end def self.new( # The typename of the schema. _typename:, # The blocks of the message in an app feed. blocks: - ); end + ) + end + sig do - override - .returns( - { - _typename: String, - blocks: T::Array[ + override.returns( + { + _typename: String, + blocks: + T::Array[ T.any( Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock, Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock ) ] - } - ) + } + ) + end + def to_hash end - def to_hash; end # A block in a message in an app feed. module Block extend Knockapi::Internal::Type::Union + Variants = + T.type_alias do + T.any( + Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock, + Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock + ) + end + class MessageInAppFeedContentBlock < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock, + Knockapi::Internal::AnyHash + ) + end + # The content of the block in a message in an app feed. sig { returns(String) } attr_accessor :content @@ -541,9 +660,9 @@ module Knockapi content: String, name: String, rendered: String, - type: Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock::Type::OrSymbol - ) - .returns(T.attached_class) + type: + Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock::Type::OrSymbol + ).returns(T.attached_class) end def self.new( # The content of the block in a message in an app feed. @@ -554,19 +673,22 @@ module Knockapi rendered:, # The type of block in a message in an app feed. type: - ); end + ) + end + sig do - override - .returns( - { - content: String, - name: String, - rendered: String, - type: Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock::Type::TaggedSymbol - } - ) + override.returns( + { + content: String, + name: String, + rendered: String, + type: + Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock::Type::TaggedSymbol + } + ) + end + def to_hash end - def to_hash; end # The type of block in a message in an app feed. module Type @@ -574,7 +696,10 @@ module Knockapi TaggedSymbol = T.type_alias do - T.all(Symbol, Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock::Type) + T.all( + Symbol, + Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock::Type + ) end OrSymbol = T.type_alias { T.any(Symbol, String) } @@ -590,18 +715,26 @@ module Knockapi ) sig do - override - .returns( - T::Array[ - Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock::Type::TaggedSymbol - ] - ) + override.returns( + T::Array[ + Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock::Type::TaggedSymbol + ] + ) + end + def self.values end - def self.values; end end end class MessageInAppFeedButtonSetBlock < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock, + Knockapi::Internal::AnyHash + ) + end + # A list of buttons in an in app feed message. sig do returns( @@ -627,16 +760,14 @@ module Knockapi # A button set block in a message in an app feed. sig do params( - buttons: T::Array[ - T.any( - Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock::Button, - Knockapi::Internal::AnyHash - ) - ], + buttons: + T::Array[ + Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock::Button::OrHash + ], name: String, - type: Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock::Type::OrSymbol - ) - .returns(T.attached_class) + type: + Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock::Type::OrSymbol + ).returns(T.attached_class) end def self.new( # A list of buttons in an in app feed message. @@ -645,22 +776,34 @@ module Knockapi name:, # The type of block in a message in an app feed. type: - ); end + ) + end + sig do - override - .returns( - { - buttons: T::Array[ + override.returns( + { + buttons: + T::Array[ Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock::Button ], - name: String, - type: Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock::Type::TaggedSymbol - } - ) + name: String, + type: + Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock::Type::TaggedSymbol + } + ) + end + def to_hash end - def to_hash; end class Button < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock::Button, + Knockapi::Internal::AnyHash + ) + end + # The action to take when the button is clicked. sig { returns(String) } attr_accessor :action @@ -674,7 +817,11 @@ module Knockapi attr_accessor :name # A button in an in app feed message. - sig { params(action: String, label: String, name: String).returns(T.attached_class) } + sig do + params(action: String, label: String, name: String).returns( + T.attached_class + ) + end def self.new( # The action to take when the button is clicked. action:, @@ -682,9 +829,16 @@ module Knockapi label:, # The name of the button. name: - ); end - sig { override.returns({action: String, label: String, name: String}) } - def to_hash; end + ) + end + + sig do + override.returns( + { action: String, label: String, name: String } + ) + end + def to_hash + end end # The type of block in a message in an app feed. @@ -693,7 +847,10 @@ module Knockapi TaggedSymbol = T.type_alias do - T.all(Symbol, Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock::Type) + T.all( + Symbol, + Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock::Type + ) end OrSymbol = T.type_alias { T.any(Symbol, String) } @@ -704,34 +861,38 @@ module Knockapi ) sig do - override - .returns( - T::Array[ - Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock::Type::TaggedSymbol - ] - ) + override.returns( + T::Array[ + Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock::Type::TaggedSymbol + ] + ) + end + def self.values end - def self.values; end end end sig do - override - .returns( - [Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock, Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock] - ) + override.returns( + T::Array[ + Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::Variants + ] + ) + end + def self.variants end - def self.variants; end end end sig do - override - .returns( - [Knockapi::Models::MessageGetContentResponse::Data::MessageEmailContent, Knockapi::Models::MessageGetContentResponse::Data::MessageSMSContent, Knockapi::Models::MessageGetContentResponse::Data::MessagePushContent, Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent, Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent] - ) + override.returns( + T::Array[ + Knockapi::Models::MessageGetContentResponse::Data::Variants + ] + ) + end + def self.variants end - def self.variants; end end end end diff --git a/rbi/knockapi/models/message_get_params.rbi b/rbi/knockapi/models/message_get_params.rbi index 85557444..8a13db1e 100644 --- a/rbi/knockapi/models/message_get_params.rbi +++ b/rbi/knockapi/models/message_get_params.rbi @@ -6,14 +6,22 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any(Knockapi::MessageGetParams, Knockapi::Internal::AnyHash) + end + sig do - params(request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash)) - .returns(T.attached_class) + params(request_options: Knockapi::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) end - def self.new(request_options: {}); end - sig { override.returns({request_options: Knockapi::RequestOptions}) } - def to_hash; end + sig { override.returns({ request_options: Knockapi::RequestOptions }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/message_list_activities_params.rbi b/rbi/knockapi/models/message_list_activities_params.rbi index 8be340b9..33f06903 100644 --- a/rbi/knockapi/models/message_list_activities_params.rbi +++ b/rbi/knockapi/models/message_list_activities_params.rbi @@ -6,6 +6,14 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::MessageListActivitiesParams, + Knockapi::Internal::AnyHash + ) + end + # The cursor to fetch entries after. sig { returns(T.nilable(String)) } attr_reader :after @@ -40,9 +48,8 @@ module Knockapi before: String, page_size: Integer, trigger_data: String, - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # The cursor to fetch entries after. @@ -54,20 +61,22 @@ module Knockapi # The trigger data to filter activities by. trigger_data: nil, request_options: {} - ); end + ) + end + sig do - override - .returns( - { - after: String, - before: String, - page_size: Integer, - trigger_data: String, - request_options: Knockapi::RequestOptions - } - ) + override.returns( + { + after: String, + before: String, + page_size: Integer, + trigger_data: String, + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/message_list_delivery_logs_params.rbi b/rbi/knockapi/models/message_list_delivery_logs_params.rbi index 5e284f19..54d255a8 100644 --- a/rbi/knockapi/models/message_list_delivery_logs_params.rbi +++ b/rbi/knockapi/models/message_list_delivery_logs_params.rbi @@ -6,6 +6,14 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::MessageListDeliveryLogsParams, + Knockapi::Internal::AnyHash + ) + end + # The cursor to fetch entries after. sig { returns(T.nilable(String)) } attr_reader :after @@ -32,9 +40,8 @@ module Knockapi after: String, before: String, page_size: Integer, - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # The cursor to fetch entries after. @@ -44,17 +51,21 @@ module Knockapi # The number of items per page. page_size: nil, request_options: {} - ); end + ) + end + sig do - override - .returns({ - after: String, - before: String, - page_size: Integer, - request_options: Knockapi::RequestOptions - }) + override.returns( + { + after: String, + before: String, + page_size: Integer, + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/message_list_events_params.rbi b/rbi/knockapi/models/message_list_events_params.rbi index 922c7d06..42ef7273 100644 --- a/rbi/knockapi/models/message_list_events_params.rbi +++ b/rbi/knockapi/models/message_list_events_params.rbi @@ -6,6 +6,11 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any(Knockapi::MessageListEventsParams, Knockapi::Internal::AnyHash) + end + # The cursor to fetch entries after. sig { returns(T.nilable(String)) } attr_reader :after @@ -32,9 +37,8 @@ module Knockapi after: String, before: String, page_size: Integer, - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # The cursor to fetch entries after. @@ -44,17 +48,21 @@ module Knockapi # The number of items per page. page_size: nil, request_options: {} - ); end + ) + end + sig do - override - .returns({ - after: String, - before: String, - page_size: Integer, - request_options: Knockapi::RequestOptions - }) + override.returns( + { + after: String, + before: String, + page_size: Integer, + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/message_list_params.rbi b/rbi/knockapi/models/message_list_params.rbi index 6b431829..0f230b71 100644 --- a/rbi/knockapi/models/message_list_params.rbi +++ b/rbi/knockapi/models/message_list_params.rbi @@ -6,6 +6,11 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any(Knockapi::MessageListParams, Knockapi::Internal::AnyHash) + end + # The cursor to fetch entries after. sig { returns(T.nilable(String)) } attr_reader :after @@ -28,18 +33,30 @@ module Knockapi attr_writer :channel_id # Limits the results to messages with the given engagement status. - sig { returns(T.nilable(T::Array[Knockapi::Models::MessageListParams::EngagementStatus::OrSymbol])) } + sig do + returns( + T.nilable( + T::Array[Knockapi::MessageListParams::EngagementStatus::OrSymbol] + ) + ) + end attr_reader :engagement_status - sig { params(engagement_status: T::Array[Knockapi::Models::MessageListParams::EngagementStatus::OrSymbol]).void } + sig do + params( + engagement_status: + T::Array[Knockapi::MessageListParams::EngagementStatus::OrSymbol] + ).void + end attr_writer :engagement_status - sig { returns(T.nilable(Knockapi::Models::MessageListParams::InsertedAt)) } + sig { returns(T.nilable(Knockapi::MessageListParams::InsertedAt)) } attr_reader :inserted_at sig do - params(inserted_at: T.any(Knockapi::Models::MessageListParams::InsertedAt, Knockapi::Internal::AnyHash)) - .void + params( + inserted_at: Knockapi::MessageListParams::InsertedAt::OrHash + ).void end attr_writer :inserted_at @@ -66,10 +83,18 @@ module Knockapi attr_writer :source # Limits the results to messages with the given delivery status. - sig { returns(T.nilable(T::Array[Knockapi::Models::MessageListParams::Status::OrSymbol])) } + sig do + returns( + T.nilable(T::Array[Knockapi::MessageListParams::Status::OrSymbol]) + ) + end attr_reader :status - sig { params(status: T::Array[Knockapi::Models::MessageListParams::Status::OrSymbol]).void } + sig do + params( + status: T::Array[Knockapi::MessageListParams::Status::OrSymbol] + ).void + end attr_writer :status # Limits the results to items with the corresponding tenant. @@ -115,20 +140,20 @@ module Knockapi after: String, before: String, channel_id: String, - engagement_status: T::Array[Knockapi::Models::MessageListParams::EngagementStatus::OrSymbol], - inserted_at: T.any(Knockapi::Models::MessageListParams::InsertedAt, Knockapi::Internal::AnyHash), + engagement_status: + T::Array[Knockapi::MessageListParams::EngagementStatus::OrSymbol], + inserted_at: Knockapi::MessageListParams::InsertedAt::OrHash, message_ids: T::Array[String], page_size: Integer, source: String, - status: T::Array[Knockapi::Models::MessageListParams::Status::OrSymbol], + status: T::Array[Knockapi::MessageListParams::Status::OrSymbol], tenant: String, trigger_data: String, workflow_categories: T::Array[String], workflow_recipient_run_id: String, workflow_run_id: String, - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # The cursor to fetch entries after. @@ -163,48 +188,89 @@ module Knockapi # returned by the workflow trigger request. workflow_run_id: nil, request_options: {} - ); end + ) + end + sig do - override - .returns( - { - after: String, - before: String, - channel_id: String, - engagement_status: T::Array[Knockapi::Models::MessageListParams::EngagementStatus::OrSymbol], - inserted_at: Knockapi::Models::MessageListParams::InsertedAt, - message_ids: T::Array[String], - page_size: Integer, - source: String, - status: T::Array[Knockapi::Models::MessageListParams::Status::OrSymbol], - tenant: String, - trigger_data: String, - workflow_categories: T::Array[String], - workflow_recipient_run_id: String, - workflow_run_id: String, - request_options: Knockapi::RequestOptions - } - ) + override.returns( + { + after: String, + before: String, + channel_id: String, + engagement_status: + T::Array[Knockapi::MessageListParams::EngagementStatus::OrSymbol], + inserted_at: Knockapi::MessageListParams::InsertedAt, + message_ids: T::Array[String], + page_size: Integer, + source: String, + status: T::Array[Knockapi::MessageListParams::Status::OrSymbol], + tenant: String, + trigger_data: String, + workflow_categories: T::Array[String], + workflow_recipient_run_id: String, + workflow_run_id: String, + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end module EngagementStatus extend Knockapi::Internal::Type::Enum - TaggedSymbol = T.type_alias { T.all(Symbol, Knockapi::Models::MessageListParams::EngagementStatus) } + TaggedSymbol = + T.type_alias do + T.all(Symbol, Knockapi::MessageListParams::EngagementStatus) + end OrSymbol = T.type_alias { T.any(Symbol, String) } - SEEN = T.let(:seen, Knockapi::Models::MessageListParams::EngagementStatus::TaggedSymbol) - READ = T.let(:read, Knockapi::Models::MessageListParams::EngagementStatus::TaggedSymbol) - INTERACTED = T.let(:interacted, Knockapi::Models::MessageListParams::EngagementStatus::TaggedSymbol) - LINK_CLICKED = T.let(:link_clicked, Knockapi::Models::MessageListParams::EngagementStatus::TaggedSymbol) - ARCHIVED = T.let(:archived, Knockapi::Models::MessageListParams::EngagementStatus::TaggedSymbol) + SEEN = + T.let( + :seen, + Knockapi::MessageListParams::EngagementStatus::TaggedSymbol + ) + READ = + T.let( + :read, + Knockapi::MessageListParams::EngagementStatus::TaggedSymbol + ) + INTERACTED = + T.let( + :interacted, + Knockapi::MessageListParams::EngagementStatus::TaggedSymbol + ) + LINK_CLICKED = + T.let( + :link_clicked, + Knockapi::MessageListParams::EngagementStatus::TaggedSymbol + ) + ARCHIVED = + T.let( + :archived, + Knockapi::MessageListParams::EngagementStatus::TaggedSymbol + ) - sig { override.returns(T::Array[Knockapi::Models::MessageListParams::EngagementStatus::TaggedSymbol]) } - def self.values; end + sig do + override.returns( + T::Array[ + Knockapi::MessageListParams::EngagementStatus::TaggedSymbol + ] + ) + end + def self.values + end end class InsertedAt < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::MessageListParams::InsertedAt, + Knockapi::Internal::AnyHash + ) + end + # Limits the results to messages inserted after the given date. sig { returns(T.nilable(String)) } attr_reader :gt @@ -233,7 +299,11 @@ module Knockapi sig { params(lte: String).void } attr_writer :lte - sig { params(gt: String, gte: String, lt: String, lte: String).returns(T.attached_class) } + sig do + params(gt: String, gte: String, lt: String, lte: String).returns( + T.attached_class + ) + end def self.new( # Limits the results to messages inserted after the given date. gt: nil, @@ -243,28 +313,47 @@ module Knockapi lt: nil, # Limits the results to messages inserted before or on the given date. lte: nil - ); end - sig { override.returns({gt: String, gte: String, lt: String, lte: String}) } - def to_hash; end + ) + end + + sig do + override.returns({ gt: String, gte: String, lt: String, lte: String }) + end + def to_hash + end end module Status extend Knockapi::Internal::Type::Enum - TaggedSymbol = T.type_alias { T.all(Symbol, Knockapi::Models::MessageListParams::Status) } + TaggedSymbol = + T.type_alias { T.all(Symbol, Knockapi::MessageListParams::Status) } OrSymbol = T.type_alias { T.any(Symbol, String) } - QUEUED = T.let(:queued, Knockapi::Models::MessageListParams::Status::TaggedSymbol) - SENT = T.let(:sent, Knockapi::Models::MessageListParams::Status::TaggedSymbol) - DELIVERED = T.let(:delivered, Knockapi::Models::MessageListParams::Status::TaggedSymbol) + QUEUED = + T.let(:queued, Knockapi::MessageListParams::Status::TaggedSymbol) + SENT = T.let(:sent, Knockapi::MessageListParams::Status::TaggedSymbol) + DELIVERED = + T.let(:delivered, Knockapi::MessageListParams::Status::TaggedSymbol) DELIVERY_ATTEMPTED = - T.let(:delivery_attempted, Knockapi::Models::MessageListParams::Status::TaggedSymbol) - UNDELIVERED = T.let(:undelivered, Knockapi::Models::MessageListParams::Status::TaggedSymbol) - NOT_SENT = T.let(:not_sent, Knockapi::Models::MessageListParams::Status::TaggedSymbol) - BOUNCED = T.let(:bounced, Knockapi::Models::MessageListParams::Status::TaggedSymbol) - - sig { override.returns(T::Array[Knockapi::Models::MessageListParams::Status::TaggedSymbol]) } - def self.values; end + T.let( + :delivery_attempted, + Knockapi::MessageListParams::Status::TaggedSymbol + ) + UNDELIVERED = + T.let(:undelivered, Knockapi::MessageListParams::Status::TaggedSymbol) + NOT_SENT = + T.let(:not_sent, Knockapi::MessageListParams::Status::TaggedSymbol) + BOUNCED = + T.let(:bounced, Knockapi::MessageListParams::Status::TaggedSymbol) + + sig do + override.returns( + T::Array[Knockapi::MessageListParams::Status::TaggedSymbol] + ) + end + def self.values + end end end end diff --git a/rbi/knockapi/models/message_mark_as_interacted_params.rbi b/rbi/knockapi/models/message_mark_as_interacted_params.rbi index e216162a..c66916f2 100644 --- a/rbi/knockapi/models/message_mark_as_interacted_params.rbi +++ b/rbi/knockapi/models/message_mark_as_interacted_params.rbi @@ -6,6 +6,14 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::MessageMarkAsInteractedParams, + Knockapi::Internal::AnyHash + ) + end + # Metadata about the interaction. sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_reader :metadata @@ -16,19 +24,26 @@ module Knockapi sig do params( metadata: T::Hash[Symbol, T.anything], - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # Metadata about the interaction. metadata: nil, request_options: {} - ); end + ) + end + sig do - override.returns({metadata: T::Hash[Symbol, T.anything], request_options: Knockapi::RequestOptions}) + override.returns( + { + metadata: T::Hash[Symbol, T.anything], + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/message_mark_as_read_params.rbi b/rbi/knockapi/models/message_mark_as_read_params.rbi index 92465aee..856cd236 100644 --- a/rbi/knockapi/models/message_mark_as_read_params.rbi +++ b/rbi/knockapi/models/message_mark_as_read_params.rbi @@ -6,14 +6,22 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any(Knockapi::MessageMarkAsReadParams, Knockapi::Internal::AnyHash) + end + sig do - params(request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash)) - .returns(T.attached_class) + params(request_options: Knockapi::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) end - def self.new(request_options: {}); end - sig { override.returns({request_options: Knockapi::RequestOptions}) } - def to_hash; end + sig { override.returns({ request_options: Knockapi::RequestOptions }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/message_mark_as_seen_params.rbi b/rbi/knockapi/models/message_mark_as_seen_params.rbi index cf700989..bb846b14 100644 --- a/rbi/knockapi/models/message_mark_as_seen_params.rbi +++ b/rbi/knockapi/models/message_mark_as_seen_params.rbi @@ -6,14 +6,22 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any(Knockapi::MessageMarkAsSeenParams, Knockapi::Internal::AnyHash) + end + sig do - params(request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash)) - .returns(T.attached_class) + params(request_options: Knockapi::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) end - def self.new(request_options: {}); end - sig { override.returns({request_options: Knockapi::RequestOptions}) } - def to_hash; end + sig { override.returns({ request_options: Knockapi::RequestOptions }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/message_mark_as_unread_params.rbi b/rbi/knockapi/models/message_mark_as_unread_params.rbi index 5bd2d55b..43cedec1 100644 --- a/rbi/knockapi/models/message_mark_as_unread_params.rbi +++ b/rbi/knockapi/models/message_mark_as_unread_params.rbi @@ -6,14 +6,25 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::MessageMarkAsUnreadParams, + Knockapi::Internal::AnyHash + ) + end + sig do - params(request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash)) - .returns(T.attached_class) + params(request_options: Knockapi::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) end - def self.new(request_options: {}); end - sig { override.returns({request_options: Knockapi::RequestOptions}) } - def to_hash; end + sig { override.returns({ request_options: Knockapi::RequestOptions }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/message_mark_as_unseen_params.rbi b/rbi/knockapi/models/message_mark_as_unseen_params.rbi index a9e979fa..15726562 100644 --- a/rbi/knockapi/models/message_mark_as_unseen_params.rbi +++ b/rbi/knockapi/models/message_mark_as_unseen_params.rbi @@ -6,14 +6,25 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::MessageMarkAsUnseenParams, + Knockapi::Internal::AnyHash + ) + end + sig do - params(request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash)) - .returns(T.attached_class) + params(request_options: Knockapi::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) end - def self.new(request_options: {}); end - sig { override.returns({request_options: Knockapi::RequestOptions}) } - def to_hash; end + sig { override.returns({ request_options: Knockapi::RequestOptions }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/message_unarchive_params.rbi b/rbi/knockapi/models/message_unarchive_params.rbi index 87846693..e167d1a7 100644 --- a/rbi/knockapi/models/message_unarchive_params.rbi +++ b/rbi/knockapi/models/message_unarchive_params.rbi @@ -6,14 +6,22 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any(Knockapi::MessageUnarchiveParams, Knockapi::Internal::AnyHash) + end + sig do - params(request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash)) - .returns(T.attached_class) + params(request_options: Knockapi::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) end - def self.new(request_options: {}); end - sig { override.returns({request_options: Knockapi::RequestOptions}) } - def to_hash; end + sig { override.returns({ request_options: Knockapi::RequestOptions }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/messages/activity_list_params.rbi b/rbi/knockapi/models/messages/activity_list_params.rbi deleted file mode 100644 index c46902d4..00000000 --- a/rbi/knockapi/models/messages/activity_list_params.rbi +++ /dev/null @@ -1,75 +0,0 @@ -# typed: strong - -module Knockapi - module Models - module Messages - class ActivityListParams < Knockapi::Internal::Type::BaseModel - extend Knockapi::Internal::Type::RequestParameters::Converter - include Knockapi::Internal::Type::RequestParameters - - # The cursor to fetch entries after. - sig { returns(T.nilable(String)) } - attr_reader :after - - sig { params(after: String).void } - attr_writer :after - - # The cursor to fetch entries before. - sig { returns(T.nilable(String)) } - attr_reader :before - - sig { params(before: String).void } - attr_writer :before - - # The number of items per page. - sig { returns(T.nilable(Integer)) } - attr_reader :page_size - - sig { params(page_size: Integer).void } - attr_writer :page_size - - # The trigger data to filter activities by. - sig { returns(T.nilable(String)) } - attr_reader :trigger_data - - sig { params(trigger_data: String).void } - attr_writer :trigger_data - - sig do - params( - after: String, - before: String, - page_size: Integer, - trigger_data: String, - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) - end - def self.new( - # The cursor to fetch entries after. - after: nil, - # The cursor to fetch entries before. - before: nil, - # The number of items per page. - page_size: nil, - # The trigger data to filter activities by. - trigger_data: nil, - request_options: {} - ); end - sig do - override - .returns( - { - after: String, - before: String, - page_size: Integer, - trigger_data: String, - request_options: Knockapi::RequestOptions - } - ) - end - def to_hash; end - end - end - end -end diff --git a/rbi/knockapi/models/messages/batch_archive_params.rbi b/rbi/knockapi/models/messages/batch_archive_params.rbi index 2e467c17..b522e188 100644 --- a/rbi/knockapi/models/messages/batch_archive_params.rbi +++ b/rbi/knockapi/models/messages/batch_archive_params.rbi @@ -7,6 +7,14 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::Messages::BatchArchiveParams, + Knockapi::Internal::AnyHash + ) + end + # The message IDs to update the status of. sig { returns(T::Array[String]) } attr_accessor :message_ids @@ -14,17 +22,26 @@ module Knockapi sig do params( message_ids: T::Array[String], - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # The message IDs to update the status of. message_ids:, request_options: {} - ); end - sig { override.returns({message_ids: T::Array[String], request_options: Knockapi::RequestOptions}) } - def to_hash; end + ) + end + + sig do + override.returns( + { + message_ids: T::Array[String], + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash + end end end end diff --git a/rbi/knockapi/models/messages/batch_archive_response.rbi b/rbi/knockapi/models/messages/batch_archive_response.rbi index 5739cbf5..b0956cc7 100644 --- a/rbi/knockapi/models/messages/batch_archive_response.rbi +++ b/rbi/knockapi/models/messages/batch_archive_response.rbi @@ -4,7 +4,10 @@ module Knockapi module Models module Messages BatchArchiveResponse = - T.let(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Message], Knockapi::Internal::Type::Converter) + T.let( + Knockapi::Internal::Type::ArrayOf[Knockapi::Message], + Knockapi::Internal::Type::Converter + ) end end end diff --git a/rbi/knockapi/models/messages/batch_get_content_params.rbi b/rbi/knockapi/models/messages/batch_get_content_params.rbi index 0e4974bc..a4acbfbf 100644 --- a/rbi/knockapi/models/messages/batch_get_content_params.rbi +++ b/rbi/knockapi/models/messages/batch_get_content_params.rbi @@ -7,6 +7,14 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::Messages::BatchGetContentParams, + Knockapi::Internal::AnyHash + ) + end + # The IDs of the messages to fetch contents of. sig { returns(T::Array[String]) } attr_accessor :message_ids @@ -14,17 +22,26 @@ module Knockapi sig do params( message_ids: T::Array[String], - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # The IDs of the messages to fetch contents of. message_ids:, request_options: {} - ); end - sig { override.returns({message_ids: T::Array[String], request_options: Knockapi::RequestOptions}) } - def to_hash; end + ) + end + + sig do + override.returns( + { + message_ids: T::Array[String], + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash + end end end end diff --git a/rbi/knockapi/models/messages/batch_get_content_response.rbi b/rbi/knockapi/models/messages/batch_get_content_response.rbi index 1eef910a..45f59264 100644 --- a/rbi/knockapi/models/messages/batch_get_content_response.rbi +++ b/rbi/knockapi/models/messages/batch_get_content_response.rbi @@ -4,6 +4,14 @@ module Knockapi module Models module Messages class BatchGetContentResponseItem < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::Messages::BatchGetContentResponseItem, + Knockapi::Internal::AnyHash + ) + end + # The typename of the schema. sig { returns(String) } attr_accessor :_typename @@ -34,18 +42,17 @@ module Knockapi sig do params( _typename: String, - data: T.any( - Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageEmailContent, - Knockapi::Internal::AnyHash, - Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageSMSContent, - Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessagePushContent, - Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageChatContent, - Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent - ), + data: + T.any( + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageEmailContent::OrHash, + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageSMSContent::OrHash, + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessagePushContent::OrHash, + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageChatContent::OrHash, + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::OrHash + ), inserted_at: Time, message_id: String - ) - .returns(T.attached_class) + ).returns(T.attached_class) end def self.new( # The typename of the schema. @@ -56,31 +63,53 @@ module Knockapi inserted_at:, # The unique identifier for the message content. message_id: - ); end + ) + end + sig do - override - .returns( - { - _typename: String, - data: T.any( + override.returns( + { + _typename: String, + data: + T.any( Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageEmailContent, Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageSMSContent, Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessagePushContent, Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageChatContent, Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent ), - inserted_at: Time, - message_id: String - } - ) + inserted_at: Time, + message_id: String + } + ) + end + def to_hash end - def to_hash; end # Content data specific to the channel type. module Data extend Knockapi::Internal::Type::Union + Variants = + T.type_alias do + T.any( + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageEmailContent, + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageSMSContent, + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessagePushContent, + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageChatContent, + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent + ) + end + class MessageEmailContent < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageEmailContent, + Knockapi::Internal::AnyHash + ) + end + # The typename of the schema. sig { returns(String) } attr_accessor :_typename @@ -129,8 +158,7 @@ module Knockapi bcc: T.nilable(String), cc: T.nilable(String), reply_to: T.nilable(String) - ) - .returns(T.attached_class) + ).returns(T.attached_class) end def self.new( # The typename of the schema. @@ -151,27 +179,37 @@ module Knockapi cc: nil, # The reply-to email address. reply_to: nil - ); end + ) + end + sig do - override - .returns( - { - _typename: String, - from: String, - html_body: String, - subject_line: String, - text_body: String, - to: String, - bcc: T.nilable(String), - cc: T.nilable(String), - reply_to: T.nilable(String) - } - ) + override.returns( + { + _typename: String, + from: String, + html_body: String, + subject_line: String, + text_body: String, + to: String, + bcc: T.nilable(String), + cc: T.nilable(String), + reply_to: T.nilable(String) + } + ) + end + def to_hash end - def to_hash; end end class MessageSMSContent < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageSMSContent, + Knockapi::Internal::AnyHash + ) + end + # The typename of the schema. sig { returns(String) } attr_accessor :_typename @@ -185,7 +223,11 @@ module Knockapi attr_accessor :to # The content of an SMS message. - sig { params(_typename: String, body: String, to: String).returns(T.attached_class) } + sig do + params(_typename: String, body: String, to: String).returns( + T.attached_class + ) + end def self.new( # The typename of the schema. _typename:, @@ -193,12 +235,25 @@ module Knockapi body:, # The phone number the SMS was sent to. to: - ); end - sig { override.returns({_typename: String, body: String, to: String}) } - def to_hash; end + ) + end + + sig do + override.returns({ _typename: String, body: String, to: String }) + end + def to_hash + end end class MessagePushContent < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessagePushContent, + Knockapi::Internal::AnyHash + ) + end + # The device token to send the push notification to. sig { returns(String) } attr_accessor :token @@ -227,8 +282,7 @@ module Knockapi body: String, title: String, data: T.nilable(T::Hash[Symbol, T.anything]) - ) - .returns(T.attached_class) + ).returns(T.attached_class) end def self.new( # The device token to send the push notification to. @@ -241,23 +295,33 @@ module Knockapi title:, # Additional data payload for the push notification. data: nil - ); end + ) + end + sig do - override - .returns( - { - token: String, - _typename: String, - body: String, - title: String, - data: T.nilable(T::Hash[Symbol, T.anything]) - } - ) + override.returns( + { + token: String, + _typename: String, + body: String, + title: String, + data: T.nilable(T::Hash[Symbol, T.anything]) + } + ) + end + def to_hash end - def to_hash; end end class MessageChatContent < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageChatContent, + Knockapi::Internal::AnyHash + ) + end + # The typename of the schema. sig { returns(String) } attr_accessor :_typename @@ -267,17 +331,18 @@ module Knockapi attr_accessor :connection # The template structure for the chat message. - sig { returns(Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageChatContent::Template) } + sig do + returns( + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageChatContent::Template + ) + end attr_reader :template sig do params( - template: T.any( - Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageChatContent::Template, - Knockapi::Internal::AnyHash - ) - ) - .void + template: + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageChatContent::Template::OrHash + ).void end attr_writer :template @@ -290,13 +355,10 @@ module Knockapi params( _typename: String, connection: T::Hash[Symbol, T.anything], - template: T.any( - Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageChatContent::Template, - Knockapi::Internal::AnyHash - ), + template: + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageChatContent::Template::OrHash, metadata: T.nilable(T::Hash[Symbol, T.anything]) - ) - .returns(T.attached_class) + ).returns(T.attached_class) end def self.new( # The typename of the schema. @@ -307,26 +369,39 @@ module Knockapi template:, # Additional metadata associated with the chat message. metadata: nil - ); end + ) + end + sig do - override - .returns( - { - _typename: String, - connection: T::Hash[Symbol, T.anything], - template: Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageChatContent::Template, - metadata: T.nilable(T::Hash[Symbol, T.anything]) - } - ) + override.returns( + { + _typename: String, + connection: T::Hash[Symbol, T.anything], + template: + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageChatContent::Template, + metadata: T.nilable(T::Hash[Symbol, T.anything]) + } + ) + end + def to_hash end - def to_hash; end class Template < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageChatContent::Template, + Knockapi::Internal::AnyHash + ) + end + # The blocks of the message in a chat. sig do returns( T.nilable( - T::Array[Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageChatContent::Template::Block] + T::Array[ + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageChatContent::Template::Block + ] ) ) end @@ -343,18 +418,15 @@ module Knockapi # The template structure for the chat message. sig do params( - blocks: T.nilable( - T::Array[ - T.any( - Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageChatContent::Template::Block, - Knockapi::Internal::AnyHash - ) - ] - ), + blocks: + T.nilable( + T::Array[ + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageChatContent::Template::Block::OrHash + ] + ), json_content: T.nilable(T::Hash[Symbol, T.anything]), summary: T.nilable(String) - ) - .returns(T.attached_class) + ).returns(T.attached_class) end def self.new( # The blocks of the message in a chat. @@ -363,22 +435,35 @@ module Knockapi json_content: nil, # The summary of the chat message. summary: nil - ); end + ) + end + sig do - override - .returns( - { - blocks: T.nilable( - T::Array[Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageChatContent::Template::Block] + override.returns( + { + blocks: + T.nilable( + T::Array[ + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageChatContent::Template::Block + ] ), - json_content: T.nilable(T::Hash[Symbol, T.anything]), - summary: T.nilable(String) - } - ) + json_content: T.nilable(T::Hash[Symbol, T.anything]), + summary: T.nilable(String) + } + ) + end + def to_hash end - def to_hash; end class Block < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageChatContent::Template::Block, + Knockapi::Internal::AnyHash + ) + end + # The actual content of the block. sig { returns(String) } attr_accessor :content @@ -400,9 +485,9 @@ module Knockapi params( content: String, name: String, - type: Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageChatContent::Template::Block::Type::OrSymbol - ) - .returns(T.attached_class) + type: + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageChatContent::Template::Block::Type::OrSymbol + ).returns(T.attached_class) end def self.new( # The actual content of the block. @@ -411,18 +496,21 @@ module Knockapi name:, # The type of block in a message in a chat (text or markdown). type: - ); end + ) + end + sig do - override - .returns( - { - content: String, - name: String, - type: Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageChatContent::Template::Block::Type::TaggedSymbol - } - ) + override.returns( + { + content: String, + name: String, + type: + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageChatContent::Template::Block::Type::TaggedSymbol + } + ) + end + def to_hash end - def to_hash; end # The type of block in a message in a chat (text or markdown). module Type @@ -430,7 +518,10 @@ module Knockapi TaggedSymbol = T.type_alias do - T.all(Symbol, Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageChatContent::Template::Block::Type) + T.all( + Symbol, + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageChatContent::Template::Block::Type + ) end OrSymbol = T.type_alias { T.any(Symbol, String) } @@ -446,20 +537,28 @@ module Knockapi ) sig do - override - .returns( - T::Array[ - Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageChatContent::Template::Block::Type::TaggedSymbol - ] - ) + override.returns( + T::Array[ + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageChatContent::Template::Block::Type::TaggedSymbol + ] + ) + end + def self.values end - def self.values; end end end end end class MessageInAppFeedContent < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent, + Knockapi::Internal::AnyHash + ) + end + # The typename of the schema. sig { returns(String) } attr_accessor :_typename @@ -481,43 +580,61 @@ module Knockapi sig do params( _typename: String, - blocks: T::Array[ - T.any( - Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock, - Knockapi::Internal::AnyHash, - Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock - ) - ] - ) - .returns(T.attached_class) + blocks: + T::Array[ + T.any( + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock::OrHash, + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock::OrHash + ) + ] + ).returns(T.attached_class) end def self.new( # The typename of the schema. _typename:, # The blocks of the message in an app feed. blocks: - ); end + ) + end + sig do - override - .returns( - { - _typename: String, - blocks: T::Array[ + override.returns( + { + _typename: String, + blocks: + T::Array[ T.any( Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock, Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock ) ] - } - ) + } + ) + end + def to_hash end - def to_hash; end # A block in a message in an app feed. module Block extend Knockapi::Internal::Type::Union + Variants = + T.type_alias do + T.any( + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock, + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock + ) + end + class MessageInAppFeedContentBlock < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock, + Knockapi::Internal::AnyHash + ) + end + # The content of the block in a message in an app feed. sig { returns(String) } attr_accessor :content @@ -544,9 +661,9 @@ module Knockapi content: String, name: String, rendered: String, - type: Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock::Type::OrSymbol - ) - .returns(T.attached_class) + type: + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock::Type::OrSymbol + ).returns(T.attached_class) end def self.new( # The content of the block in a message in an app feed. @@ -557,19 +674,22 @@ module Knockapi rendered:, # The type of block in a message in an app feed. type: - ); end + ) + end + sig do - override - .returns( - { - content: String, - name: String, - rendered: String, - type: Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock::Type::TaggedSymbol - } - ) + override.returns( + { + content: String, + name: String, + rendered: String, + type: + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock::Type::TaggedSymbol + } + ) + end + def to_hash end - def to_hash; end # The type of block in a message in an app feed. module Type @@ -577,7 +697,10 @@ module Knockapi TaggedSymbol = T.type_alias do - T.all(Symbol, Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock::Type) + T.all( + Symbol, + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock::Type + ) end OrSymbol = T.type_alias { T.any(Symbol, String) } @@ -593,18 +716,26 @@ module Knockapi ) sig do - override - .returns( - T::Array[ - Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock::Type::TaggedSymbol - ] - ) + override.returns( + T::Array[ + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock::Type::TaggedSymbol + ] + ) + end + def self.values end - def self.values; end end end class MessageInAppFeedButtonSetBlock < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock, + Knockapi::Internal::AnyHash + ) + end + # A list of buttons in an in app feed message. sig do returns( @@ -630,16 +761,14 @@ module Knockapi # A button set block in a message in an app feed. sig do params( - buttons: T::Array[ - T.any( - Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock::Button, - Knockapi::Internal::AnyHash - ) - ], + buttons: + T::Array[ + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock::Button::OrHash + ], name: String, - type: Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock::Type::OrSymbol - ) - .returns(T.attached_class) + type: + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock::Type::OrSymbol + ).returns(T.attached_class) end def self.new( # A list of buttons in an in app feed message. @@ -648,22 +777,34 @@ module Knockapi name:, # The type of block in a message in an app feed. type: - ); end + ) + end + sig do - override - .returns( - { - buttons: T::Array[ + override.returns( + { + buttons: + T::Array[ Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock::Button ], - name: String, - type: Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock::Type::TaggedSymbol - } - ) + name: String, + type: + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock::Type::TaggedSymbol + } + ) + end + def to_hash end - def to_hash; end class Button < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock::Button, + Knockapi::Internal::AnyHash + ) + end + # The action to take when the button is clicked. sig { returns(String) } attr_accessor :action @@ -677,7 +818,11 @@ module Knockapi attr_accessor :name # A button in an in app feed message. - sig { params(action: String, label: String, name: String).returns(T.attached_class) } + sig do + params(action: String, label: String, name: String).returns( + T.attached_class + ) + end def self.new( # The action to take when the button is clicked. action:, @@ -685,9 +830,16 @@ module Knockapi label:, # The name of the button. name: - ); end - sig { override.returns({action: String, label: String, name: String}) } - def to_hash; end + ) + end + + sig do + override.returns( + { action: String, label: String, name: String } + ) + end + def to_hash + end end # The type of block in a message in an app feed. @@ -696,7 +848,10 @@ module Knockapi TaggedSymbol = T.type_alias do - T.all(Symbol, Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock::Type) + T.all( + Symbol, + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock::Type + ) end OrSymbol = T.type_alias { T.any(Symbol, String) } @@ -707,40 +862,46 @@ module Knockapi ) sig do - override - .returns( - T::Array[ - Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock::Type::TaggedSymbol - ] - ) + override.returns( + T::Array[ + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock::Type::TaggedSymbol + ] + ) + end + def self.values end - def self.values; end end end sig do - override - .returns( - [Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock, Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock] - ) + override.returns( + T::Array[ + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::Variants + ] + ) + end + def self.variants end - def self.variants; end end end sig do - override - .returns( - [Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageEmailContent, Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageSMSContent, Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessagePushContent, Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageChatContent, Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent] - ) + override.returns( + T::Array[ + Knockapi::Models::Messages::BatchGetContentResponseItem::Data::Variants + ] + ) + end + def self.variants end - def self.variants; end end end BatchGetContentResponse = T.let( - Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Messages::BatchGetContentResponseItem], + Knockapi::Internal::Type::ArrayOf[ + Knockapi::Models::Messages::BatchGetContentResponseItem + ], Knockapi::Internal::Type::Converter ) end diff --git a/rbi/knockapi/models/messages/batch_mark_as_interacted_params.rbi b/rbi/knockapi/models/messages/batch_mark_as_interacted_params.rbi index e67863fa..6ae3c144 100644 --- a/rbi/knockapi/models/messages/batch_mark_as_interacted_params.rbi +++ b/rbi/knockapi/models/messages/batch_mark_as_interacted_params.rbi @@ -7,6 +7,14 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::Messages::BatchMarkAsInteractedParams, + Knockapi::Internal::AnyHash + ) + end + # The message IDs to batch mark as interacted with. sig { returns(T::Array[String]) } attr_accessor :message_ids @@ -19,9 +27,8 @@ module Knockapi params( message_ids: T::Array[String], metadata: T.nilable(T::Hash[Symbol, T.anything]), - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # The message IDs to batch mark as interacted with. @@ -29,18 +36,20 @@ module Knockapi # Metadata about the interaction. metadata: nil, request_options: {} - ); end + ) + end + sig do - override - .returns( - { - message_ids: T::Array[String], - metadata: T.nilable(T::Hash[Symbol, T.anything]), - request_options: Knockapi::RequestOptions - } - ) + override.returns( + { + message_ids: T::Array[String], + metadata: T.nilable(T::Hash[Symbol, T.anything]), + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/messages/batch_mark_as_interacted_response.rbi b/rbi/knockapi/models/messages/batch_mark_as_interacted_response.rbi index d22c8b5f..8bfa535c 100644 --- a/rbi/knockapi/models/messages/batch_mark_as_interacted_response.rbi +++ b/rbi/knockapi/models/messages/batch_mark_as_interacted_response.rbi @@ -4,7 +4,10 @@ module Knockapi module Models module Messages BatchMarkAsInteractedResponse = - T.let(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Message], Knockapi::Internal::Type::Converter) + T.let( + Knockapi::Internal::Type::ArrayOf[Knockapi::Message], + Knockapi::Internal::Type::Converter + ) end end end diff --git a/rbi/knockapi/models/messages/batch_mark_as_read_params.rbi b/rbi/knockapi/models/messages/batch_mark_as_read_params.rbi index 5be053dd..5de8a1e4 100644 --- a/rbi/knockapi/models/messages/batch_mark_as_read_params.rbi +++ b/rbi/knockapi/models/messages/batch_mark_as_read_params.rbi @@ -7,6 +7,14 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::Messages::BatchMarkAsReadParams, + Knockapi::Internal::AnyHash + ) + end + # The message IDs to update the status of. sig { returns(T::Array[String]) } attr_accessor :message_ids @@ -14,17 +22,26 @@ module Knockapi sig do params( message_ids: T::Array[String], - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # The message IDs to update the status of. message_ids:, request_options: {} - ); end - sig { override.returns({message_ids: T::Array[String], request_options: Knockapi::RequestOptions}) } - def to_hash; end + ) + end + + sig do + override.returns( + { + message_ids: T::Array[String], + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash + end end end end diff --git a/rbi/knockapi/models/messages/batch_mark_as_read_response.rbi b/rbi/knockapi/models/messages/batch_mark_as_read_response.rbi index 8f0a212e..08e4aea6 100644 --- a/rbi/knockapi/models/messages/batch_mark_as_read_response.rbi +++ b/rbi/knockapi/models/messages/batch_mark_as_read_response.rbi @@ -4,7 +4,10 @@ module Knockapi module Models module Messages BatchMarkAsReadResponse = - T.let(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Message], Knockapi::Internal::Type::Converter) + T.let( + Knockapi::Internal::Type::ArrayOf[Knockapi::Message], + Knockapi::Internal::Type::Converter + ) end end end diff --git a/rbi/knockapi/models/messages/batch_mark_as_seen_params.rbi b/rbi/knockapi/models/messages/batch_mark_as_seen_params.rbi index 4ae97e41..2a4dc2ee 100644 --- a/rbi/knockapi/models/messages/batch_mark_as_seen_params.rbi +++ b/rbi/knockapi/models/messages/batch_mark_as_seen_params.rbi @@ -7,6 +7,14 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::Messages::BatchMarkAsSeenParams, + Knockapi::Internal::AnyHash + ) + end + # The message IDs to update the status of. sig { returns(T::Array[String]) } attr_accessor :message_ids @@ -14,17 +22,26 @@ module Knockapi sig do params( message_ids: T::Array[String], - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # The message IDs to update the status of. message_ids:, request_options: {} - ); end - sig { override.returns({message_ids: T::Array[String], request_options: Knockapi::RequestOptions}) } - def to_hash; end + ) + end + + sig do + override.returns( + { + message_ids: T::Array[String], + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash + end end end end diff --git a/rbi/knockapi/models/messages/batch_mark_as_seen_response.rbi b/rbi/knockapi/models/messages/batch_mark_as_seen_response.rbi index 22c0a6bb..12b735c0 100644 --- a/rbi/knockapi/models/messages/batch_mark_as_seen_response.rbi +++ b/rbi/knockapi/models/messages/batch_mark_as_seen_response.rbi @@ -4,7 +4,10 @@ module Knockapi module Models module Messages BatchMarkAsSeenResponse = - T.let(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Message], Knockapi::Internal::Type::Converter) + T.let( + Knockapi::Internal::Type::ArrayOf[Knockapi::Message], + Knockapi::Internal::Type::Converter + ) end end end diff --git a/rbi/knockapi/models/messages/batch_mark_as_unread_params.rbi b/rbi/knockapi/models/messages/batch_mark_as_unread_params.rbi index b65d36ab..54c46c48 100644 --- a/rbi/knockapi/models/messages/batch_mark_as_unread_params.rbi +++ b/rbi/knockapi/models/messages/batch_mark_as_unread_params.rbi @@ -7,6 +7,14 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::Messages::BatchMarkAsUnreadParams, + Knockapi::Internal::AnyHash + ) + end + # The message IDs to update the status of. sig { returns(T::Array[String]) } attr_accessor :message_ids @@ -14,17 +22,26 @@ module Knockapi sig do params( message_ids: T::Array[String], - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # The message IDs to update the status of. message_ids:, request_options: {} - ); end - sig { override.returns({message_ids: T::Array[String], request_options: Knockapi::RequestOptions}) } - def to_hash; end + ) + end + + sig do + override.returns( + { + message_ids: T::Array[String], + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash + end end end end diff --git a/rbi/knockapi/models/messages/batch_mark_as_unread_response.rbi b/rbi/knockapi/models/messages/batch_mark_as_unread_response.rbi index f79ffb4a..2f21953c 100644 --- a/rbi/knockapi/models/messages/batch_mark_as_unread_response.rbi +++ b/rbi/knockapi/models/messages/batch_mark_as_unread_response.rbi @@ -4,7 +4,10 @@ module Knockapi module Models module Messages BatchMarkAsUnreadResponse = - T.let(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Message], Knockapi::Internal::Type::Converter) + T.let( + Knockapi::Internal::Type::ArrayOf[Knockapi::Message], + Knockapi::Internal::Type::Converter + ) end end end diff --git a/rbi/knockapi/models/messages/batch_mark_as_unseen_params.rbi b/rbi/knockapi/models/messages/batch_mark_as_unseen_params.rbi index 57357c2a..763738ca 100644 --- a/rbi/knockapi/models/messages/batch_mark_as_unseen_params.rbi +++ b/rbi/knockapi/models/messages/batch_mark_as_unseen_params.rbi @@ -7,6 +7,14 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::Messages::BatchMarkAsUnseenParams, + Knockapi::Internal::AnyHash + ) + end + # The message IDs to update the status of. sig { returns(T::Array[String]) } attr_accessor :message_ids @@ -14,17 +22,26 @@ module Knockapi sig do params( message_ids: T::Array[String], - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # The message IDs to update the status of. message_ids:, request_options: {} - ); end - sig { override.returns({message_ids: T::Array[String], request_options: Knockapi::RequestOptions}) } - def to_hash; end + ) + end + + sig do + override.returns( + { + message_ids: T::Array[String], + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash + end end end end diff --git a/rbi/knockapi/models/messages/batch_mark_as_unseen_response.rbi b/rbi/knockapi/models/messages/batch_mark_as_unseen_response.rbi index 0d06d881..d2860fc5 100644 --- a/rbi/knockapi/models/messages/batch_mark_as_unseen_response.rbi +++ b/rbi/knockapi/models/messages/batch_mark_as_unseen_response.rbi @@ -4,7 +4,10 @@ module Knockapi module Models module Messages BatchMarkAsUnseenResponse = - T.let(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Message], Knockapi::Internal::Type::Converter) + T.let( + Knockapi::Internal::Type::ArrayOf[Knockapi::Message], + Knockapi::Internal::Type::Converter + ) end end end diff --git a/rbi/knockapi/models/messages/batch_unarchive_params.rbi b/rbi/knockapi/models/messages/batch_unarchive_params.rbi index bb1c61e5..71103702 100644 --- a/rbi/knockapi/models/messages/batch_unarchive_params.rbi +++ b/rbi/knockapi/models/messages/batch_unarchive_params.rbi @@ -7,6 +7,14 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::Messages::BatchUnarchiveParams, + Knockapi::Internal::AnyHash + ) + end + # The message IDs to update the status of. sig { returns(T::Array[String]) } attr_accessor :message_ids @@ -14,17 +22,26 @@ module Knockapi sig do params( message_ids: T::Array[String], - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # The message IDs to update the status of. message_ids:, request_options: {} - ); end - sig { override.returns({message_ids: T::Array[String], request_options: Knockapi::RequestOptions}) } - def to_hash; end + ) + end + + sig do + override.returns( + { + message_ids: T::Array[String], + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash + end end end end diff --git a/rbi/knockapi/models/messages/batch_unarchive_response.rbi b/rbi/knockapi/models/messages/batch_unarchive_response.rbi index ef14fc58..af864800 100644 --- a/rbi/knockapi/models/messages/batch_unarchive_response.rbi +++ b/rbi/knockapi/models/messages/batch_unarchive_response.rbi @@ -4,7 +4,10 @@ module Knockapi module Models module Messages BatchUnarchiveResponse = - T.let(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Message], Knockapi::Internal::Type::Converter) + T.let( + Knockapi::Internal::Type::ArrayOf[Knockapi::Message], + Knockapi::Internal::Type::Converter + ) end end end diff --git a/rbi/knockapi/models/object.rbi b/rbi/knockapi/models/object.rbi index 62d7cb22..18593b72 100644 --- a/rbi/knockapi/models/object.rbi +++ b/rbi/knockapi/models/object.rbi @@ -3,6 +3,9 @@ module Knockapi module Models class Object < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Knockapi::Object, Knockapi::Internal::AnyHash) } + # Unique identifier for the object. sig { returns(String) } attr_accessor :id @@ -23,6 +26,13 @@ module Knockapi sig { returns(T.nilable(Time)) } attr_accessor :created_at + # The custom properties associated with the object. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :properties + + sig { params(properties: T::Hash[Symbol, T.anything]).void } + attr_writer :properties + # A custom [Object](/concepts/objects) entity which belongs to a collection. sig do params( @@ -30,9 +40,9 @@ module Knockapi _typename: String, collection: String, updated_at: Time, - created_at: T.nilable(Time) - ) - .returns(T.attached_class) + created_at: T.nilable(Time), + properties: T::Hash[Symbol, T.anything] + ).returns(T.attached_class) end def self.new( # Unique identifier for the object. @@ -44,15 +54,26 @@ module Knockapi # The timestamp when the resource was last updated. updated_at:, # Timestamp when the resource was created. - created_at: nil - ); end + created_at: nil, + # The custom properties associated with the object. + properties: nil + ) + end + sig do - override - .returns( - {id: String, _typename: String, collection: String, updated_at: Time, created_at: T.nilable(Time)} - ) + override.returns( + { + id: String, + _typename: String, + collection: String, + updated_at: Time, + created_at: T.nilable(Time), + properties: T::Hash[Symbol, T.anything] + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/object_add_subscriptions_params.rbi b/rbi/knockapi/models/object_add_subscriptions_params.rbi index 7128707a..64878859 100644 --- a/rbi/knockapi/models/object_add_subscriptions_params.rbi +++ b/rbi/knockapi/models/object_add_subscriptions_params.rbi @@ -6,11 +6,25 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::ObjectAddSubscriptionsParams, + Knockapi::Internal::AnyHash + ) + end + # The recipients of the subscription. You can subscribe up to 100 recipients to an # object at a time. sig do returns( - T::Array[T.any(String, Knockapi::Models::InlineIdentifyUserRequest, Knockapi::Models::InlineObjectRequest)] + T::Array[ + T.any( + String, + Knockapi::InlineIdentifyUserRequest, + Knockapi::InlineObjectRequest + ) + ] ) end attr_accessor :recipients @@ -21,18 +35,17 @@ module Knockapi sig do params( - recipients: T::Array[ - T.any( - String, - Knockapi::Models::InlineIdentifyUserRequest, - Knockapi::Internal::AnyHash, - Knockapi::Models::InlineObjectRequest - ) - ], + recipients: + T::Array[ + T.any( + String, + Knockapi::InlineIdentifyUserRequest::OrHash, + Knockapi::InlineObjectRequest::OrHash + ) + ], properties: T.nilable(T::Hash[Symbol, T.anything]), - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # The recipients of the subscription. You can subscribe up to 100 recipients to an @@ -41,18 +54,27 @@ module Knockapi # The custom properties associated with the subscription relationship. properties: nil, request_options: {} - ); end + ) + end + sig do - override - .returns( - { - recipients: T::Array[T.any(String, Knockapi::Models::InlineIdentifyUserRequest, Knockapi::Models::InlineObjectRequest)], - properties: T.nilable(T::Hash[Symbol, T.anything]), - request_options: Knockapi::RequestOptions - } - ) + override.returns( + { + recipients: + T::Array[ + T.any( + String, + Knockapi::InlineIdentifyUserRequest, + Knockapi::InlineObjectRequest + ) + ], + properties: T.nilable(T::Hash[Symbol, T.anything]), + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/object_add_subscriptions_response.rbi b/rbi/knockapi/models/object_add_subscriptions_response.rbi index 9ec49aaa..923769f7 100644 --- a/rbi/knockapi/models/object_add_subscriptions_response.rbi +++ b/rbi/knockapi/models/object_add_subscriptions_response.rbi @@ -4,7 +4,7 @@ module Knockapi module Models ObjectAddSubscriptionsResponse = T.let( - Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Recipients::Subscription], + Knockapi::Internal::Type::ArrayOf[Knockapi::Recipients::Subscription], Knockapi::Internal::Type::Converter ) end diff --git a/rbi/knockapi/models/object_delete_params.rbi b/rbi/knockapi/models/object_delete_params.rbi index dca83e69..c4bb8e96 100644 --- a/rbi/knockapi/models/object_delete_params.rbi +++ b/rbi/knockapi/models/object_delete_params.rbi @@ -6,14 +6,22 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any(Knockapi::ObjectDeleteParams, Knockapi::Internal::AnyHash) + end + sig do - params(request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash)) - .returns(T.attached_class) + params(request_options: Knockapi::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) end - def self.new(request_options: {}); end - sig { override.returns({request_options: Knockapi::RequestOptions}) } - def to_hash; end + sig { override.returns({ request_options: Knockapi::RequestOptions }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/object_delete_response.rbi b/rbi/knockapi/models/object_delete_response.rbi new file mode 100644 index 00000000..a21f6f93 --- /dev/null +++ b/rbi/knockapi/models/object_delete_response.rbi @@ -0,0 +1,7 @@ +# typed: strong + +module Knockapi + module Models + ObjectDeleteResponse = String + end +end diff --git a/rbi/knockapi/models/object_delete_subscriptions_params.rbi b/rbi/knockapi/models/object_delete_subscriptions_params.rbi index a193ac6f..72e382b0 100644 --- a/rbi/knockapi/models/object_delete_subscriptions_params.rbi +++ b/rbi/knockapi/models/object_delete_subscriptions_params.rbi @@ -6,34 +6,56 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::ObjectDeleteSubscriptionsParams, + Knockapi::Internal::AnyHash + ) + end + # The recipients of the subscription. You can subscribe up to 100 recipients to an # object at a time. - sig { returns(T::Array[T.any(String, Knockapi::Models::RecipientReference::ObjectReference)]) } + sig do + returns( + T::Array[T.any(String, Knockapi::RecipientReference::ObjectReference)] + ) + end attr_accessor :recipients sig do params( - recipients: T::Array[T.any(String, Knockapi::Models::RecipientReference::ObjectReference, Knockapi::Internal::AnyHash)], - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + recipients: + T::Array[ + T.any( + String, + Knockapi::RecipientReference::ObjectReference::OrHash + ) + ], + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # The recipients of the subscription. You can subscribe up to 100 recipients to an # object at a time. recipients:, request_options: {} - ); end + ) + end + sig do - override - .returns( - { - recipients: T::Array[T.any(String, Knockapi::Models::RecipientReference::ObjectReference)], - request_options: Knockapi::RequestOptions - } - ) + override.returns( + { + recipients: + T::Array[ + T.any(String, Knockapi::RecipientReference::ObjectReference) + ], + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/object_delete_subscriptions_response.rbi b/rbi/knockapi/models/object_delete_subscriptions_response.rbi index 7e8a23f8..acd5f0a5 100644 --- a/rbi/knockapi/models/object_delete_subscriptions_response.rbi +++ b/rbi/knockapi/models/object_delete_subscriptions_response.rbi @@ -4,7 +4,7 @@ module Knockapi module Models ObjectDeleteSubscriptionsResponse = T.let( - Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Recipients::Subscription], + Knockapi::Internal::Type::ArrayOf[Knockapi::Recipients::Subscription], Knockapi::Internal::Type::Converter ) end diff --git a/rbi/knockapi/models/object_get_channel_data_params.rbi b/rbi/knockapi/models/object_get_channel_data_params.rbi index fc1c7557..b77b7971 100644 --- a/rbi/knockapi/models/object_get_channel_data_params.rbi +++ b/rbi/knockapi/models/object_get_channel_data_params.rbi @@ -6,14 +6,25 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::ObjectGetChannelDataParams, + Knockapi::Internal::AnyHash + ) + end + sig do - params(request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash)) - .returns(T.attached_class) + params(request_options: Knockapi::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) end - def self.new(request_options: {}); end - sig { override.returns({request_options: Knockapi::RequestOptions}) } - def to_hash; end + sig { override.returns({ request_options: Knockapi::RequestOptions }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/object_get_params.rbi b/rbi/knockapi/models/object_get_params.rbi index 10962596..d897b069 100644 --- a/rbi/knockapi/models/object_get_params.rbi +++ b/rbi/knockapi/models/object_get_params.rbi @@ -6,14 +6,22 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any(Knockapi::ObjectGetParams, Knockapi::Internal::AnyHash) + end + sig do - params(request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash)) - .returns(T.attached_class) + params(request_options: Knockapi::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) end - def self.new(request_options: {}); end - sig { override.returns({request_options: Knockapi::RequestOptions}) } - def to_hash; end + sig { override.returns({ request_options: Knockapi::RequestOptions }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/object_get_preferences_params.rbi b/rbi/knockapi/models/object_get_preferences_params.rbi index f6ab0c33..4a6ade0d 100644 --- a/rbi/knockapi/models/object_get_preferences_params.rbi +++ b/rbi/knockapi/models/object_get_preferences_params.rbi @@ -6,14 +6,25 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::ObjectGetPreferencesParams, + Knockapi::Internal::AnyHash + ) + end + sig do - params(request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash)) - .returns(T.attached_class) + params(request_options: Knockapi::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) end - def self.new(request_options: {}); end - sig { override.returns({request_options: Knockapi::RequestOptions}) } - def to_hash; end + sig { override.returns({ request_options: Knockapi::RequestOptions }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/object_list_messages_params.rbi b/rbi/knockapi/models/object_list_messages_params.rbi index bd865ed5..9e4a7a6c 100644 --- a/rbi/knockapi/models/object_list_messages_params.rbi +++ b/rbi/knockapi/models/object_list_messages_params.rbi @@ -6,6 +6,11 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any(Knockapi::ObjectListMessagesParams, Knockapi::Internal::AnyHash) + end + # The cursor to fetch entries after. sig { returns(T.nilable(String)) } attr_reader :after @@ -28,25 +33,34 @@ module Knockapi attr_writer :channel_id # Limits the results to messages with the given engagement status. - sig { returns(T.nilable(T::Array[Knockapi::Models::ObjectListMessagesParams::EngagementStatus::OrSymbol])) } + sig do + returns( + T.nilable( + T::Array[ + Knockapi::ObjectListMessagesParams::EngagementStatus::OrSymbol + ] + ) + ) + end attr_reader :engagement_status sig do params( - engagement_status: T::Array[Knockapi::Models::ObjectListMessagesParams::EngagementStatus::OrSymbol] - ) - .void + engagement_status: + T::Array[ + Knockapi::ObjectListMessagesParams::EngagementStatus::OrSymbol + ] + ).void end attr_writer :engagement_status - sig { returns(T.nilable(Knockapi::Models::ObjectListMessagesParams::InsertedAt)) } + sig { returns(T.nilable(Knockapi::ObjectListMessagesParams::InsertedAt)) } attr_reader :inserted_at sig do params( - inserted_at: T.any(Knockapi::Models::ObjectListMessagesParams::InsertedAt, Knockapi::Internal::AnyHash) - ) - .void + inserted_at: Knockapi::ObjectListMessagesParams::InsertedAt::OrHash + ).void end attr_writer :inserted_at @@ -73,10 +87,20 @@ module Knockapi attr_writer :source # Limits the results to messages with the given delivery status. - sig { returns(T.nilable(T::Array[Knockapi::Models::ObjectListMessagesParams::Status::OrSymbol])) } + sig do + returns( + T.nilable( + T::Array[Knockapi::ObjectListMessagesParams::Status::OrSymbol] + ) + ) + end attr_reader :status - sig { params(status: T::Array[Knockapi::Models::ObjectListMessagesParams::Status::OrSymbol]).void } + sig do + params( + status: T::Array[Knockapi::ObjectListMessagesParams::Status::OrSymbol] + ).void + end attr_writer :status # Limits the results to items with the corresponding tenant. @@ -122,20 +146,23 @@ module Knockapi after: String, before: String, channel_id: String, - engagement_status: T::Array[Knockapi::Models::ObjectListMessagesParams::EngagementStatus::OrSymbol], - inserted_at: T.any(Knockapi::Models::ObjectListMessagesParams::InsertedAt, Knockapi::Internal::AnyHash), + engagement_status: + T::Array[ + Knockapi::ObjectListMessagesParams::EngagementStatus::OrSymbol + ], + inserted_at: Knockapi::ObjectListMessagesParams::InsertedAt::OrHash, message_ids: T::Array[String], page_size: Integer, source: String, - status: T::Array[Knockapi::Models::ObjectListMessagesParams::Status::OrSymbol], + status: + T::Array[Knockapi::ObjectListMessagesParams::Status::OrSymbol], tenant: String, trigger_data: String, workflow_categories: T::Array[String], workflow_recipient_run_id: String, workflow_run_id: String, - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # The cursor to fetch entries after. @@ -170,51 +197,92 @@ module Knockapi # returned by the workflow trigger request. workflow_run_id: nil, request_options: {} - ); end + ) + end + sig do - override - .returns( - { - after: String, - before: String, - channel_id: String, - engagement_status: T::Array[Knockapi::Models::ObjectListMessagesParams::EngagementStatus::OrSymbol], - inserted_at: Knockapi::Models::ObjectListMessagesParams::InsertedAt, - message_ids: T::Array[String], - page_size: Integer, - source: String, - status: T::Array[Knockapi::Models::ObjectListMessagesParams::Status::OrSymbol], - tenant: String, - trigger_data: String, - workflow_categories: T::Array[String], - workflow_recipient_run_id: String, - workflow_run_id: String, - request_options: Knockapi::RequestOptions - } - ) + override.returns( + { + after: String, + before: String, + channel_id: String, + engagement_status: + T::Array[ + Knockapi::ObjectListMessagesParams::EngagementStatus::OrSymbol + ], + inserted_at: Knockapi::ObjectListMessagesParams::InsertedAt, + message_ids: T::Array[String], + page_size: Integer, + source: String, + status: + T::Array[Knockapi::ObjectListMessagesParams::Status::OrSymbol], + tenant: String, + trigger_data: String, + workflow_categories: T::Array[String], + workflow_recipient_run_id: String, + workflow_run_id: String, + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end module EngagementStatus extend Knockapi::Internal::Type::Enum TaggedSymbol = - T.type_alias { T.all(Symbol, Knockapi::Models::ObjectListMessagesParams::EngagementStatus) } + T.type_alias do + T.all(Symbol, Knockapi::ObjectListMessagesParams::EngagementStatus) + end OrSymbol = T.type_alias { T.any(Symbol, String) } - SEEN = T.let(:seen, Knockapi::Models::ObjectListMessagesParams::EngagementStatus::TaggedSymbol) - READ = T.let(:read, Knockapi::Models::ObjectListMessagesParams::EngagementStatus::TaggedSymbol) + SEEN = + T.let( + :seen, + Knockapi::ObjectListMessagesParams::EngagementStatus::TaggedSymbol + ) + READ = + T.let( + :read, + Knockapi::ObjectListMessagesParams::EngagementStatus::TaggedSymbol + ) INTERACTED = - T.let(:interacted, Knockapi::Models::ObjectListMessagesParams::EngagementStatus::TaggedSymbol) + T.let( + :interacted, + Knockapi::ObjectListMessagesParams::EngagementStatus::TaggedSymbol + ) LINK_CLICKED = - T.let(:link_clicked, Knockapi::Models::ObjectListMessagesParams::EngagementStatus::TaggedSymbol) - ARCHIVED = T.let(:archived, Knockapi::Models::ObjectListMessagesParams::EngagementStatus::TaggedSymbol) + T.let( + :link_clicked, + Knockapi::ObjectListMessagesParams::EngagementStatus::TaggedSymbol + ) + ARCHIVED = + T.let( + :archived, + Knockapi::ObjectListMessagesParams::EngagementStatus::TaggedSymbol + ) - sig { override.returns(T::Array[Knockapi::Models::ObjectListMessagesParams::EngagementStatus::TaggedSymbol]) } - def self.values; end + sig do + override.returns( + T::Array[ + Knockapi::ObjectListMessagesParams::EngagementStatus::TaggedSymbol + ] + ) + end + def self.values + end end class InsertedAt < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::ObjectListMessagesParams::InsertedAt, + Knockapi::Internal::AnyHash + ) + end + # Limits the results to messages inserted after the given date. sig { returns(T.nilable(String)) } attr_reader :gt @@ -243,7 +311,11 @@ module Knockapi sig { params(lte: String).void } attr_writer :lte - sig { params(gt: String, gte: String, lt: String, lte: String).returns(T.attached_class) } + sig do + params(gt: String, gte: String, lt: String, lte: String).returns( + T.attached_class + ) + end def self.new( # Limits the results to messages inserted after the given date. gt: nil, @@ -253,28 +325,65 @@ module Knockapi lt: nil, # Limits the results to messages inserted before or on the given date. lte: nil - ); end - sig { override.returns({gt: String, gte: String, lt: String, lte: String}) } - def to_hash; end + ) + end + + sig do + override.returns({ gt: String, gte: String, lt: String, lte: String }) + end + def to_hash + end end module Status extend Knockapi::Internal::Type::Enum - TaggedSymbol = T.type_alias { T.all(Symbol, Knockapi::Models::ObjectListMessagesParams::Status) } + TaggedSymbol = + T.type_alias do + T.all(Symbol, Knockapi::ObjectListMessagesParams::Status) + end OrSymbol = T.type_alias { T.any(Symbol, String) } - QUEUED = T.let(:queued, Knockapi::Models::ObjectListMessagesParams::Status::TaggedSymbol) - SENT = T.let(:sent, Knockapi::Models::ObjectListMessagesParams::Status::TaggedSymbol) - DELIVERED = T.let(:delivered, Knockapi::Models::ObjectListMessagesParams::Status::TaggedSymbol) + QUEUED = + T.let( + :queued, + Knockapi::ObjectListMessagesParams::Status::TaggedSymbol + ) + SENT = + T.let(:sent, Knockapi::ObjectListMessagesParams::Status::TaggedSymbol) + DELIVERED = + T.let( + :delivered, + Knockapi::ObjectListMessagesParams::Status::TaggedSymbol + ) DELIVERY_ATTEMPTED = - T.let(:delivery_attempted, Knockapi::Models::ObjectListMessagesParams::Status::TaggedSymbol) - UNDELIVERED = T.let(:undelivered, Knockapi::Models::ObjectListMessagesParams::Status::TaggedSymbol) - NOT_SENT = T.let(:not_sent, Knockapi::Models::ObjectListMessagesParams::Status::TaggedSymbol) - BOUNCED = T.let(:bounced, Knockapi::Models::ObjectListMessagesParams::Status::TaggedSymbol) + T.let( + :delivery_attempted, + Knockapi::ObjectListMessagesParams::Status::TaggedSymbol + ) + UNDELIVERED = + T.let( + :undelivered, + Knockapi::ObjectListMessagesParams::Status::TaggedSymbol + ) + NOT_SENT = + T.let( + :not_sent, + Knockapi::ObjectListMessagesParams::Status::TaggedSymbol + ) + BOUNCED = + T.let( + :bounced, + Knockapi::ObjectListMessagesParams::Status::TaggedSymbol + ) - sig { override.returns(T::Array[Knockapi::Models::ObjectListMessagesParams::Status::TaggedSymbol]) } - def self.values; end + sig do + override.returns( + T::Array[Knockapi::ObjectListMessagesParams::Status::TaggedSymbol] + ) + end + def self.values + end end end end diff --git a/rbi/knockapi/models/object_list_params.rbi b/rbi/knockapi/models/object_list_params.rbi index 85839b1b..c98d854d 100644 --- a/rbi/knockapi/models/object_list_params.rbi +++ b/rbi/knockapi/models/object_list_params.rbi @@ -6,6 +6,11 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any(Knockapi::ObjectListParams, Knockapi::Internal::AnyHash) + end + # The cursor to fetch entries after. sig { returns(T.nilable(String)) } attr_reader :after @@ -21,10 +26,18 @@ module Knockapi attr_writer :before # Includes preferences of the objects in the response. - sig { returns(T.nilable(T::Array[Knockapi::Models::ObjectListParams::Include::OrSymbol])) } + sig do + returns( + T.nilable(T::Array[Knockapi::ObjectListParams::Include::OrSymbol]) + ) + end attr_reader :include - sig { params(include: T::Array[Knockapi::Models::ObjectListParams::Include::OrSymbol]).void } + sig do + params( + include: T::Array[Knockapi::ObjectListParams::Include::OrSymbol] + ).void + end attr_writer :include # The number of items per page. @@ -38,11 +51,10 @@ module Knockapi params( after: String, before: String, - include: T::Array[Knockapi::Models::ObjectListParams::Include::OrSymbol], + include: T::Array[Knockapi::ObjectListParams::Include::OrSymbol], page_size: Integer, - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # The cursor to fetch entries after. @@ -54,31 +66,40 @@ module Knockapi # The number of items per page. page_size: nil, request_options: {} - ); end + ) + end + sig do - override - .returns( - { - after: String, - before: String, - include: T::Array[Knockapi::Models::ObjectListParams::Include::OrSymbol], - page_size: Integer, - request_options: Knockapi::RequestOptions - } - ) + override.returns( + { + after: String, + before: String, + include: T::Array[Knockapi::ObjectListParams::Include::OrSymbol], + page_size: Integer, + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end module Include extend Knockapi::Internal::Type::Enum - TaggedSymbol = T.type_alias { T.all(Symbol, Knockapi::Models::ObjectListParams::Include) } + TaggedSymbol = + T.type_alias { T.all(Symbol, Knockapi::ObjectListParams::Include) } OrSymbol = T.type_alias { T.any(Symbol, String) } - PREFERENCES = T.let(:preferences, Knockapi::Models::ObjectListParams::Include::TaggedSymbol) + PREFERENCES = + T.let(:preferences, Knockapi::ObjectListParams::Include::TaggedSymbol) - sig { override.returns(T::Array[Knockapi::Models::ObjectListParams::Include::TaggedSymbol]) } - def self.values; end + sig do + override.returns( + T::Array[Knockapi::ObjectListParams::Include::TaggedSymbol] + ) + end + def self.values + end end end end diff --git a/rbi/knockapi/models/object_list_preferences_params.rbi b/rbi/knockapi/models/object_list_preferences_params.rbi index cf796292..76d9dce0 100644 --- a/rbi/knockapi/models/object_list_preferences_params.rbi +++ b/rbi/knockapi/models/object_list_preferences_params.rbi @@ -6,14 +6,25 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::ObjectListPreferencesParams, + Knockapi::Internal::AnyHash + ) + end + sig do - params(request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash)) - .returns(T.attached_class) + params(request_options: Knockapi::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) end - def self.new(request_options: {}); end - sig { override.returns({request_options: Knockapi::RequestOptions}) } - def to_hash; end + sig { override.returns({ request_options: Knockapi::RequestOptions }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/object_list_preferences_response.rbi b/rbi/knockapi/models/object_list_preferences_response.rbi index b4cb13cd..82e47b5d 100644 --- a/rbi/knockapi/models/object_list_preferences_response.rbi +++ b/rbi/knockapi/models/object_list_preferences_response.rbi @@ -4,7 +4,7 @@ module Knockapi module Models ObjectListPreferencesResponse = T.let( - Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Recipients::PreferenceSet], + Knockapi::Internal::Type::ArrayOf[Knockapi::Recipients::PreferenceSet], Knockapi::Internal::Type::Converter ) end diff --git a/rbi/knockapi/models/object_list_schedules_params.rbi b/rbi/knockapi/models/object_list_schedules_params.rbi index 43124eed..7e7f8019 100644 --- a/rbi/knockapi/models/object_list_schedules_params.rbi +++ b/rbi/knockapi/models/object_list_schedules_params.rbi @@ -6,6 +6,14 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::ObjectListSchedulesParams, + Knockapi::Internal::AnyHash + ) + end + # The cursor to fetch entries after. sig { returns(T.nilable(String)) } attr_reader :after @@ -48,9 +56,8 @@ module Knockapi page_size: Integer, tenant: String, workflow: String, - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # The cursor to fetch entries after. @@ -64,21 +71,23 @@ module Knockapi # Filter schedules by workflow id. workflow: nil, request_options: {} - ); end + ) + end + sig do - override - .returns( - { - after: String, - before: String, - page_size: Integer, - tenant: String, - workflow: String, - request_options: Knockapi::RequestOptions - } - ) + override.returns( + { + after: String, + before: String, + page_size: Integer, + tenant: String, + workflow: String, + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/object_list_subscriptions_params.rbi b/rbi/knockapi/models/object_list_subscriptions_params.rbi index d350270e..479daa72 100644 --- a/rbi/knockapi/models/object_list_subscriptions_params.rbi +++ b/rbi/knockapi/models/object_list_subscriptions_params.rbi @@ -6,6 +6,14 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::ObjectListSubscriptionsParams, + Knockapi::Internal::AnyHash + ) + end + # The cursor to fetch entries after. sig { returns(T.nilable(String)) } attr_reader :after @@ -21,30 +29,53 @@ module Knockapi attr_writer :before # Additional fields to include in the response. - sig { returns(T.nilable(T::Array[Knockapi::Models::ObjectListSubscriptionsParams::Include::OrSymbol])) } + sig do + returns( + T.nilable( + T::Array[Knockapi::ObjectListSubscriptionsParams::Include::OrSymbol] + ) + ) + end attr_reader :include - sig { params(include: T::Array[Knockapi::Models::ObjectListSubscriptionsParams::Include::OrSymbol]).void } + sig do + params( + include: + T::Array[Knockapi::ObjectListSubscriptionsParams::Include::OrSymbol] + ).void + end attr_writer :include # Mode of the request. `recipient` to list the objects that the provided object is # subscribed to, `object` to list the recipients that subscribe to the provided # object. - sig { returns(T.nilable(Knockapi::Models::ObjectListSubscriptionsParams::Mode::OrSymbol)) } + sig do + returns( + T.nilable(Knockapi::ObjectListSubscriptionsParams::Mode::OrSymbol) + ) + end attr_reader :mode - sig { params(mode: Knockapi::Models::ObjectListSubscriptionsParams::Mode::OrSymbol).void } + sig do + params( + mode: Knockapi::ObjectListSubscriptionsParams::Mode::OrSymbol + ).void + end attr_writer :mode # Objects to filter by (only used if mode is `recipient`). - sig { returns(T.nilable(T::Array[Knockapi::Models::ObjectListSubscriptionsParams::Object])) } + sig do + returns( + T.nilable(T::Array[Knockapi::ObjectListSubscriptionsParams::Object]) + ) + end attr_reader :objects sig do params( - objects: T::Array[T.any(Knockapi::Models::ObjectListSubscriptionsParams::Object, Knockapi::Internal::AnyHash)] - ) - .void + objects: + T::Array[Knockapi::ObjectListSubscriptionsParams::Object::OrHash] + ).void end attr_writer :objects @@ -56,14 +87,27 @@ module Knockapi attr_writer :page_size # Recipients to filter by (only used if mode is `object`). - sig { returns(T.nilable(T::Array[T.any(String, Knockapi::Models::RecipientReference::ObjectReference)])) } + sig do + returns( + T.nilable( + T::Array[ + T.any(String, Knockapi::RecipientReference::ObjectReference) + ] + ) + ) + end attr_reader :recipients sig do params( - recipients: T::Array[T.any(String, Knockapi::Models::RecipientReference::ObjectReference, Knockapi::Internal::AnyHash)] - ) - .void + recipients: + T::Array[ + T.any( + String, + Knockapi::RecipientReference::ObjectReference::OrHash + ) + ] + ).void end attr_writer :recipients @@ -71,14 +115,23 @@ module Knockapi params( after: String, before: String, - include: T::Array[Knockapi::Models::ObjectListSubscriptionsParams::Include::OrSymbol], - mode: Knockapi::Models::ObjectListSubscriptionsParams::Mode::OrSymbol, - objects: T::Array[T.any(Knockapi::Models::ObjectListSubscriptionsParams::Object, Knockapi::Internal::AnyHash)], + include: + T::Array[ + Knockapi::ObjectListSubscriptionsParams::Include::OrSymbol + ], + mode: Knockapi::ObjectListSubscriptionsParams::Mode::OrSymbol, + objects: + T::Array[Knockapi::ObjectListSubscriptionsParams::Object::OrHash], page_size: Integer, - recipients: T::Array[T.any(String, Knockapi::Models::RecipientReference::ObjectReference, Knockapi::Internal::AnyHash)], - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + recipients: + T::Array[ + T.any( + String, + Knockapi::RecipientReference::ObjectReference::OrHash + ) + ], + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # The cursor to fetch entries after. @@ -98,34 +151,56 @@ module Knockapi # Recipients to filter by (only used if mode is `object`). recipients: nil, request_options: {} - ); end + ) + end + sig do - override - .returns( - { - after: String, - before: String, - include: T::Array[Knockapi::Models::ObjectListSubscriptionsParams::Include::OrSymbol], - mode: Knockapi::Models::ObjectListSubscriptionsParams::Mode::OrSymbol, - objects: T::Array[Knockapi::Models::ObjectListSubscriptionsParams::Object], - page_size: Integer, - recipients: T::Array[T.any(String, Knockapi::Models::RecipientReference::ObjectReference)], - request_options: Knockapi::RequestOptions - } - ) + override.returns( + { + after: String, + before: String, + include: + T::Array[ + Knockapi::ObjectListSubscriptionsParams::Include::OrSymbol + ], + mode: Knockapi::ObjectListSubscriptionsParams::Mode::OrSymbol, + objects: T::Array[Knockapi::ObjectListSubscriptionsParams::Object], + page_size: Integer, + recipients: + T::Array[ + T.any(String, Knockapi::RecipientReference::ObjectReference) + ], + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end module Include extend Knockapi::Internal::Type::Enum - TaggedSymbol = T.type_alias { T.all(Symbol, Knockapi::Models::ObjectListSubscriptionsParams::Include) } + TaggedSymbol = + T.type_alias do + T.all(Symbol, Knockapi::ObjectListSubscriptionsParams::Include) + end OrSymbol = T.type_alias { T.any(Symbol, String) } - PREFERENCES = T.let(:preferences, Knockapi::Models::ObjectListSubscriptionsParams::Include::TaggedSymbol) + PREFERENCES = + T.let( + :preferences, + Knockapi::ObjectListSubscriptionsParams::Include::TaggedSymbol + ) - sig { override.returns(T::Array[Knockapi::Models::ObjectListSubscriptionsParams::Include::TaggedSymbol]) } - def self.values; end + sig do + override.returns( + T::Array[ + Knockapi::ObjectListSubscriptionsParams::Include::TaggedSymbol + ] + ) + end + def self.values + end end # Mode of the request. `recipient` to list the objects that the provided object is @@ -134,17 +209,43 @@ module Knockapi module Mode extend Knockapi::Internal::Type::Enum - TaggedSymbol = T.type_alias { T.all(Symbol, Knockapi::Models::ObjectListSubscriptionsParams::Mode) } + TaggedSymbol = + T.type_alias do + T.all(Symbol, Knockapi::ObjectListSubscriptionsParams::Mode) + end OrSymbol = T.type_alias { T.any(Symbol, String) } - RECIPIENT = T.let(:recipient, Knockapi::Models::ObjectListSubscriptionsParams::Mode::TaggedSymbol) - OBJECT = T.let(:object, Knockapi::Models::ObjectListSubscriptionsParams::Mode::TaggedSymbol) + RECIPIENT = + T.let( + :recipient, + Knockapi::ObjectListSubscriptionsParams::Mode::TaggedSymbol + ) + OBJECT = + T.let( + :object, + Knockapi::ObjectListSubscriptionsParams::Mode::TaggedSymbol + ) - sig { override.returns(T::Array[Knockapi::Models::ObjectListSubscriptionsParams::Mode::TaggedSymbol]) } - def self.values; end + sig do + override.returns( + T::Array[ + Knockapi::ObjectListSubscriptionsParams::Mode::TaggedSymbol + ] + ) + end + def self.values + end end class Object < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::ObjectListSubscriptionsParams::Object, + Knockapi::Internal::AnyHash + ) + end + # An identifier for the recipient object. sig { returns(T.nilable(String)) } attr_reader :id @@ -166,9 +267,12 @@ module Knockapi id: nil, # The collection the recipient object belongs to. collection: nil - ); end - sig { override.returns({id: String, collection: String}) } - def to_hash; end + ) + end + + sig { override.returns({ id: String, collection: String }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/object_set_channel_data_params.rbi b/rbi/knockapi/models/object_set_channel_data_params.rbi index 5dbfc99e..102694e9 100644 --- a/rbi/knockapi/models/object_set_channel_data_params.rbi +++ b/rbi/knockapi/models/object_set_channel_data_params.rbi @@ -6,14 +6,25 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::ObjectSetChannelDataParams, + Knockapi::Internal::AnyHash + ) + end + sig do - params(request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash)) - .returns(T.attached_class) + params(request_options: Knockapi::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) end - def self.new(request_options: {}); end - sig { override.returns({request_options: Knockapi::RequestOptions}) } - def to_hash; end + sig { override.returns({ request_options: Knockapi::RequestOptions }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/object_set_params.rbi b/rbi/knockapi/models/object_set_params.rbi index d767092d..d4012678 100644 --- a/rbi/knockapi/models/object_set_params.rbi +++ b/rbi/knockapi/models/object_set_params.rbi @@ -6,15 +6,44 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any(Knockapi::ObjectSetParams, Knockapi::Internal::AnyHash) + end + # A request to set channel data for a type of channel inline. - sig { returns(T.nilable(T::Hash[Symbol, Knockapi::Models::Recipients::ChannelDataRequest])) } + sig do + returns( + T.nilable( + T::Hash[ + Symbol, + T.any( + Knockapi::Recipients::PushChannelData, + Knockapi::Recipients::OneSignalChannelData, + Knockapi::Recipients::SlackChannelData, + Knockapi::Recipients::MsTeamsChannelData, + Knockapi::Recipients::DiscordChannelData + ) + ] + ) + ) + end attr_reader :channel_data sig do params( - channel_data: T::Hash[Symbol, T.any(Knockapi::Models::Recipients::ChannelDataRequest, Knockapi::Internal::AnyHash)] - ) - .void + channel_data: + T::Hash[ + Symbol, + T.any( + Knockapi::Recipients::PushChannelData::OrHash, + Knockapi::Recipients::OneSignalChannelData::OrHash, + Knockapi::Recipients::SlackChannelData::OrHash, + Knockapi::Recipients::MsTeamsChannelData::OrHash, + Knockapi::Recipients::DiscordChannelData::OrHash + ) + ] + ).void end attr_writer :channel_data @@ -24,33 +53,47 @@ module Knockapi attr_accessor :locale # Inline set preferences for a recipient, where the key is the preference set id. - sig { returns(T.nilable(T::Hash[Symbol, Knockapi::Models::Recipients::PreferenceSetRequest])) } + sig do + returns( + T.nilable(T::Hash[Symbol, Knockapi::Recipients::PreferenceSetRequest]) + ) + end attr_reader :preferences sig do params( - preferences: T::Hash[Symbol, T.any(Knockapi::Models::Recipients::PreferenceSetRequest, Knockapi::Internal::AnyHash)] - ) - .void + preferences: + T::Hash[Symbol, Knockapi::Recipients::PreferenceSetRequest::OrHash] + ).void end attr_writer :preferences - # The timezone of the object. Must be a valid - # [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). - # Used for - # [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients). + # The timezone of the object. Must be a + # valid [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + # Used + # for [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients). sig { returns(T.nilable(String)) } attr_accessor :timezone sig do params( - channel_data: T::Hash[Symbol, T.any(Knockapi::Models::Recipients::ChannelDataRequest, Knockapi::Internal::AnyHash)], + channel_data: + T::Hash[ + Symbol, + T.any( + Knockapi::Recipients::PushChannelData::OrHash, + Knockapi::Recipients::OneSignalChannelData::OrHash, + Knockapi::Recipients::SlackChannelData::OrHash, + Knockapi::Recipients::MsTeamsChannelData::OrHash, + Knockapi::Recipients::DiscordChannelData::OrHash + ) + ], locale: T.nilable(String), - preferences: T::Hash[Symbol, T.any(Knockapi::Models::Recipients::PreferenceSetRequest, Knockapi::Internal::AnyHash)], + preferences: + T::Hash[Symbol, Knockapi::Recipients::PreferenceSetRequest::OrHash], timezone: T.nilable(String), - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # A request to set channel data for a type of channel inline. @@ -60,26 +103,39 @@ module Knockapi locale: nil, # Inline set preferences for a recipient, where the key is the preference set id. preferences: nil, - # The timezone of the object. Must be a valid - # [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). - # Used for - # [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients). + # The timezone of the object. Must be a + # valid [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + # Used + # for [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients). timezone: nil, request_options: {} - ); end + ) + end + sig do - override - .returns( - { - channel_data: T::Hash[Symbol, Knockapi::Models::Recipients::ChannelDataRequest], - locale: T.nilable(String), - preferences: T::Hash[Symbol, Knockapi::Models::Recipients::PreferenceSetRequest], - timezone: T.nilable(String), - request_options: Knockapi::RequestOptions - } - ) + override.returns( + { + channel_data: + T::Hash[ + Symbol, + T.any( + Knockapi::Recipients::PushChannelData, + Knockapi::Recipients::OneSignalChannelData, + Knockapi::Recipients::SlackChannelData, + Knockapi::Recipients::MsTeamsChannelData, + Knockapi::Recipients::DiscordChannelData + ) + ], + locale: T.nilable(String), + preferences: + T::Hash[Symbol, Knockapi::Recipients::PreferenceSetRequest], + timezone: T.nilable(String), + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/object_set_preferences_params.rbi b/rbi/knockapi/models/object_set_preferences_params.rbi index d332d45f..232619fc 100644 --- a/rbi/knockapi/models/object_set_preferences_params.rbi +++ b/rbi/knockapi/models/object_set_preferences_params.rbi @@ -6,14 +6,25 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::ObjectSetPreferencesParams, + Knockapi::Internal::AnyHash + ) + end + sig do - params(request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash)) - .returns(T.attached_class) + params(request_options: Knockapi::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) end - def self.new(request_options: {}); end - sig { override.returns({request_options: Knockapi::RequestOptions}) } - def to_hash; end + sig { override.returns({ request_options: Knockapi::RequestOptions }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/object_unset_channel_data_params.rbi b/rbi/knockapi/models/object_unset_channel_data_params.rbi index 330b3137..812d7662 100644 --- a/rbi/knockapi/models/object_unset_channel_data_params.rbi +++ b/rbi/knockapi/models/object_unset_channel_data_params.rbi @@ -6,14 +6,25 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::ObjectUnsetChannelDataParams, + Knockapi::Internal::AnyHash + ) + end + sig do - params(request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash)) - .returns(T.attached_class) + params(request_options: Knockapi::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) end - def self.new(request_options: {}); end - sig { override.returns({request_options: Knockapi::RequestOptions}) } - def to_hash; end + sig { override.returns({ request_options: Knockapi::RequestOptions }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/object_unset_channel_data_response.rbi b/rbi/knockapi/models/object_unset_channel_data_response.rbi new file mode 100644 index 00000000..3dd54baf --- /dev/null +++ b/rbi/knockapi/models/object_unset_channel_data_response.rbi @@ -0,0 +1,7 @@ +# typed: strong + +module Knockapi + module Models + ObjectUnsetChannelDataResponse = String + end +end diff --git a/rbi/knockapi/models/objects/bulk_add_subscriptions_params.rbi b/rbi/knockapi/models/objects/bulk_add_subscriptions_params.rbi index d270b9a1..f7558a9e 100644 --- a/rbi/knockapi/models/objects/bulk_add_subscriptions_params.rbi +++ b/rbi/knockapi/models/objects/bulk_add_subscriptions_params.rbi @@ -7,39 +7,74 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::Objects::BulkAddSubscriptionsParams, + Knockapi::Internal::AnyHash + ) + end + # A list of subscriptions. - sig { returns(T::Array[Knockapi::Models::Objects::BulkAddSubscriptionsParams::Subscription]) } + sig do + returns( + T::Array[ + Knockapi::Objects::BulkAddSubscriptionsParams::Subscription + ] + ) + end attr_accessor :subscriptions sig do params( - subscriptions: T::Array[T.any(Knockapi::Models::Objects::BulkAddSubscriptionsParams::Subscription, Knockapi::Internal::AnyHash)], - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + subscriptions: + T::Array[ + Knockapi::Objects::BulkAddSubscriptionsParams::Subscription::OrHash + ], + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # A list of subscriptions. subscriptions:, request_options: {} - ); end + ) + end + sig do - override - .returns( - { - subscriptions: T::Array[Knockapi::Models::Objects::BulkAddSubscriptionsParams::Subscription], - request_options: Knockapi::RequestOptions - } - ) + override.returns( + { + subscriptions: + T::Array[ + Knockapi::Objects::BulkAddSubscriptionsParams::Subscription + ], + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end class Subscription < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Objects::BulkAddSubscriptionsParams::Subscription, + Knockapi::Internal::AnyHash + ) + end + # The recipients of the subscription. You can subscribe up to 100 recipients to an # object at a time. sig do returns( - T::Array[T.any(String, Knockapi::Models::InlineIdentifyUserRequest, Knockapi::Models::InlineObjectRequest)] + T::Array[ + T.any( + String, + Knockapi::InlineIdentifyUserRequest, + Knockapi::InlineObjectRequest + ) + ] ) end attr_accessor :recipients @@ -50,17 +85,16 @@ module Knockapi sig do params( - recipients: T::Array[ - T.any( - String, - Knockapi::Models::InlineIdentifyUserRequest, - Knockapi::Internal::AnyHash, - Knockapi::Models::InlineObjectRequest - ) - ], + recipients: + T::Array[ + T.any( + String, + Knockapi::InlineIdentifyUserRequest::OrHash, + Knockapi::InlineObjectRequest::OrHash + ) + ], properties: T.nilable(T::Hash[Symbol, T.anything]) - ) - .returns(T.attached_class) + ).returns(T.attached_class) end def self.new( # The recipients of the subscription. You can subscribe up to 100 recipients to an @@ -68,17 +102,26 @@ module Knockapi recipients:, # The custom properties associated with the subscription relationship. properties: nil - ); end + ) + end + sig do - override - .returns( - { - recipients: T::Array[T.any(String, Knockapi::Models::InlineIdentifyUserRequest, Knockapi::Models::InlineObjectRequest)], - properties: T.nilable(T::Hash[Symbol, T.anything]) - } - ) + override.returns( + { + recipients: + T::Array[ + T.any( + String, + Knockapi::InlineIdentifyUserRequest, + Knockapi::InlineObjectRequest + ) + ], + properties: T.nilable(T::Hash[Symbol, T.anything]) + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/objects/bulk_delete_params.rbi b/rbi/knockapi/models/objects/bulk_delete_params.rbi index e9ad815a..42606be8 100644 --- a/rbi/knockapi/models/objects/bulk_delete_params.rbi +++ b/rbi/knockapi/models/objects/bulk_delete_params.rbi @@ -7,6 +7,14 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::Objects::BulkDeleteParams, + Knockapi::Internal::AnyHash + ) + end + # List of object IDs to delete. sig { returns(T::Array[String]) } attr_accessor :object_ids @@ -14,17 +22,26 @@ module Knockapi sig do params( object_ids: T::Array[String], - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # List of object IDs to delete. object_ids:, request_options: {} - ); end - sig { override.returns({object_ids: T::Array[String], request_options: Knockapi::RequestOptions}) } - def to_hash; end + ) + end + + sig do + override.returns( + { + object_ids: T::Array[String], + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash + end end end end diff --git a/rbi/knockapi/models/objects/bulk_set_params.rbi b/rbi/knockapi/models/objects/bulk_set_params.rbi index e195296f..14b9b53a 100644 --- a/rbi/knockapi/models/objects/bulk_set_params.rbi +++ b/rbi/knockapi/models/objects/bulk_set_params.rbi @@ -7,29 +7,38 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any(Knockapi::Objects::BulkSetParams, Knockapi::Internal::AnyHash) + end + # A list of objects. - sig { returns(T::Array[Knockapi::Models::InlineObjectRequest]) } + sig { returns(T::Array[Knockapi::InlineObjectRequest]) } attr_accessor :objects sig do params( - objects: T::Array[T.any(Knockapi::Models::InlineObjectRequest, Knockapi::Internal::AnyHash)], - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + objects: T::Array[Knockapi::InlineObjectRequest::OrHash], + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # A list of objects. objects:, request_options: {} - ); end + ) + end + sig do - override - .returns( - {objects: T::Array[Knockapi::Models::InlineObjectRequest], request_options: Knockapi::RequestOptions} - ) + override.returns( + { + objects: T::Array[Knockapi::InlineObjectRequest], + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/page_info.rbi b/rbi/knockapi/models/page_info.rbi index 38cbeeea..3bce8c0b 100644 --- a/rbi/knockapi/models/page_info.rbi +++ b/rbi/knockapi/models/page_info.rbi @@ -3,6 +3,9 @@ module Knockapi module Models class PageInfo < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Knockapi::PageInfo, Knockapi::Internal::AnyHash) } + # The typename of the schema. sig { returns(String) } attr_accessor :_typename @@ -21,8 +24,12 @@ module Knockapi # Pagination information for a list of resources. sig do - params(_typename: String, page_size: Integer, after: T.nilable(String), before: T.nilable(String)) - .returns(T.attached_class) + params( + _typename: String, + page_size: Integer, + after: T.nilable(String), + before: T.nilable(String) + ).returns(T.attached_class) end def self.new( # The typename of the schema. @@ -33,17 +40,21 @@ module Knockapi after: nil, # The cursor to fetch entries before. before: nil - ); end + ) + end + sig do - override - .returns({ - _typename: String, - page_size: Integer, - after: T.nilable(String), - before: T.nilable(String) - }) + override.returns( + { + _typename: String, + page_size: Integer, + after: T.nilable(String), + before: T.nilable(String) + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/providers/ms_team_check_auth_params.rbi b/rbi/knockapi/models/providers/ms_team_check_auth_params.rbi index f5d2d57c..53b9f985 100644 --- a/rbi/knockapi/models/providers/ms_team_check_auth_params.rbi +++ b/rbi/knockapi/models/providers/ms_team_check_auth_params.rbi @@ -7,6 +7,14 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::Providers::MsTeamCheckAuthParams, + Knockapi::Internal::AnyHash + ) + end + # A JSON encoded string containing the Microsoft Teams tenant object reference. sig { returns(String) } attr_accessor :ms_teams_tenant_object @@ -14,17 +22,26 @@ module Knockapi sig do params( ms_teams_tenant_object: String, - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # A JSON encoded string containing the Microsoft Teams tenant object reference. ms_teams_tenant_object:, request_options: {} - ); end - sig { override.returns({ms_teams_tenant_object: String, request_options: Knockapi::RequestOptions}) } - def to_hash; end + ) + end + + sig do + override.returns( + { + ms_teams_tenant_object: String, + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash + end end end end diff --git a/rbi/knockapi/models/providers/ms_team_check_auth_response.rbi b/rbi/knockapi/models/providers/ms_team_check_auth_response.rbi index 7a80f456..d4e5e99e 100644 --- a/rbi/knockapi/models/providers/ms_team_check_auth_response.rbi +++ b/rbi/knockapi/models/providers/ms_team_check_auth_response.rbi @@ -4,33 +4,63 @@ module Knockapi module Models module Providers class MsTeamCheckAuthResponse < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::Providers::MsTeamCheckAuthResponse, + Knockapi::Internal::AnyHash + ) + end + # A Microsoft Teams connection object. - sig { returns(Knockapi::Models::Providers::MsTeamCheckAuthResponse::Connection) } + sig do + returns( + Knockapi::Models::Providers::MsTeamCheckAuthResponse::Connection + ) + end attr_reader :connection sig do params( - connection: T.any(Knockapi::Models::Providers::MsTeamCheckAuthResponse::Connection, Knockapi::Internal::AnyHash) - ) - .void + connection: + Knockapi::Models::Providers::MsTeamCheckAuthResponse::Connection::OrHash + ).void end attr_writer :connection # The response from a Microsoft Teams auth check request. sig do params( - connection: T.any(Knockapi::Models::Providers::MsTeamCheckAuthResponse::Connection, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + connection: + Knockapi::Models::Providers::MsTeamCheckAuthResponse::Connection::OrHash + ).returns(T.attached_class) end def self.new( # A Microsoft Teams connection object. connection: - ); end - sig { override.returns({connection: Knockapi::Models::Providers::MsTeamCheckAuthResponse::Connection}) } - def to_hash; end + ) + end + + sig do + override.returns( + { + connection: + Knockapi::Models::Providers::MsTeamCheckAuthResponse::Connection + } + ) + end + def to_hash + end class Connection < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::Providers::MsTeamCheckAuthResponse::Connection, + Knockapi::Internal::AnyHash + ) + end + # Whether the Microsoft Teams connection is valid. sig { returns(T::Boolean) } attr_accessor :ok @@ -40,15 +70,24 @@ module Knockapi attr_accessor :reason # A Microsoft Teams connection object. - sig { params(ok: T::Boolean, reason: T.nilable(String)).returns(T.attached_class) } + sig do + params(ok: T::Boolean, reason: T.nilable(String)).returns( + T.attached_class + ) + end def self.new( # Whether the Microsoft Teams connection is valid. ok:, # The reason for the Microsoft Teams connection if it is not valid. reason: nil - ); end - sig { override.returns({ok: T::Boolean, reason: T.nilable(String)}) } - def to_hash; end + ) + end + + sig do + override.returns({ ok: T::Boolean, reason: T.nilable(String) }) + end + def to_hash + end end end end diff --git a/rbi/knockapi/models/providers/ms_team_list_channels_params.rbi b/rbi/knockapi/models/providers/ms_team_list_channels_params.rbi index 1503aa06..64f15848 100644 --- a/rbi/knockapi/models/providers/ms_team_list_channels_params.rbi +++ b/rbi/knockapi/models/providers/ms_team_list_channels_params.rbi @@ -7,6 +7,14 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::Providers::MsTeamListChannelsParams, + Knockapi::Internal::AnyHash + ) + end + # A JSON encoded string containing the Microsoft Teams tenant object reference. sig { returns(String) } attr_accessor :ms_teams_tenant_object @@ -15,14 +23,20 @@ module Knockapi sig { returns(String) } attr_accessor :team_id - sig { returns(T.nilable(Knockapi::Models::Providers::MsTeamListChannelsParams::QueryOptions)) } + sig do + returns( + T.nilable( + Knockapi::Providers::MsTeamListChannelsParams::QueryOptions + ) + ) + end attr_reader :query_options sig do params( - query_options: T.any(Knockapi::Models::Providers::MsTeamListChannelsParams::QueryOptions, Knockapi::Internal::AnyHash) - ) - .void + query_options: + Knockapi::Providers::MsTeamListChannelsParams::QueryOptions::OrHash + ).void end attr_writer :query_options @@ -30,10 +44,10 @@ module Knockapi params( ms_teams_tenant_object: String, team_id: String, - query_options: T.any(Knockapi::Models::Providers::MsTeamListChannelsParams::QueryOptions, Knockapi::Internal::AnyHash), - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + query_options: + Knockapi::Providers::MsTeamListChannelsParams::QueryOptions::OrHash, + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # A JSON encoded string containing the Microsoft Teams tenant object reference. @@ -42,21 +56,32 @@ module Knockapi team_id:, query_options: nil, request_options: {} - ); end + ) + end + sig do - override - .returns( - { - ms_teams_tenant_object: String, - team_id: String, - query_options: Knockapi::Models::Providers::MsTeamListChannelsParams::QueryOptions, - request_options: Knockapi::RequestOptions - } - ) + override.returns( + { + ms_teams_tenant_object: String, + team_id: String, + query_options: + Knockapi::Providers::MsTeamListChannelsParams::QueryOptions, + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end class QueryOptions < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Providers::MsTeamListChannelsParams::QueryOptions, + Knockapi::Internal::AnyHash + ) + end + # [OData param](https://learn.microsoft.com/en-us/graph/query-parameters) passed # to the Microsoft Graph API to filter channels. sig { returns(T.nilable(String)) } @@ -73,7 +98,9 @@ module Knockapi sig { params(select_: String).void } attr_writer :select_ - sig { params(filter: String, select_: String).returns(T.attached_class) } + sig do + params(filter: String, select_: String).returns(T.attached_class) + end def self.new( # [OData param](https://learn.microsoft.com/en-us/graph/query-parameters) passed # to the Microsoft Graph API to filter channels. @@ -81,9 +108,12 @@ module Knockapi # [OData param](https://learn.microsoft.com/en-us/graph/query-parameters) passed # to the Microsoft Graph API to select specific properties. select_: nil - ); end - sig { override.returns({filter: String, select_: String}) } - def to_hash; end + ) + end + + sig { override.returns({ filter: String, select_: String }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/providers/ms_team_list_channels_response.rbi b/rbi/knockapi/models/providers/ms_team_list_channels_response.rbi index 1d937f9c..4d59c637 100644 --- a/rbi/knockapi/models/providers/ms_team_list_channels_response.rbi +++ b/rbi/knockapi/models/providers/ms_team_list_channels_response.rbi @@ -4,36 +4,62 @@ module Knockapi module Models module Providers class MsTeamListChannelsResponse < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::Providers::MsTeamListChannelsResponse, + Knockapi::Internal::AnyHash + ) + end + # List of Microsoft Teams channels. - sig { returns(T::Array[Knockapi::Models::Providers::MsTeamListChannelsResponse::MsTeamsChannel]) } + sig do + returns( + T::Array[ + Knockapi::Models::Providers::MsTeamListChannelsResponse::MsTeamsChannel + ] + ) + end attr_accessor :ms_teams_channels # The response from a Microsoft Teams provider request, containing a list of # channels. sig do params( - ms_teams_channels: T::Array[ - T.any( - Knockapi::Models::Providers::MsTeamListChannelsResponse::MsTeamsChannel, - Knockapi::Internal::AnyHash - ) - ] - ) - .returns(T.attached_class) + ms_teams_channels: + T::Array[ + Knockapi::Models::Providers::MsTeamListChannelsResponse::MsTeamsChannel::OrHash + ] + ).returns(T.attached_class) end def self.new( # List of Microsoft Teams channels. ms_teams_channels: - ); end + ) + end + sig do - override - .returns( - {ms_teams_channels: T::Array[Knockapi::Models::Providers::MsTeamListChannelsResponse::MsTeamsChannel]} - ) + override.returns( + { + ms_teams_channels: + T::Array[ + Knockapi::Models::Providers::MsTeamListChannelsResponse::MsTeamsChannel + ] + } + ) + end + def to_hash end - def to_hash; end class MsTeamsChannel < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::Providers::MsTeamListChannelsResponse::MsTeamsChannel, + Knockapi::Internal::AnyHash + ) + end + # Microsoft Teams channel ID. sig { returns(String) } attr_accessor :id @@ -75,8 +101,7 @@ module Knockapi description: T.nilable(String), is_archived: T::Boolean, membership_type: String - ) - .returns(T.attached_class) + ).returns(T.attached_class) end def self.new( # Microsoft Teams channel ID. @@ -91,21 +116,23 @@ module Knockapi is_archived: nil, # Microsoft Teams channel membership type. membership_type: nil - ); end + ) + end + sig do - override - .returns( - { - id: String, - display_name: String, - created_date_time: String, - description: T.nilable(String), - is_archived: T::Boolean, - membership_type: String - } - ) + override.returns( + { + id: String, + display_name: String, + created_date_time: String, + description: T.nilable(String), + is_archived: T::Boolean, + membership_type: String + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/providers/ms_team_list_teams_params.rbi b/rbi/knockapi/models/providers/ms_team_list_teams_params.rbi index ee16f743..bdd7fd4b 100644 --- a/rbi/knockapi/models/providers/ms_team_list_teams_params.rbi +++ b/rbi/knockapi/models/providers/ms_team_list_teams_params.rbi @@ -7,48 +7,71 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::Providers::MsTeamListTeamsParams, + Knockapi::Internal::AnyHash + ) + end + # A JSON encoded string containing the Microsoft Teams tenant object reference. sig { returns(String) } attr_accessor :ms_teams_tenant_object - sig { returns(T.nilable(Knockapi::Models::Providers::MsTeamListTeamsParams::QueryOptions)) } + sig do + returns( + T.nilable(Knockapi::Providers::MsTeamListTeamsParams::QueryOptions) + ) + end attr_reader :query_options sig do params( - query_options: T.any(Knockapi::Models::Providers::MsTeamListTeamsParams::QueryOptions, Knockapi::Internal::AnyHash) - ) - .void + query_options: + Knockapi::Providers::MsTeamListTeamsParams::QueryOptions::OrHash + ).void end attr_writer :query_options sig do params( ms_teams_tenant_object: String, - query_options: T.any(Knockapi::Models::Providers::MsTeamListTeamsParams::QueryOptions, Knockapi::Internal::AnyHash), - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + query_options: + Knockapi::Providers::MsTeamListTeamsParams::QueryOptions::OrHash, + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # A JSON encoded string containing the Microsoft Teams tenant object reference. ms_teams_tenant_object:, query_options: nil, request_options: {} - ); end + ) + end + sig do - override - .returns( - { - ms_teams_tenant_object: String, - query_options: Knockapi::Models::Providers::MsTeamListTeamsParams::QueryOptions, - request_options: Knockapi::RequestOptions - } - ) + override.returns( + { + ms_teams_tenant_object: String, + query_options: + Knockapi::Providers::MsTeamListTeamsParams::QueryOptions, + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end class QueryOptions < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Providers::MsTeamListTeamsParams::QueryOptions, + Knockapi::Internal::AnyHash + ) + end + # [OData param](https://learn.microsoft.com/en-us/graph/query-parameters) passed # to the Microsoft Graph API to filter teams. sig { returns(T.nilable(String)) } @@ -82,7 +105,12 @@ module Knockapi attr_writer :top sig do - params(filter: String, select_: String, skiptoken: String, top: Integer).returns(T.attached_class) + params( + filter: String, + select_: String, + skiptoken: String, + top: Integer + ).returns(T.attached_class) end def self.new( # [OData param](https://learn.microsoft.com/en-us/graph/query-parameters) passed @@ -97,9 +125,21 @@ module Knockapi # [OData param](https://learn.microsoft.com/en-us/graph/query-parameters) passed # to the Microsoft Graph API to limit the number of teams returned. top: nil - ); end - sig { override.returns({filter: String, select_: String, skiptoken: String, top: Integer}) } - def to_hash; end + ) + end + + sig do + override.returns( + { + filter: String, + select_: String, + skiptoken: String, + top: Integer + } + ) + end + def to_hash + end end end end diff --git a/rbi/knockapi/models/providers/ms_team_list_teams_response.rbi b/rbi/knockapi/models/providers/ms_team_list_teams_response.rbi index 084fd47a..06b6cfd6 100644 --- a/rbi/knockapi/models/providers/ms_team_list_teams_response.rbi +++ b/rbi/knockapi/models/providers/ms_team_list_teams_response.rbi @@ -4,6 +4,14 @@ module Knockapi module Models module Providers class MsTeamListTeamsResponse < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::Providers::MsTeamListTeamsResponse, + Knockapi::Internal::AnyHash + ) + end + # Microsoft Teams team ID. sig { returns(String) } attr_accessor :id @@ -17,7 +25,11 @@ module Knockapi attr_accessor :description sig do - params(id: String, display_name: String, description: T.nilable(String)).returns(T.attached_class) + params( + id: String, + display_name: String, + description: T.nilable(String) + ).returns(T.attached_class) end def self.new( # Microsoft Teams team ID. @@ -26,9 +38,16 @@ module Knockapi display_name:, # Microsoft Teams team description. description: nil - ); end - sig { override.returns({id: String, display_name: String, description: T.nilable(String)}) } - def to_hash; end + ) + end + + sig do + override.returns( + { id: String, display_name: String, description: T.nilable(String) } + ) + end + def to_hash + end end end end diff --git a/rbi/knockapi/models/providers/ms_team_revoke_access_params.rbi b/rbi/knockapi/models/providers/ms_team_revoke_access_params.rbi index e3d190b1..66d70ba4 100644 --- a/rbi/knockapi/models/providers/ms_team_revoke_access_params.rbi +++ b/rbi/knockapi/models/providers/ms_team_revoke_access_params.rbi @@ -7,6 +7,14 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::Providers::MsTeamRevokeAccessParams, + Knockapi::Internal::AnyHash + ) + end + # A JSON encoded string containing the Microsoft Teams tenant object reference. sig { returns(String) } attr_accessor :ms_teams_tenant_object @@ -14,17 +22,26 @@ module Knockapi sig do params( ms_teams_tenant_object: String, - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # A JSON encoded string containing the Microsoft Teams tenant object reference. ms_teams_tenant_object:, request_options: {} - ); end - sig { override.returns({ms_teams_tenant_object: String, request_options: Knockapi::RequestOptions}) } - def to_hash; end + ) + end + + sig do + override.returns( + { + ms_teams_tenant_object: String, + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash + end end end end diff --git a/rbi/knockapi/models/providers/ms_team_revoke_access_response.rbi b/rbi/knockapi/models/providers/ms_team_revoke_access_response.rbi index 0ae4af3f..27648bc2 100644 --- a/rbi/knockapi/models/providers/ms_team_revoke_access_response.rbi +++ b/rbi/knockapi/models/providers/ms_team_revoke_access_response.rbi @@ -4,6 +4,14 @@ module Knockapi module Models module Providers class MsTeamRevokeAccessResponse < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::Providers::MsTeamRevokeAccessResponse, + Knockapi::Internal::AnyHash + ) + end + # OK response. sig { returns(T.nilable(String)) } attr_reader :ok @@ -16,9 +24,12 @@ module Knockapi def self.new( # OK response. ok: nil - ); end - sig { override.returns({ok: String}) } - def to_hash; end + ) + end + + sig { override.returns({ ok: String }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/providers/slack_check_auth_params.rbi b/rbi/knockapi/models/providers/slack_check_auth_params.rbi index 6de5b3ff..de1ccbad 100644 --- a/rbi/knockapi/models/providers/slack_check_auth_params.rbi +++ b/rbi/knockapi/models/providers/slack_check_auth_params.rbi @@ -7,6 +7,14 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::Providers::SlackCheckAuthParams, + Knockapi::Internal::AnyHash + ) + end + # A JSON encoded string containing the access token object reference. sig { returns(String) } attr_accessor :access_token_object @@ -14,17 +22,26 @@ module Knockapi sig do params( access_token_object: String, - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # A JSON encoded string containing the access token object reference. access_token_object:, request_options: {} - ); end - sig { override.returns({access_token_object: String, request_options: Knockapi::RequestOptions}) } - def to_hash; end + ) + end + + sig do + override.returns( + { + access_token_object: String, + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash + end end end end diff --git a/rbi/knockapi/models/providers/slack_check_auth_response.rbi b/rbi/knockapi/models/providers/slack_check_auth_response.rbi index b8866c8e..a6471c3e 100644 --- a/rbi/knockapi/models/providers/slack_check_auth_response.rbi +++ b/rbi/knockapi/models/providers/slack_check_auth_response.rbi @@ -4,33 +4,63 @@ module Knockapi module Models module Providers class SlackCheckAuthResponse < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::Providers::SlackCheckAuthResponse, + Knockapi::Internal::AnyHash + ) + end + # A Slack connection object. - sig { returns(Knockapi::Models::Providers::SlackCheckAuthResponse::Connection) } + sig do + returns( + Knockapi::Models::Providers::SlackCheckAuthResponse::Connection + ) + end attr_reader :connection sig do params( - connection: T.any(Knockapi::Models::Providers::SlackCheckAuthResponse::Connection, Knockapi::Internal::AnyHash) - ) - .void + connection: + Knockapi::Models::Providers::SlackCheckAuthResponse::Connection::OrHash + ).void end attr_writer :connection # The response from a Slack auth check request. sig do params( - connection: T.any(Knockapi::Models::Providers::SlackCheckAuthResponse::Connection, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + connection: + Knockapi::Models::Providers::SlackCheckAuthResponse::Connection::OrHash + ).returns(T.attached_class) end def self.new( # A Slack connection object. connection: - ); end - sig { override.returns({connection: Knockapi::Models::Providers::SlackCheckAuthResponse::Connection}) } - def to_hash; end + ) + end + + sig do + override.returns( + { + connection: + Knockapi::Models::Providers::SlackCheckAuthResponse::Connection + } + ) + end + def to_hash + end class Connection < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::Providers::SlackCheckAuthResponse::Connection, + Knockapi::Internal::AnyHash + ) + end + # Whether the Slack connection is valid. sig { returns(T::Boolean) } attr_accessor :ok @@ -40,15 +70,24 @@ module Knockapi attr_accessor :reason # A Slack connection object. - sig { params(ok: T::Boolean, reason: T.nilable(String)).returns(T.attached_class) } + sig do + params(ok: T::Boolean, reason: T.nilable(String)).returns( + T.attached_class + ) + end def self.new( # Whether the Slack connection is valid. ok:, # The reason for the Slack connection if it is not valid. reason: nil - ); end - sig { override.returns({ok: T::Boolean, reason: T.nilable(String)}) } - def to_hash; end + ) + end + + sig do + override.returns({ ok: T::Boolean, reason: T.nilable(String) }) + end + def to_hash + end end end end diff --git a/rbi/knockapi/models/providers/slack_list_channels_params.rbi b/rbi/knockapi/models/providers/slack_list_channels_params.rbi index 40dad7fe..cc18eddd 100644 --- a/rbi/knockapi/models/providers/slack_list_channels_params.rbi +++ b/rbi/knockapi/models/providers/slack_list_channels_params.rbi @@ -7,48 +7,73 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::Providers::SlackListChannelsParams, + Knockapi::Internal::AnyHash + ) + end + # A JSON encoded string containing the access token object reference. sig { returns(String) } attr_accessor :access_token_object - sig { returns(T.nilable(Knockapi::Models::Providers::SlackListChannelsParams::QueryOptions)) } + sig do + returns( + T.nilable( + Knockapi::Providers::SlackListChannelsParams::QueryOptions + ) + ) + end attr_reader :query_options sig do params( - query_options: T.any(Knockapi::Models::Providers::SlackListChannelsParams::QueryOptions, Knockapi::Internal::AnyHash) - ) - .void + query_options: + Knockapi::Providers::SlackListChannelsParams::QueryOptions::OrHash + ).void end attr_writer :query_options sig do params( access_token_object: String, - query_options: T.any(Knockapi::Models::Providers::SlackListChannelsParams::QueryOptions, Knockapi::Internal::AnyHash), - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + query_options: + Knockapi::Providers::SlackListChannelsParams::QueryOptions::OrHash, + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # A JSON encoded string containing the access token object reference. access_token_object:, query_options: nil, request_options: {} - ); end + ) + end + sig do - override - .returns( - { - access_token_object: String, - query_options: Knockapi::Models::Providers::SlackListChannelsParams::QueryOptions, - request_options: Knockapi::RequestOptions - } - ) + override.returns( + { + access_token_object: String, + query_options: + Knockapi::Providers::SlackListChannelsParams::QueryOptions, + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end class QueryOptions < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Providers::SlackListChannelsParams::QueryOptions, + Knockapi::Internal::AnyHash + ) + end + # Paginate through collections of data by setting the cursor parameter to a # next_cursor attribute returned by a previous request's response_metadata. # Default value fetches the first "page" of the collection. @@ -94,8 +119,7 @@ module Knockapi limit: Integer, team_id: String, types: String - ) - .returns(T.attached_class) + ).returns(T.attached_class) end def self.new( # Paginate through collections of data by setting the cursor parameter to a @@ -111,18 +135,22 @@ module Knockapi # Mix and match channel types by providing a comma-separated list of any # combination of public_channel, private_channel, mpim, im. types: nil - ); end + ) + end + sig do - override - .returns({ - cursor: String, - exclude_archived: T::Boolean, - limit: Integer, - team_id: String, - types: String - }) + override.returns( + { + cursor: String, + exclude_archived: T::Boolean, + limit: Integer, + team_id: String, + types: String + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/providers/slack_list_channels_response.rbi b/rbi/knockapi/models/providers/slack_list_channels_response.rbi index 0ecc9207..e3c85576 100644 --- a/rbi/knockapi/models/providers/slack_list_channels_response.rbi +++ b/rbi/knockapi/models/providers/slack_list_channels_response.rbi @@ -4,6 +4,14 @@ module Knockapi module Models module Providers class SlackListChannelsResponse < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::Providers::SlackListChannelsResponse, + Knockapi::Internal::AnyHash + ) + end + # A Slack channel ID from the Slack provider. sig { returns(String) } attr_accessor :id @@ -26,8 +34,13 @@ module Knockapi # A Slack channel. sig do - params(id: String, context_team_id: String, is_im: T::Boolean, is_private: T::Boolean, name: String) - .returns(T.attached_class) + params( + id: String, + context_team_id: String, + is_im: T::Boolean, + is_private: T::Boolean, + name: String + ).returns(T.attached_class) end def self.new( # A Slack channel ID from the Slack provider. @@ -40,18 +53,22 @@ module Knockapi is_private:, # Slack channel name. name: - ); end + ) + end + sig do - override - .returns({ - id: String, - context_team_id: String, - is_im: T::Boolean, - is_private: T::Boolean, - name: String - }) + override.returns( + { + id: String, + context_team_id: String, + is_im: T::Boolean, + is_private: T::Boolean, + name: String + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/providers/slack_revoke_access_params.rbi b/rbi/knockapi/models/providers/slack_revoke_access_params.rbi index fca75104..7a0bf8fe 100644 --- a/rbi/knockapi/models/providers/slack_revoke_access_params.rbi +++ b/rbi/knockapi/models/providers/slack_revoke_access_params.rbi @@ -7,6 +7,14 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::Providers::SlackRevokeAccessParams, + Knockapi::Internal::AnyHash + ) + end + # A JSON encoded string containing the access token object reference. sig { returns(String) } attr_accessor :access_token_object @@ -14,17 +22,26 @@ module Knockapi sig do params( access_token_object: String, - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # A JSON encoded string containing the access token object reference. access_token_object:, request_options: {} - ); end - sig { override.returns({access_token_object: String, request_options: Knockapi::RequestOptions}) } - def to_hash; end + ) + end + + sig do + override.returns( + { + access_token_object: String, + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash + end end end end diff --git a/rbi/knockapi/models/providers/slack_revoke_access_response.rbi b/rbi/knockapi/models/providers/slack_revoke_access_response.rbi index b3ca2857..2086c774 100644 --- a/rbi/knockapi/models/providers/slack_revoke_access_response.rbi +++ b/rbi/knockapi/models/providers/slack_revoke_access_response.rbi @@ -4,6 +4,14 @@ module Knockapi module Models module Providers class SlackRevokeAccessResponse < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::Providers::SlackRevokeAccessResponse, + Knockapi::Internal::AnyHash + ) + end + # OK response. sig { returns(T.nilable(String)) } attr_reader :ok @@ -16,9 +24,12 @@ module Knockapi def self.new( # OK response. ok: nil - ); end - sig { override.returns({ok: String}) } - def to_hash; end + ) + end + + sig { override.returns({ ok: String }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/recipient.rbi b/rbi/knockapi/models/recipient.rbi index cbe25a69..282289d8 100644 --- a/rbi/knockapi/models/recipient.rbi +++ b/rbi/knockapi/models/recipient.rbi @@ -6,8 +6,11 @@ module Knockapi module Recipient extend Knockapi::Internal::Type::Union - sig { override.returns([Knockapi::Models::User, Knockapi::Models::Object]) } - def self.variants; end + Variants = T.type_alias { T.any(Knockapi::User, Knockapi::Object) } + + sig { override.returns(T::Array[Knockapi::Recipient::Variants]) } + def self.variants + end end end end diff --git a/rbi/knockapi/models/recipient_reference.rbi b/rbi/knockapi/models/recipient_reference.rbi index ba626fda..5b6b94b9 100644 --- a/rbi/knockapi/models/recipient_reference.rbi +++ b/rbi/knockapi/models/recipient_reference.rbi @@ -7,7 +7,20 @@ module Knockapi module RecipientReference extend Knockapi::Internal::Type::Union + Variants = + T.type_alias do + T.any(String, Knockapi::RecipientReference::ObjectReference) + end + class ObjectReference < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::RecipientReference::ObjectReference, + Knockapi::Internal::AnyHash + ) + end + # An identifier for the recipient object. sig { returns(T.nilable(String)) } attr_reader :id @@ -29,13 +42,17 @@ module Knockapi id: nil, # The collection the recipient object belongs to. collection: nil - ); end - sig { override.returns({id: String, collection: String}) } - def to_hash; end + ) + end + + sig { override.returns({ id: String, collection: String }) } + def to_hash + end end - sig { override.returns([String, Knockapi::Models::RecipientReference::ObjectReference]) } - def self.variants; end + sig { override.returns(T::Array[Knockapi::RecipientReference::Variants]) } + def self.variants + end end end end diff --git a/rbi/knockapi/models/recipient_request.rbi b/rbi/knockapi/models/recipient_request.rbi index 45b14837..cc9e54cd 100644 --- a/rbi/knockapi/models/recipient_request.rbi +++ b/rbi/knockapi/models/recipient_request.rbi @@ -8,11 +8,18 @@ module Knockapi module RecipientRequest extend Knockapi::Internal::Type::Union - sig do - override - .returns([String, Knockapi::Models::InlineIdentifyUserRequest, Knockapi::Models::InlineObjectRequest]) + Variants = + T.type_alias do + T.any( + String, + Knockapi::InlineIdentifyUserRequest, + Knockapi::InlineObjectRequest + ) + end + + sig { override.returns(T::Array[Knockapi::RecipientRequest::Variants]) } + def self.variants end - def self.variants; end end end end diff --git a/rbi/knockapi/models/recipients/channel_data.rbi b/rbi/knockapi/models/recipients/channel_data.rbi index ff56b284..5beefdde 100644 --- a/rbi/knockapi/models/recipients/channel_data.rbi +++ b/rbi/knockapi/models/recipients/channel_data.rbi @@ -4,6 +4,14 @@ module Knockapi module Models module Recipients class RecipientsChannelData < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Recipients::RecipientsChannelData, + Knockapi::Internal::AnyHash + ) + end + # The typename of the schema. sig { returns(String) } attr_accessor :_typename @@ -16,21 +24,32 @@ module Knockapi sig do returns( T.any( - Knockapi::Models::Recipients::PushChannelData, - Knockapi::Models::Recipients::SlackChannelData, - Knockapi::Models::Recipients::MsTeamsChannelData, - Knockapi::Models::Recipients::DiscordChannelData, - Knockapi::Models::Recipients::OneSignalChannelData + Knockapi::Recipients::PushChannelData, + Knockapi::Recipients::SlackChannelData, + Knockapi::Recipients::MsTeamsChannelData, + Knockapi::Recipients::DiscordChannelData, + Knockapi::Recipients::OneSignalChannelData ) ) end attr_accessor :data # The type of provider. - sig { returns(T.nilable(Knockapi::Models::Recipients::RecipientsChannelData::Provider::TaggedSymbol)) } + sig do + returns( + T.nilable( + Knockapi::Recipients::RecipientsChannelData::Provider::TaggedSymbol + ) + ) + end attr_reader :provider - sig { params(provider: Knockapi::Models::Recipients::RecipientsChannelData::Provider::OrSymbol).void } + sig do + params( + provider: + Knockapi::Recipients::RecipientsChannelData::Provider::OrSymbol + ).void + end attr_writer :provider # Channel data for a given channel type. @@ -38,17 +57,17 @@ module Knockapi params( _typename: String, channel_id: String, - data: T.any( - Knockapi::Models::Recipients::PushChannelData, - Knockapi::Internal::AnyHash, - Knockapi::Models::Recipients::SlackChannelData, - Knockapi::Models::Recipients::MsTeamsChannelData, - Knockapi::Models::Recipients::DiscordChannelData, - Knockapi::Models::Recipients::OneSignalChannelData - ), - provider: Knockapi::Models::Recipients::RecipientsChannelData::Provider::OrSymbol - ) - .returns(T.attached_class) + data: + T.any( + Knockapi::Recipients::PushChannelData::OrHash, + Knockapi::Recipients::SlackChannelData::OrHash, + Knockapi::Recipients::MsTeamsChannelData::OrHash, + Knockapi::Recipients::DiscordChannelData::OrHash, + Knockapi::Recipients::OneSignalChannelData::OrHash + ), + provider: + Knockapi::Recipients::RecipientsChannelData::Provider::OrSymbol + ).returns(T.attached_class) end def self.new( # The typename of the schema. @@ -59,37 +78,54 @@ module Knockapi data:, # The type of provider. provider: nil - ); end + ) + end + sig do - override - .returns( - { - _typename: String, - channel_id: String, - data: T.any( - Knockapi::Models::Recipients::PushChannelData, - Knockapi::Models::Recipients::SlackChannelData, - Knockapi::Models::Recipients::MsTeamsChannelData, - Knockapi::Models::Recipients::DiscordChannelData, - Knockapi::Models::Recipients::OneSignalChannelData + override.returns( + { + _typename: String, + channel_id: String, + data: + T.any( + Knockapi::Recipients::PushChannelData, + Knockapi::Recipients::SlackChannelData, + Knockapi::Recipients::MsTeamsChannelData, + Knockapi::Recipients::DiscordChannelData, + Knockapi::Recipients::OneSignalChannelData ), - provider: Knockapi::Models::Recipients::RecipientsChannelData::Provider::TaggedSymbol - } - ) + provider: + Knockapi::Recipients::RecipientsChannelData::Provider::TaggedSymbol + } + ) + end + def to_hash end - def to_hash; end # Channel data for a given channel type. module Data extend Knockapi::Internal::Type::Union - sig do - override - .returns( - [Knockapi::Models::Recipients::PushChannelData, Knockapi::Models::Recipients::SlackChannelData, Knockapi::Models::Recipients::MsTeamsChannelData, Knockapi::Models::Recipients::DiscordChannelData, Knockapi::Models::Recipients::OneSignalChannelData] + Variants = + T.type_alias do + T.any( + Knockapi::Recipients::PushChannelData, + Knockapi::Recipients::SlackChannelData, + Knockapi::Recipients::MsTeamsChannelData, + Knockapi::Recipients::DiscordChannelData, + Knockapi::Recipients::OneSignalChannelData ) + end + + sig do + override.returns( + T::Array[ + Knockapi::Recipients::RecipientsChannelData::Data::Variants + ] + ) + end + def self.variants end - def self.variants; end end # The type of provider. @@ -97,27 +133,64 @@ module Knockapi extend Knockapi::Internal::Type::Enum TaggedSymbol = - T.type_alias { T.all(Symbol, Knockapi::Models::Recipients::RecipientsChannelData::Provider) } + T.type_alias do + T.all( + Symbol, + Knockapi::Recipients::RecipientsChannelData::Provider + ) + end OrSymbol = T.type_alias { T.any(Symbol, String) } - PUSH_FCM = T.let(:push_fcm, Knockapi::Models::Recipients::RecipientsChannelData::Provider::TaggedSymbol) + PUSH_FCM = + T.let( + :push_fcm, + Knockapi::Recipients::RecipientsChannelData::Provider::TaggedSymbol + ) PUSH_APNS = - T.let(:push_apns, Knockapi::Models::Recipients::RecipientsChannelData::Provider::TaggedSymbol) + T.let( + :push_apns, + Knockapi::Recipients::RecipientsChannelData::Provider::TaggedSymbol + ) PUSH_EXPO = - T.let(:push_expo, Knockapi::Models::Recipients::RecipientsChannelData::Provider::TaggedSymbol) + T.let( + :push_expo, + Knockapi::Recipients::RecipientsChannelData::Provider::TaggedSymbol + ) PUSH_ONE_SIGNAL = - T.let(:push_one_signal, Knockapi::Models::Recipients::RecipientsChannelData::Provider::TaggedSymbol) + T.let( + :push_one_signal, + Knockapi::Recipients::RecipientsChannelData::Provider::TaggedSymbol + ) CHAT_SLACK = - T.let(:chat_slack, Knockapi::Models::Recipients::RecipientsChannelData::Provider::TaggedSymbol) + T.let( + :chat_slack, + Knockapi::Recipients::RecipientsChannelData::Provider::TaggedSymbol + ) CHAT_MS_TEAMS = - T.let(:chat_ms_teams, Knockapi::Models::Recipients::RecipientsChannelData::Provider::TaggedSymbol) + T.let( + :chat_ms_teams, + Knockapi::Recipients::RecipientsChannelData::Provider::TaggedSymbol + ) CHAT_DISCORD = - T.let(:chat_discord, Knockapi::Models::Recipients::RecipientsChannelData::Provider::TaggedSymbol) + T.let( + :chat_discord, + Knockapi::Recipients::RecipientsChannelData::Provider::TaggedSymbol + ) HTTP_KNOCK_WEBHOOK = - T.let(:http_knock_webhook, Knockapi::Models::Recipients::RecipientsChannelData::Provider::TaggedSymbol) + T.let( + :http_knock_webhook, + Knockapi::Recipients::RecipientsChannelData::Provider::TaggedSymbol + ) - sig { override.returns(T::Array[Knockapi::Models::Recipients::RecipientsChannelData::Provider::TaggedSymbol]) } - def self.values; end + sig do + override.returns( + T::Array[ + Knockapi::Recipients::RecipientsChannelData::Provider::TaggedSymbol + ] + ) + end + def self.values + end end end end diff --git a/rbi/knockapi/models/recipients/channel_data_request.rbi b/rbi/knockapi/models/recipients/channel_data_request.rbi index 12d874bf..df815dcb 100644 --- a/rbi/knockapi/models/recipients/channel_data_request.rbi +++ b/rbi/knockapi/models/recipients/channel_data_request.rbi @@ -4,15 +4,23 @@ module Knockapi module Models module Recipients class ChannelDataRequest < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Recipients::ChannelDataRequest, + Knockapi::Internal::AnyHash + ) + end + # Channel data for a given channel type. sig do returns( T.any( - Knockapi::Models::Recipients::PushChannelData, - Knockapi::Models::Recipients::OneSignalChannelData, - Knockapi::Models::Recipients::SlackChannelData, - Knockapi::Models::Recipients::MsTeamsChannelData, - Knockapi::Models::Recipients::DiscordChannelData + Knockapi::Recipients::PushChannelData, + Knockapi::Recipients::OneSignalChannelData, + Knockapi::Recipients::SlackChannelData, + Knockapi::Recipients::MsTeamsChannelData, + Knockapi::Recipients::DiscordChannelData ) ) end @@ -21,48 +29,61 @@ module Knockapi # A request to set channel data for a type of channel. sig do params( - data: T.any( - Knockapi::Models::Recipients::PushChannelData, - Knockapi::Internal::AnyHash, - Knockapi::Models::Recipients::OneSignalChannelData, - Knockapi::Models::Recipients::SlackChannelData, - Knockapi::Models::Recipients::MsTeamsChannelData, - Knockapi::Models::Recipients::DiscordChannelData - ) - ) - .returns(T.attached_class) + data: + T.any( + Knockapi::Recipients::PushChannelData::OrHash, + Knockapi::Recipients::OneSignalChannelData::OrHash, + Knockapi::Recipients::SlackChannelData::OrHash, + Knockapi::Recipients::MsTeamsChannelData::OrHash, + Knockapi::Recipients::DiscordChannelData::OrHash + ) + ).returns(T.attached_class) end def self.new( # Channel data for a given channel type. data: - ); end + ) + end + sig do - override - .returns( - { - data: T.any( - Knockapi::Models::Recipients::PushChannelData, - Knockapi::Models::Recipients::OneSignalChannelData, - Knockapi::Models::Recipients::SlackChannelData, - Knockapi::Models::Recipients::MsTeamsChannelData, - Knockapi::Models::Recipients::DiscordChannelData + override.returns( + { + data: + T.any( + Knockapi::Recipients::PushChannelData, + Knockapi::Recipients::OneSignalChannelData, + Knockapi::Recipients::SlackChannelData, + Knockapi::Recipients::MsTeamsChannelData, + Knockapi::Recipients::DiscordChannelData ) - } - ) + } + ) + end + def to_hash end - def to_hash; end # Channel data for a given channel type. module Data extend Knockapi::Internal::Type::Union - sig do - override - .returns( - [Knockapi::Models::Recipients::PushChannelData, Knockapi::Models::Recipients::OneSignalChannelData, Knockapi::Models::Recipients::SlackChannelData, Knockapi::Models::Recipients::MsTeamsChannelData, Knockapi::Models::Recipients::DiscordChannelData] + Variants = + T.type_alias do + T.any( + Knockapi::Recipients::PushChannelData, + Knockapi::Recipients::OneSignalChannelData, + Knockapi::Recipients::SlackChannelData, + Knockapi::Recipients::MsTeamsChannelData, + Knockapi::Recipients::DiscordChannelData ) + end + + sig do + override.returns( + T::Array[Knockapi::Recipients::ChannelDataRequest::Data::Variants] + ) + end + def self.variants end - def self.variants; end end end end diff --git a/rbi/knockapi/models/recipients/discord_channel_data.rbi b/rbi/knockapi/models/recipients/discord_channel_data.rbi index 0346046b..3b1e65d1 100644 --- a/rbi/knockapi/models/recipients/discord_channel_data.rbi +++ b/rbi/knockapi/models/recipients/discord_channel_data.rbi @@ -4,13 +4,21 @@ module Knockapi module Models module Recipients class DiscordChannelData < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Recipients::DiscordChannelData, + Knockapi::Internal::AnyHash + ) + end + # List of Discord channel connections. sig do returns( T::Array[ T.any( - Knockapi::Models::Recipients::DiscordChannelData::Connection::DiscordChannelConnection, - Knockapi::Models::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection + Knockapi::Recipients::DiscordChannelData::Connection::DiscordChannelConnection, + Knockapi::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection ) ] ) @@ -20,41 +28,59 @@ module Knockapi # Discord channel data. sig do params( - connections: T::Array[ - T.any( - Knockapi::Models::Recipients::DiscordChannelData::Connection::DiscordChannelConnection, - Knockapi::Internal::AnyHash, - Knockapi::Models::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection - ) - ] - ) - .returns(T.attached_class) + connections: + T::Array[ + T.any( + Knockapi::Recipients::DiscordChannelData::Connection::DiscordChannelConnection::OrHash, + Knockapi::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection::OrHash + ) + ] + ).returns(T.attached_class) end def self.new( # List of Discord channel connections. connections: - ); end + ) + end + sig do - override - .returns( - { - connections: T::Array[ + override.returns( + { + connections: + T::Array[ T.any( - Knockapi::Models::Recipients::DiscordChannelData::Connection::DiscordChannelConnection, - Knockapi::Models::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection + Knockapi::Recipients::DiscordChannelData::Connection::DiscordChannelConnection, + Knockapi::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection ) ] - } - ) + } + ) + end + def to_hash end - def to_hash; end # Discord channel connection, either a channel connection or an incoming webhook # connection. module Connection extend Knockapi::Internal::Type::Union + Variants = + T.type_alias do + T.any( + Knockapi::Recipients::DiscordChannelData::Connection::DiscordChannelConnection, + Knockapi::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection + ) + end + class DiscordChannelConnection < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Recipients::DiscordChannelData::Connection::DiscordChannelConnection, + Knockapi::Internal::AnyHash + ) + end + # Discord channel ID. sig { returns(String) } attr_accessor :channel_id @@ -64,56 +90,72 @@ module Knockapi def self.new( # Discord channel ID. channel_id: - ); end - sig { override.returns({channel_id: String}) } - def to_hash; end + ) + end + + sig { override.returns({ channel_id: String }) } + def to_hash + end end class DiscordIncomingWebhookConnection < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection, + Knockapi::Internal::AnyHash + ) + end + # Discord incoming webhook object. sig do returns( - Knockapi::Models::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection::IncomingWebhook + Knockapi::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection::IncomingWebhook ) end attr_reader :incoming_webhook sig do params( - incoming_webhook: T.any( - Knockapi::Models::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection::IncomingWebhook, - Knockapi::Internal::AnyHash - ) - ) - .void + incoming_webhook: + Knockapi::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection::IncomingWebhook::OrHash + ).void end attr_writer :incoming_webhook # Discord incoming webhook connection. sig do params( - incoming_webhook: T.any( - Knockapi::Models::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection::IncomingWebhook, - Knockapi::Internal::AnyHash - ) - ) - .returns(T.attached_class) + incoming_webhook: + Knockapi::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection::IncomingWebhook::OrHash + ).returns(T.attached_class) end def self.new( # Discord incoming webhook object. incoming_webhook: - ); end + ) + end + sig do - override - .returns( - { - incoming_webhook: Knockapi::Models::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection::IncomingWebhook - } - ) + override.returns( + { + incoming_webhook: + Knockapi::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection::IncomingWebhook + } + ) + end + def to_hash end - def to_hash; end class IncomingWebhook < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection::IncomingWebhook, + Knockapi::Internal::AnyHash + ) + end + # Incoming webhook URL. sig { returns(String) } attr_accessor :url @@ -123,19 +165,24 @@ module Knockapi def self.new( # Incoming webhook URL. url: - ); end - sig { override.returns({url: String}) } - def to_hash; end + ) + end + + sig { override.returns({ url: String }) } + def to_hash + end end end sig do - override - .returns( - [Knockapi::Models::Recipients::DiscordChannelData::Connection::DiscordChannelConnection, Knockapi::Models::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection] - ) + override.returns( + T::Array[ + Knockapi::Recipients::DiscordChannelData::Connection::Variants + ] + ) + end + def self.variants end - def self.variants; end end end end diff --git a/rbi/knockapi/models/recipients/inline_channel_data_request.rbi b/rbi/knockapi/models/recipients/inline_channel_data_request.rbi index a623912b..8dc0189c 100644 --- a/rbi/knockapi/models/recipients/inline_channel_data_request.rbi +++ b/rbi/knockapi/models/recipients/inline_channel_data_request.rbi @@ -3,9 +3,37 @@ module Knockapi module Models module Recipients + # Channel data for a given channel type. + module InlineChannelDataRequestItem + extend Knockapi::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Knockapi::Recipients::PushChannelData, + Knockapi::Recipients::OneSignalChannelData, + Knockapi::Recipients::SlackChannelData, + Knockapi::Recipients::MsTeamsChannelData, + Knockapi::Recipients::DiscordChannelData + ) + end + + sig do + override.returns( + T::Array[ + Knockapi::Recipients::InlineChannelDataRequestItem::Variants + ] + ) + end + def self.variants + end + end + InlineChannelDataRequest = T.let( - Knockapi::Internal::Type::HashOf[Knockapi::Models::Recipients::ChannelDataRequest], + Knockapi::Internal::Type::HashOf[ + union: Knockapi::Recipients::InlineChannelDataRequestItem + ], Knockapi::Internal::Type::Converter ) end diff --git a/rbi/knockapi/models/recipients/inline_preference_set_request.rbi b/rbi/knockapi/models/recipients/inline_preference_set_request.rbi index 1444e563..03b3407a 100644 --- a/rbi/knockapi/models/recipients/inline_preference_set_request.rbi +++ b/rbi/knockapi/models/recipients/inline_preference_set_request.rbi @@ -5,7 +5,9 @@ module Knockapi module Recipients InlinePreferenceSetRequest = T.let( - Knockapi::Internal::Type::HashOf[Knockapi::Models::Recipients::PreferenceSetRequest], + Knockapi::Internal::Type::HashOf[ + Knockapi::Recipients::PreferenceSetRequest + ], Knockapi::Internal::Type::Converter ) end diff --git a/rbi/knockapi/models/recipients/ms_teams_channel_data.rbi b/rbi/knockapi/models/recipients/ms_teams_channel_data.rbi index 9c543886..b56f7c67 100644 --- a/rbi/knockapi/models/recipients/ms_teams_channel_data.rbi +++ b/rbi/knockapi/models/recipients/ms_teams_channel_data.rbi @@ -4,13 +4,21 @@ module Knockapi module Models module Recipients class MsTeamsChannelData < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Recipients::MsTeamsChannelData, + Knockapi::Internal::AnyHash + ) + end + # List of Microsoft Teams connections. sig do returns( T::Array[ T.any( - Knockapi::Models::Recipients::MsTeamsChannelData::Connection::MsTeamsTokenConnection, - Knockapi::Models::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection + Knockapi::Recipients::MsTeamsChannelData::Connection::MsTeamsTokenConnection, + Knockapi::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection ) ] ) @@ -24,44 +32,62 @@ module Knockapi # Microsoft Teams channel connection. sig do params( - connections: T::Array[ - T.any( - Knockapi::Models::Recipients::MsTeamsChannelData::Connection::MsTeamsTokenConnection, - Knockapi::Internal::AnyHash, - Knockapi::Models::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection - ) - ], + connections: + T::Array[ + T.any( + Knockapi::Recipients::MsTeamsChannelData::Connection::MsTeamsTokenConnection::OrHash, + Knockapi::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection::OrHash + ) + ], ms_teams_tenant_id: T.nilable(String) - ) - .returns(T.attached_class) + ).returns(T.attached_class) end def self.new( # List of Microsoft Teams connections. connections:, # Microsoft Teams tenant ID. ms_teams_tenant_id: nil - ); end + ) + end + sig do - override - .returns( - { - connections: T::Array[ + override.returns( + { + connections: + T::Array[ T.any( - Knockapi::Models::Recipients::MsTeamsChannelData::Connection::MsTeamsTokenConnection, - Knockapi::Models::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection + Knockapi::Recipients::MsTeamsChannelData::Connection::MsTeamsTokenConnection, + Knockapi::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection ) ], - ms_teams_tenant_id: T.nilable(String) - } - ) + ms_teams_tenant_id: T.nilable(String) + } + ) + end + def to_hash end - def to_hash; end # Microsoft Teams token connection. module Connection extend Knockapi::Internal::Type::Union + Variants = + T.type_alias do + T.any( + Knockapi::Recipients::MsTeamsChannelData::Connection::MsTeamsTokenConnection, + Knockapi::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection + ) + end + class MsTeamsTokenConnection < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Recipients::MsTeamsChannelData::Connection::MsTeamsTokenConnection, + Knockapi::Internal::AnyHash + ) + end + # Microsoft Teams channel ID. sig { returns(T.nilable(String)) } attr_accessor :ms_teams_channel_id @@ -85,8 +111,7 @@ module Knockapi ms_teams_team_id: T.nilable(String), ms_teams_tenant_id: T.nilable(String), ms_teams_user_id: T.nilable(String) - ) - .returns(T.attached_class) + ).returns(T.attached_class) end def self.new( # Microsoft Teams channel ID. @@ -97,66 +122,81 @@ module Knockapi ms_teams_tenant_id: nil, # Microsoft Teams user ID. ms_teams_user_id: nil - ); end + ) + end + sig do - override - .returns( - { - ms_teams_channel_id: T.nilable(String), - ms_teams_team_id: T.nilable(String), - ms_teams_tenant_id: T.nilable(String), - ms_teams_user_id: T.nilable(String) - } - ) + override.returns( + { + ms_teams_channel_id: T.nilable(String), + ms_teams_team_id: T.nilable(String), + ms_teams_tenant_id: T.nilable(String), + ms_teams_user_id: T.nilable(String) + } + ) + end + def to_hash end - def to_hash; end end class MsTeamsIncomingWebhookConnection < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection, + Knockapi::Internal::AnyHash + ) + end + # Microsoft Teams incoming webhook. sig do returns( - Knockapi::Models::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection::IncomingWebhook + Knockapi::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection::IncomingWebhook ) end attr_reader :incoming_webhook sig do params( - incoming_webhook: T.any( - Knockapi::Models::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection::IncomingWebhook, - Knockapi::Internal::AnyHash - ) - ) - .void + incoming_webhook: + Knockapi::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection::IncomingWebhook::OrHash + ).void end attr_writer :incoming_webhook # Microsoft Teams incoming webhook connection. sig do params( - incoming_webhook: T.any( - Knockapi::Models::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection::IncomingWebhook, - Knockapi::Internal::AnyHash - ) - ) - .returns(T.attached_class) + incoming_webhook: + Knockapi::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection::IncomingWebhook::OrHash + ).returns(T.attached_class) end def self.new( # Microsoft Teams incoming webhook. incoming_webhook: - ); end + ) + end + sig do - override - .returns( - { - incoming_webhook: Knockapi::Models::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection::IncomingWebhook - } - ) + override.returns( + { + incoming_webhook: + Knockapi::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection::IncomingWebhook + } + ) + end + def to_hash end - def to_hash; end class IncomingWebhook < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection::IncomingWebhook, + Knockapi::Internal::AnyHash + ) + end + # Microsoft Teams incoming webhook URL. sig { returns(String) } attr_accessor :url @@ -166,19 +206,24 @@ module Knockapi def self.new( # Microsoft Teams incoming webhook URL. url: - ); end - sig { override.returns({url: String}) } - def to_hash; end + ) + end + + sig { override.returns({ url: String }) } + def to_hash + end end end sig do - override - .returns( - [Knockapi::Models::Recipients::MsTeamsChannelData::Connection::MsTeamsTokenConnection, Knockapi::Models::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection] - ) + override.returns( + T::Array[ + Knockapi::Recipients::MsTeamsChannelData::Connection::Variants + ] + ) + end + def self.variants end - def self.variants; end end end end diff --git a/rbi/knockapi/models/recipients/one_signal_channel_data.rbi b/rbi/knockapi/models/recipients/one_signal_channel_data.rbi index efaf9d71..c4a51dc5 100644 --- a/rbi/knockapi/models/recipients/one_signal_channel_data.rbi +++ b/rbi/knockapi/models/recipients/one_signal_channel_data.rbi @@ -4,6 +4,14 @@ module Knockapi module Models module Recipients class OneSignalChannelData < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Recipients::OneSignalChannelData, + Knockapi::Internal::AnyHash + ) + end + # A list of OneSignal player IDs. sig { returns(T::Array[String]) } attr_accessor :player_ids @@ -13,9 +21,12 @@ module Knockapi def self.new( # A list of OneSignal player IDs. player_ids: - ); end - sig { override.returns({player_ids: T::Array[String]}) } - def to_hash; end + ) + end + + sig { override.returns({ player_ids: T::Array[String] }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/recipients/preference_set.rbi b/rbi/knockapi/models/recipients/preference_set.rbi index 48f9aef0..af9ae11e 100644 --- a/rbi/knockapi/models/recipients/preference_set.rbi +++ b/rbi/knockapi/models/recipients/preference_set.rbi @@ -4,6 +4,14 @@ module Knockapi module Models module Recipients class PreferenceSet < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Recipients::PreferenceSet, + Knockapi::Internal::AnyHash + ) + end + # Unique identifier for the preference set. sig { returns(String) } attr_accessor :id @@ -17,7 +25,7 @@ module Knockapi Symbol, T.any( T::Boolean, - Knockapi::Models::Recipients::PreferenceSet::Category::PreferenceSetWorkflowCategorySettingObject + Knockapi::Recipients::PreferenceSet::Category::PreferenceSetWorkflowCategorySettingObject ) ] ) @@ -26,14 +34,16 @@ module Knockapi attr_accessor :categories # Channel type preferences. - sig { returns(T.nilable(Knockapi::Models::Recipients::PreferenceSetChannelTypes)) } + sig do + returns(T.nilable(Knockapi::Recipients::PreferenceSetChannelTypes)) + end attr_reader :channel_types sig do params( - channel_types: T.nilable(T.any(Knockapi::Models::Recipients::PreferenceSetChannelTypes, Knockapi::Internal::AnyHash)) - ) - .void + channel_types: + T.nilable(Knockapi::Recipients::PreferenceSetChannelTypes::OrHash) + ).void end attr_writer :channel_types @@ -46,7 +56,7 @@ module Knockapi Symbol, T.any( T::Boolean, - Knockapi::Models::Recipients::PreferenceSet::Workflow::PreferenceSetWorkflowCategorySettingObject + Knockapi::Recipients::PreferenceSet::Workflow::PreferenceSetWorkflowCategorySettingObject ) ] ) @@ -59,29 +69,31 @@ module Knockapi sig do params( id: String, - categories: T.nilable( - T::Hash[ - Symbol, - T.any( - T::Boolean, - Knockapi::Models::Recipients::PreferenceSet::Category::PreferenceSetWorkflowCategorySettingObject, - Knockapi::Internal::AnyHash - ) - ] - ), - channel_types: T.nilable(T.any(Knockapi::Models::Recipients::PreferenceSetChannelTypes, Knockapi::Internal::AnyHash)), - workflows: T.nilable( - T::Hash[ - Symbol, - T.any( - T::Boolean, - Knockapi::Models::Recipients::PreferenceSet::Workflow::PreferenceSetWorkflowCategorySettingObject, - Knockapi::Internal::AnyHash - ) - ] - ) - ) - .returns(T.attached_class) + categories: + T.nilable( + T::Hash[ + Symbol, + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSet::Category::PreferenceSetWorkflowCategorySettingObject::OrHash + ) + ] + ), + channel_types: + T.nilable( + Knockapi::Recipients::PreferenceSetChannelTypes::OrHash + ), + workflows: + T.nilable( + T::Hash[ + Symbol, + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSet::Workflow::PreferenceSetWorkflowCategorySettingObject::OrHash + ) + ] + ) + ).returns(T.attached_class) end def self.new( # Unique identifier for the preference set. @@ -94,148 +106,207 @@ module Knockapi # An object where the key is the workflow key and the values are the preference # settings for that workflow. workflows: nil - ); end + ) + end + sig do - override - .returns( - { - id: String, - categories: T.nilable( + override.returns( + { + id: String, + categories: + T.nilable( T::Hash[ Symbol, T.any( T::Boolean, - Knockapi::Models::Recipients::PreferenceSet::Category::PreferenceSetWorkflowCategorySettingObject + Knockapi::Recipients::PreferenceSet::Category::PreferenceSetWorkflowCategorySettingObject ) ] ), - channel_types: T.nilable(Knockapi::Models::Recipients::PreferenceSetChannelTypes), - workflows: T.nilable( + channel_types: + T.nilable(Knockapi::Recipients::PreferenceSetChannelTypes), + workflows: + T.nilable( T::Hash[ Symbol, T.any( T::Boolean, - Knockapi::Models::Recipients::PreferenceSet::Workflow::PreferenceSetWorkflowCategorySettingObject + Knockapi::Recipients::PreferenceSet::Workflow::PreferenceSetWorkflowCategorySettingObject ) ] ) - } - ) + } + ) + end + def to_hash end - def to_hash; end # Workflow or category preferences within a preference set module Category extend Knockapi::Internal::Type::Union + Variants = + T.type_alias do + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSet::Category::PreferenceSetWorkflowCategorySettingObject + ) + end + class PreferenceSetWorkflowCategorySettingObject < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Recipients::PreferenceSet::Category::PreferenceSetWorkflowCategorySettingObject, + Knockapi::Internal::AnyHash + ) + end + # Channel type preferences. - sig { returns(T.nilable(Knockapi::Models::Recipients::PreferenceSetChannelTypes)) } + sig do + returns( + T.nilable(Knockapi::Recipients::PreferenceSetChannelTypes) + ) + end attr_reader :channel_types sig do params( - channel_types: T.nilable(T.any(Knockapi::Models::Recipients::PreferenceSetChannelTypes, Knockapi::Internal::AnyHash)) - ) - .void + channel_types: + T.nilable( + Knockapi::Recipients::PreferenceSetChannelTypes::OrHash + ) + ).void end attr_writer :channel_types # A list of conditions to apply to a channel type. - sig { returns(T.nilable(T::Array[Knockapi::Models::Condition])) } + sig { returns(T.nilable(T::Array[Knockapi::Condition])) } attr_accessor :conditions # The settings object for a workflow or category, where you can specify channel # types or conditions. sig do params( - channel_types: T.nilable(T.any(Knockapi::Models::Recipients::PreferenceSetChannelTypes, Knockapi::Internal::AnyHash)), - conditions: T.nilable(T::Array[T.any(Knockapi::Models::Condition, Knockapi::Internal::AnyHash)]) - ) - .returns(T.attached_class) + channel_types: + T.nilable( + Knockapi::Recipients::PreferenceSetChannelTypes::OrHash + ), + conditions: T.nilable(T::Array[Knockapi::Condition::OrHash]) + ).returns(T.attached_class) end def self.new( # Channel type preferences. channel_types: nil, # A list of conditions to apply to a channel type. conditions: nil - ); end + ) + end + sig do - override - .returns( - { - channel_types: T.nilable(Knockapi::Models::Recipients::PreferenceSetChannelTypes), - conditions: T.nilable(T::Array[Knockapi::Models::Condition]) - } - ) + override.returns( + { + channel_types: + T.nilable(Knockapi::Recipients::PreferenceSetChannelTypes), + conditions: T.nilable(T::Array[Knockapi::Condition]) + } + ) + end + def to_hash end - def to_hash; end end sig do - override - .returns( - [T::Boolean, Knockapi::Models::Recipients::PreferenceSet::Category::PreferenceSetWorkflowCategorySettingObject] - ) + override.returns( + T::Array[Knockapi::Recipients::PreferenceSet::Category::Variants] + ) + end + def self.variants end - def self.variants; end end # Workflow or category preferences within a preference set module Workflow extend Knockapi::Internal::Type::Union + Variants = + T.type_alias do + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSet::Workflow::PreferenceSetWorkflowCategorySettingObject + ) + end + class PreferenceSetWorkflowCategorySettingObject < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Recipients::PreferenceSet::Workflow::PreferenceSetWorkflowCategorySettingObject, + Knockapi::Internal::AnyHash + ) + end + # Channel type preferences. - sig { returns(T.nilable(Knockapi::Models::Recipients::PreferenceSetChannelTypes)) } + sig do + returns( + T.nilable(Knockapi::Recipients::PreferenceSetChannelTypes) + ) + end attr_reader :channel_types sig do params( - channel_types: T.nilable(T.any(Knockapi::Models::Recipients::PreferenceSetChannelTypes, Knockapi::Internal::AnyHash)) - ) - .void + channel_types: + T.nilable( + Knockapi::Recipients::PreferenceSetChannelTypes::OrHash + ) + ).void end attr_writer :channel_types # A list of conditions to apply to a channel type. - sig { returns(T.nilable(T::Array[Knockapi::Models::Condition])) } + sig { returns(T.nilable(T::Array[Knockapi::Condition])) } attr_accessor :conditions # The settings object for a workflow or category, where you can specify channel # types or conditions. sig do params( - channel_types: T.nilable(T.any(Knockapi::Models::Recipients::PreferenceSetChannelTypes, Knockapi::Internal::AnyHash)), - conditions: T.nilable(T::Array[T.any(Knockapi::Models::Condition, Knockapi::Internal::AnyHash)]) - ) - .returns(T.attached_class) + channel_types: + T.nilable( + Knockapi::Recipients::PreferenceSetChannelTypes::OrHash + ), + conditions: T.nilable(T::Array[Knockapi::Condition::OrHash]) + ).returns(T.attached_class) end def self.new( # Channel type preferences. channel_types: nil, # A list of conditions to apply to a channel type. conditions: nil - ); end + ) + end + sig do - override - .returns( - { - channel_types: T.nilable(Knockapi::Models::Recipients::PreferenceSetChannelTypes), - conditions: T.nilable(T::Array[Knockapi::Models::Condition]) - } - ) + override.returns( + { + channel_types: + T.nilable(Knockapi::Recipients::PreferenceSetChannelTypes), + conditions: T.nilable(T::Array[Knockapi::Condition]) + } + ) + end + def to_hash end - def to_hash; end end sig do - override - .returns( - [T::Boolean, Knockapi::Models::Recipients::PreferenceSet::Workflow::PreferenceSetWorkflowCategorySettingObject] - ) + override.returns( + T::Array[Knockapi::Recipients::PreferenceSet::Workflow::Variants] + ) + end + def self.variants end - def self.variants; end end end end diff --git a/rbi/knockapi/models/recipients/preference_set_channel_type_setting.rbi b/rbi/knockapi/models/recipients/preference_set_channel_type_setting.rbi index 4c28209b..d50887b8 100644 --- a/rbi/knockapi/models/recipients/preference_set_channel_type_setting.rbi +++ b/rbi/knockapi/models/recipients/preference_set_channel_type_setting.rbi @@ -4,22 +4,34 @@ module Knockapi module Models module Recipients class PreferenceSetChannelTypeSetting < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Recipients::PreferenceSetChannelTypeSetting, + Knockapi::Internal::AnyHash + ) + end + # A list of conditions to apply to a channel type. - sig { returns(T::Array[Knockapi::Models::Condition]) } + sig { returns(T::Array[Knockapi::Condition]) } attr_accessor :conditions # A set of settings for a channel type. Currently, this can only be a list of # conditions to apply. sig do - params(conditions: T::Array[T.any(Knockapi::Models::Condition, Knockapi::Internal::AnyHash)]) - .returns(T.attached_class) + params(conditions: T::Array[Knockapi::Condition::OrHash]).returns( + T.attached_class + ) end def self.new( # A list of conditions to apply to a channel type. conditions: - ); end - sig { override.returns({conditions: T::Array[Knockapi::Models::Condition]}) } - def to_hash; end + ) + end + + sig { override.returns({ conditions: T::Array[Knockapi::Condition] }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/recipients/preference_set_channel_types.rbi b/rbi/knockapi/models/recipients/preference_set_channel_types.rbi index a20dfce3..ef36e952 100644 --- a/rbi/knockapi/models/recipients/preference_set_channel_types.rbi +++ b/rbi/knockapi/models/recipients/preference_set_channel_types.rbi @@ -4,137 +4,192 @@ module Knockapi module Models module Recipients class PreferenceSetChannelTypes < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Recipients::PreferenceSetChannelTypes, + Knockapi::Internal::AnyHash + ) + end + # Whether the channel type is enabled for the preference set. - sig { returns(T.nilable(T.any(T::Boolean, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting))) } + sig do + returns( + T.nilable( + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetChannelTypeSetting + ) + ) + ) + end attr_reader :chat sig do params( - chat: T.any( - T::Boolean, - Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting, - Knockapi::Internal::AnyHash - ) - ) - .void + chat: + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetChannelTypeSetting::OrHash + ) + ).void end attr_writer :chat # Whether the channel type is enabled for the preference set. - sig { returns(T.nilable(T.any(T::Boolean, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting))) } + sig do + returns( + T.nilable( + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetChannelTypeSetting + ) + ) + ) + end attr_reader :email sig do params( - email: T.any( - T::Boolean, - Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting, - Knockapi::Internal::AnyHash - ) - ) - .void + email: + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetChannelTypeSetting::OrHash + ) + ).void end attr_writer :email # Whether the channel type is enabled for the preference set. - sig { returns(T.nilable(T.any(T::Boolean, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting))) } + sig do + returns( + T.nilable( + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetChannelTypeSetting + ) + ) + ) + end attr_reader :http sig do params( - http: T.any( - T::Boolean, - Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting, - Knockapi::Internal::AnyHash - ) - ) - .void + http: + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetChannelTypeSetting::OrHash + ) + ).void end attr_writer :http # Whether the channel type is enabled for the preference set. - sig { returns(T.nilable(T.any(T::Boolean, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting))) } + sig do + returns( + T.nilable( + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetChannelTypeSetting + ) + ) + ) + end attr_reader :in_app_feed sig do params( - in_app_feed: T.any( - T::Boolean, - Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting, - Knockapi::Internal::AnyHash - ) - ) - .void + in_app_feed: + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetChannelTypeSetting::OrHash + ) + ).void end attr_writer :in_app_feed # Whether the channel type is enabled for the preference set. - sig { returns(T.nilable(T.any(T::Boolean, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting))) } + sig do + returns( + T.nilable( + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetChannelTypeSetting + ) + ) + ) + end attr_reader :push sig do params( - push: T.any( - T::Boolean, - Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting, - Knockapi::Internal::AnyHash - ) - ) - .void + push: + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetChannelTypeSetting::OrHash + ) + ).void end attr_writer :push # Whether the channel type is enabled for the preference set. - sig { returns(T.nilable(T.any(T::Boolean, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting))) } + sig do + returns( + T.nilable( + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetChannelTypeSetting + ) + ) + ) + end attr_reader :sms sig do params( - sms: T.any( - T::Boolean, - Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting, - Knockapi::Internal::AnyHash - ) - ) - .void + sms: + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetChannelTypeSetting::OrHash + ) + ).void end attr_writer :sms # Channel type preferences. sig do params( - chat: T.any( - T::Boolean, - Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting, - Knockapi::Internal::AnyHash - ), - email: T.any( - T::Boolean, - Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting, - Knockapi::Internal::AnyHash - ), - http: T.any( - T::Boolean, - Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting, - Knockapi::Internal::AnyHash - ), - in_app_feed: T.any( - T::Boolean, - Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting, - Knockapi::Internal::AnyHash - ), - push: T.any( - T::Boolean, - Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting, - Knockapi::Internal::AnyHash - ), - sms: T.any( - T::Boolean, - Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting, - Knockapi::Internal::AnyHash - ) - ) - .returns(T.attached_class) + chat: + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetChannelTypeSetting::OrHash + ), + email: + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetChannelTypeSetting::OrHash + ), + http: + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetChannelTypeSetting::OrHash + ), + in_app_feed: + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetChannelTypeSetting::OrHash + ), + push: + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetChannelTypeSetting::OrHash + ), + sms: + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetChannelTypeSetting::OrHash + ) + ).returns(T.attached_class) end def self.new( # Whether the channel type is enabled for the preference set. @@ -149,68 +204,184 @@ module Knockapi push: nil, # Whether the channel type is enabled for the preference set. sms: nil - ); end + ) + end + sig do - override - .returns( - { - chat: T.any(T::Boolean, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting), - email: T.any(T::Boolean, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting), - http: T.any(T::Boolean, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting), - in_app_feed: T.any(T::Boolean, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting), - push: T.any(T::Boolean, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting), - sms: T.any(T::Boolean, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting) - } - ) + override.returns( + { + chat: + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetChannelTypeSetting + ), + email: + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetChannelTypeSetting + ), + http: + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetChannelTypeSetting + ), + in_app_feed: + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetChannelTypeSetting + ), + push: + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetChannelTypeSetting + ), + sms: + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetChannelTypeSetting + ) + } + ) + end + def to_hash end - def to_hash; end # Whether the channel type is enabled for the preference set. module Chat extend Knockapi::Internal::Type::Union - sig { override.returns([T::Boolean, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting]) } - def self.variants; end + Variants = + T.type_alias do + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetChannelTypeSetting + ) + end + + sig do + override.returns( + T::Array[ + Knockapi::Recipients::PreferenceSetChannelTypes::Chat::Variants + ] + ) + end + def self.variants + end end # Whether the channel type is enabled for the preference set. module Email extend Knockapi::Internal::Type::Union - sig { override.returns([T::Boolean, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting]) } - def self.variants; end + Variants = + T.type_alias do + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetChannelTypeSetting + ) + end + + sig do + override.returns( + T::Array[ + Knockapi::Recipients::PreferenceSetChannelTypes::Email::Variants + ] + ) + end + def self.variants + end end # Whether the channel type is enabled for the preference set. module HTTP extend Knockapi::Internal::Type::Union - sig { override.returns([T::Boolean, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting]) } - def self.variants; end + Variants = + T.type_alias do + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetChannelTypeSetting + ) + end + + sig do + override.returns( + T::Array[ + Knockapi::Recipients::PreferenceSetChannelTypes::HTTP::Variants + ] + ) + end + def self.variants + end end # Whether the channel type is enabled for the preference set. module InAppFeed extend Knockapi::Internal::Type::Union - sig { override.returns([T::Boolean, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting]) } - def self.variants; end + Variants = + T.type_alias do + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetChannelTypeSetting + ) + end + + sig do + override.returns( + T::Array[ + Knockapi::Recipients::PreferenceSetChannelTypes::InAppFeed::Variants + ] + ) + end + def self.variants + end end # Whether the channel type is enabled for the preference set. module Push extend Knockapi::Internal::Type::Union - sig { override.returns([T::Boolean, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting]) } - def self.variants; end + Variants = + T.type_alias do + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetChannelTypeSetting + ) + end + + sig do + override.returns( + T::Array[ + Knockapi::Recipients::PreferenceSetChannelTypes::Push::Variants + ] + ) + end + def self.variants + end end # Whether the channel type is enabled for the preference set. module SMS extend Knockapi::Internal::Type::Union - sig { override.returns([T::Boolean, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting]) } - def self.variants; end + Variants = + T.type_alias do + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetChannelTypeSetting + ) + end + + sig do + override.returns( + T::Array[ + Knockapi::Recipients::PreferenceSetChannelTypes::SMS::Variants + ] + ) + end + def self.variants + end end end end diff --git a/rbi/knockapi/models/recipients/preference_set_request.rbi b/rbi/knockapi/models/recipients/preference_set_request.rbi index f56772ea..35828132 100644 --- a/rbi/knockapi/models/recipients/preference_set_request.rbi +++ b/rbi/knockapi/models/recipients/preference_set_request.rbi @@ -4,6 +4,14 @@ module Knockapi module Models module Recipients class PreferenceSetRequest < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Recipients::PreferenceSetRequest, + Knockapi::Internal::AnyHash + ) + end + # An object where the key is the category and the values are the preference # settings for that category. sig do @@ -13,7 +21,7 @@ module Knockapi Symbol, T.any( T::Boolean, - Knockapi::Models::Recipients::PreferenceSetRequest::Category::PreferenceSetWorkflowCategorySettingObject + Knockapi::Recipients::PreferenceSetRequest::Category::PreferenceSetWorkflowCategorySettingObject ) ] ) @@ -22,14 +30,16 @@ module Knockapi attr_accessor :categories # Channel type preferences. - sig { returns(T.nilable(Knockapi::Models::Recipients::PreferenceSetChannelTypes)) } + sig do + returns(T.nilable(Knockapi::Recipients::PreferenceSetChannelTypes)) + end attr_reader :channel_types sig do params( - channel_types: T.nilable(T.any(Knockapi::Models::Recipients::PreferenceSetChannelTypes, Knockapi::Internal::AnyHash)) - ) - .void + channel_types: + T.nilable(Knockapi::Recipients::PreferenceSetChannelTypes::OrHash) + ).void end attr_writer :channel_types @@ -42,7 +52,7 @@ module Knockapi Symbol, T.any( T::Boolean, - Knockapi::Models::Recipients::PreferenceSetRequest::Workflow::PreferenceSetWorkflowCategorySettingObject + Knockapi::Recipients::PreferenceSetRequest::Workflow::PreferenceSetWorkflowCategorySettingObject ) ] ) @@ -53,29 +63,31 @@ module Knockapi # A request to set a preference set for a recipient. sig do params( - categories: T.nilable( - T::Hash[ - Symbol, - T.any( - T::Boolean, - Knockapi::Models::Recipients::PreferenceSetRequest::Category::PreferenceSetWorkflowCategorySettingObject, - Knockapi::Internal::AnyHash - ) - ] - ), - channel_types: T.nilable(T.any(Knockapi::Models::Recipients::PreferenceSetChannelTypes, Knockapi::Internal::AnyHash)), - workflows: T.nilable( - T::Hash[ - Symbol, - T.any( - T::Boolean, - Knockapi::Models::Recipients::PreferenceSetRequest::Workflow::PreferenceSetWorkflowCategorySettingObject, - Knockapi::Internal::AnyHash - ) - ] - ) - ) - .returns(T.attached_class) + categories: + T.nilable( + T::Hash[ + Symbol, + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetRequest::Category::PreferenceSetWorkflowCategorySettingObject::OrHash + ) + ] + ), + channel_types: + T.nilable( + Knockapi::Recipients::PreferenceSetChannelTypes::OrHash + ), + workflows: + T.nilable( + T::Hash[ + Symbol, + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetRequest::Workflow::PreferenceSetWorkflowCategorySettingObject::OrHash + ) + ] + ) + ).returns(T.attached_class) end def self.new( # An object where the key is the category and the values are the preference @@ -86,147 +98,210 @@ module Knockapi # An object where the key is the workflow key and the values are the preference # settings for that workflow. workflows: nil - ); end + ) + end + sig do - override - .returns( - { - categories: T.nilable( + override.returns( + { + categories: + T.nilable( T::Hash[ Symbol, T.any( T::Boolean, - Knockapi::Models::Recipients::PreferenceSetRequest::Category::PreferenceSetWorkflowCategorySettingObject + Knockapi::Recipients::PreferenceSetRequest::Category::PreferenceSetWorkflowCategorySettingObject ) ] ), - channel_types: T.nilable(Knockapi::Models::Recipients::PreferenceSetChannelTypes), - workflows: T.nilable( + channel_types: + T.nilable(Knockapi::Recipients::PreferenceSetChannelTypes), + workflows: + T.nilable( T::Hash[ Symbol, T.any( T::Boolean, - Knockapi::Models::Recipients::PreferenceSetRequest::Workflow::PreferenceSetWorkflowCategorySettingObject + Knockapi::Recipients::PreferenceSetRequest::Workflow::PreferenceSetWorkflowCategorySettingObject ) ] ) - } - ) + } + ) + end + def to_hash end - def to_hash; end # Workflow or category preferences within a preference set module Category extend Knockapi::Internal::Type::Union + Variants = + T.type_alias do + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetRequest::Category::PreferenceSetWorkflowCategorySettingObject + ) + end + class PreferenceSetWorkflowCategorySettingObject < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Recipients::PreferenceSetRequest::Category::PreferenceSetWorkflowCategorySettingObject, + Knockapi::Internal::AnyHash + ) + end + # Channel type preferences. - sig { returns(T.nilable(Knockapi::Models::Recipients::PreferenceSetChannelTypes)) } + sig do + returns( + T.nilable(Knockapi::Recipients::PreferenceSetChannelTypes) + ) + end attr_reader :channel_types sig do params( - channel_types: T.nilable(T.any(Knockapi::Models::Recipients::PreferenceSetChannelTypes, Knockapi::Internal::AnyHash)) - ) - .void + channel_types: + T.nilable( + Knockapi::Recipients::PreferenceSetChannelTypes::OrHash + ) + ).void end attr_writer :channel_types # A list of conditions to apply to a channel type. - sig { returns(T.nilable(T::Array[Knockapi::Models::Condition])) } + sig { returns(T.nilable(T::Array[Knockapi::Condition])) } attr_accessor :conditions # The settings object for a workflow or category, where you can specify channel # types or conditions. sig do params( - channel_types: T.nilable(T.any(Knockapi::Models::Recipients::PreferenceSetChannelTypes, Knockapi::Internal::AnyHash)), - conditions: T.nilable(T::Array[T.any(Knockapi::Models::Condition, Knockapi::Internal::AnyHash)]) - ) - .returns(T.attached_class) + channel_types: + T.nilable( + Knockapi::Recipients::PreferenceSetChannelTypes::OrHash + ), + conditions: T.nilable(T::Array[Knockapi::Condition::OrHash]) + ).returns(T.attached_class) end def self.new( # Channel type preferences. channel_types: nil, # A list of conditions to apply to a channel type. conditions: nil - ); end + ) + end + sig do - override - .returns( - { - channel_types: T.nilable(Knockapi::Models::Recipients::PreferenceSetChannelTypes), - conditions: T.nilable(T::Array[Knockapi::Models::Condition]) - } - ) + override.returns( + { + channel_types: + T.nilable(Knockapi::Recipients::PreferenceSetChannelTypes), + conditions: T.nilable(T::Array[Knockapi::Condition]) + } + ) + end + def to_hash end - def to_hash; end end sig do - override - .returns( - [T::Boolean, Knockapi::Models::Recipients::PreferenceSetRequest::Category::PreferenceSetWorkflowCategorySettingObject] - ) + override.returns( + T::Array[ + Knockapi::Recipients::PreferenceSetRequest::Category::Variants + ] + ) + end + def self.variants end - def self.variants; end end # Workflow or category preferences within a preference set module Workflow extend Knockapi::Internal::Type::Union + Variants = + T.type_alias do + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetRequest::Workflow::PreferenceSetWorkflowCategorySettingObject + ) + end + class PreferenceSetWorkflowCategorySettingObject < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Recipients::PreferenceSetRequest::Workflow::PreferenceSetWorkflowCategorySettingObject, + Knockapi::Internal::AnyHash + ) + end + # Channel type preferences. - sig { returns(T.nilable(Knockapi::Models::Recipients::PreferenceSetChannelTypes)) } + sig do + returns( + T.nilable(Knockapi::Recipients::PreferenceSetChannelTypes) + ) + end attr_reader :channel_types sig do params( - channel_types: T.nilable(T.any(Knockapi::Models::Recipients::PreferenceSetChannelTypes, Knockapi::Internal::AnyHash)) - ) - .void + channel_types: + T.nilable( + Knockapi::Recipients::PreferenceSetChannelTypes::OrHash + ) + ).void end attr_writer :channel_types # A list of conditions to apply to a channel type. - sig { returns(T.nilable(T::Array[Knockapi::Models::Condition])) } + sig { returns(T.nilable(T::Array[Knockapi::Condition])) } attr_accessor :conditions # The settings object for a workflow or category, where you can specify channel # types or conditions. sig do params( - channel_types: T.nilable(T.any(Knockapi::Models::Recipients::PreferenceSetChannelTypes, Knockapi::Internal::AnyHash)), - conditions: T.nilable(T::Array[T.any(Knockapi::Models::Condition, Knockapi::Internal::AnyHash)]) - ) - .returns(T.attached_class) + channel_types: + T.nilable( + Knockapi::Recipients::PreferenceSetChannelTypes::OrHash + ), + conditions: T.nilable(T::Array[Knockapi::Condition::OrHash]) + ).returns(T.attached_class) end def self.new( # Channel type preferences. channel_types: nil, # A list of conditions to apply to a channel type. conditions: nil - ); end + ) + end + sig do - override - .returns( - { - channel_types: T.nilable(Knockapi::Models::Recipients::PreferenceSetChannelTypes), - conditions: T.nilable(T::Array[Knockapi::Models::Condition]) - } - ) + override.returns( + { + channel_types: + T.nilable(Knockapi::Recipients::PreferenceSetChannelTypes), + conditions: T.nilable(T::Array[Knockapi::Condition]) + } + ) + end + def to_hash end - def to_hash; end end sig do - override - .returns( - [T::Boolean, Knockapi::Models::Recipients::PreferenceSetRequest::Workflow::PreferenceSetWorkflowCategorySettingObject] - ) + override.returns( + T::Array[ + Knockapi::Recipients::PreferenceSetRequest::Workflow::Variants + ] + ) + end + def self.variants end - def self.variants; end end end end diff --git a/rbi/knockapi/models/recipients/push_channel_data.rbi b/rbi/knockapi/models/recipients/push_channel_data.rbi index de2a58a5..7bbe2112 100644 --- a/rbi/knockapi/models/recipients/push_channel_data.rbi +++ b/rbi/knockapi/models/recipients/push_channel_data.rbi @@ -4,6 +4,14 @@ module Knockapi module Models module Recipients class PushChannelData < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Recipients::PushChannelData, + Knockapi::Internal::AnyHash + ) + end + # A list of push channel tokens. sig { returns(T::Array[String]) } attr_accessor :tokens @@ -13,9 +21,12 @@ module Knockapi def self.new( # A list of push channel tokens. tokens: - ); end - sig { override.returns({tokens: T::Array[String]}) } - def to_hash; end + ) + end + + sig { override.returns({ tokens: T::Array[String] }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/recipients/slack_channel_data.rbi b/rbi/knockapi/models/recipients/slack_channel_data.rbi index b5151ba3..fb3e1df5 100644 --- a/rbi/knockapi/models/recipients/slack_channel_data.rbi +++ b/rbi/knockapi/models/recipients/slack_channel_data.rbi @@ -4,13 +4,21 @@ module Knockapi module Models module Recipients class SlackChannelData < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Recipients::SlackChannelData, + Knockapi::Internal::AnyHash + ) + end + # List of Slack channel connections. sig do returns( T::Array[ T.any( - Knockapi::Models::Recipients::SlackChannelData::Connection::SlackTokenConnection, - Knockapi::Models::Recipients::SlackChannelData::Connection::SlackIncomingWebhookConnection + Knockapi::Recipients::SlackChannelData::Connection::SlackTokenConnection, + Knockapi::Recipients::SlackChannelData::Connection::SlackIncomingWebhookConnection ) ] ) @@ -18,58 +26,79 @@ module Knockapi attr_accessor :connections # A Slack connection token. - sig { returns(T.nilable(Knockapi::Models::Recipients::SlackChannelData::Token)) } + sig do + returns(T.nilable(Knockapi::Recipients::SlackChannelData::Token)) + end attr_reader :token sig do params( - token: T.nilable(T.any(Knockapi::Models::Recipients::SlackChannelData::Token, Knockapi::Internal::AnyHash)) - ) - .void + token: + T.nilable(Knockapi::Recipients::SlackChannelData::Token::OrHash) + ).void end attr_writer :token # Slack channel data sig do params( - connections: T::Array[ - T.any( - Knockapi::Models::Recipients::SlackChannelData::Connection::SlackTokenConnection, - Knockapi::Internal::AnyHash, - Knockapi::Models::Recipients::SlackChannelData::Connection::SlackIncomingWebhookConnection - ) - ], - token: T.nilable(T.any(Knockapi::Models::Recipients::SlackChannelData::Token, Knockapi::Internal::AnyHash)) - ) - .returns(T.attached_class) + connections: + T::Array[ + T.any( + Knockapi::Recipients::SlackChannelData::Connection::SlackTokenConnection::OrHash, + Knockapi::Recipients::SlackChannelData::Connection::SlackIncomingWebhookConnection::OrHash + ) + ], + token: + T.nilable(Knockapi::Recipients::SlackChannelData::Token::OrHash) + ).returns(T.attached_class) end def self.new( # List of Slack channel connections. connections:, # A Slack connection token. token: nil - ); end + ) + end + sig do - override - .returns( - { - connections: T::Array[ + override.returns( + { + connections: + T::Array[ T.any( - Knockapi::Models::Recipients::SlackChannelData::Connection::SlackTokenConnection, - Knockapi::Models::Recipients::SlackChannelData::Connection::SlackIncomingWebhookConnection + Knockapi::Recipients::SlackChannelData::Connection::SlackTokenConnection, + Knockapi::Recipients::SlackChannelData::Connection::SlackIncomingWebhookConnection ) ], - token: T.nilable(Knockapi::Models::Recipients::SlackChannelData::Token) - } - ) + token: T.nilable(Knockapi::Recipients::SlackChannelData::Token) + } + ) + end + def to_hash end - def to_hash; end # A Slack connection, either an access token or an incoming webhook module Connection extend Knockapi::Internal::Type::Union + Variants = + T.type_alias do + T.any( + Knockapi::Recipients::SlackChannelData::Connection::SlackTokenConnection, + Knockapi::Recipients::SlackChannelData::Connection::SlackIncomingWebhookConnection + ) + end + class SlackTokenConnection < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Recipients::SlackChannelData::Connection::SlackTokenConnection, + Knockapi::Internal::AnyHash + ) + end + # A Slack access token. sig { returns(T.nilable(String)) } attr_accessor :access_token @@ -88,8 +117,7 @@ module Knockapi access_token: T.nilable(String), channel_id: T.nilable(String), user_id: T.nilable(String) - ) - .returns(T.attached_class) + ).returns(T.attached_class) end def self.new( # A Slack access token. @@ -98,19 +126,31 @@ module Knockapi channel_id: nil, # A Slack user ID from the Slack provider. user_id: nil - ); end + ) + end + sig do - override - .returns({ - access_token: T.nilable(String), - channel_id: T.nilable(String), - user_id: T.nilable(String) - }) + override.returns( + { + access_token: T.nilable(String), + channel_id: T.nilable(String), + user_id: T.nilable(String) + } + ) + end + def to_hash end - def to_hash; end end class SlackIncomingWebhookConnection < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Recipients::SlackChannelData::Connection::SlackIncomingWebhookConnection, + Knockapi::Internal::AnyHash + ) + end + # The URL of the incoming webhook for a Slack connection. sig { returns(String) } attr_accessor :url @@ -120,33 +160,51 @@ module Knockapi def self.new( # The URL of the incoming webhook for a Slack connection. url: - ); end - sig { override.returns({url: String}) } - def to_hash; end + ) + end + + sig { override.returns({ url: String }) } + def to_hash + end end sig do - override - .returns( - [Knockapi::Models::Recipients::SlackChannelData::Connection::SlackTokenConnection, Knockapi::Models::Recipients::SlackChannelData::Connection::SlackIncomingWebhookConnection] - ) + override.returns( + T::Array[ + Knockapi::Recipients::SlackChannelData::Connection::Variants + ] + ) + end + def self.variants end - def self.variants; end end class Token < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Recipients::SlackChannelData::Token, + Knockapi::Internal::AnyHash + ) + end + # A Slack access token. sig { returns(T.nilable(String)) } attr_accessor :access_token # A Slack connection token. - sig { params(access_token: T.nilable(String)).returns(T.attached_class) } + sig do + params(access_token: T.nilable(String)).returns(T.attached_class) + end def self.new( # A Slack access token. access_token: - ); end - sig { override.returns({access_token: T.nilable(String)}) } - def to_hash; end + ) + end + + sig { override.returns({ access_token: T.nilable(String) }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/recipients/subscription.rbi b/rbi/knockapi/models/recipients/subscription.rbi index ec1b3e75..d01069a0 100644 --- a/rbi/knockapi/models/recipients/subscription.rbi +++ b/rbi/knockapi/models/recipients/subscription.rbi @@ -4,6 +4,14 @@ module Knockapi module Models module Recipients class Subscription < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Recipients::Subscription, + Knockapi::Internal::AnyHash + ) + end + # The typename of the schema. sig { returns(String) } attr_accessor :_typename @@ -13,14 +21,14 @@ module Knockapi attr_accessor :inserted_at # A custom [Object](/concepts/objects) entity which belongs to a collection. - sig { returns(Knockapi::Models::Object) } + sig { returns(Knockapi::Object) } attr_reader :object - sig { params(object: T.any(Knockapi::Models::Object, Knockapi::Internal::AnyHash)).void } + sig { params(object: Knockapi::Object::OrHash).void } attr_writer :object # A recipient of a notification, which is either a user or an object. - sig { returns(T.any(Knockapi::Models::User, Knockapi::Models::Object)) } + sig { returns(T.any(Knockapi::User, Knockapi::Object)) } attr_accessor :recipient # The timestamp when the resource was last updated. @@ -36,12 +44,11 @@ module Knockapi params( _typename: String, inserted_at: Time, - object: T.any(Knockapi::Models::Object, Knockapi::Internal::AnyHash), - recipient: T.any(Knockapi::Models::User, Knockapi::Internal::AnyHash, Knockapi::Models::Object), + object: Knockapi::Object::OrHash, + recipient: T.any(Knockapi::User::OrHash, Knockapi::Object::OrHash), updated_at: Time, properties: T.nilable(T::Hash[Symbol, T.anything]) - ) - .returns(T.attached_class) + ).returns(T.attached_class) end def self.new( # The typename of the schema. @@ -56,21 +63,23 @@ module Knockapi updated_at:, # The custom properties associated with the subscription relationship. properties: nil - ); end + ) + end + sig do - override - .returns( - { - _typename: String, - inserted_at: Time, - object: Knockapi::Models::Object, - recipient: T.any(Knockapi::Models::User, Knockapi::Models::Object), - updated_at: Time, - properties: T.nilable(T::Hash[Symbol, T.anything]) - } - ) + override.returns( + { + _typename: String, + inserted_at: Time, + object: Knockapi::Object, + recipient: T.any(Knockapi::User, Knockapi::Object), + updated_at: Time, + properties: T.nilable(T::Hash[Symbol, T.anything]) + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/schedule.rbi b/rbi/knockapi/models/schedule.rbi index b808de62..49436d5e 100644 --- a/rbi/knockapi/models/schedule.rbi +++ b/rbi/knockapi/models/schedule.rbi @@ -3,6 +3,9 @@ module Knockapi module Models class Schedule < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Knockapi::Schedule, Knockapi::Internal::AnyHash) } + # Unique identifier for the schedule. sig { returns(String) } attr_accessor :id @@ -12,11 +15,11 @@ module Knockapi attr_accessor :inserted_at # A recipient of a notification, which is either a user or an object. - sig { returns(T.any(Knockapi::Models::User, Knockapi::Models::Object)) } + sig { returns(T.any(Knockapi::User, Knockapi::Object)) } attr_accessor :recipient # The repeat rule for the schedule. - sig { returns(T::Array[Knockapi::Models::ScheduleRepeatRule]) } + sig { returns(T::Array[Knockapi::ScheduleRepeatRule]) } attr_accessor :repeats # The timestamp when the resource was last updated. @@ -35,7 +38,7 @@ module Knockapi attr_writer :_typename # A recipient of a notification, which is either a user or an object. - sig { returns(T.nilable(T.any(Knockapi::Models::User, Knockapi::Models::Object))) } + sig { returns(T.nilable(T.any(Knockapi::User, Knockapi::Object))) } attr_accessor :actor # An optional map of data to pass into the workflow execution. @@ -61,18 +64,18 @@ module Knockapi params( id: String, inserted_at: Time, - recipient: T.any(Knockapi::Models::User, Knockapi::Internal::AnyHash, Knockapi::Models::Object), - repeats: T::Array[T.any(Knockapi::Models::ScheduleRepeatRule, Knockapi::Internal::AnyHash)], + recipient: T.any(Knockapi::User::OrHash, Knockapi::Object::OrHash), + repeats: T::Array[Knockapi::ScheduleRepeatRule::OrHash], updated_at: Time, workflow: String, _typename: String, - actor: T.nilable(T.any(Knockapi::Models::User, Knockapi::Internal::AnyHash, Knockapi::Models::Object)), + actor: + T.nilable(T.any(Knockapi::User::OrHash, Knockapi::Object::OrHash)), data: T.nilable(T::Hash[Symbol, T.anything]), last_occurrence_at: T.nilable(Time), next_occurrence_at: T.nilable(Time), tenant: T.nilable(String) - ) - .returns(T.attached_class) + ).returns(T.attached_class) end def self.new( # Unique identifier for the schedule. @@ -101,27 +104,29 @@ module Knockapi # tenant-level overrides associated with the tenant object, and all messages # produced from workflow runs will be tagged with the tenant. tenant: nil - ); end + ) + end + sig do - override - .returns( - { - id: String, - inserted_at: Time, - recipient: T.any(Knockapi::Models::User, Knockapi::Models::Object), - repeats: T::Array[Knockapi::Models::ScheduleRepeatRule], - updated_at: Time, - workflow: String, - _typename: String, - actor: T.nilable(T.any(Knockapi::Models::User, Knockapi::Models::Object)), - data: T.nilable(T::Hash[Symbol, T.anything]), - last_occurrence_at: T.nilable(Time), - next_occurrence_at: T.nilable(Time), - tenant: T.nilable(String) - } - ) + override.returns( + { + id: String, + inserted_at: Time, + recipient: T.any(Knockapi::User, Knockapi::Object), + repeats: T::Array[Knockapi::ScheduleRepeatRule], + updated_at: Time, + workflow: String, + _typename: String, + actor: T.nilable(T.any(Knockapi::User, Knockapi::Object)), + data: T.nilable(T::Hash[Symbol, T.anything]), + last_occurrence_at: T.nilable(Time), + next_occurrence_at: T.nilable(Time), + tenant: T.nilable(String) + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/schedule_create_params.rbi b/rbi/knockapi/models/schedule_create_params.rbi index 6db726a2..24078191 100644 --- a/rbi/knockapi/models/schedule_create_params.rbi +++ b/rbi/knockapi/models/schedule_create_params.rbi @@ -6,17 +6,27 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters - # The recipients to trigger the workflow for. Can inline identify users, objects, - # or use a list of user IDs. Limited to 1,000 recipients. + OrHash = + T.type_alias do + T.any(Knockapi::ScheduleCreateParams, Knockapi::Internal::AnyHash) + end + + # The recipients to set the schedule for. Limited to 100 recipients per request. sig do returns( - T::Array[T.any(String, Knockapi::Models::InlineIdentifyUserRequest, Knockapi::Models::InlineObjectRequest)] + T::Array[ + T.any( + String, + Knockapi::InlineIdentifyUserRequest, + Knockapi::InlineObjectRequest + ) + ] ) end attr_accessor :recipients # The repeat rule for the schedule. - sig { returns(T::Array[Knockapi::Models::ScheduleRepeatRule]) } + sig { returns(T::Array[Knockapi::ScheduleRepeatRule]) } attr_accessor :repeats # The key of the workflow. @@ -36,32 +46,30 @@ module Knockapi attr_accessor :scheduled_at # An request to set a tenant inline. - sig { returns(T.nilable(T.any(String, Knockapi::Models::TenantRequest))) } + sig { returns(T.nilable(T.any(String, Knockapi::TenantRequest))) } attr_accessor :tenant sig do params( - recipients: T::Array[ - T.any( - String, - Knockapi::Models::InlineIdentifyUserRequest, - Knockapi::Internal::AnyHash, - Knockapi::Models::InlineObjectRequest - ) - ], - repeats: T::Array[T.any(Knockapi::Models::ScheduleRepeatRule, Knockapi::Internal::AnyHash)], + recipients: + T::Array[ + T.any( + String, + Knockapi::InlineIdentifyUserRequest::OrHash, + Knockapi::InlineObjectRequest::OrHash + ) + ], + repeats: T::Array[Knockapi::ScheduleRepeatRule::OrHash], workflow: String, data: T.nilable(T::Hash[Symbol, T.anything]), ending_at: T.nilable(Time), scheduled_at: T.nilable(Time), - tenant: T.nilable(T.any(String, Knockapi::Models::TenantRequest, Knockapi::Internal::AnyHash)), - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + tenant: T.nilable(T.any(String, Knockapi::TenantRequest::OrHash)), + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( - # The recipients to trigger the workflow for. Can inline identify users, objects, - # or use a list of user IDs. Limited to 1,000 recipients. + # The recipients to set the schedule for. Limited to 100 recipients per request. recipients:, # The repeat rule for the schedule. repeats:, @@ -76,23 +84,32 @@ module Knockapi # An request to set a tenant inline. tenant: nil, request_options: {} - ); end + ) + end + sig do - override - .returns( - { - recipients: T::Array[T.any(String, Knockapi::Models::InlineIdentifyUserRequest, Knockapi::Models::InlineObjectRequest)], - repeats: T::Array[Knockapi::Models::ScheduleRepeatRule], - workflow: String, - data: T.nilable(T::Hash[Symbol, T.anything]), - ending_at: T.nilable(Time), - scheduled_at: T.nilable(Time), - tenant: T.nilable(T.any(String, Knockapi::Models::TenantRequest)), - request_options: Knockapi::RequestOptions - } - ) + override.returns( + { + recipients: + T::Array[ + T.any( + String, + Knockapi::InlineIdentifyUserRequest, + Knockapi::InlineObjectRequest + ) + ], + repeats: T::Array[Knockapi::ScheduleRepeatRule], + workflow: String, + data: T.nilable(T::Hash[Symbol, T.anything]), + ending_at: T.nilable(Time), + scheduled_at: T.nilable(Time), + tenant: T.nilable(T.any(String, Knockapi::TenantRequest)), + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/schedule_create_response.rbi b/rbi/knockapi/models/schedule_create_response.rbi index a98132ee..96271b40 100644 --- a/rbi/knockapi/models/schedule_create_response.rbi +++ b/rbi/knockapi/models/schedule_create_response.rbi @@ -3,6 +3,9 @@ module Knockapi module Models ScheduleCreateResponse = - T.let(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Schedule], Knockapi::Internal::Type::Converter) + T.let( + Knockapi::Internal::Type::ArrayOf[Knockapi::Schedule], + Knockapi::Internal::Type::Converter + ) end end diff --git a/rbi/knockapi/models/schedule_delete_params.rbi b/rbi/knockapi/models/schedule_delete_params.rbi index 16955333..f220d036 100644 --- a/rbi/knockapi/models/schedule_delete_params.rbi +++ b/rbi/knockapi/models/schedule_delete_params.rbi @@ -6,6 +6,11 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any(Knockapi::ScheduleDeleteParams, Knockapi::Internal::AnyHash) + end + # A list of schedule IDs. sig { returns(T::Array[String]) } attr_accessor :schedule_ids @@ -13,17 +18,26 @@ module Knockapi sig do params( schedule_ids: T::Array[String], - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # A list of schedule IDs. schedule_ids:, request_options: {} - ); end - sig { override.returns({schedule_ids: T::Array[String], request_options: Knockapi::RequestOptions}) } - def to_hash; end + ) + end + + sig do + override.returns( + { + schedule_ids: T::Array[String], + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash + end end end end diff --git a/rbi/knockapi/models/schedule_delete_response.rbi b/rbi/knockapi/models/schedule_delete_response.rbi index 0289b927..e5afb330 100644 --- a/rbi/knockapi/models/schedule_delete_response.rbi +++ b/rbi/knockapi/models/schedule_delete_response.rbi @@ -3,6 +3,9 @@ module Knockapi module Models ScheduleDeleteResponse = - T.let(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Schedule], Knockapi::Internal::Type::Converter) + T.let( + Knockapi::Internal::Type::ArrayOf[Knockapi::Schedule], + Knockapi::Internal::Type::Converter + ) end end diff --git a/rbi/knockapi/models/schedule_list_params.rbi b/rbi/knockapi/models/schedule_list_params.rbi index 0e71b95f..96e275b7 100644 --- a/rbi/knockapi/models/schedule_list_params.rbi +++ b/rbi/knockapi/models/schedule_list_params.rbi @@ -6,6 +6,11 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any(Knockapi::ScheduleListParams, Knockapi::Internal::AnyHash) + end + # Filter by workflow key. sig { returns(String) } attr_accessor :workflow @@ -53,9 +58,8 @@ module Knockapi page_size: Integer, recipients: T::Array[String], tenant: String, - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # Filter by workflow key. @@ -71,22 +75,24 @@ module Knockapi # Filter by tenant ID. tenant: nil, request_options: {} - ); end + ) + end + sig do - override - .returns( - { - workflow: String, - after: String, - before: String, - page_size: Integer, - recipients: T::Array[String], - tenant: String, - request_options: Knockapi::RequestOptions - } - ) + override.returns( + { + workflow: String, + after: String, + before: String, + page_size: Integer, + recipients: T::Array[String], + tenant: String, + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/schedule_repeat_rule.rbi b/rbi/knockapi/models/schedule_repeat_rule.rbi index 49d19b0d..d380cdc1 100644 --- a/rbi/knockapi/models/schedule_repeat_rule.rbi +++ b/rbi/knockapi/models/schedule_repeat_rule.rbi @@ -3,12 +3,17 @@ module Knockapi module Models class ScheduleRepeatRule < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Knockapi::ScheduleRepeatRule, Knockapi::Internal::AnyHash) + end + # The typename of the schema. sig { returns(String) } attr_accessor :_typename # The frequency of the schedule. - sig { returns(Knockapi::Models::ScheduleRepeatRule::Frequency::OrSymbol) } + sig { returns(Knockapi::ScheduleRepeatRule::Frequency::OrSymbol) } attr_accessor :frequency # The day of the month to repeat the schedule. @@ -16,7 +21,11 @@ module Knockapi attr_accessor :day_of_month # The days of the week to repeat the schedule. - sig { returns(T.nilable(T::Array[Knockapi::Models::ScheduleRepeatRule::Day::OrSymbol])) } + sig do + returns( + T.nilable(T::Array[Knockapi::ScheduleRepeatRule::Day::OrSymbol]) + ) + end attr_accessor :days # The hour of the day to repeat the schedule. @@ -38,14 +47,14 @@ module Knockapi sig do params( _typename: String, - frequency: Knockapi::Models::ScheduleRepeatRule::Frequency::OrSymbol, + frequency: Knockapi::ScheduleRepeatRule::Frequency::OrSymbol, day_of_month: T.nilable(Integer), - days: T.nilable(T::Array[Knockapi::Models::ScheduleRepeatRule::Day::OrSymbol]), + days: + T.nilable(T::Array[Knockapi::ScheduleRepeatRule::Day::OrSymbol]), hours: T.nilable(Integer), interval: Integer, minutes: T.nilable(Integer) - ) - .returns(T.attached_class) + ).returns(T.attached_class) end def self.new( # The typename of the schema. @@ -62,56 +71,77 @@ module Knockapi interval: nil, # The minute of the hour to repeat the schedule. minutes: nil - ); end + ) + end + sig do - override - .returns( - { - _typename: String, - frequency: Knockapi::Models::ScheduleRepeatRule::Frequency::OrSymbol, - day_of_month: T.nilable(Integer), - days: T.nilable(T::Array[Knockapi::Models::ScheduleRepeatRule::Day::OrSymbol]), - hours: T.nilable(Integer), - interval: Integer, - minutes: T.nilable(Integer) - } - ) + override.returns( + { + _typename: String, + frequency: Knockapi::ScheduleRepeatRule::Frequency::OrSymbol, + day_of_month: T.nilable(Integer), + days: + T.nilable(T::Array[Knockapi::ScheduleRepeatRule::Day::OrSymbol]), + hours: T.nilable(Integer), + interval: Integer, + minutes: T.nilable(Integer) + } + ) + end + def to_hash end - def to_hash; end # The frequency of the schedule. module Frequency extend Knockapi::Internal::Type::Enum - TaggedSymbol = T.type_alias { T.all(Symbol, Knockapi::Models::ScheduleRepeatRule::Frequency) } + TaggedSymbol = + T.type_alias do + T.all(Symbol, Knockapi::ScheduleRepeatRule::Frequency) + end OrSymbol = T.type_alias { T.any(Symbol, String) } - DAILY = T.let(:daily, Knockapi::Models::ScheduleRepeatRule::Frequency::TaggedSymbol) - WEEKLY = T.let(:weekly, Knockapi::Models::ScheduleRepeatRule::Frequency::TaggedSymbol) - MONTHLY = T.let(:monthly, Knockapi::Models::ScheduleRepeatRule::Frequency::TaggedSymbol) - HOURLY = T.let(:hourly, Knockapi::Models::ScheduleRepeatRule::Frequency::TaggedSymbol) - - sig { override.returns(T::Array[Knockapi::Models::ScheduleRepeatRule::Frequency::TaggedSymbol]) } - def self.values; end + DAILY = + T.let(:daily, Knockapi::ScheduleRepeatRule::Frequency::TaggedSymbol) + WEEKLY = + T.let(:weekly, Knockapi::ScheduleRepeatRule::Frequency::TaggedSymbol) + MONTHLY = + T.let(:monthly, Knockapi::ScheduleRepeatRule::Frequency::TaggedSymbol) + HOURLY = + T.let(:hourly, Knockapi::ScheduleRepeatRule::Frequency::TaggedSymbol) + + sig do + override.returns( + T::Array[Knockapi::ScheduleRepeatRule::Frequency::TaggedSymbol] + ) + end + def self.values + end end # An identifier for a day of the week. module Day extend Knockapi::Internal::Type::Enum - TaggedSymbol = T.type_alias { T.all(Symbol, Knockapi::Models::ScheduleRepeatRule::Day) } + TaggedSymbol = + T.type_alias { T.all(Symbol, Knockapi::ScheduleRepeatRule::Day) } OrSymbol = T.type_alias { T.any(Symbol, String) } - MON = T.let(:mon, Knockapi::Models::ScheduleRepeatRule::Day::TaggedSymbol) - TUE = T.let(:tue, Knockapi::Models::ScheduleRepeatRule::Day::TaggedSymbol) - WED = T.let(:wed, Knockapi::Models::ScheduleRepeatRule::Day::TaggedSymbol) - THU = T.let(:thu, Knockapi::Models::ScheduleRepeatRule::Day::TaggedSymbol) - FRI = T.let(:fri, Knockapi::Models::ScheduleRepeatRule::Day::TaggedSymbol) - SAT = T.let(:sat, Knockapi::Models::ScheduleRepeatRule::Day::TaggedSymbol) - SUN = T.let(:sun, Knockapi::Models::ScheduleRepeatRule::Day::TaggedSymbol) - - sig { override.returns(T::Array[Knockapi::Models::ScheduleRepeatRule::Day::TaggedSymbol]) } - def self.values; end + MON = T.let(:mon, Knockapi::ScheduleRepeatRule::Day::TaggedSymbol) + TUE = T.let(:tue, Knockapi::ScheduleRepeatRule::Day::TaggedSymbol) + WED = T.let(:wed, Knockapi::ScheduleRepeatRule::Day::TaggedSymbol) + THU = T.let(:thu, Knockapi::ScheduleRepeatRule::Day::TaggedSymbol) + FRI = T.let(:fri, Knockapi::ScheduleRepeatRule::Day::TaggedSymbol) + SAT = T.let(:sat, Knockapi::ScheduleRepeatRule::Day::TaggedSymbol) + SUN = T.let(:sun, Knockapi::ScheduleRepeatRule::Day::TaggedSymbol) + + sig do + override.returns( + T::Array[Knockapi::ScheduleRepeatRule::Day::TaggedSymbol] + ) + end + def self.values + end end end end diff --git a/rbi/knockapi/models/schedule_update_params.rbi b/rbi/knockapi/models/schedule_update_params.rbi index 901fb3be..5c47c4f4 100644 --- a/rbi/knockapi/models/schedule_update_params.rbi +++ b/rbi/knockapi/models/schedule_update_params.rbi @@ -6,13 +6,24 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any(Knockapi::ScheduleUpdateParams, Knockapi::Internal::AnyHash) + end + # A list of schedule IDs. sig { returns(T::Array[String]) } attr_accessor :schedule_ids # A reference to a recipient, either a user identifier (string) or an object # reference (ID, collection). - sig { returns(T.nilable(T.any(String, Knockapi::Models::RecipientReference::ObjectReference))) } + sig do + returns( + T.nilable( + T.any(String, Knockapi::RecipientReference::ObjectReference) + ) + ) + end attr_accessor :actor # An optional map of data to pass into the workflow execution. @@ -24,10 +35,12 @@ module Knockapi attr_accessor :ending_at # The repeat rule for the schedule. - sig { returns(T.nilable(T::Array[Knockapi::Models::ScheduleRepeatRule])) } + sig { returns(T.nilable(T::Array[Knockapi::ScheduleRepeatRule])) } attr_reader :repeats - sig { params(repeats: T::Array[T.any(Knockapi::Models::ScheduleRepeatRule, Knockapi::Internal::AnyHash)]).void } + sig do + params(repeats: T::Array[Knockapi::ScheduleRepeatRule::OrHash]).void + end attr_writer :repeats # The starting date and time for the schedule. @@ -35,23 +48,26 @@ module Knockapi attr_accessor :scheduled_at # An request to set a tenant inline. - sig { returns(T.nilable(T.any(String, Knockapi::Models::TenantRequest))) } + sig { returns(T.nilable(T.any(String, Knockapi::TenantRequest))) } attr_accessor :tenant sig do params( schedule_ids: T::Array[String], - actor: T.nilable( - T.any(String, Knockapi::Models::RecipientReference::ObjectReference, Knockapi::Internal::AnyHash) - ), + actor: + T.nilable( + T.any( + String, + Knockapi::RecipientReference::ObjectReference::OrHash + ) + ), data: T.nilable(T::Hash[Symbol, T.anything]), ending_at: T.nilable(Time), - repeats: T::Array[T.any(Knockapi::Models::ScheduleRepeatRule, Knockapi::Internal::AnyHash)], + repeats: T::Array[Knockapi::ScheduleRepeatRule::OrHash], scheduled_at: T.nilable(Time), - tenant: T.nilable(T.any(String, Knockapi::Models::TenantRequest, Knockapi::Internal::AnyHash)), - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + tenant: T.nilable(T.any(String, Knockapi::TenantRequest::OrHash)), + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # A list of schedule IDs. @@ -70,23 +86,28 @@ module Knockapi # An request to set a tenant inline. tenant: nil, request_options: {} - ); end + ) + end + sig do - override - .returns( - { - schedule_ids: T::Array[String], - actor: T.nilable(T.any(String, Knockapi::Models::RecipientReference::ObjectReference)), - data: T.nilable(T::Hash[Symbol, T.anything]), - ending_at: T.nilable(Time), - repeats: T::Array[Knockapi::Models::ScheduleRepeatRule], - scheduled_at: T.nilable(Time), - tenant: T.nilable(T.any(String, Knockapi::Models::TenantRequest)), - request_options: Knockapi::RequestOptions - } - ) + override.returns( + { + schedule_ids: T::Array[String], + actor: + T.nilable( + T.any(String, Knockapi::RecipientReference::ObjectReference) + ), + data: T.nilable(T::Hash[Symbol, T.anything]), + ending_at: T.nilable(Time), + repeats: T::Array[Knockapi::ScheduleRepeatRule], + scheduled_at: T.nilable(Time), + tenant: T.nilable(T.any(String, Knockapi::TenantRequest)), + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/schedule_update_response.rbi b/rbi/knockapi/models/schedule_update_response.rbi index 76fd8856..9d8b544a 100644 --- a/rbi/knockapi/models/schedule_update_response.rbi +++ b/rbi/knockapi/models/schedule_update_response.rbi @@ -3,6 +3,9 @@ module Knockapi module Models ScheduleUpdateResponse = - T.let(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Schedule], Knockapi::Internal::Type::Converter) + T.let( + Knockapi::Internal::Type::ArrayOf[Knockapi::Schedule], + Knockapi::Internal::Type::Converter + ) end end diff --git a/rbi/knockapi/models/schedules/bulk_create_params.rbi b/rbi/knockapi/models/schedules/bulk_create_params.rbi index 1d8891bf..1f233087 100644 --- a/rbi/knockapi/models/schedules/bulk_create_params.rbi +++ b/rbi/knockapi/models/schedules/bulk_create_params.rbi @@ -7,34 +7,55 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::Schedules::BulkCreateParams, + Knockapi::Internal::AnyHash + ) + end + # A list of schedules. - sig { returns(T::Array[Knockapi::Models::Schedules::BulkCreateParams::Schedule]) } + sig do + returns(T::Array[Knockapi::Schedules::BulkCreateParams::Schedule]) + end attr_accessor :schedules sig do params( - schedules: T::Array[T.any(Knockapi::Models::Schedules::BulkCreateParams::Schedule, Knockapi::Internal::AnyHash)], - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + schedules: + T::Array[Knockapi::Schedules::BulkCreateParams::Schedule::OrHash], + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # A list of schedules. schedules:, request_options: {} - ); end + ) + end + sig do - override - .returns( - { - schedules: T::Array[Knockapi::Models::Schedules::BulkCreateParams::Schedule], - request_options: Knockapi::RequestOptions - } - ) + override.returns( + { + schedules: + T::Array[Knockapi::Schedules::BulkCreateParams::Schedule], + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end class Schedule < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Schedules::BulkCreateParams::Schedule, + Knockapi::Internal::AnyHash + ) + end + # The key of the workflow. sig { returns(String) } attr_accessor :workflow @@ -45,7 +66,11 @@ module Knockapi sig do returns( T.nilable( - T.any(String, Knockapi::Models::InlineIdentifyUserRequest, Knockapi::Models::InlineObjectRequest) + T.any( + String, + Knockapi::InlineIdentifyUserRequest, + Knockapi::InlineObjectRequest + ) ) ) end @@ -65,7 +90,11 @@ module Knockapi sig do returns( T.nilable( - T.any(String, Knockapi::Models::InlineIdentifyUserRequest, Knockapi::Models::InlineObjectRequest) + T.any( + String, + Knockapi::InlineIdentifyUserRequest, + Knockapi::InlineObjectRequest + ) ) ) end @@ -73,22 +102,23 @@ module Knockapi sig do params( - recipient: T.any( - String, - Knockapi::Models::InlineIdentifyUserRequest, - Knockapi::Internal::AnyHash, - Knockapi::Models::InlineObjectRequest - ) - ) - .void + recipient: + T.any( + String, + Knockapi::InlineIdentifyUserRequest::OrHash, + Knockapi::InlineObjectRequest::OrHash + ) + ).void end attr_writer :recipient # The repeat rule for the schedule. - sig { returns(T.nilable(T::Array[Knockapi::Models::ScheduleRepeatRule])) } + sig { returns(T.nilable(T::Array[Knockapi::ScheduleRepeatRule])) } attr_reader :repeats - sig { params(repeats: T::Array[T.any(Knockapi::Models::ScheduleRepeatRule, Knockapi::Internal::AnyHash)]).void } + sig do + params(repeats: T::Array[Knockapi::ScheduleRepeatRule::OrHash]).void + end attr_writer :repeats # The starting date and time for the schedule. @@ -96,34 +126,33 @@ module Knockapi attr_accessor :scheduled_at # An request to set a tenant inline. - sig { returns(T.nilable(T.any(String, Knockapi::Models::TenantRequest))) } + sig { returns(T.nilable(T.any(String, Knockapi::TenantRequest))) } attr_accessor :tenant # A schedule represents a recurring workflow execution. sig do params( workflow: String, - actor: T.nilable( - T.any( - String, - Knockapi::Models::InlineIdentifyUserRequest, - Knockapi::Internal::AnyHash, - Knockapi::Models::InlineObjectRequest - ) - ), + actor: + T.nilable( + T.any( + String, + Knockapi::InlineIdentifyUserRequest::OrHash, + Knockapi::InlineObjectRequest::OrHash + ) + ), data: T.nilable(T::Hash[Symbol, T.anything]), ending_at: T.nilable(Time), - recipient: T.any( - String, - Knockapi::Models::InlineIdentifyUserRequest, - Knockapi::Internal::AnyHash, - Knockapi::Models::InlineObjectRequest - ), - repeats: T::Array[T.any(Knockapi::Models::ScheduleRepeatRule, Knockapi::Internal::AnyHash)], + recipient: + T.any( + String, + Knockapi::InlineIdentifyUserRequest::OrHash, + Knockapi::InlineObjectRequest::OrHash + ), + repeats: T::Array[Knockapi::ScheduleRepeatRule::OrHash], scheduled_at: T.nilable(Time), - tenant: T.nilable(T.any(String, Knockapi::Models::TenantRequest, Knockapi::Internal::AnyHash)) - ) - .returns(T.attached_class) + tenant: T.nilable(T.any(String, Knockapi::TenantRequest::OrHash)) + ).returns(T.attached_class) end def self.new( # The key of the workflow. @@ -146,25 +175,37 @@ module Knockapi scheduled_at: nil, # An request to set a tenant inline. tenant: nil - ); end + ) + end + sig do - override - .returns( - { - workflow: String, - actor: T.nilable( - T.any(String, Knockapi::Models::InlineIdentifyUserRequest, Knockapi::Models::InlineObjectRequest) + override.returns( + { + workflow: String, + actor: + T.nilable( + T.any( + String, + Knockapi::InlineIdentifyUserRequest, + Knockapi::InlineObjectRequest + ) ), - data: T.nilable(T::Hash[Symbol, T.anything]), - ending_at: T.nilable(Time), - recipient: T.any(String, Knockapi::Models::InlineIdentifyUserRequest, Knockapi::Models::InlineObjectRequest), - repeats: T::Array[Knockapi::Models::ScheduleRepeatRule], - scheduled_at: T.nilable(Time), - tenant: T.nilable(T.any(String, Knockapi::Models::TenantRequest)) - } - ) + data: T.nilable(T::Hash[Symbol, T.anything]), + ending_at: T.nilable(Time), + recipient: + T.any( + String, + Knockapi::InlineIdentifyUserRequest, + Knockapi::InlineObjectRequest + ), + repeats: T::Array[Knockapi::ScheduleRepeatRule], + scheduled_at: T.nilable(Time), + tenant: T.nilable(T.any(String, Knockapi::TenantRequest)) + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/tenant.rbi b/rbi/knockapi/models/tenant.rbi index 9730d9c2..11636671 100644 --- a/rbi/knockapi/models/tenant.rbi +++ b/rbi/knockapi/models/tenant.rbi @@ -3,6 +3,9 @@ module Knockapi module Models class Tenant < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Knockapi::Tenant, Knockapi::Internal::AnyHash) } + # The unique identifier for the tenant. sig { returns(String) } attr_accessor :id @@ -16,10 +19,12 @@ module Knockapi attr_accessor :name # The settings for the tenant. Includes branding and preference set. - sig { returns(T.nilable(Knockapi::Models::Tenant::Settings)) } + sig { returns(T.nilable(Knockapi::Tenant::Settings)) } attr_reader :settings - sig { params(settings: T.nilable(T.any(Knockapi::Models::Tenant::Settings, Knockapi::Internal::AnyHash))).void } + sig do + params(settings: T.nilable(Knockapi::Tenant::Settings::OrHash)).void + end attr_writer :settings # A tenant entity. @@ -28,9 +33,8 @@ module Knockapi id: String, _typename: String, name: T.nilable(String), - settings: T.nilable(T.any(Knockapi::Models::Tenant::Settings, Knockapi::Internal::AnyHash)) - ) - .returns(T.attached_class) + settings: T.nilable(Knockapi::Tenant::Settings::OrHash) + ).returns(T.attached_class) end def self.new( # The unique identifier for the tenant. @@ -41,48 +45,59 @@ module Knockapi name: nil, # The settings for the tenant. Includes branding and preference set. settings: nil - ); end + ) + end + sig do - override - .returns( - {id: String, _typename: String, name: T.nilable(String), settings: T.nilable(Knockapi::Models::Tenant::Settings)} - ) + override.returns( + { + id: String, + _typename: String, + name: T.nilable(String), + settings: T.nilable(Knockapi::Tenant::Settings) + } + ) + end + def to_hash end - def to_hash; end class Settings < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Knockapi::Tenant::Settings, Knockapi::Internal::AnyHash) + end + # The branding for the tenant. - sig { returns(T.nilable(Knockapi::Models::Tenant::Settings::Branding)) } + sig { returns(T.nilable(Knockapi::Tenant::Settings::Branding)) } attr_reader :branding sig do params( - branding: T.nilable(T.any(Knockapi::Models::Tenant::Settings::Branding, Knockapi::Internal::AnyHash)) - ) - .void + branding: T.nilable(Knockapi::Tenant::Settings::Branding::OrHash) + ).void end attr_writer :branding # A preference set represents a specific set of notification preferences for a # recipient. A recipient can have multiple preference sets. - sig { returns(T.nilable(Knockapi::Models::Recipients::PreferenceSet)) } + sig { returns(T.nilable(Knockapi::Recipients::PreferenceSet)) } attr_reader :preference_set sig do params( - preference_set: T.nilable(T.any(Knockapi::Models::Recipients::PreferenceSet, Knockapi::Internal::AnyHash)) - ) - .void + preference_set: + T.nilable(Knockapi::Recipients::PreferenceSet::OrHash) + ).void end attr_writer :preference_set # The settings for the tenant. Includes branding and preference set. sig do params( - branding: T.nilable(T.any(Knockapi::Models::Tenant::Settings::Branding, Knockapi::Internal::AnyHash)), - preference_set: T.nilable(T.any(Knockapi::Models::Recipients::PreferenceSet, Knockapi::Internal::AnyHash)) - ) - .returns(T.attached_class) + branding: T.nilable(Knockapi::Tenant::Settings::Branding::OrHash), + preference_set: + T.nilable(Knockapi::Recipients::PreferenceSet::OrHash) + ).returns(T.attached_class) end def self.new( # The branding for the tenant. @@ -90,19 +105,29 @@ module Knockapi # A preference set represents a specific set of notification preferences for a # recipient. A recipient can have multiple preference sets. preference_set: nil - ); end + ) + end + sig do - override - .returns( - { - branding: T.nilable(Knockapi::Models::Tenant::Settings::Branding), - preference_set: T.nilable(Knockapi::Models::Recipients::PreferenceSet) - } - ) + override.returns( + { + branding: T.nilable(Knockapi::Tenant::Settings::Branding), + preference_set: T.nilable(Knockapi::Recipients::PreferenceSet) + } + ) + end + def to_hash end - def to_hash; end class Branding < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Tenant::Settings::Branding, + Knockapi::Internal::AnyHash + ) + end + # The icon URL for the tenant. Must point to a valid image with an image MIME # type. sig { returns(T.nilable(String)) } @@ -128,8 +153,7 @@ module Knockapi logo_url: T.nilable(String), primary_color: T.nilable(String), primary_color_contrast: T.nilable(String) - ) - .returns(T.attached_class) + ).returns(T.attached_class) end def self.new( # The icon URL for the tenant. Must point to a valid image with an image MIME @@ -142,19 +166,21 @@ module Knockapi primary_color: nil, # The primary color contrast for the tenant, provided as a hex value. primary_color_contrast: nil - ); end + ) + end + sig do - override - .returns( - { - icon_url: T.nilable(String), - logo_url: T.nilable(String), - primary_color: T.nilable(String), - primary_color_contrast: T.nilable(String) - } - ) + override.returns( + { + icon_url: T.nilable(String), + logo_url: T.nilable(String), + primary_color: T.nilable(String), + primary_color_contrast: T.nilable(String) + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/tenant_delete_params.rbi b/rbi/knockapi/models/tenant_delete_params.rbi index 4e7f151a..b17556d9 100644 --- a/rbi/knockapi/models/tenant_delete_params.rbi +++ b/rbi/knockapi/models/tenant_delete_params.rbi @@ -6,14 +6,22 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any(Knockapi::TenantDeleteParams, Knockapi::Internal::AnyHash) + end + sig do - params(request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash)) - .returns(T.attached_class) + params(request_options: Knockapi::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) end - def self.new(request_options: {}); end - sig { override.returns({request_options: Knockapi::RequestOptions}) } - def to_hash; end + sig { override.returns({ request_options: Knockapi::RequestOptions }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/tenant_delete_response.rbi b/rbi/knockapi/models/tenant_delete_response.rbi new file mode 100644 index 00000000..10cd8b3a --- /dev/null +++ b/rbi/knockapi/models/tenant_delete_response.rbi @@ -0,0 +1,7 @@ +# typed: strong + +module Knockapi + module Models + TenantDeleteResponse = String + end +end diff --git a/rbi/knockapi/models/tenant_get_params.rbi b/rbi/knockapi/models/tenant_get_params.rbi index f6d9c31c..d16a77a9 100644 --- a/rbi/knockapi/models/tenant_get_params.rbi +++ b/rbi/knockapi/models/tenant_get_params.rbi @@ -6,14 +6,22 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any(Knockapi::TenantGetParams, Knockapi::Internal::AnyHash) + end + sig do - params(request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash)) - .returns(T.attached_class) + params(request_options: Knockapi::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) end - def self.new(request_options: {}); end - sig { override.returns({request_options: Knockapi::RequestOptions}) } - def to_hash; end + sig { override.returns({ request_options: Knockapi::RequestOptions }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/tenant_list_params.rbi b/rbi/knockapi/models/tenant_list_params.rbi index c20d784a..63a877f4 100644 --- a/rbi/knockapi/models/tenant_list_params.rbi +++ b/rbi/knockapi/models/tenant_list_params.rbi @@ -6,6 +6,11 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any(Knockapi::TenantListParams, Knockapi::Internal::AnyHash) + end + # The cursor to fetch entries after. sig { returns(T.nilable(String)) } attr_reader :after @@ -48,9 +53,8 @@ module Knockapi name: String, page_size: Integer, tenant_id: String, - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # The cursor to fetch entries after. @@ -64,21 +68,23 @@ module Knockapi # Filter tenants by ID. tenant_id: nil, request_options: {} - ); end + ) + end + sig do - override - .returns( - { - after: String, - before: String, - name: String, - page_size: Integer, - tenant_id: String, - request_options: Knockapi::RequestOptions - } - ) + override.returns( + { + after: String, + before: String, + name: String, + page_size: Integer, + tenant_id: String, + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/tenant_request.rbi b/rbi/knockapi/models/tenant_request.rbi index 5b29c1c0..554b65fb 100644 --- a/rbi/knockapi/models/tenant_request.rbi +++ b/rbi/knockapi/models/tenant_request.rbi @@ -3,23 +3,47 @@ module Knockapi module Models class TenantRequest < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Knockapi::TenantRequest, Knockapi::Internal::AnyHash) + end + # The unique identifier for the tenant. sig { returns(String) } attr_accessor :id # A request to set channel data for a type of channel inline. - sig { returns(T.nilable(T::Hash[Symbol, Knockapi::Models::Recipients::ChannelDataRequest])) } + sig do + returns( + T.nilable( + T::Hash[ + Symbol, + T.any( + Knockapi::Recipients::PushChannelData, + Knockapi::Recipients::OneSignalChannelData, + Knockapi::Recipients::SlackChannelData, + Knockapi::Recipients::MsTeamsChannelData, + Knockapi::Recipients::DiscordChannelData + ) + ] + ) + ) + end attr_accessor :channel_data # Inline set preferences for a recipient, where the key is the preference set id. - sig { returns(T.nilable(T::Hash[Symbol, Knockapi::Models::Recipients::PreferenceSetRequest])) } + sig do + returns( + T.nilable(T::Hash[Symbol, Knockapi::Recipients::PreferenceSetRequest]) + ) + end attr_accessor :preferences # The settings for the tenant. Includes branding and preference set. - sig { returns(T.nilable(Knockapi::Models::TenantRequest::Settings)) } + sig { returns(T.nilable(Knockapi::TenantRequest::Settings)) } attr_reader :settings - sig { params(settings: T.any(Knockapi::Models::TenantRequest::Settings, Knockapi::Internal::AnyHash)).void } + sig { params(settings: Knockapi::TenantRequest::Settings::OrHash).void } attr_writer :settings # A tenant to be set in the system. You can supply any additional properties on @@ -27,15 +51,28 @@ module Knockapi sig do params( id: String, - channel_data: T.nilable( - T::Hash[Symbol, T.any(Knockapi::Models::Recipients::ChannelDataRequest, Knockapi::Internal::AnyHash)] - ), - preferences: T.nilable( - T::Hash[Symbol, T.any(Knockapi::Models::Recipients::PreferenceSetRequest, Knockapi::Internal::AnyHash)] - ), - settings: T.any(Knockapi::Models::TenantRequest::Settings, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + channel_data: + T.nilable( + T::Hash[ + Symbol, + T.any( + Knockapi::Recipients::PushChannelData::OrHash, + Knockapi::Recipients::OneSignalChannelData::OrHash, + Knockapi::Recipients::SlackChannelData::OrHash, + Knockapi::Recipients::MsTeamsChannelData::OrHash, + Knockapi::Recipients::DiscordChannelData::OrHash + ) + ] + ), + preferences: + T.nilable( + T::Hash[ + Symbol, + Knockapi::Recipients::PreferenceSetRequest::OrHash + ] + ), + settings: Knockapi::TenantRequest::Settings::OrHash + ).returns(T.attached_class) end def self.new( # The unique identifier for the tenant. @@ -46,69 +83,106 @@ module Knockapi preferences: nil, # The settings for the tenant. Includes branding and preference set. settings: nil - ); end + ) + end + sig do - override - .returns( - { - id: String, - channel_data: T.nilable(T::Hash[Symbol, Knockapi::Models::Recipients::ChannelDataRequest]), - preferences: T.nilable(T::Hash[Symbol, Knockapi::Models::Recipients::PreferenceSetRequest]), - settings: Knockapi::Models::TenantRequest::Settings - } - ) + override.returns( + { + id: String, + channel_data: + T.nilable( + T::Hash[ + Symbol, + T.any( + Knockapi::Recipients::PushChannelData, + Knockapi::Recipients::OneSignalChannelData, + Knockapi::Recipients::SlackChannelData, + Knockapi::Recipients::MsTeamsChannelData, + Knockapi::Recipients::DiscordChannelData + ) + ] + ), + preferences: + T.nilable( + T::Hash[Symbol, Knockapi::Recipients::PreferenceSetRequest] + ), + settings: Knockapi::TenantRequest::Settings + } + ) + end + def to_hash end - def to_hash; end class Settings < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::TenantRequest::Settings, + Knockapi::Internal::AnyHash + ) + end + # The branding for the tenant. - sig { returns(T.nilable(Knockapi::Models::TenantRequest::Settings::Branding)) } + sig { returns(T.nilable(Knockapi::TenantRequest::Settings::Branding)) } attr_reader :branding sig do - params(branding: T.any(Knockapi::Models::TenantRequest::Settings::Branding, Knockapi::Internal::AnyHash)) - .void + params( + branding: Knockapi::TenantRequest::Settings::Branding::OrHash + ).void end attr_writer :branding # A request to set a preference set for a recipient. - sig { returns(T.nilable(Knockapi::Models::Recipients::PreferenceSetRequest)) } + sig { returns(T.nilable(Knockapi::Recipients::PreferenceSetRequest)) } attr_reader :preference_set sig do params( - preference_set: T.nilable(T.any(Knockapi::Models::Recipients::PreferenceSetRequest, Knockapi::Internal::AnyHash)) - ) - .void + preference_set: + T.nilable(Knockapi::Recipients::PreferenceSetRequest::OrHash) + ).void end attr_writer :preference_set # The settings for the tenant. Includes branding and preference set. sig do params( - branding: T.any(Knockapi::Models::TenantRequest::Settings::Branding, Knockapi::Internal::AnyHash), - preference_set: T.nilable(T.any(Knockapi::Models::Recipients::PreferenceSetRequest, Knockapi::Internal::AnyHash)) - ) - .returns(T.attached_class) + branding: Knockapi::TenantRequest::Settings::Branding::OrHash, + preference_set: + T.nilable(Knockapi::Recipients::PreferenceSetRequest::OrHash) + ).returns(T.attached_class) end def self.new( # The branding for the tenant. branding: nil, # A request to set a preference set for a recipient. preference_set: nil - ); end + ) + end + sig do - override - .returns( - { - branding: Knockapi::Models::TenantRequest::Settings::Branding, - preference_set: T.nilable(Knockapi::Models::Recipients::PreferenceSetRequest) - } - ) + override.returns( + { + branding: Knockapi::TenantRequest::Settings::Branding, + preference_set: + T.nilable(Knockapi::Recipients::PreferenceSetRequest) + } + ) + end + def to_hash end - def to_hash; end class Branding < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::TenantRequest::Settings::Branding, + Knockapi::Internal::AnyHash + ) + end + # The icon URL for the tenant. Must point to a valid image with an image MIME # type. sig { returns(T.nilable(String)) } @@ -134,8 +208,7 @@ module Knockapi logo_url: T.nilable(String), primary_color: T.nilable(String), primary_color_contrast: T.nilable(String) - ) - .returns(T.attached_class) + ).returns(T.attached_class) end def self.new( # The icon URL for the tenant. Must point to a valid image with an image MIME @@ -148,19 +221,21 @@ module Knockapi primary_color: nil, # The primary color contrast for the tenant, provided as a hex value. primary_color_contrast: nil - ); end + ) + end + sig do - override - .returns( - { - icon_url: T.nilable(String), - logo_url: T.nilable(String), - primary_color: T.nilable(String), - primary_color_contrast: T.nilable(String) - } - ) + override.returns( + { + icon_url: T.nilable(String), + logo_url: T.nilable(String), + primary_color: T.nilable(String), + primary_color_contrast: T.nilable(String) + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/tenant_set_params.rbi b/rbi/knockapi/models/tenant_set_params.rbi index 50ddfe5e..23a1571d 100644 --- a/rbi/knockapi/models/tenant_set_params.rbi +++ b/rbi/knockapi/models/tenant_set_params.rbi @@ -6,33 +6,70 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any(Knockapi::TenantSetParams, Knockapi::Internal::AnyHash) + end + # A request to set channel data for a type of channel inline. - sig { returns(T.nilable(T::Hash[Symbol, Knockapi::Models::Recipients::ChannelDataRequest])) } + sig do + returns( + T.nilable( + T::Hash[ + Symbol, + T.any( + Knockapi::Recipients::PushChannelData, + Knockapi::Recipients::OneSignalChannelData, + Knockapi::Recipients::SlackChannelData, + Knockapi::Recipients::MsTeamsChannelData, + Knockapi::Recipients::DiscordChannelData + ) + ] + ) + ) + end attr_accessor :channel_data # Inline set preferences for a recipient, where the key is the preference set id. - sig { returns(T.nilable(T::Hash[Symbol, Knockapi::Models::Recipients::PreferenceSetRequest])) } + sig do + returns( + T.nilable(T::Hash[Symbol, Knockapi::Recipients::PreferenceSetRequest]) + ) + end attr_accessor :preferences # The settings for the tenant. Includes branding and preference set. - sig { returns(T.nilable(Knockapi::Models::TenantSetParams::Settings)) } + sig { returns(T.nilable(Knockapi::TenantSetParams::Settings)) } attr_reader :settings - sig { params(settings: T.any(Knockapi::Models::TenantSetParams::Settings, Knockapi::Internal::AnyHash)).void } + sig { params(settings: Knockapi::TenantSetParams::Settings::OrHash).void } attr_writer :settings sig do params( - channel_data: T.nilable( - T::Hash[Symbol, T.any(Knockapi::Models::Recipients::ChannelDataRequest, Knockapi::Internal::AnyHash)] - ), - preferences: T.nilable( - T::Hash[Symbol, T.any(Knockapi::Models::Recipients::PreferenceSetRequest, Knockapi::Internal::AnyHash)] - ), - settings: T.any(Knockapi::Models::TenantSetParams::Settings, Knockapi::Internal::AnyHash), - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + channel_data: + T.nilable( + T::Hash[ + Symbol, + T.any( + Knockapi::Recipients::PushChannelData::OrHash, + Knockapi::Recipients::OneSignalChannelData::OrHash, + Knockapi::Recipients::SlackChannelData::OrHash, + Knockapi::Recipients::MsTeamsChannelData::OrHash, + Knockapi::Recipients::DiscordChannelData::OrHash + ) + ] + ), + preferences: + T.nilable( + T::Hash[ + Symbol, + Knockapi::Recipients::PreferenceSetRequest::OrHash + ] + ), + settings: Knockapi::TenantSetParams::Settings::OrHash, + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # A request to set channel data for a type of channel inline. @@ -42,71 +79,108 @@ module Knockapi # The settings for the tenant. Includes branding and preference set. settings: nil, request_options: {} - ); end + ) + end + sig do - override - .returns( - { - channel_data: T.nilable(T::Hash[Symbol, Knockapi::Models::Recipients::ChannelDataRequest]), - preferences: T.nilable(T::Hash[Symbol, Knockapi::Models::Recipients::PreferenceSetRequest]), - settings: Knockapi::Models::TenantSetParams::Settings, - request_options: Knockapi::RequestOptions - } - ) + override.returns( + { + channel_data: + T.nilable( + T::Hash[ + Symbol, + T.any( + Knockapi::Recipients::PushChannelData, + Knockapi::Recipients::OneSignalChannelData, + Knockapi::Recipients::SlackChannelData, + Knockapi::Recipients::MsTeamsChannelData, + Knockapi::Recipients::DiscordChannelData + ) + ] + ), + preferences: + T.nilable( + T::Hash[Symbol, Knockapi::Recipients::PreferenceSetRequest] + ), + settings: Knockapi::TenantSetParams::Settings, + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end class Settings < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::TenantSetParams::Settings, + Knockapi::Internal::AnyHash + ) + end + # The branding for the tenant. - sig { returns(T.nilable(Knockapi::Models::TenantSetParams::Settings::Branding)) } + sig do + returns(T.nilable(Knockapi::TenantSetParams::Settings::Branding)) + end attr_reader :branding sig do params( - branding: T.any(Knockapi::Models::TenantSetParams::Settings::Branding, Knockapi::Internal::AnyHash) - ) - .void + branding: Knockapi::TenantSetParams::Settings::Branding::OrHash + ).void end attr_writer :branding # A request to set a preference set for a recipient. - sig { returns(T.nilable(Knockapi::Models::Recipients::PreferenceSetRequest)) } + sig { returns(T.nilable(Knockapi::Recipients::PreferenceSetRequest)) } attr_reader :preference_set sig do params( - preference_set: T.nilable(T.any(Knockapi::Models::Recipients::PreferenceSetRequest, Knockapi::Internal::AnyHash)) - ) - .void + preference_set: + T.nilable(Knockapi::Recipients::PreferenceSetRequest::OrHash) + ).void end attr_writer :preference_set # The settings for the tenant. Includes branding and preference set. sig do params( - branding: T.any(Knockapi::Models::TenantSetParams::Settings::Branding, Knockapi::Internal::AnyHash), - preference_set: T.nilable(T.any(Knockapi::Models::Recipients::PreferenceSetRequest, Knockapi::Internal::AnyHash)) - ) - .returns(T.attached_class) + branding: Knockapi::TenantSetParams::Settings::Branding::OrHash, + preference_set: + T.nilable(Knockapi::Recipients::PreferenceSetRequest::OrHash) + ).returns(T.attached_class) end def self.new( # The branding for the tenant. branding: nil, # A request to set a preference set for a recipient. preference_set: nil - ); end + ) + end + sig do - override - .returns( - { - branding: Knockapi::Models::TenantSetParams::Settings::Branding, - preference_set: T.nilable(Knockapi::Models::Recipients::PreferenceSetRequest) - } - ) + override.returns( + { + branding: Knockapi::TenantSetParams::Settings::Branding, + preference_set: + T.nilable(Knockapi::Recipients::PreferenceSetRequest) + } + ) + end + def to_hash end - def to_hash; end class Branding < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::TenantSetParams::Settings::Branding, + Knockapi::Internal::AnyHash + ) + end + # The icon URL for the tenant. Must point to a valid image with an image MIME # type. sig { returns(T.nilable(String)) } @@ -132,8 +206,7 @@ module Knockapi logo_url: T.nilable(String), primary_color: T.nilable(String), primary_color_contrast: T.nilable(String) - ) - .returns(T.attached_class) + ).returns(T.attached_class) end def self.new( # The icon URL for the tenant. Must point to a valid image with an image MIME @@ -146,19 +219,21 @@ module Knockapi primary_color: nil, # The primary color contrast for the tenant, provided as a hex value. primary_color_contrast: nil - ); end + ) + end + sig do - override - .returns( - { - icon_url: T.nilable(String), - logo_url: T.nilable(String), - primary_color: T.nilable(String), - primary_color_contrast: T.nilable(String) - } - ) + override.returns( + { + icon_url: T.nilable(String), + logo_url: T.nilable(String), + primary_color: T.nilable(String), + primary_color_contrast: T.nilable(String) + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/tenants/bulk_delete_params.rbi b/rbi/knockapi/models/tenants/bulk_delete_params.rbi index e658bb79..1cc52724 100644 --- a/rbi/knockapi/models/tenants/bulk_delete_params.rbi +++ b/rbi/knockapi/models/tenants/bulk_delete_params.rbi @@ -7,6 +7,14 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::Tenants::BulkDeleteParams, + Knockapi::Internal::AnyHash + ) + end + # The IDs of the tenants to delete. sig { returns(T::Array[String]) } attr_accessor :tenant_ids @@ -14,17 +22,26 @@ module Knockapi sig do params( tenant_ids: T::Array[String], - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # The IDs of the tenants to delete. tenant_ids:, request_options: {} - ); end - sig { override.returns({tenant_ids: T::Array[String], request_options: Knockapi::RequestOptions}) } - def to_hash; end + ) + end + + sig do + override.returns( + { + tenant_ids: T::Array[String], + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash + end end end end diff --git a/rbi/knockapi/models/tenants/bulk_set_params.rbi b/rbi/knockapi/models/tenants/bulk_set_params.rbi index f35ef895..298cd5a6 100644 --- a/rbi/knockapi/models/tenants/bulk_set_params.rbi +++ b/rbi/knockapi/models/tenants/bulk_set_params.rbi @@ -7,29 +7,38 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any(Knockapi::Tenants::BulkSetParams, Knockapi::Internal::AnyHash) + end + # The tenants to be upserted. - sig { returns(T::Array[T.any(String, Knockapi::Models::TenantRequest)]) } + sig { returns(T::Array[T.any(String, Knockapi::TenantRequest)]) } attr_accessor :tenants sig do params( - tenants: T::Array[T.any(String, Knockapi::Models::TenantRequest, Knockapi::Internal::AnyHash)], - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + tenants: T::Array[T.any(String, Knockapi::TenantRequest::OrHash)], + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # The tenants to be upserted. tenants:, request_options: {} - ); end + ) + end + sig do - override - .returns( - {tenants: T::Array[T.any(String, Knockapi::Models::TenantRequest)], request_options: Knockapi::RequestOptions} - ) + override.returns( + { + tenants: T::Array[T.any(String, Knockapi::TenantRequest)], + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/user.rbi b/rbi/knockapi/models/user.rbi index 58efddc5..68ac7252 100644 --- a/rbi/knockapi/models/user.rbi +++ b/rbi/knockapi/models/user.rbi @@ -3,6 +3,9 @@ module Knockapi module Models class User < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Knockapi::User, Knockapi::Internal::AnyHash) } + # The ID for the user that you set when identifying them in Knock. sig { returns(String) } attr_accessor :id @@ -31,15 +34,15 @@ module Knockapi sig { returns(T.nilable(String)) } attr_accessor :name - # The [E.164](https://www.twilio.com/docs/glossary/what-e164) phone number of the + # The [E.164](https://www.twilio.com/docs/glossary/what-e164) phone number of the # user (required for SMS channels). sig { returns(T.nilable(String)) } attr_accessor :phone_number - # The timezone of the user. Must be a valid - # [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). - # Used for - # [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients). + # The timezone of the user. Must be a + # valid [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + # Used + # for [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients). sig { returns(T.nilable(String)) } attr_accessor :timezone @@ -57,8 +60,7 @@ module Knockapi name: T.nilable(String), phone_number: T.nilable(String), timezone: T.nilable(String) - ) - .returns(T.attached_class) + ).returns(T.attached_class) end def self.new( # The ID for the user that you set when identifying them in Knock. @@ -75,32 +77,34 @@ module Knockapi email: nil, # Display name of the user. name: nil, - # The [E.164](https://www.twilio.com/docs/glossary/what-e164) phone number of the + # The [E.164](https://www.twilio.com/docs/glossary/what-e164) phone number of the # user (required for SMS channels). phone_number: nil, - # The timezone of the user. Must be a valid - # [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). - # Used for - # [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients). + # The timezone of the user. Must be a + # valid [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + # Used + # for [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients). timezone: nil - ); end + ) + end + sig do - override - .returns( - { - id: String, - _typename: String, - updated_at: Time, - avatar: T.nilable(String), - created_at: T.nilable(Time), - email: T.nilable(String), - name: T.nilable(String), - phone_number: T.nilable(String), - timezone: T.nilable(String) - } - ) + override.returns( + { + id: String, + _typename: String, + updated_at: Time, + avatar: T.nilable(String), + created_at: T.nilable(Time), + email: T.nilable(String), + name: T.nilable(String), + phone_number: T.nilable(String), + timezone: T.nilable(String) + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/user_delete_params.rbi b/rbi/knockapi/models/user_delete_params.rbi index 471448e8..0619d33b 100644 --- a/rbi/knockapi/models/user_delete_params.rbi +++ b/rbi/knockapi/models/user_delete_params.rbi @@ -6,14 +6,22 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any(Knockapi::UserDeleteParams, Knockapi::Internal::AnyHash) + end + sig do - params(request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash)) - .returns(T.attached_class) + params(request_options: Knockapi::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) end - def self.new(request_options: {}); end - sig { override.returns({request_options: Knockapi::RequestOptions}) } - def to_hash; end + sig { override.returns({ request_options: Knockapi::RequestOptions }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/user_delete_response.rbi b/rbi/knockapi/models/user_delete_response.rbi new file mode 100644 index 00000000..879642bb --- /dev/null +++ b/rbi/knockapi/models/user_delete_response.rbi @@ -0,0 +1,7 @@ +# typed: strong + +module Knockapi + module Models + UserDeleteResponse = String + end +end diff --git a/rbi/knockapi/models/user_get_channel_data_params.rbi b/rbi/knockapi/models/user_get_channel_data_params.rbi index a4edb58a..13be57b1 100644 --- a/rbi/knockapi/models/user_get_channel_data_params.rbi +++ b/rbi/knockapi/models/user_get_channel_data_params.rbi @@ -6,14 +6,22 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any(Knockapi::UserGetChannelDataParams, Knockapi::Internal::AnyHash) + end + sig do - params(request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash)) - .returns(T.attached_class) + params(request_options: Knockapi::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) end - def self.new(request_options: {}); end - sig { override.returns({request_options: Knockapi::RequestOptions}) } - def to_hash; end + sig { override.returns({ request_options: Knockapi::RequestOptions }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/user_get_params.rbi b/rbi/knockapi/models/user_get_params.rbi index e6266259..234e3115 100644 --- a/rbi/knockapi/models/user_get_params.rbi +++ b/rbi/knockapi/models/user_get_params.rbi @@ -6,14 +6,22 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any(Knockapi::UserGetParams, Knockapi::Internal::AnyHash) + end + sig do - params(request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash)) - .returns(T.attached_class) + params(request_options: Knockapi::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) end - def self.new(request_options: {}); end - sig { override.returns({request_options: Knockapi::RequestOptions}) } - def to_hash; end + sig { override.returns({ request_options: Knockapi::RequestOptions }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/user_get_preferences_params.rbi b/rbi/knockapi/models/user_get_preferences_params.rbi index 31c49f75..202328e0 100644 --- a/rbi/knockapi/models/user_get_preferences_params.rbi +++ b/rbi/knockapi/models/user_get_preferences_params.rbi @@ -6,6 +6,11 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any(Knockapi::UserGetPreferencesParams, Knockapi::Internal::AnyHash) + end + # The unique identifier for the tenant. sig { returns(T.nilable(String)) } attr_reader :tenant @@ -14,16 +19,25 @@ module Knockapi attr_writer :tenant sig do - params(tenant: String, request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash)) - .returns(T.attached_class) + params( + tenant: String, + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # The unique identifier for the tenant. tenant: nil, request_options: {} - ); end - sig { override.returns({tenant: String, request_options: Knockapi::RequestOptions}) } - def to_hash; end + ) + end + + sig do + override.returns( + { tenant: String, request_options: Knockapi::RequestOptions } + ) + end + def to_hash + end end end end diff --git a/rbi/knockapi/models/user_list_messages_params.rbi b/rbi/knockapi/models/user_list_messages_params.rbi index 9f774b73..a04c2ecf 100644 --- a/rbi/knockapi/models/user_list_messages_params.rbi +++ b/rbi/knockapi/models/user_list_messages_params.rbi @@ -6,6 +6,11 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any(Knockapi::UserListMessagesParams, Knockapi::Internal::AnyHash) + end + # The cursor to fetch entries after. sig { returns(T.nilable(String)) } attr_reader :after @@ -28,23 +33,34 @@ module Knockapi attr_writer :channel_id # Limits the results to messages with the given engagement status. - sig { returns(T.nilable(T::Array[Knockapi::Models::UserListMessagesParams::EngagementStatus::OrSymbol])) } + sig do + returns( + T.nilable( + T::Array[ + Knockapi::UserListMessagesParams::EngagementStatus::OrSymbol + ] + ) + ) + end attr_reader :engagement_status sig do - params(engagement_status: T::Array[Knockapi::Models::UserListMessagesParams::EngagementStatus::OrSymbol]) - .void + params( + engagement_status: + T::Array[ + Knockapi::UserListMessagesParams::EngagementStatus::OrSymbol + ] + ).void end attr_writer :engagement_status - sig { returns(T.nilable(Knockapi::Models::UserListMessagesParams::InsertedAt)) } + sig { returns(T.nilable(Knockapi::UserListMessagesParams::InsertedAt)) } attr_reader :inserted_at sig do params( - inserted_at: T.any(Knockapi::Models::UserListMessagesParams::InsertedAt, Knockapi::Internal::AnyHash) - ) - .void + inserted_at: Knockapi::UserListMessagesParams::InsertedAt::OrHash + ).void end attr_writer :inserted_at @@ -71,10 +87,20 @@ module Knockapi attr_writer :source # Limits the results to messages with the given delivery status. - sig { returns(T.nilable(T::Array[Knockapi::Models::UserListMessagesParams::Status::OrSymbol])) } + sig do + returns( + T.nilable( + T::Array[Knockapi::UserListMessagesParams::Status::OrSymbol] + ) + ) + end attr_reader :status - sig { params(status: T::Array[Knockapi::Models::UserListMessagesParams::Status::OrSymbol]).void } + sig do + params( + status: T::Array[Knockapi::UserListMessagesParams::Status::OrSymbol] + ).void + end attr_writer :status # Limits the results to items with the corresponding tenant. @@ -120,20 +146,22 @@ module Knockapi after: String, before: String, channel_id: String, - engagement_status: T::Array[Knockapi::Models::UserListMessagesParams::EngagementStatus::OrSymbol], - inserted_at: T.any(Knockapi::Models::UserListMessagesParams::InsertedAt, Knockapi::Internal::AnyHash), + engagement_status: + T::Array[ + Knockapi::UserListMessagesParams::EngagementStatus::OrSymbol + ], + inserted_at: Knockapi::UserListMessagesParams::InsertedAt::OrHash, message_ids: T::Array[String], page_size: Integer, source: String, - status: T::Array[Knockapi::Models::UserListMessagesParams::Status::OrSymbol], + status: T::Array[Knockapi::UserListMessagesParams::Status::OrSymbol], tenant: String, trigger_data: String, workflow_categories: T::Array[String], workflow_recipient_run_id: String, workflow_run_id: String, - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # The cursor to fetch entries after. @@ -168,49 +196,92 @@ module Knockapi # returned by the workflow trigger request. workflow_run_id: nil, request_options: {} - ); end + ) + end + sig do - override - .returns( - { - after: String, - before: String, - channel_id: String, - engagement_status: T::Array[Knockapi::Models::UserListMessagesParams::EngagementStatus::OrSymbol], - inserted_at: Knockapi::Models::UserListMessagesParams::InsertedAt, - message_ids: T::Array[String], - page_size: Integer, - source: String, - status: T::Array[Knockapi::Models::UserListMessagesParams::Status::OrSymbol], - tenant: String, - trigger_data: String, - workflow_categories: T::Array[String], - workflow_recipient_run_id: String, - workflow_run_id: String, - request_options: Knockapi::RequestOptions - } - ) + override.returns( + { + after: String, + before: String, + channel_id: String, + engagement_status: + T::Array[ + Knockapi::UserListMessagesParams::EngagementStatus::OrSymbol + ], + inserted_at: Knockapi::UserListMessagesParams::InsertedAt, + message_ids: T::Array[String], + page_size: Integer, + source: String, + status: + T::Array[Knockapi::UserListMessagesParams::Status::OrSymbol], + tenant: String, + trigger_data: String, + workflow_categories: T::Array[String], + workflow_recipient_run_id: String, + workflow_run_id: String, + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end module EngagementStatus extend Knockapi::Internal::Type::Enum - TaggedSymbol = T.type_alias { T.all(Symbol, Knockapi::Models::UserListMessagesParams::EngagementStatus) } + TaggedSymbol = + T.type_alias do + T.all(Symbol, Knockapi::UserListMessagesParams::EngagementStatus) + end OrSymbol = T.type_alias { T.any(Symbol, String) } - SEEN = T.let(:seen, Knockapi::Models::UserListMessagesParams::EngagementStatus::TaggedSymbol) - READ = T.let(:read, Knockapi::Models::UserListMessagesParams::EngagementStatus::TaggedSymbol) - INTERACTED = T.let(:interacted, Knockapi::Models::UserListMessagesParams::EngagementStatus::TaggedSymbol) + SEEN = + T.let( + :seen, + Knockapi::UserListMessagesParams::EngagementStatus::TaggedSymbol + ) + READ = + T.let( + :read, + Knockapi::UserListMessagesParams::EngagementStatus::TaggedSymbol + ) + INTERACTED = + T.let( + :interacted, + Knockapi::UserListMessagesParams::EngagementStatus::TaggedSymbol + ) LINK_CLICKED = - T.let(:link_clicked, Knockapi::Models::UserListMessagesParams::EngagementStatus::TaggedSymbol) - ARCHIVED = T.let(:archived, Knockapi::Models::UserListMessagesParams::EngagementStatus::TaggedSymbol) + T.let( + :link_clicked, + Knockapi::UserListMessagesParams::EngagementStatus::TaggedSymbol + ) + ARCHIVED = + T.let( + :archived, + Knockapi::UserListMessagesParams::EngagementStatus::TaggedSymbol + ) - sig { override.returns(T::Array[Knockapi::Models::UserListMessagesParams::EngagementStatus::TaggedSymbol]) } - def self.values; end + sig do + override.returns( + T::Array[ + Knockapi::UserListMessagesParams::EngagementStatus::TaggedSymbol + ] + ) + end + def self.values + end end class InsertedAt < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::UserListMessagesParams::InsertedAt, + Knockapi::Internal::AnyHash + ) + end + # Limits the results to messages inserted after the given date. sig { returns(T.nilable(String)) } attr_reader :gt @@ -239,7 +310,11 @@ module Knockapi sig { params(lte: String).void } attr_writer :lte - sig { params(gt: String, gte: String, lt: String, lte: String).returns(T.attached_class) } + sig do + params(gt: String, gte: String, lt: String, lte: String).returns( + T.attached_class + ) + end def self.new( # Limits the results to messages inserted after the given date. gt: nil, @@ -249,28 +324,62 @@ module Knockapi lt: nil, # Limits the results to messages inserted before or on the given date. lte: nil - ); end - sig { override.returns({gt: String, gte: String, lt: String, lte: String}) } - def to_hash; end + ) + end + + sig do + override.returns({ gt: String, gte: String, lt: String, lte: String }) + end + def to_hash + end end module Status extend Knockapi::Internal::Type::Enum - TaggedSymbol = T.type_alias { T.all(Symbol, Knockapi::Models::UserListMessagesParams::Status) } + TaggedSymbol = + T.type_alias do + T.all(Symbol, Knockapi::UserListMessagesParams::Status) + end OrSymbol = T.type_alias { T.any(Symbol, String) } - QUEUED = T.let(:queued, Knockapi::Models::UserListMessagesParams::Status::TaggedSymbol) - SENT = T.let(:sent, Knockapi::Models::UserListMessagesParams::Status::TaggedSymbol) - DELIVERED = T.let(:delivered, Knockapi::Models::UserListMessagesParams::Status::TaggedSymbol) + QUEUED = + T.let(:queued, Knockapi::UserListMessagesParams::Status::TaggedSymbol) + SENT = + T.let(:sent, Knockapi::UserListMessagesParams::Status::TaggedSymbol) + DELIVERED = + T.let( + :delivered, + Knockapi::UserListMessagesParams::Status::TaggedSymbol + ) DELIVERY_ATTEMPTED = - T.let(:delivery_attempted, Knockapi::Models::UserListMessagesParams::Status::TaggedSymbol) - UNDELIVERED = T.let(:undelivered, Knockapi::Models::UserListMessagesParams::Status::TaggedSymbol) - NOT_SENT = T.let(:not_sent, Knockapi::Models::UserListMessagesParams::Status::TaggedSymbol) - BOUNCED = T.let(:bounced, Knockapi::Models::UserListMessagesParams::Status::TaggedSymbol) + T.let( + :delivery_attempted, + Knockapi::UserListMessagesParams::Status::TaggedSymbol + ) + UNDELIVERED = + T.let( + :undelivered, + Knockapi::UserListMessagesParams::Status::TaggedSymbol + ) + NOT_SENT = + T.let( + :not_sent, + Knockapi::UserListMessagesParams::Status::TaggedSymbol + ) + BOUNCED = + T.let( + :bounced, + Knockapi::UserListMessagesParams::Status::TaggedSymbol + ) - sig { override.returns(T::Array[Knockapi::Models::UserListMessagesParams::Status::TaggedSymbol]) } - def self.values; end + sig do + override.returns( + T::Array[Knockapi::UserListMessagesParams::Status::TaggedSymbol] + ) + end + def self.values + end end end end diff --git a/rbi/knockapi/models/user_list_params.rbi b/rbi/knockapi/models/user_list_params.rbi index 0ee50640..334007e9 100644 --- a/rbi/knockapi/models/user_list_params.rbi +++ b/rbi/knockapi/models/user_list_params.rbi @@ -6,6 +6,11 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any(Knockapi::UserListParams, Knockapi::Internal::AnyHash) + end + # The cursor to fetch entries after. sig { returns(T.nilable(String)) } attr_reader :after @@ -21,10 +26,18 @@ module Knockapi attr_writer :before # Associated resources to include in the response. - sig { returns(T.nilable(T::Array[Knockapi::Models::UserListParams::Include::OrSymbol])) } + sig do + returns( + T.nilable(T::Array[Knockapi::UserListParams::Include::OrSymbol]) + ) + end attr_reader :include - sig { params(include: T::Array[Knockapi::Models::UserListParams::Include::OrSymbol]).void } + sig do + params( + include: T::Array[Knockapi::UserListParams::Include::OrSymbol] + ).void + end attr_writer :include # The number of items per page. @@ -38,11 +51,10 @@ module Knockapi params( after: String, before: String, - include: T::Array[Knockapi::Models::UserListParams::Include::OrSymbol], + include: T::Array[Knockapi::UserListParams::Include::OrSymbol], page_size: Integer, - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # The cursor to fetch entries after. @@ -54,31 +66,40 @@ module Knockapi # The number of items per page. page_size: nil, request_options: {} - ); end + ) + end + sig do - override - .returns( - { - after: String, - before: String, - include: T::Array[Knockapi::Models::UserListParams::Include::OrSymbol], - page_size: Integer, - request_options: Knockapi::RequestOptions - } - ) + override.returns( + { + after: String, + before: String, + include: T::Array[Knockapi::UserListParams::Include::OrSymbol], + page_size: Integer, + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end module Include extend Knockapi::Internal::Type::Enum - TaggedSymbol = T.type_alias { T.all(Symbol, Knockapi::Models::UserListParams::Include) } + TaggedSymbol = + T.type_alias { T.all(Symbol, Knockapi::UserListParams::Include) } OrSymbol = T.type_alias { T.any(Symbol, String) } - PREFERENCES = T.let(:preferences, Knockapi::Models::UserListParams::Include::TaggedSymbol) + PREFERENCES = + T.let(:preferences, Knockapi::UserListParams::Include::TaggedSymbol) - sig { override.returns(T::Array[Knockapi::Models::UserListParams::Include::TaggedSymbol]) } - def self.values; end + sig do + override.returns( + T::Array[Knockapi::UserListParams::Include::TaggedSymbol] + ) + end + def self.values + end end end end diff --git a/rbi/knockapi/models/user_list_preferences_params.rbi b/rbi/knockapi/models/user_list_preferences_params.rbi index 2c4d44fa..a3f6d062 100644 --- a/rbi/knockapi/models/user_list_preferences_params.rbi +++ b/rbi/knockapi/models/user_list_preferences_params.rbi @@ -6,14 +6,25 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::UserListPreferencesParams, + Knockapi::Internal::AnyHash + ) + end + sig do - params(request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash)) - .returns(T.attached_class) + params(request_options: Knockapi::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) end - def self.new(request_options: {}); end - sig { override.returns({request_options: Knockapi::RequestOptions}) } - def to_hash; end + sig { override.returns({ request_options: Knockapi::RequestOptions }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/user_list_preferences_response.rbi b/rbi/knockapi/models/user_list_preferences_response.rbi index 36c42a9f..b7508daf 100644 --- a/rbi/knockapi/models/user_list_preferences_response.rbi +++ b/rbi/knockapi/models/user_list_preferences_response.rbi @@ -4,7 +4,7 @@ module Knockapi module Models UserListPreferencesResponse = T.let( - Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Recipients::PreferenceSet], + Knockapi::Internal::Type::ArrayOf[Knockapi::Recipients::PreferenceSet], Knockapi::Internal::Type::Converter ) end diff --git a/rbi/knockapi/models/user_list_schedules_params.rbi b/rbi/knockapi/models/user_list_schedules_params.rbi index 956dd0a0..c7093dd1 100644 --- a/rbi/knockapi/models/user_list_schedules_params.rbi +++ b/rbi/knockapi/models/user_list_schedules_params.rbi @@ -6,6 +6,11 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any(Knockapi::UserListSchedulesParams, Knockapi::Internal::AnyHash) + end + # The cursor to fetch entries after. sig { returns(T.nilable(String)) } attr_reader :after @@ -48,9 +53,8 @@ module Knockapi page_size: Integer, tenant: String, workflow: String, - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # The cursor to fetch entries after. @@ -64,21 +68,23 @@ module Knockapi # The workflow key to filter schedules for. workflow: nil, request_options: {} - ); end + ) + end + sig do - override - .returns( - { - after: String, - before: String, - page_size: Integer, - tenant: String, - workflow: String, - request_options: Knockapi::RequestOptions - } - ) + override.returns( + { + after: String, + before: String, + page_size: Integer, + tenant: String, + workflow: String, + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/user_list_subscriptions_params.rbi b/rbi/knockapi/models/user_list_subscriptions_params.rbi index ab1cb378..8333c702 100644 --- a/rbi/knockapi/models/user_list_subscriptions_params.rbi +++ b/rbi/knockapi/models/user_list_subscriptions_params.rbi @@ -6,6 +6,14 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::UserListSubscriptionsParams, + Knockapi::Internal::AnyHash + ) + end + # The cursor to fetch entries after. sig { returns(T.nilable(String)) } attr_reader :after @@ -21,10 +29,21 @@ module Knockapi attr_writer :before # Associated resources to include in the response. - sig { returns(T.nilable(T::Array[Knockapi::Models::UserListSubscriptionsParams::Include::OrSymbol])) } + sig do + returns( + T.nilable( + T::Array[Knockapi::UserListSubscriptionsParams::Include::OrSymbol] + ) + ) + end attr_reader :include - sig { params(include: T::Array[Knockapi::Models::UserListSubscriptionsParams::Include::OrSymbol]).void } + sig do + params( + include: + T::Array[Knockapi::UserListSubscriptionsParams::Include::OrSymbol] + ).void + end attr_writer :include # Only returns subscriptions for the specified object GIDs. @@ -45,12 +64,12 @@ module Knockapi params( after: String, before: String, - include: T::Array[Knockapi::Models::UserListSubscriptionsParams::Include::OrSymbol], + include: + T::Array[Knockapi::UserListSubscriptionsParams::Include::OrSymbol], objects: T::Array[String], page_size: Integer, - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # The cursor to fetch entries after. @@ -64,32 +83,51 @@ module Knockapi # The number of items per page. page_size: nil, request_options: {} - ); end + ) + end + sig do - override - .returns( - { - after: String, - before: String, - include: T::Array[Knockapi::Models::UserListSubscriptionsParams::Include::OrSymbol], - objects: T::Array[String], - page_size: Integer, - request_options: Knockapi::RequestOptions - } - ) + override.returns( + { + after: String, + before: String, + include: + T::Array[ + Knockapi::UserListSubscriptionsParams::Include::OrSymbol + ], + objects: T::Array[String], + page_size: Integer, + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end module Include extend Knockapi::Internal::Type::Enum - TaggedSymbol = T.type_alias { T.all(Symbol, Knockapi::Models::UserListSubscriptionsParams::Include) } + TaggedSymbol = + T.type_alias do + T.all(Symbol, Knockapi::UserListSubscriptionsParams::Include) + end OrSymbol = T.type_alias { T.any(Symbol, String) } - PREFERENCES = T.let(:preferences, Knockapi::Models::UserListSubscriptionsParams::Include::TaggedSymbol) + PREFERENCES = + T.let( + :preferences, + Knockapi::UserListSubscriptionsParams::Include::TaggedSymbol + ) - sig { override.returns(T::Array[Knockapi::Models::UserListSubscriptionsParams::Include::TaggedSymbol]) } - def self.values; end + sig do + override.returns( + T::Array[ + Knockapi::UserListSubscriptionsParams::Include::TaggedSymbol + ] + ) + end + def self.values + end end end end diff --git a/rbi/knockapi/models/user_merge_params.rbi b/rbi/knockapi/models/user_merge_params.rbi index 111c09ea..68455a12 100644 --- a/rbi/knockapi/models/user_merge_params.rbi +++ b/rbi/knockapi/models/user_merge_params.rbi @@ -6,6 +6,11 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any(Knockapi::UserMergeParams, Knockapi::Internal::AnyHash) + end + # The user ID to merge from. sig { returns(String) } attr_accessor :from_user_id @@ -13,17 +18,23 @@ module Knockapi sig do params( from_user_id: String, - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # The user ID to merge from. from_user_id:, request_options: {} - ); end - sig { override.returns({from_user_id: String, request_options: Knockapi::RequestOptions}) } - def to_hash; end + ) + end + + sig do + override.returns( + { from_user_id: String, request_options: Knockapi::RequestOptions } + ) + end + def to_hash + end end end end diff --git a/rbi/knockapi/models/user_set_channel_data_params.rbi b/rbi/knockapi/models/user_set_channel_data_params.rbi index 605dfdeb..8fe16eca 100644 --- a/rbi/knockapi/models/user_set_channel_data_params.rbi +++ b/rbi/knockapi/models/user_set_channel_data_params.rbi @@ -6,14 +6,22 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any(Knockapi::UserSetChannelDataParams, Knockapi::Internal::AnyHash) + end + sig do - params(request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash)) - .returns(T.attached_class) + params(request_options: Knockapi::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) end - def self.new(request_options: {}); end - sig { override.returns({request_options: Knockapi::RequestOptions}) } - def to_hash; end + sig { override.returns({ request_options: Knockapi::RequestOptions }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/user_set_preferences_params.rbi b/rbi/knockapi/models/user_set_preferences_params.rbi index 6c79c5b7..7230bfc6 100644 --- a/rbi/knockapi/models/user_set_preferences_params.rbi +++ b/rbi/knockapi/models/user_set_preferences_params.rbi @@ -6,14 +6,22 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any(Knockapi::UserSetPreferencesParams, Knockapi::Internal::AnyHash) + end + sig do - params(request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash)) - .returns(T.attached_class) + params(request_options: Knockapi::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) end - def self.new(request_options: {}); end - sig { override.returns({request_options: Knockapi::RequestOptions}) } - def to_hash; end + sig { override.returns({ request_options: Knockapi::RequestOptions }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/user_unset_channel_data_params.rbi b/rbi/knockapi/models/user_unset_channel_data_params.rbi index aa757bdb..0a51ba07 100644 --- a/rbi/knockapi/models/user_unset_channel_data_params.rbi +++ b/rbi/knockapi/models/user_unset_channel_data_params.rbi @@ -6,14 +6,25 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::UserUnsetChannelDataParams, + Knockapi::Internal::AnyHash + ) + end + sig do - params(request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash)) - .returns(T.attached_class) + params(request_options: Knockapi::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) end - def self.new(request_options: {}); end - sig { override.returns({request_options: Knockapi::RequestOptions}) } - def to_hash; end + sig { override.returns({ request_options: Knockapi::RequestOptions }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/user_unset_channel_data_response.rbi b/rbi/knockapi/models/user_unset_channel_data_response.rbi new file mode 100644 index 00000000..f0837099 --- /dev/null +++ b/rbi/knockapi/models/user_unset_channel_data_response.rbi @@ -0,0 +1,7 @@ +# typed: strong + +module Knockapi + module Models + UserUnsetChannelDataResponse = String + end +end diff --git a/rbi/knockapi/models/user_update_params.rbi b/rbi/knockapi/models/user_update_params.rbi index 1f64bc8e..af785228 100644 --- a/rbi/knockapi/models/user_update_params.rbi +++ b/rbi/knockapi/models/user_update_params.rbi @@ -6,14 +6,22 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any(Knockapi::UserUpdateParams, Knockapi::Internal::AnyHash) + end + sig do - params(request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash)) - .returns(T.attached_class) + params(request_options: Knockapi::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) end - def self.new(request_options: {}); end - sig { override.returns({request_options: Knockapi::RequestOptions}) } - def to_hash; end + sig { override.returns({ request_options: Knockapi::RequestOptions }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/users/bulk_delete_params.rbi b/rbi/knockapi/models/users/bulk_delete_params.rbi index 442ebbd9..8dcb6fbb 100644 --- a/rbi/knockapi/models/users/bulk_delete_params.rbi +++ b/rbi/knockapi/models/users/bulk_delete_params.rbi @@ -7,6 +7,14 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::Users::BulkDeleteParams, + Knockapi::Internal::AnyHash + ) + end + # A list of user IDs. sig { returns(T::Array[String]) } attr_accessor :user_ids @@ -14,17 +22,26 @@ module Knockapi sig do params( user_ids: T::Array[String], - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # A list of user IDs. user_ids:, request_options: {} - ); end - sig { override.returns({user_ids: T::Array[String], request_options: Knockapi::RequestOptions}) } - def to_hash; end + ) + end + + sig do + override.returns( + { + user_ids: T::Array[String], + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash + end end end end diff --git a/rbi/knockapi/models/users/bulk_identify_params.rbi b/rbi/knockapi/models/users/bulk_identify_params.rbi index 1958006c..3dacd705 100644 --- a/rbi/knockapi/models/users/bulk_identify_params.rbi +++ b/rbi/knockapi/models/users/bulk_identify_params.rbi @@ -7,29 +7,41 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::Users::BulkIdentifyParams, + Knockapi::Internal::AnyHash + ) + end + # A list of users. - sig { returns(T::Array[Knockapi::Models::InlineIdentifyUserRequest]) } + sig { returns(T::Array[Knockapi::InlineIdentifyUserRequest]) } attr_accessor :users sig do params( - users: T::Array[T.any(Knockapi::Models::InlineIdentifyUserRequest, Knockapi::Internal::AnyHash)], - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + users: T::Array[Knockapi::InlineIdentifyUserRequest::OrHash], + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # A list of users. users:, request_options: {} - ); end + ) + end + sig do - override - .returns( - {users: T::Array[Knockapi::Models::InlineIdentifyUserRequest], request_options: Knockapi::RequestOptions} - ) + override.returns( + { + users: T::Array[Knockapi::InlineIdentifyUserRequest], + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/users/bulk_set_preferences_params.rbi b/rbi/knockapi/models/users/bulk_set_preferences_params.rbi index 78edb734..5e07832c 100644 --- a/rbi/knockapi/models/users/bulk_set_preferences_params.rbi +++ b/rbi/knockapi/models/users/bulk_set_preferences_params.rbi @@ -7,15 +7,22 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::Users::BulkSetPreferencesParams, + Knockapi::Internal::AnyHash + ) + end + # A request to set a preference set for a recipient. - sig { returns(Knockapi::Models::Recipients::PreferenceSetRequest) } + sig { returns(Knockapi::Recipients::PreferenceSetRequest) } attr_reader :preferences sig do params( - preferences: T.any(Knockapi::Models::Recipients::PreferenceSetRequest, Knockapi::Internal::AnyHash) - ) - .void + preferences: Knockapi::Recipients::PreferenceSetRequest::OrHash + ).void end attr_writer :preferences @@ -25,11 +32,10 @@ module Knockapi sig do params( - preferences: T.any(Knockapi::Models::Recipients::PreferenceSetRequest, Knockapi::Internal::AnyHash), + preferences: Knockapi::Recipients::PreferenceSetRequest::OrHash, user_ids: T::Array[String], - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # A request to set a preference set for a recipient. @@ -37,18 +43,20 @@ module Knockapi # A list of user IDs. user_ids:, request_options: {} - ); end + ) + end + sig do - override - .returns( - { - preferences: Knockapi::Models::Recipients::PreferenceSetRequest, - user_ids: T::Array[String], - request_options: Knockapi::RequestOptions - } - ) + override.returns( + { + preferences: Knockapi::Recipients::PreferenceSetRequest, + user_ids: T::Array[String], + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/users/feed_get_settings_params.rbi b/rbi/knockapi/models/users/feed_get_settings_params.rbi index c6436daf..dc849b8e 100644 --- a/rbi/knockapi/models/users/feed_get_settings_params.rbi +++ b/rbi/knockapi/models/users/feed_get_settings_params.rbi @@ -7,14 +7,25 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::Users::FeedGetSettingsParams, + Knockapi::Internal::AnyHash + ) + end + sig do - params(request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash)) - .returns(T.attached_class) + params(request_options: Knockapi::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) end - def self.new(request_options: {}); end - sig { override.returns({request_options: Knockapi::RequestOptions}) } - def to_hash; end + sig { override.returns({ request_options: Knockapi::RequestOptions }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/users/feed_get_settings_response.rbi b/rbi/knockapi/models/users/feed_get_settings_response.rbi index 37a256f2..2eba7e29 100644 --- a/rbi/knockapi/models/users/feed_get_settings_response.rbi +++ b/rbi/knockapi/models/users/feed_get_settings_response.rbi @@ -4,45 +4,78 @@ module Knockapi module Models module Users class FeedGetSettingsResponse < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::Users::FeedGetSettingsResponse, + Knockapi::Internal::AnyHash + ) + end + # Features configuration for the user's feed. - sig { returns(Knockapi::Models::Users::FeedGetSettingsResponse::Features) } + sig do + returns(Knockapi::Models::Users::FeedGetSettingsResponse::Features) + end attr_reader :features sig do params( - features: T.any(Knockapi::Models::Users::FeedGetSettingsResponse::Features, Knockapi::Internal::AnyHash) - ) - .void + features: + Knockapi::Models::Users::FeedGetSettingsResponse::Features::OrHash + ).void end attr_writer :features # The response for the user's feed settings. sig do params( - features: T.any(Knockapi::Models::Users::FeedGetSettingsResponse::Features, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + features: + Knockapi::Models::Users::FeedGetSettingsResponse::Features::OrHash + ).returns(T.attached_class) end def self.new( # Features configuration for the user's feed. features: - ); end - sig { override.returns({features: Knockapi::Models::Users::FeedGetSettingsResponse::Features}) } - def to_hash; end + ) + end + + sig do + override.returns( + { + features: + Knockapi::Models::Users::FeedGetSettingsResponse::Features + } + ) + end + def to_hash + end class Features < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::Users::FeedGetSettingsResponse::Features, + Knockapi::Internal::AnyHash + ) + end + # Whether branding is required for the user's feed. sig { returns(T::Boolean) } attr_accessor :branding_required # Features configuration for the user's feed. - sig { params(branding_required: T::Boolean).returns(T.attached_class) } + sig do + params(branding_required: T::Boolean).returns(T.attached_class) + end def self.new( # Whether branding is required for the user's feed. branding_required: - ); end - sig { override.returns({branding_required: T::Boolean}) } - def to_hash; end + ) + end + + sig { override.returns({ branding_required: T::Boolean }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/users/feed_list_items_params.rbi b/rbi/knockapi/models/users/feed_list_items_params.rbi index cc94b53d..d4ea73a9 100644 --- a/rbi/knockapi/models/users/feed_list_items_params.rbi +++ b/rbi/knockapi/models/users/feed_list_items_params.rbi @@ -7,6 +7,14 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::Users::FeedListItemsParams, + Knockapi::Internal::AnyHash + ) + end + # The cursor to fetch entries after. sig { returns(T.nilable(String)) } attr_reader :after @@ -15,10 +23,18 @@ module Knockapi attr_writer :after # The archived status of the feed items. - sig { returns(T.nilable(Knockapi::Models::Users::FeedListItemsParams::Archived::OrSymbol)) } + sig do + returns( + T.nilable(Knockapi::Users::FeedListItemsParams::Archived::OrSymbol) + ) + end attr_reader :archived - sig { params(archived: Knockapi::Models::Users::FeedListItemsParams::Archived::OrSymbol).void } + sig do + params( + archived: Knockapi::Users::FeedListItemsParams::Archived::OrSymbol + ).void + end attr_writer :archived # The cursor to fetch entries before. @@ -50,10 +66,18 @@ module Knockapi attr_writer :source # The status of the feed items. - sig { returns(T.nilable(Knockapi::Models::Users::FeedListItemsParams::Status::OrSymbol)) } + sig do + returns( + T.nilable(Knockapi::Users::FeedListItemsParams::Status::OrSymbol) + ) + end attr_reader :status - sig { params(status: Knockapi::Models::Users::FeedListItemsParams::Status::OrSymbol).void } + sig do + params( + status: Knockapi::Users::FeedListItemsParams::Status::OrSymbol + ).void + end attr_writer :status # The tenant associated with the feed items. @@ -80,18 +104,17 @@ module Knockapi sig do params( after: String, - archived: Knockapi::Models::Users::FeedListItemsParams::Archived::OrSymbol, + archived: Knockapi::Users::FeedListItemsParams::Archived::OrSymbol, before: String, has_tenant: T::Boolean, page_size: Integer, source: String, - status: Knockapi::Models::Users::FeedListItemsParams::Status::OrSymbol, + status: Knockapi::Users::FeedListItemsParams::Status::OrSymbol, tenant: String, trigger_data: String, workflow_categories: T::Array[String], - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # The cursor to fetch entries after. @@ -115,57 +138,112 @@ module Knockapi # The workflow categories of the feed items. workflow_categories: nil, request_options: {} - ); end + ) + end + sig do - override - .returns( - { - after: String, - archived: Knockapi::Models::Users::FeedListItemsParams::Archived::OrSymbol, - before: String, - has_tenant: T::Boolean, - page_size: Integer, - source: String, - status: Knockapi::Models::Users::FeedListItemsParams::Status::OrSymbol, - tenant: String, - trigger_data: String, - workflow_categories: T::Array[String], - request_options: Knockapi::RequestOptions - } - ) + override.returns( + { + after: String, + archived: + Knockapi::Users::FeedListItemsParams::Archived::OrSymbol, + before: String, + has_tenant: T::Boolean, + page_size: Integer, + source: String, + status: Knockapi::Users::FeedListItemsParams::Status::OrSymbol, + tenant: String, + trigger_data: String, + workflow_categories: T::Array[String], + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end # The archived status of the feed items. module Archived extend Knockapi::Internal::Type::Enum - TaggedSymbol = T.type_alias { T.all(Symbol, Knockapi::Models::Users::FeedListItemsParams::Archived) } + TaggedSymbol = + T.type_alias do + T.all(Symbol, Knockapi::Users::FeedListItemsParams::Archived) + end OrSymbol = T.type_alias { T.any(Symbol, String) } - EXCLUDE = T.let(:exclude, Knockapi::Models::Users::FeedListItemsParams::Archived::TaggedSymbol) - INCLUDE = T.let(:include, Knockapi::Models::Users::FeedListItemsParams::Archived::TaggedSymbol) - ONLY = T.let(:only, Knockapi::Models::Users::FeedListItemsParams::Archived::TaggedSymbol) + EXCLUDE = + T.let( + :exclude, + Knockapi::Users::FeedListItemsParams::Archived::TaggedSymbol + ) + INCLUDE = + T.let( + :include, + Knockapi::Users::FeedListItemsParams::Archived::TaggedSymbol + ) + ONLY = + T.let( + :only, + Knockapi::Users::FeedListItemsParams::Archived::TaggedSymbol + ) - sig { override.returns(T::Array[Knockapi::Models::Users::FeedListItemsParams::Archived::TaggedSymbol]) } - def self.values; end + sig do + override.returns( + T::Array[ + Knockapi::Users::FeedListItemsParams::Archived::TaggedSymbol + ] + ) + end + def self.values + end end # The status of the feed items. module Status extend Knockapi::Internal::Type::Enum - TaggedSymbol = T.type_alias { T.all(Symbol, Knockapi::Models::Users::FeedListItemsParams::Status) } + TaggedSymbol = + T.type_alias do + T.all(Symbol, Knockapi::Users::FeedListItemsParams::Status) + end OrSymbol = T.type_alias { T.any(Symbol, String) } - UNREAD = T.let(:unread, Knockapi::Models::Users::FeedListItemsParams::Status::TaggedSymbol) - READ = T.let(:read, Knockapi::Models::Users::FeedListItemsParams::Status::TaggedSymbol) - UNSEEN = T.let(:unseen, Knockapi::Models::Users::FeedListItemsParams::Status::TaggedSymbol) - SEEN = T.let(:seen, Knockapi::Models::Users::FeedListItemsParams::Status::TaggedSymbol) - ALL = T.let(:all, Knockapi::Models::Users::FeedListItemsParams::Status::TaggedSymbol) + UNREAD = + T.let( + :unread, + Knockapi::Users::FeedListItemsParams::Status::TaggedSymbol + ) + READ = + T.let( + :read, + Knockapi::Users::FeedListItemsParams::Status::TaggedSymbol + ) + UNSEEN = + T.let( + :unseen, + Knockapi::Users::FeedListItemsParams::Status::TaggedSymbol + ) + SEEN = + T.let( + :seen, + Knockapi::Users::FeedListItemsParams::Status::TaggedSymbol + ) + ALL = + T.let( + :all, + Knockapi::Users::FeedListItemsParams::Status::TaggedSymbol + ) - sig { override.returns(T::Array[Knockapi::Models::Users::FeedListItemsParams::Status::TaggedSymbol]) } - def self.values; end + sig do + override.returns( + T::Array[ + Knockapi::Users::FeedListItemsParams::Status::TaggedSymbol + ] + ) + end + def self.values + end end end end diff --git a/rbi/knockapi/models/users/feed_list_items_response.rbi b/rbi/knockapi/models/users/feed_list_items_response.rbi index 0ec4b4ae..ded6779a 100644 --- a/rbi/knockapi/models/users/feed_list_items_response.rbi +++ b/rbi/knockapi/models/users/feed_list_items_response.rbi @@ -4,6 +4,14 @@ module Knockapi module Models module Users class FeedListItemsResponse < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::Users::FeedListItemsResponse, + Knockapi::Internal::AnyHash + ) + end + # Unique identifier for the feed. sig { returns(String) } attr_accessor :id @@ -13,11 +21,11 @@ module Knockapi attr_accessor :_typename # List of activities associated with this feed item. - sig { returns(T::Array[Knockapi::Models::Activity]) } + sig { returns(T::Array[Knockapi::Activity]) } attr_accessor :activities # List of actors associated with this feed item. - sig { returns(T::Array[T.any(Knockapi::Models::User, Knockapi::Models::Object)]) } + sig { returns(T::Array[T.any(Knockapi::User, Knockapi::Object)]) } attr_accessor :actors # Content blocks that make up the feed item. @@ -46,8 +54,10 @@ module Knockapi attr_reader :source sig do - params(source: T.any(Knockapi::Models::Users::FeedListItemsResponse::Source, Knockapi::Internal::AnyHash)) - .void + params( + source: + Knockapi::Models::Users::FeedListItemsResponse::Source::OrHash + ).void end attr_writer :source @@ -96,18 +106,20 @@ module Knockapi params( id: String, _typename: String, - activities: T::Array[T.any(Knockapi::Models::Activity, Knockapi::Internal::AnyHash)], - actors: T::Array[T.any(Knockapi::Models::User, Knockapi::Internal::AnyHash, Knockapi::Models::Object)], - blocks: T::Array[ - T.any( - Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedContentBlock, - Knockapi::Internal::AnyHash, - Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedButtonSetBlock - ) - ], + activities: T::Array[Knockapi::Activity::OrHash], + actors: + T::Array[T.any(Knockapi::User::OrHash, Knockapi::Object::OrHash)], + blocks: + T::Array[ + T.any( + Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedContentBlock::OrHash, + Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedButtonSetBlock::OrHash + ) + ], data: T.nilable(T::Hash[Symbol, T.anything]), inserted_at: String, - source: T.any(Knockapi::Models::Users::FeedListItemsResponse::Source, Knockapi::Internal::AnyHash), + source: + Knockapi::Models::Users::FeedListItemsResponse::Source::OrHash, tenant: T.nilable(String), total_activities: Integer, total_actors: Integer, @@ -118,8 +130,7 @@ module Knockapi link_clicked_at: T.nilable(String), read_at: T.nilable(String), seen_at: T.nilable(String) - ) - .returns(T.attached_class) + ).returns(T.attached_class) end def self.new( # Unique identifier for the feed. @@ -158,44 +169,63 @@ module Knockapi read_at: nil, # Timestamp when the feed item was marked as seen. seen_at: nil - ); end + ) + end + sig do - override - .returns( - { - id: String, - _typename: String, - activities: T::Array[Knockapi::Models::Activity], - actors: T::Array[T.any(Knockapi::Models::User, Knockapi::Models::Object)], - blocks: T::Array[ + override.returns( + { + id: String, + _typename: String, + activities: T::Array[Knockapi::Activity], + actors: T::Array[T.any(Knockapi::User, Knockapi::Object)], + blocks: + T::Array[ T.any( Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedContentBlock, Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedButtonSetBlock ) ], - data: T.nilable(T::Hash[Symbol, T.anything]), - inserted_at: String, - source: Knockapi::Models::Users::FeedListItemsResponse::Source, - tenant: T.nilable(String), - total_activities: Integer, - total_actors: Integer, - updated_at: String, - archived_at: T.nilable(String), - clicked_at: T.nilable(String), - interacted_at: T.nilable(String), - link_clicked_at: T.nilable(String), - read_at: T.nilable(String), - seen_at: T.nilable(String) - } - ) + data: T.nilable(T::Hash[Symbol, T.anything]), + inserted_at: String, + source: Knockapi::Models::Users::FeedListItemsResponse::Source, + tenant: T.nilable(String), + total_activities: Integer, + total_actors: Integer, + updated_at: String, + archived_at: T.nilable(String), + clicked_at: T.nilable(String), + interacted_at: T.nilable(String), + link_clicked_at: T.nilable(String), + read_at: T.nilable(String), + seen_at: T.nilable(String) + } + ) + end + def to_hash end - def to_hash; end # A content block for the feed, can be content or a button set. module Block extend Knockapi::Internal::Type::Union + Variants = + T.type_alias do + T.any( + Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedContentBlock, + Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedButtonSetBlock + ) + end + class MessageInAppFeedContentBlock < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedContentBlock, + Knockapi::Internal::AnyHash + ) + end + # The content of the block in a message in an app feed. sig { returns(String) } attr_accessor :content @@ -222,9 +252,9 @@ module Knockapi content: String, name: String, rendered: String, - type: Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedContentBlock::Type::OrSymbol - ) - .returns(T.attached_class) + type: + Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedContentBlock::Type::OrSymbol + ).returns(T.attached_class) end def self.new( # The content of the block in a message in an app feed. @@ -235,26 +265,34 @@ module Knockapi rendered:, # The type of block in a message in an app feed. type: - ); end + ) + end + sig do - override - .returns( - { - content: String, - name: String, - rendered: String, - type: Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedContentBlock::Type::TaggedSymbol - } - ) + override.returns( + { + content: String, + name: String, + rendered: String, + type: + Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedContentBlock::Type::TaggedSymbol + } + ) + end + def to_hash end - def to_hash; end # The type of block in a message in an app feed. module Type extend Knockapi::Internal::Type::Enum TaggedSymbol = - T.type_alias { T.all(Symbol, Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedContentBlock::Type) } + T.type_alias do + T.all( + Symbol, + Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedContentBlock::Type + ) + end OrSymbol = T.type_alias { T.any(Symbol, String) } MARKDOWN = @@ -269,20 +307,32 @@ module Knockapi ) sig do - override - .returns( - T::Array[Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedContentBlock::Type::TaggedSymbol] - ) + override.returns( + T::Array[ + Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedContentBlock::Type::TaggedSymbol + ] + ) + end + def self.values end - def self.values; end end end class MessageInAppFeedButtonSetBlock < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedButtonSetBlock, + Knockapi::Internal::AnyHash + ) + end + # A list of buttons in an in app feed message. sig do returns( - T::Array[Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedButtonSetBlock::Button] + T::Array[ + Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedButtonSetBlock::Button + ] ) end attr_accessor :buttons @@ -302,16 +352,14 @@ module Knockapi # A button set block in a message in an app feed. sig do params( - buttons: T::Array[ - T.any( - Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedButtonSetBlock::Button, - Knockapi::Internal::AnyHash - ) - ], + buttons: + T::Array[ + Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedButtonSetBlock::Button::OrHash + ], name: String, - type: Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedButtonSetBlock::Type::OrSymbol - ) - .returns(T.attached_class) + type: + Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedButtonSetBlock::Type::OrSymbol + ).returns(T.attached_class) end def self.new( # A list of buttons in an in app feed message. @@ -320,20 +368,34 @@ module Knockapi name:, # The type of block in a message in an app feed. type: - ); end + ) + end + sig do - override - .returns( - { - buttons: T::Array[Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedButtonSetBlock::Button], - name: String, - type: Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedButtonSetBlock::Type::TaggedSymbol - } - ) + override.returns( + { + buttons: + T::Array[ + Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedButtonSetBlock::Button + ], + name: String, + type: + Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedButtonSetBlock::Type::TaggedSymbol + } + ) + end + def to_hash end - def to_hash; end class Button < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedButtonSetBlock::Button, + Knockapi::Internal::AnyHash + ) + end + # The action to take when the button is clicked. sig { returns(String) } attr_accessor :action @@ -347,7 +409,11 @@ module Knockapi attr_accessor :name # A button in an in app feed message. - sig { params(action: String, label: String, name: String).returns(T.attached_class) } + sig do + params(action: String, label: String, name: String).returns( + T.attached_class + ) + end def self.new( # The action to take when the button is clicked. action:, @@ -355,9 +421,16 @@ module Knockapi label:, # The name of the button. name: - ); end - sig { override.returns({action: String, label: String, name: String}) } - def to_hash; end + ) + end + + sig do + override.returns( + { action: String, label: String, name: String } + ) + end + def to_hash + end end # The type of block in a message in an app feed. @@ -365,7 +438,12 @@ module Knockapi extend Knockapi::Internal::Type::Enum TaggedSymbol = - T.type_alias { T.all(Symbol, Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedButtonSetBlock::Type) } + T.type_alias do + T.all( + Symbol, + Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedButtonSetBlock::Type + ) + end OrSymbol = T.type_alias { T.any(Symbol, String) } BUTTON_SET = @@ -375,25 +453,37 @@ module Knockapi ) sig do - override - .returns( - T::Array[Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedButtonSetBlock::Type::TaggedSymbol] - ) + override.returns( + T::Array[ + Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedButtonSetBlock::Type::TaggedSymbol + ] + ) + end + def self.values end - def self.values; end end end sig do - override - .returns( - [Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedContentBlock, Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedButtonSetBlock] - ) + override.returns( + T::Array[ + Knockapi::Models::Users::FeedListItemsResponse::Block::Variants + ] + ) + end + def self.variants end - def self.variants; end end class Source < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::Users::FeedListItemsResponse::Source, + Knockapi::Internal::AnyHash + ) + end + # The typename of the schema. sig { returns(String) } attr_accessor :_typename @@ -412,8 +502,12 @@ module Knockapi # Source information for the feed item. sig do - params(_typename: String, categories: T::Array[String], key: String, version_id: String) - .returns(T.attached_class) + params( + _typename: String, + categories: T::Array[String], + key: String, + version_id: String + ).returns(T.attached_class) end def self.new( # The typename of the schema. @@ -424,7 +518,9 @@ module Knockapi key:, # The workflow version ID. version_id: - ); end + ) + end + sig do override.returns( { @@ -435,7 +531,8 @@ module Knockapi } ) end - def to_hash; end + def to_hash + end end end end diff --git a/rbi/knockapi/models/users/guide_get_channel_params.rbi b/rbi/knockapi/models/users/guide_get_channel_params.rbi index 3886bfae..d1e4de86 100644 --- a/rbi/knockapi/models/users/guide_get_channel_params.rbi +++ b/rbi/knockapi/models/users/guide_get_channel_params.rbi @@ -7,6 +7,14 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::Users::GuideGetChannelParams, + Knockapi::Internal::AnyHash + ) + end + # The data (JSON encoded object) to use for targeting and rendering guides. sig { returns(T.nilable(String)) } attr_reader :data @@ -33,9 +41,8 @@ module Knockapi data: String, tenant: String, type: String, - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # The data (JSON encoded object) to use for targeting and rendering guides. @@ -45,7 +52,9 @@ module Knockapi # The type of guides to filter by. type: nil, request_options: {} - ); end + ) + end + sig do override.returns( { @@ -56,7 +65,8 @@ module Knockapi } ) end - def to_hash; end + def to_hash + end end end end diff --git a/rbi/knockapi/models/users/guide_get_channel_response.rbi b/rbi/knockapi/models/users/guide_get_channel_response.rbi index 026106b7..c9938085 100644 --- a/rbi/knockapi/models/users/guide_get_channel_response.rbi +++ b/rbi/knockapi/models/users/guide_get_channel_response.rbi @@ -4,48 +4,89 @@ module Knockapi module Models module Users class GuideGetChannelResponse < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::Users::GuideGetChannelResponse, + Knockapi::Internal::AnyHash + ) + end + # A list of guides. - sig { returns(T::Array[Knockapi::Models::Users::GuideGetChannelResponse::Guide]) } + sig do + returns( + T::Array[Knockapi::Models::Users::GuideGetChannelResponse::Guide] + ) + end attr_accessor :guides # The recipient of the guide. - sig { returns(T.nilable(Knockapi::Models::Users::GuideGetChannelResponse::Recipient)) } + sig do + returns( + T.nilable( + Knockapi::Models::Users::GuideGetChannelResponse::Recipient + ) + ) + end attr_reader :recipient sig do params( - recipient: T.nilable(T.any(Knockapi::Models::Users::GuideGetChannelResponse::Recipient, Knockapi::Internal::AnyHash)) - ) - .void + recipient: + T.nilable( + Knockapi::Models::Users::GuideGetChannelResponse::Recipient::OrHash + ) + ).void end attr_writer :recipient # A response for a list of guides. sig do params( - guides: T::Array[T.any(Knockapi::Models::Users::GuideGetChannelResponse::Guide, Knockapi::Internal::AnyHash)], - recipient: T.nilable(T.any(Knockapi::Models::Users::GuideGetChannelResponse::Recipient, Knockapi::Internal::AnyHash)) - ) - .returns(T.attached_class) + guides: + T::Array[ + Knockapi::Models::Users::GuideGetChannelResponse::Guide::OrHash + ], + recipient: + T.nilable( + Knockapi::Models::Users::GuideGetChannelResponse::Recipient::OrHash + ) + ).returns(T.attached_class) end def self.new( # A list of guides. guides:, # The recipient of the guide. recipient: nil - ); end + ) + end + sig do - override - .returns( - { - guides: T::Array[Knockapi::Models::Users::GuideGetChannelResponse::Guide], - recipient: T.nilable(Knockapi::Models::Users::GuideGetChannelResponse::Recipient) - } - ) + override.returns( + { + guides: + T::Array[ + Knockapi::Models::Users::GuideGetChannelResponse::Guide + ], + recipient: + T.nilable( + Knockapi::Models::Users::GuideGetChannelResponse::Recipient + ) + } + ) + end + def to_hash end - def to_hash; end class Guide < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::Users::GuideGetChannelResponse::Guide, + Knockapi::Internal::AnyHash + ) + end + # The unique identifier for the guide. sig { returns(T.nilable(String)) } attr_reader :id @@ -75,8 +116,12 @@ module Knockapi attr_writer :title sig do - params(id: String, content: String, metadata: T::Hash[Symbol, T.anything], title: String) - .returns(T.attached_class) + params( + id: String, + content: String, + metadata: T::Hash[Symbol, T.anything], + title: String + ).returns(T.attached_class) end def self.new( # The unique identifier for the guide. @@ -87,7 +132,9 @@ module Knockapi metadata: nil, # The title of the guide. title: nil - ); end + ) + end + sig do override.returns( { @@ -98,10 +145,19 @@ module Knockapi } ) end - def to_hash; end + def to_hash + end end class Recipient < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::Users::GuideGetChannelResponse::Recipient, + Knockapi::Internal::AnyHash + ) + end + # Unique identifier for the recipient. sig { returns(T.nilable(String)) } attr_reader :id @@ -114,9 +170,12 @@ module Knockapi def self.new( # Unique identifier for the recipient. id: nil - ); end - sig { override.returns({id: String}) } - def to_hash; end + ) + end + + sig { override.returns({ id: String }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/users/guide_mark_message_as_archived_params.rbi b/rbi/knockapi/models/users/guide_mark_message_as_archived_params.rbi index ee82041a..cc93948b 100644 --- a/rbi/knockapi/models/users/guide_mark_message_as_archived_params.rbi +++ b/rbi/knockapi/models/users/guide_mark_message_as_archived_params.rbi @@ -7,6 +7,14 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::Users::GuideMarkMessageAsArchivedParams, + Knockapi::Internal::AnyHash + ) + end + # The unique identifier for the channel. sig { returns(String) } attr_accessor :channel_id @@ -66,9 +74,8 @@ module Knockapi is_final: T::Boolean, metadata: T::Hash[Symbol, T.anything], tenant: T.nilable(String), - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # The unique identifier for the channel. @@ -90,25 +97,27 @@ module Knockapi # The tenant ID of the guide. tenant: nil, request_options: {} - ); end + ) + end + sig do - override - .returns( - { - channel_id: String, - guide_id: String, - guide_key: String, - guide_step_ref: String, - content: T::Hash[Symbol, T.anything], - data: T::Hash[Symbol, T.anything], - is_final: T::Boolean, - metadata: T::Hash[Symbol, T.anything], - tenant: T.nilable(String), - request_options: Knockapi::RequestOptions - } - ) + override.returns( + { + channel_id: String, + guide_id: String, + guide_key: String, + guide_step_ref: String, + content: T::Hash[Symbol, T.anything], + data: T::Hash[Symbol, T.anything], + is_final: T::Boolean, + metadata: T::Hash[Symbol, T.anything], + tenant: T.nilable(String), + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/users/guide_mark_message_as_archived_response.rbi b/rbi/knockapi/models/users/guide_mark_message_as_archived_response.rbi index af9b2c3f..3c784e64 100644 --- a/rbi/knockapi/models/users/guide_mark_message_as_archived_response.rbi +++ b/rbi/knockapi/models/users/guide_mark_message_as_archived_response.rbi @@ -4,6 +4,14 @@ module Knockapi module Models module Users class GuideMarkMessageAsArchivedResponse < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::Users::GuideMarkMessageAsArchivedResponse, + Knockapi::Internal::AnyHash + ) + end + # The status of a guide's action. sig { returns(String) } attr_accessor :status @@ -13,9 +21,12 @@ module Knockapi def self.new( # The status of a guide's action. status: - ); end - sig { override.returns({status: String}) } - def to_hash; end + ) + end + + sig { override.returns({ status: String }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/users/guide_mark_message_as_interacted_params.rbi b/rbi/knockapi/models/users/guide_mark_message_as_interacted_params.rbi index ad72f947..9dafcf8b 100644 --- a/rbi/knockapi/models/users/guide_mark_message_as_interacted_params.rbi +++ b/rbi/knockapi/models/users/guide_mark_message_as_interacted_params.rbi @@ -7,6 +7,14 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::Users::GuideMarkMessageAsInteractedParams, + Knockapi::Internal::AnyHash + ) + end + # The unique identifier for the channel. sig { returns(String) } attr_accessor :channel_id @@ -66,9 +74,8 @@ module Knockapi is_final: T::Boolean, metadata: T::Hash[Symbol, T.anything], tenant: T.nilable(String), - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # The unique identifier for the channel. @@ -90,25 +97,27 @@ module Knockapi # The tenant ID of the guide. tenant: nil, request_options: {} - ); end + ) + end + sig do - override - .returns( - { - channel_id: String, - guide_id: String, - guide_key: String, - guide_step_ref: String, - content: T::Hash[Symbol, T.anything], - data: T::Hash[Symbol, T.anything], - is_final: T::Boolean, - metadata: T::Hash[Symbol, T.anything], - tenant: T.nilable(String), - request_options: Knockapi::RequestOptions - } - ) + override.returns( + { + channel_id: String, + guide_id: String, + guide_key: String, + guide_step_ref: String, + content: T::Hash[Symbol, T.anything], + data: T::Hash[Symbol, T.anything], + is_final: T::Boolean, + metadata: T::Hash[Symbol, T.anything], + tenant: T.nilable(String), + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/users/guide_mark_message_as_interacted_response.rbi b/rbi/knockapi/models/users/guide_mark_message_as_interacted_response.rbi index c8fdbb25..6472afaf 100644 --- a/rbi/knockapi/models/users/guide_mark_message_as_interacted_response.rbi +++ b/rbi/knockapi/models/users/guide_mark_message_as_interacted_response.rbi @@ -4,6 +4,14 @@ module Knockapi module Models module Users class GuideMarkMessageAsInteractedResponse < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::Users::GuideMarkMessageAsInteractedResponse, + Knockapi::Internal::AnyHash + ) + end + # The status of a guide's action. sig { returns(String) } attr_accessor :status @@ -13,9 +21,12 @@ module Knockapi def self.new( # The status of a guide's action. status: - ); end - sig { override.returns({status: String}) } - def to_hash; end + ) + end + + sig { override.returns({ status: String }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/users/guide_mark_message_as_seen_params.rbi b/rbi/knockapi/models/users/guide_mark_message_as_seen_params.rbi index 1bab7481..d88dee98 100644 --- a/rbi/knockapi/models/users/guide_mark_message_as_seen_params.rbi +++ b/rbi/knockapi/models/users/guide_mark_message_as_seen_params.rbi @@ -7,6 +7,14 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any( + Knockapi::Users::GuideMarkMessageAsSeenParams, + Knockapi::Internal::AnyHash + ) + end + # The unique identifier for the channel. sig { returns(String) } attr_accessor :channel_id @@ -66,9 +74,8 @@ module Knockapi is_final: T::Boolean, metadata: T::Hash[Symbol, T.anything], tenant: T.nilable(String), - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # The unique identifier for the channel. @@ -90,25 +97,27 @@ module Knockapi # The tenant ID of the guide. tenant: nil, request_options: {} - ); end + ) + end + sig do - override - .returns( - { - channel_id: String, - guide_id: String, - guide_key: String, - guide_step_ref: String, - content: T::Hash[Symbol, T.anything], - data: T::Hash[Symbol, T.anything], - is_final: T::Boolean, - metadata: T::Hash[Symbol, T.anything], - tenant: T.nilable(String), - request_options: Knockapi::RequestOptions - } - ) + override.returns( + { + channel_id: String, + guide_id: String, + guide_key: String, + guide_step_ref: String, + content: T::Hash[Symbol, T.anything], + data: T::Hash[Symbol, T.anything], + is_final: T::Boolean, + metadata: T::Hash[Symbol, T.anything], + tenant: T.nilable(String), + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/users/guide_mark_message_as_seen_response.rbi b/rbi/knockapi/models/users/guide_mark_message_as_seen_response.rbi index fd44f8c4..f2d00fe9 100644 --- a/rbi/knockapi/models/users/guide_mark_message_as_seen_response.rbi +++ b/rbi/knockapi/models/users/guide_mark_message_as_seen_response.rbi @@ -4,6 +4,14 @@ module Knockapi module Models module Users class GuideMarkMessageAsSeenResponse < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::Users::GuideMarkMessageAsSeenResponse, + Knockapi::Internal::AnyHash + ) + end + # The status of a guide's action. sig { returns(String) } attr_accessor :status @@ -13,9 +21,12 @@ module Knockapi def self.new( # The status of a guide's action. status: - ); end - sig { override.returns({status: String}) } - def to_hash; end + ) + end + + sig { override.returns({ status: String }) } + def to_hash + end end end end diff --git a/rbi/knockapi/models/workflow_cancel_params.rbi b/rbi/knockapi/models/workflow_cancel_params.rbi index c64666ba..5956c0ee 100644 --- a/rbi/knockapi/models/workflow_cancel_params.rbi +++ b/rbi/knockapi/models/workflow_cancel_params.rbi @@ -6,6 +6,11 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any(Knockapi::WorkflowCancelParams, Knockapi::Internal::AnyHash) + end + # An optional key that is used to reference a specific workflow trigger request # when issuing a [workflow cancellation](/send-notifications/canceling-workflows) # request. Must be provided while triggering a workflow in order to enable @@ -16,18 +21,31 @@ module Knockapi # A list of recipients to cancel the notification for. If omitted, cancels for all # recipients associated with the cancellation key. - sig { returns(T.nilable(T::Array[T.any(String, Knockapi::Models::RecipientReference::ObjectReference)])) } + sig do + returns( + T.nilable( + T::Array[ + T.any(String, Knockapi::RecipientReference::ObjectReference) + ] + ) + ) + end attr_accessor :recipients sig do params( cancellation_key: String, - recipients: T.nilable( - T::Array[T.any(String, Knockapi::Models::RecipientReference::ObjectReference, Knockapi::Internal::AnyHash)] - ), - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + recipients: + T.nilable( + T::Array[ + T.any( + String, + Knockapi::RecipientReference::ObjectReference::OrHash + ) + ] + ), + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # An optional key that is used to reference a specific workflow trigger request @@ -40,18 +58,25 @@ module Knockapi # recipients associated with the cancellation key. recipients: nil, request_options: {} - ); end + ) + end + sig do - override - .returns( - { - cancellation_key: String, - recipients: T.nilable(T::Array[T.any(String, Knockapi::Models::RecipientReference::ObjectReference)]), - request_options: Knockapi::RequestOptions - } - ) + override.returns( + { + cancellation_key: String, + recipients: + T.nilable( + T::Array[ + T.any(String, Knockapi::RecipientReference::ObjectReference) + ] + ), + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/workflow_cancel_response.rbi b/rbi/knockapi/models/workflow_cancel_response.rbi new file mode 100644 index 00000000..5ccb7635 --- /dev/null +++ b/rbi/knockapi/models/workflow_cancel_response.rbi @@ -0,0 +1,7 @@ +# typed: strong + +module Knockapi + module Models + WorkflowCancelResponse = String + end +end diff --git a/rbi/knockapi/models/workflow_trigger_params.rbi b/rbi/knockapi/models/workflow_trigger_params.rbi index edb24a13..fb3e9795 100644 --- a/rbi/knockapi/models/workflow_trigger_params.rbi +++ b/rbi/knockapi/models/workflow_trigger_params.rbi @@ -6,11 +6,22 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters + OrHash = + T.type_alias do + T.any(Knockapi::WorkflowTriggerParams, Knockapi::Internal::AnyHash) + end + # The recipients to trigger the workflow for. Can inline identify users, objects, # or use a list of user IDs. Limited to 1,000 recipients. sig do returns( - T::Array[T.any(String, Knockapi::Models::InlineIdentifyUserRequest, Knockapi::Models::InlineObjectRequest)] + T::Array[ + T.any( + String, + Knockapi::InlineIdentifyUserRequest, + Knockapi::InlineObjectRequest + ) + ] ) end attr_accessor :recipients @@ -21,7 +32,11 @@ module Knockapi sig do returns( T.nilable( - T.any(String, Knockapi::Models::InlineIdentifyUserRequest, Knockapi::Models::InlineObjectRequest) + T.any( + String, + Knockapi::InlineIdentifyUserRequest, + Knockapi::InlineObjectRequest + ) ) ) end @@ -40,33 +55,32 @@ module Knockapi attr_accessor :data # An request to set a tenant inline. - sig { returns(T.nilable(T.any(String, Knockapi::Models::TenantRequest))) } + sig { returns(T.nilable(T.any(String, Knockapi::TenantRequest))) } attr_accessor :tenant sig do params( - recipients: T::Array[ - T.any( - String, - Knockapi::Models::InlineIdentifyUserRequest, - Knockapi::Internal::AnyHash, - Knockapi::Models::InlineObjectRequest - ) - ], - actor: T.nilable( - T.any( - String, - Knockapi::Models::InlineIdentifyUserRequest, - Knockapi::Internal::AnyHash, - Knockapi::Models::InlineObjectRequest - ) - ), + recipients: + T::Array[ + T.any( + String, + Knockapi::InlineIdentifyUserRequest::OrHash, + Knockapi::InlineObjectRequest::OrHash + ) + ], + actor: + T.nilable( + T.any( + String, + Knockapi::InlineIdentifyUserRequest::OrHash, + Knockapi::InlineObjectRequest::OrHash + ) + ), cancellation_key: T.nilable(String), data: T.nilable(T::Hash[Symbol, T.anything]), - tenant: T.nilable(T.any(String, Knockapi::Models::TenantRequest, Knockapi::Internal::AnyHash)), - request_options: T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) - ) - .returns(T.attached_class) + tenant: T.nilable(T.any(String, Knockapi::TenantRequest::OrHash)), + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) end def self.new( # The recipients to trigger the workflow for. Can inline identify users, objects, @@ -87,23 +101,37 @@ module Knockapi # An request to set a tenant inline. tenant: nil, request_options: {} - ); end + ) + end + sig do - override - .returns( - { - recipients: T::Array[T.any(String, Knockapi::Models::InlineIdentifyUserRequest, Knockapi::Models::InlineObjectRequest)], - actor: T.nilable( - T.any(String, Knockapi::Models::InlineIdentifyUserRequest, Knockapi::Models::InlineObjectRequest) + override.returns( + { + recipients: + T::Array[ + T.any( + String, + Knockapi::InlineIdentifyUserRequest, + Knockapi::InlineObjectRequest + ) + ], + actor: + T.nilable( + T.any( + String, + Knockapi::InlineIdentifyUserRequest, + Knockapi::InlineObjectRequest + ) ), - cancellation_key: T.nilable(String), - data: T.nilable(T::Hash[Symbol, T.anything]), - tenant: T.nilable(T.any(String, Knockapi::Models::TenantRequest)), - request_options: Knockapi::RequestOptions - } - ) + cancellation_key: T.nilable(String), + data: T.nilable(T::Hash[Symbol, T.anything]), + tenant: T.nilable(T.any(String, Knockapi::TenantRequest)), + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash end - def to_hash; end end end end diff --git a/rbi/knockapi/models/workflow_trigger_response.rbi b/rbi/knockapi/models/workflow_trigger_response.rbi index ffe51adc..80f24831 100644 --- a/rbi/knockapi/models/workflow_trigger_response.rbi +++ b/rbi/knockapi/models/workflow_trigger_response.rbi @@ -3,6 +3,14 @@ module Knockapi module Models class WorkflowTriggerResponse < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Models::WorkflowTriggerResponse, + Knockapi::Internal::AnyHash + ) + end + # This value allows you to track individual messages associated with this trigger # request. sig { returns(String) } @@ -14,9 +22,12 @@ module Knockapi # This value allows you to track individual messages associated with this trigger # request. workflow_run_id: - ); end - sig { override.returns({workflow_run_id: String}) } - def to_hash; end + ) + end + + sig { override.returns({ workflow_run_id: String }) } + def to_hash + end end end end diff --git a/rbi/knockapi/request_options.rbi b/rbi/knockapi/request_options.rbi index e8e92828..42a65f52 100644 --- a/rbi/knockapi/request_options.rbi +++ b/rbi/knockapi/request_options.rbi @@ -1,17 +1,21 @@ # typed: strong module Knockapi - RequestOpts = T.type_alias { T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) } - # Specify HTTP behaviour to use for a specific request. These options supplement # or override those provided at the client level. # # When making a request, you can pass an actual {RequestOptions} instance, or # simply pass a Hash with symbol keys matching the attributes on this class. class RequestOptions < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Knockapi::RequestOptions, Knockapi::Internal::AnyHash) + end + # @api private - sig { params(opts: T.any(T.self_type, T::Hash[Symbol, T.anything])).void } - def self.validate!(opts); end + sig { params(opts: Knockapi::RequestOptions::OrHash).void } + def self.validate!(opts) + end # Idempotency key to send with request and all associated retries. Will only be # sent for write requests. @@ -20,7 +24,11 @@ module Knockapi # Extra query params to send with the request. These are `.merge`’d into any # `query` given at the client level. - sig { returns(T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))])) } + sig do + returns( + T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))]) + ) + end attr_accessor :extra_query # Extra headers to send with the request. These are `.merged`’d into any @@ -42,7 +50,10 @@ module Knockapi attr_accessor :timeout # Returns a new instance of RequestOptions. - sig { params(values: Knockapi::Internal::AnyHash).returns(T.attached_class) } - def self.new(values = {}); end + sig do + params(values: Knockapi::Internal::AnyHash).returns(T.attached_class) + end + def self.new(values = {}) + end end end diff --git a/rbi/knockapi/resources/audiences.rbi b/rbi/knockapi/resources/audiences.rbi index 59ef5c5b..aedc54d1 100644 --- a/rbi/knockapi/resources/audiences.rbi +++ b/rbi/knockapi/resources/audiences.rbi @@ -7,10 +7,9 @@ module Knockapi sig do params( key: String, - members: T::Array[T.any(Knockapi::Models::AudienceAddMembersParams::Member, Knockapi::Internal::AnyHash)], - request_options: Knockapi::RequestOpts - ) - .returns(String) + members: T::Array[Knockapi::AudienceAddMembersParams::Member::OrHash], + request_options: Knockapi::RequestOptions::OrHash + ).returns(String) end def add_members( # The key of the audience. @@ -18,25 +17,31 @@ module Knockapi # A list of audience members to add. members:, request_options: {} - ); end + ) + end + # Returns a paginated list of members for the specified audience. sig do - params(key: String, request_options: Knockapi::RequestOpts) - .returns(Knockapi::Models::AudienceListMembersResponse) + params( + key: String, + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Models::AudienceListMembersResponse) end def list_members( # The key of the audience. key, request_options: {} - ); end + ) + end + # Removes one or more members from the specified audience. sig do params( key: String, - members: T::Array[T.any(Knockapi::Models::AudienceRemoveMembersParams::Member, Knockapi::Internal::AnyHash)], - request_options: Knockapi::RequestOpts - ) - .returns(String) + members: + T::Array[Knockapi::AudienceRemoveMembersParams::Member::OrHash], + request_options: Knockapi::RequestOptions::OrHash + ).returns(String) end def remove_members( # The key of the audience. @@ -44,10 +49,13 @@ module Knockapi # A list of audience members to remove. members:, request_options: {} - ); end + ) + end + # @api private sig { params(client: Knockapi::Client).returns(T.attached_class) } - def self.new(client:); end + def self.new(client:) + end end end end diff --git a/rbi/knockapi/resources/bulk_operations.rbi b/rbi/knockapi/resources/bulk_operations.rbi index 87d40e74..7fc257fe 100644 --- a/rbi/knockapi/resources/bulk_operations.rbi +++ b/rbi/knockapi/resources/bulk_operations.rbi @@ -4,15 +4,23 @@ module Knockapi module Resources class BulkOperations # Retrieves a bulk operation (if it exists) and displays the current state of it. - sig { params(id: String, request_options: Knockapi::RequestOpts).returns(Knockapi::Models::BulkOperation) } + sig do + params( + id: String, + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::BulkOperation) + end def get( # The ID of the bulk operation to retrieve. id, request_options: {} - ); end + ) + end + # @api private sig { params(client: Knockapi::Client).returns(T.attached_class) } - def self.new(client:); end + def self.new(client:) + end end end end diff --git a/rbi/knockapi/resources/channels.rbi b/rbi/knockapi/resources/channels.rbi index 0e9531db..740daa47 100644 --- a/rbi/knockapi/resources/channels.rbi +++ b/rbi/knockapi/resources/channels.rbi @@ -8,7 +8,8 @@ module Knockapi # @api private sig { params(client: Knockapi::Client).returns(T.attached_class) } - def self.new(client:); end + def self.new(client:) + end end end end diff --git a/rbi/knockapi/resources/channels/bulk.rbi b/rbi/knockapi/resources/channels/bulk.rbi index bdffe096..4657e12d 100644 --- a/rbi/knockapi/resources/channels/bulk.rbi +++ b/rbi/knockapi/resources/channels/bulk.rbi @@ -11,10 +11,14 @@ module Knockapi sig do params( channel_id: String, - action: Knockapi::Models::Channels::BulkUpdateMessageStatusParams::Action::OrSymbol, - archived: Knockapi::Models::Channels::BulkUpdateMessageStatusParams::Archived::OrSymbol, - delivery_status: Knockapi::Models::Channels::BulkUpdateMessageStatusParams::DeliveryStatus::OrSymbol, - engagement_status: Knockapi::Models::Channels::BulkUpdateMessageStatusParams::EngagementStatus::OrSymbol, + action: + Knockapi::Channels::BulkUpdateMessageStatusParams::Action::OrSymbol, + archived: + Knockapi::Channels::BulkUpdateMessageStatusParams::Archived::OrSymbol, + delivery_status: + Knockapi::Channels::BulkUpdateMessageStatusParams::DeliveryStatus::OrSymbol, + engagement_status: + Knockapi::Channels::BulkUpdateMessageStatusParams::EngagementStatus::OrSymbol, has_tenant: T::Boolean, newer_than: Time, older_than: Time, @@ -22,9 +26,8 @@ module Knockapi tenants: T::Array[String], trigger_data: String, workflows: T::Array[String], - request_options: Knockapi::RequestOpts - ) - .returns(Knockapi::Models::BulkOperation) + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::BulkOperation) end def update_message_status( # The ID of the channel to update messages for. @@ -54,10 +57,13 @@ module Knockapi # Limits the results to messages with the given workflow keys. workflows: nil, request_options: {} - ); end + ) + end + # @api private sig { params(client: Knockapi::Client).returns(T.attached_class) } - def self.new(client:); end + def self.new(client:) + end end end end diff --git a/rbi/knockapi/resources/integrations.rbi b/rbi/knockapi/resources/integrations.rbi index 6926de62..d005120c 100644 --- a/rbi/knockapi/resources/integrations.rbi +++ b/rbi/knockapi/resources/integrations.rbi @@ -11,7 +11,8 @@ module Knockapi # @api private sig { params(client: Knockapi::Client).returns(T.attached_class) } - def self.new(client:); end + def self.new(client:) + end end end end diff --git a/rbi/knockapi/resources/integrations/census.rbi b/rbi/knockapi/resources/integrations/census.rbi index 9c069258..04f18a3a 100644 --- a/rbi/knockapi/resources/integrations/census.rbi +++ b/rbi/knockapi/resources/integrations/census.rbi @@ -11,9 +11,10 @@ module Knockapi jsonrpc: String, method_: String, params: T::Hash[Symbol, T.anything], - request_options: Knockapi::RequestOpts + request_options: Knockapi::RequestOptions::OrHash + ).returns( + Knockapi::Models::Integrations::CensusCustomDestinationResponse ) - .returns(Knockapi::Models::Integrations::CensusCustomDestinationResponse) end def custom_destination( # The unique identifier for the RPC request. @@ -25,10 +26,13 @@ module Knockapi # The parameters for the method. params: nil, request_options: {} - ); end + ) + end + # @api private sig { params(client: Knockapi::Client).returns(T.attached_class) } - def self.new(client:); end + def self.new(client:) + end end end end diff --git a/rbi/knockapi/resources/integrations/hightouch.rbi b/rbi/knockapi/resources/integrations/hightouch.rbi index 89632739..6a3b9aac 100644 --- a/rbi/knockapi/resources/integrations/hightouch.rbi +++ b/rbi/knockapi/resources/integrations/hightouch.rbi @@ -11,9 +11,10 @@ module Knockapi jsonrpc: String, method_: String, params: T::Hash[Symbol, T.anything], - request_options: Knockapi::RequestOpts + request_options: Knockapi::RequestOptions::OrHash + ).returns( + Knockapi::Models::Integrations::HightouchEmbeddedDestinationResponse ) - .returns(Knockapi::Models::Integrations::HightouchEmbeddedDestinationResponse) end def embedded_destination( # The unique identifier for the RPC request. @@ -25,10 +26,13 @@ module Knockapi # The parameters for the method. params: nil, request_options: {} - ); end + ) + end + # @api private sig { params(client: Knockapi::Client).returns(T.attached_class) } - def self.new(client:); end + def self.new(client:) + end end end end diff --git a/rbi/knockapi/resources/messages.rbi b/rbi/knockapi/resources/messages.rbi index d0fb0bd5..b9671e04 100644 --- a/rbi/knockapi/resources/messages.rbi +++ b/rbi/knockapi/resources/messages.rbi @@ -6,29 +6,26 @@ module Knockapi sig { returns(Knockapi::Resources::Messages::Batch) } attr_reader :batch - sig { returns(Knockapi::Resources::Messages::Activities) } - attr_reader :activities - # Returns a paginated list of messages for the current environment. sig do params( after: String, before: String, channel_id: String, - engagement_status: T::Array[Knockapi::Models::MessageListParams::EngagementStatus::OrSymbol], - inserted_at: T.any(Knockapi::Models::MessageListParams::InsertedAt, Knockapi::Internal::AnyHash), + engagement_status: + T::Array[Knockapi::MessageListParams::EngagementStatus::OrSymbol], + inserted_at: Knockapi::MessageListParams::InsertedAt::OrHash, message_ids: T::Array[String], page_size: Integer, source: String, - status: T::Array[Knockapi::Models::MessageListParams::Status::OrSymbol], + status: T::Array[Knockapi::MessageListParams::Status::OrSymbol], tenant: String, trigger_data: String, workflow_categories: T::Array[String], workflow_recipient_run_id: String, workflow_run_id: String, - request_options: Knockapi::RequestOpts - ) - .returns(Knockapi::Internal::EntriesCursor[Knockapi::Models::Message]) + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Internal::EntriesCursor[Knockapi::Message]) end def list( # The cursor to fetch entries after. @@ -63,33 +60,53 @@ module Knockapi # returned by the workflow trigger request. workflow_run_id: nil, request_options: {} - ); end + ) + end + # Archives a message for the user. Archived messages are hidden from the default # message list in the feed but can still be accessed and unarchived later. - sig { params(message_id: String, request_options: Knockapi::RequestOpts).returns(Knockapi::Models::Message) } + sig do + params( + message_id: String, + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Message) + end def archive( # The unique identifier for the message. message_id, request_options: {} - ); end + ) + end + # Retrieves a specific message by its ID. - sig { params(message_id: String, request_options: Knockapi::RequestOpts).returns(Knockapi::Models::Message) } + sig do + params( + message_id: String, + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Message) + end def get( # The unique identifier for the message. message_id, request_options: {} - ); end + ) + end + # Returns the fully rendered contents of a message, where the response depends on # which channel the message was sent through. sig do - params(message_id: String, request_options: Knockapi::RequestOpts) - .returns(Knockapi::Models::MessageGetContentResponse) + params( + message_id: String, + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Models::MessageGetContentResponse) end def get_content( # The ID of the message to fetch contents of. message_id, request_options: {} - ); end + ) + end + # Returns a paginated list of activities for the specified message. sig do params( @@ -98,9 +115,8 @@ module Knockapi before: String, page_size: Integer, trigger_data: String, - request_options: Knockapi::RequestOpts - ) - .returns(Knockapi::Internal::ItemsCursor[Knockapi::Models::Activity]) + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Internal::ItemsCursor[Knockapi::Activity]) end def list_activities( # The ID of the message to fetch activities for. @@ -114,7 +130,9 @@ module Knockapi # The trigger data to filter activities by. trigger_data: nil, request_options: {} - ); end + ) + end + # Returns a paginated list of delivery logs for the specified message. sig do params( @@ -122,9 +140,10 @@ module Knockapi after: String, before: String, page_size: Integer, - request_options: Knockapi::RequestOpts + request_options: Knockapi::RequestOptions::OrHash + ).returns( + Knockapi::Internal::EntriesCursor[Knockapi::MessageDeliveryLog] ) - .returns(Knockapi::Internal::EntriesCursor[Knockapi::Models::MessageDeliveryLog]) end def list_delivery_logs( # The ID of the message to fetch delivery logs for. @@ -136,7 +155,9 @@ module Knockapi # The number of items per page. page_size: nil, request_options: {} - ); end + ) + end + # Returns a paginated list of events for the specified message. sig do params( @@ -144,9 +165,8 @@ module Knockapi after: String, before: String, page_size: Integer, - request_options: Knockapi::RequestOpts - ) - .returns(Knockapi::Internal::EntriesCursor[Knockapi::Models::MessageEvent]) + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Internal::EntriesCursor[Knockapi::MessageEvent]) end def list_events( # The ID of the message to fetch events for. @@ -158,7 +178,9 @@ module Knockapi # The number of items per page. page_size: nil, request_options: {} - ); end + ) + end + # Marks a message as `interacted` with by the user. This can include any user # action on the message, with optional metadata about the specific interaction. # Cannot include more than 5 key-value pairs, must not contain nested data. Read @@ -168,9 +190,8 @@ module Knockapi params( message_id: String, metadata: T::Hash[Symbol, T.anything], - request_options: Knockapi::RequestOpts - ) - .returns(Knockapi::Models::Message) + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Message) end def mark_as_interacted( # The unique identifier for the message. @@ -178,54 +199,92 @@ module Knockapi # Metadata about the interaction. metadata: nil, request_options: {} - ); end + ) + end + # Marks a message as `read`. This indicates that the user has read the message # content. Read more about message engagement statuses # [here](/send-notifications/message-statuses#engagement-status). - sig { params(message_id: String, request_options: Knockapi::RequestOpts).returns(Knockapi::Models::Message) } + sig do + params( + message_id: String, + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Message) + end def mark_as_read( # The unique identifier for the message. message_id, request_options: {} - ); end + ) + end + # Marks a message as `seen`. This indicates that the user has viewed the message # in their feed or inbox. Read more about message engagement statuses # [here](/send-notifications/message-statuses#engagement-status). - sig { params(message_id: String, request_options: Knockapi::RequestOpts).returns(Knockapi::Models::Message) } + sig do + params( + message_id: String, + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Message) + end def mark_as_seen( # The unique identifier for the message. message_id, request_options: {} - ); end + ) + end + # Marks a message as `unread`. This reverses the `read` state. Read more about # message engagement statuses # [here](/send-notifications/message-statuses#engagement-status). - sig { params(message_id: String, request_options: Knockapi::RequestOpts).returns(Knockapi::Models::Message) } + sig do + params( + message_id: String, + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Message) + end def mark_as_unread( # The unique identifier for the message. message_id, request_options: {} - ); end + ) + end + # Marks a message as `unseen`. This reverses the `seen` state. Read more about # message engagement statuses # [here](/send-notifications/message-statuses#engagement-status). - sig { params(message_id: String, request_options: Knockapi::RequestOpts).returns(Knockapi::Models::Message) } + sig do + params( + message_id: String, + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Message) + end def mark_as_unseen( # The unique identifier for the message. message_id, request_options: {} - ); end + ) + end + # Removes a message from the archived state, making it visible in the default # message list in the feed again. - sig { params(message_id: String, request_options: Knockapi::RequestOpts).returns(Knockapi::Models::Message) } + sig do + params( + message_id: String, + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Message) + end def unarchive( # The unique identifier for the message. message_id, request_options: {} - ); end + ) + end + # @api private sig { params(client: Knockapi::Client).returns(T.attached_class) } - def self.new(client:); end + def self.new(client:) + end end end end diff --git a/rbi/knockapi/resources/messages/activities.rbi b/rbi/knockapi/resources/messages/activities.rbi deleted file mode 100644 index f9329ebf..00000000 --- a/rbi/knockapi/resources/messages/activities.rbi +++ /dev/null @@ -1,38 +0,0 @@ -# typed: strong - -module Knockapi - module Resources - class Messages - class Activities - # Returns a paginated list of activities for the specified message. - sig do - params( - message_id: String, - after: String, - before: String, - page_size: Integer, - trigger_data: String, - request_options: Knockapi::RequestOpts - ) - .returns(Knockapi::Internal::ItemsCursor[Knockapi::Models::Activity]) - end - def list( - # The ID of the message to fetch activities for. - message_id, - # The cursor to fetch entries after. - after: nil, - # The cursor to fetch entries before. - before: nil, - # The number of items per page. - page_size: nil, - # The trigger data to filter activities by. - trigger_data: nil, - request_options: {} - ); end - # @api private - sig { params(client: Knockapi::Client).returns(T.attached_class) } - def self.new(client:); end - end - end - end -end diff --git a/rbi/knockapi/resources/messages/batch.rbi b/rbi/knockapi/resources/messages/batch.rbi index 3c7ea01d..7900e0d8 100644 --- a/rbi/knockapi/resources/messages/batch.rbi +++ b/rbi/knockapi/resources/messages/batch.rbi @@ -7,24 +7,34 @@ module Knockapi # Marks the given messages as archived. Archived messages are hidden from the # default message list in the feed but can still be accessed and unarchived later. sig do - params(message_ids: T::Array[String], request_options: Knockapi::RequestOpts) - .returns(T::Array[Knockapi::Models::Message]) + params( + message_ids: T::Array[String], + request_options: Knockapi::RequestOptions::OrHash + ).returns(T::Array[Knockapi::Message]) end def archive( # The message IDs to update the status of. message_ids:, request_options: {} - ); end + ) + end + # Get the contents of multiple messages in a single request. sig do - params(message_ids: T::Array[String], request_options: Knockapi::RequestOpts) - .returns(T::Array[Knockapi::Models::Messages::BatchGetContentResponseItem]) + params( + message_ids: T::Array[String], + request_options: Knockapi::RequestOptions::OrHash + ).returns( + T::Array[Knockapi::Models::Messages::BatchGetContentResponseItem] + ) end def get_content( # The IDs of the messages to fetch contents of. message_ids:, request_options: {} - ); end + ) + end + # Marks the given messages as interacted with by the user. This can include any # user action on the message, with optional metadata about the specific # interaction. Cannot include more than 5 key-value pairs, must not contain nested @@ -34,9 +44,8 @@ module Knockapi params( message_ids: T::Array[String], metadata: T.nilable(T::Hash[Symbol, T.anything]), - request_options: Knockapi::RequestOpts - ) - .returns(T::Array[Knockapi::Models::Message]) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T::Array[Knockapi::Message]) end def mark_as_interacted( # The message IDs to batch mark as interacted with. @@ -44,69 +53,92 @@ module Knockapi # Metadata about the interaction. metadata: nil, request_options: {} - ); end + ) + end + # Marks the given messages as `read`. Read more about message engagement statuses # [here](/send-notifications/message-statuses#engagement-status). sig do - params(message_ids: T::Array[String], request_options: Knockapi::RequestOpts) - .returns(T::Array[Knockapi::Models::Message]) + params( + message_ids: T::Array[String], + request_options: Knockapi::RequestOptions::OrHash + ).returns(T::Array[Knockapi::Message]) end def mark_as_read( # The message IDs to update the status of. message_ids:, request_options: {} - ); end + ) + end + # Marks the given messages as `seen`. This indicates that the user has viewed the # message in their feed or inbox. Read more about message engagement statuses # [here](/send-notifications/message-statuses#engagement-status). sig do - params(message_ids: T::Array[String], request_options: Knockapi::RequestOpts) - .returns(T::Array[Knockapi::Models::Message]) + params( + message_ids: T::Array[String], + request_options: Knockapi::RequestOptions::OrHash + ).returns(T::Array[Knockapi::Message]) end def mark_as_seen( # The message IDs to update the status of. message_ids:, request_options: {} - ); end + ) + end + # Marks the given messages as `unread`. This reverses the `read` state. Read more # about message engagement statuses # [here](/send-notifications/message-statuses#engagement-status). sig do - params(message_ids: T::Array[String], request_options: Knockapi::RequestOpts) - .returns(T::Array[Knockapi::Models::Message]) + params( + message_ids: T::Array[String], + request_options: Knockapi::RequestOptions::OrHash + ).returns(T::Array[Knockapi::Message]) end def mark_as_unread( # The message IDs to update the status of. message_ids:, request_options: {} - ); end + ) + end + # Marks the given messages as `unseen`. This reverses the `seen` state. Read more # about message engagement statuses # [here](/send-notifications/message-statuses#engagement-status). sig do - params(message_ids: T::Array[String], request_options: Knockapi::RequestOpts) - .returns(T::Array[Knockapi::Models::Message]) + params( + message_ids: T::Array[String], + request_options: Knockapi::RequestOptions::OrHash + ).returns(T::Array[Knockapi::Message]) end def mark_as_unseen( # The message IDs to update the status of. message_ids:, request_options: {} - ); end + ) + end + # Marks the given messages as unarchived. This reverses the `archived` state. # Archived messages are hidden from the default message list in the feed but can # still be accessed and unarchived later. sig do - params(message_ids: T::Array[String], request_options: Knockapi::RequestOpts) - .returns(T::Array[Knockapi::Models::Message]) + params( + message_ids: T::Array[String], + request_options: Knockapi::RequestOptions::OrHash + ).returns(T::Array[Knockapi::Message]) end def unarchive( # The message IDs to update the status of. message_ids:, request_options: {} - ); end + ) + end + # @api private sig { params(client: Knockapi::Client).returns(T.attached_class) } - def self.new(client:); end + def self.new(client:) + end end end end diff --git a/rbi/knockapi/resources/objects.rbi b/rbi/knockapi/resources/objects.rbi index 26ff3f78..5f4d894f 100644 --- a/rbi/knockapi/resources/objects.rbi +++ b/rbi/knockapi/resources/objects.rbi @@ -13,11 +13,10 @@ module Knockapi collection: String, after: String, before: String, - include: T::Array[Knockapi::Models::ObjectListParams::Include::OrSymbol], + include: T::Array[Knockapi::ObjectListParams::Include::OrSymbol], page_size: Integer, - request_options: Knockapi::RequestOpts - ) - .returns(Knockapi::Internal::EntriesCursor[Knockapi::Models::Object]) + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Internal::EntriesCursor[Knockapi::Object]) end def list( # The collection this object belongs to. @@ -31,17 +30,27 @@ module Knockapi # The number of items per page. page_size: nil, request_options: {} - ); end + ) + end + # Permanently removes an object from the specified collection. This operation # cannot be undone. - sig { params(collection: String, id: String, request_options: Knockapi::RequestOpts).returns(String) } + sig do + params( + collection: String, + id: String, + request_options: Knockapi::RequestOptions::OrHash + ).returns(String) + end def delete( # The collection this object belongs to. collection, # Unique identifier for the object. id, request_options: {} - ); end + ) + end + # Add subscriptions for an object. If a subscription already exists, it will be # updated. This endpoint also handles # [inline identifications](/managing-recipients/identifying-recipients#inline-identifying-recipients) @@ -50,18 +59,17 @@ module Knockapi params( collection: String, object_id_: String, - recipients: T::Array[ - T.any( - String, - Knockapi::Models::InlineIdentifyUserRequest, - Knockapi::Internal::AnyHash, - Knockapi::Models::InlineObjectRequest - ) - ], + recipients: + T::Array[ + T.any( + String, + Knockapi::InlineIdentifyUserRequest::OrHash, + Knockapi::InlineObjectRequest::OrHash + ) + ], properties: T.nilable(T::Hash[Symbol, T.anything]), - request_options: Knockapi::RequestOpts - ) - .returns(T::Array[Knockapi::Models::Recipients::Subscription]) + request_options: Knockapi::RequestOptions::OrHash + ).returns(T::Array[Knockapi::Recipients::Subscription]) end def add_subscriptions( # The collection this object belongs to. @@ -74,17 +82,24 @@ module Knockapi # The custom properties associated with the subscription relationship. properties: nil, request_options: {} - ); end + ) + end + # Delete subscriptions for the specified recipients from an object. Returns the # list of deleted subscriptions. sig do params( collection: String, object_id_: String, - recipients: T::Array[T.any(String, Knockapi::Models::RecipientReference::ObjectReference, Knockapi::Internal::AnyHash)], - request_options: Knockapi::RequestOpts - ) - .returns(T::Array[Knockapi::Models::Recipients::Subscription]) + recipients: + T::Array[ + T.any( + String, + Knockapi::RecipientReference::ObjectReference::OrHash + ) + ], + request_options: Knockapi::RequestOptions::OrHash + ).returns(T::Array[Knockapi::Recipients::Subscription]) end def delete_subscriptions( # The collection this object belongs to. @@ -95,12 +110,17 @@ module Knockapi # object at a time. recipients:, request_options: {} - ); end + ) + end + # Retrieves a specific object by its ID from the specified collection. Returns the # object with all its properties. sig do - params(collection: String, id: String, request_options: Knockapi::RequestOpts) - .returns(Knockapi::Models::Object) + params( + collection: String, + id: String, + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Object) end def get( # The collection this object belongs to. @@ -108,16 +128,17 @@ module Knockapi # Unique identifier for the object. id, request_options: {} - ); end + ) + end + # Returns the channel data for the specified object and channel. sig do params( collection: String, object_id_: String, channel_id: String, - request_options: Knockapi::RequestOpts - ) - .returns(Knockapi::Models::Recipients::RecipientsChannelData) + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Recipients::RecipientsChannelData) end def get_channel_data( # The collection this object belongs to. @@ -127,11 +148,17 @@ module Knockapi # The unique identifier for the channel. channel_id, request_options: {} - ); end + ) + end + # Returns the preference set for the specified object and preference set `id`. sig do - params(collection: String, object_id_: String, id: String, request_options: Knockapi::RequestOpts) - .returns(Knockapi::Models::Recipients::PreferenceSet) + params( + collection: String, + object_id_: String, + id: String, + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Recipients::PreferenceSet) end def get_preferences( # The collection this object belongs to. @@ -141,7 +168,9 @@ module Knockapi # Unique identifier for the preference set. id, request_options: {} - ); end + ) + end + # Returns a paginated list of messages for a specific object in the given # collection. Allows filtering by message status and provides various sorting # options. @@ -152,20 +181,23 @@ module Knockapi after: String, before: String, channel_id: String, - engagement_status: T::Array[Knockapi::Models::ObjectListMessagesParams::EngagementStatus::OrSymbol], - inserted_at: T.any(Knockapi::Models::ObjectListMessagesParams::InsertedAt, Knockapi::Internal::AnyHash), + engagement_status: + T::Array[ + Knockapi::ObjectListMessagesParams::EngagementStatus::OrSymbol + ], + inserted_at: Knockapi::ObjectListMessagesParams::InsertedAt::OrHash, message_ids: T::Array[String], page_size: Integer, source: String, - status: T::Array[Knockapi::Models::ObjectListMessagesParams::Status::OrSymbol], + status: + T::Array[Knockapi::ObjectListMessagesParams::Status::OrSymbol], tenant: String, trigger_data: String, workflow_categories: T::Array[String], workflow_recipient_run_id: String, workflow_run_id: String, - request_options: Knockapi::RequestOpts - ) - .returns(Knockapi::Internal::EntriesCursor[Knockapi::Models::Message]) + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Internal::EntriesCursor[Knockapi::Message]) end def list_messages( # The collection this object belongs to. @@ -204,11 +236,16 @@ module Knockapi # returned by the workflow trigger request. workflow_run_id: nil, request_options: {} - ); end + ) + end + # Returns a paginated list of preference sets for the specified object. sig do - params(collection: String, object_id_: String, request_options: Knockapi::RequestOpts) - .returns(T::Array[Knockapi::Models::Recipients::PreferenceSet]) + params( + collection: String, + object_id_: String, + request_options: Knockapi::RequestOptions::OrHash + ).returns(T::Array[Knockapi::Recipients::PreferenceSet]) end def list_preferences( # The collection this object belongs to. @@ -216,7 +253,9 @@ module Knockapi # Unique identifier for the object. object_id_, request_options: {} - ); end + ) + end + # Returns a paginated list of schedules for an object. sig do params( @@ -227,9 +266,8 @@ module Knockapi page_size: Integer, tenant: String, workflow: String, - request_options: Knockapi::RequestOpts - ) - .returns(Knockapi::Internal::EntriesCursor[Knockapi::Models::Schedule]) + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Internal::EntriesCursor[Knockapi::Schedule]) end def list_schedules( # The collection of the object to list schedules for. @@ -247,7 +285,9 @@ module Knockapi # Filter schedules by workflow id. workflow: nil, request_options: {} - ); end + ) + end + # List subscriptions for an object. Either list the recipients that subscribe to # the provided object, or list the objects that the provided object is subscribed # to. Determined by the `mode` query parameter. @@ -257,14 +297,25 @@ module Knockapi object_id_: String, after: String, before: String, - include: T::Array[Knockapi::Models::ObjectListSubscriptionsParams::Include::OrSymbol], - mode: Knockapi::Models::ObjectListSubscriptionsParams::Mode::OrSymbol, - objects: T::Array[T.any(Knockapi::Models::ObjectListSubscriptionsParams::Object, Knockapi::Internal::AnyHash)], + include: + T::Array[ + Knockapi::ObjectListSubscriptionsParams::Include::OrSymbol + ], + mode: Knockapi::ObjectListSubscriptionsParams::Mode::OrSymbol, + objects: + T::Array[Knockapi::ObjectListSubscriptionsParams::Object::OrHash], page_size: Integer, - recipients: T::Array[T.any(String, Knockapi::Models::RecipientReference::ObjectReference, Knockapi::Internal::AnyHash)], - request_options: Knockapi::RequestOpts + recipients: + T::Array[ + T.any( + String, + Knockapi::RecipientReference::ObjectReference::OrHash + ) + ], + request_options: Knockapi::RequestOptions::OrHash + ).returns( + Knockapi::Internal::EntriesCursor[Knockapi::Recipients::Subscription] ) - .returns(Knockapi::Internal::EntriesCursor[Knockapi::Models::Recipients::Subscription]) end def list_subscriptions( # The collection this object belongs to. @@ -288,7 +339,9 @@ module Knockapi # Recipients to filter by (only used if mode is `object`). recipients: nil, request_options: {} - ); end + ) + end + # Creates a new object or updates an existing one in the specified collection. # This operation is used to identify objects with their properties, as well as # optional preferences and channel data. @@ -296,13 +349,23 @@ module Knockapi params( collection: String, id: String, - channel_data: T::Hash[Symbol, T.any(Knockapi::Models::Recipients::ChannelDataRequest, Knockapi::Internal::AnyHash)], + channel_data: + T::Hash[ + Symbol, + T.any( + Knockapi::Recipients::PushChannelData::OrHash, + Knockapi::Recipients::OneSignalChannelData::OrHash, + Knockapi::Recipients::SlackChannelData::OrHash, + Knockapi::Recipients::MsTeamsChannelData::OrHash, + Knockapi::Recipients::DiscordChannelData::OrHash + ) + ], locale: T.nilable(String), - preferences: T::Hash[Symbol, T.any(Knockapi::Models::Recipients::PreferenceSetRequest, Knockapi::Internal::AnyHash)], + preferences: + T::Hash[Symbol, Knockapi::Recipients::PreferenceSetRequest::OrHash], timezone: T.nilable(String), - request_options: Knockapi::RequestOpts - ) - .returns(Knockapi::Models::Object) + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Object) end def set( # The collection this object belongs to. @@ -316,13 +379,15 @@ module Knockapi locale: nil, # Inline set preferences for a recipient, where the key is the preference set id. preferences: nil, - # The timezone of the object. Must be a valid - # [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). - # Used for - # [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients). + # The timezone of the object. Must be a + # valid [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + # Used + # for [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients). timezone: nil, request_options: {} - ); end + ) + end + # Sets the channel data for the specified object and channel. If no object exists # in the current environment for the given `collection` and `object_id`, Knock # will create the object as part of this request. @@ -331,17 +396,16 @@ module Knockapi collection: String, object_id_: String, channel_id: String, - data: T.any( - Knockapi::Models::Recipients::PushChannelData, - Knockapi::Internal::AnyHash, - Knockapi::Models::Recipients::OneSignalChannelData, - Knockapi::Models::Recipients::SlackChannelData, - Knockapi::Models::Recipients::MsTeamsChannelData, - Knockapi::Models::Recipients::DiscordChannelData - ), - request_options: Knockapi::RequestOpts - ) - .returns(Knockapi::Models::Recipients::RecipientsChannelData) + data: + T.any( + Knockapi::Recipients::PushChannelData::OrHash, + Knockapi::Recipients::OneSignalChannelData::OrHash, + Knockapi::Recipients::SlackChannelData::OrHash, + Knockapi::Recipients::MsTeamsChannelData::OrHash, + Knockapi::Recipients::DiscordChannelData::OrHash + ), + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Recipients::RecipientsChannelData) end def set_channel_data( # The collection this object belongs to. @@ -353,7 +417,9 @@ module Knockapi # Channel data for a given channel type. data:, request_options: {} - ); end + ) + end + # Sets preferences within the given preference set. This is a destructive # operation and will replace any existing preferences with the preferences given. # If no object exists in the current environment for the given `:collection` and @@ -365,30 +431,30 @@ module Knockapi collection: String, object_id_: String, id: String, - categories: T.nilable( - T::Hash[ - Symbol, - T.any( - T::Boolean, - Knockapi::Models::Recipients::PreferenceSetRequest::Category::PreferenceSetWorkflowCategorySettingObject, - Knockapi::Internal::AnyHash - ) - ] - ), - channel_types: T.nilable(T.any(Knockapi::Models::Recipients::PreferenceSetChannelTypes, Knockapi::Internal::AnyHash)), - workflows: T.nilable( - T::Hash[ - Symbol, - T.any( - T::Boolean, - Knockapi::Models::Recipients::PreferenceSetRequest::Workflow::PreferenceSetWorkflowCategorySettingObject, - Knockapi::Internal::AnyHash - ) - ] - ), - request_options: Knockapi::RequestOpts - ) - .returns(Knockapi::Models::Recipients::PreferenceSet) + categories: + T.nilable( + T::Hash[ + Symbol, + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetRequest::Category::PreferenceSetWorkflowCategorySettingObject::OrHash + ) + ] + ), + channel_types: + T.nilable(Knockapi::Recipients::PreferenceSetChannelTypes::OrHash), + workflows: + T.nilable( + T::Hash[ + Symbol, + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetRequest::Workflow::PreferenceSetWorkflowCategorySettingObject::OrHash + ) + ] + ), + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Recipients::PreferenceSet) end def set_preferences( # The collection this object belongs to. @@ -406,16 +472,17 @@ module Knockapi # settings for that workflow. workflows: nil, request_options: {} - ); end + ) + end + # Unsets the channel data for the specified object and channel. sig do params( collection: String, object_id_: String, channel_id: String, - request_options: Knockapi::RequestOpts - ) - .returns(String) + request_options: Knockapi::RequestOptions::OrHash + ).returns(String) end def unset_channel_data( # The collection this object belongs to. @@ -425,10 +492,13 @@ module Knockapi # The unique identifier for the channel. channel_id, request_options: {} - ); end + ) + end + # @api private sig { params(client: Knockapi::Client).returns(T.attached_class) } - def self.new(client:); end + def self.new(client:) + end end end end diff --git a/rbi/knockapi/resources/objects/bulk.rbi b/rbi/knockapi/resources/objects/bulk.rbi index 5207b19e..e1a2d95b 100644 --- a/rbi/knockapi/resources/objects/bulk.rbi +++ b/rbi/knockapi/resources/objects/bulk.rbi @@ -6,8 +6,11 @@ module Knockapi class Bulk # Bulk deletes objects from the specified collection. sig do - params(collection: String, object_ids: T::Array[String], request_options: Knockapi::RequestOpts) - .returns(Knockapi::Models::BulkOperation) + params( + collection: String, + object_ids: T::Array[String], + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::BulkOperation) end def delete( # The collection this object belongs to. @@ -15,7 +18,9 @@ module Knockapi # List of object IDs to delete. object_ids:, request_options: {} - ); end + ) + end + # Add subscriptions for all objects in a single collection. If a subscription for # an object in the collection already exists, it will be updated. This endpoint # also handles @@ -24,10 +29,12 @@ module Knockapi sig do params( collection: String, - subscriptions: T::Array[T.any(Knockapi::Models::Objects::BulkAddSubscriptionsParams::Subscription, Knockapi::Internal::AnyHash)], - request_options: Knockapi::RequestOpts - ) - .returns(Knockapi::Models::BulkOperation) + subscriptions: + T::Array[ + Knockapi::Objects::BulkAddSubscriptionsParams::Subscription::OrHash + ], + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::BulkOperation) end def add_subscriptions( # The collection this object belongs to. @@ -35,15 +42,16 @@ module Knockapi # A list of subscriptions. subscriptions:, request_options: {} - ); end + ) + end + # Bulk sets up to 1,000 objects at a time in the specified collection. sig do params( collection: String, - objects: T::Array[T.any(Knockapi::Models::InlineObjectRequest, Knockapi::Internal::AnyHash)], - request_options: Knockapi::RequestOpts - ) - .returns(Knockapi::Models::BulkOperation) + objects: T::Array[Knockapi::InlineObjectRequest::OrHash], + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::BulkOperation) end def set( # The collection this object belongs to. @@ -51,10 +59,13 @@ module Knockapi # A list of objects. objects:, request_options: {} - ); end + ) + end + # @api private sig { params(client: Knockapi::Client).returns(T.attached_class) } - def self.new(client:); end + def self.new(client:) + end end end end diff --git a/rbi/knockapi/resources/providers.rbi b/rbi/knockapi/resources/providers.rbi index dbbd12f6..ec333815 100644 --- a/rbi/knockapi/resources/providers.rbi +++ b/rbi/knockapi/resources/providers.rbi @@ -11,7 +11,8 @@ module Knockapi # @api private sig { params(client: Knockapi::Client).returns(T.attached_class) } - def self.new(client:); end + def self.new(client:) + end end end end diff --git a/rbi/knockapi/resources/providers/ms_teams.rbi b/rbi/knockapi/resources/providers/ms_teams.rbi index 839a2560..8dc37e2f 100644 --- a/rbi/knockapi/resources/providers/ms_teams.rbi +++ b/rbi/knockapi/resources/providers/ms_teams.rbi @@ -7,8 +7,11 @@ module Knockapi # Check if a connection to Microsoft Teams has been authorized for a given # Microsoft Teams tenant object. sig do - params(channel_id: String, ms_teams_tenant_object: String, request_options: Knockapi::RequestOpts) - .returns(Knockapi::Models::Providers::MsTeamCheckAuthResponse) + params( + channel_id: String, + ms_teams_tenant_object: String, + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Models::Providers::MsTeamCheckAuthResponse) end def check_auth( # The ID of the Knock Microsoft Teams channel to check. @@ -16,7 +19,9 @@ module Knockapi # A JSON encoded string containing the Microsoft Teams tenant object reference. ms_teams_tenant_object:, request_options: {} - ); end + ) + end + # List the Microsoft Teams channels within a team. By default, archived and # private channels are excluded from the results. sig do @@ -24,10 +29,10 @@ module Knockapi channel_id: String, ms_teams_tenant_object: String, team_id: String, - query_options: T.any(Knockapi::Models::Providers::MsTeamListChannelsParams::QueryOptions, Knockapi::Internal::AnyHash), - request_options: Knockapi::RequestOpts - ) - .returns(Knockapi::Models::Providers::MsTeamListChannelsResponse) + query_options: + Knockapi::Providers::MsTeamListChannelsParams::QueryOptions::OrHash, + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Models::Providers::MsTeamListChannelsResponse) end def list_channels( # The ID of the Knock Microsoft Teams channel to get channels for. @@ -38,17 +43,23 @@ module Knockapi team_id:, query_options: nil, request_options: {} - ); end + ) + end + # Get a list of teams belonging to the Microsoft Entra tenant. By default, # archived and private channels are excluded from the results. sig do params( channel_id: String, ms_teams_tenant_object: String, - query_options: T.any(Knockapi::Models::Providers::MsTeamListTeamsParams::QueryOptions, Knockapi::Internal::AnyHash), - request_options: Knockapi::RequestOpts + query_options: + Knockapi::Providers::MsTeamListTeamsParams::QueryOptions::OrHash, + request_options: Knockapi::RequestOptions::OrHash + ).returns( + Knockapi::Internal::MsTeamsPagination[ + Knockapi::Models::Providers::MsTeamListTeamsResponse + ] ) - .returns(Knockapi::Internal::MsTeamsPagination[Knockapi::Models::Providers::MsTeamListTeamsResponse]) end def list_teams( # The ID of the Knock Microsoft Teams channel to get teams for. @@ -57,11 +68,16 @@ module Knockapi ms_teams_tenant_object:, query_options: nil, request_options: {} - ); end + ) + end + # Remove a Microsoft Entra tenant ID from a Microsoft Teams tenant object. sig do - params(channel_id: String, ms_teams_tenant_object: String, request_options: Knockapi::RequestOpts) - .returns(Knockapi::Models::Providers::MsTeamRevokeAccessResponse) + params( + channel_id: String, + ms_teams_tenant_object: String, + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Models::Providers::MsTeamRevokeAccessResponse) end def revoke_access( # The ID of the Knock Microsoft Teams channel to revoke access for. @@ -69,10 +85,13 @@ module Knockapi # A JSON encoded string containing the Microsoft Teams tenant object reference. ms_teams_tenant_object:, request_options: {} - ); end + ) + end + # @api private sig { params(client: Knockapi::Client).returns(T.attached_class) } - def self.new(client:); end + def self.new(client:) + end end end end diff --git a/rbi/knockapi/resources/providers/slack.rbi b/rbi/knockapi/resources/providers/slack.rbi index df21454c..b80d4232 100644 --- a/rbi/knockapi/resources/providers/slack.rbi +++ b/rbi/knockapi/resources/providers/slack.rbi @@ -6,8 +6,11 @@ module Knockapi class Slack # Check if a Slack channel is authenticated. sig do - params(channel_id: String, access_token_object: String, request_options: Knockapi::RequestOpts) - .returns(Knockapi::Models::Providers::SlackCheckAuthResponse) + params( + channel_id: String, + access_token_object: String, + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Models::Providers::SlackCheckAuthResponse) end def check_auth( # The ID of the Knock Slack channel to check. @@ -15,16 +18,22 @@ module Knockapi # A JSON encoded string containing the access token object reference. access_token_object:, request_options: {} - ); end + ) + end + # List Slack channels for a Slack workspace. sig do params( channel_id: String, access_token_object: String, - query_options: T.any(Knockapi::Models::Providers::SlackListChannelsParams::QueryOptions, Knockapi::Internal::AnyHash), - request_options: Knockapi::RequestOpts + query_options: + Knockapi::Providers::SlackListChannelsParams::QueryOptions::OrHash, + request_options: Knockapi::RequestOptions::OrHash + ).returns( + Knockapi::Internal::SlackChannelsCursor[ + Knockapi::Models::Providers::SlackListChannelsResponse + ] ) - .returns(Knockapi::Internal::SlackChannelsCursor[Knockapi::Models::Providers::SlackListChannelsResponse]) end def list_channels( # The ID of the Knock Slack channel to get channels for. @@ -33,11 +42,16 @@ module Knockapi access_token_object:, query_options: nil, request_options: {} - ); end + ) + end + # Revoke access for a Slack channel. sig do - params(channel_id: String, access_token_object: String, request_options: Knockapi::RequestOpts) - .returns(Knockapi::Models::Providers::SlackRevokeAccessResponse) + params( + channel_id: String, + access_token_object: String, + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Models::Providers::SlackRevokeAccessResponse) end def revoke_access( # The ID of the Knock Slack channel to revoke access for. @@ -45,10 +59,13 @@ module Knockapi # A JSON encoded string containing the access token object reference. access_token_object:, request_options: {} - ); end + ) + end + # @api private sig { params(client: Knockapi::Client).returns(T.attached_class) } - def self.new(client:); end + def self.new(client:) + end end end end diff --git a/rbi/knockapi/resources/recipients.rbi b/rbi/knockapi/resources/recipients.rbi index d9a6dccc..3dd7b87e 100644 --- a/rbi/knockapi/resources/recipients.rbi +++ b/rbi/knockapi/resources/recipients.rbi @@ -14,7 +14,8 @@ module Knockapi # @api private sig { params(client: Knockapi::Client).returns(T.attached_class) } - def self.new(client:); end + def self.new(client:) + end end end end diff --git a/rbi/knockapi/resources/recipients/channel_data.rbi b/rbi/knockapi/resources/recipients/channel_data.rbi index 7920af49..3d2174c3 100644 --- a/rbi/knockapi/resources/recipients/channel_data.rbi +++ b/rbi/knockapi/resources/recipients/channel_data.rbi @@ -6,7 +6,8 @@ module Knockapi class ChannelData # @api private sig { params(client: Knockapi::Client).returns(T.attached_class) } - def self.new(client:); end + def self.new(client:) + end end end end diff --git a/rbi/knockapi/resources/recipients/preferences.rbi b/rbi/knockapi/resources/recipients/preferences.rbi index fdae1877..1d10748d 100644 --- a/rbi/knockapi/resources/recipients/preferences.rbi +++ b/rbi/knockapi/resources/recipients/preferences.rbi @@ -6,7 +6,8 @@ module Knockapi class Preferences # @api private sig { params(client: Knockapi::Client).returns(T.attached_class) } - def self.new(client:); end + def self.new(client:) + end end end end diff --git a/rbi/knockapi/resources/recipients/subscriptions.rbi b/rbi/knockapi/resources/recipients/subscriptions.rbi index 3824e9c6..49070394 100644 --- a/rbi/knockapi/resources/recipients/subscriptions.rbi +++ b/rbi/knockapi/resources/recipients/subscriptions.rbi @@ -6,7 +6,8 @@ module Knockapi class Subscriptions # @api private sig { params(client: Knockapi::Client).returns(T.attached_class) } - def self.new(client:); end + def self.new(client:) + end end end end diff --git a/rbi/knockapi/resources/schedules.rbi b/rbi/knockapi/resources/schedules.rbi index 104c22d3..40ad1d3c 100644 --- a/rbi/knockapi/resources/schedules.rbi +++ b/rbi/knockapi/resources/schedules.rbi @@ -13,27 +13,25 @@ module Knockapi # for the `actor`, `recipient`, and `tenant` fields. sig do params( - recipients: T::Array[ - T.any( - String, - Knockapi::Models::InlineIdentifyUserRequest, - Knockapi::Internal::AnyHash, - Knockapi::Models::InlineObjectRequest - ) - ], - repeats: T::Array[T.any(Knockapi::Models::ScheduleRepeatRule, Knockapi::Internal::AnyHash)], + recipients: + T::Array[ + T.any( + String, + Knockapi::InlineIdentifyUserRequest::OrHash, + Knockapi::InlineObjectRequest::OrHash + ) + ], + repeats: T::Array[Knockapi::ScheduleRepeatRule::OrHash], workflow: String, data: T.nilable(T::Hash[Symbol, T.anything]), ending_at: T.nilable(Time), scheduled_at: T.nilable(Time), - tenant: T.nilable(T.any(String, Knockapi::Models::TenantRequest, Knockapi::Internal::AnyHash)), - request_options: Knockapi::RequestOpts - ) - .returns(T::Array[Knockapi::Models::Schedule]) + tenant: T.nilable(T.any(String, Knockapi::TenantRequest::OrHash)), + request_options: Knockapi::RequestOptions::OrHash + ).returns(T::Array[Knockapi::Schedule]) end def create( - # The recipients to trigger the workflow for. Can inline identify users, objects, - # or use a list of user IDs. Limited to 1,000 recipients. + # The recipients to set the schedule for. Limited to 100 recipients per request. recipients:, # The repeat rule for the schedule. repeats:, @@ -48,7 +46,9 @@ module Knockapi # An request to set a tenant inline. tenant: nil, request_options: {} - ); end + ) + end + # Updates one or more existing schedules with new timing, data, or other # properties. All specified schedule IDs will be updated with the same values. # This endpoint also handles @@ -57,17 +57,20 @@ module Knockapi sig do params( schedule_ids: T::Array[String], - actor: T.nilable( - T.any(String, Knockapi::Models::RecipientReference::ObjectReference, Knockapi::Internal::AnyHash) - ), + actor: + T.nilable( + T.any( + String, + Knockapi::RecipientReference::ObjectReference::OrHash + ) + ), data: T.nilable(T::Hash[Symbol, T.anything]), ending_at: T.nilable(Time), - repeats: T::Array[T.any(Knockapi::Models::ScheduleRepeatRule, Knockapi::Internal::AnyHash)], + repeats: T::Array[Knockapi::ScheduleRepeatRule::OrHash], scheduled_at: T.nilable(Time), - tenant: T.nilable(T.any(String, Knockapi::Models::TenantRequest, Knockapi::Internal::AnyHash)), - request_options: Knockapi::RequestOpts - ) - .returns(T::Array[Knockapi::Models::Schedule]) + tenant: T.nilable(T.any(String, Knockapi::TenantRequest::OrHash)), + request_options: Knockapi::RequestOptions::OrHash + ).returns(T::Array[Knockapi::Schedule]) end def update( # A list of schedule IDs. @@ -86,7 +89,9 @@ module Knockapi # An request to set a tenant inline. tenant: nil, request_options: {} - ); end + ) + end + # Returns a paginated list of schedules for the current environment, filtered by # workflow and optionally by recipients and tenant. sig do @@ -97,9 +102,8 @@ module Knockapi page_size: Integer, recipients: T::Array[String], tenant: String, - request_options: Knockapi::RequestOpts - ) - .returns(Knockapi::Internal::EntriesCursor[Knockapi::Models::Schedule]) + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Internal::EntriesCursor[Knockapi::Schedule]) end def list( # Filter by workflow key. @@ -115,21 +119,28 @@ module Knockapi # Filter by tenant ID. tenant: nil, request_options: {} - ); end + ) + end + # Permanently deletes one or more schedules identified by the provided schedule # IDs. This operation cannot be undone. sig do - params(schedule_ids: T::Array[String], request_options: Knockapi::RequestOpts) - .returns(T::Array[Knockapi::Models::Schedule]) + params( + schedule_ids: T::Array[String], + request_options: Knockapi::RequestOptions::OrHash + ).returns(T::Array[Knockapi::Schedule]) end def delete( # A list of schedule IDs. schedule_ids:, request_options: {} - ); end + ) + end + # @api private sig { params(client: Knockapi::Client).returns(T.attached_class) } - def self.new(client:); end + def self.new(client:) + end end end end diff --git a/rbi/knockapi/resources/schedules/bulk.rbi b/rbi/knockapi/resources/schedules/bulk.rbi index c7a01465..a2f03180 100644 --- a/rbi/knockapi/resources/schedules/bulk.rbi +++ b/rbi/knockapi/resources/schedules/bulk.rbi @@ -9,19 +9,22 @@ module Knockapi # for the `actor`, `recipient`, and `tenant` fields. sig do params( - schedules: T::Array[T.any(Knockapi::Models::Schedules::BulkCreateParams::Schedule, Knockapi::Internal::AnyHash)], - request_options: Knockapi::RequestOpts - ) - .returns(Knockapi::Models::BulkOperation) + schedules: + T::Array[Knockapi::Schedules::BulkCreateParams::Schedule::OrHash], + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::BulkOperation) end def create( # A list of schedules. schedules:, request_options: {} - ); end + ) + end + # @api private sig { params(client: Knockapi::Client).returns(T.attached_class) } - def self.new(client:); end + def self.new(client:) + end end end end diff --git a/rbi/knockapi/resources/shared.rbi b/rbi/knockapi/resources/shared.rbi index b13f7008..eddfefec 100644 --- a/rbi/knockapi/resources/shared.rbi +++ b/rbi/knockapi/resources/shared.rbi @@ -5,7 +5,8 @@ module Knockapi class Shared # @api private sig { params(client: Knockapi::Client).returns(T.attached_class) } - def self.new(client:); end + def self.new(client:) + end end end end diff --git a/rbi/knockapi/resources/tenants.rbi b/rbi/knockapi/resources/tenants.rbi index f0231559..cab76ae8 100644 --- a/rbi/knockapi/resources/tenants.rbi +++ b/rbi/knockapi/resources/tenants.rbi @@ -14,9 +14,8 @@ module Knockapi name: String, page_size: Integer, tenant_id: String, - request_options: Knockapi::RequestOpts - ) - .returns(Knockapi::Internal::EntriesCursor[Knockapi::Models::Tenant]) + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Internal::EntriesCursor[Knockapi::Tenant]) end def list( # The cursor to fetch entries after. @@ -30,36 +29,65 @@ module Knockapi # Filter tenants by ID. tenant_id: nil, request_options: {} - ); end + ) + end + # Delete a tenant and all associated data. This operation cannot be undone. - sig { params(id: String, request_options: Knockapi::RequestOpts).returns(String) } + sig do + params( + id: String, + request_options: Knockapi::RequestOptions::OrHash + ).returns(String) + end def delete( # The unique identifier for the tenant. id, request_options: {} - ); end + ) + end + # Get a tenant by ID. - sig { params(id: String, request_options: Knockapi::RequestOpts).returns(Knockapi::Models::Tenant) } + sig do + params( + id: String, + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Tenant) + end def get( # The unique identifier for the tenant. id, request_options: {} - ); end + ) + end + # Sets a tenant within an environment, performing an upsert operation. Any # existing properties will be merged with the incoming properties. sig do params( id: String, - channel_data: T.nilable( - T::Hash[Symbol, T.any(Knockapi::Models::Recipients::ChannelDataRequest, Knockapi::Internal::AnyHash)] - ), - preferences: T.nilable( - T::Hash[Symbol, T.any(Knockapi::Models::Recipients::PreferenceSetRequest, Knockapi::Internal::AnyHash)] - ), - settings: T.any(Knockapi::Models::TenantSetParams::Settings, Knockapi::Internal::AnyHash), - request_options: Knockapi::RequestOpts - ) - .returns(Knockapi::Models::Tenant) + channel_data: + T.nilable( + T::Hash[ + Symbol, + T.any( + Knockapi::Recipients::PushChannelData::OrHash, + Knockapi::Recipients::OneSignalChannelData::OrHash, + Knockapi::Recipients::SlackChannelData::OrHash, + Knockapi::Recipients::MsTeamsChannelData::OrHash, + Knockapi::Recipients::DiscordChannelData::OrHash + ) + ] + ), + preferences: + T.nilable( + T::Hash[ + Symbol, + Knockapi::Recipients::PreferenceSetRequest::OrHash + ] + ), + settings: Knockapi::TenantSetParams::Settings::OrHash, + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Tenant) end def set( # The unique identifier for the tenant. @@ -71,10 +99,13 @@ module Knockapi # The settings for the tenant. Includes branding and preference set. settings: nil, request_options: {} - ); end + ) + end + # @api private sig { params(client: Knockapi::Client).returns(T.attached_class) } - def self.new(client:); end + def self.new(client:) + end end end end diff --git a/rbi/knockapi/resources/tenants/bulk.rbi b/rbi/knockapi/resources/tenants/bulk.rbi index 702c2a3a..6f2653ff 100644 --- a/rbi/knockapi/resources/tenants/bulk.rbi +++ b/rbi/knockapi/resources/tenants/bulk.rbi @@ -6,30 +6,36 @@ module Knockapi class Bulk # Delete multiple tenants in a single operation. This operation cannot be undone. sig do - params(tenant_ids: T::Array[String], request_options: Knockapi::RequestOpts) - .returns(Knockapi::Models::BulkOperation) + params( + tenant_ids: T::Array[String], + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::BulkOperation) end def delete( # The IDs of the tenants to delete. tenant_ids:, request_options: {} - ); end + ) + end + # Set or update up to 1,000 tenants in a single operation. sig do params( - tenants: T::Array[T.any(String, Knockapi::Models::TenantRequest, Knockapi::Internal::AnyHash)], - request_options: Knockapi::RequestOpts - ) - .returns(Knockapi::Models::BulkOperation) + tenants: T::Array[T.any(String, Knockapi::TenantRequest::OrHash)], + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::BulkOperation) end def set( # The tenants to be upserted. tenants:, request_options: {} - ); end + ) + end + # @api private sig { params(client: Knockapi::Client).returns(T.attached_class) } - def self.new(client:); end + def self.new(client:) + end end end end diff --git a/rbi/knockapi/resources/users.rbi b/rbi/knockapi/resources/users.rbi index f99f1977..cb023704 100644 --- a/rbi/knockapi/resources/users.rbi +++ b/rbi/knockapi/resources/users.rbi @@ -19,21 +19,34 @@ module Knockapi params( user_id: String, avatar: T.nilable(String), - channel_data: T.nilable( - T::Hash[Symbol, T.any(Knockapi::Models::Recipients::ChannelDataRequest, Knockapi::Internal::AnyHash)] - ), + channel_data: + T.nilable( + T::Hash[ + Symbol, + T.any( + Knockapi::Recipients::PushChannelData::OrHash, + Knockapi::Recipients::OneSignalChannelData::OrHash, + Knockapi::Recipients::SlackChannelData::OrHash, + Knockapi::Recipients::MsTeamsChannelData::OrHash, + Knockapi::Recipients::DiscordChannelData::OrHash + ) + ] + ), created_at: T.nilable(Time), email: T.nilable(String), locale: T.nilable(String), name: T.nilable(String), phone_number: T.nilable(String), - preferences: T.nilable( - T::Hash[Symbol, T.any(Knockapi::Models::Recipients::PreferenceSetRequest, Knockapi::Internal::AnyHash)] - ), + preferences: + T.nilable( + T::Hash[ + Symbol, + Knockapi::Recipients::PreferenceSetRequest::OrHash + ] + ), timezone: T.nilable(String), - request_options: Knockapi::RequestOpts - ) - .returns(Knockapi::Models::User) + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::User) end def update( # The ID for the user that you set when identifying them in Knock. @@ -50,29 +63,30 @@ module Knockapi locale: nil, # Display name of the user. name: nil, - # The [E.164](https://www.twilio.com/docs/glossary/what-e164) phone number of the + # The [E.164](https://www.twilio.com/docs/glossary/what-e164) phone number of the # user (required for SMS channels). phone_number: nil, # Inline set preferences for a recipient, where the key is the preference set id. preferences: nil, - # The timezone of the user. Must be a valid - # [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). - # Used for - # [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients). + # The timezone of the user. Must be a + # valid [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + # Used + # for [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients). timezone: nil, request_options: {} - ); end + ) + end + # Retrieve a paginated list of users in the environment. Defaults to 50 users per # page. sig do params( after: String, before: String, - include: T::Array[Knockapi::Models::UserListParams::Include::OrSymbol], + include: T::Array[Knockapi::UserListParams::Include::OrSymbol], page_size: Integer, - request_options: Knockapi::RequestOpts - ) - .returns(Knockapi::Internal::EntriesCursor[Knockapi::Models::User]) + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Internal::EntriesCursor[Knockapi::User]) end def list( # The cursor to fetch entries after. @@ -84,25 +98,44 @@ module Knockapi # The number of items per page. page_size: nil, request_options: {} - ); end + ) + end + # Permanently delete a user and all associated data. - sig { params(user_id: String, request_options: Knockapi::RequestOpts).returns(String) } + sig do + params( + user_id: String, + request_options: Knockapi::RequestOptions::OrHash + ).returns(String) + end def delete( # The ID of the user to delete. user_id, request_options: {} - ); end + ) + end + # Retrieve a specific user by their ID. - sig { params(user_id: String, request_options: Knockapi::RequestOpts).returns(Knockapi::Models::User) } + sig do + params( + user_id: String, + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::User) + end def get( # The ID of the user to retrieve. user_id, request_options: {} - ); end + ) + end + # Retrieves the channel data for a specific user and channel ID. sig do - params(user_id: String, channel_id: String, request_options: Knockapi::RequestOpts) - .returns(Knockapi::Models::Recipients::RecipientsChannelData) + params( + user_id: String, + channel_id: String, + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Recipients::RecipientsChannelData) end def get_channel_data( # The ID for the user that you set when identifying them in Knock. @@ -110,12 +143,18 @@ module Knockapi # The unique identifier for the channel. channel_id, request_options: {} - ); end + ) + end + # Retrieves a specific preference set for a user identified by the preference set # ID. sig do - params(user_id: String, id: String, tenant: String, request_options: Knockapi::RequestOpts) - .returns(Knockapi::Models::Recipients::PreferenceSet) + params( + user_id: String, + id: String, + tenant: String, + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Recipients::PreferenceSet) end def get_preferences( # The ID for the user that you set when identifying them in Knock. @@ -125,7 +164,9 @@ module Knockapi # The unique identifier for the tenant. tenant: nil, request_options: {} - ); end + ) + end + # Returns a paginated list of messages for a specific user. Allows filtering by # message status and provides various sorting options. Messages outside the # account's retention window will not be included in the results. @@ -135,20 +176,22 @@ module Knockapi after: String, before: String, channel_id: String, - engagement_status: T::Array[Knockapi::Models::UserListMessagesParams::EngagementStatus::OrSymbol], - inserted_at: T.any(Knockapi::Models::UserListMessagesParams::InsertedAt, Knockapi::Internal::AnyHash), + engagement_status: + T::Array[ + Knockapi::UserListMessagesParams::EngagementStatus::OrSymbol + ], + inserted_at: Knockapi::UserListMessagesParams::InsertedAt::OrHash, message_ids: T::Array[String], page_size: Integer, source: String, - status: T::Array[Knockapi::Models::UserListMessagesParams::Status::OrSymbol], + status: T::Array[Knockapi::UserListMessagesParams::Status::OrSymbol], tenant: String, trigger_data: String, workflow_categories: T::Array[String], workflow_recipient_run_id: String, workflow_run_id: String, - request_options: Knockapi::RequestOpts - ) - .returns(Knockapi::Internal::EntriesCursor[Knockapi::Models::Message]) + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Internal::EntriesCursor[Knockapi::Message]) end def list_messages( # The user ID to list messages for. @@ -185,17 +228,23 @@ module Knockapi # returned by the workflow trigger request. workflow_run_id: nil, request_options: {} - ); end + ) + end + # Retrieves a list of all preference sets for a specific user. sig do - params(user_id: String, request_options: Knockapi::RequestOpts) - .returns(T::Array[Knockapi::Models::Recipients::PreferenceSet]) + params( + user_id: String, + request_options: Knockapi::RequestOptions::OrHash + ).returns(T::Array[Knockapi::Recipients::PreferenceSet]) end def list_preferences( # The ID for the user that you set when identifying them in Knock. user_id, request_options: {} - ); end + ) + end + # Returns a paginated list of schedules for a specific user, in descending order. sig do params( @@ -205,9 +254,8 @@ module Knockapi page_size: Integer, tenant: String, workflow: String, - request_options: Knockapi::RequestOpts - ) - .returns(Knockapi::Internal::EntriesCursor[Knockapi::Models::Schedule]) + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Internal::EntriesCursor[Knockapi::Schedule]) end def list_schedules( # The user ID to list schedules for. @@ -223,7 +271,9 @@ module Knockapi # The workflow key to filter schedules for. workflow: nil, request_options: {} - ); end + ) + end + # Retrieves a paginated list of subscriptions for a specific user, in descending # order. sig do @@ -231,12 +281,14 @@ module Knockapi user_id: String, after: String, before: String, - include: T::Array[Knockapi::Models::UserListSubscriptionsParams::Include::OrSymbol], + include: + T::Array[Knockapi::UserListSubscriptionsParams::Include::OrSymbol], objects: T::Array[String], page_size: Integer, - request_options: Knockapi::RequestOpts + request_options: Knockapi::RequestOptions::OrHash + ).returns( + Knockapi::Internal::EntriesCursor[Knockapi::Recipients::Subscription] ) - .returns(Knockapi::Internal::EntriesCursor[Knockapi::Models::Recipients::Subscription]) end def list_subscriptions( # The user ID to list subscriptions for. @@ -252,12 +304,17 @@ module Knockapi # The number of items per page. page_size: nil, request_options: {} - ); end + ) + end + # Merge two users together, where the user specified with the `from_user_id` param # will be merged into the user specified by `user_id`. sig do - params(user_id: String, from_user_id: String, request_options: Knockapi::RequestOpts) - .returns(Knockapi::Models::User) + params( + user_id: String, + from_user_id: String, + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::User) end def merge( # The id of the user to merge into. @@ -265,23 +322,24 @@ module Knockapi # The user ID to merge from. from_user_id:, request_options: {} - ); end + ) + end + # Updates or creates channel data for a specific user and channel ID. sig do params( user_id: String, channel_id: String, - data: T.any( - Knockapi::Models::Recipients::PushChannelData, - Knockapi::Internal::AnyHash, - Knockapi::Models::Recipients::OneSignalChannelData, - Knockapi::Models::Recipients::SlackChannelData, - Knockapi::Models::Recipients::MsTeamsChannelData, - Knockapi::Models::Recipients::DiscordChannelData - ), - request_options: Knockapi::RequestOpts - ) - .returns(Knockapi::Models::Recipients::RecipientsChannelData) + data: + T.any( + Knockapi::Recipients::PushChannelData::OrHash, + Knockapi::Recipients::OneSignalChannelData::OrHash, + Knockapi::Recipients::SlackChannelData::OrHash, + Knockapi::Recipients::MsTeamsChannelData::OrHash, + Knockapi::Recipients::DiscordChannelData::OrHash + ), + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Recipients::RecipientsChannelData) end def set_channel_data( # The ID for the user that you set when identifying them in Knock. @@ -291,37 +349,39 @@ module Knockapi # Channel data for a given channel type. data:, request_options: {} - ); end + ) + end + # Updates a complete preference set for a user. This is a destructive operation # that will replace the existing preference set for the user. sig do params( user_id: String, id: String, - categories: T.nilable( - T::Hash[ - Symbol, - T.any( - T::Boolean, - Knockapi::Models::Recipients::PreferenceSetRequest::Category::PreferenceSetWorkflowCategorySettingObject, - Knockapi::Internal::AnyHash - ) - ] - ), - channel_types: T.nilable(T.any(Knockapi::Models::Recipients::PreferenceSetChannelTypes, Knockapi::Internal::AnyHash)), - workflows: T.nilable( - T::Hash[ - Symbol, - T.any( - T::Boolean, - Knockapi::Models::Recipients::PreferenceSetRequest::Workflow::PreferenceSetWorkflowCategorySettingObject, - Knockapi::Internal::AnyHash - ) - ] - ), - request_options: Knockapi::RequestOpts - ) - .returns(Knockapi::Models::Recipients::PreferenceSet) + categories: + T.nilable( + T::Hash[ + Symbol, + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetRequest::Category::PreferenceSetWorkflowCategorySettingObject::OrHash + ) + ] + ), + channel_types: + T.nilable(Knockapi::Recipients::PreferenceSetChannelTypes::OrHash), + workflows: + T.nilable( + T::Hash[ + Symbol, + T.any( + T::Boolean, + Knockapi::Recipients::PreferenceSetRequest::Workflow::PreferenceSetWorkflowCategorySettingObject::OrHash + ) + ] + ), + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Recipients::PreferenceSet) end def set_preferences( # The ID for the user that you set when identifying them in Knock. @@ -337,10 +397,16 @@ module Knockapi # settings for that workflow. workflows: nil, request_options: {} - ); end + ) + end + # Deletes channel data for a specific user and channel ID. sig do - params(user_id: String, channel_id: String, request_options: Knockapi::RequestOpts).returns(String) + params( + user_id: String, + channel_id: String, + request_options: Knockapi::RequestOptions::OrHash + ).returns(String) end def unset_channel_data( # The ID for the user that you set when identifying them in Knock. @@ -348,10 +414,13 @@ module Knockapi # The unique identifier for the channel. channel_id, request_options: {} - ); end + ) + end + # @api private sig { params(client: Knockapi::Client).returns(T.attached_class) } - def self.new(client:); end + def self.new(client:) + end end end end diff --git a/rbi/knockapi/resources/users/bulk.rbi b/rbi/knockapi/resources/users/bulk.rbi index 3667fdb2..5daeb769 100644 --- a/rbi/knockapi/resources/users/bulk.rbi +++ b/rbi/knockapi/resources/users/bulk.rbi @@ -7,39 +7,43 @@ module Knockapi # Deletes multiple users in a single operation. Accepts up to 100 user IDs to # delete and returns a bulk operation that can be queried for progress. sig do - params(user_ids: T::Array[String], request_options: Knockapi::RequestOpts) - .returns(Knockapi::Models::BulkOperation) + params( + user_ids: T::Array[String], + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::BulkOperation) end def delete( # A list of user IDs. user_ids:, request_options: {} - ); end + ) + end + # Identifies multiple users in a single operation. Allows creating or updating up # to 100 users in a single batch with various properties, preferences, and channel # data. sig do params( - users: T::Array[T.any(Knockapi::Models::InlineIdentifyUserRequest, Knockapi::Internal::AnyHash)], - request_options: Knockapi::RequestOpts - ) - .returns(Knockapi::Models::BulkOperation) + users: T::Array[Knockapi::InlineIdentifyUserRequest::OrHash], + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::BulkOperation) end def identify( # A list of users. users:, request_options: {} - ); end + ) + end + # Sets preferences for multiple users in a single operation. Supports either # setting the same preferences for multiple users or specific preferences for each # user. sig do params( - preferences: T.any(Knockapi::Models::Recipients::PreferenceSetRequest, Knockapi::Internal::AnyHash), + preferences: Knockapi::Recipients::PreferenceSetRequest::OrHash, user_ids: T::Array[String], - request_options: Knockapi::RequestOpts - ) - .returns(Knockapi::Models::BulkOperation) + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::BulkOperation) end def set_preferences( # A request to set a preference set for a recipient. @@ -47,10 +51,13 @@ module Knockapi # A list of user IDs. user_ids:, request_options: {} - ); end + ) + end + # @api private sig { params(client: Knockapi::Client).returns(T.attached_class) } - def self.new(client:); end + def self.new(client:) + end end end end diff --git a/rbi/knockapi/resources/users/feeds.rbi b/rbi/knockapi/resources/users/feeds.rbi index b459af51..f8781fe8 100644 --- a/rbi/knockapi/resources/users/feeds.rbi +++ b/rbi/knockapi/resources/users/feeds.rbi @@ -6,8 +6,11 @@ module Knockapi class Feeds # Returns the feed settings for a user. sig do - params(user_id: String, id: String, request_options: Knockapi::RequestOpts) - .returns(Knockapi::Models::Users::FeedGetSettingsResponse) + params( + user_id: String, + id: String, + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Models::Users::FeedGetSettingsResponse) end def get_settings( # The ID for the user that you set when identifying them in Knock. @@ -15,7 +18,9 @@ module Knockapi # The unique identifier for the channel. id, request_options: {} - ); end + ) + end + # Returns a paginated list of feed items for a user, including metadata about the # feed. sig do @@ -23,18 +28,21 @@ module Knockapi user_id: String, id: String, after: String, - archived: Knockapi::Models::Users::FeedListItemsParams::Archived::OrSymbol, + archived: Knockapi::Users::FeedListItemsParams::Archived::OrSymbol, before: String, has_tenant: T::Boolean, page_size: Integer, source: String, - status: Knockapi::Models::Users::FeedListItemsParams::Status::OrSymbol, + status: Knockapi::Users::FeedListItemsParams::Status::OrSymbol, tenant: String, trigger_data: String, workflow_categories: T::Array[String], - request_options: Knockapi::RequestOpts + request_options: Knockapi::RequestOptions::OrHash + ).returns( + Knockapi::Internal::EntriesCursor[ + Knockapi::Models::Users::FeedListItemsResponse + ] ) - .returns(Knockapi::Internal::EntriesCursor[Knockapi::Models::Users::FeedListItemsResponse]) end def list_items( # The ID for the user that you set when identifying them in Knock. @@ -62,10 +70,13 @@ module Knockapi # The workflow categories of the feed items. workflow_categories: nil, request_options: {} - ); end + ) + end + # @api private sig { params(client: Knockapi::Client).returns(T.attached_class) } - def self.new(client:); end + def self.new(client:) + end end end end diff --git a/rbi/knockapi/resources/users/guides.rbi b/rbi/knockapi/resources/users/guides.rbi index 1dcfd97e..9dfc5576 100644 --- a/rbi/knockapi/resources/users/guides.rbi +++ b/rbi/knockapi/resources/users/guides.rbi @@ -12,9 +12,8 @@ module Knockapi data: String, tenant: String, type: String, - request_options: Knockapi::RequestOpts - ) - .returns(Knockapi::Models::Users::GuideGetChannelResponse) + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Models::Users::GuideGetChannelResponse) end def get_channel( # The ID for the user that you set when identifying them in Knock. @@ -28,7 +27,9 @@ module Knockapi # The type of guides to filter by. type: nil, request_options: {} - ); end + ) + end + # Records that a guide has been archived by a user, triggering any associated # archived events. sig do @@ -44,9 +45,8 @@ module Knockapi is_final: T::Boolean, metadata: T::Hash[Symbol, T.anything], tenant: T.nilable(String), - request_options: Knockapi::RequestOpts - ) - .returns(Knockapi::Models::Users::GuideMarkMessageAsArchivedResponse) + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Models::Users::GuideMarkMessageAsArchivedResponse) end def mark_message_as_archived( # The ID for the user that you set when identifying them in Knock. @@ -72,7 +72,9 @@ module Knockapi # The tenant ID of the guide. tenant: nil, request_options: {} - ); end + ) + end + # Records that a user has interacted with a guide, triggering any associated # interacted events. sig do @@ -88,9 +90,10 @@ module Knockapi is_final: T::Boolean, metadata: T::Hash[Symbol, T.anything], tenant: T.nilable(String), - request_options: Knockapi::RequestOpts + request_options: Knockapi::RequestOptions::OrHash + ).returns( + Knockapi::Models::Users::GuideMarkMessageAsInteractedResponse ) - .returns(Knockapi::Models::Users::GuideMarkMessageAsInteractedResponse) end def mark_message_as_interacted( # The ID for the user that you set when identifying them in Knock. @@ -116,7 +119,9 @@ module Knockapi # The tenant ID of the guide. tenant: nil, request_options: {} - ); end + ) + end + # Records that a guide has been seen by a user, triggering any associated seen # events. sig do @@ -132,9 +137,8 @@ module Knockapi is_final: T::Boolean, metadata: T::Hash[Symbol, T.anything], tenant: T.nilable(String), - request_options: Knockapi::RequestOpts - ) - .returns(Knockapi::Models::Users::GuideMarkMessageAsSeenResponse) + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Models::Users::GuideMarkMessageAsSeenResponse) end def mark_message_as_seen( # The ID for the user that you set when identifying them in Knock. @@ -160,10 +164,13 @@ module Knockapi # The tenant ID of the guide. tenant: nil, request_options: {} - ); end + ) + end + # @api private sig { params(client: Knockapi::Client).returns(T.attached_class) } - def self.new(client:); end + def self.new(client:) + end end end end diff --git a/rbi/knockapi/resources/workflows.rbi b/rbi/knockapi/resources/workflows.rbi index 75f0effe..02bcf3b8 100644 --- a/rbi/knockapi/resources/workflows.rbi +++ b/rbi/knockapi/resources/workflows.rbi @@ -10,12 +10,17 @@ module Knockapi params( key: String, cancellation_key: String, - recipients: T.nilable( - T::Array[T.any(String, Knockapi::Models::RecipientReference::ObjectReference, Knockapi::Internal::AnyHash)] - ), - request_options: Knockapi::RequestOpts - ) - .returns(String) + recipients: + T.nilable( + T::Array[ + T.any( + String, + Knockapi::RecipientReference::ObjectReference::OrHash + ) + ] + ), + request_options: Knockapi::RequestOptions::OrHash + ).returns(String) end def cancel( # The key of the workflow to cancel. @@ -30,7 +35,9 @@ module Knockapi # recipients associated with the cancellation key. recipients: nil, request_options: {} - ); end + ) + end + # Trigger a workflow (specified by the key) to run for the given recipients, using # the parameters provided. Returns an identifier for the workflow run request. All # workflow runs are executed asynchronously. This endpoint also handles @@ -39,28 +46,27 @@ module Knockapi sig do params( key: String, - recipients: T::Array[ - T.any( - String, - Knockapi::Models::InlineIdentifyUserRequest, - Knockapi::Internal::AnyHash, - Knockapi::Models::InlineObjectRequest - ) - ], - actor: T.nilable( - T.any( - String, - Knockapi::Models::InlineIdentifyUserRequest, - Knockapi::Internal::AnyHash, - Knockapi::Models::InlineObjectRequest - ) - ), + recipients: + T::Array[ + T.any( + String, + Knockapi::InlineIdentifyUserRequest::OrHash, + Knockapi::InlineObjectRequest::OrHash + ) + ], + actor: + T.nilable( + T.any( + String, + Knockapi::InlineIdentifyUserRequest::OrHash, + Knockapi::InlineObjectRequest::OrHash + ) + ), cancellation_key: T.nilable(String), data: T.nilable(T::Hash[Symbol, T.anything]), - tenant: T.nilable(T.any(String, Knockapi::Models::TenantRequest, Knockapi::Internal::AnyHash)), - request_options: Knockapi::RequestOpts - ) - .returns(Knockapi::Models::WorkflowTriggerResponse) + tenant: T.nilable(T.any(String, Knockapi::TenantRequest::OrHash)), + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::Models::WorkflowTriggerResponse) end def trigger( # Key of the workflow to trigger. @@ -83,10 +89,13 @@ module Knockapi # An request to set a tenant inline. tenant: nil, request_options: {} - ); end + ) + end + # @api private sig { params(client: Knockapi::Client).returns(T.attached_class) } - def self.new(client:); end + def self.new(client:) + end end end end diff --git a/sig/knockapi/internal.rbs b/sig/knockapi/internal.rbs index c3e9c9de..9bc0c4fd 100644 --- a/sig/knockapi/internal.rbs +++ b/sig/knockapi/internal.rbs @@ -1,5 +1,7 @@ module Knockapi module Internal + extend Knockapi::Internal::Util::SorbetRuntimeSupport + OMIT: Object end end diff --git a/sig/knockapi/internal/entries_cursor.rbs b/sig/knockapi/internal/entries_cursor.rbs index 8dfa32ce..968223c7 100644 --- a/sig/knockapi/internal/entries_cursor.rbs +++ b/sig/knockapi/internal/entries_cursor.rbs @@ -16,8 +16,6 @@ module Knockapi def after=: (String) -> String def initialize: (?after: String) -> void - - def to_hash: -> page_info end end end diff --git a/sig/knockapi/internal/items_cursor.rbs b/sig/knockapi/internal/items_cursor.rbs index 2a1d1a14..f3fcb075 100644 --- a/sig/knockapi/internal/items_cursor.rbs +++ b/sig/knockapi/internal/items_cursor.rbs @@ -16,8 +16,6 @@ module Knockapi def after=: (String) -> String def initialize: (?after: String) -> void - - def to_hash: -> page_info end end end diff --git a/sig/knockapi/internal/transport/base_client.rbs b/sig/knockapi/internal/transport/base_client.rbs index ede5894b..1715e799 100644 --- a/sig/knockapi/internal/transport/base_client.rbs +++ b/sig/knockapi/internal/transport/base_client.rbs @@ -2,6 +2,8 @@ module Knockapi module Internal module Transport class BaseClient + extend Knockapi::Internal::Util::SorbetRuntimeSupport + type request_components = { method: Symbol, @@ -20,7 +22,6 @@ module Knockapi model: Knockapi::Internal::Type::Converter::input?, options: Knockapi::request_opts? } - type request_input = { method: Symbol, @@ -55,6 +56,20 @@ module Knockapi stream: Enumerable[String]? ) -> void + attr_reader base_url: URI::Generic + + attr_reader timeout: Float + + attr_reader max_retries: Integer + + attr_reader initial_retry_delay: Float + + attr_reader max_retry_delay: Float + + attr_reader headers: ::Hash[String, String] + + attr_reader idempotency_header: String? + # @api private attr_reader requester: Knockapi::Internal::Transport::PooledNetRequester diff --git a/sig/knockapi/internal/transport/pooled_net_requester.rbs b/sig/knockapi/internal/transport/pooled_net_requester.rbs index f73f7c98..045cabe6 100644 --- a/sig/knockapi/internal/transport/pooled_net_requester.rbs +++ b/sig/knockapi/internal/transport/pooled_net_requester.rbs @@ -2,6 +2,8 @@ module Knockapi module Internal module Transport class PooledNetRequester + extend Knockapi::Internal::Util::SorbetRuntimeSupport + type request = { method: Symbol, @@ -13,6 +15,8 @@ module Knockapi KEEP_ALIVE_TIMEOUT: 30 + DEFAULT_MAX_CONNECTIONS: Integer + def self.connect: (URI::Generic url) -> top def self.calibrate_socket_timeout: (top conn, Float deadline) -> void diff --git a/sig/knockapi/internal/type/base_model.rbs b/sig/knockapi/internal/type/base_model.rbs index f2c11dc2..cc659f67 100644 --- a/sig/knockapi/internal/type/base_model.rbs +++ b/sig/knockapi/internal/type/base_model.rbs @@ -3,10 +3,13 @@ module Knockapi module Type class BaseModel extend Knockapi::Internal::Type::Converter + extend Knockapi::Internal::Util::SorbetRuntimeSupport type known_field = { mode: (:coerce | :dump)?, required: bool, nilable: bool } + def self.inherited: (self child) -> void + def self.known_fields: -> ::Hash[Symbol, (Knockapi::Internal::Type::BaseModel::known_field & { type_fn: (^-> Knockapi::Internal::Type::Converter::input) })] @@ -65,23 +68,26 @@ module Knockapi state: Knockapi::Internal::Type::Converter::dump_state ) -> (::Hash[top, top] | top) + def self.recursively_to_h: ( + Knockapi::Internal::Type::BaseModel model, + convert: bool + ) -> ::Hash[Symbol, top] + def []: (Symbol key) -> top? def to_h: -> ::Hash[Symbol, top] alias to_hash to_h - def deconstruct_keys: (::Array[Symbol]? keys) -> ::Hash[Symbol, top] + def deep_to_h: -> ::Hash[Symbol, top] - def self.walk: ( - Knockapi::Internal::Type::BaseModel model - ) -> ::Hash[Symbol, top] + def deconstruct_keys: (::Array[Symbol]? keys) -> ::Hash[Symbol, top] def to_json: (*top a) -> String def to_yaml: (*top a) -> String - def initialize: (?::Hash[Symbol, top] | self data) -> void + def initialize: (?::Hash[Symbol, top] | instance data) -> void def self.inspect: (?depth: Integer) -> String diff --git a/sig/knockapi/internal/type/base_page.rbs b/sig/knockapi/internal/type/base_page.rbs index afee0417..309944ab 100644 --- a/sig/knockapi/internal/type/base_page.rbs +++ b/sig/knockapi/internal/type/base_page.rbs @@ -4,7 +4,7 @@ module Knockapi module BasePage[Elem] def next_page?: -> bool - def next_page: -> self + def next_page: -> instance def auto_paging_each: { (Elem arg0) -> void } -> void diff --git a/sig/knockapi/internal/type/converter.rbs b/sig/knockapi/internal/type/converter.rbs index b6f79ec3..e2d14edb 100644 --- a/sig/knockapi/internal/type/converter.rbs +++ b/sig/knockapi/internal/type/converter.rbs @@ -2,6 +2,8 @@ module Knockapi module Internal module Type module Converter + extend Knockapi::Internal::Util::SorbetRuntimeSupport + type input = Knockapi::Internal::Type::Converter | Class type coerce_state = diff --git a/sig/knockapi/internal/type/enum.rbs b/sig/knockapi/internal/type/enum.rbs index bf6c6196..fd227505 100644 --- a/sig/knockapi/internal/type/enum.rbs +++ b/sig/knockapi/internal/type/enum.rbs @@ -3,6 +3,7 @@ module Knockapi module Type module Enum include Knockapi::Internal::Type::Converter + include Knockapi::Internal::Util::SorbetRuntimeSupport def self.values: -> ::Array[(nil | bool | Integer | Float | Symbol)] diff --git a/sig/knockapi/internal/type/request_parameters.rbs b/sig/knockapi/internal/type/request_parameters.rbs index f6f719f1..af79656a 100644 --- a/sig/knockapi/internal/type/request_parameters.rbs +++ b/sig/knockapi/internal/type/request_parameters.rbs @@ -4,7 +4,9 @@ module Knockapi type request_parameters = { request_options: Knockapi::request_opts } module RequestParameters - attr_accessor request_options: Knockapi::request_opts + attr_reader request_options: Knockapi::request_opts + + def request_options=: (Knockapi::request_opts) -> Knockapi::request_opts module Converter def dump_request: (top params) -> [top, ::Hash[Symbol, top]] diff --git a/sig/knockapi/internal/type/union.rbs b/sig/knockapi/internal/type/union.rbs index 6826d250..27a2cde7 100644 --- a/sig/knockapi/internal/type/union.rbs +++ b/sig/knockapi/internal/type/union.rbs @@ -3,6 +3,7 @@ module Knockapi module Type module Union include Knockapi::Internal::Type::Converter + include Knockapi::Internal::Util::SorbetRuntimeSupport private def self.known_variants: -> ::Array[[Symbol?, (^-> Knockapi::Internal::Type::Converter::input)]] diff --git a/sig/knockapi/internal/util.rbs b/sig/knockapi/internal/util.rbs index 85da4a36..f086c64b 100644 --- a/sig/knockapi/internal/util.rbs +++ b/sig/knockapi/internal/util.rbs @@ -1,6 +1,8 @@ module Knockapi module Internal module Util + extend Knockapi::Internal::Util::SorbetRuntimeSupport + def self?.monotonic_secs: -> Float def self?.arch: -> String @@ -19,6 +21,8 @@ module Knockapi def self?.coerce_hash: (top input) -> (::Hash[top, top] | top) + def self?.coerce_hash!: (top input) -> ::Hash[top, top]? + def self?.deep_merge_lr: (top lhs, top rhs, ?concat: bool) -> top def self?.deep_merge: ( @@ -153,6 +157,17 @@ module Knockapi def self?.decode_sse: ( Enumerable[String] lines ) -> Enumerable[Knockapi::Internal::Util::server_sent_event] + + module SorbetRuntimeSupport + class MissingSorbetRuntimeError < ::RuntimeError + end + + private def sorbet_runtime_constants: -> ::Hash[Symbol, top] + + def const_missing: (Symbol name) -> void + + def define_sorbet_constant!: (Symbol name) { -> top } -> void + end end end end diff --git a/sig/knockapi/models.rbs b/sig/knockapi/models.rbs new file mode 100644 index 00000000..7fd3a3ac --- /dev/null +++ b/sig/knockapi/models.rbs @@ -0,0 +1,173 @@ +module Knockapi + class Activity = Knockapi::Models::Activity + + class AudienceAddMembersParams = Knockapi::Models::AudienceAddMembersParams + + class AudienceListMembersParams = Knockapi::Models::AudienceListMembersParams + + class AudienceMember = Knockapi::Models::AudienceMember + + class AudienceRemoveMembersParams = Knockapi::Models::AudienceRemoveMembersParams + + class BulkOperation = Knockapi::Models::BulkOperation + + class BulkOperationGetParams = Knockapi::Models::BulkOperationGetParams + + module Channels = Knockapi::Models::Channels + + class Condition = Knockapi::Models::Condition + + class IdentifyUserRequest = Knockapi::Models::IdentifyUserRequest + + class InlineIdentifyUserRequest = Knockapi::Models::InlineIdentifyUserRequest + + class InlineObjectRequest = Knockapi::Models::InlineObjectRequest + + module InlineTenantRequest = Knockapi::Models::InlineTenantRequest + + module Integrations = Knockapi::Models::Integrations + + class Message = Knockapi::Models::Message + + class MessageArchiveParams = Knockapi::Models::MessageArchiveParams + + class MessageDeliveryLog = Knockapi::Models::MessageDeliveryLog + + class MessageEvent = Knockapi::Models::MessageEvent + + class MessageGetContentParams = Knockapi::Models::MessageGetContentParams + + class MessageGetParams = Knockapi::Models::MessageGetParams + + class MessageListActivitiesParams = Knockapi::Models::MessageListActivitiesParams + + class MessageListDeliveryLogsParams = Knockapi::Models::MessageListDeliveryLogsParams + + class MessageListEventsParams = Knockapi::Models::MessageListEventsParams + + class MessageListParams = Knockapi::Models::MessageListParams + + class MessageMarkAsInteractedParams = Knockapi::Models::MessageMarkAsInteractedParams + + class MessageMarkAsReadParams = Knockapi::Models::MessageMarkAsReadParams + + class MessageMarkAsSeenParams = Knockapi::Models::MessageMarkAsSeenParams + + class MessageMarkAsUnreadParams = Knockapi::Models::MessageMarkAsUnreadParams + + class MessageMarkAsUnseenParams = Knockapi::Models::MessageMarkAsUnseenParams + + module Messages = Knockapi::Models::Messages + + class MessageUnarchiveParams = Knockapi::Models::MessageUnarchiveParams + + class Object = Knockapi::Models::Object + + class ObjectAddSubscriptionsParams = Knockapi::Models::ObjectAddSubscriptionsParams + + class ObjectDeleteParams = Knockapi::Models::ObjectDeleteParams + + class ObjectDeleteSubscriptionsParams = Knockapi::Models::ObjectDeleteSubscriptionsParams + + class ObjectGetChannelDataParams = Knockapi::Models::ObjectGetChannelDataParams + + class ObjectGetParams = Knockapi::Models::ObjectGetParams + + class ObjectGetPreferencesParams = Knockapi::Models::ObjectGetPreferencesParams + + class ObjectListMessagesParams = Knockapi::Models::ObjectListMessagesParams + + class ObjectListParams = Knockapi::Models::ObjectListParams + + class ObjectListPreferencesParams = Knockapi::Models::ObjectListPreferencesParams + + class ObjectListSchedulesParams = Knockapi::Models::ObjectListSchedulesParams + + class ObjectListSubscriptionsParams = Knockapi::Models::ObjectListSubscriptionsParams + + module Objects = Knockapi::Models::Objects + + class ObjectSetChannelDataParams = Knockapi::Models::ObjectSetChannelDataParams + + class ObjectSetParams = Knockapi::Models::ObjectSetParams + + class ObjectSetPreferencesParams = Knockapi::Models::ObjectSetPreferencesParams + + class ObjectUnsetChannelDataParams = Knockapi::Models::ObjectUnsetChannelDataParams + + class PageInfo = Knockapi::Models::PageInfo + + module Providers = Knockapi::Models::Providers + + module Recipient = Knockapi::Models::Recipient + + module RecipientReference = Knockapi::Models::RecipientReference + + module RecipientRequest = Knockapi::Models::RecipientRequest + + module Recipients = Knockapi::Models::Recipients + + class Schedule = Knockapi::Models::Schedule + + class ScheduleCreateParams = Knockapi::Models::ScheduleCreateParams + + class ScheduleDeleteParams = Knockapi::Models::ScheduleDeleteParams + + class ScheduleListParams = Knockapi::Models::ScheduleListParams + + class ScheduleRepeatRule = Knockapi::Models::ScheduleRepeatRule + + module Schedules = Knockapi::Models::Schedules + + class ScheduleUpdateParams = Knockapi::Models::ScheduleUpdateParams + + class Tenant = Knockapi::Models::Tenant + + class TenantDeleteParams = Knockapi::Models::TenantDeleteParams + + class TenantGetParams = Knockapi::Models::TenantGetParams + + class TenantListParams = Knockapi::Models::TenantListParams + + class TenantRequest = Knockapi::Models::TenantRequest + + module Tenants = Knockapi::Models::Tenants + + class TenantSetParams = Knockapi::Models::TenantSetParams + + class User = Knockapi::Models::User + + class UserDeleteParams = Knockapi::Models::UserDeleteParams + + class UserGetChannelDataParams = Knockapi::Models::UserGetChannelDataParams + + class UserGetParams = Knockapi::Models::UserGetParams + + class UserGetPreferencesParams = Knockapi::Models::UserGetPreferencesParams + + class UserListMessagesParams = Knockapi::Models::UserListMessagesParams + + class UserListParams = Knockapi::Models::UserListParams + + class UserListPreferencesParams = Knockapi::Models::UserListPreferencesParams + + class UserListSchedulesParams = Knockapi::Models::UserListSchedulesParams + + class UserListSubscriptionsParams = Knockapi::Models::UserListSubscriptionsParams + + class UserMergeParams = Knockapi::Models::UserMergeParams + + module Users = Knockapi::Models::Users + + class UserSetChannelDataParams = Knockapi::Models::UserSetChannelDataParams + + class UserSetPreferencesParams = Knockapi::Models::UserSetPreferencesParams + + class UserUnsetChannelDataParams = Knockapi::Models::UserUnsetChannelDataParams + + class UserUpdateParams = Knockapi::Models::UserUpdateParams + + class WorkflowCancelParams = Knockapi::Models::WorkflowCancelParams + + class WorkflowTriggerParams = Knockapi::Models::WorkflowTriggerParams +end diff --git a/sig/knockapi/models/activity.rbs b/sig/knockapi/models/activity.rbs index 9063f943..d1647013 100644 --- a/sig/knockapi/models/activity.rbs +++ b/sig/knockapi/models/activity.rbs @@ -47,8 +47,6 @@ module Knockapi ?recipient: Knockapi::Models::recipient, ?updated_at: Time ) -> void - - def to_hash: -> Knockapi::Models::activity end end end diff --git a/sig/knockapi/models/audience_add_members_params.rbs b/sig/knockapi/models/audience_add_members_params.rbs index 3fe3ce46..358b937f 100644 --- a/sig/knockapi/models/audience_add_members_params.rbs +++ b/sig/knockapi/models/audience_add_members_params.rbs @@ -1,40 +1,36 @@ module Knockapi module Models type audience_add_members_params = - { members: ::Array[Knockapi::Models::AudienceAddMembersParams::Member] } + { members: ::Array[Knockapi::AudienceAddMembersParams::Member] } & Knockapi::Internal::Type::request_parameters class AudienceAddMembersParams < Knockapi::Internal::Type::BaseModel extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters - attr_accessor members: ::Array[Knockapi::Models::AudienceAddMembersParams::Member] + attr_accessor members: ::Array[Knockapi::AudienceAddMembersParams::Member] def initialize: ( - members: ::Array[Knockapi::Models::AudienceAddMembersParams::Member], + members: ::Array[Knockapi::AudienceAddMembersParams::Member], ?request_options: Knockapi::request_opts ) -> void - def to_hash: -> Knockapi::Models::audience_add_members_params - type member = { - user: Knockapi::Models::AudienceAddMembersParams::Member::User, + user: Knockapi::AudienceAddMembersParams::Member::User, tenant: String? } class Member < Knockapi::Internal::Type::BaseModel - attr_accessor user: Knockapi::Models::AudienceAddMembersParams::Member::User + attr_accessor user: Knockapi::AudienceAddMembersParams::Member::User attr_accessor tenant: String? def initialize: ( - user: Knockapi::Models::AudienceAddMembersParams::Member::User, + user: Knockapi::AudienceAddMembersParams::Member::User, ?tenant: String? ) -> void - def to_hash: -> Knockapi::Models::AudienceAddMembersParams::member - type user = { id: String } class User < Knockapi::Internal::Type::BaseModel @@ -43,8 +39,6 @@ module Knockapi def id=: (String) -> String def initialize: (?id: String) -> void - - def to_hash: -> Knockapi::Models::AudienceAddMembersParams::Member::user end end end diff --git a/sig/knockapi/models/audience_add_members_response.rbs b/sig/knockapi/models/audience_add_members_response.rbs new file mode 100644 index 00000000..d8a7e34d --- /dev/null +++ b/sig/knockapi/models/audience_add_members_response.rbs @@ -0,0 +1,5 @@ +module Knockapi + module Models + class AudienceAddMembersResponse = String + end +end diff --git a/sig/knockapi/models/audience_list_members_params.rbs b/sig/knockapi/models/audience_list_members_params.rbs index 81b5cf70..57280333 100644 --- a/sig/knockapi/models/audience_list_members_params.rbs +++ b/sig/knockapi/models/audience_list_members_params.rbs @@ -8,8 +8,6 @@ module Knockapi include Knockapi::Internal::Type::RequestParameters def initialize: (?request_options: Knockapi::request_opts) -> void - - def to_hash: -> Knockapi::Models::audience_list_members_params end end end diff --git a/sig/knockapi/models/audience_list_members_response.rbs b/sig/knockapi/models/audience_list_members_response.rbs index ccd64953..aafb913b 100644 --- a/sig/knockapi/models/audience_list_members_response.rbs +++ b/sig/knockapi/models/audience_list_members_response.rbs @@ -2,21 +2,19 @@ module Knockapi module Models type audience_list_members_response = { - entries: ::Array[Knockapi::Models::AudienceMember], - page_info: Knockapi::Models::PageInfo + entries: ::Array[Knockapi::AudienceMember], + page_info: Knockapi::PageInfo } class AudienceListMembersResponse < Knockapi::Internal::Type::BaseModel - attr_accessor entries: ::Array[Knockapi::Models::AudienceMember] + attr_accessor entries: ::Array[Knockapi::AudienceMember] - attr_accessor page_info: Knockapi::Models::PageInfo + attr_accessor page_info: Knockapi::PageInfo def initialize: ( - entries: ::Array[Knockapi::Models::AudienceMember], - page_info: Knockapi::Models::PageInfo + entries: ::Array[Knockapi::AudienceMember], + page_info: Knockapi::PageInfo ) -> void - - def to_hash: -> Knockapi::Models::audience_list_members_response end end end diff --git a/sig/knockapi/models/audience_member.rbs b/sig/knockapi/models/audience_member.rbs index 4d5eb045..28b9326c 100644 --- a/sig/knockapi/models/audience_member.rbs +++ b/sig/knockapi/models/audience_member.rbs @@ -4,7 +4,7 @@ module Knockapi { _typename: String, added_at: Time, - user: Knockapi::Models::User, + user: Knockapi::User, user_id: String, tenant: String? } @@ -14,7 +14,7 @@ module Knockapi attr_accessor added_at: Time - attr_accessor user: Knockapi::Models::User + attr_accessor user: Knockapi::User attr_accessor user_id: String @@ -23,12 +23,10 @@ module Knockapi def initialize: ( _typename: String, added_at: Time, - user: Knockapi::Models::User, + user: Knockapi::User, user_id: String, ?tenant: String? ) -> void - - def to_hash: -> Knockapi::Models::audience_member end end end diff --git a/sig/knockapi/models/audience_remove_members_params.rbs b/sig/knockapi/models/audience_remove_members_params.rbs index 0ff98859..f2ce35c3 100644 --- a/sig/knockapi/models/audience_remove_members_params.rbs +++ b/sig/knockapi/models/audience_remove_members_params.rbs @@ -1,42 +1,36 @@ module Knockapi module Models type audience_remove_members_params = - { - members: ::Array[Knockapi::Models::AudienceRemoveMembersParams::Member] - } + { members: ::Array[Knockapi::AudienceRemoveMembersParams::Member] } & Knockapi::Internal::Type::request_parameters class AudienceRemoveMembersParams < Knockapi::Internal::Type::BaseModel extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters - attr_accessor members: ::Array[Knockapi::Models::AudienceRemoveMembersParams::Member] + attr_accessor members: ::Array[Knockapi::AudienceRemoveMembersParams::Member] def initialize: ( - members: ::Array[Knockapi::Models::AudienceRemoveMembersParams::Member], + members: ::Array[Knockapi::AudienceRemoveMembersParams::Member], ?request_options: Knockapi::request_opts ) -> void - def to_hash: -> Knockapi::Models::audience_remove_members_params - type member = { - user: Knockapi::Models::AudienceRemoveMembersParams::Member::User, + user: Knockapi::AudienceRemoveMembersParams::Member::User, tenant: String? } class Member < Knockapi::Internal::Type::BaseModel - attr_accessor user: Knockapi::Models::AudienceRemoveMembersParams::Member::User + attr_accessor user: Knockapi::AudienceRemoveMembersParams::Member::User attr_accessor tenant: String? def initialize: ( - user: Knockapi::Models::AudienceRemoveMembersParams::Member::User, + user: Knockapi::AudienceRemoveMembersParams::Member::User, ?tenant: String? ) -> void - def to_hash: -> Knockapi::Models::AudienceRemoveMembersParams::member - type user = { id: String } class User < Knockapi::Internal::Type::BaseModel @@ -45,8 +39,6 @@ module Knockapi def id=: (String) -> String def initialize: (?id: String) -> void - - def to_hash: -> Knockapi::Models::AudienceRemoveMembersParams::Member::user end end end diff --git a/sig/knockapi/models/audience_remove_members_response.rbs b/sig/knockapi/models/audience_remove_members_response.rbs new file mode 100644 index 00000000..6ca72512 --- /dev/null +++ b/sig/knockapi/models/audience_remove_members_response.rbs @@ -0,0 +1,5 @@ +module Knockapi + module Models + class AudienceRemoveMembersResponse = String + end +end diff --git a/sig/knockapi/models/bulk_operation.rbs b/sig/knockapi/models/bulk_operation.rbs index 26fa6c0d..211d6a0a 100644 --- a/sig/knockapi/models/bulk_operation.rbs +++ b/sig/knockapi/models/bulk_operation.rbs @@ -8,12 +8,12 @@ module Knockapi inserted_at: Time, name: String, processed_rows: Integer, - status: Knockapi::Models::BulkOperation::status, + status: Knockapi::BulkOperation::status, success_count: Integer, updated_at: Time, completed_at: Time?, error_count: Integer, - error_items: ::Array[Knockapi::Models::BulkOperation::ErrorItem], + error_items: ::Array[Knockapi::BulkOperation::ErrorItem], failed_at: Time?, progress_path: String, started_at: Time? @@ -32,7 +32,7 @@ module Knockapi attr_accessor processed_rows: Integer - attr_accessor status: Knockapi::Models::BulkOperation::status + attr_accessor status: Knockapi::BulkOperation::status attr_accessor success_count: Integer @@ -44,11 +44,11 @@ module Knockapi def error_count=: (Integer) -> Integer - attr_reader error_items: ::Array[Knockapi::Models::BulkOperation::ErrorItem]? + attr_reader error_items: ::Array[Knockapi::BulkOperation::ErrorItem]? def error_items=: ( - ::Array[Knockapi::Models::BulkOperation::ErrorItem] - ) -> ::Array[Knockapi::Models::BulkOperation::ErrorItem] + ::Array[Knockapi::BulkOperation::ErrorItem] + ) -> ::Array[Knockapi::BulkOperation::ErrorItem] attr_accessor failed_at: Time? @@ -65,19 +65,17 @@ module Knockapi inserted_at: Time, name: String, processed_rows: Integer, - status: Knockapi::Models::BulkOperation::status, + status: Knockapi::BulkOperation::status, success_count: Integer, updated_at: Time, ?completed_at: Time?, ?error_count: Integer, - ?error_items: ::Array[Knockapi::Models::BulkOperation::ErrorItem], + ?error_items: ::Array[Knockapi::BulkOperation::ErrorItem], ?failed_at: Time?, ?progress_path: String, ?started_at: Time? ) -> void - def to_hash: -> Knockapi::Models::bulk_operation - type status = :queued | :processing | :completed | :failed module Status @@ -88,7 +86,7 @@ module Knockapi COMPLETED: :completed FAILED: :failed - def self?.values: -> ::Array[Knockapi::Models::BulkOperation::status] + def self?.values: -> ::Array[Knockapi::BulkOperation::status] end type error_item = { id: String, collection: String? } @@ -99,8 +97,6 @@ module Knockapi attr_accessor collection: String? def initialize: (id: String, ?collection: String?) -> void - - def to_hash: -> Knockapi::Models::BulkOperation::error_item end end end diff --git a/sig/knockapi/models/bulk_operation_get_params.rbs b/sig/knockapi/models/bulk_operation_get_params.rbs index 049a77dd..29739416 100644 --- a/sig/knockapi/models/bulk_operation_get_params.rbs +++ b/sig/knockapi/models/bulk_operation_get_params.rbs @@ -8,8 +8,6 @@ module Knockapi include Knockapi::Internal::Type::RequestParameters def initialize: (?request_options: Knockapi::request_opts) -> void - - def to_hash: -> Knockapi::Models::bulk_operation_get_params end end end diff --git a/sig/knockapi/models/channels/bulk_update_message_status_params.rbs b/sig/knockapi/models/channels/bulk_update_message_status_params.rbs index 1498396a..e70d423d 100644 --- a/sig/knockapi/models/channels/bulk_update_message_status_params.rbs +++ b/sig/knockapi/models/channels/bulk_update_message_status_params.rbs @@ -80,8 +80,6 @@ module Knockapi ?request_options: Knockapi::request_opts ) -> void - def to_hash: -> Knockapi::Models::Channels::bulk_update_message_status_params - type action = :seen | :unseen diff --git a/sig/knockapi/models/condition.rbs b/sig/knockapi/models/condition.rbs index d828fd8e..e6813d03 100644 --- a/sig/knockapi/models/condition.rbs +++ b/sig/knockapi/models/condition.rbs @@ -3,25 +3,23 @@ module Knockapi type condition = { argument: String?, - operator: Knockapi::Models::Condition::operator, + operator: Knockapi::Condition::operator, variable: String } class Condition < Knockapi::Internal::Type::BaseModel attr_accessor argument: String? - attr_accessor operator: Knockapi::Models::Condition::operator + attr_accessor operator: Knockapi::Condition::operator attr_accessor variable: String def initialize: ( argument: String?, - operator: Knockapi::Models::Condition::operator, + operator: Knockapi::Condition::operator, variable: String ) -> void - def to_hash: -> Knockapi::Models::condition - type operator = :equal_to | :not_equal_to @@ -64,7 +62,7 @@ module Knockapi IS_AUDIENCE_MEMBER: :is_audience_member IS_NOT_AUDIENCE_MEMBER: :is_not_audience_member - def self?.values: -> ::Array[Knockapi::Models::Condition::operator] + def self?.values: -> ::Array[Knockapi::Condition::operator] end end end diff --git a/sig/knockapi/models/identify_user_request.rbs b/sig/knockapi/models/identify_user_request.rbs index 015a9a30..917b2726 100644 --- a/sig/knockapi/models/identify_user_request.rbs +++ b/sig/knockapi/models/identify_user_request.rbs @@ -43,8 +43,6 @@ module Knockapi ?preferences: Knockapi::Models::Recipients::inline_preference_set_request?, ?timezone: String? ) -> void - - def to_hash: -> Knockapi::Models::identify_user_request end end end diff --git a/sig/knockapi/models/inline_identify_user_request.rbs b/sig/knockapi/models/inline_identify_user_request.rbs index 14ed78ef..67e1d280 100644 --- a/sig/knockapi/models/inline_identify_user_request.rbs +++ b/sig/knockapi/models/inline_identify_user_request.rbs @@ -3,28 +3,50 @@ module Knockapi type inline_identify_user_request = { id: String, + avatar: String?, channel_data: Knockapi::Models::Recipients::inline_channel_data_request?, created_at: Time?, - preferences: Knockapi::Models::Recipients::inline_preference_set_request? + email: String?, + locale: String?, + name: String?, + phone_number: String?, + preferences: Knockapi::Models::Recipients::inline_preference_set_request?, + timezone: String? } class InlineIdentifyUserRequest < Knockapi::Internal::Type::BaseModel attr_accessor id: String + attr_accessor avatar: String? + attr_accessor channel_data: Knockapi::Models::Recipients::inline_channel_data_request? attr_accessor created_at: Time? + attr_accessor email: String? + + attr_accessor locale: String? + + attr_accessor name: String? + + attr_accessor phone_number: String? + attr_accessor preferences: Knockapi::Models::Recipients::inline_preference_set_request? + attr_accessor timezone: String? + def initialize: ( id: String, + ?avatar: String?, ?channel_data: Knockapi::Models::Recipients::inline_channel_data_request?, ?created_at: Time?, - ?preferences: Knockapi::Models::Recipients::inline_preference_set_request? + ?email: String?, + ?locale: String?, + ?name: String?, + ?phone_number: String?, + ?preferences: Knockapi::Models::Recipients::inline_preference_set_request?, + ?timezone: String? ) -> void - - def to_hash: -> Knockapi::Models::inline_identify_user_request end end end diff --git a/sig/knockapi/models/inline_object_request.rbs b/sig/knockapi/models/inline_object_request.rbs index ffa1868a..d8372503 100644 --- a/sig/knockapi/models/inline_object_request.rbs +++ b/sig/knockapi/models/inline_object_request.rbs @@ -27,8 +27,6 @@ module Knockapi ?created_at: Time?, ?preferences: Knockapi::Models::Recipients::inline_preference_set_request? ) -> void - - def to_hash: -> Knockapi::Models::inline_object_request end end end diff --git a/sig/knockapi/models/inline_tenant_request.rbs b/sig/knockapi/models/inline_tenant_request.rbs index 2f367bd4..b13fcd64 100644 --- a/sig/knockapi/models/inline_tenant_request.rbs +++ b/sig/knockapi/models/inline_tenant_request.rbs @@ -1,11 +1,11 @@ module Knockapi module Models - type inline_tenant_request = String | Knockapi::Models::TenantRequest + type inline_tenant_request = String | Knockapi::TenantRequest module InlineTenantRequest extend Knockapi::Internal::Type::Union - def self?.variants: -> [String, Knockapi::Models::TenantRequest] + def self?.variants: -> ::Array[Knockapi::Models::inline_tenant_request] end end end diff --git a/sig/knockapi/models/integrations/census_custom_destination_params.rbs b/sig/knockapi/models/integrations/census_custom_destination_params.rbs index 9f204349..0c19603c 100644 --- a/sig/knockapi/models/integrations/census_custom_destination_params.rbs +++ b/sig/knockapi/models/integrations/census_custom_destination_params.rbs @@ -31,8 +31,6 @@ module Knockapi ?params: ::Hash[Symbol, top], ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::Integrations::census_custom_destination_params end end end diff --git a/sig/knockapi/models/integrations/census_custom_destination_response.rbs b/sig/knockapi/models/integrations/census_custom_destination_response.rbs index df302312..0a71d2cb 100644 --- a/sig/knockapi/models/integrations/census_custom_destination_response.rbs +++ b/sig/knockapi/models/integrations/census_custom_destination_response.rbs @@ -14,8 +14,6 @@ module Knockapi def result=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] def initialize: (?id: String, ?result: ::Hash[Symbol, top]) -> void - - def to_hash: -> Knockapi::Models::Integrations::census_custom_destination_response end end end diff --git a/sig/knockapi/models/integrations/hightouch_embedded_destination_params.rbs b/sig/knockapi/models/integrations/hightouch_embedded_destination_params.rbs index a1d3288b..39cbc92c 100644 --- a/sig/knockapi/models/integrations/hightouch_embedded_destination_params.rbs +++ b/sig/knockapi/models/integrations/hightouch_embedded_destination_params.rbs @@ -31,8 +31,6 @@ module Knockapi ?params: ::Hash[Symbol, top], ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::Integrations::hightouch_embedded_destination_params end end end diff --git a/sig/knockapi/models/integrations/hightouch_embedded_destination_response.rbs b/sig/knockapi/models/integrations/hightouch_embedded_destination_response.rbs index e078c686..264c6e48 100644 --- a/sig/knockapi/models/integrations/hightouch_embedded_destination_response.rbs +++ b/sig/knockapi/models/integrations/hightouch_embedded_destination_response.rbs @@ -14,8 +14,6 @@ module Knockapi def result=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] def initialize: (?id: String, ?result: ::Hash[Symbol, top]) -> void - - def to_hash: -> Knockapi::Models::Integrations::hightouch_embedded_destination_response end end end diff --git a/sig/knockapi/models/message.rbs b/sig/knockapi/models/message.rbs index 6b534c12..0a7864e2 100644 --- a/sig/knockapi/models/message.rbs +++ b/sig/knockapi/models/message.rbs @@ -9,7 +9,7 @@ module Knockapi channel_id: String, clicked_at: Time?, data: ::Hash[Symbol, top]?, - engagement_statuses: ::Array[Knockapi::Models::Message::engagement_status], + engagement_statuses: ::Array[Knockapi::Message::engagement_status], inserted_at: Time, interacted_at: Time?, link_clicked_at: Time?, @@ -18,8 +18,8 @@ module Knockapi recipient: Knockapi::Models::recipient_reference, scheduled_at: Time?, seen_at: Time?, - source: Knockapi::Models::Message::Source, - status: Knockapi::Models::Message::status, + source: Knockapi::Message::Source, + status: Knockapi::Message::status, tenant: String?, updated_at: Time, workflow: String? @@ -50,11 +50,11 @@ module Knockapi attr_accessor data: ::Hash[Symbol, top]? - attr_reader engagement_statuses: ::Array[Knockapi::Models::Message::engagement_status]? + attr_reader engagement_statuses: ::Array[Knockapi::Message::engagement_status]? def engagement_statuses=: ( - ::Array[Knockapi::Models::Message::engagement_status] - ) -> ::Array[Knockapi::Models::Message::engagement_status] + ::Array[Knockapi::Message::engagement_status] + ) -> ::Array[Knockapi::Message::engagement_status] attr_reader inserted_at: Time? @@ -78,17 +78,13 @@ module Knockapi attr_accessor seen_at: Time? - attr_reader source: Knockapi::Models::Message::Source? + attr_reader source: Knockapi::Message::Source? - def source=: ( - Knockapi::Models::Message::Source - ) -> Knockapi::Models::Message::Source + def source=: (Knockapi::Message::Source) -> Knockapi::Message::Source - attr_reader status: Knockapi::Models::Message::status? + attr_reader status: Knockapi::Message::status? - def status=: ( - Knockapi::Models::Message::status - ) -> Knockapi::Models::Message::status + def status=: (Knockapi::Message::status) -> Knockapi::Message::status attr_accessor tenant: String? @@ -106,7 +102,7 @@ module Knockapi ?channel_id: String, ?clicked_at: Time?, ?data: ::Hash[Symbol, top]?, - ?engagement_statuses: ::Array[Knockapi::Models::Message::engagement_status], + ?engagement_statuses: ::Array[Knockapi::Message::engagement_status], ?inserted_at: Time, ?interacted_at: Time?, ?link_clicked_at: Time?, @@ -115,15 +111,13 @@ module Knockapi ?recipient: Knockapi::Models::recipient_reference, ?scheduled_at: Time?, ?seen_at: Time?, - ?source: Knockapi::Models::Message::Source, - ?status: Knockapi::Models::Message::status, + ?source: Knockapi::Message::Source, + ?status: Knockapi::Message::status, ?tenant: String?, ?updated_at: Time, ?workflow: String? ) -> void - def to_hash: -> Knockapi::Models::message - type engagement_status = :seen | :read | :interacted | :link_clicked | :archived @@ -136,7 +130,7 @@ module Knockapi LINK_CLICKED: :link_clicked ARCHIVED: :archived - def self?.values: -> ::Array[Knockapi::Models::Message::engagement_status] + def self?.values: -> ::Array[Knockapi::Message::engagement_status] end type source = @@ -162,8 +156,6 @@ module Knockapi key: String, version_id: String ) -> void - - def to_hash: -> Knockapi::Models::Message::source end type status = @@ -186,7 +178,7 @@ module Knockapi NOT_SENT: :not_sent BOUNCED: :bounced - def self?.values: -> ::Array[Knockapi::Models::Message::status] + def self?.values: -> ::Array[Knockapi::Message::status] end end end diff --git a/sig/knockapi/models/message_archive_params.rbs b/sig/knockapi/models/message_archive_params.rbs index 814aeaba..d9f602df 100644 --- a/sig/knockapi/models/message_archive_params.rbs +++ b/sig/knockapi/models/message_archive_params.rbs @@ -8,8 +8,6 @@ module Knockapi include Knockapi::Internal::Type::RequestParameters def initialize: (?request_options: Knockapi::request_opts) -> void - - def to_hash: -> Knockapi::Models::message_archive_params end end end diff --git a/sig/knockapi/models/message_delivery_log.rbs b/sig/knockapi/models/message_delivery_log.rbs index 63829e68..9591c863 100644 --- a/sig/knockapi/models/message_delivery_log.rbs +++ b/sig/knockapi/models/message_delivery_log.rbs @@ -6,8 +6,8 @@ module Knockapi _typename: String, environment_id: String, inserted_at: String, - request: Knockapi::Models::MessageDeliveryLog::Request, - response: Knockapi::Models::MessageDeliveryLog::Response, + request: Knockapi::MessageDeliveryLog::Request, + response: Knockapi::MessageDeliveryLog::Response, service_name: String } @@ -20,9 +20,9 @@ module Knockapi attr_accessor inserted_at: String - attr_accessor request: Knockapi::Models::MessageDeliveryLog::Request + attr_accessor request: Knockapi::MessageDeliveryLog::Request - attr_accessor response: Knockapi::Models::MessageDeliveryLog::Response + attr_accessor response: Knockapi::MessageDeliveryLog::Response attr_accessor service_name: String @@ -31,29 +31,27 @@ module Knockapi _typename: String, environment_id: String, inserted_at: String, - request: Knockapi::Models::MessageDeliveryLog::Request, - response: Knockapi::Models::MessageDeliveryLog::Response, + request: Knockapi::MessageDeliveryLog::Request, + response: Knockapi::MessageDeliveryLog::Response, service_name: String ) -> void - def to_hash: -> Knockapi::Models::message_delivery_log - type request = { - body: Knockapi::Models::MessageDeliveryLog::Request::body, + body: Knockapi::MessageDeliveryLog::Request::body, headers: ::Hash[Symbol, top]?, host: String, - method_: Knockapi::Models::MessageDeliveryLog::Request::method_, + method_: Knockapi::MessageDeliveryLog::Request::method_, path: String, query: String? } class Request < Knockapi::Internal::Type::BaseModel - attr_reader body: Knockapi::Models::MessageDeliveryLog::Request::body? + attr_reader body: Knockapi::MessageDeliveryLog::Request::body? def body=: ( - Knockapi::Models::MessageDeliveryLog::Request::body - ) -> Knockapi::Models::MessageDeliveryLog::Request::body + Knockapi::MessageDeliveryLog::Request::body + ) -> Knockapi::MessageDeliveryLog::Request::body attr_accessor headers: ::Hash[Symbol, top]? @@ -61,11 +59,11 @@ module Knockapi def host=: (String) -> String - attr_reader method_: Knockapi::Models::MessageDeliveryLog::Request::method_? + attr_reader method_: Knockapi::MessageDeliveryLog::Request::method_? def method_=: ( - Knockapi::Models::MessageDeliveryLog::Request::method_ - ) -> Knockapi::Models::MessageDeliveryLog::Request::method_ + Knockapi::MessageDeliveryLog::Request::method_ + ) -> Knockapi::MessageDeliveryLog::Request::method_ attr_reader path: String? @@ -74,22 +72,20 @@ module Knockapi attr_accessor query: String? def initialize: ( - ?body: Knockapi::Models::MessageDeliveryLog::Request::body, + ?body: Knockapi::MessageDeliveryLog::Request::body, ?headers: ::Hash[Symbol, top]?, ?host: String, - ?method_: Knockapi::Models::MessageDeliveryLog::Request::method_, + ?method_: Knockapi::MessageDeliveryLog::Request::method_, ?path: String, ?query: String? ) -> void - def to_hash: -> Knockapi::Models::MessageDeliveryLog::request - type body = String | ::Hash[Symbol, top] module Body extend Knockapi::Internal::Type::Union - def self?.variants: -> [String, ::Hash[Symbol, top]] + def self?.variants: -> ::Array[Knockapi::MessageDeliveryLog::Request::body] UnionMember1Map: Knockapi::Internal::Type::Converter end @@ -105,23 +101,23 @@ module Knockapi DELETE: :DELETE PATCH: :PATCH - def self?.values: -> ::Array[Knockapi::Models::MessageDeliveryLog::Request::method_] + def self?.values: -> ::Array[Knockapi::MessageDeliveryLog::Request::method_] end end type response = { - body: Knockapi::Models::MessageDeliveryLog::Response::body, + body: Knockapi::MessageDeliveryLog::Response::body, headers: ::Hash[Symbol, top]?, status: Integer } class Response < Knockapi::Internal::Type::BaseModel - attr_reader body: Knockapi::Models::MessageDeliveryLog::Response::body? + attr_reader body: Knockapi::MessageDeliveryLog::Response::body? def body=: ( - Knockapi::Models::MessageDeliveryLog::Response::body - ) -> Knockapi::Models::MessageDeliveryLog::Response::body + Knockapi::MessageDeliveryLog::Response::body + ) -> Knockapi::MessageDeliveryLog::Response::body attr_accessor headers: ::Hash[Symbol, top]? @@ -130,19 +126,17 @@ module Knockapi def status=: (Integer) -> Integer def initialize: ( - ?body: Knockapi::Models::MessageDeliveryLog::Response::body, + ?body: Knockapi::MessageDeliveryLog::Response::body, ?headers: ::Hash[Symbol, top]?, ?status: Integer ) -> void - def to_hash: -> Knockapi::Models::MessageDeliveryLog::response - type body = String | ::Hash[Symbol, top] module Body extend Knockapi::Internal::Type::Union - def self?.variants: -> [String, ::Hash[Symbol, top]] + def self?.variants: -> ::Array[Knockapi::MessageDeliveryLog::Response::body] UnionMember1Map: Knockapi::Internal::Type::Converter end diff --git a/sig/knockapi/models/message_event.rbs b/sig/knockapi/models/message_event.rbs index 9eac3743..90fc71b6 100644 --- a/sig/knockapi/models/message_event.rbs +++ b/sig/knockapi/models/message_event.rbs @@ -6,7 +6,7 @@ module Knockapi _typename: String, inserted_at: Time, recipient: Knockapi::Models::recipient_reference, - type: Knockapi::Models::MessageEvent::type_, + type: Knockapi::MessageEvent::type_, data: ::Hash[Symbol, top]? } @@ -19,7 +19,7 @@ module Knockapi attr_accessor recipient: Knockapi::Models::recipient_reference - attr_accessor type: Knockapi::Models::MessageEvent::type_ + attr_accessor type: Knockapi::MessageEvent::type_ attr_accessor data: ::Hash[Symbol, top]? @@ -28,12 +28,10 @@ module Knockapi _typename: String, inserted_at: Time, recipient: Knockapi::Models::recipient_reference, - type: Knockapi::Models::MessageEvent::type_, + type: Knockapi::MessageEvent::type_, ?data: ::Hash[Symbol, top]? ) -> void - def to_hash: -> Knockapi::Models::message_event - type type_ = :"message.archived" | :"message.bounced" @@ -70,7 +68,7 @@ module Knockapi MESSAGE_UNREAD: :"message.unread" MESSAGE_UNSEEN: :"message.unseen" - def self?.values: -> ::Array[Knockapi::Models::MessageEvent::type_] + def self?.values: -> ::Array[Knockapi::MessageEvent::type_] end end end diff --git a/sig/knockapi/models/message_get_content_params.rbs b/sig/knockapi/models/message_get_content_params.rbs index 6548ab06..47c99806 100644 --- a/sig/knockapi/models/message_get_content_params.rbs +++ b/sig/knockapi/models/message_get_content_params.rbs @@ -8,8 +8,6 @@ module Knockapi include Knockapi::Internal::Type::RequestParameters def initialize: (?request_options: Knockapi::request_opts) -> void - - def to_hash: -> Knockapi::Models::message_get_content_params end end end diff --git a/sig/knockapi/models/message_get_content_response.rbs b/sig/knockapi/models/message_get_content_response.rbs index ebb34524..97079abd 100644 --- a/sig/knockapi/models/message_get_content_response.rbs +++ b/sig/knockapi/models/message_get_content_response.rbs @@ -24,8 +24,6 @@ module Knockapi message_id: String ) -> void - def to_hash: -> Knockapi::Models::message_get_content_response - type data = Knockapi::Models::MessageGetContentResponse::Data::MessageEmailContent | Knockapi::Models::MessageGetContentResponse::Data::MessageSMSContent @@ -79,8 +77,6 @@ module Knockapi ?cc: String?, ?reply_to: String? ) -> void - - def to_hash: -> Knockapi::Models::MessageGetContentResponse::Data::message_email_content end type message_sms_content = @@ -94,8 +90,6 @@ module Knockapi attr_accessor to: String def initialize: (_typename: String, body: String, to: String) -> void - - def to_hash: -> Knockapi::Models::MessageGetContentResponse::Data::message_sms_content end type message_push_content = @@ -125,8 +119,6 @@ module Knockapi title: String, ?data: ::Hash[Symbol, top]? ) -> void - - def to_hash: -> Knockapi::Models::MessageGetContentResponse::Data::message_push_content end type message_chat_content = @@ -153,8 +145,6 @@ module Knockapi ?metadata: ::Hash[Symbol, top]? ) -> void - def to_hash: -> Knockapi::Models::MessageGetContentResponse::Data::message_chat_content - type template = { blocks: ::Array[Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent::Template::Block]?, @@ -175,8 +165,6 @@ module Knockapi ?summary: String? ) -> void - def to_hash: -> Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent::template - type block = { content: String, @@ -197,8 +185,6 @@ module Knockapi type: Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent::Template::Block::type_ ) -> void - def to_hash: -> Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent::Template::block - type type_ = :text | :markdown module Type @@ -229,8 +215,6 @@ module Knockapi blocks: ::Array[Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::block] ) -> void - def to_hash: -> Knockapi::Models::MessageGetContentResponse::Data::message_in_app_feed_content - type block = Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock | Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock @@ -262,8 +246,6 @@ module Knockapi type: Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock::type_ ) -> void - def to_hash: -> Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::message_in_app_feed_content_block - type type_ = :markdown | :text module Type @@ -296,8 +278,6 @@ module Knockapi type: Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock::type_ ) -> void - def to_hash: -> Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::message_in_app_feed_button_set_block - type button = { action: String, label: String, name: String } class Button < Knockapi::Internal::Type::BaseModel @@ -312,8 +292,6 @@ module Knockapi label: String, name: String ) -> void - - def to_hash: -> Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock::button end type type_ = :button_set @@ -327,11 +305,11 @@ module Knockapi end end - def self?.variants: -> [Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock, Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock] + def self?.variants: -> ::Array[Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::block] end end - def self?.variants: -> [Knockapi::Models::MessageGetContentResponse::Data::MessageEmailContent, Knockapi::Models::MessageGetContentResponse::Data::MessageSMSContent, Knockapi::Models::MessageGetContentResponse::Data::MessagePushContent, Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent, Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent] + def self?.variants: -> ::Array[Knockapi::Models::MessageGetContentResponse::data] end end end diff --git a/sig/knockapi/models/message_get_params.rbs b/sig/knockapi/models/message_get_params.rbs index a9259c77..d881ab0e 100644 --- a/sig/knockapi/models/message_get_params.rbs +++ b/sig/knockapi/models/message_get_params.rbs @@ -8,8 +8,6 @@ module Knockapi include Knockapi::Internal::Type::RequestParameters def initialize: (?request_options: Knockapi::request_opts) -> void - - def to_hash: -> Knockapi::Models::message_get_params end end end diff --git a/sig/knockapi/models/message_list_activities_params.rbs b/sig/knockapi/models/message_list_activities_params.rbs index 548ba836..231cf32e 100644 --- a/sig/knockapi/models/message_list_activities_params.rbs +++ b/sig/knockapi/models/message_list_activities_params.rbs @@ -36,8 +36,6 @@ module Knockapi ?trigger_data: String, ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::message_list_activities_params end end end diff --git a/sig/knockapi/models/message_list_delivery_logs_params.rbs b/sig/knockapi/models/message_list_delivery_logs_params.rbs index 2bc98508..bb41b930 100644 --- a/sig/knockapi/models/message_list_delivery_logs_params.rbs +++ b/sig/knockapi/models/message_list_delivery_logs_params.rbs @@ -26,8 +26,6 @@ module Knockapi ?page_size: Integer, ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::message_list_delivery_logs_params end end end diff --git a/sig/knockapi/models/message_list_events_params.rbs b/sig/knockapi/models/message_list_events_params.rbs index 5c772f1c..d249674b 100644 --- a/sig/knockapi/models/message_list_events_params.rbs +++ b/sig/knockapi/models/message_list_events_params.rbs @@ -26,8 +26,6 @@ module Knockapi ?page_size: Integer, ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::message_list_events_params end end end diff --git a/sig/knockapi/models/message_list_params.rbs b/sig/knockapi/models/message_list_params.rbs index 16a33775..9a00f3d3 100644 --- a/sig/knockapi/models/message_list_params.rbs +++ b/sig/knockapi/models/message_list_params.rbs @@ -5,12 +5,12 @@ module Knockapi after: String, before: String, channel_id: String, - engagement_status: ::Array[Knockapi::Models::MessageListParams::engagement_status], - inserted_at: Knockapi::Models::MessageListParams::InsertedAt, + engagement_status: ::Array[Knockapi::MessageListParams::engagement_status], + inserted_at: Knockapi::MessageListParams::InsertedAt, message_ids: ::Array[String], page_size: Integer, source: String, - status: ::Array[Knockapi::Models::MessageListParams::status], + status: ::Array[Knockapi::MessageListParams::status], tenant: String, trigger_data: String, workflow_categories: ::Array[String], @@ -35,17 +35,17 @@ module Knockapi def channel_id=: (String) -> String - attr_reader engagement_status: ::Array[Knockapi::Models::MessageListParams::engagement_status]? + attr_reader engagement_status: ::Array[Knockapi::MessageListParams::engagement_status]? def engagement_status=: ( - ::Array[Knockapi::Models::MessageListParams::engagement_status] - ) -> ::Array[Knockapi::Models::MessageListParams::engagement_status] + ::Array[Knockapi::MessageListParams::engagement_status] + ) -> ::Array[Knockapi::MessageListParams::engagement_status] - attr_reader inserted_at: Knockapi::Models::MessageListParams::InsertedAt? + attr_reader inserted_at: Knockapi::MessageListParams::InsertedAt? def inserted_at=: ( - Knockapi::Models::MessageListParams::InsertedAt - ) -> Knockapi::Models::MessageListParams::InsertedAt + Knockapi::MessageListParams::InsertedAt + ) -> Knockapi::MessageListParams::InsertedAt attr_reader message_ids: ::Array[String]? @@ -59,11 +59,11 @@ module Knockapi def source=: (String) -> String - attr_reader status: ::Array[Knockapi::Models::MessageListParams::status]? + attr_reader status: ::Array[Knockapi::MessageListParams::status]? def status=: ( - ::Array[Knockapi::Models::MessageListParams::status] - ) -> ::Array[Knockapi::Models::MessageListParams::status] + ::Array[Knockapi::MessageListParams::status] + ) -> ::Array[Knockapi::MessageListParams::status] attr_reader tenant: String? @@ -89,12 +89,12 @@ module Knockapi ?after: String, ?before: String, ?channel_id: String, - ?engagement_status: ::Array[Knockapi::Models::MessageListParams::engagement_status], - ?inserted_at: Knockapi::Models::MessageListParams::InsertedAt, + ?engagement_status: ::Array[Knockapi::MessageListParams::engagement_status], + ?inserted_at: Knockapi::MessageListParams::InsertedAt, ?message_ids: ::Array[String], ?page_size: Integer, ?source: String, - ?status: ::Array[Knockapi::Models::MessageListParams::status], + ?status: ::Array[Knockapi::MessageListParams::status], ?tenant: String, ?trigger_data: String, ?workflow_categories: ::Array[String], @@ -103,8 +103,6 @@ module Knockapi ?request_options: Knockapi::request_opts ) -> void - def to_hash: -> Knockapi::Models::message_list_params - type engagement_status = :seen | :read | :interacted | :link_clicked | :archived @@ -117,7 +115,7 @@ module Knockapi LINK_CLICKED: :link_clicked ARCHIVED: :archived - def self?.values: -> ::Array[Knockapi::Models::MessageListParams::engagement_status] + def self?.values: -> ::Array[Knockapi::MessageListParams::engagement_status] end type inserted_at = { gt: String, gte: String, lt: String, lte: String } @@ -145,8 +143,6 @@ module Knockapi ?lt: String, ?lte: String ) -> void - - def to_hash: -> Knockapi::Models::MessageListParams::inserted_at end type status = @@ -169,7 +165,7 @@ module Knockapi NOT_SENT: :not_sent BOUNCED: :bounced - def self?.values: -> ::Array[Knockapi::Models::MessageListParams::status] + def self?.values: -> ::Array[Knockapi::MessageListParams::status] end end end diff --git a/sig/knockapi/models/message_mark_as_interacted_params.rbs b/sig/knockapi/models/message_mark_as_interacted_params.rbs index ec7eb610..20df610f 100644 --- a/sig/knockapi/models/message_mark_as_interacted_params.rbs +++ b/sig/knockapi/models/message_mark_as_interacted_params.rbs @@ -16,8 +16,6 @@ module Knockapi ?metadata: ::Hash[Symbol, top], ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::message_mark_as_interacted_params end end end diff --git a/sig/knockapi/models/message_mark_as_read_params.rbs b/sig/knockapi/models/message_mark_as_read_params.rbs index ac3fb292..81098e91 100644 --- a/sig/knockapi/models/message_mark_as_read_params.rbs +++ b/sig/knockapi/models/message_mark_as_read_params.rbs @@ -8,8 +8,6 @@ module Knockapi include Knockapi::Internal::Type::RequestParameters def initialize: (?request_options: Knockapi::request_opts) -> void - - def to_hash: -> Knockapi::Models::message_mark_as_read_params end end end diff --git a/sig/knockapi/models/message_mark_as_seen_params.rbs b/sig/knockapi/models/message_mark_as_seen_params.rbs index ada75db4..45d0049f 100644 --- a/sig/knockapi/models/message_mark_as_seen_params.rbs +++ b/sig/knockapi/models/message_mark_as_seen_params.rbs @@ -8,8 +8,6 @@ module Knockapi include Knockapi::Internal::Type::RequestParameters def initialize: (?request_options: Knockapi::request_opts) -> void - - def to_hash: -> Knockapi::Models::message_mark_as_seen_params end end end diff --git a/sig/knockapi/models/message_mark_as_unread_params.rbs b/sig/knockapi/models/message_mark_as_unread_params.rbs index 0ec96253..46df4ed5 100644 --- a/sig/knockapi/models/message_mark_as_unread_params.rbs +++ b/sig/knockapi/models/message_mark_as_unread_params.rbs @@ -8,8 +8,6 @@ module Knockapi include Knockapi::Internal::Type::RequestParameters def initialize: (?request_options: Knockapi::request_opts) -> void - - def to_hash: -> Knockapi::Models::message_mark_as_unread_params end end end diff --git a/sig/knockapi/models/message_mark_as_unseen_params.rbs b/sig/knockapi/models/message_mark_as_unseen_params.rbs index d761d393..f2c798f5 100644 --- a/sig/knockapi/models/message_mark_as_unseen_params.rbs +++ b/sig/knockapi/models/message_mark_as_unseen_params.rbs @@ -8,8 +8,6 @@ module Knockapi include Knockapi::Internal::Type::RequestParameters def initialize: (?request_options: Knockapi::request_opts) -> void - - def to_hash: -> Knockapi::Models::message_mark_as_unseen_params end end end diff --git a/sig/knockapi/models/message_unarchive_params.rbs b/sig/knockapi/models/message_unarchive_params.rbs index c0920625..98e1c0d7 100644 --- a/sig/knockapi/models/message_unarchive_params.rbs +++ b/sig/knockapi/models/message_unarchive_params.rbs @@ -8,8 +8,6 @@ module Knockapi include Knockapi::Internal::Type::RequestParameters def initialize: (?request_options: Knockapi::request_opts) -> void - - def to_hash: -> Knockapi::Models::message_unarchive_params end end end diff --git a/sig/knockapi/models/messages/activity_list_params.rbs b/sig/knockapi/models/messages/activity_list_params.rbs deleted file mode 100644 index c20b9e73..00000000 --- a/sig/knockapi/models/messages/activity_list_params.rbs +++ /dev/null @@ -1,45 +0,0 @@ -module Knockapi - module Models - module Messages - type activity_list_params = - { - after: String, - before: String, - page_size: Integer, - trigger_data: String - } - & Knockapi::Internal::Type::request_parameters - - class ActivityListParams < Knockapi::Internal::Type::BaseModel - extend Knockapi::Internal::Type::RequestParameters::Converter - include Knockapi::Internal::Type::RequestParameters - - attr_reader after: String? - - def after=: (String) -> String - - attr_reader before: String? - - def before=: (String) -> String - - attr_reader page_size: Integer? - - def page_size=: (Integer) -> Integer - - attr_reader trigger_data: String? - - def trigger_data=: (String) -> String - - def initialize: ( - ?after: String, - ?before: String, - ?page_size: Integer, - ?trigger_data: String, - ?request_options: Knockapi::request_opts - ) -> void - - def to_hash: -> Knockapi::Models::Messages::activity_list_params - end - end - end -end diff --git a/sig/knockapi/models/messages/batch_archive_params.rbs b/sig/knockapi/models/messages/batch_archive_params.rbs index 4a288fd0..a422f46f 100644 --- a/sig/knockapi/models/messages/batch_archive_params.rbs +++ b/sig/knockapi/models/messages/batch_archive_params.rbs @@ -15,8 +15,6 @@ module Knockapi message_ids: ::Array[String], ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::Messages::batch_archive_params end end end diff --git a/sig/knockapi/models/messages/batch_archive_response.rbs b/sig/knockapi/models/messages/batch_archive_response.rbs index 5837000d..df1c4ee2 100644 --- a/sig/knockapi/models/messages/batch_archive_response.rbs +++ b/sig/knockapi/models/messages/batch_archive_response.rbs @@ -1,7 +1,7 @@ module Knockapi module Models module Messages - type batch_archive_response = ::Array[Knockapi::Models::Message] + type batch_archive_response = ::Array[Knockapi::Message] BatchArchiveResponse: Knockapi::Internal::Type::Converter end diff --git a/sig/knockapi/models/messages/batch_get_content_params.rbs b/sig/knockapi/models/messages/batch_get_content_params.rbs index 736ef60a..74cfc82e 100644 --- a/sig/knockapi/models/messages/batch_get_content_params.rbs +++ b/sig/knockapi/models/messages/batch_get_content_params.rbs @@ -15,8 +15,6 @@ module Knockapi message_ids: ::Array[String], ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::Messages::batch_get_content_params end end end diff --git a/sig/knockapi/models/messages/batch_get_content_response.rbs b/sig/knockapi/models/messages/batch_get_content_response.rbs index 7d4ea834..4698f3d5 100644 --- a/sig/knockapi/models/messages/batch_get_content_response.rbs +++ b/sig/knockapi/models/messages/batch_get_content_response.rbs @@ -25,8 +25,6 @@ module Knockapi message_id: String ) -> void - def to_hash: -> Knockapi::Models::Messages::batch_get_content_response_item - type data = Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageEmailContent | Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageSMSContent @@ -80,8 +78,6 @@ module Knockapi ?cc: String?, ?reply_to: String? ) -> void - - def to_hash: -> Knockapi::Models::Messages::BatchGetContentResponseItem::Data::message_email_content end type message_sms_content = @@ -99,8 +95,6 @@ module Knockapi body: String, to: String ) -> void - - def to_hash: -> Knockapi::Models::Messages::BatchGetContentResponseItem::Data::message_sms_content end type message_push_content = @@ -130,8 +124,6 @@ module Knockapi title: String, ?data: ::Hash[Symbol, top]? ) -> void - - def to_hash: -> Knockapi::Models::Messages::BatchGetContentResponseItem::Data::message_push_content end type message_chat_content = @@ -158,8 +150,6 @@ module Knockapi ?metadata: ::Hash[Symbol, top]? ) -> void - def to_hash: -> Knockapi::Models::Messages::BatchGetContentResponseItem::Data::message_chat_content - type template = { blocks: ::Array[Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageChatContent::Template::Block]?, @@ -180,8 +170,6 @@ module Knockapi ?summary: String? ) -> void - def to_hash: -> Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageChatContent::template - type block = { content: String, @@ -202,8 +190,6 @@ module Knockapi type: Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageChatContent::Template::Block::type_ ) -> void - def to_hash: -> Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageChatContent::Template::block - type type_ = :text | :markdown module Type @@ -234,8 +220,6 @@ module Knockapi blocks: ::Array[Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::block] ) -> void - def to_hash: -> Knockapi::Models::Messages::BatchGetContentResponseItem::Data::message_in_app_feed_content - type block = Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock | Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock @@ -267,8 +251,6 @@ module Knockapi type: Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock::type_ ) -> void - def to_hash: -> Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::message_in_app_feed_content_block - type type_ = :markdown | :text module Type @@ -301,8 +283,6 @@ module Knockapi type: Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock::type_ ) -> void - def to_hash: -> Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::message_in_app_feed_button_set_block - type button = { action: String, label: String, name: String } class Button < Knockapi::Internal::Type::BaseModel @@ -317,8 +297,6 @@ module Knockapi label: String, name: String ) -> void - - def to_hash: -> Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock::button end type type_ = :button_set @@ -332,11 +310,11 @@ module Knockapi end end - def self?.variants: -> [Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock, Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock] + def self?.variants: -> ::Array[Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent::block] end end - def self?.variants: -> [Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageEmailContent, Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageSMSContent, Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessagePushContent, Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageChatContent, Knockapi::Models::Messages::BatchGetContentResponseItem::Data::MessageInAppFeedContent] + def self?.variants: -> ::Array[Knockapi::Models::Messages::BatchGetContentResponseItem::data] end end diff --git a/sig/knockapi/models/messages/batch_mark_as_interacted_params.rbs b/sig/knockapi/models/messages/batch_mark_as_interacted_params.rbs index d6336b6b..f083668e 100644 --- a/sig/knockapi/models/messages/batch_mark_as_interacted_params.rbs +++ b/sig/knockapi/models/messages/batch_mark_as_interacted_params.rbs @@ -18,8 +18,6 @@ module Knockapi ?metadata: ::Hash[Symbol, top]?, ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::Messages::batch_mark_as_interacted_params end end end diff --git a/sig/knockapi/models/messages/batch_mark_as_interacted_response.rbs b/sig/knockapi/models/messages/batch_mark_as_interacted_response.rbs index de88d392..926d940b 100644 --- a/sig/knockapi/models/messages/batch_mark_as_interacted_response.rbs +++ b/sig/knockapi/models/messages/batch_mark_as_interacted_response.rbs @@ -1,8 +1,7 @@ module Knockapi module Models module Messages - type batch_mark_as_interacted_response = - ::Array[Knockapi::Models::Message] + type batch_mark_as_interacted_response = ::Array[Knockapi::Message] BatchMarkAsInteractedResponse: Knockapi::Internal::Type::Converter end diff --git a/sig/knockapi/models/messages/batch_mark_as_read_params.rbs b/sig/knockapi/models/messages/batch_mark_as_read_params.rbs index 5c96687f..fa268dc4 100644 --- a/sig/knockapi/models/messages/batch_mark_as_read_params.rbs +++ b/sig/knockapi/models/messages/batch_mark_as_read_params.rbs @@ -15,8 +15,6 @@ module Knockapi message_ids: ::Array[String], ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::Messages::batch_mark_as_read_params end end end diff --git a/sig/knockapi/models/messages/batch_mark_as_read_response.rbs b/sig/knockapi/models/messages/batch_mark_as_read_response.rbs index 63b32905..59ee9fb0 100644 --- a/sig/knockapi/models/messages/batch_mark_as_read_response.rbs +++ b/sig/knockapi/models/messages/batch_mark_as_read_response.rbs @@ -1,7 +1,7 @@ module Knockapi module Models module Messages - type batch_mark_as_read_response = ::Array[Knockapi::Models::Message] + type batch_mark_as_read_response = ::Array[Knockapi::Message] BatchMarkAsReadResponse: Knockapi::Internal::Type::Converter end diff --git a/sig/knockapi/models/messages/batch_mark_as_seen_params.rbs b/sig/knockapi/models/messages/batch_mark_as_seen_params.rbs index 0374537c..e602077c 100644 --- a/sig/knockapi/models/messages/batch_mark_as_seen_params.rbs +++ b/sig/knockapi/models/messages/batch_mark_as_seen_params.rbs @@ -15,8 +15,6 @@ module Knockapi message_ids: ::Array[String], ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::Messages::batch_mark_as_seen_params end end end diff --git a/sig/knockapi/models/messages/batch_mark_as_seen_response.rbs b/sig/knockapi/models/messages/batch_mark_as_seen_response.rbs index 74e8ee6d..bf1c067b 100644 --- a/sig/knockapi/models/messages/batch_mark_as_seen_response.rbs +++ b/sig/knockapi/models/messages/batch_mark_as_seen_response.rbs @@ -1,7 +1,7 @@ module Knockapi module Models module Messages - type batch_mark_as_seen_response = ::Array[Knockapi::Models::Message] + type batch_mark_as_seen_response = ::Array[Knockapi::Message] BatchMarkAsSeenResponse: Knockapi::Internal::Type::Converter end diff --git a/sig/knockapi/models/messages/batch_mark_as_unread_params.rbs b/sig/knockapi/models/messages/batch_mark_as_unread_params.rbs index 0b0e83af..869686a2 100644 --- a/sig/knockapi/models/messages/batch_mark_as_unread_params.rbs +++ b/sig/knockapi/models/messages/batch_mark_as_unread_params.rbs @@ -15,8 +15,6 @@ module Knockapi message_ids: ::Array[String], ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::Messages::batch_mark_as_unread_params end end end diff --git a/sig/knockapi/models/messages/batch_mark_as_unread_response.rbs b/sig/knockapi/models/messages/batch_mark_as_unread_response.rbs index 42e04337..b879ac42 100644 --- a/sig/knockapi/models/messages/batch_mark_as_unread_response.rbs +++ b/sig/knockapi/models/messages/batch_mark_as_unread_response.rbs @@ -1,7 +1,7 @@ module Knockapi module Models module Messages - type batch_mark_as_unread_response = ::Array[Knockapi::Models::Message] + type batch_mark_as_unread_response = ::Array[Knockapi::Message] BatchMarkAsUnreadResponse: Knockapi::Internal::Type::Converter end diff --git a/sig/knockapi/models/messages/batch_mark_as_unseen_params.rbs b/sig/knockapi/models/messages/batch_mark_as_unseen_params.rbs index 524aeee5..df65ffac 100644 --- a/sig/knockapi/models/messages/batch_mark_as_unseen_params.rbs +++ b/sig/knockapi/models/messages/batch_mark_as_unseen_params.rbs @@ -15,8 +15,6 @@ module Knockapi message_ids: ::Array[String], ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::Messages::batch_mark_as_unseen_params end end end diff --git a/sig/knockapi/models/messages/batch_mark_as_unseen_response.rbs b/sig/knockapi/models/messages/batch_mark_as_unseen_response.rbs index a968cc8c..6fd17355 100644 --- a/sig/knockapi/models/messages/batch_mark_as_unseen_response.rbs +++ b/sig/knockapi/models/messages/batch_mark_as_unseen_response.rbs @@ -1,7 +1,7 @@ module Knockapi module Models module Messages - type batch_mark_as_unseen_response = ::Array[Knockapi::Models::Message] + type batch_mark_as_unseen_response = ::Array[Knockapi::Message] BatchMarkAsUnseenResponse: Knockapi::Internal::Type::Converter end diff --git a/sig/knockapi/models/messages/batch_unarchive_params.rbs b/sig/knockapi/models/messages/batch_unarchive_params.rbs index 083732ff..6418e3a6 100644 --- a/sig/knockapi/models/messages/batch_unarchive_params.rbs +++ b/sig/knockapi/models/messages/batch_unarchive_params.rbs @@ -15,8 +15,6 @@ module Knockapi message_ids: ::Array[String], ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::Messages::batch_unarchive_params end end end diff --git a/sig/knockapi/models/messages/batch_unarchive_response.rbs b/sig/knockapi/models/messages/batch_unarchive_response.rbs index 19860008..a60df0a3 100644 --- a/sig/knockapi/models/messages/batch_unarchive_response.rbs +++ b/sig/knockapi/models/messages/batch_unarchive_response.rbs @@ -1,7 +1,7 @@ module Knockapi module Models module Messages - type batch_unarchive_response = ::Array[Knockapi::Models::Message] + type batch_unarchive_response = ::Array[Knockapi::Message] BatchUnarchiveResponse: Knockapi::Internal::Type::Converter end diff --git a/sig/knockapi/models/object.rbs b/sig/knockapi/models/object.rbs index 5dee7876..060a20ed 100644 --- a/sig/knockapi/models/object.rbs +++ b/sig/knockapi/models/object.rbs @@ -6,7 +6,8 @@ module Knockapi _typename: String, collection: String, updated_at: Time, - created_at: Time? + created_at: Time?, + properties: ::Hash[Symbol, top] } class Object < Knockapi::Internal::Type::BaseModel @@ -20,15 +21,18 @@ module Knockapi attr_accessor created_at: Time? + attr_reader properties: ::Hash[Symbol, top]? + + def properties=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + def initialize: ( id: String, _typename: String, collection: String, updated_at: Time, - ?created_at: Time? + ?created_at: Time?, + ?properties: ::Hash[Symbol, top] ) -> void - - def to_hash: -> Knockapi::Models::object end end end diff --git a/sig/knockapi/models/object_add_subscriptions_params.rbs b/sig/knockapi/models/object_add_subscriptions_params.rbs index 8c9e05b7..73a2e224 100644 --- a/sig/knockapi/models/object_add_subscriptions_params.rbs +++ b/sig/knockapi/models/object_add_subscriptions_params.rbs @@ -20,8 +20,6 @@ module Knockapi ?properties: ::Hash[Symbol, top]?, ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::object_add_subscriptions_params end end end diff --git a/sig/knockapi/models/object_add_subscriptions_response.rbs b/sig/knockapi/models/object_add_subscriptions_response.rbs index de330a18..a6a7cd09 100644 --- a/sig/knockapi/models/object_add_subscriptions_response.rbs +++ b/sig/knockapi/models/object_add_subscriptions_response.rbs @@ -1,7 +1,7 @@ module Knockapi module Models type object_add_subscriptions_response = - ::Array[Knockapi::Models::Recipients::Subscription] + ::Array[Knockapi::Recipients::Subscription] ObjectAddSubscriptionsResponse: Knockapi::Internal::Type::Converter end diff --git a/sig/knockapi/models/object_delete_params.rbs b/sig/knockapi/models/object_delete_params.rbs index 4742ae40..ed88b251 100644 --- a/sig/knockapi/models/object_delete_params.rbs +++ b/sig/knockapi/models/object_delete_params.rbs @@ -8,8 +8,6 @@ module Knockapi include Knockapi::Internal::Type::RequestParameters def initialize: (?request_options: Knockapi::request_opts) -> void - - def to_hash: -> Knockapi::Models::object_delete_params end end end diff --git a/sig/knockapi/models/object_delete_response.rbs b/sig/knockapi/models/object_delete_response.rbs new file mode 100644 index 00000000..50570a54 --- /dev/null +++ b/sig/knockapi/models/object_delete_response.rbs @@ -0,0 +1,5 @@ +module Knockapi + module Models + class ObjectDeleteResponse = String + end +end diff --git a/sig/knockapi/models/object_delete_subscriptions_params.rbs b/sig/knockapi/models/object_delete_subscriptions_params.rbs index 2619e557..ba98fe9a 100644 --- a/sig/knockapi/models/object_delete_subscriptions_params.rbs +++ b/sig/knockapi/models/object_delete_subscriptions_params.rbs @@ -14,8 +14,6 @@ module Knockapi recipients: ::Array[Knockapi::Models::recipient_reference], ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::object_delete_subscriptions_params end end end diff --git a/sig/knockapi/models/object_delete_subscriptions_response.rbs b/sig/knockapi/models/object_delete_subscriptions_response.rbs index 773b3c3b..9df4aae9 100644 --- a/sig/knockapi/models/object_delete_subscriptions_response.rbs +++ b/sig/knockapi/models/object_delete_subscriptions_response.rbs @@ -1,7 +1,7 @@ module Knockapi module Models type object_delete_subscriptions_response = - ::Array[Knockapi::Models::Recipients::Subscription] + ::Array[Knockapi::Recipients::Subscription] ObjectDeleteSubscriptionsResponse: Knockapi::Internal::Type::Converter end diff --git a/sig/knockapi/models/object_get_channel_data_params.rbs b/sig/knockapi/models/object_get_channel_data_params.rbs index 99518530..b3854dc1 100644 --- a/sig/knockapi/models/object_get_channel_data_params.rbs +++ b/sig/knockapi/models/object_get_channel_data_params.rbs @@ -8,8 +8,6 @@ module Knockapi include Knockapi::Internal::Type::RequestParameters def initialize: (?request_options: Knockapi::request_opts) -> void - - def to_hash: -> Knockapi::Models::object_get_channel_data_params end end end diff --git a/sig/knockapi/models/object_get_params.rbs b/sig/knockapi/models/object_get_params.rbs index ec7405cb..084d8098 100644 --- a/sig/knockapi/models/object_get_params.rbs +++ b/sig/knockapi/models/object_get_params.rbs @@ -7,8 +7,6 @@ module Knockapi include Knockapi::Internal::Type::RequestParameters def initialize: (?request_options: Knockapi::request_opts) -> void - - def to_hash: -> Knockapi::Models::object_get_params end end end diff --git a/sig/knockapi/models/object_get_preferences_params.rbs b/sig/knockapi/models/object_get_preferences_params.rbs index 6b52cbd4..cba410df 100644 --- a/sig/knockapi/models/object_get_preferences_params.rbs +++ b/sig/knockapi/models/object_get_preferences_params.rbs @@ -8,8 +8,6 @@ module Knockapi include Knockapi::Internal::Type::RequestParameters def initialize: (?request_options: Knockapi::request_opts) -> void - - def to_hash: -> Knockapi::Models::object_get_preferences_params end end end diff --git a/sig/knockapi/models/object_list_messages_params.rbs b/sig/knockapi/models/object_list_messages_params.rbs index 0b03e4ce..491d840b 100644 --- a/sig/knockapi/models/object_list_messages_params.rbs +++ b/sig/knockapi/models/object_list_messages_params.rbs @@ -5,12 +5,12 @@ module Knockapi after: String, before: String, channel_id: String, - engagement_status: ::Array[Knockapi::Models::ObjectListMessagesParams::engagement_status], - inserted_at: Knockapi::Models::ObjectListMessagesParams::InsertedAt, + engagement_status: ::Array[Knockapi::ObjectListMessagesParams::engagement_status], + inserted_at: Knockapi::ObjectListMessagesParams::InsertedAt, message_ids: ::Array[String], page_size: Integer, source: String, - status: ::Array[Knockapi::Models::ObjectListMessagesParams::status], + status: ::Array[Knockapi::ObjectListMessagesParams::status], tenant: String, trigger_data: String, workflow_categories: ::Array[String], @@ -35,17 +35,17 @@ module Knockapi def channel_id=: (String) -> String - attr_reader engagement_status: ::Array[Knockapi::Models::ObjectListMessagesParams::engagement_status]? + attr_reader engagement_status: ::Array[Knockapi::ObjectListMessagesParams::engagement_status]? def engagement_status=: ( - ::Array[Knockapi::Models::ObjectListMessagesParams::engagement_status] - ) -> ::Array[Knockapi::Models::ObjectListMessagesParams::engagement_status] + ::Array[Knockapi::ObjectListMessagesParams::engagement_status] + ) -> ::Array[Knockapi::ObjectListMessagesParams::engagement_status] - attr_reader inserted_at: Knockapi::Models::ObjectListMessagesParams::InsertedAt? + attr_reader inserted_at: Knockapi::ObjectListMessagesParams::InsertedAt? def inserted_at=: ( - Knockapi::Models::ObjectListMessagesParams::InsertedAt - ) -> Knockapi::Models::ObjectListMessagesParams::InsertedAt + Knockapi::ObjectListMessagesParams::InsertedAt + ) -> Knockapi::ObjectListMessagesParams::InsertedAt attr_reader message_ids: ::Array[String]? @@ -59,11 +59,11 @@ module Knockapi def source=: (String) -> String - attr_reader status: ::Array[Knockapi::Models::ObjectListMessagesParams::status]? + attr_reader status: ::Array[Knockapi::ObjectListMessagesParams::status]? def status=: ( - ::Array[Knockapi::Models::ObjectListMessagesParams::status] - ) -> ::Array[Knockapi::Models::ObjectListMessagesParams::status] + ::Array[Knockapi::ObjectListMessagesParams::status] + ) -> ::Array[Knockapi::ObjectListMessagesParams::status] attr_reader tenant: String? @@ -89,12 +89,12 @@ module Knockapi ?after: String, ?before: String, ?channel_id: String, - ?engagement_status: ::Array[Knockapi::Models::ObjectListMessagesParams::engagement_status], - ?inserted_at: Knockapi::Models::ObjectListMessagesParams::InsertedAt, + ?engagement_status: ::Array[Knockapi::ObjectListMessagesParams::engagement_status], + ?inserted_at: Knockapi::ObjectListMessagesParams::InsertedAt, ?message_ids: ::Array[String], ?page_size: Integer, ?source: String, - ?status: ::Array[Knockapi::Models::ObjectListMessagesParams::status], + ?status: ::Array[Knockapi::ObjectListMessagesParams::status], ?tenant: String, ?trigger_data: String, ?workflow_categories: ::Array[String], @@ -103,8 +103,6 @@ module Knockapi ?request_options: Knockapi::request_opts ) -> void - def to_hash: -> Knockapi::Models::object_list_messages_params - type engagement_status = :seen | :read | :interacted | :link_clicked | :archived @@ -117,7 +115,7 @@ module Knockapi LINK_CLICKED: :link_clicked ARCHIVED: :archived - def self?.values: -> ::Array[Knockapi::Models::ObjectListMessagesParams::engagement_status] + def self?.values: -> ::Array[Knockapi::ObjectListMessagesParams::engagement_status] end type inserted_at = { gt: String, gte: String, lt: String, lte: String } @@ -145,8 +143,6 @@ module Knockapi ?lt: String, ?lte: String ) -> void - - def to_hash: -> Knockapi::Models::ObjectListMessagesParams::inserted_at end type status = @@ -169,7 +165,7 @@ module Knockapi NOT_SENT: :not_sent BOUNCED: :bounced - def self?.values: -> ::Array[Knockapi::Models::ObjectListMessagesParams::status] + def self?.values: -> ::Array[Knockapi::ObjectListMessagesParams::status] end end end diff --git a/sig/knockapi/models/object_list_params.rbs b/sig/knockapi/models/object_list_params.rbs index 653f4e86..817e1ee6 100644 --- a/sig/knockapi/models/object_list_params.rbs +++ b/sig/knockapi/models/object_list_params.rbs @@ -4,7 +4,7 @@ module Knockapi { after: String, before: String, - include: ::Array[Knockapi::Models::ObjectListParams::include_], + include: ::Array[Knockapi::ObjectListParams::include_], page_size: Integer } & Knockapi::Internal::Type::request_parameters @@ -21,11 +21,11 @@ module Knockapi def before=: (String) -> String - attr_reader include: ::Array[Knockapi::Models::ObjectListParams::include_]? + attr_reader include: ::Array[Knockapi::ObjectListParams::include_]? def include=: ( - ::Array[Knockapi::Models::ObjectListParams::include_] - ) -> ::Array[Knockapi::Models::ObjectListParams::include_] + ::Array[Knockapi::ObjectListParams::include_] + ) -> ::Array[Knockapi::ObjectListParams::include_] attr_reader page_size: Integer? @@ -34,13 +34,11 @@ module Knockapi def initialize: ( ?after: String, ?before: String, - ?include: ::Array[Knockapi::Models::ObjectListParams::include_], + ?include: ::Array[Knockapi::ObjectListParams::include_], ?page_size: Integer, ?request_options: Knockapi::request_opts ) -> void - def to_hash: -> Knockapi::Models::object_list_params - type include_ = :preferences module Include @@ -48,7 +46,7 @@ module Knockapi PREFERENCES: :preferences - def self?.values: -> ::Array[Knockapi::Models::ObjectListParams::include_] + def self?.values: -> ::Array[Knockapi::ObjectListParams::include_] end end end diff --git a/sig/knockapi/models/object_list_preferences_params.rbs b/sig/knockapi/models/object_list_preferences_params.rbs index cdeb20b1..a13b375c 100644 --- a/sig/knockapi/models/object_list_preferences_params.rbs +++ b/sig/knockapi/models/object_list_preferences_params.rbs @@ -8,8 +8,6 @@ module Knockapi include Knockapi::Internal::Type::RequestParameters def initialize: (?request_options: Knockapi::request_opts) -> void - - def to_hash: -> Knockapi::Models::object_list_preferences_params end end end diff --git a/sig/knockapi/models/object_list_preferences_response.rbs b/sig/knockapi/models/object_list_preferences_response.rbs index 25e7d29d..2829003d 100644 --- a/sig/knockapi/models/object_list_preferences_response.rbs +++ b/sig/knockapi/models/object_list_preferences_response.rbs @@ -1,7 +1,7 @@ module Knockapi module Models type object_list_preferences_response = - ::Array[Knockapi::Models::Recipients::PreferenceSet] + ::Array[Knockapi::Recipients::PreferenceSet] ObjectListPreferencesResponse: Knockapi::Internal::Type::Converter end diff --git a/sig/knockapi/models/object_list_schedules_params.rbs b/sig/knockapi/models/object_list_schedules_params.rbs index d0f497d9..0597532f 100644 --- a/sig/knockapi/models/object_list_schedules_params.rbs +++ b/sig/knockapi/models/object_list_schedules_params.rbs @@ -42,8 +42,6 @@ module Knockapi ?workflow: String, ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::object_list_schedules_params end end end diff --git a/sig/knockapi/models/object_list_subscriptions_params.rbs b/sig/knockapi/models/object_list_subscriptions_params.rbs index ccb86147..861bf4a0 100644 --- a/sig/knockapi/models/object_list_subscriptions_params.rbs +++ b/sig/knockapi/models/object_list_subscriptions_params.rbs @@ -4,9 +4,9 @@ module Knockapi { after: String, before: String, - include: ::Array[Knockapi::Models::ObjectListSubscriptionsParams::include_], + include: ::Array[Knockapi::ObjectListSubscriptionsParams::include_], mode: Knockapi::Models::ObjectListSubscriptionsParams::mode, - objects: ::Array[Knockapi::Models::ObjectListSubscriptionsParams::Object], + objects: ::Array[Knockapi::ObjectListSubscriptionsParams::Object], page_size: Integer, recipients: ::Array[Knockapi::Models::recipient_reference] } @@ -24,11 +24,11 @@ module Knockapi def before=: (String) -> String - attr_reader include: ::Array[Knockapi::Models::ObjectListSubscriptionsParams::include_]? + attr_reader include: ::Array[Knockapi::ObjectListSubscriptionsParams::include_]? def include=: ( - ::Array[Knockapi::Models::ObjectListSubscriptionsParams::include_] - ) -> ::Array[Knockapi::Models::ObjectListSubscriptionsParams::include_] + ::Array[Knockapi::ObjectListSubscriptionsParams::include_] + ) -> ::Array[Knockapi::ObjectListSubscriptionsParams::include_] attr_reader mode: Knockapi::Models::ObjectListSubscriptionsParams::mode? @@ -36,11 +36,11 @@ module Knockapi Knockapi::Models::ObjectListSubscriptionsParams::mode ) -> Knockapi::Models::ObjectListSubscriptionsParams::mode - attr_reader objects: ::Array[Knockapi::Models::ObjectListSubscriptionsParams::Object]? + attr_reader objects: ::Array[Knockapi::ObjectListSubscriptionsParams::Object]? def objects=: ( - ::Array[Knockapi::Models::ObjectListSubscriptionsParams::Object] - ) -> ::Array[Knockapi::Models::ObjectListSubscriptionsParams::Object] + ::Array[Knockapi::ObjectListSubscriptionsParams::Object] + ) -> ::Array[Knockapi::ObjectListSubscriptionsParams::Object] attr_reader page_size: Integer? @@ -55,16 +55,14 @@ module Knockapi def initialize: ( ?after: String, ?before: String, - ?include: ::Array[Knockapi::Models::ObjectListSubscriptionsParams::include_], + ?include: ::Array[Knockapi::ObjectListSubscriptionsParams::include_], ?mode: Knockapi::Models::ObjectListSubscriptionsParams::mode, - ?objects: ::Array[Knockapi::Models::ObjectListSubscriptionsParams::Object], + ?objects: ::Array[Knockapi::ObjectListSubscriptionsParams::Object], ?page_size: Integer, ?recipients: ::Array[Knockapi::Models::recipient_reference], ?request_options: Knockapi::request_opts ) -> void - def to_hash: -> Knockapi::Models::object_list_subscriptions_params - type include_ = :preferences module Include @@ -72,7 +70,7 @@ module Knockapi PREFERENCES: :preferences - def self?.values: -> ::Array[Knockapi::Models::ObjectListSubscriptionsParams::include_] + def self?.values: -> ::Array[Knockapi::ObjectListSubscriptionsParams::include_] end type mode = :recipient | :object @@ -98,8 +96,6 @@ module Knockapi def collection=: (String) -> String def initialize: (?id: String, ?collection: String) -> void - - def to_hash: -> Knockapi::Models::ObjectListSubscriptionsParams::object end end end diff --git a/sig/knockapi/models/object_set_channel_data_params.rbs b/sig/knockapi/models/object_set_channel_data_params.rbs index adfed03e..16762cb3 100644 --- a/sig/knockapi/models/object_set_channel_data_params.rbs +++ b/sig/knockapi/models/object_set_channel_data_params.rbs @@ -8,8 +8,6 @@ module Knockapi include Knockapi::Internal::Type::RequestParameters def initialize: (?request_options: Knockapi::request_opts) -> void - - def to_hash: -> Knockapi::Models::object_set_channel_data_params end end end diff --git a/sig/knockapi/models/object_set_params.rbs b/sig/knockapi/models/object_set_params.rbs index 51c83f65..40814154 100644 --- a/sig/knockapi/models/object_set_params.rbs +++ b/sig/knockapi/models/object_set_params.rbs @@ -36,8 +36,6 @@ module Knockapi ?timezone: String?, ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::object_set_params end end end diff --git a/sig/knockapi/models/object_set_preferences_params.rbs b/sig/knockapi/models/object_set_preferences_params.rbs index 590a18af..657d590d 100644 --- a/sig/knockapi/models/object_set_preferences_params.rbs +++ b/sig/knockapi/models/object_set_preferences_params.rbs @@ -8,8 +8,6 @@ module Knockapi include Knockapi::Internal::Type::RequestParameters def initialize: (?request_options: Knockapi::request_opts) -> void - - def to_hash: -> Knockapi::Models::object_set_preferences_params end end end diff --git a/sig/knockapi/models/object_unset_channel_data_params.rbs b/sig/knockapi/models/object_unset_channel_data_params.rbs index a4d7a2e0..3ec88049 100644 --- a/sig/knockapi/models/object_unset_channel_data_params.rbs +++ b/sig/knockapi/models/object_unset_channel_data_params.rbs @@ -8,8 +8,6 @@ module Knockapi include Knockapi::Internal::Type::RequestParameters def initialize: (?request_options: Knockapi::request_opts) -> void - - def to_hash: -> Knockapi::Models::object_unset_channel_data_params end end end diff --git a/sig/knockapi/models/object_unset_channel_data_response.rbs b/sig/knockapi/models/object_unset_channel_data_response.rbs new file mode 100644 index 00000000..44e9cfd4 --- /dev/null +++ b/sig/knockapi/models/object_unset_channel_data_response.rbs @@ -0,0 +1,5 @@ +module Knockapi + module Models + class ObjectUnsetChannelDataResponse = String + end +end diff --git a/sig/knockapi/models/objects/bulk_add_subscriptions_params.rbs b/sig/knockapi/models/objects/bulk_add_subscriptions_params.rbs index cf00c22a..8cdcc198 100644 --- a/sig/knockapi/models/objects/bulk_add_subscriptions_params.rbs +++ b/sig/knockapi/models/objects/bulk_add_subscriptions_params.rbs @@ -3,7 +3,7 @@ module Knockapi module Objects type bulk_add_subscriptions_params = { - subscriptions: ::Array[Knockapi::Models::Objects::BulkAddSubscriptionsParams::Subscription] + subscriptions: ::Array[Knockapi::Objects::BulkAddSubscriptionsParams::Subscription] } & Knockapi::Internal::Type::request_parameters @@ -11,15 +11,13 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters - attr_accessor subscriptions: ::Array[Knockapi::Models::Objects::BulkAddSubscriptionsParams::Subscription] + attr_accessor subscriptions: ::Array[Knockapi::Objects::BulkAddSubscriptionsParams::Subscription] def initialize: ( - subscriptions: ::Array[Knockapi::Models::Objects::BulkAddSubscriptionsParams::Subscription], + subscriptions: ::Array[Knockapi::Objects::BulkAddSubscriptionsParams::Subscription], ?request_options: Knockapi::request_opts ) -> void - def to_hash: -> Knockapi::Models::Objects::bulk_add_subscriptions_params - type subscription = { recipients: ::Array[Knockapi::Models::recipient_request], @@ -35,8 +33,6 @@ module Knockapi recipients: ::Array[Knockapi::Models::recipient_request], ?properties: ::Hash[Symbol, top]? ) -> void - - def to_hash: -> Knockapi::Models::Objects::BulkAddSubscriptionsParams::subscription end end end diff --git a/sig/knockapi/models/objects/bulk_delete_params.rbs b/sig/knockapi/models/objects/bulk_delete_params.rbs index 966bbe9d..c3020450 100644 --- a/sig/knockapi/models/objects/bulk_delete_params.rbs +++ b/sig/knockapi/models/objects/bulk_delete_params.rbs @@ -15,8 +15,6 @@ module Knockapi object_ids: ::Array[String], ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::Objects::bulk_delete_params end end end diff --git a/sig/knockapi/models/objects/bulk_set_params.rbs b/sig/knockapi/models/objects/bulk_set_params.rbs index de8a79ab..75c84fc8 100644 --- a/sig/knockapi/models/objects/bulk_set_params.rbs +++ b/sig/knockapi/models/objects/bulk_set_params.rbs @@ -2,21 +2,19 @@ module Knockapi module Models module Objects type bulk_set_params = - { objects: ::Array[Knockapi::Models::InlineObjectRequest] } + { objects: ::Array[Knockapi::InlineObjectRequest] } & Knockapi::Internal::Type::request_parameters class BulkSetParams < Knockapi::Internal::Type::BaseModel extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters - attr_accessor objects: ::Array[Knockapi::Models::InlineObjectRequest] + attr_accessor objects: ::Array[Knockapi::InlineObjectRequest] def initialize: ( - objects: ::Array[Knockapi::Models::InlineObjectRequest], + objects: ::Array[Knockapi::InlineObjectRequest], ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::Objects::bulk_set_params end end end diff --git a/sig/knockapi/models/page_info.rbs b/sig/knockapi/models/page_info.rbs index a329252b..37af74ee 100644 --- a/sig/knockapi/models/page_info.rbs +++ b/sig/knockapi/models/page_info.rbs @@ -18,8 +18,6 @@ module Knockapi ?after: String?, ?before: String? ) -> void - - def to_hash: -> Knockapi::Models::page_info end end end diff --git a/sig/knockapi/models/providers/ms_team_check_auth_params.rbs b/sig/knockapi/models/providers/ms_team_check_auth_params.rbs index f0b77eec..02dcbd14 100644 --- a/sig/knockapi/models/providers/ms_team_check_auth_params.rbs +++ b/sig/knockapi/models/providers/ms_team_check_auth_params.rbs @@ -15,8 +15,6 @@ module Knockapi ms_teams_tenant_object: String, ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::Providers::ms_team_check_auth_params end end end diff --git a/sig/knockapi/models/providers/ms_team_check_auth_response.rbs b/sig/knockapi/models/providers/ms_team_check_auth_response.rbs index 6b239ceb..79bb47a2 100644 --- a/sig/knockapi/models/providers/ms_team_check_auth_response.rbs +++ b/sig/knockapi/models/providers/ms_team_check_auth_response.rbs @@ -13,8 +13,6 @@ module Knockapi connection: Knockapi::Models::Providers::MsTeamCheckAuthResponse::Connection ) -> void - def to_hash: -> Knockapi::Models::Providers::ms_team_check_auth_response - type connection = { ok: bool, reason: String? } class Connection < Knockapi::Internal::Type::BaseModel @@ -23,8 +21,6 @@ module Knockapi attr_accessor reason: String? def initialize: (ok: bool, ?reason: String?) -> void - - def to_hash: -> Knockapi::Models::Providers::MsTeamCheckAuthResponse::connection end end end diff --git a/sig/knockapi/models/providers/ms_team_list_channels_params.rbs b/sig/knockapi/models/providers/ms_team_list_channels_params.rbs index 203ad734..3770ea1d 100644 --- a/sig/knockapi/models/providers/ms_team_list_channels_params.rbs +++ b/sig/knockapi/models/providers/ms_team_list_channels_params.rbs @@ -5,7 +5,7 @@ module Knockapi { ms_teams_tenant_object: String, team_id: String, - query_options: Knockapi::Models::Providers::MsTeamListChannelsParams::QueryOptions + query_options: Knockapi::Providers::MsTeamListChannelsParams::QueryOptions } & Knockapi::Internal::Type::request_parameters @@ -17,21 +17,19 @@ module Knockapi attr_accessor team_id: String - attr_reader query_options: Knockapi::Models::Providers::MsTeamListChannelsParams::QueryOptions? + attr_reader query_options: Knockapi::Providers::MsTeamListChannelsParams::QueryOptions? def query_options=: ( - Knockapi::Models::Providers::MsTeamListChannelsParams::QueryOptions - ) -> Knockapi::Models::Providers::MsTeamListChannelsParams::QueryOptions + Knockapi::Providers::MsTeamListChannelsParams::QueryOptions + ) -> Knockapi::Providers::MsTeamListChannelsParams::QueryOptions def initialize: ( ms_teams_tenant_object: String, team_id: String, - ?query_options: Knockapi::Models::Providers::MsTeamListChannelsParams::QueryOptions, + ?query_options: Knockapi::Providers::MsTeamListChannelsParams::QueryOptions, ?request_options: Knockapi::request_opts ) -> void - def to_hash: -> Knockapi::Models::Providers::ms_team_list_channels_params - type query_options = { filter: String, select_: String } class QueryOptions < Knockapi::Internal::Type::BaseModel @@ -44,8 +42,6 @@ module Knockapi def select_=: (String) -> String def initialize: (?filter: String, ?select_: String) -> void - - def to_hash: -> Knockapi::Models::Providers::MsTeamListChannelsParams::query_options end end end diff --git a/sig/knockapi/models/providers/ms_team_list_channels_response.rbs b/sig/knockapi/models/providers/ms_team_list_channels_response.rbs index 1ca21333..36654a03 100644 --- a/sig/knockapi/models/providers/ms_team_list_channels_response.rbs +++ b/sig/knockapi/models/providers/ms_team_list_channels_response.rbs @@ -13,8 +13,6 @@ module Knockapi ms_teams_channels: ::Array[Knockapi::Models::Providers::MsTeamListChannelsResponse::MsTeamsChannel] ) -> void - def to_hash: -> Knockapi::Models::Providers::ms_team_list_channels_response - type ms_teams_channel = { id: String, @@ -52,8 +50,6 @@ module Knockapi ?is_archived: bool, ?membership_type: String ) -> void - - def to_hash: -> Knockapi::Models::Providers::MsTeamListChannelsResponse::ms_teams_channel end end end diff --git a/sig/knockapi/models/providers/ms_team_list_teams_params.rbs b/sig/knockapi/models/providers/ms_team_list_teams_params.rbs index 588e9b8b..f2b1e738 100644 --- a/sig/knockapi/models/providers/ms_team_list_teams_params.rbs +++ b/sig/knockapi/models/providers/ms_team_list_teams_params.rbs @@ -4,7 +4,7 @@ module Knockapi type ms_team_list_teams_params = { ms_teams_tenant_object: String, - query_options: Knockapi::Models::Providers::MsTeamListTeamsParams::QueryOptions + query_options: Knockapi::Providers::MsTeamListTeamsParams::QueryOptions } & Knockapi::Internal::Type::request_parameters @@ -14,20 +14,18 @@ module Knockapi attr_accessor ms_teams_tenant_object: String - attr_reader query_options: Knockapi::Models::Providers::MsTeamListTeamsParams::QueryOptions? + attr_reader query_options: Knockapi::Providers::MsTeamListTeamsParams::QueryOptions? def query_options=: ( - Knockapi::Models::Providers::MsTeamListTeamsParams::QueryOptions - ) -> Knockapi::Models::Providers::MsTeamListTeamsParams::QueryOptions + Knockapi::Providers::MsTeamListTeamsParams::QueryOptions + ) -> Knockapi::Providers::MsTeamListTeamsParams::QueryOptions def initialize: ( ms_teams_tenant_object: String, - ?query_options: Knockapi::Models::Providers::MsTeamListTeamsParams::QueryOptions, + ?query_options: Knockapi::Providers::MsTeamListTeamsParams::QueryOptions, ?request_options: Knockapi::request_opts ) -> void - def to_hash: -> Knockapi::Models::Providers::ms_team_list_teams_params - type query_options = { filter: String, select_: String, skiptoken: String, top: Integer } @@ -54,8 +52,6 @@ module Knockapi ?skiptoken: String, ?top: Integer ) -> void - - def to_hash: -> Knockapi::Models::Providers::MsTeamListTeamsParams::query_options end end end diff --git a/sig/knockapi/models/providers/ms_team_list_teams_response.rbs b/sig/knockapi/models/providers/ms_team_list_teams_response.rbs index 91a64cb2..5e405ec4 100644 --- a/sig/knockapi/models/providers/ms_team_list_teams_response.rbs +++ b/sig/knockapi/models/providers/ms_team_list_teams_response.rbs @@ -16,8 +16,6 @@ module Knockapi display_name: String, ?description: String? ) -> void - - def to_hash: -> Knockapi::Models::Providers::ms_team_list_teams_response end end end diff --git a/sig/knockapi/models/providers/ms_team_revoke_access_params.rbs b/sig/knockapi/models/providers/ms_team_revoke_access_params.rbs index 79c9c76b..a1648c95 100644 --- a/sig/knockapi/models/providers/ms_team_revoke_access_params.rbs +++ b/sig/knockapi/models/providers/ms_team_revoke_access_params.rbs @@ -15,8 +15,6 @@ module Knockapi ms_teams_tenant_object: String, ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::Providers::ms_team_revoke_access_params end end end diff --git a/sig/knockapi/models/providers/ms_team_revoke_access_response.rbs b/sig/knockapi/models/providers/ms_team_revoke_access_response.rbs index 3aa65c2e..1b9dad75 100644 --- a/sig/knockapi/models/providers/ms_team_revoke_access_response.rbs +++ b/sig/knockapi/models/providers/ms_team_revoke_access_response.rbs @@ -9,8 +9,6 @@ module Knockapi def ok=: (String) -> String def initialize: (?ok: String) -> void - - def to_hash: -> Knockapi::Models::Providers::ms_team_revoke_access_response end end end diff --git a/sig/knockapi/models/providers/slack_check_auth_params.rbs b/sig/knockapi/models/providers/slack_check_auth_params.rbs index 23de8d38..95a8cc02 100644 --- a/sig/knockapi/models/providers/slack_check_auth_params.rbs +++ b/sig/knockapi/models/providers/slack_check_auth_params.rbs @@ -15,8 +15,6 @@ module Knockapi access_token_object: String, ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::Providers::slack_check_auth_params end end end diff --git a/sig/knockapi/models/providers/slack_check_auth_response.rbs b/sig/knockapi/models/providers/slack_check_auth_response.rbs index 7d9db951..07c09369 100644 --- a/sig/knockapi/models/providers/slack_check_auth_response.rbs +++ b/sig/knockapi/models/providers/slack_check_auth_response.rbs @@ -13,8 +13,6 @@ module Knockapi connection: Knockapi::Models::Providers::SlackCheckAuthResponse::Connection ) -> void - def to_hash: -> Knockapi::Models::Providers::slack_check_auth_response - type connection = { ok: bool, reason: String? } class Connection < Knockapi::Internal::Type::BaseModel @@ -23,8 +21,6 @@ module Knockapi attr_accessor reason: String? def initialize: (ok: bool, ?reason: String?) -> void - - def to_hash: -> Knockapi::Models::Providers::SlackCheckAuthResponse::connection end end end diff --git a/sig/knockapi/models/providers/slack_list_channels_params.rbs b/sig/knockapi/models/providers/slack_list_channels_params.rbs index e11a109a..eb4776b5 100644 --- a/sig/knockapi/models/providers/slack_list_channels_params.rbs +++ b/sig/knockapi/models/providers/slack_list_channels_params.rbs @@ -4,7 +4,7 @@ module Knockapi type slack_list_channels_params = { access_token_object: String, - query_options: Knockapi::Models::Providers::SlackListChannelsParams::QueryOptions + query_options: Knockapi::Providers::SlackListChannelsParams::QueryOptions } & Knockapi::Internal::Type::request_parameters @@ -14,20 +14,18 @@ module Knockapi attr_accessor access_token_object: String - attr_reader query_options: Knockapi::Models::Providers::SlackListChannelsParams::QueryOptions? + attr_reader query_options: Knockapi::Providers::SlackListChannelsParams::QueryOptions? def query_options=: ( - Knockapi::Models::Providers::SlackListChannelsParams::QueryOptions - ) -> Knockapi::Models::Providers::SlackListChannelsParams::QueryOptions + Knockapi::Providers::SlackListChannelsParams::QueryOptions + ) -> Knockapi::Providers::SlackListChannelsParams::QueryOptions def initialize: ( access_token_object: String, - ?query_options: Knockapi::Models::Providers::SlackListChannelsParams::QueryOptions, + ?query_options: Knockapi::Providers::SlackListChannelsParams::QueryOptions, ?request_options: Knockapi::request_opts ) -> void - def to_hash: -> Knockapi::Models::Providers::slack_list_channels_params - type query_options = { cursor: String, @@ -65,8 +63,6 @@ module Knockapi ?team_id: String, ?types: String ) -> void - - def to_hash: -> Knockapi::Models::Providers::SlackListChannelsParams::query_options end end end diff --git a/sig/knockapi/models/providers/slack_list_channels_response.rbs b/sig/knockapi/models/providers/slack_list_channels_response.rbs index f2284a69..622aa0e6 100644 --- a/sig/knockapi/models/providers/slack_list_channels_response.rbs +++ b/sig/knockapi/models/providers/slack_list_channels_response.rbs @@ -28,8 +28,6 @@ module Knockapi is_private: bool, name: String ) -> void - - def to_hash: -> Knockapi::Models::Providers::slack_list_channels_response end end end diff --git a/sig/knockapi/models/providers/slack_revoke_access_params.rbs b/sig/knockapi/models/providers/slack_revoke_access_params.rbs index 2fb6920d..0ffe2e66 100644 --- a/sig/knockapi/models/providers/slack_revoke_access_params.rbs +++ b/sig/knockapi/models/providers/slack_revoke_access_params.rbs @@ -15,8 +15,6 @@ module Knockapi access_token_object: String, ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::Providers::slack_revoke_access_params end end end diff --git a/sig/knockapi/models/providers/slack_revoke_access_response.rbs b/sig/knockapi/models/providers/slack_revoke_access_response.rbs index 22a60511..9a137511 100644 --- a/sig/knockapi/models/providers/slack_revoke_access_response.rbs +++ b/sig/knockapi/models/providers/slack_revoke_access_response.rbs @@ -9,8 +9,6 @@ module Knockapi def ok=: (String) -> String def initialize: (?ok: String) -> void - - def to_hash: -> Knockapi::Models::Providers::slack_revoke_access_response end end end diff --git a/sig/knockapi/models/recipient.rbs b/sig/knockapi/models/recipient.rbs index 775db03b..3fad24b1 100644 --- a/sig/knockapi/models/recipient.rbs +++ b/sig/knockapi/models/recipient.rbs @@ -1,11 +1,11 @@ module Knockapi module Models - type recipient = Knockapi::Models::User | Knockapi::Models::Object + type recipient = Knockapi::User | Knockapi::Object module Recipient extend Knockapi::Internal::Type::Union - def self?.variants: -> [Knockapi::Models::User, Knockapi::Models::Object] + def self?.variants: -> ::Array[Knockapi::Models::recipient] end end end diff --git a/sig/knockapi/models/recipient_reference.rbs b/sig/knockapi/models/recipient_reference.rbs index d062821f..4088b624 100644 --- a/sig/knockapi/models/recipient_reference.rbs +++ b/sig/knockapi/models/recipient_reference.rbs @@ -1,7 +1,7 @@ module Knockapi module Models type recipient_reference = - String | Knockapi::Models::RecipientReference::ObjectReference + String | Knockapi::RecipientReference::ObjectReference module RecipientReference extend Knockapi::Internal::Type::Union @@ -18,11 +18,9 @@ module Knockapi def collection=: (String) -> String def initialize: (?id: String, ?collection: String) -> void - - def to_hash: -> Knockapi::Models::RecipientReference::object_reference end - def self?.variants: -> [String, Knockapi::Models::RecipientReference::ObjectReference] + def self?.variants: -> ::Array[Knockapi::Models::recipient_reference] end end end diff --git a/sig/knockapi/models/recipient_request.rbs b/sig/knockapi/models/recipient_request.rbs index 2c927860..9b561113 100644 --- a/sig/knockapi/models/recipient_request.rbs +++ b/sig/knockapi/models/recipient_request.rbs @@ -2,13 +2,13 @@ module Knockapi module Models type recipient_request = String - | Knockapi::Models::InlineIdentifyUserRequest - | Knockapi::Models::InlineObjectRequest + | Knockapi::InlineIdentifyUserRequest + | Knockapi::InlineObjectRequest module RecipientRequest extend Knockapi::Internal::Type::Union - def self?.variants: -> [String, Knockapi::Models::InlineIdentifyUserRequest, Knockapi::Models::InlineObjectRequest] + def self?.variants: -> ::Array[Knockapi::Models::recipient_request] end end end diff --git a/sig/knockapi/models/recipients/channel_data.rbs b/sig/knockapi/models/recipients/channel_data.rbs index 51411875..f6f892ce 100644 --- a/sig/knockapi/models/recipients/channel_data.rbs +++ b/sig/knockapi/models/recipients/channel_data.rbs @@ -5,8 +5,8 @@ module Knockapi { _typename: String, channel_id: String, - data: Knockapi::Models::Recipients::RecipientsChannelData::data, - provider: Knockapi::Models::Recipients::RecipientsChannelData::provider + data: Knockapi::Recipients::RecipientsChannelData::data, + provider: Knockapi::Recipients::RecipientsChannelData::provider } class RecipientsChannelData < Knockapi::Internal::Type::BaseModel @@ -14,34 +14,32 @@ module Knockapi attr_accessor channel_id: String - attr_accessor data: Knockapi::Models::Recipients::RecipientsChannelData::data + attr_accessor data: Knockapi::Recipients::RecipientsChannelData::data - attr_reader provider: Knockapi::Models::Recipients::RecipientsChannelData::provider? + attr_reader provider: Knockapi::Recipients::RecipientsChannelData::provider? def provider=: ( - Knockapi::Models::Recipients::RecipientsChannelData::provider - ) -> Knockapi::Models::Recipients::RecipientsChannelData::provider + Knockapi::Recipients::RecipientsChannelData::provider + ) -> Knockapi::Recipients::RecipientsChannelData::provider def initialize: ( _typename: String, channel_id: String, - data: Knockapi::Models::Recipients::RecipientsChannelData::data, - ?provider: Knockapi::Models::Recipients::RecipientsChannelData::provider + data: Knockapi::Recipients::RecipientsChannelData::data, + ?provider: Knockapi::Recipients::RecipientsChannelData::provider ) -> void - def to_hash: -> Knockapi::Models::Recipients::recipients_channel_data - type data = - Knockapi::Models::Recipients::PushChannelData - | Knockapi::Models::Recipients::SlackChannelData - | Knockapi::Models::Recipients::MsTeamsChannelData - | Knockapi::Models::Recipients::DiscordChannelData - | Knockapi::Models::Recipients::OneSignalChannelData + Knockapi::Recipients::PushChannelData + | Knockapi::Recipients::SlackChannelData + | Knockapi::Recipients::MsTeamsChannelData + | Knockapi::Recipients::DiscordChannelData + | Knockapi::Recipients::OneSignalChannelData module Data extend Knockapi::Internal::Type::Union - def self?.variants: -> [Knockapi::Models::Recipients::PushChannelData, Knockapi::Models::Recipients::SlackChannelData, Knockapi::Models::Recipients::MsTeamsChannelData, Knockapi::Models::Recipients::DiscordChannelData, Knockapi::Models::Recipients::OneSignalChannelData] + def self?.variants: -> ::Array[Knockapi::Recipients::RecipientsChannelData::data] end type provider = @@ -66,7 +64,7 @@ module Knockapi CHAT_DISCORD: :chat_discord HTTP_KNOCK_WEBHOOK: :http_knock_webhook - def self?.values: -> ::Array[Knockapi::Models::Recipients::RecipientsChannelData::provider] + def self?.values: -> ::Array[Knockapi::Recipients::RecipientsChannelData::provider] end end end diff --git a/sig/knockapi/models/recipients/channel_data_request.rbs b/sig/knockapi/models/recipients/channel_data_request.rbs index 8e824436..827319d8 100644 --- a/sig/knockapi/models/recipients/channel_data_request.rbs +++ b/sig/knockapi/models/recipients/channel_data_request.rbs @@ -2,28 +2,26 @@ module Knockapi module Models module Recipients type channel_data_request = - { data: Knockapi::Models::Recipients::ChannelDataRequest::data } + { data: Knockapi::Recipients::ChannelDataRequest::data } class ChannelDataRequest < Knockapi::Internal::Type::BaseModel - attr_accessor data: Knockapi::Models::Recipients::ChannelDataRequest::data + attr_accessor data: Knockapi::Recipients::ChannelDataRequest::data def initialize: ( - data: Knockapi::Models::Recipients::ChannelDataRequest::data + data: Knockapi::Recipients::ChannelDataRequest::data ) -> void - def to_hash: -> Knockapi::Models::Recipients::channel_data_request - type data = - Knockapi::Models::Recipients::PushChannelData - | Knockapi::Models::Recipients::OneSignalChannelData - | Knockapi::Models::Recipients::SlackChannelData - | Knockapi::Models::Recipients::MsTeamsChannelData - | Knockapi::Models::Recipients::DiscordChannelData + Knockapi::Recipients::PushChannelData + | Knockapi::Recipients::OneSignalChannelData + | Knockapi::Recipients::SlackChannelData + | Knockapi::Recipients::MsTeamsChannelData + | Knockapi::Recipients::DiscordChannelData module Data extend Knockapi::Internal::Type::Union - def self?.variants: -> [Knockapi::Models::Recipients::PushChannelData, Knockapi::Models::Recipients::OneSignalChannelData, Knockapi::Models::Recipients::SlackChannelData, Knockapi::Models::Recipients::MsTeamsChannelData, Knockapi::Models::Recipients::DiscordChannelData] + def self?.variants: -> ::Array[Knockapi::Recipients::ChannelDataRequest::data] end end end diff --git a/sig/knockapi/models/recipients/discord_channel_data.rbs b/sig/knockapi/models/recipients/discord_channel_data.rbs index 85ac5048..e79929c6 100644 --- a/sig/knockapi/models/recipients/discord_channel_data.rbs +++ b/sig/knockapi/models/recipients/discord_channel_data.rbs @@ -3,21 +3,19 @@ module Knockapi module Recipients type discord_channel_data = { - connections: ::Array[Knockapi::Models::Recipients::DiscordChannelData::connection] + connections: ::Array[Knockapi::Recipients::DiscordChannelData::connection] } class DiscordChannelData < Knockapi::Internal::Type::BaseModel - attr_accessor connections: ::Array[Knockapi::Models::Recipients::DiscordChannelData::connection] + attr_accessor connections: ::Array[Knockapi::Recipients::DiscordChannelData::connection] def initialize: ( - connections: ::Array[Knockapi::Models::Recipients::DiscordChannelData::connection] + connections: ::Array[Knockapi::Recipients::DiscordChannelData::connection] ) -> void - def to_hash: -> Knockapi::Models::Recipients::discord_channel_data - type connection = - Knockapi::Models::Recipients::DiscordChannelData::Connection::DiscordChannelConnection - | Knockapi::Models::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection + Knockapi::Recipients::DiscordChannelData::Connection::DiscordChannelConnection + | Knockapi::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection module Connection extend Knockapi::Internal::Type::Union @@ -28,36 +26,30 @@ module Knockapi attr_accessor channel_id: String def initialize: (channel_id: String) -> void - - def to_hash: -> Knockapi::Models::Recipients::DiscordChannelData::Connection::discord_channel_connection end type discord_incoming_webhook_connection = { - incoming_webhook: Knockapi::Models::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection::IncomingWebhook + incoming_webhook: Knockapi::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection::IncomingWebhook } class DiscordIncomingWebhookConnection < Knockapi::Internal::Type::BaseModel - attr_accessor incoming_webhook: Knockapi::Models::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection::IncomingWebhook + attr_accessor incoming_webhook: Knockapi::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection::IncomingWebhook def initialize: ( - incoming_webhook: Knockapi::Models::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection::IncomingWebhook + incoming_webhook: Knockapi::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection::IncomingWebhook ) -> void - def to_hash: -> Knockapi::Models::Recipients::DiscordChannelData::Connection::discord_incoming_webhook_connection - type incoming_webhook = { url: String } class IncomingWebhook < Knockapi::Internal::Type::BaseModel attr_accessor url: String def initialize: (url: String) -> void - - def to_hash: -> Knockapi::Models::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection::incoming_webhook end end - def self?.variants: -> [Knockapi::Models::Recipients::DiscordChannelData::Connection::DiscordChannelConnection, Knockapi::Models::Recipients::DiscordChannelData::Connection::DiscordIncomingWebhookConnection] + def self?.variants: -> ::Array[Knockapi::Recipients::DiscordChannelData::connection] end end end diff --git a/sig/knockapi/models/recipients/inline_channel_data_request.rbs b/sig/knockapi/models/recipients/inline_channel_data_request.rbs index b7a328f7..25de5cd8 100644 --- a/sig/knockapi/models/recipients/inline_channel_data_request.rbs +++ b/sig/knockapi/models/recipients/inline_channel_data_request.rbs @@ -1,8 +1,21 @@ module Knockapi module Models module Recipients + type inline_channel_data_request_item = + Knockapi::Recipients::PushChannelData + | Knockapi::Recipients::OneSignalChannelData + | Knockapi::Recipients::SlackChannelData + | Knockapi::Recipients::MsTeamsChannelData + | Knockapi::Recipients::DiscordChannelData + + module InlineChannelDataRequestItem + extend Knockapi::Internal::Type::Union + + def self?.variants: -> ::Array[Knockapi::Recipients::inline_channel_data_request_item] + end + type inline_channel_data_request = - ::Hash[Symbol, Knockapi::Models::Recipients::ChannelDataRequest] + ::Hash[Symbol, Knockapi::Recipients::inline_channel_data_request_item] InlineChannelDataRequest: Knockapi::Internal::Type::Converter end diff --git a/sig/knockapi/models/recipients/inline_preference_set_request.rbs b/sig/knockapi/models/recipients/inline_preference_set_request.rbs index 837956cd..1274f1b8 100644 --- a/sig/knockapi/models/recipients/inline_preference_set_request.rbs +++ b/sig/knockapi/models/recipients/inline_preference_set_request.rbs @@ -2,7 +2,7 @@ module Knockapi module Models module Recipients type inline_preference_set_request = - ::Hash[Symbol, Knockapi::Models::Recipients::PreferenceSetRequest] + ::Hash[Symbol, Knockapi::Recipients::PreferenceSetRequest] InlinePreferenceSetRequest: Knockapi::Internal::Type::Converter end diff --git a/sig/knockapi/models/recipients/ms_teams_channel_data.rbs b/sig/knockapi/models/recipients/ms_teams_channel_data.rbs index 8d64621f..7dd95f7c 100644 --- a/sig/knockapi/models/recipients/ms_teams_channel_data.rbs +++ b/sig/knockapi/models/recipients/ms_teams_channel_data.rbs @@ -3,25 +3,23 @@ module Knockapi module Recipients type ms_teams_channel_data = { - connections: ::Array[Knockapi::Models::Recipients::MsTeamsChannelData::connection], + connections: ::Array[Knockapi::Recipients::MsTeamsChannelData::connection], ms_teams_tenant_id: String? } class MsTeamsChannelData < Knockapi::Internal::Type::BaseModel - attr_accessor connections: ::Array[Knockapi::Models::Recipients::MsTeamsChannelData::connection] + attr_accessor connections: ::Array[Knockapi::Recipients::MsTeamsChannelData::connection] attr_accessor ms_teams_tenant_id: String? def initialize: ( - connections: ::Array[Knockapi::Models::Recipients::MsTeamsChannelData::connection], + connections: ::Array[Knockapi::Recipients::MsTeamsChannelData::connection], ?ms_teams_tenant_id: String? ) -> void - def to_hash: -> Knockapi::Models::Recipients::ms_teams_channel_data - type connection = - Knockapi::Models::Recipients::MsTeamsChannelData::Connection::MsTeamsTokenConnection - | Knockapi::Models::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection + Knockapi::Recipients::MsTeamsChannelData::Connection::MsTeamsTokenConnection + | Knockapi::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection module Connection extend Knockapi::Internal::Type::Union @@ -49,36 +47,30 @@ module Knockapi ?ms_teams_tenant_id: String?, ?ms_teams_user_id: String? ) -> void - - def to_hash: -> Knockapi::Models::Recipients::MsTeamsChannelData::Connection::ms_teams_token_connection end type ms_teams_incoming_webhook_connection = { - incoming_webhook: Knockapi::Models::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection::IncomingWebhook + incoming_webhook: Knockapi::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection::IncomingWebhook } class MsTeamsIncomingWebhookConnection < Knockapi::Internal::Type::BaseModel - attr_accessor incoming_webhook: Knockapi::Models::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection::IncomingWebhook + attr_accessor incoming_webhook: Knockapi::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection::IncomingWebhook def initialize: ( - incoming_webhook: Knockapi::Models::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection::IncomingWebhook + incoming_webhook: Knockapi::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection::IncomingWebhook ) -> void - def to_hash: -> Knockapi::Models::Recipients::MsTeamsChannelData::Connection::ms_teams_incoming_webhook_connection - type incoming_webhook = { url: String } class IncomingWebhook < Knockapi::Internal::Type::BaseModel attr_accessor url: String def initialize: (url: String) -> void - - def to_hash: -> Knockapi::Models::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection::incoming_webhook end end - def self?.variants: -> [Knockapi::Models::Recipients::MsTeamsChannelData::Connection::MsTeamsTokenConnection, Knockapi::Models::Recipients::MsTeamsChannelData::Connection::MsTeamsIncomingWebhookConnection] + def self?.variants: -> ::Array[Knockapi::Recipients::MsTeamsChannelData::connection] end end end diff --git a/sig/knockapi/models/recipients/one_signal_channel_data.rbs b/sig/knockapi/models/recipients/one_signal_channel_data.rbs index 9c7c9492..0eaa3fc2 100644 --- a/sig/knockapi/models/recipients/one_signal_channel_data.rbs +++ b/sig/knockapi/models/recipients/one_signal_channel_data.rbs @@ -7,8 +7,6 @@ module Knockapi attr_accessor player_ids: ::Array[String] def initialize: (player_ids: ::Array[String]) -> void - - def to_hash: -> Knockapi::Models::Recipients::one_signal_channel_data end end end diff --git a/sig/knockapi/models/recipients/preference_set.rbs b/sig/knockapi/models/recipients/preference_set.rbs index d9ef3e94..4e802f37 100644 --- a/sig/knockapi/models/recipients/preference_set.rbs +++ b/sig/knockapi/models/recipients/preference_set.rbs @@ -4,85 +4,79 @@ module Knockapi type preference_set = { id: String, - categories: ::Hash[Symbol, Knockapi::Models::Recipients::PreferenceSet::category]?, - channel_types: Knockapi::Models::Recipients::PreferenceSetChannelTypes?, - workflows: ::Hash[Symbol, Knockapi::Models::Recipients::PreferenceSet::workflow]? + categories: ::Hash[Symbol, Knockapi::Recipients::PreferenceSet::category]?, + channel_types: Knockapi::Recipients::PreferenceSetChannelTypes?, + workflows: ::Hash[Symbol, Knockapi::Recipients::PreferenceSet::workflow]? } class PreferenceSet < Knockapi::Internal::Type::BaseModel attr_accessor id: String - attr_accessor categories: ::Hash[Symbol, Knockapi::Models::Recipients::PreferenceSet::category]? + attr_accessor categories: ::Hash[Symbol, Knockapi::Recipients::PreferenceSet::category]? - attr_accessor channel_types: Knockapi::Models::Recipients::PreferenceSetChannelTypes? + attr_accessor channel_types: Knockapi::Recipients::PreferenceSetChannelTypes? - attr_accessor workflows: ::Hash[Symbol, Knockapi::Models::Recipients::PreferenceSet::workflow]? + attr_accessor workflows: ::Hash[Symbol, Knockapi::Recipients::PreferenceSet::workflow]? def initialize: ( id: String, - ?categories: ::Hash[Symbol, Knockapi::Models::Recipients::PreferenceSet::category]?, - ?channel_types: Knockapi::Models::Recipients::PreferenceSetChannelTypes?, - ?workflows: ::Hash[Symbol, Knockapi::Models::Recipients::PreferenceSet::workflow]? + ?categories: ::Hash[Symbol, Knockapi::Recipients::PreferenceSet::category]?, + ?channel_types: Knockapi::Recipients::PreferenceSetChannelTypes?, + ?workflows: ::Hash[Symbol, Knockapi::Recipients::PreferenceSet::workflow]? ) -> void - def to_hash: -> Knockapi::Models::Recipients::preference_set - type category = bool - | Knockapi::Models::Recipients::PreferenceSet::Category::PreferenceSetWorkflowCategorySettingObject + | Knockapi::Recipients::PreferenceSet::Category::PreferenceSetWorkflowCategorySettingObject module Category extend Knockapi::Internal::Type::Union type preference_set_workflow_category_setting_object = { - channel_types: Knockapi::Models::Recipients::PreferenceSetChannelTypes?, - conditions: ::Array[Knockapi::Models::Condition]? + channel_types: Knockapi::Recipients::PreferenceSetChannelTypes?, + conditions: ::Array[Knockapi::Condition]? } class PreferenceSetWorkflowCategorySettingObject < Knockapi::Internal::Type::BaseModel - attr_accessor channel_types: Knockapi::Models::Recipients::PreferenceSetChannelTypes? + attr_accessor channel_types: Knockapi::Recipients::PreferenceSetChannelTypes? - attr_accessor conditions: ::Array[Knockapi::Models::Condition]? + attr_accessor conditions: ::Array[Knockapi::Condition]? def initialize: ( - ?channel_types: Knockapi::Models::Recipients::PreferenceSetChannelTypes?, - ?conditions: ::Array[Knockapi::Models::Condition]? + ?channel_types: Knockapi::Recipients::PreferenceSetChannelTypes?, + ?conditions: ::Array[Knockapi::Condition]? ) -> void - - def to_hash: -> Knockapi::Models::Recipients::PreferenceSet::Category::preference_set_workflow_category_setting_object end - def self?.variants: -> [bool, Knockapi::Models::Recipients::PreferenceSet::Category::PreferenceSetWorkflowCategorySettingObject] + def self?.variants: -> ::Array[Knockapi::Recipients::PreferenceSet::category] end type workflow = bool - | Knockapi::Models::Recipients::PreferenceSet::Workflow::PreferenceSetWorkflowCategorySettingObject + | Knockapi::Recipients::PreferenceSet::Workflow::PreferenceSetWorkflowCategorySettingObject module Workflow extend Knockapi::Internal::Type::Union type preference_set_workflow_category_setting_object = { - channel_types: Knockapi::Models::Recipients::PreferenceSetChannelTypes?, - conditions: ::Array[Knockapi::Models::Condition]? + channel_types: Knockapi::Recipients::PreferenceSetChannelTypes?, + conditions: ::Array[Knockapi::Condition]? } class PreferenceSetWorkflowCategorySettingObject < Knockapi::Internal::Type::BaseModel - attr_accessor channel_types: Knockapi::Models::Recipients::PreferenceSetChannelTypes? + attr_accessor channel_types: Knockapi::Recipients::PreferenceSetChannelTypes? - attr_accessor conditions: ::Array[Knockapi::Models::Condition]? + attr_accessor conditions: ::Array[Knockapi::Condition]? def initialize: ( - ?channel_types: Knockapi::Models::Recipients::PreferenceSetChannelTypes?, - ?conditions: ::Array[Knockapi::Models::Condition]? + ?channel_types: Knockapi::Recipients::PreferenceSetChannelTypes?, + ?conditions: ::Array[Knockapi::Condition]? ) -> void - - def to_hash: -> Knockapi::Models::Recipients::PreferenceSet::Workflow::preference_set_workflow_category_setting_object end - def self?.variants: -> [bool, Knockapi::Models::Recipients::PreferenceSet::Workflow::PreferenceSetWorkflowCategorySettingObject] + def self?.variants: -> ::Array[Knockapi::Recipients::PreferenceSet::workflow] end end end diff --git a/sig/knockapi/models/recipients/preference_set_channel_type_setting.rbs b/sig/knockapi/models/recipients/preference_set_channel_type_setting.rbs index afeb97ac..f28175bd 100644 --- a/sig/knockapi/models/recipients/preference_set_channel_type_setting.rbs +++ b/sig/knockapi/models/recipients/preference_set_channel_type_setting.rbs @@ -2,16 +2,12 @@ module Knockapi module Models module Recipients type preference_set_channel_type_setting = - { conditions: ::Array[Knockapi::Models::Condition] } + { conditions: ::Array[Knockapi::Condition] } class PreferenceSetChannelTypeSetting < Knockapi::Internal::Type::BaseModel - attr_accessor conditions: ::Array[Knockapi::Models::Condition] + attr_accessor conditions: ::Array[Knockapi::Condition] - def initialize: ( - conditions: ::Array[Knockapi::Models::Condition] - ) -> void - - def to_hash: -> Knockapi::Models::Recipients::preference_set_channel_type_setting + def initialize: (conditions: ::Array[Knockapi::Condition]) -> void end end end diff --git a/sig/knockapi/models/recipients/preference_set_channel_types.rbs b/sig/knockapi/models/recipients/preference_set_channel_types.rbs index 950db857..71b6d82c 100644 --- a/sig/knockapi/models/recipients/preference_set_channel_types.rbs +++ b/sig/knockapi/models/recipients/preference_set_channel_types.rbs @@ -3,114 +3,108 @@ module Knockapi module Recipients type preference_set_channel_types = { - chat: Knockapi::Models::Recipients::PreferenceSetChannelTypes::chat, - email: Knockapi::Models::Recipients::PreferenceSetChannelTypes::email, - http: Knockapi::Models::Recipients::PreferenceSetChannelTypes::http, - in_app_feed: Knockapi::Models::Recipients::PreferenceSetChannelTypes::in_app_feed, - push: Knockapi::Models::Recipients::PreferenceSetChannelTypes::push, - sms: Knockapi::Models::Recipients::PreferenceSetChannelTypes::sms + chat: Knockapi::Recipients::PreferenceSetChannelTypes::chat, + email: Knockapi::Recipients::PreferenceSetChannelTypes::email, + http: Knockapi::Recipients::PreferenceSetChannelTypes::http, + in_app_feed: Knockapi::Recipients::PreferenceSetChannelTypes::in_app_feed, + push: Knockapi::Recipients::PreferenceSetChannelTypes::push, + sms: Knockapi::Recipients::PreferenceSetChannelTypes::sms } class PreferenceSetChannelTypes < Knockapi::Internal::Type::BaseModel - attr_reader chat: Knockapi::Models::Recipients::PreferenceSetChannelTypes::chat? + attr_reader chat: Knockapi::Recipients::PreferenceSetChannelTypes::chat? def chat=: ( - Knockapi::Models::Recipients::PreferenceSetChannelTypes::chat - ) -> Knockapi::Models::Recipients::PreferenceSetChannelTypes::chat + Knockapi::Recipients::PreferenceSetChannelTypes::chat + ) -> Knockapi::Recipients::PreferenceSetChannelTypes::chat - attr_reader email: Knockapi::Models::Recipients::PreferenceSetChannelTypes::email? + attr_reader email: Knockapi::Recipients::PreferenceSetChannelTypes::email? def email=: ( - Knockapi::Models::Recipients::PreferenceSetChannelTypes::email - ) -> Knockapi::Models::Recipients::PreferenceSetChannelTypes::email + Knockapi::Recipients::PreferenceSetChannelTypes::email + ) -> Knockapi::Recipients::PreferenceSetChannelTypes::email - attr_reader http: Knockapi::Models::Recipients::PreferenceSetChannelTypes::http? + attr_reader http: Knockapi::Recipients::PreferenceSetChannelTypes::http? def http=: ( - Knockapi::Models::Recipients::PreferenceSetChannelTypes::http - ) -> Knockapi::Models::Recipients::PreferenceSetChannelTypes::http + Knockapi::Recipients::PreferenceSetChannelTypes::http + ) -> Knockapi::Recipients::PreferenceSetChannelTypes::http - attr_reader in_app_feed: Knockapi::Models::Recipients::PreferenceSetChannelTypes::in_app_feed? + attr_reader in_app_feed: Knockapi::Recipients::PreferenceSetChannelTypes::in_app_feed? def in_app_feed=: ( - Knockapi::Models::Recipients::PreferenceSetChannelTypes::in_app_feed - ) -> Knockapi::Models::Recipients::PreferenceSetChannelTypes::in_app_feed + Knockapi::Recipients::PreferenceSetChannelTypes::in_app_feed + ) -> Knockapi::Recipients::PreferenceSetChannelTypes::in_app_feed - attr_reader push: Knockapi::Models::Recipients::PreferenceSetChannelTypes::push? + attr_reader push: Knockapi::Recipients::PreferenceSetChannelTypes::push? def push=: ( - Knockapi::Models::Recipients::PreferenceSetChannelTypes::push - ) -> Knockapi::Models::Recipients::PreferenceSetChannelTypes::push + Knockapi::Recipients::PreferenceSetChannelTypes::push + ) -> Knockapi::Recipients::PreferenceSetChannelTypes::push - attr_reader sms: Knockapi::Models::Recipients::PreferenceSetChannelTypes::sms? + attr_reader sms: Knockapi::Recipients::PreferenceSetChannelTypes::sms? def sms=: ( - Knockapi::Models::Recipients::PreferenceSetChannelTypes::sms - ) -> Knockapi::Models::Recipients::PreferenceSetChannelTypes::sms + Knockapi::Recipients::PreferenceSetChannelTypes::sms + ) -> Knockapi::Recipients::PreferenceSetChannelTypes::sms def initialize: ( - ?chat: Knockapi::Models::Recipients::PreferenceSetChannelTypes::chat, - ?email: Knockapi::Models::Recipients::PreferenceSetChannelTypes::email, - ?http: Knockapi::Models::Recipients::PreferenceSetChannelTypes::http, - ?in_app_feed: Knockapi::Models::Recipients::PreferenceSetChannelTypes::in_app_feed, - ?push: Knockapi::Models::Recipients::PreferenceSetChannelTypes::push, - ?sms: Knockapi::Models::Recipients::PreferenceSetChannelTypes::sms + ?chat: Knockapi::Recipients::PreferenceSetChannelTypes::chat, + ?email: Knockapi::Recipients::PreferenceSetChannelTypes::email, + ?http: Knockapi::Recipients::PreferenceSetChannelTypes::http, + ?in_app_feed: Knockapi::Recipients::PreferenceSetChannelTypes::in_app_feed, + ?push: Knockapi::Recipients::PreferenceSetChannelTypes::push, + ?sms: Knockapi::Recipients::PreferenceSetChannelTypes::sms ) -> void - def to_hash: -> Knockapi::Models::Recipients::preference_set_channel_types - - type chat = - bool | Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting + type chat = bool | Knockapi::Recipients::PreferenceSetChannelTypeSetting module Chat extend Knockapi::Internal::Type::Union - def self?.variants: -> [bool, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting] + def self?.variants: -> ::Array[Knockapi::Recipients::PreferenceSetChannelTypes::chat] end type email = - bool | Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting + bool | Knockapi::Recipients::PreferenceSetChannelTypeSetting module Email extend Knockapi::Internal::Type::Union - def self?.variants: -> [bool, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting] + def self?.variants: -> ::Array[Knockapi::Recipients::PreferenceSetChannelTypes::email] end - type http = - bool | Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting + type http = bool | Knockapi::Recipients::PreferenceSetChannelTypeSetting module HTTP extend Knockapi::Internal::Type::Union - def self?.variants: -> [bool, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting] + def self?.variants: -> ::Array[Knockapi::Recipients::PreferenceSetChannelTypes::http] end type in_app_feed = - bool | Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting + bool | Knockapi::Recipients::PreferenceSetChannelTypeSetting module InAppFeed extend Knockapi::Internal::Type::Union - def self?.variants: -> [bool, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting] + def self?.variants: -> ::Array[Knockapi::Recipients::PreferenceSetChannelTypes::in_app_feed] end - type push = - bool | Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting + type push = bool | Knockapi::Recipients::PreferenceSetChannelTypeSetting module Push extend Knockapi::Internal::Type::Union - def self?.variants: -> [bool, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting] + def self?.variants: -> ::Array[Knockapi::Recipients::PreferenceSetChannelTypes::push] end - type sms = - bool | Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting + type sms = bool | Knockapi::Recipients::PreferenceSetChannelTypeSetting module SMS extend Knockapi::Internal::Type::Union - def self?.variants: -> [bool, Knockapi::Models::Recipients::PreferenceSetChannelTypeSetting] + def self?.variants: -> ::Array[Knockapi::Recipients::PreferenceSetChannelTypes::sms] end end end diff --git a/sig/knockapi/models/recipients/preference_set_request.rbs b/sig/knockapi/models/recipients/preference_set_request.rbs index 5edbf1ea..a4ae2015 100644 --- a/sig/knockapi/models/recipients/preference_set_request.rbs +++ b/sig/knockapi/models/recipients/preference_set_request.rbs @@ -3,82 +3,76 @@ module Knockapi module Recipients type preference_set_request = { - categories: ::Hash[Symbol, Knockapi::Models::Recipients::PreferenceSetRequest::category]?, - channel_types: Knockapi::Models::Recipients::PreferenceSetChannelTypes?, - workflows: ::Hash[Symbol, Knockapi::Models::Recipients::PreferenceSetRequest::workflow]? + categories: ::Hash[Symbol, Knockapi::Recipients::PreferenceSetRequest::category]?, + channel_types: Knockapi::Recipients::PreferenceSetChannelTypes?, + workflows: ::Hash[Symbol, Knockapi::Recipients::PreferenceSetRequest::workflow]? } class PreferenceSetRequest < Knockapi::Internal::Type::BaseModel - attr_accessor categories: ::Hash[Symbol, Knockapi::Models::Recipients::PreferenceSetRequest::category]? + attr_accessor categories: ::Hash[Symbol, Knockapi::Recipients::PreferenceSetRequest::category]? - attr_accessor channel_types: Knockapi::Models::Recipients::PreferenceSetChannelTypes? + attr_accessor channel_types: Knockapi::Recipients::PreferenceSetChannelTypes? - attr_accessor workflows: ::Hash[Symbol, Knockapi::Models::Recipients::PreferenceSetRequest::workflow]? + attr_accessor workflows: ::Hash[Symbol, Knockapi::Recipients::PreferenceSetRequest::workflow]? def initialize: ( - ?categories: ::Hash[Symbol, Knockapi::Models::Recipients::PreferenceSetRequest::category]?, - ?channel_types: Knockapi::Models::Recipients::PreferenceSetChannelTypes?, - ?workflows: ::Hash[Symbol, Knockapi::Models::Recipients::PreferenceSetRequest::workflow]? + ?categories: ::Hash[Symbol, Knockapi::Recipients::PreferenceSetRequest::category]?, + ?channel_types: Knockapi::Recipients::PreferenceSetChannelTypes?, + ?workflows: ::Hash[Symbol, Knockapi::Recipients::PreferenceSetRequest::workflow]? ) -> void - def to_hash: -> Knockapi::Models::Recipients::preference_set_request - type category = bool - | Knockapi::Models::Recipients::PreferenceSetRequest::Category::PreferenceSetWorkflowCategorySettingObject + | Knockapi::Recipients::PreferenceSetRequest::Category::PreferenceSetWorkflowCategorySettingObject module Category extend Knockapi::Internal::Type::Union type preference_set_workflow_category_setting_object = { - channel_types: Knockapi::Models::Recipients::PreferenceSetChannelTypes?, - conditions: ::Array[Knockapi::Models::Condition]? + channel_types: Knockapi::Recipients::PreferenceSetChannelTypes?, + conditions: ::Array[Knockapi::Condition]? } class PreferenceSetWorkflowCategorySettingObject < Knockapi::Internal::Type::BaseModel - attr_accessor channel_types: Knockapi::Models::Recipients::PreferenceSetChannelTypes? + attr_accessor channel_types: Knockapi::Recipients::PreferenceSetChannelTypes? - attr_accessor conditions: ::Array[Knockapi::Models::Condition]? + attr_accessor conditions: ::Array[Knockapi::Condition]? def initialize: ( - ?channel_types: Knockapi::Models::Recipients::PreferenceSetChannelTypes?, - ?conditions: ::Array[Knockapi::Models::Condition]? + ?channel_types: Knockapi::Recipients::PreferenceSetChannelTypes?, + ?conditions: ::Array[Knockapi::Condition]? ) -> void - - def to_hash: -> Knockapi::Models::Recipients::PreferenceSetRequest::Category::preference_set_workflow_category_setting_object end - def self?.variants: -> [bool, Knockapi::Models::Recipients::PreferenceSetRequest::Category::PreferenceSetWorkflowCategorySettingObject] + def self?.variants: -> ::Array[Knockapi::Recipients::PreferenceSetRequest::category] end type workflow = bool - | Knockapi::Models::Recipients::PreferenceSetRequest::Workflow::PreferenceSetWorkflowCategorySettingObject + | Knockapi::Recipients::PreferenceSetRequest::Workflow::PreferenceSetWorkflowCategorySettingObject module Workflow extend Knockapi::Internal::Type::Union type preference_set_workflow_category_setting_object = { - channel_types: Knockapi::Models::Recipients::PreferenceSetChannelTypes?, - conditions: ::Array[Knockapi::Models::Condition]? + channel_types: Knockapi::Recipients::PreferenceSetChannelTypes?, + conditions: ::Array[Knockapi::Condition]? } class PreferenceSetWorkflowCategorySettingObject < Knockapi::Internal::Type::BaseModel - attr_accessor channel_types: Knockapi::Models::Recipients::PreferenceSetChannelTypes? + attr_accessor channel_types: Knockapi::Recipients::PreferenceSetChannelTypes? - attr_accessor conditions: ::Array[Knockapi::Models::Condition]? + attr_accessor conditions: ::Array[Knockapi::Condition]? def initialize: ( - ?channel_types: Knockapi::Models::Recipients::PreferenceSetChannelTypes?, - ?conditions: ::Array[Knockapi::Models::Condition]? + ?channel_types: Knockapi::Recipients::PreferenceSetChannelTypes?, + ?conditions: ::Array[Knockapi::Condition]? ) -> void - - def to_hash: -> Knockapi::Models::Recipients::PreferenceSetRequest::Workflow::preference_set_workflow_category_setting_object end - def self?.variants: -> [bool, Knockapi::Models::Recipients::PreferenceSetRequest::Workflow::PreferenceSetWorkflowCategorySettingObject] + def self?.variants: -> ::Array[Knockapi::Recipients::PreferenceSetRequest::workflow] end end end diff --git a/sig/knockapi/models/recipients/push_channel_data.rbs b/sig/knockapi/models/recipients/push_channel_data.rbs index 7d4b2f57..82780251 100644 --- a/sig/knockapi/models/recipients/push_channel_data.rbs +++ b/sig/knockapi/models/recipients/push_channel_data.rbs @@ -7,8 +7,6 @@ module Knockapi attr_accessor tokens: ::Array[String] def initialize: (tokens: ::Array[String]) -> void - - def to_hash: -> Knockapi::Models::Recipients::push_channel_data end end end diff --git a/sig/knockapi/models/recipients/slack_channel_data.rbs b/sig/knockapi/models/recipients/slack_channel_data.rbs index 57fc86ed..42ed6a53 100644 --- a/sig/knockapi/models/recipients/slack_channel_data.rbs +++ b/sig/knockapi/models/recipients/slack_channel_data.rbs @@ -3,25 +3,23 @@ module Knockapi module Recipients type slack_channel_data = { - connections: ::Array[Knockapi::Models::Recipients::SlackChannelData::connection], - token: Knockapi::Models::Recipients::SlackChannelData::Token? + connections: ::Array[Knockapi::Recipients::SlackChannelData::connection], + token: Knockapi::Recipients::SlackChannelData::Token? } class SlackChannelData < Knockapi::Internal::Type::BaseModel - attr_accessor connections: ::Array[Knockapi::Models::Recipients::SlackChannelData::connection] + attr_accessor connections: ::Array[Knockapi::Recipients::SlackChannelData::connection] - attr_accessor token: Knockapi::Models::Recipients::SlackChannelData::Token? + attr_accessor token: Knockapi::Recipients::SlackChannelData::Token? def initialize: ( - connections: ::Array[Knockapi::Models::Recipients::SlackChannelData::connection], - ?token: Knockapi::Models::Recipients::SlackChannelData::Token? + connections: ::Array[Knockapi::Recipients::SlackChannelData::connection], + ?token: Knockapi::Recipients::SlackChannelData::Token? ) -> void - def to_hash: -> Knockapi::Models::Recipients::slack_channel_data - type connection = - Knockapi::Models::Recipients::SlackChannelData::Connection::SlackTokenConnection - | Knockapi::Models::Recipients::SlackChannelData::Connection::SlackIncomingWebhookConnection + Knockapi::Recipients::SlackChannelData::Connection::SlackTokenConnection + | Knockapi::Recipients::SlackChannelData::Connection::SlackIncomingWebhookConnection module Connection extend Knockapi::Internal::Type::Union @@ -41,8 +39,6 @@ module Knockapi ?channel_id: String?, ?user_id: String? ) -> void - - def to_hash: -> Knockapi::Models::Recipients::SlackChannelData::Connection::slack_token_connection end type slack_incoming_webhook_connection = { url: String } @@ -51,11 +47,9 @@ module Knockapi attr_accessor url: String def initialize: (url: String) -> void - - def to_hash: -> Knockapi::Models::Recipients::SlackChannelData::Connection::slack_incoming_webhook_connection end - def self?.variants: -> [Knockapi::Models::Recipients::SlackChannelData::Connection::SlackTokenConnection, Knockapi::Models::Recipients::SlackChannelData::Connection::SlackIncomingWebhookConnection] + def self?.variants: -> ::Array[Knockapi::Recipients::SlackChannelData::connection] end type token = { access_token: String? } @@ -64,8 +58,6 @@ module Knockapi attr_accessor access_token: String? def initialize: (access_token: String?) -> void - - def to_hash: -> Knockapi::Models::Recipients::SlackChannelData::token end end end diff --git a/sig/knockapi/models/recipients/subscription.rbs b/sig/knockapi/models/recipients/subscription.rbs index 536d9b68..a7fea0a8 100644 --- a/sig/knockapi/models/recipients/subscription.rbs +++ b/sig/knockapi/models/recipients/subscription.rbs @@ -5,7 +5,7 @@ module Knockapi { _typename: String, inserted_at: Time, - object: Knockapi::Models::Object, + object: Knockapi::Object, recipient: Knockapi::Models::recipient, updated_at: Time, properties: ::Hash[Symbol, top]? @@ -16,7 +16,7 @@ module Knockapi attr_accessor inserted_at: Time - attr_accessor object: Knockapi::Models::Object + attr_accessor object: Knockapi::Object attr_accessor recipient: Knockapi::Models::recipient @@ -27,13 +27,11 @@ module Knockapi def initialize: ( _typename: String, inserted_at: Time, - object: Knockapi::Models::Object, + object: Knockapi::Object, recipient: Knockapi::Models::recipient, updated_at: Time, ?properties: ::Hash[Symbol, top]? ) -> void - - def to_hash: -> Knockapi::Models::Recipients::subscription end end end diff --git a/sig/knockapi/models/schedule.rbs b/sig/knockapi/models/schedule.rbs index 3672426e..aa686379 100644 --- a/sig/knockapi/models/schedule.rbs +++ b/sig/knockapi/models/schedule.rbs @@ -5,7 +5,7 @@ module Knockapi id: String, inserted_at: Time, recipient: Knockapi::Models::recipient, - repeats: ::Array[Knockapi::Models::ScheduleRepeatRule], + repeats: ::Array[Knockapi::ScheduleRepeatRule], updated_at: Time, workflow: String, _typename: String, @@ -23,7 +23,7 @@ module Knockapi attr_accessor recipient: Knockapi::Models::recipient - attr_accessor repeats: ::Array[Knockapi::Models::ScheduleRepeatRule] + attr_accessor repeats: ::Array[Knockapi::ScheduleRepeatRule] attr_accessor updated_at: Time @@ -47,7 +47,7 @@ module Knockapi id: String, inserted_at: Time, recipient: Knockapi::Models::recipient, - repeats: ::Array[Knockapi::Models::ScheduleRepeatRule], + repeats: ::Array[Knockapi::ScheduleRepeatRule], updated_at: Time, workflow: String, ?_typename: String, @@ -57,8 +57,6 @@ module Knockapi ?next_occurrence_at: Time?, ?tenant: String? ) -> void - - def to_hash: -> Knockapi::Models::schedule end end end diff --git a/sig/knockapi/models/schedule_create_params.rbs b/sig/knockapi/models/schedule_create_params.rbs index b2c816d1..b3fe370c 100644 --- a/sig/knockapi/models/schedule_create_params.rbs +++ b/sig/knockapi/models/schedule_create_params.rbs @@ -3,7 +3,7 @@ module Knockapi type schedule_create_params = { recipients: ::Array[Knockapi::Models::recipient_request], - repeats: ::Array[Knockapi::Models::ScheduleRepeatRule], + repeats: ::Array[Knockapi::ScheduleRepeatRule], workflow: String, data: ::Hash[Symbol, top]?, ending_at: Time?, @@ -18,7 +18,7 @@ module Knockapi attr_accessor recipients: ::Array[Knockapi::Models::recipient_request] - attr_accessor repeats: ::Array[Knockapi::Models::ScheduleRepeatRule] + attr_accessor repeats: ::Array[Knockapi::ScheduleRepeatRule] attr_accessor workflow: String @@ -32,7 +32,7 @@ module Knockapi def initialize: ( recipients: ::Array[Knockapi::Models::recipient_request], - repeats: ::Array[Knockapi::Models::ScheduleRepeatRule], + repeats: ::Array[Knockapi::ScheduleRepeatRule], workflow: String, ?data: ::Hash[Symbol, top]?, ?ending_at: Time?, @@ -40,8 +40,6 @@ module Knockapi ?tenant: Knockapi::Models::inline_tenant_request?, ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::schedule_create_params end end end diff --git a/sig/knockapi/models/schedule_create_response.rbs b/sig/knockapi/models/schedule_create_response.rbs index e02ab6f0..f2cb7d53 100644 --- a/sig/knockapi/models/schedule_create_response.rbs +++ b/sig/knockapi/models/schedule_create_response.rbs @@ -1,6 +1,6 @@ module Knockapi module Models - type schedule_create_response = ::Array[Knockapi::Models::Schedule] + type schedule_create_response = ::Array[Knockapi::Schedule] ScheduleCreateResponse: Knockapi::Internal::Type::Converter end diff --git a/sig/knockapi/models/schedule_delete_params.rbs b/sig/knockapi/models/schedule_delete_params.rbs index a1e4152c..057a5052 100644 --- a/sig/knockapi/models/schedule_delete_params.rbs +++ b/sig/knockapi/models/schedule_delete_params.rbs @@ -14,8 +14,6 @@ module Knockapi schedule_ids: ::Array[String], ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::schedule_delete_params end end end diff --git a/sig/knockapi/models/schedule_delete_response.rbs b/sig/knockapi/models/schedule_delete_response.rbs index cc0e8f28..af1da7dc 100644 --- a/sig/knockapi/models/schedule_delete_response.rbs +++ b/sig/knockapi/models/schedule_delete_response.rbs @@ -1,6 +1,6 @@ module Knockapi module Models - type schedule_delete_response = ::Array[Knockapi::Models::Schedule] + type schedule_delete_response = ::Array[Knockapi::Schedule] ScheduleDeleteResponse: Knockapi::Internal::Type::Converter end diff --git a/sig/knockapi/models/schedule_list_params.rbs b/sig/knockapi/models/schedule_list_params.rbs index efa12c60..237060d6 100644 --- a/sig/knockapi/models/schedule_list_params.rbs +++ b/sig/knockapi/models/schedule_list_params.rbs @@ -46,8 +46,6 @@ module Knockapi ?tenant: String, ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::schedule_list_params end end end diff --git a/sig/knockapi/models/schedule_repeat_rule.rbs b/sig/knockapi/models/schedule_repeat_rule.rbs index 436ac808..8ed5ed67 100644 --- a/sig/knockapi/models/schedule_repeat_rule.rbs +++ b/sig/knockapi/models/schedule_repeat_rule.rbs @@ -3,9 +3,9 @@ module Knockapi type schedule_repeat_rule = { _typename: String, - frequency: Knockapi::Models::ScheduleRepeatRule::frequency, + frequency: Knockapi::ScheduleRepeatRule::frequency, day_of_month: Integer?, - days: ::Array[Knockapi::Models::ScheduleRepeatRule::day]?, + days: ::Array[Knockapi::ScheduleRepeatRule::day]?, hours: Integer?, interval: Integer, minutes: Integer? @@ -14,11 +14,11 @@ module Knockapi class ScheduleRepeatRule < Knockapi::Internal::Type::BaseModel attr_accessor _typename: String - attr_accessor frequency: Knockapi::Models::ScheduleRepeatRule::frequency + attr_accessor frequency: Knockapi::ScheduleRepeatRule::frequency attr_accessor day_of_month: Integer? - attr_accessor days: ::Array[Knockapi::Models::ScheduleRepeatRule::day]? + attr_accessor days: ::Array[Knockapi::ScheduleRepeatRule::day]? attr_accessor hours: Integer? @@ -30,16 +30,14 @@ module Knockapi def initialize: ( _typename: String, - frequency: Knockapi::Models::ScheduleRepeatRule::frequency, + frequency: Knockapi::ScheduleRepeatRule::frequency, ?day_of_month: Integer?, - ?days: ::Array[Knockapi::Models::ScheduleRepeatRule::day]?, + ?days: ::Array[Knockapi::ScheduleRepeatRule::day]?, ?hours: Integer?, ?interval: Integer, ?minutes: Integer? ) -> void - def to_hash: -> Knockapi::Models::schedule_repeat_rule - type frequency = :daily | :weekly | :monthly | :hourly module Frequency @@ -50,7 +48,7 @@ module Knockapi MONTHLY: :monthly HOURLY: :hourly - def self?.values: -> ::Array[Knockapi::Models::ScheduleRepeatRule::frequency] + def self?.values: -> ::Array[Knockapi::ScheduleRepeatRule::frequency] end type day = :mon | :tue | :wed | :thu | :fri | :sat | :sun @@ -66,7 +64,7 @@ module Knockapi SAT: :sat SUN: :sun - def self?.values: -> ::Array[Knockapi::Models::ScheduleRepeatRule::day] + def self?.values: -> ::Array[Knockapi::ScheduleRepeatRule::day] end end end diff --git a/sig/knockapi/models/schedule_update_params.rbs b/sig/knockapi/models/schedule_update_params.rbs index 6f99adb3..b86e6c32 100644 --- a/sig/knockapi/models/schedule_update_params.rbs +++ b/sig/knockapi/models/schedule_update_params.rbs @@ -6,7 +6,7 @@ module Knockapi actor: Knockapi::Models::recipient_reference?, data: ::Hash[Symbol, top]?, ending_at: Time?, - repeats: ::Array[Knockapi::Models::ScheduleRepeatRule], + repeats: ::Array[Knockapi::ScheduleRepeatRule], scheduled_at: Time?, tenant: Knockapi::Models::inline_tenant_request? } @@ -24,11 +24,11 @@ module Knockapi attr_accessor ending_at: Time? - attr_reader repeats: ::Array[Knockapi::Models::ScheduleRepeatRule]? + attr_reader repeats: ::Array[Knockapi::ScheduleRepeatRule]? def repeats=: ( - ::Array[Knockapi::Models::ScheduleRepeatRule] - ) -> ::Array[Knockapi::Models::ScheduleRepeatRule] + ::Array[Knockapi::ScheduleRepeatRule] + ) -> ::Array[Knockapi::ScheduleRepeatRule] attr_accessor scheduled_at: Time? @@ -39,13 +39,11 @@ module Knockapi ?actor: Knockapi::Models::recipient_reference?, ?data: ::Hash[Symbol, top]?, ?ending_at: Time?, - ?repeats: ::Array[Knockapi::Models::ScheduleRepeatRule], + ?repeats: ::Array[Knockapi::ScheduleRepeatRule], ?scheduled_at: Time?, ?tenant: Knockapi::Models::inline_tenant_request?, ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::schedule_update_params end end end diff --git a/sig/knockapi/models/schedule_update_response.rbs b/sig/knockapi/models/schedule_update_response.rbs index 1f12cc5e..4c83c882 100644 --- a/sig/knockapi/models/schedule_update_response.rbs +++ b/sig/knockapi/models/schedule_update_response.rbs @@ -1,6 +1,6 @@ module Knockapi module Models - type schedule_update_response = ::Array[Knockapi::Models::Schedule] + type schedule_update_response = ::Array[Knockapi::Schedule] ScheduleUpdateResponse: Knockapi::Internal::Type::Converter end diff --git a/sig/knockapi/models/schedules/bulk_create_params.rbs b/sig/knockapi/models/schedules/bulk_create_params.rbs index 14eef663..52722d0b 100644 --- a/sig/knockapi/models/schedules/bulk_create_params.rbs +++ b/sig/knockapi/models/schedules/bulk_create_params.rbs @@ -2,24 +2,20 @@ module Knockapi module Models module Schedules type bulk_create_params = - { - schedules: ::Array[Knockapi::Models::Schedules::BulkCreateParams::Schedule] - } + { schedules: ::Array[Knockapi::Schedules::BulkCreateParams::Schedule] } & Knockapi::Internal::Type::request_parameters class BulkCreateParams < Knockapi::Internal::Type::BaseModel extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters - attr_accessor schedules: ::Array[Knockapi::Models::Schedules::BulkCreateParams::Schedule] + attr_accessor schedules: ::Array[Knockapi::Schedules::BulkCreateParams::Schedule] def initialize: ( - schedules: ::Array[Knockapi::Models::Schedules::BulkCreateParams::Schedule], + schedules: ::Array[Knockapi::Schedules::BulkCreateParams::Schedule], ?request_options: Knockapi::request_opts ) -> void - def to_hash: -> Knockapi::Models::Schedules::bulk_create_params - type schedule = { workflow: String, @@ -27,7 +23,7 @@ module Knockapi data: ::Hash[Symbol, top]?, ending_at: Time?, recipient: Knockapi::Models::recipient_request, - repeats: ::Array[Knockapi::Models::ScheduleRepeatRule], + repeats: ::Array[Knockapi::ScheduleRepeatRule], scheduled_at: Time?, tenant: Knockapi::Models::inline_tenant_request? } @@ -47,11 +43,11 @@ module Knockapi Knockapi::Models::recipient_request ) -> Knockapi::Models::recipient_request - attr_reader repeats: ::Array[Knockapi::Models::ScheduleRepeatRule]? + attr_reader repeats: ::Array[Knockapi::ScheduleRepeatRule]? def repeats=: ( - ::Array[Knockapi::Models::ScheduleRepeatRule] - ) -> ::Array[Knockapi::Models::ScheduleRepeatRule] + ::Array[Knockapi::ScheduleRepeatRule] + ) -> ::Array[Knockapi::ScheduleRepeatRule] attr_accessor scheduled_at: Time? @@ -63,12 +59,10 @@ module Knockapi ?data: ::Hash[Symbol, top]?, ?ending_at: Time?, ?recipient: Knockapi::Models::recipient_request, - ?repeats: ::Array[Knockapi::Models::ScheduleRepeatRule], + ?repeats: ::Array[Knockapi::ScheduleRepeatRule], ?scheduled_at: Time?, ?tenant: Knockapi::Models::inline_tenant_request? ) -> void - - def to_hash: -> Knockapi::Models::Schedules::BulkCreateParams::schedule end end end diff --git a/sig/knockapi/models/tenant.rbs b/sig/knockapi/models/tenant.rbs index 11204a55..63fd98aa 100644 --- a/sig/knockapi/models/tenant.rbs +++ b/sig/knockapi/models/tenant.rbs @@ -5,7 +5,7 @@ module Knockapi id: String, _typename: String, name: String?, - settings: Knockapi::Models::Tenant::Settings? + settings: Knockapi::Tenant::Settings? } class Tenant < Knockapi::Internal::Type::BaseModel @@ -15,35 +15,31 @@ module Knockapi attr_accessor name: String? - attr_accessor settings: Knockapi::Models::Tenant::Settings? + attr_accessor settings: Knockapi::Tenant::Settings? def initialize: ( id: String, _typename: String, ?name: String?, - ?settings: Knockapi::Models::Tenant::Settings? + ?settings: Knockapi::Tenant::Settings? ) -> void - def to_hash: -> Knockapi::Models::tenant - type settings = { - branding: Knockapi::Models::Tenant::Settings::Branding?, - preference_set: Knockapi::Models::Recipients::PreferenceSet? + branding: Knockapi::Tenant::Settings::Branding?, + preference_set: Knockapi::Recipients::PreferenceSet? } class Settings < Knockapi::Internal::Type::BaseModel - attr_accessor branding: Knockapi::Models::Tenant::Settings::Branding? + attr_accessor branding: Knockapi::Tenant::Settings::Branding? - attr_accessor preference_set: Knockapi::Models::Recipients::PreferenceSet? + attr_accessor preference_set: Knockapi::Recipients::PreferenceSet? def initialize: ( - ?branding: Knockapi::Models::Tenant::Settings::Branding?, - ?preference_set: Knockapi::Models::Recipients::PreferenceSet? + ?branding: Knockapi::Tenant::Settings::Branding?, + ?preference_set: Knockapi::Recipients::PreferenceSet? ) -> void - def to_hash: -> Knockapi::Models::Tenant::settings - type branding = { icon_url: String?, @@ -67,8 +63,6 @@ module Knockapi ?primary_color: String?, ?primary_color_contrast: String? ) -> void - - def to_hash: -> Knockapi::Models::Tenant::Settings::branding end end end diff --git a/sig/knockapi/models/tenant_delete_params.rbs b/sig/knockapi/models/tenant_delete_params.rbs index afc05db1..68bd2791 100644 --- a/sig/knockapi/models/tenant_delete_params.rbs +++ b/sig/knockapi/models/tenant_delete_params.rbs @@ -8,8 +8,6 @@ module Knockapi include Knockapi::Internal::Type::RequestParameters def initialize: (?request_options: Knockapi::request_opts) -> void - - def to_hash: -> Knockapi::Models::tenant_delete_params end end end diff --git a/sig/knockapi/models/tenant_delete_response.rbs b/sig/knockapi/models/tenant_delete_response.rbs new file mode 100644 index 00000000..3c1734f4 --- /dev/null +++ b/sig/knockapi/models/tenant_delete_response.rbs @@ -0,0 +1,5 @@ +module Knockapi + module Models + class TenantDeleteResponse = String + end +end diff --git a/sig/knockapi/models/tenant_get_params.rbs b/sig/knockapi/models/tenant_get_params.rbs index 224cdc2a..58971090 100644 --- a/sig/knockapi/models/tenant_get_params.rbs +++ b/sig/knockapi/models/tenant_get_params.rbs @@ -7,8 +7,6 @@ module Knockapi include Knockapi::Internal::Type::RequestParameters def initialize: (?request_options: Knockapi::request_opts) -> void - - def to_hash: -> Knockapi::Models::tenant_get_params end end end diff --git a/sig/knockapi/models/tenant_list_params.rbs b/sig/knockapi/models/tenant_list_params.rbs index 4b68e223..0f8fa3a4 100644 --- a/sig/knockapi/models/tenant_list_params.rbs +++ b/sig/knockapi/models/tenant_list_params.rbs @@ -42,8 +42,6 @@ module Knockapi ?tenant_id: String, ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::tenant_list_params end end end diff --git a/sig/knockapi/models/tenant_request.rbs b/sig/knockapi/models/tenant_request.rbs index 6ff1a975..409ff0bd 100644 --- a/sig/knockapi/models/tenant_request.rbs +++ b/sig/knockapi/models/tenant_request.rbs @@ -5,7 +5,7 @@ module Knockapi id: String, channel_data: Knockapi::Models::Recipients::inline_channel_data_request?, preferences: Knockapi::Models::Recipients::inline_preference_set_request?, - settings: Knockapi::Models::TenantRequest::Settings + settings: Knockapi::TenantRequest::Settings } class TenantRequest < Knockapi::Internal::Type::BaseModel @@ -15,43 +15,39 @@ module Knockapi attr_accessor preferences: Knockapi::Models::Recipients::inline_preference_set_request? - attr_reader settings: Knockapi::Models::TenantRequest::Settings? + attr_reader settings: Knockapi::TenantRequest::Settings? def settings=: ( - Knockapi::Models::TenantRequest::Settings - ) -> Knockapi::Models::TenantRequest::Settings + Knockapi::TenantRequest::Settings + ) -> Knockapi::TenantRequest::Settings def initialize: ( id: String, ?channel_data: Knockapi::Models::Recipients::inline_channel_data_request?, ?preferences: Knockapi::Models::Recipients::inline_preference_set_request?, - ?settings: Knockapi::Models::TenantRequest::Settings + ?settings: Knockapi::TenantRequest::Settings ) -> void - def to_hash: -> Knockapi::Models::tenant_request - type settings = { - branding: Knockapi::Models::TenantRequest::Settings::Branding, - preference_set: Knockapi::Models::Recipients::PreferenceSetRequest? + branding: Knockapi::TenantRequest::Settings::Branding, + preference_set: Knockapi::Recipients::PreferenceSetRequest? } class Settings < Knockapi::Internal::Type::BaseModel - attr_reader branding: Knockapi::Models::TenantRequest::Settings::Branding? + attr_reader branding: Knockapi::TenantRequest::Settings::Branding? def branding=: ( - Knockapi::Models::TenantRequest::Settings::Branding - ) -> Knockapi::Models::TenantRequest::Settings::Branding + Knockapi::TenantRequest::Settings::Branding + ) -> Knockapi::TenantRequest::Settings::Branding - attr_accessor preference_set: Knockapi::Models::Recipients::PreferenceSetRequest? + attr_accessor preference_set: Knockapi::Recipients::PreferenceSetRequest? def initialize: ( - ?branding: Knockapi::Models::TenantRequest::Settings::Branding, - ?preference_set: Knockapi::Models::Recipients::PreferenceSetRequest? + ?branding: Knockapi::TenantRequest::Settings::Branding, + ?preference_set: Knockapi::Recipients::PreferenceSetRequest? ) -> void - def to_hash: -> Knockapi::Models::TenantRequest::settings - type branding = { icon_url: String?, @@ -75,8 +71,6 @@ module Knockapi ?primary_color: String?, ?primary_color_contrast: String? ) -> void - - def to_hash: -> Knockapi::Models::TenantRequest::Settings::branding end end end diff --git a/sig/knockapi/models/tenant_set_params.rbs b/sig/knockapi/models/tenant_set_params.rbs index 2288dd85..1c36dd11 100644 --- a/sig/knockapi/models/tenant_set_params.rbs +++ b/sig/knockapi/models/tenant_set_params.rbs @@ -4,7 +4,7 @@ module Knockapi { channel_data: Knockapi::Models::Recipients::inline_channel_data_request?, preferences: Knockapi::Models::Recipients::inline_preference_set_request?, - settings: Knockapi::Models::TenantSetParams::Settings + settings: Knockapi::TenantSetParams::Settings } & Knockapi::Internal::Type::request_parameters @@ -16,43 +16,39 @@ module Knockapi attr_accessor preferences: Knockapi::Models::Recipients::inline_preference_set_request? - attr_reader settings: Knockapi::Models::TenantSetParams::Settings? + attr_reader settings: Knockapi::TenantSetParams::Settings? def settings=: ( - Knockapi::Models::TenantSetParams::Settings - ) -> Knockapi::Models::TenantSetParams::Settings + Knockapi::TenantSetParams::Settings + ) -> Knockapi::TenantSetParams::Settings def initialize: ( ?channel_data: Knockapi::Models::Recipients::inline_channel_data_request?, ?preferences: Knockapi::Models::Recipients::inline_preference_set_request?, - ?settings: Knockapi::Models::TenantSetParams::Settings, + ?settings: Knockapi::TenantSetParams::Settings, ?request_options: Knockapi::request_opts ) -> void - def to_hash: -> Knockapi::Models::tenant_set_params - type settings = { - branding: Knockapi::Models::TenantSetParams::Settings::Branding, - preference_set: Knockapi::Models::Recipients::PreferenceSetRequest? + branding: Knockapi::TenantSetParams::Settings::Branding, + preference_set: Knockapi::Recipients::PreferenceSetRequest? } class Settings < Knockapi::Internal::Type::BaseModel - attr_reader branding: Knockapi::Models::TenantSetParams::Settings::Branding? + attr_reader branding: Knockapi::TenantSetParams::Settings::Branding? def branding=: ( - Knockapi::Models::TenantSetParams::Settings::Branding - ) -> Knockapi::Models::TenantSetParams::Settings::Branding + Knockapi::TenantSetParams::Settings::Branding + ) -> Knockapi::TenantSetParams::Settings::Branding - attr_accessor preference_set: Knockapi::Models::Recipients::PreferenceSetRequest? + attr_accessor preference_set: Knockapi::Recipients::PreferenceSetRequest? def initialize: ( - ?branding: Knockapi::Models::TenantSetParams::Settings::Branding, - ?preference_set: Knockapi::Models::Recipients::PreferenceSetRequest? + ?branding: Knockapi::TenantSetParams::Settings::Branding, + ?preference_set: Knockapi::Recipients::PreferenceSetRequest? ) -> void - def to_hash: -> Knockapi::Models::TenantSetParams::settings - type branding = { icon_url: String?, @@ -76,8 +72,6 @@ module Knockapi ?primary_color: String?, ?primary_color_contrast: String? ) -> void - - def to_hash: -> Knockapi::Models::TenantSetParams::Settings::branding end end end diff --git a/sig/knockapi/models/tenants/bulk_delete_params.rbs b/sig/knockapi/models/tenants/bulk_delete_params.rbs index f8e46e7a..f655ef11 100644 --- a/sig/knockapi/models/tenants/bulk_delete_params.rbs +++ b/sig/knockapi/models/tenants/bulk_delete_params.rbs @@ -15,8 +15,6 @@ module Knockapi tenant_ids: ::Array[String], ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::Tenants::bulk_delete_params end end end diff --git a/sig/knockapi/models/tenants/bulk_set_params.rbs b/sig/knockapi/models/tenants/bulk_set_params.rbs index 2b966f76..6b78b212 100644 --- a/sig/knockapi/models/tenants/bulk_set_params.rbs +++ b/sig/knockapi/models/tenants/bulk_set_params.rbs @@ -15,8 +15,6 @@ module Knockapi tenants: ::Array[Knockapi::Models::inline_tenant_request], ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::Tenants::bulk_set_params end end end diff --git a/sig/knockapi/models/user.rbs b/sig/knockapi/models/user.rbs index 40945f92..93132693 100644 --- a/sig/knockapi/models/user.rbs +++ b/sig/knockapi/models/user.rbs @@ -43,8 +43,6 @@ module Knockapi ?phone_number: String?, ?timezone: String? ) -> void - - def to_hash: -> Knockapi::Models::user end end end diff --git a/sig/knockapi/models/user_delete_params.rbs b/sig/knockapi/models/user_delete_params.rbs index 2b89fd09..e4953972 100644 --- a/sig/knockapi/models/user_delete_params.rbs +++ b/sig/knockapi/models/user_delete_params.rbs @@ -8,8 +8,6 @@ module Knockapi include Knockapi::Internal::Type::RequestParameters def initialize: (?request_options: Knockapi::request_opts) -> void - - def to_hash: -> Knockapi::Models::user_delete_params end end end diff --git a/sig/knockapi/models/user_delete_response.rbs b/sig/knockapi/models/user_delete_response.rbs new file mode 100644 index 00000000..d084bc18 --- /dev/null +++ b/sig/knockapi/models/user_delete_response.rbs @@ -0,0 +1,5 @@ +module Knockapi + module Models + class UserDeleteResponse = String + end +end diff --git a/sig/knockapi/models/user_get_channel_data_params.rbs b/sig/knockapi/models/user_get_channel_data_params.rbs index dd5423d3..50661f60 100644 --- a/sig/knockapi/models/user_get_channel_data_params.rbs +++ b/sig/knockapi/models/user_get_channel_data_params.rbs @@ -8,8 +8,6 @@ module Knockapi include Knockapi::Internal::Type::RequestParameters def initialize: (?request_options: Knockapi::request_opts) -> void - - def to_hash: -> Knockapi::Models::user_get_channel_data_params end end end diff --git a/sig/knockapi/models/user_get_params.rbs b/sig/knockapi/models/user_get_params.rbs index 0af37fd4..6bd5a2b2 100644 --- a/sig/knockapi/models/user_get_params.rbs +++ b/sig/knockapi/models/user_get_params.rbs @@ -7,8 +7,6 @@ module Knockapi include Knockapi::Internal::Type::RequestParameters def initialize: (?request_options: Knockapi::request_opts) -> void - - def to_hash: -> Knockapi::Models::user_get_params end end end diff --git a/sig/knockapi/models/user_get_preferences_params.rbs b/sig/knockapi/models/user_get_preferences_params.rbs index d4d37c71..23a7544a 100644 --- a/sig/knockapi/models/user_get_preferences_params.rbs +++ b/sig/knockapi/models/user_get_preferences_params.rbs @@ -15,8 +15,6 @@ module Knockapi ?tenant: String, ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::user_get_preferences_params end end end diff --git a/sig/knockapi/models/user_list_messages_params.rbs b/sig/knockapi/models/user_list_messages_params.rbs index 7f16c5cd..fe75091f 100644 --- a/sig/knockapi/models/user_list_messages_params.rbs +++ b/sig/knockapi/models/user_list_messages_params.rbs @@ -5,12 +5,12 @@ module Knockapi after: String, before: String, channel_id: String, - engagement_status: ::Array[Knockapi::Models::UserListMessagesParams::engagement_status], - inserted_at: Knockapi::Models::UserListMessagesParams::InsertedAt, + engagement_status: ::Array[Knockapi::UserListMessagesParams::engagement_status], + inserted_at: Knockapi::UserListMessagesParams::InsertedAt, message_ids: ::Array[String], page_size: Integer, source: String, - status: ::Array[Knockapi::Models::UserListMessagesParams::status], + status: ::Array[Knockapi::UserListMessagesParams::status], tenant: String, trigger_data: String, workflow_categories: ::Array[String], @@ -35,17 +35,17 @@ module Knockapi def channel_id=: (String) -> String - attr_reader engagement_status: ::Array[Knockapi::Models::UserListMessagesParams::engagement_status]? + attr_reader engagement_status: ::Array[Knockapi::UserListMessagesParams::engagement_status]? def engagement_status=: ( - ::Array[Knockapi::Models::UserListMessagesParams::engagement_status] - ) -> ::Array[Knockapi::Models::UserListMessagesParams::engagement_status] + ::Array[Knockapi::UserListMessagesParams::engagement_status] + ) -> ::Array[Knockapi::UserListMessagesParams::engagement_status] - attr_reader inserted_at: Knockapi::Models::UserListMessagesParams::InsertedAt? + attr_reader inserted_at: Knockapi::UserListMessagesParams::InsertedAt? def inserted_at=: ( - Knockapi::Models::UserListMessagesParams::InsertedAt - ) -> Knockapi::Models::UserListMessagesParams::InsertedAt + Knockapi::UserListMessagesParams::InsertedAt + ) -> Knockapi::UserListMessagesParams::InsertedAt attr_reader message_ids: ::Array[String]? @@ -59,11 +59,11 @@ module Knockapi def source=: (String) -> String - attr_reader status: ::Array[Knockapi::Models::UserListMessagesParams::status]? + attr_reader status: ::Array[Knockapi::UserListMessagesParams::status]? def status=: ( - ::Array[Knockapi::Models::UserListMessagesParams::status] - ) -> ::Array[Knockapi::Models::UserListMessagesParams::status] + ::Array[Knockapi::UserListMessagesParams::status] + ) -> ::Array[Knockapi::UserListMessagesParams::status] attr_reader tenant: String? @@ -89,12 +89,12 @@ module Knockapi ?after: String, ?before: String, ?channel_id: String, - ?engagement_status: ::Array[Knockapi::Models::UserListMessagesParams::engagement_status], - ?inserted_at: Knockapi::Models::UserListMessagesParams::InsertedAt, + ?engagement_status: ::Array[Knockapi::UserListMessagesParams::engagement_status], + ?inserted_at: Knockapi::UserListMessagesParams::InsertedAt, ?message_ids: ::Array[String], ?page_size: Integer, ?source: String, - ?status: ::Array[Knockapi::Models::UserListMessagesParams::status], + ?status: ::Array[Knockapi::UserListMessagesParams::status], ?tenant: String, ?trigger_data: String, ?workflow_categories: ::Array[String], @@ -103,8 +103,6 @@ module Knockapi ?request_options: Knockapi::request_opts ) -> void - def to_hash: -> Knockapi::Models::user_list_messages_params - type engagement_status = :seen | :read | :interacted | :link_clicked | :archived @@ -117,7 +115,7 @@ module Knockapi LINK_CLICKED: :link_clicked ARCHIVED: :archived - def self?.values: -> ::Array[Knockapi::Models::UserListMessagesParams::engagement_status] + def self?.values: -> ::Array[Knockapi::UserListMessagesParams::engagement_status] end type inserted_at = { gt: String, gte: String, lt: String, lte: String } @@ -145,8 +143,6 @@ module Knockapi ?lt: String, ?lte: String ) -> void - - def to_hash: -> Knockapi::Models::UserListMessagesParams::inserted_at end type status = @@ -169,7 +165,7 @@ module Knockapi NOT_SENT: :not_sent BOUNCED: :bounced - def self?.values: -> ::Array[Knockapi::Models::UserListMessagesParams::status] + def self?.values: -> ::Array[Knockapi::UserListMessagesParams::status] end end end diff --git a/sig/knockapi/models/user_list_params.rbs b/sig/knockapi/models/user_list_params.rbs index 251d403c..2893c88c 100644 --- a/sig/knockapi/models/user_list_params.rbs +++ b/sig/knockapi/models/user_list_params.rbs @@ -4,7 +4,7 @@ module Knockapi { after: String, before: String, - include: ::Array[Knockapi::Models::UserListParams::include_], + include: ::Array[Knockapi::UserListParams::include_], page_size: Integer } & Knockapi::Internal::Type::request_parameters @@ -21,11 +21,11 @@ module Knockapi def before=: (String) -> String - attr_reader include: ::Array[Knockapi::Models::UserListParams::include_]? + attr_reader include: ::Array[Knockapi::UserListParams::include_]? def include=: ( - ::Array[Knockapi::Models::UserListParams::include_] - ) -> ::Array[Knockapi::Models::UserListParams::include_] + ::Array[Knockapi::UserListParams::include_] + ) -> ::Array[Knockapi::UserListParams::include_] attr_reader page_size: Integer? @@ -34,13 +34,11 @@ module Knockapi def initialize: ( ?after: String, ?before: String, - ?include: ::Array[Knockapi::Models::UserListParams::include_], + ?include: ::Array[Knockapi::UserListParams::include_], ?page_size: Integer, ?request_options: Knockapi::request_opts ) -> void - def to_hash: -> Knockapi::Models::user_list_params - type include_ = :preferences module Include @@ -48,7 +46,7 @@ module Knockapi PREFERENCES: :preferences - def self?.values: -> ::Array[Knockapi::Models::UserListParams::include_] + def self?.values: -> ::Array[Knockapi::UserListParams::include_] end end end diff --git a/sig/knockapi/models/user_list_preferences_params.rbs b/sig/knockapi/models/user_list_preferences_params.rbs index 1dc02fdc..64152480 100644 --- a/sig/knockapi/models/user_list_preferences_params.rbs +++ b/sig/knockapi/models/user_list_preferences_params.rbs @@ -8,8 +8,6 @@ module Knockapi include Knockapi::Internal::Type::RequestParameters def initialize: (?request_options: Knockapi::request_opts) -> void - - def to_hash: -> Knockapi::Models::user_list_preferences_params end end end diff --git a/sig/knockapi/models/user_list_preferences_response.rbs b/sig/knockapi/models/user_list_preferences_response.rbs index 15303b69..e8737924 100644 --- a/sig/knockapi/models/user_list_preferences_response.rbs +++ b/sig/knockapi/models/user_list_preferences_response.rbs @@ -1,7 +1,7 @@ module Knockapi module Models type user_list_preferences_response = - ::Array[Knockapi::Models::Recipients::PreferenceSet] + ::Array[Knockapi::Recipients::PreferenceSet] UserListPreferencesResponse: Knockapi::Internal::Type::Converter end diff --git a/sig/knockapi/models/user_list_schedules_params.rbs b/sig/knockapi/models/user_list_schedules_params.rbs index ad55066b..6b8f81f9 100644 --- a/sig/knockapi/models/user_list_schedules_params.rbs +++ b/sig/knockapi/models/user_list_schedules_params.rbs @@ -42,8 +42,6 @@ module Knockapi ?workflow: String, ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::user_list_schedules_params end end end diff --git a/sig/knockapi/models/user_list_subscriptions_params.rbs b/sig/knockapi/models/user_list_subscriptions_params.rbs index bb6cd68e..c80a7dd7 100644 --- a/sig/knockapi/models/user_list_subscriptions_params.rbs +++ b/sig/knockapi/models/user_list_subscriptions_params.rbs @@ -4,7 +4,7 @@ module Knockapi { after: String, before: String, - include: ::Array[Knockapi::Models::UserListSubscriptionsParams::include_], + include: ::Array[Knockapi::UserListSubscriptionsParams::include_], objects: ::Array[String], page_size: Integer } @@ -22,11 +22,11 @@ module Knockapi def before=: (String) -> String - attr_reader include: ::Array[Knockapi::Models::UserListSubscriptionsParams::include_]? + attr_reader include: ::Array[Knockapi::UserListSubscriptionsParams::include_]? def include=: ( - ::Array[Knockapi::Models::UserListSubscriptionsParams::include_] - ) -> ::Array[Knockapi::Models::UserListSubscriptionsParams::include_] + ::Array[Knockapi::UserListSubscriptionsParams::include_] + ) -> ::Array[Knockapi::UserListSubscriptionsParams::include_] attr_reader objects: ::Array[String]? @@ -39,14 +39,12 @@ module Knockapi def initialize: ( ?after: String, ?before: String, - ?include: ::Array[Knockapi::Models::UserListSubscriptionsParams::include_], + ?include: ::Array[Knockapi::UserListSubscriptionsParams::include_], ?objects: ::Array[String], ?page_size: Integer, ?request_options: Knockapi::request_opts ) -> void - def to_hash: -> Knockapi::Models::user_list_subscriptions_params - type include_ = :preferences module Include @@ -54,7 +52,7 @@ module Knockapi PREFERENCES: :preferences - def self?.values: -> ::Array[Knockapi::Models::UserListSubscriptionsParams::include_] + def self?.values: -> ::Array[Knockapi::UserListSubscriptionsParams::include_] end end end diff --git a/sig/knockapi/models/user_merge_params.rbs b/sig/knockapi/models/user_merge_params.rbs index 53e42a0e..73a0ec1c 100644 --- a/sig/knockapi/models/user_merge_params.rbs +++ b/sig/knockapi/models/user_merge_params.rbs @@ -13,8 +13,6 @@ module Knockapi from_user_id: String, ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::user_merge_params end end end diff --git a/sig/knockapi/models/user_set_channel_data_params.rbs b/sig/knockapi/models/user_set_channel_data_params.rbs index aff74ce9..9a42771c 100644 --- a/sig/knockapi/models/user_set_channel_data_params.rbs +++ b/sig/knockapi/models/user_set_channel_data_params.rbs @@ -8,8 +8,6 @@ module Knockapi include Knockapi::Internal::Type::RequestParameters def initialize: (?request_options: Knockapi::request_opts) -> void - - def to_hash: -> Knockapi::Models::user_set_channel_data_params end end end diff --git a/sig/knockapi/models/user_set_preferences_params.rbs b/sig/knockapi/models/user_set_preferences_params.rbs index b1bdfd59..d68758f7 100644 --- a/sig/knockapi/models/user_set_preferences_params.rbs +++ b/sig/knockapi/models/user_set_preferences_params.rbs @@ -8,8 +8,6 @@ module Knockapi include Knockapi::Internal::Type::RequestParameters def initialize: (?request_options: Knockapi::request_opts) -> void - - def to_hash: -> Knockapi::Models::user_set_preferences_params end end end diff --git a/sig/knockapi/models/user_unset_channel_data_params.rbs b/sig/knockapi/models/user_unset_channel_data_params.rbs index 5631632b..72b1fec5 100644 --- a/sig/knockapi/models/user_unset_channel_data_params.rbs +++ b/sig/knockapi/models/user_unset_channel_data_params.rbs @@ -8,8 +8,6 @@ module Knockapi include Knockapi::Internal::Type::RequestParameters def initialize: (?request_options: Knockapi::request_opts) -> void - - def to_hash: -> Knockapi::Models::user_unset_channel_data_params end end end diff --git a/sig/knockapi/models/user_unset_channel_data_response.rbs b/sig/knockapi/models/user_unset_channel_data_response.rbs new file mode 100644 index 00000000..43f7f6f9 --- /dev/null +++ b/sig/knockapi/models/user_unset_channel_data_response.rbs @@ -0,0 +1,5 @@ +module Knockapi + module Models + class UserUnsetChannelDataResponse = String + end +end diff --git a/sig/knockapi/models/user_update_params.rbs b/sig/knockapi/models/user_update_params.rbs index d04f9ac3..fa588e58 100644 --- a/sig/knockapi/models/user_update_params.rbs +++ b/sig/knockapi/models/user_update_params.rbs @@ -8,8 +8,6 @@ module Knockapi include Knockapi::Internal::Type::RequestParameters def initialize: (?request_options: Knockapi::request_opts) -> void - - def to_hash: -> Knockapi::Models::user_update_params end end end diff --git a/sig/knockapi/models/users/bulk_delete_params.rbs b/sig/knockapi/models/users/bulk_delete_params.rbs index e3d8017b..00a61a72 100644 --- a/sig/knockapi/models/users/bulk_delete_params.rbs +++ b/sig/knockapi/models/users/bulk_delete_params.rbs @@ -15,8 +15,6 @@ module Knockapi user_ids: ::Array[String], ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::Users::bulk_delete_params end end end diff --git a/sig/knockapi/models/users/bulk_identify_params.rbs b/sig/knockapi/models/users/bulk_identify_params.rbs index cc5c1506..6e32870a 100644 --- a/sig/knockapi/models/users/bulk_identify_params.rbs +++ b/sig/knockapi/models/users/bulk_identify_params.rbs @@ -2,21 +2,19 @@ module Knockapi module Models module Users type bulk_identify_params = - { users: ::Array[Knockapi::Models::InlineIdentifyUserRequest] } + { users: ::Array[Knockapi::InlineIdentifyUserRequest] } & Knockapi::Internal::Type::request_parameters class BulkIdentifyParams < Knockapi::Internal::Type::BaseModel extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters - attr_accessor users: ::Array[Knockapi::Models::InlineIdentifyUserRequest] + attr_accessor users: ::Array[Knockapi::InlineIdentifyUserRequest] def initialize: ( - users: ::Array[Knockapi::Models::InlineIdentifyUserRequest], + users: ::Array[Knockapi::InlineIdentifyUserRequest], ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::Users::bulk_identify_params end end end diff --git a/sig/knockapi/models/users/bulk_set_preferences_params.rbs b/sig/knockapi/models/users/bulk_set_preferences_params.rbs index 41d3537e..80127e0a 100644 --- a/sig/knockapi/models/users/bulk_set_preferences_params.rbs +++ b/sig/knockapi/models/users/bulk_set_preferences_params.rbs @@ -3,7 +3,7 @@ module Knockapi module Users type bulk_set_preferences_params = { - preferences: Knockapi::Models::Recipients::PreferenceSetRequest, + preferences: Knockapi::Recipients::PreferenceSetRequest, user_ids: ::Array[String] } & Knockapi::Internal::Type::request_parameters @@ -12,17 +12,15 @@ module Knockapi extend Knockapi::Internal::Type::RequestParameters::Converter include Knockapi::Internal::Type::RequestParameters - attr_accessor preferences: Knockapi::Models::Recipients::PreferenceSetRequest + attr_accessor preferences: Knockapi::Recipients::PreferenceSetRequest attr_accessor user_ids: ::Array[String] def initialize: ( - preferences: Knockapi::Models::Recipients::PreferenceSetRequest, + preferences: Knockapi::Recipients::PreferenceSetRequest, user_ids: ::Array[String], ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::Users::bulk_set_preferences_params end end end diff --git a/sig/knockapi/models/users/feed_get_settings_params.rbs b/sig/knockapi/models/users/feed_get_settings_params.rbs index 30a8df16..e7a60009 100644 --- a/sig/knockapi/models/users/feed_get_settings_params.rbs +++ b/sig/knockapi/models/users/feed_get_settings_params.rbs @@ -9,8 +9,6 @@ module Knockapi include Knockapi::Internal::Type::RequestParameters def initialize: (?request_options: Knockapi::request_opts) -> void - - def to_hash: -> Knockapi::Models::Users::feed_get_settings_params end end end diff --git a/sig/knockapi/models/users/feed_get_settings_response.rbs b/sig/knockapi/models/users/feed_get_settings_response.rbs index 3b7d3ba7..24c3d872 100644 --- a/sig/knockapi/models/users/feed_get_settings_response.rbs +++ b/sig/knockapi/models/users/feed_get_settings_response.rbs @@ -11,16 +11,12 @@ module Knockapi features: Knockapi::Models::Users::FeedGetSettingsResponse::Features ) -> void - def to_hash: -> Knockapi::Models::Users::feed_get_settings_response - type features = { branding_required: bool } class Features < Knockapi::Internal::Type::BaseModel attr_accessor branding_required: bool def initialize: (branding_required: bool) -> void - - def to_hash: -> Knockapi::Models::Users::FeedGetSettingsResponse::features end end end diff --git a/sig/knockapi/models/users/feed_list_items_params.rbs b/sig/knockapi/models/users/feed_list_items_params.rbs index ff2277d5..76a906ca 100644 --- a/sig/knockapi/models/users/feed_list_items_params.rbs +++ b/sig/knockapi/models/users/feed_list_items_params.rbs @@ -78,8 +78,6 @@ module Knockapi ?request_options: Knockapi::request_opts ) -> void - def to_hash: -> Knockapi::Models::Users::feed_list_items_params - type archived = :exclude | :include | :only module Archived diff --git a/sig/knockapi/models/users/feed_list_items_response.rbs b/sig/knockapi/models/users/feed_list_items_response.rbs index ae60e4a8..1e4a3924 100644 --- a/sig/knockapi/models/users/feed_list_items_response.rbs +++ b/sig/knockapi/models/users/feed_list_items_response.rbs @@ -5,7 +5,7 @@ module Knockapi { id: String, _typename: String, - activities: ::Array[Knockapi::Models::Activity], + activities: ::Array[Knockapi::Activity], actors: ::Array[Knockapi::Models::recipient], blocks: ::Array[Knockapi::Models::Users::FeedListItemsResponse::block], data: ::Hash[Symbol, top]?, @@ -28,7 +28,7 @@ module Knockapi attr_accessor _typename: String - attr_accessor activities: ::Array[Knockapi::Models::Activity] + attr_accessor activities: ::Array[Knockapi::Activity] attr_accessor actors: ::Array[Knockapi::Models::recipient] @@ -63,7 +63,7 @@ module Knockapi def initialize: ( id: String, _typename: String, - activities: ::Array[Knockapi::Models::Activity], + activities: ::Array[Knockapi::Activity], actors: ::Array[Knockapi::Models::recipient], blocks: ::Array[Knockapi::Models::Users::FeedListItemsResponse::block], data: ::Hash[Symbol, top]?, @@ -81,8 +81,6 @@ module Knockapi ?seen_at: String? ) -> void - def to_hash: -> Knockapi::Models::Users::feed_list_items_response - type block = Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedContentBlock | Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedButtonSetBlock @@ -114,8 +112,6 @@ module Knockapi type: Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedContentBlock::type_ ) -> void - def to_hash: -> Knockapi::Models::Users::FeedListItemsResponse::Block::message_in_app_feed_content_block - type type_ = :markdown | :text module Type @@ -148,8 +144,6 @@ module Knockapi type: Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedButtonSetBlock::type_ ) -> void - def to_hash: -> Knockapi::Models::Users::FeedListItemsResponse::Block::message_in_app_feed_button_set_block - type button = { action: String, label: String, name: String } class Button < Knockapi::Internal::Type::BaseModel @@ -164,8 +158,6 @@ module Knockapi label: String, name: String ) -> void - - def to_hash: -> Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedButtonSetBlock::button end type type_ = :button_set @@ -179,7 +171,7 @@ module Knockapi end end - def self?.variants: -> [Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedContentBlock, Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedButtonSetBlock] + def self?.variants: -> ::Array[Knockapi::Models::Users::FeedListItemsResponse::block] end type source = @@ -205,8 +197,6 @@ module Knockapi key: String, version_id: String ) -> void - - def to_hash: -> Knockapi::Models::Users::FeedListItemsResponse::source end end end diff --git a/sig/knockapi/models/users/guide_get_channel_params.rbs b/sig/knockapi/models/users/guide_get_channel_params.rbs index 4e38c814..7ef57d0f 100644 --- a/sig/knockapi/models/users/guide_get_channel_params.rbs +++ b/sig/knockapi/models/users/guide_get_channel_params.rbs @@ -27,8 +27,6 @@ module Knockapi ?type: String, ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::Users::guide_get_channel_params end end end diff --git a/sig/knockapi/models/users/guide_get_channel_response.rbs b/sig/knockapi/models/users/guide_get_channel_response.rbs index 7bdb9065..0088392f 100644 --- a/sig/knockapi/models/users/guide_get_channel_response.rbs +++ b/sig/knockapi/models/users/guide_get_channel_response.rbs @@ -17,8 +17,6 @@ module Knockapi ?recipient: Knockapi::Models::Users::GuideGetChannelResponse::Recipient? ) -> void - def to_hash: -> Knockapi::Models::Users::guide_get_channel_response - type guide = { id: String, @@ -50,8 +48,6 @@ module Knockapi ?metadata: ::Hash[Symbol, top], ?title: String ) -> void - - def to_hash: -> Knockapi::Models::Users::GuideGetChannelResponse::guide end type recipient = { id: String } @@ -62,8 +58,6 @@ module Knockapi def id=: (String) -> String def initialize: (?id: String) -> void - - def to_hash: -> Knockapi::Models::Users::GuideGetChannelResponse::recipient end end end diff --git a/sig/knockapi/models/users/guide_mark_message_as_archived_params.rbs b/sig/knockapi/models/users/guide_mark_message_as_archived_params.rbs index 6c74bac2..0ae4e897 100644 --- a/sig/knockapi/models/users/guide_mark_message_as_archived_params.rbs +++ b/sig/knockapi/models/users/guide_mark_message_as_archived_params.rbs @@ -57,8 +57,6 @@ module Knockapi ?tenant: String?, ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::Users::guide_mark_message_as_archived_params end end end diff --git a/sig/knockapi/models/users/guide_mark_message_as_archived_response.rbs b/sig/knockapi/models/users/guide_mark_message_as_archived_response.rbs index f79b50e4..abe098f2 100644 --- a/sig/knockapi/models/users/guide_mark_message_as_archived_response.rbs +++ b/sig/knockapi/models/users/guide_mark_message_as_archived_response.rbs @@ -7,8 +7,6 @@ module Knockapi attr_accessor status: String def initialize: (status: String) -> void - - def to_hash: -> Knockapi::Models::Users::guide_mark_message_as_archived_response end end end diff --git a/sig/knockapi/models/users/guide_mark_message_as_interacted_params.rbs b/sig/knockapi/models/users/guide_mark_message_as_interacted_params.rbs index f9b4480e..7c9f4d54 100644 --- a/sig/knockapi/models/users/guide_mark_message_as_interacted_params.rbs +++ b/sig/knockapi/models/users/guide_mark_message_as_interacted_params.rbs @@ -57,8 +57,6 @@ module Knockapi ?tenant: String?, ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::Users::guide_mark_message_as_interacted_params end end end diff --git a/sig/knockapi/models/users/guide_mark_message_as_interacted_response.rbs b/sig/knockapi/models/users/guide_mark_message_as_interacted_response.rbs index 2e2e117f..0b0ad539 100644 --- a/sig/knockapi/models/users/guide_mark_message_as_interacted_response.rbs +++ b/sig/knockapi/models/users/guide_mark_message_as_interacted_response.rbs @@ -7,8 +7,6 @@ module Knockapi attr_accessor status: String def initialize: (status: String) -> void - - def to_hash: -> Knockapi::Models::Users::guide_mark_message_as_interacted_response end end end diff --git a/sig/knockapi/models/users/guide_mark_message_as_seen_params.rbs b/sig/knockapi/models/users/guide_mark_message_as_seen_params.rbs index 9581d6a7..708827aa 100644 --- a/sig/knockapi/models/users/guide_mark_message_as_seen_params.rbs +++ b/sig/knockapi/models/users/guide_mark_message_as_seen_params.rbs @@ -57,8 +57,6 @@ module Knockapi ?tenant: String?, ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::Users::guide_mark_message_as_seen_params end end end diff --git a/sig/knockapi/models/users/guide_mark_message_as_seen_response.rbs b/sig/knockapi/models/users/guide_mark_message_as_seen_response.rbs index 50490398..271d67fc 100644 --- a/sig/knockapi/models/users/guide_mark_message_as_seen_response.rbs +++ b/sig/knockapi/models/users/guide_mark_message_as_seen_response.rbs @@ -7,8 +7,6 @@ module Knockapi attr_accessor status: String def initialize: (status: String) -> void - - def to_hash: -> Knockapi::Models::Users::guide_mark_message_as_seen_response end end end diff --git a/sig/knockapi/models/workflow_cancel_params.rbs b/sig/knockapi/models/workflow_cancel_params.rbs index 812b95fe..6ae31b67 100644 --- a/sig/knockapi/models/workflow_cancel_params.rbs +++ b/sig/knockapi/models/workflow_cancel_params.rbs @@ -20,8 +20,6 @@ module Knockapi ?recipients: ::Array[Knockapi::Models::recipient_reference]?, ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::workflow_cancel_params end end end diff --git a/sig/knockapi/models/workflow_cancel_response.rbs b/sig/knockapi/models/workflow_cancel_response.rbs new file mode 100644 index 00000000..088015aa --- /dev/null +++ b/sig/knockapi/models/workflow_cancel_response.rbs @@ -0,0 +1,5 @@ +module Knockapi + module Models + class WorkflowCancelResponse = String + end +end diff --git a/sig/knockapi/models/workflow_trigger_params.rbs b/sig/knockapi/models/workflow_trigger_params.rbs index eb8a1d27..2aa79be9 100644 --- a/sig/knockapi/models/workflow_trigger_params.rbs +++ b/sig/knockapi/models/workflow_trigger_params.rbs @@ -32,8 +32,6 @@ module Knockapi ?tenant: Knockapi::Models::inline_tenant_request?, ?request_options: Knockapi::request_opts ) -> void - - def to_hash: -> Knockapi::Models::workflow_trigger_params end end end diff --git a/sig/knockapi/models/workflow_trigger_response.rbs b/sig/knockapi/models/workflow_trigger_response.rbs index 4727e613..432a3892 100644 --- a/sig/knockapi/models/workflow_trigger_response.rbs +++ b/sig/knockapi/models/workflow_trigger_response.rbs @@ -6,8 +6,6 @@ module Knockapi attr_accessor workflow_run_id: String def initialize: (workflow_run_id: String) -> void - - def to_hash: -> Knockapi::Models::workflow_trigger_response end end end diff --git a/sig/knockapi/request_options.rbs b/sig/knockapi/request_options.rbs index cc44f035..66216c0c 100644 --- a/sig/knockapi/request_options.rbs +++ b/sig/knockapi/request_options.rbs @@ -13,7 +13,7 @@ module Knockapi } class RequestOptions < Knockapi::Internal::Type::BaseModel - def self.validate!: (self | ::Hash[Symbol, top] opts) -> void + def self.validate!: (Knockapi::request_opts opts) -> void attr_accessor idempotency_key: String? diff --git a/sig/knockapi/resources/audiences.rbs b/sig/knockapi/resources/audiences.rbs index 0daf5190..f434883f 100644 --- a/sig/knockapi/resources/audiences.rbs +++ b/sig/knockapi/resources/audiences.rbs @@ -3,7 +3,7 @@ module Knockapi class Audiences def add_members: ( String key, - members: ::Array[Knockapi::Models::AudienceAddMembersParams::Member], + members: ::Array[Knockapi::AudienceAddMembersParams::Member], ?request_options: Knockapi::request_opts ) -> String @@ -14,7 +14,7 @@ module Knockapi def remove_members: ( String key, - members: ::Array[Knockapi::Models::AudienceRemoveMembersParams::Member], + members: ::Array[Knockapi::AudienceRemoveMembersParams::Member], ?request_options: Knockapi::request_opts ) -> String diff --git a/sig/knockapi/resources/bulk_operations.rbs b/sig/knockapi/resources/bulk_operations.rbs index 774dd18a..b8df0008 100644 --- a/sig/knockapi/resources/bulk_operations.rbs +++ b/sig/knockapi/resources/bulk_operations.rbs @@ -4,7 +4,7 @@ module Knockapi def get: ( String id, ?request_options: Knockapi::request_opts - ) -> Knockapi::Models::BulkOperation + ) -> Knockapi::BulkOperation def initialize: (client: Knockapi::Client) -> void end diff --git a/sig/knockapi/resources/channels/bulk.rbs b/sig/knockapi/resources/channels/bulk.rbs index 2a216700..276e3e6d 100644 --- a/sig/knockapi/resources/channels/bulk.rbs +++ b/sig/knockapi/resources/channels/bulk.rbs @@ -16,7 +16,7 @@ module Knockapi ?trigger_data: String, ?workflows: ::Array[String], ?request_options: Knockapi::request_opts - ) -> Knockapi::Models::BulkOperation + ) -> Knockapi::BulkOperation def initialize: (client: Knockapi::Client) -> void end diff --git a/sig/knockapi/resources/messages.rbs b/sig/knockapi/resources/messages.rbs index e8ba43ab..69958fd4 100644 --- a/sig/knockapi/resources/messages.rbs +++ b/sig/knockapi/resources/messages.rbs @@ -3,35 +3,33 @@ module Knockapi class Messages attr_reader batch: Knockapi::Resources::Messages::Batch - attr_reader activities: Knockapi::Resources::Messages::Activities - def list: ( ?after: String, ?before: String, ?channel_id: String, - ?engagement_status: ::Array[Knockapi::Models::MessageListParams::engagement_status], - ?inserted_at: Knockapi::Models::MessageListParams::InsertedAt, + ?engagement_status: ::Array[Knockapi::MessageListParams::engagement_status], + ?inserted_at: Knockapi::MessageListParams::InsertedAt, ?message_ids: ::Array[String], ?page_size: Integer, ?source: String, - ?status: ::Array[Knockapi::Models::MessageListParams::status], + ?status: ::Array[Knockapi::MessageListParams::status], ?tenant: String, ?trigger_data: String, ?workflow_categories: ::Array[String], ?workflow_recipient_run_id: String, ?workflow_run_id: String, ?request_options: Knockapi::request_opts - ) -> Knockapi::Internal::EntriesCursor[Knockapi::Models::Message] + ) -> Knockapi::Internal::EntriesCursor[Knockapi::Message] def archive: ( String message_id, ?request_options: Knockapi::request_opts - ) -> Knockapi::Models::Message + ) -> Knockapi::Message def get: ( String message_id, ?request_options: Knockapi::request_opts - ) -> Knockapi::Models::Message + ) -> Knockapi::Message def get_content: ( String message_id, @@ -45,7 +43,7 @@ module Knockapi ?page_size: Integer, ?trigger_data: String, ?request_options: Knockapi::request_opts - ) -> Knockapi::Internal::ItemsCursor[Knockapi::Models::Activity] + ) -> Knockapi::Internal::ItemsCursor[Knockapi::Activity] def list_delivery_logs: ( String message_id, @@ -53,7 +51,7 @@ module Knockapi ?before: String, ?page_size: Integer, ?request_options: Knockapi::request_opts - ) -> Knockapi::Internal::EntriesCursor[Knockapi::Models::MessageDeliveryLog] + ) -> Knockapi::Internal::EntriesCursor[Knockapi::MessageDeliveryLog] def list_events: ( String message_id, @@ -61,38 +59,38 @@ module Knockapi ?before: String, ?page_size: Integer, ?request_options: Knockapi::request_opts - ) -> Knockapi::Internal::EntriesCursor[Knockapi::Models::MessageEvent] + ) -> Knockapi::Internal::EntriesCursor[Knockapi::MessageEvent] def mark_as_interacted: ( String message_id, ?metadata: ::Hash[Symbol, top], ?request_options: Knockapi::request_opts - ) -> Knockapi::Models::Message + ) -> Knockapi::Message def mark_as_read: ( String message_id, ?request_options: Knockapi::request_opts - ) -> Knockapi::Models::Message + ) -> Knockapi::Message def mark_as_seen: ( String message_id, ?request_options: Knockapi::request_opts - ) -> Knockapi::Models::Message + ) -> Knockapi::Message def mark_as_unread: ( String message_id, ?request_options: Knockapi::request_opts - ) -> Knockapi::Models::Message + ) -> Knockapi::Message def mark_as_unseen: ( String message_id, ?request_options: Knockapi::request_opts - ) -> Knockapi::Models::Message + ) -> Knockapi::Message def unarchive: ( String message_id, ?request_options: Knockapi::request_opts - ) -> Knockapi::Models::Message + ) -> Knockapi::Message def initialize: (client: Knockapi::Client) -> void end diff --git a/sig/knockapi/resources/messages/activities.rbs b/sig/knockapi/resources/messages/activities.rbs deleted file mode 100644 index 1b64ca5c..00000000 --- a/sig/knockapi/resources/messages/activities.rbs +++ /dev/null @@ -1,18 +0,0 @@ -module Knockapi - module Resources - class Messages - class Activities - def list: ( - String message_id, - ?after: String, - ?before: String, - ?page_size: Integer, - ?trigger_data: String, - ?request_options: Knockapi::request_opts - ) -> Knockapi::Internal::ItemsCursor[Knockapi::Models::Activity] - - def initialize: (client: Knockapi::Client) -> void - end - end - end -end diff --git a/sig/knockapi/resources/objects.rbs b/sig/knockapi/resources/objects.rbs index 533ed7fd..58d6febb 100644 --- a/sig/knockapi/resources/objects.rbs +++ b/sig/knockapi/resources/objects.rbs @@ -7,10 +7,10 @@ module Knockapi String collection, ?after: String, ?before: String, - ?include: ::Array[Knockapi::Models::ObjectListParams::include_], + ?include: ::Array[Knockapi::ObjectListParams::include_], ?page_size: Integer, ?request_options: Knockapi::request_opts - ) -> Knockapi::Internal::EntriesCursor[Knockapi::Models::Object] + ) -> Knockapi::Internal::EntriesCursor[Knockapi::Object] def delete: ( String collection, @@ -37,21 +37,21 @@ module Knockapi String collection, String id, ?request_options: Knockapi::request_opts - ) -> Knockapi::Models::Object + ) -> Knockapi::Object def get_channel_data: ( String collection, String object_id_, String channel_id, ?request_options: Knockapi::request_opts - ) -> Knockapi::Models::Recipients::RecipientsChannelData + ) -> Knockapi::Recipients::RecipientsChannelData def get_preferences: ( String collection, String object_id_, String id, ?request_options: Knockapi::request_opts - ) -> Knockapi::Models::Recipients::PreferenceSet + ) -> Knockapi::Recipients::PreferenceSet def list_messages: ( String collection, @@ -59,19 +59,19 @@ module Knockapi ?after: String, ?before: String, ?channel_id: String, - ?engagement_status: ::Array[Knockapi::Models::ObjectListMessagesParams::engagement_status], - ?inserted_at: Knockapi::Models::ObjectListMessagesParams::InsertedAt, + ?engagement_status: ::Array[Knockapi::ObjectListMessagesParams::engagement_status], + ?inserted_at: Knockapi::ObjectListMessagesParams::InsertedAt, ?message_ids: ::Array[String], ?page_size: Integer, ?source: String, - ?status: ::Array[Knockapi::Models::ObjectListMessagesParams::status], + ?status: ::Array[Knockapi::ObjectListMessagesParams::status], ?tenant: String, ?trigger_data: String, ?workflow_categories: ::Array[String], ?workflow_recipient_run_id: String, ?workflow_run_id: String, ?request_options: Knockapi::request_opts - ) -> Knockapi::Internal::EntriesCursor[Knockapi::Models::Message] + ) -> Knockapi::Internal::EntriesCursor[Knockapi::Message] def list_preferences: ( String collection, @@ -88,20 +88,20 @@ module Knockapi ?tenant: String, ?workflow: String, ?request_options: Knockapi::request_opts - ) -> Knockapi::Internal::EntriesCursor[Knockapi::Models::Schedule] + ) -> Knockapi::Internal::EntriesCursor[Knockapi::Schedule] def list_subscriptions: ( String collection, String object_id_, ?after: String, ?before: String, - ?include: ::Array[Knockapi::Models::ObjectListSubscriptionsParams::include_], + ?include: ::Array[Knockapi::ObjectListSubscriptionsParams::include_], ?mode: Knockapi::Models::ObjectListSubscriptionsParams::mode, - ?objects: ::Array[Knockapi::Models::ObjectListSubscriptionsParams::Object], + ?objects: ::Array[Knockapi::ObjectListSubscriptionsParams::Object], ?page_size: Integer, ?recipients: ::Array[Knockapi::Models::recipient_reference], ?request_options: Knockapi::request_opts - ) -> Knockapi::Internal::EntriesCursor[Knockapi::Models::Recipients::Subscription] + ) -> Knockapi::Internal::EntriesCursor[Knockapi::Recipients::Subscription] def set: ( String collection, @@ -111,7 +111,7 @@ module Knockapi ?preferences: Knockapi::Models::Recipients::inline_preference_set_request, ?timezone: String?, ?request_options: Knockapi::request_opts - ) -> Knockapi::Models::Object + ) -> Knockapi::Object def set_channel_data: ( String collection, @@ -119,17 +119,17 @@ module Knockapi String channel_id, data: Knockapi::Models::Recipients::ChannelDataRequest::data, ?request_options: Knockapi::request_opts - ) -> Knockapi::Models::Recipients::RecipientsChannelData + ) -> Knockapi::Recipients::RecipientsChannelData def set_preferences: ( String collection, String object_id_, String id, - ?categories: ::Hash[Symbol, Knockapi::Models::Recipients::PreferenceSetRequest::category]?, - ?channel_types: Knockapi::Models::Recipients::PreferenceSetChannelTypes?, - ?workflows: ::Hash[Symbol, Knockapi::Models::Recipients::PreferenceSetRequest::workflow]?, + ?categories: ::Hash[Symbol, Knockapi::Recipients::PreferenceSetRequest::category]?, + ?channel_types: Knockapi::Recipients::PreferenceSetChannelTypes?, + ?workflows: ::Hash[Symbol, Knockapi::Recipients::PreferenceSetRequest::workflow]?, ?request_options: Knockapi::request_opts - ) -> Knockapi::Models::Recipients::PreferenceSet + ) -> Knockapi::Recipients::PreferenceSet def unset_channel_data: ( String collection, diff --git a/sig/knockapi/resources/objects/bulk.rbs b/sig/knockapi/resources/objects/bulk.rbs index 488c76a9..8d702de8 100644 --- a/sig/knockapi/resources/objects/bulk.rbs +++ b/sig/knockapi/resources/objects/bulk.rbs @@ -6,19 +6,19 @@ module Knockapi String collection, object_ids: ::Array[String], ?request_options: Knockapi::request_opts - ) -> Knockapi::Models::BulkOperation + ) -> Knockapi::BulkOperation def add_subscriptions: ( String collection, - subscriptions: ::Array[Knockapi::Models::Objects::BulkAddSubscriptionsParams::Subscription], + subscriptions: ::Array[Knockapi::Objects::BulkAddSubscriptionsParams::Subscription], ?request_options: Knockapi::request_opts - ) -> Knockapi::Models::BulkOperation + ) -> Knockapi::BulkOperation def set: ( String collection, - objects: ::Array[Knockapi::Models::InlineObjectRequest], + objects: ::Array[Knockapi::InlineObjectRequest], ?request_options: Knockapi::request_opts - ) -> Knockapi::Models::BulkOperation + ) -> Knockapi::BulkOperation def initialize: (client: Knockapi::Client) -> void end diff --git a/sig/knockapi/resources/providers/ms_teams.rbs b/sig/knockapi/resources/providers/ms_teams.rbs index 6b3ada46..dc2d9c87 100644 --- a/sig/knockapi/resources/providers/ms_teams.rbs +++ b/sig/knockapi/resources/providers/ms_teams.rbs @@ -12,14 +12,14 @@ module Knockapi String channel_id, ms_teams_tenant_object: String, team_id: String, - ?query_options: Knockapi::Models::Providers::MsTeamListChannelsParams::QueryOptions, + ?query_options: Knockapi::Providers::MsTeamListChannelsParams::QueryOptions, ?request_options: Knockapi::request_opts ) -> Knockapi::Models::Providers::MsTeamListChannelsResponse def list_teams: ( String channel_id, ms_teams_tenant_object: String, - ?query_options: Knockapi::Models::Providers::MsTeamListTeamsParams::QueryOptions, + ?query_options: Knockapi::Providers::MsTeamListTeamsParams::QueryOptions, ?request_options: Knockapi::request_opts ) -> Knockapi::Internal::MsTeamsPagination[Knockapi::Models::Providers::MsTeamListTeamsResponse] diff --git a/sig/knockapi/resources/providers/slack.rbs b/sig/knockapi/resources/providers/slack.rbs index 98694665..544cd856 100644 --- a/sig/knockapi/resources/providers/slack.rbs +++ b/sig/knockapi/resources/providers/slack.rbs @@ -11,7 +11,7 @@ module Knockapi def list_channels: ( String channel_id, access_token_object: String, - ?query_options: Knockapi::Models::Providers::SlackListChannelsParams::QueryOptions, + ?query_options: Knockapi::Providers::SlackListChannelsParams::QueryOptions, ?request_options: Knockapi::request_opts ) -> Knockapi::Internal::SlackChannelsCursor[Knockapi::Models::Providers::SlackListChannelsResponse] diff --git a/sig/knockapi/resources/schedules.rbs b/sig/knockapi/resources/schedules.rbs index 7c59b3ce..05a63613 100644 --- a/sig/knockapi/resources/schedules.rbs +++ b/sig/knockapi/resources/schedules.rbs @@ -5,7 +5,7 @@ module Knockapi def create: ( recipients: ::Array[Knockapi::Models::recipient_request], - repeats: ::Array[Knockapi::Models::ScheduleRepeatRule], + repeats: ::Array[Knockapi::ScheduleRepeatRule], workflow: String, ?data: ::Hash[Symbol, top]?, ?ending_at: Time?, @@ -19,7 +19,7 @@ module Knockapi ?actor: Knockapi::Models::recipient_reference?, ?data: ::Hash[Symbol, top]?, ?ending_at: Time?, - ?repeats: ::Array[Knockapi::Models::ScheduleRepeatRule], + ?repeats: ::Array[Knockapi::ScheduleRepeatRule], ?scheduled_at: Time?, ?tenant: Knockapi::Models::inline_tenant_request?, ?request_options: Knockapi::request_opts @@ -33,7 +33,7 @@ module Knockapi ?recipients: ::Array[String], ?tenant: String, ?request_options: Knockapi::request_opts - ) -> Knockapi::Internal::EntriesCursor[Knockapi::Models::Schedule] + ) -> Knockapi::Internal::EntriesCursor[Knockapi::Schedule] def delete: ( schedule_ids: ::Array[String], diff --git a/sig/knockapi/resources/schedules/bulk.rbs b/sig/knockapi/resources/schedules/bulk.rbs index a02b4f34..85b60381 100644 --- a/sig/knockapi/resources/schedules/bulk.rbs +++ b/sig/knockapi/resources/schedules/bulk.rbs @@ -3,9 +3,9 @@ module Knockapi class Schedules class Bulk def create: ( - schedules: ::Array[Knockapi::Models::Schedules::BulkCreateParams::Schedule], + schedules: ::Array[Knockapi::Schedules::BulkCreateParams::Schedule], ?request_options: Knockapi::request_opts - ) -> Knockapi::Models::BulkOperation + ) -> Knockapi::BulkOperation def initialize: (client: Knockapi::Client) -> void end diff --git a/sig/knockapi/resources/tenants.rbs b/sig/knockapi/resources/tenants.rbs index 4c5b9095..001e879d 100644 --- a/sig/knockapi/resources/tenants.rbs +++ b/sig/knockapi/resources/tenants.rbs @@ -10,7 +10,7 @@ module Knockapi ?page_size: Integer, ?tenant_id: String, ?request_options: Knockapi::request_opts - ) -> Knockapi::Internal::EntriesCursor[Knockapi::Models::Tenant] + ) -> Knockapi::Internal::EntriesCursor[Knockapi::Tenant] def delete: ( String id, @@ -20,15 +20,15 @@ module Knockapi def get: ( String id, ?request_options: Knockapi::request_opts - ) -> Knockapi::Models::Tenant + ) -> Knockapi::Tenant def set: ( String id, ?channel_data: Knockapi::Models::Recipients::inline_channel_data_request?, ?preferences: Knockapi::Models::Recipients::inline_preference_set_request?, - ?settings: Knockapi::Models::TenantSetParams::Settings, + ?settings: Knockapi::TenantSetParams::Settings, ?request_options: Knockapi::request_opts - ) -> Knockapi::Models::Tenant + ) -> Knockapi::Tenant def initialize: (client: Knockapi::Client) -> void end diff --git a/sig/knockapi/resources/tenants/bulk.rbs b/sig/knockapi/resources/tenants/bulk.rbs index 894d2bb3..c028c747 100644 --- a/sig/knockapi/resources/tenants/bulk.rbs +++ b/sig/knockapi/resources/tenants/bulk.rbs @@ -5,12 +5,12 @@ module Knockapi def delete: ( tenant_ids: ::Array[String], ?request_options: Knockapi::request_opts - ) -> Knockapi::Models::BulkOperation + ) -> Knockapi::BulkOperation def set: ( tenants: ::Array[Knockapi::Models::inline_tenant_request], ?request_options: Knockapi::request_opts - ) -> Knockapi::Models::BulkOperation + ) -> Knockapi::BulkOperation def initialize: (client: Knockapi::Client) -> void end diff --git a/sig/knockapi/resources/users.rbs b/sig/knockapi/resources/users.rbs index d6928543..0c7cee7e 100644 --- a/sig/knockapi/resources/users.rbs +++ b/sig/knockapi/resources/users.rbs @@ -19,15 +19,15 @@ module Knockapi ?preferences: Knockapi::Models::Recipients::inline_preference_set_request?, ?timezone: String?, ?request_options: Knockapi::request_opts - ) -> Knockapi::Models::User + ) -> Knockapi::User def list: ( ?after: String, ?before: String, - ?include: ::Array[Knockapi::Models::UserListParams::include_], + ?include: ::Array[Knockapi::UserListParams::include_], ?page_size: Integer, ?request_options: Knockapi::request_opts - ) -> Knockapi::Internal::EntriesCursor[Knockapi::Models::User] + ) -> Knockapi::Internal::EntriesCursor[Knockapi::User] def delete: ( String user_id, @@ -37,39 +37,39 @@ module Knockapi def get: ( String user_id, ?request_options: Knockapi::request_opts - ) -> Knockapi::Models::User + ) -> Knockapi::User def get_channel_data: ( String user_id, String channel_id, ?request_options: Knockapi::request_opts - ) -> Knockapi::Models::Recipients::RecipientsChannelData + ) -> Knockapi::Recipients::RecipientsChannelData def get_preferences: ( String user_id, String id, ?tenant: String, ?request_options: Knockapi::request_opts - ) -> Knockapi::Models::Recipients::PreferenceSet + ) -> Knockapi::Recipients::PreferenceSet def list_messages: ( String user_id, ?after: String, ?before: String, ?channel_id: String, - ?engagement_status: ::Array[Knockapi::Models::UserListMessagesParams::engagement_status], - ?inserted_at: Knockapi::Models::UserListMessagesParams::InsertedAt, + ?engagement_status: ::Array[Knockapi::UserListMessagesParams::engagement_status], + ?inserted_at: Knockapi::UserListMessagesParams::InsertedAt, ?message_ids: ::Array[String], ?page_size: Integer, ?source: String, - ?status: ::Array[Knockapi::Models::UserListMessagesParams::status], + ?status: ::Array[Knockapi::UserListMessagesParams::status], ?tenant: String, ?trigger_data: String, ?workflow_categories: ::Array[String], ?workflow_recipient_run_id: String, ?workflow_run_id: String, ?request_options: Knockapi::request_opts - ) -> Knockapi::Internal::EntriesCursor[Knockapi::Models::Message] + ) -> Knockapi::Internal::EntriesCursor[Knockapi::Message] def list_preferences: ( String user_id, @@ -84,39 +84,39 @@ module Knockapi ?tenant: String, ?workflow: String, ?request_options: Knockapi::request_opts - ) -> Knockapi::Internal::EntriesCursor[Knockapi::Models::Schedule] + ) -> Knockapi::Internal::EntriesCursor[Knockapi::Schedule] def list_subscriptions: ( String user_id, ?after: String, ?before: String, - ?include: ::Array[Knockapi::Models::UserListSubscriptionsParams::include_], + ?include: ::Array[Knockapi::UserListSubscriptionsParams::include_], ?objects: ::Array[String], ?page_size: Integer, ?request_options: Knockapi::request_opts - ) -> Knockapi::Internal::EntriesCursor[Knockapi::Models::Recipients::Subscription] + ) -> Knockapi::Internal::EntriesCursor[Knockapi::Recipients::Subscription] def merge: ( String user_id, from_user_id: String, ?request_options: Knockapi::request_opts - ) -> Knockapi::Models::User + ) -> Knockapi::User def set_channel_data: ( String user_id, String channel_id, data: Knockapi::Models::Recipients::ChannelDataRequest::data, ?request_options: Knockapi::request_opts - ) -> Knockapi::Models::Recipients::RecipientsChannelData + ) -> Knockapi::Recipients::RecipientsChannelData def set_preferences: ( String user_id, String id, - ?categories: ::Hash[Symbol, Knockapi::Models::Recipients::PreferenceSetRequest::category]?, - ?channel_types: Knockapi::Models::Recipients::PreferenceSetChannelTypes?, - ?workflows: ::Hash[Symbol, Knockapi::Models::Recipients::PreferenceSetRequest::workflow]?, + ?categories: ::Hash[Symbol, Knockapi::Recipients::PreferenceSetRequest::category]?, + ?channel_types: Knockapi::Recipients::PreferenceSetChannelTypes?, + ?workflows: ::Hash[Symbol, Knockapi::Recipients::PreferenceSetRequest::workflow]?, ?request_options: Knockapi::request_opts - ) -> Knockapi::Models::Recipients::PreferenceSet + ) -> Knockapi::Recipients::PreferenceSet def unset_channel_data: ( String user_id, diff --git a/sig/knockapi/resources/users/bulk.rbs b/sig/knockapi/resources/users/bulk.rbs index 456c7cb4..6f8233c2 100644 --- a/sig/knockapi/resources/users/bulk.rbs +++ b/sig/knockapi/resources/users/bulk.rbs @@ -5,18 +5,18 @@ module Knockapi def delete: ( user_ids: ::Array[String], ?request_options: Knockapi::request_opts - ) -> Knockapi::Models::BulkOperation + ) -> Knockapi::BulkOperation def identify: ( - users: ::Array[Knockapi::Models::InlineIdentifyUserRequest], + users: ::Array[Knockapi::InlineIdentifyUserRequest], ?request_options: Knockapi::request_opts - ) -> Knockapi::Models::BulkOperation + ) -> Knockapi::BulkOperation def set_preferences: ( - preferences: Knockapi::Models::Recipients::PreferenceSetRequest, + preferences: Knockapi::Recipients::PreferenceSetRequest, user_ids: ::Array[String], ?request_options: Knockapi::request_opts - ) -> Knockapi::Models::BulkOperation + ) -> Knockapi::BulkOperation def initialize: (client: Knockapi::Client) -> void end diff --git a/test/knockapi/client_test.rb b/test/knockapi/client_test.rb index db4ba805..fe013f24 100644 --- a/test/knockapi/client_test.rb +++ b/test/knockapi/client_test.rb @@ -3,14 +3,9 @@ require_relative "test_helper" class KnockapiTest < Minitest::Test + extend Minitest::Serial include WebMock::API - class << self - def test_order = :random - - def run_one_method(...) = Minitest::Runnable.run_one_method(...) - end - def before_all super WebMock.enable! diff --git a/test/knockapi/internal/sorbet_runtime_support_test.rb b/test/knockapi/internal/sorbet_runtime_support_test.rb new file mode 100644 index 00000000..b8e69e57 --- /dev/null +++ b/test/knockapi/internal/sorbet_runtime_support_test.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Knockapi::Test::SorbetRuntimeSupportTest < Minitest::Test + i_suck_and_my_tests_are_order_dependent! + + module E + extend Knockapi::Internal::Type::Enum + + define_sorbet_constant!(:TaggedSymbol) { 1 } + end + + module U + extend Knockapi::Internal::Type::Union + + define_sorbet_constant!(:Variants) { 2 } + end + + class M < Knockapi::Internal::Type::BaseModel + define_sorbet_constant!(:OrHash) { 3 } + end + + def test_nil_aliases + err = Knockapi::Internal::Util::SorbetRuntimeSupport::MissingSorbetRuntimeError + + assert_raises(err) { Knockapi::Internal::AnyHash } + assert_raises(err) { Knockapi::Internal::Type::Converter::Input } + assert_raises(err) { Knockapi::Internal::Type::Converter::CoerceState } + assert_raises(err) { Knockapi::Internal::Type::Converter::DumpState } + assert_raises(err) { Knockapi::Internal::Type::BaseModel::KnownField } + assert_raises(err) { Knockapi::Internal::Util::ParsedUri } + assert_raises(err) { Knockapi::Internal::Util::ServerSentEvent } + assert_raises(err) { Knockapi::Internal::Transport::BaseClient::RequestComponents } + assert_raises(err) { Knockapi::Internal::Transport::BaseClient::RequestInput } + assert_raises(err) { Knockapi::Internal::Transport::PooledNetRequester::Request } + assert_raises(err) { E::TaggedSymbol } + assert_raises(err) { U::Variants } + assert_raises(err) { M::OrHash } + end + + def test_stubbed_aliases + Kernel.instance_eval { const_set(:T, nil) } + + assert_equal(1, E::TaggedSymbol) + assert_equal(2, U::Variants) + assert_equal(3, M::OrHash) + end +end diff --git a/test/knockapi/internal/util_test.rb b/test/knockapi/internal/util_test.rb index 631ef069..0796cf7d 100644 --- a/test/knockapi/internal/util_test.rb +++ b/test/knockapi/internal/util_test.rb @@ -172,6 +172,22 @@ def test_json_content end end end + + def test_jsonl_content + cases = { + "application/x-ndjson" => true, + "application/x-ldjson" => true, + "application/jsonl" => true, + "application/x-jsonl" => true, + "application/json" => false, + "application/vnd.api+json" => false + } + cases.each do |header, verdict| + assert_pattern do + Knockapi::Internal::Util::JSONL_CONTENT.match?(header) => ^verdict + end + end + end end class Knockapi::Test::UtilFormDataEncodingTest < Minitest::Test diff --git a/test/knockapi/resources/audiences_test.rb b/test/knockapi/resources/audiences_test.rb index 8463f237..5d1cd3cd 100644 --- a/test/knockapi/resources/audiences_test.rb +++ b/test/knockapi/resources/audiences_test.rb @@ -28,8 +28,8 @@ def test_list_members assert_pattern do response => { - entries: ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::AudienceMember]), - page_info: Knockapi::Models::PageInfo + entries: ^(Knockapi::Internal::Type::ArrayOf[Knockapi::AudienceMember]), + page_info: Knockapi::PageInfo } end end diff --git a/test/knockapi/resources/bulk_operations_test.rb b/test/knockapi/resources/bulk_operations_test.rb index 0912d346..b8e52769 100644 --- a/test/knockapi/resources/bulk_operations_test.rb +++ b/test/knockapi/resources/bulk_operations_test.rb @@ -11,7 +11,7 @@ def test_get response = @knock.bulk_operations.get("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assert_pattern do - response => Knockapi::Models::BulkOperation + response => Knockapi::BulkOperation end assert_pattern do @@ -22,12 +22,12 @@ def test_get inserted_at: Time, name: String, processed_rows: Integer, - status: Knockapi::Models::BulkOperation::Status, + status: Knockapi::BulkOperation::Status, success_count: Integer, updated_at: Time, completed_at: Time | nil, error_count: Integer | nil, - error_items: ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::BulkOperation::ErrorItem]) | nil, + error_items: ^(Knockapi::Internal::Type::ArrayOf[Knockapi::BulkOperation::ErrorItem]) | nil, failed_at: Time | nil, progress_path: String | nil, started_at: Time | nil diff --git a/test/knockapi/resources/channels/bulk_test.rb b/test/knockapi/resources/channels/bulk_test.rb index 6acdfdb7..900caf3b 100644 --- a/test/knockapi/resources/channels/bulk_test.rb +++ b/test/knockapi/resources/channels/bulk_test.rb @@ -11,7 +11,7 @@ def test_update_message_status response = @knock.channels.bulk.update_message_status("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", :seen) assert_pattern do - response => Knockapi::Models::BulkOperation + response => Knockapi::BulkOperation end assert_pattern do @@ -22,12 +22,12 @@ def test_update_message_status inserted_at: Time, name: String, processed_rows: Integer, - status: Knockapi::Models::BulkOperation::Status, + status: Knockapi::BulkOperation::Status, success_count: Integer, updated_at: Time, completed_at: Time | nil, error_count: Integer | nil, - error_items: ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::BulkOperation::ErrorItem]) | nil, + error_items: ^(Knockapi::Internal::Type::ArrayOf[Knockapi::BulkOperation::ErrorItem]) | nil, failed_at: Time | nil, progress_path: String | nil, started_at: Time | nil diff --git a/test/knockapi/resources/messages/activities_test.rb b/test/knockapi/resources/messages/activities_test.rb deleted file mode 100644 index 41b99927..00000000 --- a/test/knockapi/resources/messages/activities_test.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true - -require_relative "../../test_helper" - -class Knockapi::Test::Resources::Messages::ActivitiesTest < Knockapi::Test::ResourceTest - def test_list - skip( - "skipped: currently no good way to test endpoints defining callbacks, Prism mock server will fail trying to reach the provided callback url" - ) - - response = @knock.messages.activities.list("message_id") - - assert_pattern do - response => Knockapi::Internal::ItemsCursor - end - - row = response.to_enum.first - return if row.nil? - - assert_pattern do - row => Knockapi::Models::Activity - end - - assert_pattern do - row => { - id: String | nil, - _typename: String | nil, - actor: Knockapi::Models::Recipient | nil, - data: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, - inserted_at: Time | nil, - recipient: Knockapi::Models::Recipient | nil, - updated_at: Time | nil - } - end - end -end diff --git a/test/knockapi/resources/messages/batch_test.rb b/test/knockapi/resources/messages/batch_test.rb index 3f5bbf93..72288a67 100644 --- a/test/knockapi/resources/messages/batch_test.rb +++ b/test/knockapi/resources/messages/batch_test.rb @@ -17,7 +17,7 @@ def test_archive_required_params ) assert_pattern do - response => ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Message]) + response => ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Message]) end end @@ -41,7 +41,7 @@ def test_mark_as_interacted_required_params response = @knock.messages.batch.mark_as_interacted(message_ids: ["1jNaXzB2RZX3LY8wVQnfCKyPnv7"]) assert_pattern do - response => ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Message]) + response => ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Message]) end end @@ -56,7 +56,7 @@ def test_mark_as_read_required_params ) assert_pattern do - response => ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Message]) + response => ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Message]) end end @@ -71,7 +71,7 @@ def test_mark_as_seen_required_params ) assert_pattern do - response => ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Message]) + response => ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Message]) end end @@ -86,7 +86,7 @@ def test_mark_as_unread_required_params ) assert_pattern do - response => ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Message]) + response => ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Message]) end end @@ -101,7 +101,7 @@ def test_mark_as_unseen_required_params ) assert_pattern do - response => ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Message]) + response => ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Message]) end end @@ -116,7 +116,7 @@ def test_unarchive_required_params ) assert_pattern do - response => ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Message]) + response => ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Message]) end end end diff --git a/test/knockapi/resources/messages_test.rb b/test/knockapi/resources/messages_test.rb index f1c8fc70..13e5522f 100644 --- a/test/knockapi/resources/messages_test.rb +++ b/test/knockapi/resources/messages_test.rb @@ -18,29 +18,29 @@ def test_list return if row.nil? assert_pattern do - row => Knockapi::Models::Message + row => Knockapi::Message end assert_pattern do row => { id: String | nil, _typename: String | nil, - actors: ^(Knockapi::Internal::Type::ArrayOf[union: Knockapi::Models::RecipientReference]) | nil, + actors: ^(Knockapi::Internal::Type::ArrayOf[union: Knockapi::RecipientReference]) | nil, archived_at: Time | nil, channel_id: String | nil, clicked_at: Time | nil, data: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, - engagement_statuses: ^(Knockapi::Internal::Type::ArrayOf[enum: Knockapi::Models::Message::EngagementStatus]) | nil, + engagement_statuses: ^(Knockapi::Internal::Type::ArrayOf[enum: Knockapi::Message::EngagementStatus]) | nil, inserted_at: Time | nil, interacted_at: Time | nil, link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, - recipient: Knockapi::Models::RecipientReference | nil, + recipient: Knockapi::RecipientReference | nil, scheduled_at: Time | nil, seen_at: Time | nil, - source: Knockapi::Models::Message::Source | nil, - status: Knockapi::Models::Message::Status | nil, + source: Knockapi::Message::Source | nil, + status: Knockapi::Message::Status | nil, tenant: String | nil, updated_at: Time | nil, workflow: String | nil @@ -56,29 +56,29 @@ def test_archive response = @knock.messages.archive("message_id") assert_pattern do - response => Knockapi::Models::Message + response => Knockapi::Message end assert_pattern do response => { id: String | nil, _typename: String | nil, - actors: ^(Knockapi::Internal::Type::ArrayOf[union: Knockapi::Models::RecipientReference]) | nil, + actors: ^(Knockapi::Internal::Type::ArrayOf[union: Knockapi::RecipientReference]) | nil, archived_at: Time | nil, channel_id: String | nil, clicked_at: Time | nil, data: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, - engagement_statuses: ^(Knockapi::Internal::Type::ArrayOf[enum: Knockapi::Models::Message::EngagementStatus]) | nil, + engagement_statuses: ^(Knockapi::Internal::Type::ArrayOf[enum: Knockapi::Message::EngagementStatus]) | nil, inserted_at: Time | nil, interacted_at: Time | nil, link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, - recipient: Knockapi::Models::RecipientReference | nil, + recipient: Knockapi::RecipientReference | nil, scheduled_at: Time | nil, seen_at: Time | nil, - source: Knockapi::Models::Message::Source | nil, - status: Knockapi::Models::Message::Status | nil, + source: Knockapi::Message::Source | nil, + status: Knockapi::Message::Status | nil, tenant: String | nil, updated_at: Time | nil, workflow: String | nil @@ -94,29 +94,29 @@ def test_get response = @knock.messages.get("message_id") assert_pattern do - response => Knockapi::Models::Message + response => Knockapi::Message end assert_pattern do response => { id: String | nil, _typename: String | nil, - actors: ^(Knockapi::Internal::Type::ArrayOf[union: Knockapi::Models::RecipientReference]) | nil, + actors: ^(Knockapi::Internal::Type::ArrayOf[union: Knockapi::RecipientReference]) | nil, archived_at: Time | nil, channel_id: String | nil, clicked_at: Time | nil, data: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, - engagement_statuses: ^(Knockapi::Internal::Type::ArrayOf[enum: Knockapi::Models::Message::EngagementStatus]) | nil, + engagement_statuses: ^(Knockapi::Internal::Type::ArrayOf[enum: Knockapi::Message::EngagementStatus]) | nil, inserted_at: Time | nil, interacted_at: Time | nil, link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, - recipient: Knockapi::Models::RecipientReference | nil, + recipient: Knockapi::RecipientReference | nil, scheduled_at: Time | nil, seen_at: Time | nil, - source: Knockapi::Models::Message::Source | nil, - status: Knockapi::Models::Message::Status | nil, + source: Knockapi::Message::Source | nil, + status: Knockapi::Message::Status | nil, tenant: String | nil, updated_at: Time | nil, workflow: String | nil @@ -160,17 +160,17 @@ def test_list_activities return if row.nil? assert_pattern do - row => Knockapi::Models::Activity + row => Knockapi::Activity end assert_pattern do row => { id: String | nil, _typename: String | nil, - actor: Knockapi::Models::Recipient | nil, + actor: Knockapi::Recipient | nil, data: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, inserted_at: Time | nil, - recipient: Knockapi::Models::Recipient | nil, + recipient: Knockapi::Recipient | nil, updated_at: Time | nil } end @@ -191,7 +191,7 @@ def test_list_delivery_logs return if row.nil? assert_pattern do - row => Knockapi::Models::MessageDeliveryLog + row => Knockapi::MessageDeliveryLog end assert_pattern do @@ -200,8 +200,8 @@ def test_list_delivery_logs _typename: String, environment_id: String, inserted_at: String, - request: Knockapi::Models::MessageDeliveryLog::Request, - response: Knockapi::Models::MessageDeliveryLog::Response, + request: Knockapi::MessageDeliveryLog::Request, + response: Knockapi::MessageDeliveryLog::Response, service_name: String } end @@ -222,7 +222,7 @@ def test_list_events return if row.nil? assert_pattern do - row => Knockapi::Models::MessageEvent + row => Knockapi::MessageEvent end assert_pattern do @@ -230,8 +230,8 @@ def test_list_events id: String, _typename: String, inserted_at: Time, - recipient: Knockapi::Models::RecipientReference, - type: Knockapi::Models::MessageEvent::Type, + recipient: Knockapi::RecipientReference, + type: Knockapi::MessageEvent::Type, data: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil } end @@ -245,29 +245,29 @@ def test_mark_as_interacted response = @knock.messages.mark_as_interacted("message_id") assert_pattern do - response => Knockapi::Models::Message + response => Knockapi::Message end assert_pattern do response => { id: String | nil, _typename: String | nil, - actors: ^(Knockapi::Internal::Type::ArrayOf[union: Knockapi::Models::RecipientReference]) | nil, + actors: ^(Knockapi::Internal::Type::ArrayOf[union: Knockapi::RecipientReference]) | nil, archived_at: Time | nil, channel_id: String | nil, clicked_at: Time | nil, data: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, - engagement_statuses: ^(Knockapi::Internal::Type::ArrayOf[enum: Knockapi::Models::Message::EngagementStatus]) | nil, + engagement_statuses: ^(Knockapi::Internal::Type::ArrayOf[enum: Knockapi::Message::EngagementStatus]) | nil, inserted_at: Time | nil, interacted_at: Time | nil, link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, - recipient: Knockapi::Models::RecipientReference | nil, + recipient: Knockapi::RecipientReference | nil, scheduled_at: Time | nil, seen_at: Time | nil, - source: Knockapi::Models::Message::Source | nil, - status: Knockapi::Models::Message::Status | nil, + source: Knockapi::Message::Source | nil, + status: Knockapi::Message::Status | nil, tenant: String | nil, updated_at: Time | nil, workflow: String | nil @@ -283,29 +283,29 @@ def test_mark_as_read response = @knock.messages.mark_as_read("message_id") assert_pattern do - response => Knockapi::Models::Message + response => Knockapi::Message end assert_pattern do response => { id: String | nil, _typename: String | nil, - actors: ^(Knockapi::Internal::Type::ArrayOf[union: Knockapi::Models::RecipientReference]) | nil, + actors: ^(Knockapi::Internal::Type::ArrayOf[union: Knockapi::RecipientReference]) | nil, archived_at: Time | nil, channel_id: String | nil, clicked_at: Time | nil, data: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, - engagement_statuses: ^(Knockapi::Internal::Type::ArrayOf[enum: Knockapi::Models::Message::EngagementStatus]) | nil, + engagement_statuses: ^(Knockapi::Internal::Type::ArrayOf[enum: Knockapi::Message::EngagementStatus]) | nil, inserted_at: Time | nil, interacted_at: Time | nil, link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, - recipient: Knockapi::Models::RecipientReference | nil, + recipient: Knockapi::RecipientReference | nil, scheduled_at: Time | nil, seen_at: Time | nil, - source: Knockapi::Models::Message::Source | nil, - status: Knockapi::Models::Message::Status | nil, + source: Knockapi::Message::Source | nil, + status: Knockapi::Message::Status | nil, tenant: String | nil, updated_at: Time | nil, workflow: String | nil @@ -321,29 +321,29 @@ def test_mark_as_seen response = @knock.messages.mark_as_seen("message_id") assert_pattern do - response => Knockapi::Models::Message + response => Knockapi::Message end assert_pattern do response => { id: String | nil, _typename: String | nil, - actors: ^(Knockapi::Internal::Type::ArrayOf[union: Knockapi::Models::RecipientReference]) | nil, + actors: ^(Knockapi::Internal::Type::ArrayOf[union: Knockapi::RecipientReference]) | nil, archived_at: Time | nil, channel_id: String | nil, clicked_at: Time | nil, data: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, - engagement_statuses: ^(Knockapi::Internal::Type::ArrayOf[enum: Knockapi::Models::Message::EngagementStatus]) | nil, + engagement_statuses: ^(Knockapi::Internal::Type::ArrayOf[enum: Knockapi::Message::EngagementStatus]) | nil, inserted_at: Time | nil, interacted_at: Time | nil, link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, - recipient: Knockapi::Models::RecipientReference | nil, + recipient: Knockapi::RecipientReference | nil, scheduled_at: Time | nil, seen_at: Time | nil, - source: Knockapi::Models::Message::Source | nil, - status: Knockapi::Models::Message::Status | nil, + source: Knockapi::Message::Source | nil, + status: Knockapi::Message::Status | nil, tenant: String | nil, updated_at: Time | nil, workflow: String | nil @@ -359,29 +359,29 @@ def test_mark_as_unread response = @knock.messages.mark_as_unread("message_id") assert_pattern do - response => Knockapi::Models::Message + response => Knockapi::Message end assert_pattern do response => { id: String | nil, _typename: String | nil, - actors: ^(Knockapi::Internal::Type::ArrayOf[union: Knockapi::Models::RecipientReference]) | nil, + actors: ^(Knockapi::Internal::Type::ArrayOf[union: Knockapi::RecipientReference]) | nil, archived_at: Time | nil, channel_id: String | nil, clicked_at: Time | nil, data: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, - engagement_statuses: ^(Knockapi::Internal::Type::ArrayOf[enum: Knockapi::Models::Message::EngagementStatus]) | nil, + engagement_statuses: ^(Knockapi::Internal::Type::ArrayOf[enum: Knockapi::Message::EngagementStatus]) | nil, inserted_at: Time | nil, interacted_at: Time | nil, link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, - recipient: Knockapi::Models::RecipientReference | nil, + recipient: Knockapi::RecipientReference | nil, scheduled_at: Time | nil, seen_at: Time | nil, - source: Knockapi::Models::Message::Source | nil, - status: Knockapi::Models::Message::Status | nil, + source: Knockapi::Message::Source | nil, + status: Knockapi::Message::Status | nil, tenant: String | nil, updated_at: Time | nil, workflow: String | nil @@ -397,29 +397,29 @@ def test_mark_as_unseen response = @knock.messages.mark_as_unseen("message_id") assert_pattern do - response => Knockapi::Models::Message + response => Knockapi::Message end assert_pattern do response => { id: String | nil, _typename: String | nil, - actors: ^(Knockapi::Internal::Type::ArrayOf[union: Knockapi::Models::RecipientReference]) | nil, + actors: ^(Knockapi::Internal::Type::ArrayOf[union: Knockapi::RecipientReference]) | nil, archived_at: Time | nil, channel_id: String | nil, clicked_at: Time | nil, data: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, - engagement_statuses: ^(Knockapi::Internal::Type::ArrayOf[enum: Knockapi::Models::Message::EngagementStatus]) | nil, + engagement_statuses: ^(Knockapi::Internal::Type::ArrayOf[enum: Knockapi::Message::EngagementStatus]) | nil, inserted_at: Time | nil, interacted_at: Time | nil, link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, - recipient: Knockapi::Models::RecipientReference | nil, + recipient: Knockapi::RecipientReference | nil, scheduled_at: Time | nil, seen_at: Time | nil, - source: Knockapi::Models::Message::Source | nil, - status: Knockapi::Models::Message::Status | nil, + source: Knockapi::Message::Source | nil, + status: Knockapi::Message::Status | nil, tenant: String | nil, updated_at: Time | nil, workflow: String | nil @@ -435,29 +435,29 @@ def test_unarchive response = @knock.messages.unarchive("message_id") assert_pattern do - response => Knockapi::Models::Message + response => Knockapi::Message end assert_pattern do response => { id: String | nil, _typename: String | nil, - actors: ^(Knockapi::Internal::Type::ArrayOf[union: Knockapi::Models::RecipientReference]) | nil, + actors: ^(Knockapi::Internal::Type::ArrayOf[union: Knockapi::RecipientReference]) | nil, archived_at: Time | nil, channel_id: String | nil, clicked_at: Time | nil, data: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, - engagement_statuses: ^(Knockapi::Internal::Type::ArrayOf[enum: Knockapi::Models::Message::EngagementStatus]) | nil, + engagement_statuses: ^(Knockapi::Internal::Type::ArrayOf[enum: Knockapi::Message::EngagementStatus]) | nil, inserted_at: Time | nil, interacted_at: Time | nil, link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, - recipient: Knockapi::Models::RecipientReference | nil, + recipient: Knockapi::RecipientReference | nil, scheduled_at: Time | nil, seen_at: Time | nil, - source: Knockapi::Models::Message::Source | nil, - status: Knockapi::Models::Message::Status | nil, + source: Knockapi::Message::Source | nil, + status: Knockapi::Message::Status | nil, tenant: String | nil, updated_at: Time | nil, workflow: String | nil diff --git a/test/knockapi/resources/objects/bulk_test.rb b/test/knockapi/resources/objects/bulk_test.rb index bfd823a9..c15220dd 100644 --- a/test/knockapi/resources/objects/bulk_test.rb +++ b/test/knockapi/resources/objects/bulk_test.rb @@ -11,7 +11,7 @@ def test_delete_required_params response = @knock.objects.bulk.delete("collection", object_ids: %w[obj_123 obj_456 obj_789]) assert_pattern do - response => Knockapi::Models::BulkOperation + response => Knockapi::BulkOperation end assert_pattern do @@ -22,12 +22,12 @@ def test_delete_required_params inserted_at: Time, name: String, processed_rows: Integer, - status: Knockapi::Models::BulkOperation::Status, + status: Knockapi::BulkOperation::Status, success_count: Integer, updated_at: Time, completed_at: Time | nil, error_count: Integer | nil, - error_items: ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::BulkOperation::ErrorItem]) | nil, + error_items: ^(Knockapi::Internal::Type::ArrayOf[Knockapi::BulkOperation::ErrorItem]) | nil, failed_at: Time | nil, progress_path: String | nil, started_at: Time | nil @@ -44,7 +44,7 @@ def test_add_subscriptions_required_params @knock.objects.bulk.add_subscriptions("collection", subscriptions: [{recipients: [{id: "user_1"}]}]) assert_pattern do - response => Knockapi::Models::BulkOperation + response => Knockapi::BulkOperation end assert_pattern do @@ -55,12 +55,12 @@ def test_add_subscriptions_required_params inserted_at: Time, name: String, processed_rows: Integer, - status: Knockapi::Models::BulkOperation::Status, + status: Knockapi::BulkOperation::Status, success_count: Integer, updated_at: Time, completed_at: Time | nil, error_count: Integer | nil, - error_items: ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::BulkOperation::ErrorItem]) | nil, + error_items: ^(Knockapi::Internal::Type::ArrayOf[Knockapi::BulkOperation::ErrorItem]) | nil, failed_at: Time | nil, progress_path: String | nil, started_at: Time | nil @@ -76,7 +76,7 @@ def test_set_required_params response = @knock.objects.bulk.set("collection", objects: [{id: "project_1", collection: "projects"}]) assert_pattern do - response => Knockapi::Models::BulkOperation + response => Knockapi::BulkOperation end assert_pattern do @@ -87,12 +87,12 @@ def test_set_required_params inserted_at: Time, name: String, processed_rows: Integer, - status: Knockapi::Models::BulkOperation::Status, + status: Knockapi::BulkOperation::Status, success_count: Integer, updated_at: Time, completed_at: Time | nil, error_count: Integer | nil, - error_items: ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::BulkOperation::ErrorItem]) | nil, + error_items: ^(Knockapi::Internal::Type::ArrayOf[Knockapi::BulkOperation::ErrorItem]) | nil, failed_at: Time | nil, progress_path: String | nil, started_at: Time | nil diff --git a/test/knockapi/resources/objects_test.rb b/test/knockapi/resources/objects_test.rb index 0354eea7..bd2c4313 100644 --- a/test/knockapi/resources/objects_test.rb +++ b/test/knockapi/resources/objects_test.rb @@ -18,7 +18,7 @@ def test_list return if row.nil? assert_pattern do - row => Knockapi::Models::Object + row => Knockapi::Object end assert_pattern do @@ -27,7 +27,8 @@ def test_list _typename: String, collection: String, updated_at: Time, - created_at: Time | nil + created_at: Time | nil, + properties: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil } end end @@ -52,7 +53,7 @@ def test_add_subscriptions_required_params response = @knock.objects.add_subscriptions("collection", "object_id", recipients: %w[user_1 user_2]) assert_pattern do - response => ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Recipients::Subscription]) + response => ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Recipients::Subscription]) end end @@ -64,7 +65,7 @@ def test_delete_subscriptions_required_params response = @knock.objects.delete_subscriptions("collection", "object_id", recipients: ["user_123"]) assert_pattern do - response => ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Recipients::Subscription]) + response => ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Recipients::Subscription]) end end @@ -76,7 +77,7 @@ def test_get response = @knock.objects.get("collection", "id") assert_pattern do - response => Knockapi::Models::Object + response => Knockapi::Object end assert_pattern do @@ -85,7 +86,8 @@ def test_get _typename: String, collection: String, updated_at: Time, - created_at: Time | nil + created_at: Time | nil, + properties: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil } end end @@ -99,15 +101,15 @@ def test_get_channel_data @knock.objects.get_channel_data("collection", "object_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assert_pattern do - response => Knockapi::Models::Recipients::RecipientsChannelData + response => Knockapi::Recipients::RecipientsChannelData end assert_pattern do response => { _typename: String, channel_id: String, - data: Knockapi::Models::Recipients::RecipientsChannelData::Data, - provider: Knockapi::Models::Recipients::RecipientsChannelData::Provider | nil + data: Knockapi::Recipients::RecipientsChannelData::Data, + provider: Knockapi::Recipients::RecipientsChannelData::Provider | nil } end end @@ -120,15 +122,15 @@ def test_get_preferences response = @knock.objects.get_preferences("collection", "object_id", "default") assert_pattern do - response => Knockapi::Models::Recipients::PreferenceSet + response => Knockapi::Recipients::PreferenceSet end assert_pattern do response => { id: String, - categories: ^(Knockapi::Internal::Type::HashOf[union: Knockapi::Models::Recipients::PreferenceSet::Category]) | nil, - channel_types: Knockapi::Models::Recipients::PreferenceSetChannelTypes | nil, - workflows: ^(Knockapi::Internal::Type::HashOf[union: Knockapi::Models::Recipients::PreferenceSet::Workflow]) | nil + categories: ^(Knockapi::Internal::Type::HashOf[union: Knockapi::Recipients::PreferenceSet::Category]) | nil, + channel_types: Knockapi::Recipients::PreferenceSetChannelTypes | nil, + workflows: ^(Knockapi::Internal::Type::HashOf[union: Knockapi::Recipients::PreferenceSet::Workflow]) | nil } end end @@ -148,29 +150,29 @@ def test_list_messages return if row.nil? assert_pattern do - row => Knockapi::Models::Message + row => Knockapi::Message end assert_pattern do row => { id: String | nil, _typename: String | nil, - actors: ^(Knockapi::Internal::Type::ArrayOf[union: Knockapi::Models::RecipientReference]) | nil, + actors: ^(Knockapi::Internal::Type::ArrayOf[union: Knockapi::RecipientReference]) | nil, archived_at: Time | nil, channel_id: String | nil, clicked_at: Time | nil, data: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, - engagement_statuses: ^(Knockapi::Internal::Type::ArrayOf[enum: Knockapi::Models::Message::EngagementStatus]) | nil, + engagement_statuses: ^(Knockapi::Internal::Type::ArrayOf[enum: Knockapi::Message::EngagementStatus]) | nil, inserted_at: Time | nil, interacted_at: Time | nil, link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, - recipient: Knockapi::Models::RecipientReference | nil, + recipient: Knockapi::RecipientReference | nil, scheduled_at: Time | nil, seen_at: Time | nil, - source: Knockapi::Models::Message::Source | nil, - status: Knockapi::Models::Message::Status | nil, + source: Knockapi::Message::Source | nil, + status: Knockapi::Message::Status | nil, tenant: String | nil, updated_at: Time | nil, workflow: String | nil @@ -186,7 +188,7 @@ def test_list_preferences response = @knock.objects.list_preferences("collection", "object_id") assert_pattern do - response => ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Recipients::PreferenceSet]) + response => ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Recipients::PreferenceSet]) end end @@ -205,19 +207,19 @@ def test_list_schedules return if row.nil? assert_pattern do - row => Knockapi::Models::Schedule + row => Knockapi::Schedule end assert_pattern do row => { id: String, inserted_at: Time, - recipient: Knockapi::Models::Recipient, - repeats: ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::ScheduleRepeatRule]), + recipient: Knockapi::Recipient, + repeats: ^(Knockapi::Internal::Type::ArrayOf[Knockapi::ScheduleRepeatRule]), updated_at: Time, workflow: String, _typename: String | nil, - actor: Knockapi::Models::Recipient | nil, + actor: Knockapi::Recipient | nil, data: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, last_occurrence_at: Time | nil, next_occurrence_at: Time | nil, @@ -241,15 +243,15 @@ def test_list_subscriptions return if row.nil? assert_pattern do - row => Knockapi::Models::Recipients::Subscription + row => Knockapi::Recipients::Subscription end assert_pattern do row => { _typename: String, inserted_at: Time, - object: Knockapi::Models::Object, - recipient: Knockapi::Models::Recipient, + object: Knockapi::Object, + recipient: Knockapi::Recipient, updated_at: Time, properties: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil } @@ -264,7 +266,7 @@ def test_set response = @knock.objects.set("collection", "id") assert_pattern do - response => Knockapi::Models::Object + response => Knockapi::Object end assert_pattern do @@ -273,7 +275,8 @@ def test_set _typename: String, collection: String, updated_at: Time, - created_at: Time | nil + created_at: Time | nil, + properties: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil } end end @@ -292,15 +295,15 @@ def test_set_channel_data_required_params ) assert_pattern do - response => Knockapi::Models::Recipients::RecipientsChannelData + response => Knockapi::Recipients::RecipientsChannelData end assert_pattern do response => { _typename: String, channel_id: String, - data: Knockapi::Models::Recipients::RecipientsChannelData::Data, - provider: Knockapi::Models::Recipients::RecipientsChannelData::Provider | nil + data: Knockapi::Recipients::RecipientsChannelData::Data, + provider: Knockapi::Recipients::RecipientsChannelData::Provider | nil } end end @@ -313,15 +316,15 @@ def test_set_preferences response = @knock.objects.set_preferences("collection", "object_id", "default") assert_pattern do - response => Knockapi::Models::Recipients::PreferenceSet + response => Knockapi::Recipients::PreferenceSet end assert_pattern do response => { id: String, - categories: ^(Knockapi::Internal::Type::HashOf[union: Knockapi::Models::Recipients::PreferenceSet::Category]) | nil, - channel_types: Knockapi::Models::Recipients::PreferenceSetChannelTypes | nil, - workflows: ^(Knockapi::Internal::Type::HashOf[union: Knockapi::Models::Recipients::PreferenceSet::Workflow]) | nil + categories: ^(Knockapi::Internal::Type::HashOf[union: Knockapi::Recipients::PreferenceSet::Category]) | nil, + channel_types: Knockapi::Recipients::PreferenceSetChannelTypes | nil, + workflows: ^(Knockapi::Internal::Type::HashOf[union: Knockapi::Recipients::PreferenceSet::Workflow]) | nil } end end diff --git a/test/knockapi/resources/schedules/bulk_test.rb b/test/knockapi/resources/schedules/bulk_test.rb index f8429e0c..9d23f3a1 100644 --- a/test/knockapi/resources/schedules/bulk_test.rb +++ b/test/knockapi/resources/schedules/bulk_test.rb @@ -12,7 +12,7 @@ def test_create_required_params @knock.schedules.bulk.create(schedules: [{workflow: "comment-created"}, {workflow: "comment-created"}]) assert_pattern do - response => Knockapi::Models::BulkOperation + response => Knockapi::BulkOperation end assert_pattern do @@ -23,12 +23,12 @@ def test_create_required_params inserted_at: Time, name: String, processed_rows: Integer, - status: Knockapi::Models::BulkOperation::Status, + status: Knockapi::BulkOperation::Status, success_count: Integer, updated_at: Time, completed_at: Time | nil, error_count: Integer | nil, - error_items: ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::BulkOperation::ErrorItem]) | nil, + error_items: ^(Knockapi::Internal::Type::ArrayOf[Knockapi::BulkOperation::ErrorItem]) | nil, failed_at: Time | nil, progress_path: String | nil, started_at: Time | nil diff --git a/test/knockapi/resources/schedules_test.rb b/test/knockapi/resources/schedules_test.rb index 76c5f6c6..c7bec6f4 100644 --- a/test/knockapi/resources/schedules_test.rb +++ b/test/knockapi/resources/schedules_test.rb @@ -16,7 +16,7 @@ def test_create_required_params ) assert_pattern do - response => ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Schedule]) + response => ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Schedule]) end end @@ -28,7 +28,7 @@ def test_update_required_params response = @knock.schedules.update(schedule_ids: ["123e4567-e89b-12d3-a456-426614174000"]) assert_pattern do - response => ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Schedule]) + response => ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Schedule]) end end @@ -47,19 +47,19 @@ def test_list_required_params return if row.nil? assert_pattern do - row => Knockapi::Models::Schedule + row => Knockapi::Schedule end assert_pattern do row => { id: String, inserted_at: Time, - recipient: Knockapi::Models::Recipient, - repeats: ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::ScheduleRepeatRule]), + recipient: Knockapi::Recipient, + repeats: ^(Knockapi::Internal::Type::ArrayOf[Knockapi::ScheduleRepeatRule]), updated_at: Time, workflow: String, _typename: String | nil, - actor: Knockapi::Models::Recipient | nil, + actor: Knockapi::Recipient | nil, data: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, last_occurrence_at: Time | nil, next_occurrence_at: Time | nil, @@ -76,7 +76,7 @@ def test_delete_required_params response = @knock.schedules.delete(schedule_ids: ["123e4567-e89b-12d3-a456-426614174000"]) assert_pattern do - response => ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Schedule]) + response => ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Schedule]) end end end diff --git a/test/knockapi/resources/tenants/bulk_test.rb b/test/knockapi/resources/tenants/bulk_test.rb index 4cff8fbf..fb03dcd0 100644 --- a/test/knockapi/resources/tenants/bulk_test.rb +++ b/test/knockapi/resources/tenants/bulk_test.rb @@ -11,7 +11,7 @@ def test_delete_required_params response = @knock.tenants.bulk.delete(tenant_ids: ["string"]) assert_pattern do - response => Knockapi::Models::BulkOperation + response => Knockapi::BulkOperation end assert_pattern do @@ -22,12 +22,12 @@ def test_delete_required_params inserted_at: Time, name: String, processed_rows: Integer, - status: Knockapi::Models::BulkOperation::Status, + status: Knockapi::BulkOperation::Status, success_count: Integer, updated_at: Time, completed_at: Time | nil, error_count: Integer | nil, - error_items: ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::BulkOperation::ErrorItem]) | nil, + error_items: ^(Knockapi::Internal::Type::ArrayOf[Knockapi::BulkOperation::ErrorItem]) | nil, failed_at: Time | nil, progress_path: String | nil, started_at: Time | nil @@ -43,7 +43,7 @@ def test_set_required_params response = @knock.tenants.bulk.set(tenants: ["string"]) assert_pattern do - response => Knockapi::Models::BulkOperation + response => Knockapi::BulkOperation end assert_pattern do @@ -54,12 +54,12 @@ def test_set_required_params inserted_at: Time, name: String, processed_rows: Integer, - status: Knockapi::Models::BulkOperation::Status, + status: Knockapi::BulkOperation::Status, success_count: Integer, updated_at: Time, completed_at: Time | nil, error_count: Integer | nil, - error_items: ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::BulkOperation::ErrorItem]) | nil, + error_items: ^(Knockapi::Internal::Type::ArrayOf[Knockapi::BulkOperation::ErrorItem]) | nil, failed_at: Time | nil, progress_path: String | nil, started_at: Time | nil diff --git a/test/knockapi/resources/tenants_test.rb b/test/knockapi/resources/tenants_test.rb index 64e67e76..b44041b7 100644 --- a/test/knockapi/resources/tenants_test.rb +++ b/test/knockapi/resources/tenants_test.rb @@ -18,7 +18,7 @@ def test_list return if row.nil? assert_pattern do - row => Knockapi::Models::Tenant + row => Knockapi::Tenant end assert_pattern do @@ -26,7 +26,7 @@ def test_list id: String, _typename: String, name: String | nil, - settings: Knockapi::Models::Tenant::Settings | nil + settings: Knockapi::Tenant::Settings | nil } end end @@ -51,7 +51,7 @@ def test_get response = @knock.tenants.get("id") assert_pattern do - response => Knockapi::Models::Tenant + response => Knockapi::Tenant end assert_pattern do @@ -59,7 +59,7 @@ def test_get id: String, _typename: String, name: String | nil, - settings: Knockapi::Models::Tenant::Settings | nil + settings: Knockapi::Tenant::Settings | nil } end end @@ -72,7 +72,7 @@ def test_set response = @knock.tenants.set("id") assert_pattern do - response => Knockapi::Models::Tenant + response => Knockapi::Tenant end assert_pattern do @@ -80,7 +80,7 @@ def test_set id: String, _typename: String, name: String | nil, - settings: Knockapi::Models::Tenant::Settings | nil + settings: Knockapi::Tenant::Settings | nil } end end diff --git a/test/knockapi/resources/users/bulk_test.rb b/test/knockapi/resources/users/bulk_test.rb index 8bb8c8ff..de256811 100644 --- a/test/knockapi/resources/users/bulk_test.rb +++ b/test/knockapi/resources/users/bulk_test.rb @@ -11,7 +11,7 @@ def test_delete_required_params response = @knock.users.bulk.delete(user_ids: %w[user_1 user_2]) assert_pattern do - response => Knockapi::Models::BulkOperation + response => Knockapi::BulkOperation end assert_pattern do @@ -22,12 +22,12 @@ def test_delete_required_params inserted_at: Time, name: String, processed_rows: Integer, - status: Knockapi::Models::BulkOperation::Status, + status: Knockapi::BulkOperation::Status, success_count: Integer, updated_at: Time, completed_at: Time | nil, error_count: Integer | nil, - error_items: ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::BulkOperation::ErrorItem]) | nil, + error_items: ^(Knockapi::Internal::Type::ArrayOf[Knockapi::BulkOperation::ErrorItem]) | nil, failed_at: Time | nil, progress_path: String | nil, started_at: Time | nil @@ -43,7 +43,7 @@ def test_identify_required_params response = @knock.users.bulk.identify(users: [{id: "user_1"}]) assert_pattern do - response => Knockapi::Models::BulkOperation + response => Knockapi::BulkOperation end assert_pattern do @@ -54,12 +54,12 @@ def test_identify_required_params inserted_at: Time, name: String, processed_rows: Integer, - status: Knockapi::Models::BulkOperation::Status, + status: Knockapi::BulkOperation::Status, success_count: Integer, updated_at: Time, completed_at: Time | nil, error_count: Integer | nil, - error_items: ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::BulkOperation::ErrorItem]) | nil, + error_items: ^(Knockapi::Internal::Type::ArrayOf[Knockapi::BulkOperation::ErrorItem]) | nil, failed_at: Time | nil, progress_path: String | nil, started_at: Time | nil @@ -75,7 +75,7 @@ def test_set_preferences_required_params response = @knock.users.bulk.set_preferences(preferences: {}, user_ids: %w[user_1 user_2]) assert_pattern do - response => Knockapi::Models::BulkOperation + response => Knockapi::BulkOperation end assert_pattern do @@ -86,12 +86,12 @@ def test_set_preferences_required_params inserted_at: Time, name: String, processed_rows: Integer, - status: Knockapi::Models::BulkOperation::Status, + status: Knockapi::BulkOperation::Status, success_count: Integer, updated_at: Time, completed_at: Time | nil, error_count: Integer | nil, - error_items: ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::BulkOperation::ErrorItem]) | nil, + error_items: ^(Knockapi::Internal::Type::ArrayOf[Knockapi::BulkOperation::ErrorItem]) | nil, failed_at: Time | nil, progress_path: String | nil, started_at: Time | nil diff --git a/test/knockapi/resources/users/feeds_test.rb b/test/knockapi/resources/users/feeds_test.rb index 7bf7e7a6..1e7db46d 100644 --- a/test/knockapi/resources/users/feeds_test.rb +++ b/test/knockapi/resources/users/feeds_test.rb @@ -43,8 +43,8 @@ def test_list_items row => { id: String, _typename: String, - activities: ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Activity]), - actors: ^(Knockapi::Internal::Type::ArrayOf[union: Knockapi::Models::Recipient]), + activities: ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Activity]), + actors: ^(Knockapi::Internal::Type::ArrayOf[union: Knockapi::Recipient]), blocks: ^(Knockapi::Internal::Type::ArrayOf[union: Knockapi::Models::Users::FeedListItemsResponse::Block]), data: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, inserted_at: String, diff --git a/test/knockapi/resources/users_test.rb b/test/knockapi/resources/users_test.rb index bb885880..605b243f 100644 --- a/test/knockapi/resources/users_test.rb +++ b/test/knockapi/resources/users_test.rb @@ -11,7 +11,7 @@ def test_update response = @knock.users.update("user_id") assert_pattern do - response => Knockapi::Models::User + response => Knockapi::User end assert_pattern do @@ -44,7 +44,7 @@ def test_list return if row.nil? assert_pattern do - row => Knockapi::Models::User + row => Knockapi::User end assert_pattern do @@ -82,7 +82,7 @@ def test_get response = @knock.users.get("user_id") assert_pattern do - response => Knockapi::Models::User + response => Knockapi::User end assert_pattern do @@ -108,15 +108,15 @@ def test_get_channel_data response = @knock.users.get_channel_data("user_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assert_pattern do - response => Knockapi::Models::Recipients::RecipientsChannelData + response => Knockapi::Recipients::RecipientsChannelData end assert_pattern do response => { _typename: String, channel_id: String, - data: Knockapi::Models::Recipients::RecipientsChannelData::Data, - provider: Knockapi::Models::Recipients::RecipientsChannelData::Provider | nil + data: Knockapi::Recipients::RecipientsChannelData::Data, + provider: Knockapi::Recipients::RecipientsChannelData::Provider | nil } end end @@ -129,15 +129,15 @@ def test_get_preferences response = @knock.users.get_preferences("user_id", "default") assert_pattern do - response => Knockapi::Models::Recipients::PreferenceSet + response => Knockapi::Recipients::PreferenceSet end assert_pattern do response => { id: String, - categories: ^(Knockapi::Internal::Type::HashOf[union: Knockapi::Models::Recipients::PreferenceSet::Category]) | nil, - channel_types: Knockapi::Models::Recipients::PreferenceSetChannelTypes | nil, - workflows: ^(Knockapi::Internal::Type::HashOf[union: Knockapi::Models::Recipients::PreferenceSet::Workflow]) | nil + categories: ^(Knockapi::Internal::Type::HashOf[union: Knockapi::Recipients::PreferenceSet::Category]) | nil, + channel_types: Knockapi::Recipients::PreferenceSetChannelTypes | nil, + workflows: ^(Knockapi::Internal::Type::HashOf[union: Knockapi::Recipients::PreferenceSet::Workflow]) | nil } end end @@ -157,29 +157,29 @@ def test_list_messages return if row.nil? assert_pattern do - row => Knockapi::Models::Message + row => Knockapi::Message end assert_pattern do row => { id: String | nil, _typename: String | nil, - actors: ^(Knockapi::Internal::Type::ArrayOf[union: Knockapi::Models::RecipientReference]) | nil, + actors: ^(Knockapi::Internal::Type::ArrayOf[union: Knockapi::RecipientReference]) | nil, archived_at: Time | nil, channel_id: String | nil, clicked_at: Time | nil, data: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, - engagement_statuses: ^(Knockapi::Internal::Type::ArrayOf[enum: Knockapi::Models::Message::EngagementStatus]) | nil, + engagement_statuses: ^(Knockapi::Internal::Type::ArrayOf[enum: Knockapi::Message::EngagementStatus]) | nil, inserted_at: Time | nil, interacted_at: Time | nil, link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, - recipient: Knockapi::Models::RecipientReference | nil, + recipient: Knockapi::RecipientReference | nil, scheduled_at: Time | nil, seen_at: Time | nil, - source: Knockapi::Models::Message::Source | nil, - status: Knockapi::Models::Message::Status | nil, + source: Knockapi::Message::Source | nil, + status: Knockapi::Message::Status | nil, tenant: String | nil, updated_at: Time | nil, workflow: String | nil @@ -195,7 +195,7 @@ def test_list_preferences response = @knock.users.list_preferences("user_id") assert_pattern do - response => ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Recipients::PreferenceSet]) + response => ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Recipients::PreferenceSet]) end end @@ -214,19 +214,19 @@ def test_list_schedules return if row.nil? assert_pattern do - row => Knockapi::Models::Schedule + row => Knockapi::Schedule end assert_pattern do row => { id: String, inserted_at: Time, - recipient: Knockapi::Models::Recipient, - repeats: ^(Knockapi::Internal::Type::ArrayOf[Knockapi::Models::ScheduleRepeatRule]), + recipient: Knockapi::Recipient, + repeats: ^(Knockapi::Internal::Type::ArrayOf[Knockapi::ScheduleRepeatRule]), updated_at: Time, workflow: String, _typename: String | nil, - actor: Knockapi::Models::Recipient | nil, + actor: Knockapi::Recipient | nil, data: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, last_occurrence_at: Time | nil, next_occurrence_at: Time | nil, @@ -250,15 +250,15 @@ def test_list_subscriptions return if row.nil? assert_pattern do - row => Knockapi::Models::Recipients::Subscription + row => Knockapi::Recipients::Subscription end assert_pattern do row => { _typename: String, inserted_at: Time, - object: Knockapi::Models::Object, - recipient: Knockapi::Models::Recipient, + object: Knockapi::Object, + recipient: Knockapi::Recipient, updated_at: Time, properties: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil } @@ -273,7 +273,7 @@ def test_merge_required_params response = @knock.users.merge("user_id", from_user_id: "user_1") assert_pattern do - response => Knockapi::Models::User + response => Knockapi::User end assert_pattern do @@ -304,15 +304,15 @@ def test_set_channel_data_required_params ) assert_pattern do - response => Knockapi::Models::Recipients::RecipientsChannelData + response => Knockapi::Recipients::RecipientsChannelData end assert_pattern do response => { _typename: String, channel_id: String, - data: Knockapi::Models::Recipients::RecipientsChannelData::Data, - provider: Knockapi::Models::Recipients::RecipientsChannelData::Provider | nil + data: Knockapi::Recipients::RecipientsChannelData::Data, + provider: Knockapi::Recipients::RecipientsChannelData::Provider | nil } end end @@ -325,15 +325,15 @@ def test_set_preferences response = @knock.users.set_preferences("user_id", "default") assert_pattern do - response => Knockapi::Models::Recipients::PreferenceSet + response => Knockapi::Recipients::PreferenceSet end assert_pattern do response => { id: String, - categories: ^(Knockapi::Internal::Type::HashOf[union: Knockapi::Models::Recipients::PreferenceSet::Category]) | nil, - channel_types: Knockapi::Models::Recipients::PreferenceSetChannelTypes | nil, - workflows: ^(Knockapi::Internal::Type::HashOf[union: Knockapi::Models::Recipients::PreferenceSet::Workflow]) | nil + categories: ^(Knockapi::Internal::Type::HashOf[union: Knockapi::Recipients::PreferenceSet::Category]) | nil, + channel_types: Knockapi::Recipients::PreferenceSetChannelTypes | nil, + workflows: ^(Knockapi::Internal::Type::HashOf[union: Knockapi::Recipients::PreferenceSet::Workflow]) | nil } end end diff --git a/test/knockapi/test_helper.rb b/test/knockapi/test_helper.rb index c7a72151..3ff7931d 100644 --- a/test/knockapi/test_helper.rb +++ b/test/knockapi/test_helper.rb @@ -52,6 +52,12 @@ def initialize end end +module Minitest::Serial + def test_order = :random + + def run_one_method(...) = Minitest::Runnable.run_one_method(...) +end + class Minitest::Test include Minitest::Hooks