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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"generatorConfig": {
"moduleName": "CloudPDF"
},
"originGitCommit": "622018abaf6e4578d1f4d8377982c48b92c9ced3",
"originGitCommit": "3283147ded32fc15c426768f75557a4d95943d84",
"originGitCommitIsDirty": false,
"invokedBy": "ci",
"requestedVersion": "3.0.0.alpha.20",
"requestedVersion": "3.0.0.alpha.21",
"ciProvider": "github"
}
8 changes: 4 additions & 4 deletions cloudpdf-generation.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"language": "ruby",
"canonicalVersion": "3.0.0-next.20",
"sdkVersion": "3.0.0.alpha.20",
"canonicalVersion": "3.0.0-next.21",
"sdkVersion": "3.0.0.alpha.21",
"source": {
"repository": "embedpdf/embed-pdf-viewer",
"openapi": "cloudpdf/contract/openapi.json",
"openapiSha256": "47d739acb956ce8ba0c3990117e505be2e9406038d9e0cd1729608921a40b2d9",
"gitCommit": "622018abaf6e4578d1f4d8377982c48b92c9ced3",
"openapiSha256": "f85648401f5c683a32e2b50acc3d753df9f4ce06df8492e5d2b599beceb0e788",
"gitCommit": "3283147ded32fc15c426768f75557a4d95943d84",
"gitCommitIsDirty": false
},
"fern": {
Expand Down
49 changes: 49 additions & 0 deletions lib/CloudPDF/tenants/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,55 @@ def delete(request_options: {}, **params)
raise error_class.new(response.body, code: code)
end

# A feature names an installed module; any other id is a 400. A module route answers a tenant without its feature
# 403 FeatureNotEnabled, and one whose feature is stopped 402 FeatureStopped (details.feature, details.stopped).
# Other replicas apply a change within 30 seconds.
#
# @param request_options [Hash]
# @param params [CloudPDF::Tenants::Types::TenantsUpdateRequest]
# @option request_options [String] :base_url
# @option request_options [Hash{String => Object}] :additional_headers
# @option request_options [Hash{String => Object}] :additional_query_parameters
# @option request_options [Hash{String => Object}] :additional_body_parameters
# @option request_options [Integer] :timeout_in_seconds
# @option params [String] :tenant_id
#
# @example
# client.tenants.update(
# tenant_id: "tenantId",
# features: [{
# id: "id"
# }]
# )
#
# @return [CloudPDF::Types::TenantsUpdate200Response]
def update(request_options: {}, **params)
params = CloudPDF::Internal::Types::Utils.normalize_keys(params)
request_data = CloudPDF::Tenants::Types::TenantsUpdateRequest.new(params).to_h
non_body_param_names = %w[tenantId]
body = request_data.except(*non_body_param_names)

request = CloudPDF::Internal::JSON::Request.new(
base_url: request_options[:base_url],
method: "PATCH",
path: "v1/tenants/#{URI.encode_uri_component(params[:tenant_id].to_s)}",
body: body,
request_options: request_options
)
begin
response = @client.send(request)
rescue Net::HTTPRequestTimeout
raise CloudPDF::Errors::TimeoutError
end
code = response.code.to_i
if code.between?(200, 299)
(response.body.to_s.empty? ? nil : CloudPDF::Types::TenantsUpdate200Response.load(response.body))
else
error_class = CloudPDF::Errors::ResponseError.subclass_for_code(code)
raise error_class.new(response.body, code: code)
end
end

# @param request_options [Hash]
# @param params [Hash]
# @option request_options [String] :base_url
Expand Down
13 changes: 13 additions & 0 deletions lib/CloudPDF/tenants/types/tenants_update_request.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

module CloudPDF
module Tenants
module Types
class TenantsUpdateRequest < Internal::Types::Model
field :tenant_id, -> { String }, optional: false, nullable: false, api_name: "tenantId"

field :features, -> { Internal::Types::Array[CloudPDF::Types::TenantFeature] }, optional: false, nullable: false
end
end
end
end
11 changes: 11 additions & 0 deletions lib/CloudPDF/types/tenant_feature.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

module CloudPDF
module Types
class TenantFeature < Internal::Types::Model
field :id, -> { String }, optional: false, nullable: false

field :stopped, -> { CloudPDF::Types::TenantFeatureStopped }, optional: true, nullable: false
end
end
end
11 changes: 11 additions & 0 deletions lib/CloudPDF/types/tenant_feature_stopped.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

module CloudPDF
module Types
module TenantFeatureStopped
extend CloudPDF::Internal::Types::Enum

CAP = "cap"
end
end
end
2 changes: 2 additions & 0 deletions lib/CloudPDF/types/tenants_create200response_tenant.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ class TenantsCreate200ResponseTenant < Internal::Types::Model

field :status, -> { CloudPDF::Types::TenantsCreate200ResponseTenantStatus }, optional: true, nullable: false

field :features, -> { Internal::Types::Array[CloudPDF::Types::TenantFeature] }, optional: true, nullable: false

field :created_at, -> { Integer }, optional: false, nullable: false, api_name: "createdAt"
end
end
Expand Down
2 changes: 2 additions & 0 deletions lib/CloudPDF/types/tenants_get200response_tenant.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ class TenantsGet200ResponseTenant < Internal::Types::Model

field :status, -> { CloudPDF::Types::TenantsGet200ResponseTenantStatus }, optional: true, nullable: false

field :features, -> { Internal::Types::Array[CloudPDF::Types::TenantFeature] }, optional: true, nullable: false

field :created_at, -> { Integer }, optional: false, nullable: false, api_name: "createdAt"
end
end
Expand Down
2 changes: 2 additions & 0 deletions lib/CloudPDF/types/tenants_list200response_tenants_item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ class TenantsList200ResponseTenantsItem < Internal::Types::Model

field :status, -> { CloudPDF::Types::TenantsList200ResponseTenantsItemStatus }, optional: true, nullable: false

field :features, -> { Internal::Types::Array[CloudPDF::Types::TenantFeature] }, optional: true, nullable: false

field :created_at, -> { Integer }, optional: false, nullable: false, api_name: "createdAt"
end
end
Expand Down
9 changes: 9 additions & 0 deletions lib/CloudPDF/types/tenants_update200response.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

module CloudPDF
module Types
class TenantsUpdate200Response < Internal::Types::Model
field :tenant, -> { CloudPDF::Types::TenantsUpdate200ResponseTenant }, optional: false, nullable: false
end
end
end
19 changes: 19 additions & 0 deletions lib/CloudPDF/types/tenants_update200response_tenant.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# frozen_string_literal: true

module CloudPDF
module Types
class TenantsUpdate200ResponseTenant < Internal::Types::Model
field :id, -> { String }, optional: false, nullable: false

field :name, -> { String }, optional: false, nullable: false

field :auto_provisioned, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "autoProvisioned"

field :status, -> { CloudPDF::Types::TenantsUpdate200ResponseTenantStatus }, optional: true, nullable: false

field :features, -> { Internal::Types::Array[CloudPDF::Types::TenantFeature] }, optional: true, nullable: false

field :created_at, -> { Integer }, optional: false, nullable: false, api_name: "createdAt"
end
end
end
12 changes: 12 additions & 0 deletions lib/CloudPDF/types/tenants_update200response_tenant_status.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

module CloudPDF
module Types
module TenantsUpdate200ResponseTenantStatus
extend CloudPDF::Internal::Types::Enum

ACTIVE = "active"
SUSPENDED = "suspended"
end
end
end
23 changes: 23 additions & 0 deletions lib/CloudPDF/types/tenants_update400response.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# frozen_string_literal: true

module CloudPDF
module Types
module TenantsUpdate400Response
# TenantsUpdate400Response is an alias for AdminErrorPayload

# @option str [String]
#
# @return [untyped]
def self.load(str)
::JSON.parse(str)
end

# @option value [untyped]
#
# @return [String]
def self.dump(value)
::JSON.generate(value)
end
end
end
end
23 changes: 23 additions & 0 deletions lib/CloudPDF/types/tenants_update404response.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# frozen_string_literal: true

module CloudPDF
module Types
module TenantsUpdate404Response
# TenantsUpdate404Response is an alias for AdminErrorPayload

# @option str [String]
#
# @return [untyped]
def self.load(str)
::JSON.parse(str)
end

# @option value [untyped]
#
# @return [String]
def self.dump(value)
::JSON.generate(value)
end
end
end
end
2 changes: 1 addition & 1 deletion lib/CloudPDF/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module CloudPDF
VERSION = "3.0.0.alpha.20"
VERSION = "3.0.0.alpha.21"
end
8 changes: 8 additions & 0 deletions lib/cloudpdf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,8 @@
require_relative "CloudPDF/types/engine_error_payload_name"
require_relative "CloudPDF/types/engine_error_payload_code"
require_relative "CloudPDF/types/engine_error_payload"
require_relative "CloudPDF/types/tenant_feature_stopped"
require_relative "CloudPDF/types/tenant_feature"
require_relative "CloudPDF/types/cache_delta_pages_item_cache"
require_relative "CloudPDF/types/cache_delta_pages_item"
require_relative "CloudPDF/types/cache_delta"
Expand Down Expand Up @@ -1372,6 +1374,11 @@
require_relative "CloudPDF/types/tenants_get200response_tenant"
require_relative "CloudPDF/types/tenants_get200response"
require_relative "CloudPDF/types/tenants_get404response"
require_relative "CloudPDF/types/tenants_update200response_tenant_status"
require_relative "CloudPDF/types/tenants_update200response_tenant"
require_relative "CloudPDF/types/tenants_update200response"
require_relative "CloudPDF/types/tenants_update400response"
require_relative "CloudPDF/types/tenants_update404response"
require_relative "CloudPDF/types/tenants_delete_response"
require_relative "CloudPDF/types/documents_init200response_created_document_state"
require_relative "CloudPDF/types/documents_init200response_created_document_thumbnail_state"
Expand Down Expand Up @@ -1948,6 +1955,7 @@
require_relative "CloudPDF/tenants/types/tenants_create_request"
require_relative "CloudPDF/tenants/types/get_tenants_request"
require_relative "CloudPDF/tenants/types/delete_tenants_request"
require_relative "CloudPDF/tenants/types/tenants_update_request"
require_relative "CloudPDF/tenants/types/resume_tenants_request"
require_relative "CloudPDF/tenants/types/tenants_suspend_request"
require_relative "CloudPDF/tenants/types/usage_tenants_request"
Expand Down
75 changes: 75 additions & 0 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1496,6 +1496,81 @@ client.tenants.delete(tenant_id: "tenantId")
</dl>


</dd>
</dl>
</details>

<details><summary><code>client.tenants.<a href="/lib/CloudPDF/tenants/client.rb">update</a>(tenant_id:, request) -> CloudPDF::Types::TenantsUpdate200Response</code></summary>
<dl>
<dd>

#### 📝 Description

<dl>
<dd>

<dl>
<dd>

A feature names an installed module; any other id is a 400. A module route answers a tenant without its feature 403 FeatureNotEnabled, and one whose feature is stopped 402 FeatureStopped (details.feature, details.stopped). Other replicas apply a change within 30 seconds.
</dd>
</dl>
</dd>
</dl>

#### 🔌 Usage

<dl>
<dd>

<dl>
<dd>

```ruby
client.tenants.update(
tenant_id: "tenantId",
features: [{
id: "id"
}]
)
```
</dd>
</dl>
</dd>
</dl>

#### ⚙️ Parameters

<dl>
<dd>

<dl>
<dd>

**tenant_id:** `String`

</dd>
</dl>

<dl>
<dd>

**features:** `Internal::Types::Array[CloudPDF::Types::TenantFeature]`

</dd>
</dl>

<dl>
<dd>

**request_options:** `CloudPDF::Tenants::RequestOptions`

</dd>
</dl>
</dd>
</dl>


</dd>
</dl>
</details>
Expand Down
Loading