diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eebd02f..f127dc7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,12 +25,31 @@ jobs: - run: uv run --no-sync ruff format --check - run: uv run --no-sync ruff check - run: uv run --no-sync mypy - - run: uv run --no-sync pytest + - run: uv run --no-sync pytest tests/unit + + # The real API may block some IP addresses of the GitHub runners (Azure) for their reputation: + # the integration tests run once, in a job that does not fail the workflow. + integration: + name: Integration tests (not blocking) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: astral-sh/setup-uv@v10.2.0 + with: + python-version: '3.14' + - run: uv sync --locked + - id: pytest + run: uv run --no-sync pytest tests/integration + continue-on-error: true env: # The integration tests are skipped unless these secrets are set. SHELLRENT_CLIENT_ID: ${{ secrets.SHELLRENT_CLIENT_ID }} SHELLRENT_CLIENT_SECRET: ${{ secrets.SHELLRENT_CLIENT_SECRET }} SHELLRENT_API_URL: ${{ vars.SHELLRENT_API_URL }} + - if: steps.pytest.outcome == 'failure' + run: >- + echo "::warning title=Integration tests::The integration tests failed, perhaps because + the API blocks the IP address of the runner: see the log of the pytest step." lowest-dependencies: name: Checks (Python 3.11, lowest dependencies) @@ -45,7 +64,7 @@ jobs: - run: uv run --no-sync ruff format --check - run: uv run --no-sync ruff check - run: uv run --no-sync mypy - - run: uv run --no-sync pytest + - run: uv run --no-sync pytest tests/unit generated-code: name: Generated code is up to date diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b2cdd4..f87dfd7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,90 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.0] - 2026-10-16 + +Functions and models regenerated from the updated specification of the Shellrent API, which renames +paths, parameters and models: see the lists below to update the code written for 0.3.0. + +### Added + +- `create_prepaid_credit_payment` and `create_one_click_payment` (`payment`), which replace + `pay_orders`, with `PrepaidCreditPaymentCreateRequest` and `OneClickPaymentCreateRequest`. +- `create_server_power_action` (`server`), with `ServerPowerActionRequest`: it replaces + `start_server`, `stop_server`, `reboot_server`, `hard_stop_server` and `hard_reboot_server`. +- `can_reissue_ssl_certificate` and `reissue_ssl_certificate` (`ssl`), which replace + `can_reemit_ssl_certificate` and `reemit_ssl_certificate`. +- `get_pec_mailbox_owner_change` (`pec`) and `list_private_cloud_available_ip_addresses` (`server`). +- `License`, `LicenseResponse` and `LicensePaginatedListResponse`, for both cPanel and Plesk. +- `DomainDetail` and `DomainDetailResponse`, returned by `get_domain`; `DomainNameserver` and + `DomainPremiumPrices`. +- `Hosting.http_version`, `Hosting.file_protection_enabled` and `Hosting.php_settings` + (`HostingPhpSetting`), `DomainAvailability.premium` and `DomainAvailability.premium_prices`, + `ApiErrorMetaType0.errors` (the errors of each field in validation errors). +- Enums for request fields that were `str` or `int`: `DomainDnsRecordRequestType`, + `DomainDnsZoneRequestZoneTtl`, `HostingCronjobCreateRequestRequestProtocol`, + `HostingCronjobCreateRequestHttpRequestMethod`, `HostingHttpVersionUpdateRequestVersion`, + `HostingPhpSettingsUpdateRequestSetting`, `HostingSslCertificateInstallRequestCnType`, + `HostingSslCertificateInstallRequestDestinationType` and `SslCertificateExportRequestFormat`. + +### Changed + +- `unwrap()` returns `None` for a 204 No Content response instead of raising `UnexpectedStatus`: + the specification now documents 204 for the deletions, `cancel_order`, `cancel_purchase`, + `apply_domain_contact_changes`, `revoke_one_click_autorenew` and the payments with nothing to pay. + The generated functions type these responses as `Any` instead of `EmptyResponse`. +- Path parameters renamed: `creditnote_id` → `credit_note_id` (`billing`), `cronjob_id` → + `cron_job_id` (`hosting`), `microsoft365_id` → `microsoft_365_subscription_id` (`license_`), + `topup_id` → `top_up_id` (`get_prepaid_credit_topup`). +- Parameters moved from the path to keyword-only query parameters: `recurrence_id` of + `can_change_purchase_recurrence`, `status` of `can_change_purchase_renew_status`, `domain_name` + of `list_ssl_approver_emails`. `export_ssl_certificate` takes the format in the body + (`SslCertificateExportRequest`) instead of the positional `format_`. +- `create_hosting_database` has no body: the API chooses the name of the database. +- New keyword-only parameters: `one_click_id` and `prepaid_credit` of `can_pay_order`, `page` and + `per_page` of `list_sms_messages` and `list_sms_prices`. The `body` of `upload_file` is required + and `UploadFileBody` has the `file` field. +- Return types: `create_server_network_interface`, `delete_server_network_interface`, + `create_object_storage_bucket_firewall_entry` and `delete_object_storage_bucket_firewall_entry` + return `TaskResponse`; `update_private_cloud_virtual_machine` returns `EmptyResponse` when no + resource changes; `get_hosting_antivirus` returns `HostingAntivirusNullableResponse`. +- The default of `per_page` in the list operations is 20, as in the specification. +- `error` of the success envelopes is `Literal[0]`. The fields that are always null are `Any`: + `meta` of the envelopes that are not paginated lists, `data` of `EmptyResponse` and of `ApiError`. +- The package is classified as `Development Status :: 5 - Production/Stable`. +- Model fields: many fields are now nullable or required as in the API, some request fields are + enums (see Added), `Domain.nameservers` is a list of `DomainNameserver`, + `Payment.provider_data` is `PaymentProviderData | None`, `ObjectStorage.code`, + `ObjectStorageBucket.code` and `ObjectStorageIamUser.code` are `int | None`, + `ObjectStorageBucket.creation_date` is a date, `ApiUpload.upload_date` a datetime, the `tlsa_*` + fields of `HostingDnsRecord` are `int | None`, `Creditnote.creditnote_year` is `int | None`. + +### Removed + +- `pay_orders` and `OrderPayRequest`: use `create_prepaid_credit_payment` or + `create_one_click_payment`. +- `start_server`, `stop_server`, `reboot_server`, `hard_stop_server` and `hard_reboot_server`: use + `create_server_power_action`. `start_server_first_backup` and `create_hosting_catch_all` (use + `update_hosting_catch_all`, which creates or replaces it). +- Secure Mail: `buy_secure_mail`, `buy_secure_mail_for_google_workspace`, + `buy_secure_mail_for_microsoft_365`, `list_secure_mails`, `get_secure_mail`, + `get_secure_mail_statistics`, `list_secure_mail_mailboxes`, `upgrade_secure_mail_quantity`, + `downgrade_secure_mail_quantity`, the `Securemail*` and `BuyServiceSecuremail*` models and + `Purchase.securemail_id`. +- `can_reemit_ssl_certificate`, `reemit_ssl_certificate` and `SslCertificateCanReemit*`. +- Models renamed: `CpanelLicense*` and `PleskLicense*` → `License*`, `DomainResponse` → + `DomainDetailResponse`, `HostingEmailBlocList*` → `HostingEmailBlockList*`, + `PaymentProviderDataType0` → `PaymentProviderData`, `GetHostingAntivirusResponse200` → + `HostingAntivirusNullableResponse`. Also removed: the `*ResponseMetaType0` models of the `meta` + that is always null (such as `PaymentResponseMetaType0`), `EmptyResponseDataType0`, + `ApiErrorDataType0`, `HostingDatabaseCreateRequest`, `PayOrdersResponse200`, + `BuyServiceObjectStorageRequestConfigurationTbSize` (`tb_size` is an `int`). +- Fields no longer in the API: `Domain.dnssec_enabled`, the `ns_*_ip` of + `DomainDnsNameserversChangeRequest`, `HostingSubdomainCreateRequest.subdomain`, + `Microsoft365DomainAvailable.microsoft_uuid`, `ObjectStorageIamUser.firewall_policy`, + `OneClick.one_click_preference`, `PecOwnerChange.person_id_accept` and `person_id_reject`, + `ServerBackup.backup_path` and `backup_path_parent`. + ## [0.3.0] - 2026-10-01 ### Added @@ -73,7 +157,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 `invalid_client` or, for its rate limit, `rate_limited`. - The `shellrent` command, with `shellrent api` and `shellrent token`. -[Unreleased]: https://github.com/shellrent/shellrent-sdk-python/compare/v0.3.0...HEAD +[Unreleased]: https://github.com/shellrent/shellrent-sdk-python/compare/v1.0.0...HEAD +[1.0.0]: https://github.com/shellrent/shellrent-sdk-python/compare/v0.3.0...v1.0.0 [0.3.0]: https://github.com/shellrent/shellrent-sdk-python/compare/v0.2.0...v0.3.0 [0.2.0]: https://github.com/shellrent/shellrent-sdk-python/compare/v0.1.0...v0.2.0 [0.1.0]: https://github.com/shellrent/shellrent-sdk-python/releases/tag/v0.1.0 diff --git a/CLAUDE.md b/CLAUDE.md index 0499605..2e697d7 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -42,8 +42,11 @@ da `spec/openapi.yaml`; a mano solo autenticazione, creazione del client, CLI, t chiave della CA non è conservata: per rifarli crea una nuova CA e aggiorna `CA_HASH_NAME`. - `tests/integration` chiama l'API reale solo con `SHELLRENT_CLIENT_ID` e `SHELLRENT_CLIENT_SECRET` (e opzionalmente `SHELLRENT_API_URL`); `test_errors.py` richiede lo scope `purchases:read`. -- La CI esegue ruff, mypy e pytest su Python 3.11-3.14, gli stessi controlli su 3.11 con le dipendenze minime - (`uv sync --resolution lowest-direct`) e `bin/generate`, fallendo se il codice rigenerato è diverso. +- La CI esegue ruff, mypy e i test unitari su Python 3.11-3.14, gli stessi controlli su 3.11 con le dipendenze + minime (`uv sync --resolution lowest-direct`) e `bin/generate`, fallendo se il codice rigenerato è diverso. +- I test di integrazione girano una sola volta (Python 3.14) nel job `Integration tests (not blocking)`: l'API + può bloccare alcuni IP dei runner GitHub (Azure) per la reputazione, quindi un fallimento lascia il workflow + verde con un warning nel riepilogo della run. Se falliscono spesso, verificali a mano con le credenziali. ## Vincoli diff --git a/README.md b/README.md index 5e54479..b14aed2 100644 --- a/README.md +++ b/README.md @@ -189,7 +189,8 @@ As with httpx, the requests follow the proxy and certificate settings of the env `sync()` and `asyncio()` return the error responses documented in the specification as `ApiError`, the error envelope, so you would check the type of every result. `unwrap()` does that for you: it takes the result of `sync_detailed()` or `asyncio_detailed()`, returns the parsed body of a 2xx -response and raises `ApiException` for the documented errors. +response (`None` for 204 No Content, such as most deletions) and raises `ApiException` for the +documented errors. ```python import httpx @@ -238,12 +239,12 @@ shellrent api GET /api/v3/purchases | jq '.data[] | {purchase_id, name: .purchas shellrent api GET '/api/v3/purchases?page=2&per_page=50' | jq -r '.data[].purchase_id' # JSON body: as text, from a file with @, from stdin with - -shellrent api POST /api/v3/orders/pay --data '{"order_ids": [123], "use_prepaid_credit": true}' -shellrent api POST /api/v3/orders/pay --data @order.json -jq -n '{order_ids: [123], use_prepaid_credit: true}' | shellrent api POST /api/v3/orders/pay --data - +shellrent api POST /api/v3/payments/prepaid-credit --data '{"order_ids": [123]}' +shellrent api POST /api/v3/payments/prepaid-credit --data @order.json +jq -n '{order_ids: [123]}' | shellrent api POST /api/v3/payments/prepaid-credit --data - # Files are written as they are -shellrent api GET /api/v3/invoices/456/download/pdf > invoice.pdf +shellrent api GET /api/v3/invoices/456/pdf > invoice.pdf # An access token for other tools curl -H "Authorization: Bearer $(shellrent token)" https://api.shellrent.com/api/v3/purchases diff --git a/pyproject.toml b/pyproject.toml index eaf5c07..4a38f09 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ authors = [{ name = "Shellrent S.r.l." }] requires-python = ">=3.11" keywords = ["shellrent", "api", "sdk", "client", "hosting", "domains", "openapi"] classifiers = [ - "Development Status :: 4 - Beta", + "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python :: 3", diff --git a/spec/openapi.yaml b/spec/openapi.yaml index ce8b45e..e4210be 100644 --- a/spec/openapi.yaml +++ b/spec/openapi.yaml @@ -2,10 +2,9 @@ openapi: 3.1.0 info: title: API Shellrent description: >- - API REST per gestire in modo automatico i servizi del proprio account - Shellrent: domini, hosting, server, storage, certificati SSL, acquisti e - fatturazione. L'accesso avviene tramite OAuth2 (client credentials) con - scope specifici per area. + REST API to manage the services of your Shellrent account automatically: + domains, hosting, servers, storage, SSL certificates, purchases and billing. + Access uses OAuth2 (client credentials), with a set of scopes for each area. version: 3.0.0 servers: - url: https://api.shellrent.com @@ -14,9 +13,9 @@ security: - oauth2: [] tags: - name: OAuth - description: Autenticazione e JWKS + description: Authentication and JWKS - name: Health - description: Stato del servizio + description: Service status - name: Account description: Account - name: Billing @@ -50,34 +49,24 @@ paths: get: tags: - Health - summary: Verifica lo stato del servizio - description: Restituisce lo stato corrente dell'API. + summary: Check the service status + description: Returns the current status of the API. operationId: getHealth responses: '200': - description: Servizio attivo + description: Service up content: application/json: schema: $ref: '#/components/schemas/HealthStatusResponse' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' + '429': + $ref: '#/components/responses/TooManyRequests' '500': - description: Errore inatteso - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/ServerError' security: - oauth2: [] /api/v3/account: @@ -95,66 +84,47 @@ paths: schema: $ref: '#/components/schemas/AccountResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - account:read - /api/v3/creditnotes: + /api/v3/credit-notes: get: tags: - Billing summary: List all Credit notes - description: Get a list of all Credit notes + description: |- + Get a list of all Credit notes + + Not available to sub-accounts: the response is 403 (error 1601). operationId: listCreditNotes parameters: - name: date_emission_from in: query + description: Only the credit notes issued on or after this date (YYYY-MM-DD) required: false schema: type: string format: date - name: date_emission_to in: query + description: Only the credit notes issued on or before this date (YYYY-MM-DD) required: false schema: type: string format: date - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -163,47 +133,33 @@ paths: schema: $ref: '#/components/schemas/CreditnotePaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - billing:read - /api/v3/creditnotes/{creditnote_id}: + x-sub-accounts: false + /api/v3/credit-notes/{credit_note_id}: get: tags: - Billing summary: Get a Credit note - description: Get details of a credit note + description: |- + Get details of a credit note + + Not available to sub-accounts: the response is 403 (error 1601). operationId: getCreditNote parameters: - - name: creditnote_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/CreditNoteId' responses: '200': description: OK @@ -212,47 +168,33 @@ paths: schema: $ref: '#/components/schemas/CreditnoteResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - billing:read - /api/v3/creditnotes/{creditnote_id}/rows: + x-sub-accounts: false + /api/v3/credit-notes/{credit_note_id}/rows: get: tags: - Billing summary: List all credit note rows - description: Get the list of all the rows of a Credit Note + description: |- + Get the list of all the rows of a Credit Note + + Not available to sub-accounts: the response is 403 (error 1601). operationId: listCreditNoteRows parameters: - - name: creditnote_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/CreditNoteId' responses: '200': description: OK @@ -261,52 +203,34 @@ paths: schema: $ref: '#/components/schemas/CreditnoteRowListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - billing:read - /api/v3/creditnotes/{creditnote_id}/rows/{row_id}: + x-sub-accounts: false + /api/v3/credit-notes/{credit_note_id}/rows/{row_id}: get: tags: - Billing summary: Get a credit note row - description: Get details of a Credit note row + description: |- + Get details of a Credit note row + + Not available to sub-accounts: the response is 403 (error 1601). operationId: getCreditNoteRow parameters: - - name: creditnote_id - in: path - required: true - schema: - type: integer - - name: row_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/CreditNoteId' + - $ref: '#/components/parameters/RowId' responses: '200': description: OK @@ -315,47 +239,33 @@ paths: schema: $ref: '#/components/schemas/CreditnoteRowResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - billing:read - /api/v3/creditnotes/{creditnote_id}/download: + x-sub-accounts: false + /api/v3/credit-notes/{credit_note_id}/xml: get: tags: - Billing summary: Download credit note XML - description: Download the XML file of a Credit note + description: |- + Download the XML file of a Credit note + + Not available to sub-accounts: the response is 403 (error 1601). operationId: downloadCreditNoteXml parameters: - - name: creditnote_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/CreditNoteId' - name: prefer_xml in: query description: >- @@ -399,53 +309,39 @@ paths: type: string format: binary '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - billing:read - /api/v3/creditnotes/{creditnote_id}/download/pdf: + x-sub-accounts: false + /api/v3/credit-notes/{credit_note_id}/pdf: get: tags: - Billing summary: Download credit note PDF - description: Download the courtesy PDF file of a Credit note + description: |- + Download the courtesy PDF file of a Credit note + + Not available to sub-accounts: the response is 403 (error 1601). operationId: downloadCreditNotePdf parameters: - - name: creditnote_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/CreditNoteId' responses: '200': description: OK (file download) headers: Content-Length: - description: Dimensione del file in byte. + description: Size of the file in bytes. schema: type: integer format: int64 @@ -471,34 +367,21 @@ paths: type: string format: binary '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - billing:read + x-sub-accounts: false /api/v3/domains: get: tags: @@ -531,18 +414,8 @@ paths: required: false schema: type: string - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -551,31 +424,17 @@ paths: schema: $ref: '#/components/schemas/DomainPaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - domains:read @@ -584,47 +443,31 @@ paths: tags: - Domains summary: Get domain - description: Get a domain + description: >- + Get a domain. Unlike the list, it has dnssec_enabled, which needs the + DNS zone of the domain operationId: getDomain parameters: - - name: domain_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/DomainId' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/DomainResponse' + $ref: '#/components/schemas/DomainDetailResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - domains:read @@ -633,7 +476,10 @@ paths: tags: - Domains summary: Domain whois - description: Search availability status for a domain (whois) + description: >- + Search availability status for a domain (whois). A premium domain, sold + at a price set by the registry, comes with our prices, which its order + (`POST /api/v3/shop/domain`) uses; sub-accounts get no prices operationId: checkDomainAvailability parameters: - name: domain_full_name @@ -650,31 +496,17 @@ paths: schema: $ref: '#/components/schemas/DomainAvailabilityResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - domains:read @@ -686,11 +518,7 @@ paths: description: Get DNSSEC data records operationId: getDomainDnssec parameters: - - name: domain_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/DomainId' responses: '200': description: OK @@ -699,31 +527,17 @@ paths: schema: $ref: '#/components/schemas/DomainDnssecResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - domains:read @@ -731,47 +545,43 @@ paths: tags: - Domains summary: Activate DNSSEC - description: Activate DNSSEC (for domains with "standard" nameservers only) + description: >- + Activate DNSSEC (for domains with "standard" nameservers only). When the + purchase of the domain is suspended, the request is rejected with 409 operationId: activateDomainDnssec parameters: - - name: domain_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/DomainId' responses: - '200': - description: OK + '202': + description: >- + Accepted: the operation goes on in the background, as the returned + Task + headers: + Location: + description: >- + URL of the Task: `/api/v3/tasks/{task_id}`. Reading it requires + the `purchases:read` scope + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/TaskResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - domains:write @@ -781,47 +591,43 @@ paths: summary: Deactivate DNSSEC description: >- Deactivate DNSSEC (for domains with "standard" nameservers) or remove - all DNSSEC data records (for domains with "external" nameservers) + all DNSSEC data records (for domains with "external" nameservers). When + the purchase of the domain is suspended, the request is rejected with + 409 operationId: deactivateDomainDnssec parameters: - - name: domain_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/DomainId' responses: - '200': - description: OK + '202': + description: >- + Accepted: the operation goes on in the background, as the returned + Task + headers: + Location: + description: >- + URL of the Task: `/api/v3/tasks/{task_id}`. Reading it requires + the `purchases:read` scope + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/TaskResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - domains:write @@ -831,14 +637,11 @@ paths: summary: Change DNSSEC data description: >- Add or change DNSSEC data records (for domains with "external" - nameservers only) + nameservers only). When the purchase of the domain is suspended, the + request is rejected with 409 operationId: updateDomainDnssec parameters: - - name: domain_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/DomainId' requestBody: required: true content: @@ -846,38 +649,36 @@ paths: schema: $ref: '#/components/schemas/DomainDnssecRequest' responses: - '200': - description: OK + '202': + description: >- + Accepted: the operation goes on in the background, as the returned + Task + headers: + Location: + description: >- + URL of the Task: `/api/v3/tasks/{task_id}`. Reading it requires + the `purchases:read` scope + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/TaskResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - domains:write @@ -889,11 +690,7 @@ paths: description: Know if it's possible to activate DNSSEC operationId: canActivateDomainDnssec parameters: - - name: domain_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/DomainId' responses: '200': description: OK @@ -902,31 +699,17 @@ paths: schema: $ref: '#/components/schemas/DomainDnssecCanActivateResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - domains:read @@ -938,11 +721,7 @@ paths: description: Know if it's possible to deactivate DNSSEC operationId: canDeactivateDomainDnssec parameters: - - name: domain_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/DomainId' responses: '200': description: OK @@ -951,31 +730,17 @@ paths: schema: $ref: '#/components/schemas/DomainDnssecCanDeactivateResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - domains:read @@ -987,11 +752,7 @@ paths: description: DNS Zone details operationId: getDomainDnsZone parameters: - - name: domain_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/DomainId' responses: '200': description: OK @@ -1000,31 +761,17 @@ paths: schema: $ref: '#/components/schemas/DnsZoneResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - domains:read @@ -1032,14 +779,14 @@ paths: tags: - Domains summary: Change DNS Zone data - description: Change DNS Zone data + description: >- + Changes the TTL of the DNS zone of the domain and returns the zone. Only + the zones on our nameservers (standard and external types) have a TTL, + which is also the TTL of all their records: with the Cloudflare + nameservers the response is 409. 404 when the domain has no DNS zone operationId: updateDomainDnsZone parameters: - - name: domain_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/DomainId' requestBody: required: true content: @@ -1054,31 +801,19 @@ paths: schema: $ref: '#/components/schemas/DnsZoneResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - domains:write @@ -1090,11 +825,7 @@ paths: description: Know if it's possible to change Nameservers operationId: canChangeDomainNameservers parameters: - - name: domain_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/DomainId' responses: '200': description: OK @@ -1103,31 +834,17 @@ paths: schema: $ref: '#/components/schemas/DomainCanChangeNameserversResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - domains:read @@ -1139,44 +856,38 @@ paths: description: Activate "standard" nameservers on domain operationId: setDomainStandardNameservers parameters: - - name: domain_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/DomainId' responses: - '200': - description: OK + '202': + description: >- + Accepted: the operation goes on in the background, as the returned + Task + headers: + Location: + description: >- + URL of the Task: `/api/v3/tasks/{task_id}`. Reading it requires + the `purchases:read` scope + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/TaskResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - domains:write @@ -1188,11 +899,7 @@ paths: description: Activate "Cloudflare" nameservers on domain operationId: setDomainCloudflareNameservers parameters: - - name: domain_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/DomainId' requestBody: required: true content: @@ -1200,54 +907,48 @@ paths: schema: $ref: '#/components/schemas/DomainDnsNameserversCloudflareRequest' responses: - '200': - description: OK + '202': + description: >- + Accepted: the operation goes on in the background, as the returned + Task + headers: + Location: + description: >- + URL of the Task: `/api/v3/tasks/{task_id}`. Reading it requires + the `purchases:read` scope + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/TaskResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - domains:write - /api/v3/domains/{domain_id}/dns/change-nameservers: - patch: + /api/v3/domains/{domain_id}/dns/external: + put: tags: - Domains summary: 'Nameservers: external' description: Activate "external" nameservers or change current "external" nameservers operationId: setDomainExternalNameservers parameters: - - name: domain_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/DomainId' requestBody: required: true content: @@ -1255,38 +956,36 @@ paths: schema: $ref: '#/components/schemas/DomainDnsNameserversChangeRequest' responses: - '200': - description: OK + '202': + description: >- + Accepted: the operation goes on in the background, as the returned + Task + headers: + Location: + description: >- + URL of the Task: `/api/v3/tasks/{task_id}`. Reading it requires + the `purchases:read` scope + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/TaskResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - domains:write @@ -1301,11 +1000,7 @@ paths: the total number of pages. Only forward pages navigation is supported. operationId: listDomainDnsRecords parameters: - - name: domain_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/DomainId' - name: type in: query description: Search by record type @@ -1324,18 +1019,8 @@ paths: required: false schema: type: string - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -1344,31 +1029,17 @@ paths: schema: $ref: '#/components/schemas/DnsRecordPaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - domains:read @@ -1376,14 +1047,12 @@ paths: tags: - Domains summary: Create DNS record - description: Create a new DNS record + description: >- + Creates a record in the DNS zone of the domain. `NS` and `PTR` records + cannot be created, as in the control panel (400) operationId: createDomainDnsRecord parameters: - - name: domain_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/DomainId' requestBody: required: true content: @@ -1391,38 +1060,30 @@ paths: schema: $ref: '#/components/schemas/DomainDnsRecordRequest' responses: - '200': - description: OK + '201': + description: Created + headers: + Location: + description: URL of the created resource + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/DnsRecordResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - domains:write @@ -1434,16 +1095,8 @@ paths: description: Get a DNS record operationId: getDomainDnsRecord parameters: - - name: domain_id - in: path - required: true - schema: - type: integer - - name: record_id - in: path - required: true - schema: - type: string + - $ref: '#/components/parameters/DomainId' + - $ref: '#/components/parameters/RecordId' responses: '200': description: OK @@ -1452,31 +1105,17 @@ paths: schema: $ref: '#/components/schemas/DnsRecordResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - domains:read @@ -1484,52 +1123,28 @@ paths: tags: - Domains summary: Delete DNS record - description: Delete an existing DNS record + description: >- + Deletes a record of the DNS zone of the domain. `NS` and `PTR` records + cannot be deleted, as in the control panel (403) operationId: deleteDomainDnsRecord parameters: - - name: domain_id - in: path - required: true - schema: - type: integer - - name: record_id - in: path - required: true - schema: - type: string + - $ref: '#/components/parameters/DomainId' + - $ref: '#/components/parameters/RecordId' responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/EmptyResponse' + '204': + description: No Content '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - domains:write @@ -1537,19 +1152,13 @@ paths: tags: - Domains summary: Modify DNS record - description: Modify an existing DNS record + description: >- + Changes a record of the DNS zone of the domain; its type cannot change. + `NS` and `PTR` records cannot be changed, as in the control panel (403) operationId: updateDomainDnsRecord parameters: - - name: domain_id - in: path - required: true - schema: - type: integer - - name: record_id - in: path - required: true - schema: - type: string + - $ref: '#/components/parameters/DomainId' + - $ref: '#/components/parameters/RecordId' requestBody: required: true content: @@ -1564,31 +1173,17 @@ paths: schema: $ref: '#/components/schemas/DnsRecordResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - domains:write @@ -1600,11 +1195,7 @@ paths: description: Get all contacts of domain operationId: listDomainContacts parameters: - - name: domain_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/DomainId' responses: '200': description: OK @@ -1613,31 +1204,17 @@ paths: schema: $ref: '#/components/schemas/DomainContactListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - domains:read @@ -1649,16 +1226,8 @@ paths: description: Get a contact of domain operationId: getDomainContact parameters: - - name: domain_id - in: path - required: true - schema: - type: integer - - name: domain_contact_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/DomainId' + - $ref: '#/components/parameters/DomainContactId' responses: '200': description: OK @@ -1667,31 +1236,17 @@ paths: schema: $ref: '#/components/schemas/DomainContactResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - domains:read @@ -1702,16 +1257,8 @@ paths: description: Modify a contact's data operationId: updateDomainContact parameters: - - name: domain_id - in: path - required: true - schema: - type: integer - - name: domain_contact_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/DomainId' + - $ref: '#/components/parameters/DomainContactId' requestBody: required: true content: @@ -1726,35 +1273,23 @@ paths: schema: $ref: '#/components/schemas/DomainContactResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - domains:write - /api/v3/domains/{domain_id}/contacts/apply: + /api/v3/domains/{domain_id}/contacts/synchronizations: post: tags: - Domains @@ -1764,44 +1299,22 @@ paths: Registry) operationId: applyDomainContactChanges parameters: - - name: domain_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/DomainId' responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/EmptyResponse' + '204': + description: No Content '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - domains:write @@ -1810,21 +1323,13 @@ paths: tags: - Hosting summary: List all hostings - description: Get a list of all hostings + description: >- + Lists the active main hostings of the account, one for each hosting + purchase; their subdomains are not included operationId: listHostings parameters: - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -1833,31 +1338,17 @@ paths: schema: $ref: '#/components/schemas/HostingPaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:read @@ -1869,11 +1360,7 @@ paths: description: Get details of a hosting operationId: getHosting parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' responses: '200': description: OK @@ -1882,133 +1369,99 @@ paths: schema: $ref: '#/components/schemas/HostingResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:read - post: + delete: tags: - Hosting - summary: Create subdomain - description: Create subdomain - operationId: createHostingSubdomain + summary: Delete subdomain + description: >- + Deletes a subdomain: it removes it from the web server, uninstalls its + SSL certificates and, when the DNS of the domain is a purchase of the + same account, deletes its DNS record. Not available (403) when the plan + does not include subdomains; 409 on a main hosting + operationId: deleteHostingSubdomain parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/HostingSubdomainCreateRequest' + - $ref: '#/components/parameters/HostingId' responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/HostingResponse' + '204': + description: No Content '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:write - delete: + /api/v3/hostings/{hosting_id}/subdomains: + post: tags: - Hosting - summary: Delete subdomain - description: Delete subdomain - operationId: deleteHostingSubdomain + summary: Create subdomain + description: >- + Creates a subdomain of a main hosting and returns it. When the DNS of + the domain is a purchase of the same account, it also adds the A record + of the subdomain. Not available (403) when the plan does not include + subdomains; 409 on a subdomain, when the limit is reached or when the + subdomain or its DNS record already exists + operationId: createHostingSubdomain parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/HostingSubdomainCreateRequest' responses: - '200': - description: OK - content: - application/json: + '201': + description: Created + headers: + Location: + description: URL of the created resource + required: true schema: - $ref: '#/components/schemas/EmptyResponse' - '400': - description: Bad request + type: string content: application/json: schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/schemas/HostingResponse' + '400': + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:write @@ -2017,14 +1470,13 @@ paths: tags: - Hosting summary: Get hosting credentials - description: Get hosting credentials + description: >- + Lists the active FTP, secondary FTP, MySQL and MSSQL accounts of the + hosting, with their passwords. The accounts belong to the purchase: a + subdomain returns those of its main hosting operationId: getHostingCredentials parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' responses: '200': description: OK @@ -2033,47 +1485,34 @@ paths: schema: $ref: '#/components/schemas/HostingCredentialListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:read + - hosting:secrets /api/v3/hostings/{hosting_id}/dns-records: get: tags: - Hosting summary: Get hosting DNS records - description: Get hosting DNS records + description: >- + Lists the default DNS records of the hosting: those of its web server + and of its mail server, which point the domain to the hosting. They are + not read from the DNS zone of the domain; a subdomain returns those of + its main hosting operationId: listHostingDnsRecords parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' responses: '200': description: OK @@ -2082,31 +1521,17 @@ paths: schema: $ref: '#/components/schemas/HostingDnsRecordListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:read @@ -2115,14 +1540,13 @@ paths: tags: - Hosting summary: Get hosting databases - description: Get hosting databases + description: >- + Lists the MySQL and MSSQL databases of the hosting, read from the + database servers, with the account that owns them. The databases belong + to the purchase: a subdomain returns those of its main hosting operationId: listHostingDatabases parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' responses: '200': description: OK @@ -2131,31 +1555,17 @@ paths: schema: $ref: '#/components/schemas/HostingDatabaseListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:read @@ -2163,53 +1573,41 @@ paths: tags: - Hosting summary: Create hosting database - description: Create hosting database + description: >- + Create a database of the hosting. The request has no body: as in the + control panel, the name is `_`, + with the first free n. If the database server already uses that name for + another account, it adds a suffix: the response has the actual name operationId: createHostingDatabase parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/HostingDatabaseCreateRequest' + - $ref: '#/components/parameters/HostingId' responses: - '200': - description: OK + '201': + description: Created + headers: + Location: + description: URL of the created resource + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/HostingDatabaseResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:write @@ -2218,19 +1616,14 @@ paths: tags: - Hosting summary: Get hosting database - description: Get hosting database + description: >- + Returns a database of the hosting, read from the database servers: + `database_id` is the name of the database. 404 when the hosting has no + database with that name operationId: getHostingDatabase parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer - - name: database_id - in: path - required: true - schema: - type: string + - $ref: '#/components/parameters/HostingId' + - $ref: '#/components/parameters/DatabaseId' responses: '200': description: OK @@ -2239,31 +1632,17 @@ paths: schema: $ref: '#/components/schemas/HostingDatabaseResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:read @@ -2275,11 +1654,7 @@ paths: description: Get list of email aliases for a hosting (excluding catch-all) operationId: listHostingEmailAliases parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' responses: '200': description: OK @@ -2288,31 +1663,17 @@ paths: schema: $ref: '#/components/schemas/HostingEmailAliasListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:read @@ -2323,11 +1684,7 @@ paths: description: Create a new email alias for the hosting operationId: createHostingEmailAlias parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' requestBody: required: true content: @@ -2335,38 +1692,32 @@ paths: schema: $ref: '#/components/schemas/HostingEmailAliasCreateRequest' responses: - '200': - description: OK + '201': + description: Created + headers: + Location: + description: URL of the created resource + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/HostingEmailAliasResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:write @@ -2378,16 +1729,8 @@ paths: description: Get details of a single email alias operationId: getHostingEmailAlias parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer - - name: alias_id - in: path - required: true - schema: - type: string + - $ref: '#/components/parameters/HostingId' + - $ref: '#/components/parameters/AliasId' responses: '200': description: OK @@ -2396,31 +1739,17 @@ paths: schema: $ref: '#/components/schemas/HostingEmailAliasResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:read @@ -2431,49 +1760,25 @@ paths: description: Delete an email alias operationId: deleteHostingEmailAlias parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer - - name: alias_id - in: path - required: true - schema: - type: string + - $ref: '#/components/parameters/HostingId' + - $ref: '#/components/parameters/AliasId' responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/EmptyResponse' + '204': + description: No Content '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:write @@ -2485,11 +1790,7 @@ paths: description: Get catch-all alias status and destinations operationId: getHostingCatchAll parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' responses: '200': description: OK @@ -2498,46 +1799,30 @@ paths: schema: $ref: '#/components/schemas/HostingEmailCatchAllResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:read put: tags: - Hosting - summary: Update catch-all alias - description: Update a catch-all alias destinations + summary: Create or replace catch-all alias + description: >- + Sets the destinations of the catch-all alias: the response is 201 when + the alias is created, 200 when it replaces the current one operationId: updateHostingCatchAll parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' requestBody: required: true content: @@ -2551,162 +1836,74 @@ paths: application/json: schema: $ref: '#/components/schemas/HostingEmailCatchAllResponse' - '400': - description: Bad request - content: - application/json: + '201': + description: Created + headers: + Location: + description: URL of the created resource + required: true schema: - $ref: '#/components/schemas/ApiError' - '401': - description: Not authorized + type: string content: application/json: schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/schemas/HostingEmailCatchAllResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:write - post: + delete: tags: - Hosting - summary: Create catch-all alias - description: Create a catch-all alias with destinations - operationId: createHostingCatchAll + summary: Delete catch-all alias + description: Delete the catch-all alias + operationId: deleteHostingCatchAll parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/HostingEmailCatchAllRequest' + - $ref: '#/components/parameters/HostingId' responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/HostingEmailCatchAllResponse' + '204': + description: No Content '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:write - delete: + /api/v3/hostings/{hosting_id}/allow-lists: + get: tags: - Hosting - summary: Delete catch-all alias - description: Delete the catch-all alias - operationId: deleteHostingCatchAll + summary: List hosting allow list + description: Get list of allow list entries for hosting + operationId: listHostingAllowListEntries parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/EmptyResponse' - '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '429': - $ref: '#/components/responses/TooManyRequests' - security: - - oauth2: - - hosting:write - /api/v3/hostings/{hosting_id}/allow-lists: - get: - tags: - - Hosting - summary: List hosting allow list - description: Get list of allow list entries for hosting - operationId: listHostingAllowListEntries - parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/HostingId' + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -2716,31 +1913,17 @@ paths: $ref: >- #/components/schemas/HostingEmailAllowListPaginatedListResponse '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:read @@ -2751,11 +1934,7 @@ paths: description: Create a new allow list entry for hosting operationId: createHostingAllowListEntry parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' requestBody: required: true content: @@ -2763,38 +1942,30 @@ paths: schema: $ref: '#/components/schemas/HostingEmailWblistRequest' responses: - '200': - description: OK + '201': + description: Created + headers: + Location: + description: URL of the created resource + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/HostingEmailAllowListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:write @@ -2806,16 +1977,8 @@ paths: description: Get allow list entry details for hosting operationId: getHostingAllowListEntry parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer - - name: allow_list_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' + - $ref: '#/components/parameters/AllowListId' responses: '200': description: OK @@ -2824,31 +1987,17 @@ paths: schema: $ref: '#/components/schemas/HostingEmailAllowListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:read @@ -2859,49 +2008,23 @@ paths: description: Delete an allow list entry for hosting operationId: deleteHostingAllowListEntry parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer - - name: allow_list_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' + - $ref: '#/components/parameters/AllowListId' responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/EmptyResponse' + '204': + description: No Content '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:write @@ -2913,56 +2036,29 @@ paths: description: Get list of block list entries for hosting operationId: listHostingBlockListEntries parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/HostingId' + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/HostingEmailBlocListPaginatedListResponse' + $ref: >- + #/components/schemas/HostingEmailBlockListPaginatedListResponse '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:read @@ -2973,11 +2069,7 @@ paths: description: Create a new block list entry for hosting operationId: createHostingBlockListEntry parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' requestBody: required: true content: @@ -2985,38 +2077,30 @@ paths: schema: $ref: '#/components/schemas/HostingEmailWblistRequest' responses: - '200': - description: OK - content: - application/json: + '201': + description: Created + headers: + Location: + description: URL of the created resource + required: true schema: - $ref: '#/components/schemas/HostingEmailBlocListResponse' - '400': - description: Bad request + type: string content: application/json: schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/schemas/HostingEmailBlockListResponse' + '400': + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:write @@ -3028,49 +2112,27 @@ paths: description: Get block list entry details for hosting operationId: getHostingBlockListEntry parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer - - name: block_list_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' + - $ref: '#/components/parameters/BlockListId' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/HostingEmailBlocListResponse' + $ref: '#/components/schemas/HostingEmailBlockListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:read @@ -3081,53 +2143,27 @@ paths: description: Delete a block list entry for hosting operationId: deleteHostingBlockListEntry parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer - - name: block_list_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' + - $ref: '#/components/parameters/BlockListId' responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/EmptyResponse' + '204': + description: No Content '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:write - /api/v3/hostings/{hosting_id}/cronjobs: + /api/v3/hostings/{hosting_id}/cron-jobs: get: tags: - Hosting @@ -3135,23 +2171,9 @@ paths: description: Get list of cronjobs for a hosting operationId: listHostingCronjobs parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/HostingId' + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -3160,31 +2182,17 @@ paths: schema: $ref: '#/components/schemas/HostingCronjobPaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:read @@ -3195,11 +2203,7 @@ paths: description: Create a new cronjob for hosting operationId: createHostingCronjob parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' requestBody: required: true content: @@ -3207,42 +2211,36 @@ paths: schema: $ref: '#/components/schemas/HostingCronjobCreateRequest' responses: - '200': - description: OK + '201': + description: Created + headers: + Location: + description: URL of the created resource + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/HostingCronjobResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:write - /api/v3/hostings/{hosting_id}/cronjobs/{cronjob_id}: + /api/v3/hostings/{hosting_id}/cron-jobs/{cron_job_id}: get: tags: - Hosting @@ -3250,16 +2248,8 @@ paths: description: Get a cronjob details for hosting operationId: getHostingCronjob parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer - - name: cronjob_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' + - $ref: '#/components/parameters/CronJobId' responses: '200': description: OK @@ -3268,31 +2258,17 @@ paths: schema: $ref: '#/components/schemas/HostingCronjobResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:read @@ -3303,49 +2279,23 @@ paths: description: Delete a cronjob for hosting operationId: deleteHostingCronjob parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer - - name: cronjob_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' + - $ref: '#/components/parameters/CronJobId' responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/EmptyResponse' + '204': + description: No Content '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:write @@ -3357,11 +2307,7 @@ paths: description: Get ModSecurity configuration status operationId: getHostingModSecurity parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' responses: '200': description: OK @@ -3370,31 +2316,17 @@ paths: schema: $ref: '#/components/schemas/HostingModSecurityResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:read @@ -3405,11 +2337,7 @@ paths: description: Enable or disable ModSecurity operationId: updateHostingModSecurity parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' requestBody: required: true content: @@ -3424,31 +2352,17 @@ paths: schema: $ref: '#/components/schemas/HostingModSecurityResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:write @@ -3460,23 +2374,9 @@ paths: description: Get ModSecurity scan history operationId: listHostingModSecurityScans parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/HostingId' + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -3486,31 +2386,17 @@ paths: $ref: >- #/components/schemas/HostingModSecurityScanPaginatedListResponse '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:read @@ -3522,16 +2408,8 @@ paths: description: Get ModSecurity scan details operationId: getHostingModSecurityScan parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer - - name: scan_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' + - $ref: '#/components/parameters/ScanId' responses: '200': description: OK @@ -3540,31 +2418,17 @@ paths: schema: $ref: '#/components/schemas/HostingModSecurityScanResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:read @@ -3573,14 +2437,13 @@ paths: tags: - Hosting summary: List ModSecurity rules - description: Get ModSecurity rules for a hosting + description: >- + Lists the ModSecurity rules of the hosting, found by the scans or added + by hand. A rule with `included` true is disabled on the hosting: + ModSecurity does not apply it operationId: listHostingModSecurityRules parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' responses: '200': description: OK @@ -3589,31 +2452,17 @@ paths: schema: $ref: '#/components/schemas/HostingModSecurityRuleListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:read @@ -3621,14 +2470,13 @@ paths: tags: - Hosting summary: Enable ModSecurity rules - description: Enable multiple ModSecurity rules by id + description: >- + Disables on the hosting the ModSecurity rules with the given ids + (`rule_id`), so that ModSecurity no longer applies them, and returns + them with `included` true operationId: enableHostingModSecurityRules parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' requestBody: required: true content: @@ -3643,31 +2491,17 @@ paths: schema: $ref: '#/components/schemas/HostingModSecurityRuleListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:write @@ -3675,14 +2509,14 @@ paths: tags: - Hosting summary: Create ModSecurity rule - description: Add a ModSecurity rule by rule number + description: >- + Disables the ModSecurity rule `rule_number` on the hosting, so that + ModSecurity no longer applies it, and returns the rule with `included` + true. Responds 200 instead of 201 when the hosting already had the rule, + found by a scan or added before operationId: createHostingModSecurityRule parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' requestBody: required: true content: @@ -3691,37 +2525,35 @@ paths: $ref: '#/components/schemas/HostingModSecurityRuleCreateRequest' responses: '200': - description: OK + description: The rule was already in the firewall of the hosting content: application/json: schema: $ref: '#/components/schemas/HostingModSecurityRuleResponse' - '400': - description: Bad request - content: - application/json: + '201': + description: Created + headers: + Location: + description: URL of the created resource + required: true schema: - $ref: '#/components/schemas/ApiError' - '401': - description: Not authorized + type: string content: application/json: schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/schemas/HostingModSecurityRuleResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:write @@ -3729,47 +2561,28 @@ paths: tags: - Hosting summary: Delete all ModSecurity rules - description: Disable all ModSecurity rules for a hosting + description: >- + Enables again all the ModSecurity rules disabled on the hosting: + ModSecurity applies them again and their `included` becomes false. The + rules stay in the list operationId: deleteAllHostingModSecurityRules parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/EmptyResponse' + '204': + description: No Content '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:write @@ -3781,16 +2594,8 @@ paths: description: Get a ModSecurity rule details operationId: getHostingModSecurityRule parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer - - name: rule_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' + - $ref: '#/components/parameters/RuleId' responses: '200': description: OK @@ -3799,31 +2604,17 @@ paths: schema: $ref: '#/components/schemas/HostingModSecurityRuleResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:read @@ -3831,52 +2622,29 @@ paths: tags: - Hosting summary: Delete ModSecurity rule - description: Disable a ModSecurity rule by id + description: >- + Enables again the ModSecurity rule `rule_id` on the hosting: ModSecurity + applies it again and its `included` becomes false. The rule stays in the + list operationId: deleteHostingModSecurityRule parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer - - name: rule_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' + - $ref: '#/components/parameters/RuleId' responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/EmptyResponse' + '204': + description: No Content '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:write @@ -3885,14 +2653,12 @@ paths: tags: - Hosting summary: Update file protection status - description: Enable or disable file protection + description: >- + Enable or disable file protection. Returns the updated hosting, with + `file_protection_enabled` operationId: updateHostingFileProtection parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' requestBody: required: true content: @@ -3907,31 +2673,17 @@ paths: schema: $ref: '#/components/schemas/HostingResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:write @@ -3940,14 +2692,14 @@ paths: tags: - Hosting summary: Update HTTP version - description: Change HTTP version for hosting + description: >- + Change HTTP version for hosting. Returns the updated hosting, with + `http_version`. Not available (403) on a dedicated web server, on a + non-Linux hosting or without multi-PHP; 409 while the purchase is + suspended or the hosting is under maintenance operationId: updateHostingHttpVersion parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' requestBody: required: true content: @@ -3962,31 +2714,19 @@ paths: schema: $ref: '#/components/schemas/HostingResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:write @@ -3998,11 +2738,7 @@ paths: description: Get available PHP versions for hosting operationId: listHostingPhpVersions parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' responses: '200': description: OK @@ -4011,31 +2747,17 @@ paths: schema: $ref: '#/components/schemas/HostingPhpVersionListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:read @@ -4044,14 +2766,15 @@ paths: tags: - Hosting summary: Update PHP settings - description: Update a PHP setting for hosting + description: >- + Update a PHP setting for hosting. Returns the updated hosting: + `php_settings` lists the directives changed from the default value of + the web server. Not available (403) on a dedicated web server, on a + non-Linux hosting or without multi-PHP; 409 while the purchase is + suspended or the hosting is under maintenance operationId: updateHostingPhpSettings parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' requestBody: required: true content: @@ -4066,31 +2789,19 @@ paths: schema: $ref: '#/components/schemas/HostingResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:write @@ -4099,14 +2810,14 @@ paths: tags: - Hosting summary: Update PHP version - description: Change PHP version for hosting + description: >- + Change PHP version for hosting. Returns the updated hosting, with + `php_version`. Not available (403) on a dedicated web server, on a + non-Linux hosting or without multi-PHP; 409 while the purchase is + suspended or the hosting is under maintenance operationId: updateHostingPhpVersion parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' requestBody: required: true content: @@ -4121,31 +2832,19 @@ paths: schema: $ref: '#/components/schemas/HostingResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:write @@ -4157,65 +2856,28 @@ paths: description: Get latest antivirus scan status for hosting operationId: getHostingAntivirus parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' responses: '200': - description: OK + description: >- + Running scan, or the latest one; `data` is null when the hosting has + never been scanned content: application/json: schema: - properties: - error: - type: integer - example: 0 - message: - type: - - string - - 'null' - data: - anyOf: - - $ref: '#/components/schemas/HostingAntivirus' - - type: 'null' - meta: - type: - - object - - 'null' - type: object - required: - - error - - message - - data - - meta + $ref: '#/components/schemas/HostingAntivirusNullableResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:read @@ -4227,23 +2889,9 @@ paths: description: Get a list of antivirus scans for hosting operationId: listHostingAntivirusScans parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/HostingId' + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -4252,31 +2900,17 @@ paths: schema: $ref: '#/components/schemas/HostingAntivirusScanPaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:read @@ -4287,44 +2921,34 @@ paths: description: Start a manual antivirus scan for hosting operationId: startHostingAntivirusScan parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' responses: - '200': - description: OK + '201': + description: Created + headers: + Location: + description: URL of the created resource + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/HostingAntivirusScanResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:write @@ -4336,16 +2960,8 @@ paths: description: Get antivirus scan details operationId: getHostingAntivirusScan parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer - - name: antivirus_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' + - $ref: '#/components/parameters/AntivirusId' responses: '200': description: OK @@ -4354,31 +2970,17 @@ paths: schema: $ref: '#/components/schemas/HostingAntivirusScanResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:read @@ -4390,23 +2992,9 @@ paths: description: Get a list of antivirus removal scans for hosting operationId: listHostingAntivirusRemovalScans parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/HostingId' + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -4416,31 +3004,17 @@ paths: $ref: >- #/components/schemas/HostingAntivirusRemovalScanPaginatedListResponse '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:read @@ -4451,44 +3025,34 @@ paths: description: Start an antivirus removal scan for hosting operationId: startHostingAntivirusRemovalScan parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' responses: - '200': - description: OK + '201': + description: Created + headers: + Location: + description: URL of the created resource + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/HostingAntivirusRemovalScanResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:write @@ -4500,16 +3064,8 @@ paths: description: Get antivirus removal scan details operationId: getHostingAntivirusRemovalScan parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer - - name: removal_scan_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' + - $ref: '#/components/parameters/RemovalScanId' responses: '200': description: OK @@ -4518,31 +3074,17 @@ paths: schema: $ref: '#/components/schemas/HostingAntivirusRemovalScanResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:read @@ -4554,11 +3096,7 @@ paths: description: Get list of SSL certificates installed on hosting operationId: listHostingSslCertificates parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' responses: '200': description: OK @@ -4567,31 +3105,17 @@ paths: schema: $ref: '#/components/schemas/HostingSslCertificateListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:read @@ -4604,11 +3128,7 @@ paths: Encrypt operationId: installHostingSslCertificate parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' requestBody: required: false content: @@ -4616,38 +3136,36 @@ paths: schema: $ref: '#/components/schemas/HostingSslCertificateInstallRequest' responses: - '200': - description: OK + '202': + description: >- + Accepted: the operation goes on in the background, as the returned + Task + headers: + Location: + description: >- + URL of the Task: `/api/v3/tasks/{task_id}`. Reading it requires + the `purchases:read` scope + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/TaskResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:write @@ -4659,16 +3177,8 @@ paths: description: Get details of a hosting SSL certificate installation operationId: getHostingSslCertificate parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer - - name: hosting_ssl_certificate_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' + - $ref: '#/components/parameters/HostingSslCertificateId' responses: '200': description: OK @@ -4677,31 +3187,17 @@ paths: schema: $ref: '#/components/schemas/HostingSslCertificateResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:read @@ -4712,153 +3208,112 @@ paths: description: Remove an SSL certificate installation from hosting operationId: removeHostingSslCertificate parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer - - name: hosting_ssl_certificate_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' + - $ref: '#/components/parameters/HostingSslCertificateId' responses: - '200': - description: OK + '202': + description: >- + Accepted: the operation goes on in the background, as the returned + Task + headers: + Location: + description: >- + URL of the Task: `/api/v3/tasks/{task_id}`. Reading it requires + the `purchases:read` scope + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/TaskResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:write - /api/v3/hostings/{hosting_id}/backups/first-save: - post: + /api/v3/hostings/{hosting_id}/backups: + get: tags: - Hosting - summary: Start hosting backup - description: Start a backup for hosting - operationId: startHostingFirstBackup + summary: List hosting backups + description: Get list of backups for hosting + operationId: listHostingBackups parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/TaskResponse' + $ref: '#/components/schemas/HostingBackupListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - - hosting:write - /api/v3/hostings/{hosting_id}/backups/exhibit: + - hosting:read post: tags: - Hosting - summary: Expose hosting backups - description: Expose backups for hosting - operationId: exposeHostingBackups + summary: Start hosting backup + description: Start a backup for hosting + operationId: startHostingFirstBackup parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/HostingBackupExposeRequest' + - $ref: '#/components/parameters/HostingId' responses: - '200': - description: OK + '202': + description: >- + Accepted: the operation goes on in the background, as the returned + Task + headers: + Location: + description: >- + URL of the Task: `/api/v3/tasks/{task_id}`. Reading it requires + the `purchases:read` scope + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/TaskResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:write @@ -4870,11 +3325,7 @@ paths: description: Get list of exposed backups for hosting operationId: listHostingExposedBackups parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' responses: '200': description: OK @@ -4883,34 +3334,71 @@ paths: schema: $ref: '#/components/schemas/HostingBackupListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found + $ref: '#/components/responses/NotFound' + '429': + $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' + security: + - oauth2: + - hosting:read + post: + tags: + - Hosting + summary: Expose hosting backups + description: >- + Exposes a web backup, a database backup or both, chosen among those of + the backup list by `backup_id` and `category`. The exposure is + asynchronous and is returned as a Task. + operationId: exposeHostingBackups + parameters: + - $ref: '#/components/parameters/HostingId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/HostingBackupExposeRequest' + responses: + '202': + description: >- + Accepted: the operation goes on in the background, as the returned + Task + headers: + Location: + description: >- + URL of the Task: `/api/v3/tasks/{task_id}`. Reading it requires + the `purchases:read` scope + required: true + schema: + type: string content: application/json: schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/schemas/TaskResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - - hosting:read + - hosting:write /api/v3/hostings/{hosting_id}/backups/exhibitions/{hosting_backup_id}: delete: tags: @@ -4919,206 +3407,119 @@ paths: description: Delete a single exposed backup for hosting operationId: deleteHostingExposedBackup parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer - - name: hosting_backup_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' + - $ref: '#/components/parameters/HostingBackupId' responses: - '200': - description: OK + '202': + description: >- + Accepted: the operation goes on in the background, as the returned + Task + headers: + Location: + description: >- + URL of the Task: `/api/v3/tasks/{task_id}`. Reading it requires + the `purchases:read` scope + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/TaskResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:write - /api/v3/hostings/{hosting_id}/backups: + /api/v3/hostings/{hosting_id}/backups/{hosting_backup_id}: get: tags: - Hosting - summary: List hosting backups - description: Get list of backups for hosting - operationId: listHostingBackups + summary: Get hosting backup + description: >- + Returns a backup among those of the backup list (active, successful and + completed backups); any other backup responds 404. + operationId: getHostingBackup parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' + - $ref: '#/components/parameters/HostingBackupId' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/HostingBackupListResponse' + $ref: '#/components/schemas/HostingBackupResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '429': - $ref: '#/components/responses/TooManyRequests' - security: - - oauth2: - - hosting:read - /api/v3/hostings/{hosting_id}/backups/{hosting_backup_id}: - get: - tags: - - Hosting - summary: Get hosting backup - description: Get details of a hosting backup - operationId: getHostingBackup - parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer - - name: hosting_backup_id - in: path - required: true - schema: - type: integer - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/HostingBackupResponse' - '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:read - /api/v3/hostings/{hosting_id}/backups/{hosting_backup_id}/restore: + /api/v3/hostings/{hosting_id}/backups/{hosting_backup_id}/restores: post: tags: - Hosting summary: Restore hosting backup - description: Start a restore of a hosting backup (web contents) + description: >- + Starts the restore of the web contents of a backup among those of the + backup list. The restore is asynchronous and is returned as a Task. operationId: restoreHostingBackup parameters: - - name: hosting_id - in: path - required: true - schema: - type: integer - - name: hosting_backup_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/HostingId' + - $ref: '#/components/parameters/HostingBackupId' responses: - '200': - description: OK + '202': + description: >- + Accepted: the operation goes on in the background, as the returned + Task + headers: + Location: + description: >- + URL of the Task: `/api/v3/tasks/{task_id}`. Reading it requires + the `purchases:read` scope + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/TaskResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - hosting:write @@ -5127,38 +3528,34 @@ paths: tags: - Billing summary: List all Invoices - description: Get a list of all Invoices + description: |- + Get a list of all Invoices + + Not available to sub-accounts: the response is 403 (error 1601). operationId: listInvoices parameters: - name: date_emission_from in: query + description: Only the invoices issued on or after this date (YYYY-MM-DD) required: false schema: type: string format: date - name: date_emission_to in: query + description: Only the invoices issued on or before this date (YYYY-MM-DD) required: false schema: type: string format: date - name: payed in: query + description: 'true: only the paid invoices; false: only the unpaid ones' required: false schema: type: boolean - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -5167,47 +3564,33 @@ paths: schema: $ref: '#/components/schemas/InvoicePaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - billing:read + x-sub-accounts: false /api/v3/invoices/{invoice_id}: get: tags: - Billing summary: Get an invoice - description: Get details of an invoice + description: |- + Get details of an invoice + + Not available to sub-accounts: the response is 403 (error 1601). operationId: getInvoice parameters: - - name: invoice_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/InvoiceId' responses: '200': description: OK @@ -5216,47 +3599,33 @@ paths: schema: $ref: '#/components/schemas/InvoiceResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - billing:read + x-sub-accounts: false /api/v3/invoices/{invoice_id}/rows: get: tags: - Billing summary: List all invoice rows - description: Get the list of all the rows of an Invoice + description: |- + Get the list of all the rows of an Invoice + + Not available to sub-accounts: the response is 403 (error 1601). operationId: listInvoiceRows parameters: - - name: invoice_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/InvoiceId' responses: '200': description: OK @@ -5265,52 +3634,34 @@ paths: schema: $ref: '#/components/schemas/InvoiceRowListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - billing:read + x-sub-accounts: false /api/v3/invoices/{invoice_id}/rows/{row_id}: get: tags: - Billing summary: Get an invoice row - description: Get details of an Invoice row + description: |- + Get details of an Invoice row + + Not available to sub-accounts: the response is 403 (error 1601). operationId: getInvoiceRow parameters: - - name: invoice_id - in: path - required: true - schema: - type: integer - - name: row_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/InvoiceId' + - $ref: '#/components/parameters/RowId' responses: '200': description: OK @@ -5319,47 +3670,33 @@ paths: schema: $ref: '#/components/schemas/InvoiceRowResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - billing:read - /api/v3/invoices/{invoice_id}/download: + x-sub-accounts: false + /api/v3/invoices/{invoice_id}/xml: get: tags: - Billing summary: Download invoice XML - description: Download the XML file of an Invoice + description: |- + Download the XML file of an Invoice + + Not available to sub-accounts: the response is 403 (error 1601). operationId: downloadInvoiceXml parameters: - - name: invoice_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/InvoiceId' - name: prefer_xml in: query description: >- @@ -5403,53 +3740,39 @@ paths: type: string format: binary '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - billing:read - /api/v3/invoices/{invoice_id}/download/pdf: + x-sub-accounts: false + /api/v3/invoices/{invoice_id}/pdf: get: tags: - Billing summary: Download invoice PDF - description: Download the courtesy PDF file of an Invoice + description: |- + Download the courtesy PDF file of an Invoice + + Not available to sub-accounts: the response is 403 (error 1601). operationId: downloadInvoicePdf parameters: - - name: invoice_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/InvoiceId' responses: '200': description: OK (file download) headers: Content-Length: - description: Dimensione del file in byte. + description: Size of the file in bytes. schema: type: integer format: int64 @@ -5475,34 +3798,21 @@ paths: type: string format: binary '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - billing:read + x-sub-accounts: false /api/v3/licenses/plesk: get: tags: @@ -5511,51 +3821,27 @@ paths: description: Get a paginated list of Plesk licenses for the authenticated account operationId: listPleskLicenses parameters: - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/PleskLicensePaginatedListResponse' + $ref: '#/components/schemas/LicensePaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - weblicense:read @@ -5567,51 +3853,27 @@ paths: description: Get a paginated list of cPanel licenses for the authenticated account operationId: listCpanelLicenses parameters: - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/CpanelLicensePaginatedListResponse' + $ref: '#/components/schemas/LicensePaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - weblicense:read @@ -5623,44 +3885,26 @@ paths: description: Get details of a cPanel license operationId: getCpanelLicense parameters: - - name: license_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/LicenseId' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/CpanelLicenseResponse' + $ref: '#/components/schemas/LicenseResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - weblicense:read @@ -5672,843 +3916,374 @@ paths: description: Get details of a Plesk license operationId: getPleskLicense parameters: - - name: license_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/LicenseId' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/PleskLicenseResponse' + $ref: '#/components/schemas/LicenseResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - weblicense:read - /api/v3/securemails: + /api/v3/microsoft-365-subscriptions: get: tags: - License - summary: List SecureMail subscriptions + summary: List Microsoft 365 subscriptions description: >- - Get a paginated list of SecureMail by LibraESVA subscriptions for the + Get a paginated list of Microsoft 365 subscriptions for the authenticated account - operationId: listSecureMails + operationId: listMicrosoft365Subscriptions parameters: - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/SecuremailPaginatedListResponse' + $ref: '#/components/schemas/Microsoft365PaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - - securemail:read - /api/v3/securemails/{securemail_id}: + - m365:read + /api/v3/microsoft-365-subscriptions/{microsoft_365_subscription_id}: get: tags: - License - summary: Get SecureMail subscription - description: Get details of a SecureMail by LibraESVA subscription - operationId: getSecureMail + summary: Get Microsoft 365 subscription + description: Get details of a Microsoft 365 subscription + operationId: getMicrosoft365Subscription parameters: - - name: securemail_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/Microsoft365SubscriptionId' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/SecuremailResponse' + $ref: '#/components/schemas/Microsoft365Response' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - - securemail:read - /api/v3/securemails/{securemail_id}/statistics: + - m365:read + /api/v3/microsoft-365-tenants: get: tags: - License - summary: Get SecureMail statistics - description: Get statistics for a SecureMail by LibraESVA subscription - operationId: getSecureMailStatistics + summary: List Microsoft 365 tenants + description: >- + Get a paginated list of Microsoft 365 tenants for the authenticated + account + operationId: listMicrosoft365Tenants parameters: - - name: securemail_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/SecuremailStatisticsResponse' + $ref: '#/components/schemas/Microsoft365TenantPaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - - securemail:read - /api/v3/securemails/{securemail_id}/mailboxes: + - m365:read + /api/v3/microsoft-365-tenants/{microsoft_365_tenant_id}: get: tags: - License - summary: List SecureMail mailboxes - description: >- - Get a paginated list of primary mailboxes for a SecureMail by LibraESVA - subscription - operationId: listSecureMailMailboxes + summary: Get Microsoft 365 tenant + description: Get details of a Microsoft 365 tenant + operationId: getMicrosoft365Tenant parameters: - - name: securemail_id - in: path - required: true - schema: - type: integer - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/Microsoft365TenantId' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/SecuremailMailboxPaginatedListResponse' + $ref: '#/components/schemas/Microsoft365TenantResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - - securemail:read - /api/v3/securemails/{securemail_id}/quantity-upgrade: + - m365:read + /api/v3/microsoft-365-subscriptions/{microsoft_365_subscription_id}/quantity-upgrades: post: tags: - License - summary: Upgrade SecureMail quantity + summary: Upgrade Microsoft 365 subscription quantity description: >- - Increase the SecureMail protected mailboxes quantity. Returns the - generated Order to pay the additional mailboxes. - operationId: upgradeSecureMailQuantity + Increase the Microsoft 365 seats quantity. Returns the generated Order + to pay the additional seats. + + + Not available to sub-accounts: the response is 403 (error 1601). + operationId: upgradeMicrosoft365SubscriptionQuantity parameters: - - name: securemail_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/Microsoft365SubscriptionId' requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/SecuremailQuantityRequest' + $ref: '#/components/schemas/Microsoft365SubscriptionQuantityRequest' responses: - '200': - description: OK + '201': + description: Created + headers: + Location: + description: URL of the created resource + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/OrderResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - - securemail:write - /api/v3/securemails/{securemail_id}/quantity-downgrade: - patch: + - m365:write + x-sub-accounts: false + /api/v3/microsoft-365-subscriptions/{microsoft_365_subscription_id}/quantity-downgrades: + post: tags: - License - summary: Downgrade SecureMail quantity + summary: Downgrade Microsoft 365 subscription quantity description: >- - Decrease the SecureMail protected mailboxes quantity. Returns the - background Task created for the alignment. - operationId: downgradeSecureMailQuantity + Decrease the Microsoft 365 seats quantity. Returns the background Task + created for seat removal. + + + Not available to sub-accounts: the response is 403 (error 1601). + operationId: downgradeMicrosoft365SubscriptionQuantity parameters: - - name: securemail_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/Microsoft365SubscriptionId' requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/SecuremailQuantityRequest' + $ref: '#/components/schemas/Microsoft365SubscriptionQuantityRequest' responses: - '200': - description: OK + '202': + description: >- + Accepted: the operation goes on in the background, as the returned + Task + headers: + Location: + description: >- + URL of the Task: `/api/v3/tasks/{task_id}`. Reading it requires + the `purchases:read` scope + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/TaskResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - - securemail:write - /api/v3/microsoft365-subscriptions: + - m365:write + x-sub-accounts: false + /api/v3/shop/microsoft-365/services/{service_id}/partner-link: get: tags: - License - summary: List Microsoft 365 subscriptions - description: >- - Get a paginated list of Microsoft 365 subscriptions for the - authenticated account - operationId: listMicrosoft365Subscriptions + summary: Partner link + description: |- + Get the partner authorization link for Microsoft 365 subscriptions + + Not available to sub-accounts: the response is 403 (error 1601). + operationId: getMicrosoft365PartnerLink parameters: - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/ServiceId' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/Microsoft365PaginatedListResponse' + $ref: '#/components/schemas/Microsoft365PartnerLinkResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - m365:read - /api/v3/microsoft365-subscriptions/{microsoft365_id}: + x-sub-accounts: false + /api/v3/one-clicks: get: tags: - - License - summary: Get Microsoft 365 subscription - description: Get details of a Microsoft 365 subscription - operationId: getMicrosoft365Subscription + - Payment + summary: List all One-Clicks + description: |- + Get a list of all active One-Click Payments + + Not available to sub-accounts: the response is 403 (error 1601). + operationId: listOneClicks parameters: - - name: microsoft365_id - in: path - required: true + - name: payment_method + in: query + description: >- + Only the One-Clicks of this payment method, as in the + `payment_method` field + required: false schema: - type: integer + type: string + - name: date_created_from + in: query + description: >- + Only the One-Clicks created at or after this time (ISO 8601 UTC: + YYYY-MM-DDTHH:MM:SSZ) + required: false + schema: + type: string + format: date-time + - name: date_created_to + in: query + description: >- + Only the One-Clicks created at or before this time (ISO 8601 UTC: + YYYY-MM-DDTHH:MM:SSZ) + required: false + schema: + type: string + format: date-time + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/Microsoft365Response' + $ref: '#/components/schemas/OneClickPaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '429': - $ref: '#/components/responses/TooManyRequests' - security: - - oauth2: - - m365:read - /api/v3/microsoft365-tenants: - get: - tags: - - License - summary: List Microsoft 365 tenants - description: >- - Get a paginated list of Microsoft 365 tenants for the authenticated - account - operationId: listMicrosoft365Tenants - parameters: - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Microsoft365TenantPaginatedListResponse' - '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '429': - $ref: '#/components/responses/TooManyRequests' - security: - - oauth2: - - m365:read - /api/v3/microsoft365-tenants/{microsoft_365_tenant_id}: - get: - tags: - - License - summary: Get Microsoft 365 tenant - description: Get details of a Microsoft 365 tenant - operationId: getMicrosoft365Tenant - parameters: - - name: microsoft_365_tenant_id - in: path - required: true - schema: - type: integer - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Microsoft365TenantResponse' - '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '429': - $ref: '#/components/responses/TooManyRequests' - security: - - oauth2: - - m365:read - /api/v3/microsoft365-subscriptions/{microsoft365_id}/quantity-upgrade: - post: - tags: - - License - summary: Upgrade Microsoft 365 subscription quantity - description: >- - Increase the Microsoft 365 seats quantity. Returns the generated Order - to pay the additional seats. - operationId: upgradeMicrosoft365SubscriptionQuantity - parameters: - - name: microsoft365_id - in: path - required: true - schema: - type: integer - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Microsoft365SubscriptionQuantityRequest' - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/OrderResponse' - '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '429': - $ref: '#/components/responses/TooManyRequests' - security: - - oauth2: - - m365:write - /api/v3/microsoft365-subscriptions/{microsoft365_id}/quantity-downgrade: - patch: - tags: - - License - summary: Downgrade Microsoft 365 subscription quantity - description: >- - Decrease the Microsoft 365 seats quantity. Returns the background Task - created for seat removal. - operationId: downgradeMicrosoft365SubscriptionQuantity - parameters: - - name: microsoft365_id - in: path - required: true - schema: - type: integer - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Microsoft365SubscriptionQuantityRequest' - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/TaskResponse' - '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '429': - $ref: '#/components/responses/TooManyRequests' - security: - - oauth2: - - m365:write - /api/v3/microsoft365-subscriptions/partner-link/{service_id}: - get: - tags: - - License - summary: Partner link - description: Get the partner authorization link for Microsoft 365 subscriptions - operationId: getMicrosoft365PartnerLink - parameters: - - name: service_id - in: path - required: true - schema: - type: integer - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Microsoft365PartnerLinkResponse' - '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '429': - $ref: '#/components/responses/TooManyRequests' - security: - - oauth2: - - m365:read - /api/v3/one-clicks: - get: - tags: - - Payment - summary: List all One-Clicks - description: Get a list of all active One-Click Payments - operationId: listOneClicks - parameters: - - name: payment_method - in: query - required: false - schema: - type: string - - name: date_created_from - in: query - required: false - schema: - type: string - format: date-time - - name: date_created_to - in: query - required: false - schema: - type: string - format: date-time - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/OneClickPaginatedListResponse' - '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - payment:read + x-sub-accounts: false /api/v3/one-clicks/{one_click_id}: get: tags: - Payment summary: Get a One-Click - description: Get details of an active One-Click Payment + description: |- + Get details of an active One-Click Payment + + Not available to sub-accounts: the response is 403 (error 1601). operationId: getOneClick parameters: - - name: one_click_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/OneClickId' responses: '200': description: OK @@ -6517,40 +4292,30 @@ paths: schema: $ref: '#/components/schemas/OneClickResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - payment:read - /api/v3/one-clicks/autorenew: + x-sub-accounts: false + /api/v3/one-clicks/auto-renewal: get: tags: - Payment summary: Get autorenew status - description: Get the status of the automatic renewal service with One-Click Payment + description: |- + Get the status of the automatic renewal service with One-Click Payment + + Not available to sub-accounts: the response is 403 (error 1601). operationId: getOneClickAutorenew responses: '200': @@ -6560,124 +4325,100 @@ paths: schema: $ref: '#/components/schemas/OneClickAutorenewResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - payment:read + x-sub-accounts: false post: tags: - Payment summary: Activate One-Click autorenew - description: Activate automatic renewal service with One-Click Payment + description: |- + Activate automatic renewal service with One-Click Payment + + Not available to sub-accounts: the response is 403 (error 1601). operationId: activateOneClickAutorenew responses: - '200': - description: OK + '201': + description: Created + headers: + Location: + description: URL of the created resource + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/OneClickAutorenewResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - payment:write + x-sub-accounts: false delete: tags: - Payment summary: Revoke One-Click autorenew - description: Revoke automatic renewal service with One-Click Payment + description: |- + Revoke automatic renewal service with One-Click Payment + + Not available to sub-accounts: the response is 403 (error 1601). operationId: revokeOneClickAutorenew responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/EmptyResponse' + '204': + description: No Content '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - payment:write + x-sub-accounts: false /api/v3/orders: get: tags: - Shop summary: List all Orders - description: Get a list of all Orders + description: |- + Get a list of all Orders + + Not available to sub-accounts: the response is 403 (error 1601). operationId: listOrders parameters: - name: order_status @@ -6697,43 +4438,42 @@ paths: - R - name: invoice_id in: query + description: Only the orders of the invoice with this ID required: false schema: type: integer - name: purchase_id in: query + description: Only the orders that include the purchase with this ID required: false schema: type: integer - name: payed in: query + description: 'true: only the paid orders; false: only those not paid yet' required: false schema: type: boolean - name: date_created_from in: query + description: >- + Only the orders created at or after this time (ISO 8601 UTC: + YYYY-MM-DDTHH:MM:SSZ) required: false schema: type: string format: date-time - name: date_created_to in: query + description: >- + Only the orders created at or before this time (ISO 8601 UTC: + YYYY-MM-DDTHH:MM:SSZ) required: false schema: type: string format: date-time - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -6742,47 +4482,33 @@ paths: schema: $ref: '#/components/schemas/OrderPaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - shop:read + x-sub-accounts: false /api/v3/orders/{order_id}: get: tags: - Shop summary: Get an order - description: Get details of an order + description: |- + Get details of an order + + Not available to sub-accounts: the response is 403 (error 1601). operationId: getOrder parameters: - - name: order_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/OrderId' responses: '200': description: OK @@ -6791,95 +4517,65 @@ paths: schema: $ref: '#/components/schemas/OrderResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - shop:read + x-sub-accounts: false delete: tags: - Shop summary: Cancel order - description: Cancel an Order + description: |- + Cancel an Order + + Not available to sub-accounts: the response is 403 (error 1601). operationId: cancelOrder parameters: - - name: order_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/OrderId' responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/EmptyResponse' + '204': + description: No Content '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - shop:write + x-sub-accounts: false /api/v3/orders/{order_id}/can-cancel: get: tags: - Shop summary: Can cancel order - description: Know if it's possible to cancel an Order + description: |- + Know if it's possible to cancel an Order + + Not available to sub-accounts: the response is 403 (error 1601). operationId: canCancelOrder parameters: - - name: order_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/OrderId' responses: '200': description: OK @@ -6888,171 +4584,92 @@ paths: schema: $ref: '#/components/schemas/OrderCanCancelResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - shop:read + x-sub-accounts: false /api/v3/orders/{order_id}/can-pay: get: tags: - Shop summary: Can pay Order - description: Know if it's possible to complete the payment for an Order + description: >- + Whether the order can be paid now with a payment method, with the amount + to pay, commission of the method included, and the orders paid together + with it. Send either `one_click_id` or `prepaid_credit=true` (400 + otherwise). `can_pay` is false when the order cannot be paid now, when + the One-Click method is not active or has expired, or when the prepaid + credit cannot be used for these orders or is not enough. 404 when the + One-Click method does not exist or belongs to another account + + + Not available to sub-accounts: the response is 403 (error 1601). operationId: canPayOrder parameters: - - name: order_id - in: path - required: true - schema: - type: integer - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/OrderCanPayResponse' - '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '429': - $ref: '#/components/responses/TooManyRequests' - security: - - oauth2: - - shop:read - /api/v3/orders/pay: - post: - tags: - - Shop - summary: Pay Orders - description: >- - Pay one or more Orders. The response data is the payment, or null when - there is nothing to pay (total amount to pay = 0.00). - operationId: payOrders - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OrderPayRequest' + - $ref: '#/components/parameters/OrderId' + - name: one_click_id + in: query + description: >- + Id of the One-Click payment method to pay with (`GET + /api/v3/one-clicks`); send it or `prepaid_credit`, not both + required: false + schema: + type: integer + minimum: 1 + - name: prepaid_credit + in: query + description: >- + `true` to pay with the prepaid credit; send it or `one_click_id`, + not both + required: false + schema: + type: boolean responses: '200': description: OK content: application/json: schema: - properties: - error: - type: integer - example: 0 - message: - type: - - string - - 'null' - data: - description: >- - Payment data, null when there is nothing to pay (total - amount to pay = 0.00) - anyOf: - - $ref: '#/components/schemas/Payment' - - type: 'null' - meta: - type: - - object - - 'null' - type: object - required: - - error - - message - - data - - meta + $ref: '#/components/schemas/OrderCanPayResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - - shop:write + - shop:read + x-sub-accounts: false /api/v3/orders/{order_id}/rows: get: tags: - Shop summary: List all Order rows - description: Get the list of all the rows of an Order + description: |- + Get the list of all the rows of an Order + + Not available to sub-accounts: the response is 403 (error 1601). operationId: listOrderRows parameters: - - name: order_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/OrderId' responses: '200': description: OK @@ -7061,52 +4678,34 @@ paths: schema: $ref: '#/components/schemas/OrderRowListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - shop:read + x-sub-accounts: false /api/v3/orders/{order_id}/rows/{row_id}: get: tags: - Shop summary: Get an order row - description: Get details of an Order row + description: |- + Get details of an Order row + + Not available to sub-accounts: the response is 403 (error 1601). operationId: getOrderRow parameters: - - name: order_id - in: path - required: true - schema: - type: integer - - name: row_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/OrderId' + - $ref: '#/components/parameters/RowId' responses: '200': description: OK @@ -7115,71 +4714,60 @@ paths: schema: $ref: '#/components/schemas/OrderRowResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - shop:read + x-sub-accounts: false /api/v3/payments: get: tags: - Payment summary: List all Payments - description: Get a list of all Payments + description: |- + Get a list of all Payments + + Not available to sub-accounts: the response is 403 (error 1601). operationId: listPayments parameters: - name: payment_method in: query + description: >- + Only the payments made with this payment method, as in the + `payment_method` field required: false schema: type: string - name: date_payment_from in: query + description: >- + Only the payments made at or after this time (ISO 8601 UTC: + YYYY-MM-DDTHH:MM:SSZ) required: false schema: type: string format: date-time - name: date_payment_to in: query + description: >- + Only the payments made at or before this time (ISO 8601 UTC: + YYYY-MM-DDTHH:MM:SSZ) required: false schema: type: string format: date-time - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -7188,47 +4776,33 @@ paths: schema: $ref: '#/components/schemas/PaymentPaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - payment:read + x-sub-accounts: false /api/v3/payments/{payment_id}: get: tags: - Payment summary: Get a payment - description: Get details of a payment + description: |- + Get details of a payment + + Not available to sub-accounts: the response is 403 (error 1601). operationId: getPayment parameters: - - name: payment_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/PaymentId' responses: '200': description: OK @@ -7237,34 +4811,143 @@ paths: schema: $ref: '#/components/schemas/PaymentResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '429': + $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' + security: + - oauth2: + - payment:read + x-sub-accounts: false + /api/v3/payments/one-click: + post: + tags: + - Payment + summary: Pay orders with One-Click + description: >- + Pays one or more orders together with a One-Click payment method: the + one in `one_click_id` or, without it, the default one (the first active + method in the order chosen by the customer). Only that method is tried: + when the provider declines the payment the response is 402, with the + message of the provider, and the orders are still to be paid. When there + is nothing to pay (total 0.00) the orders are confirmed without a + payment and the response is 204. The response is 409 when payments are + not possible at this time, the orders cannot be paid together, there is + no active One-Click payment method, or the payment exceeds the payment + limits allowed at this time (for example in the evening). + + + Not available to sub-accounts: the response is 403 (error 1601). + operationId: createOneClickPayment + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OneClickPaymentCreateRequest' + responses: + '201': + description: Created + headers: + Location: + description: URL of the created resource + required: true + schema: + type: string content: application/json: schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/schemas/PaymentResponse' + '204': + description: >- + Nothing to pay (total 0.00): the orders are confirmed without a + payment + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '402': + $ref: '#/components/responses/PaymentDeclined' + '403': + $ref: '#/components/responses/Forbidden' '404': - description: Not found + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' + '429': + $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' + security: + - oauth2: + - payment:write + x-sub-accounts: false + /api/v3/payments/prepaid-credit: + post: + tags: + - Payment + summary: Pay orders with the prepaid credit + description: >- + Pays one or more orders together with the prepaid credit. When there is + nothing to pay (total 0.00) the orders are confirmed without a payment + and the response is 204. The response is 409 when payments are not + possible at this time, the orders cannot be paid together, the prepaid + credit cannot be used for them (for example because it is not enough), + or the payment exceeds the payment limits allowed at this time. + + + Not available to sub-accounts: the response is 403 (error 1601). + operationId: createPrepaidCreditPayment + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PrepaidCreditPaymentCreateRequest' + responses: + '201': + description: Created + headers: + Location: + description: URL of the created resource + required: true + schema: + type: string content: application/json: schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/schemas/PaymentResponse' + '204': + description: >- + Nothing to pay (total 0.00): the orders are confirmed without a + payment + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '402': + $ref: '#/components/responses/PaymentDeclined' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - - payment:read + - payment:write + x-sub-accounts: false /api/v3/pec-domains: get: tags: @@ -7273,18 +4956,8 @@ paths: description: Get a paginated list of PEC domains for the authenticated account operationId: listPecDomains parameters: - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -7293,31 +4966,17 @@ paths: schema: $ref: '#/components/schemas/PecDomainPaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - pec:read @@ -7329,11 +4988,7 @@ paths: description: Get details of a PEC domain for the authenticated account operationId: getPecDomain parameters: - - name: pec_domain_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/PecDomainId' responses: '200': description: OK @@ -7342,31 +4997,17 @@ paths: schema: $ref: '#/components/schemas/PecDomainResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - pec:read @@ -7378,23 +5019,9 @@ paths: description: Get a paginated list of owner change requests for a PEC domain operationId: listPecDomainOwnerChanges parameters: - - name: pec_domain_id - in: path - required: true - schema: - type: integer - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/PecDomainId' + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -7403,31 +5030,17 @@ paths: schema: $ref: '#/components/schemas/PecOwnerChangePaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - pec:read @@ -7438,11 +5051,7 @@ paths: description: Create a new owner change request for a PEC domain operationId: createPecDomainOwnerChange parameters: - - name: pec_domain_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/PecDomainId' requestBody: required: true content: @@ -7450,38 +5059,32 @@ paths: schema: $ref: '#/components/schemas/PecMailboxOwnerChangeCreateRequest' responses: - '200': - description: OK + '201': + description: Created + headers: + Location: + description: URL of the created resource + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/PecOwnerChangeResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - pec:write @@ -7493,49 +5096,27 @@ paths: description: Get details of a specific owner change request for a PEC domain operationId: getPecDomainOwnerChange parameters: - - name: pec_domain_id - in: path - required: true - schema: - type: integer - - name: owner_change_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/PecDomainId' + - $ref: '#/components/parameters/OwnerChangeId' responses: '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/PecOwnerChangeResponse' - '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '401': - description: Not authorized + description: OK content: application/json: schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/schemas/PecOwnerChangeResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - pec:read @@ -7547,18 +5128,8 @@ paths: description: Get a paginated list of PEC mailboxes for the authenticated account operationId: listPecMailboxes parameters: - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -7567,31 +5138,17 @@ paths: schema: $ref: '#/components/schemas/PecPaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - pec:read @@ -7603,11 +5160,7 @@ paths: description: Get details of a PEC mailbox for the authenticated account operationId: getPecMailbox parameters: - - name: pec_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/PecId' responses: '200': description: OK @@ -7616,31 +5169,17 @@ paths: schema: $ref: '#/components/schemas/PecResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - pec:read @@ -7651,11 +5190,7 @@ paths: description: Update PEC mailbox settings for the authenticated account operationId: updatePecMailbox parameters: - - name: pec_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/PecId' requestBody: required: true content: @@ -7670,31 +5205,17 @@ paths: schema: $ref: '#/components/schemas/PecResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - pec:write @@ -7706,23 +5227,9 @@ paths: description: Get a paginated list of owner change requests for a PEC mailbox operationId: listPecMailboxOwnerChanges parameters: - - name: pec_id - in: path - required: true - schema: - type: integer - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/PecId' + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -7731,31 +5238,17 @@ paths: schema: $ref: '#/components/schemas/PecOwnerChangePaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - pec:read @@ -7766,11 +5259,7 @@ paths: description: Create a new owner change request for a PEC mailbox operationId: createPecMailboxOwnerChange parameters: - - name: pec_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/PecId' requestBody: required: true content: @@ -7778,47 +5267,76 @@ paths: schema: $ref: '#/components/schemas/PecMailboxOwnerChangeCreateRequest' responses: - '200': - description: OK + '201': + description: Created + headers: + Location: + description: URL of the created resource + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/PecOwnerChangeResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' + '429': + $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' + security: + - oauth2: + - pec:write + /api/v3/pec-mailboxes/{pec_id}/owner-changes/{owner_change_id}: + get: + tags: + - Pec + summary: Get PEC mailbox owner change + description: Get details of a specific owner change request for a PEC mailbox + operationId: getPecMailboxOwnerChange + parameters: + - $ref: '#/components/parameters/PecId' + - $ref: '#/components/parameters/OwnerChangeId' + responses: + '200': + description: OK content: application/json: schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/schemas/PecOwnerChangeResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - - pec:write + - pec:read /api/v3/prepaid-credit: get: tags: - Payment summary: Prepaid credit account - description: Get details of the Prepaid Credit for the account + description: |- + Get details of the Prepaid Credit for the account + + Not available to sub-accounts: the response is 403 (error 1601). operationId: getPrepaidCredit responses: '200': @@ -7828,66 +5346,52 @@ paths: schema: $ref: '#/components/schemas/PrepaidCreditResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - payment:read + x-sub-accounts: false /api/v3/prepaid-credit/operations: get: tags: - Payment summary: List all Prepaid credit operations - description: Get a list of all Prepaid credit operations + description: |- + Get a list of all Prepaid credit operations + + Not available to sub-accounts: the response is 403 (error 1601). operationId: listPrepaidCreditOperations parameters: - name: date_created_from in: query + description: >- + Only the operations made at or after this time (ISO 8601 UTC: + YYYY-MM-DDTHH:MM:SSZ) required: false schema: type: string format: date-time - name: date_created_to in: query + description: >- + Only the operations made at or before this time (ISO 8601 UTC: + YYYY-MM-DDTHH:MM:SSZ) required: false schema: type: string format: date-time - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -7897,47 +5401,33 @@ paths: $ref: >- #/components/schemas/PrepaidCreditOperationPaginatedListResponse '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - payment:read + x-sub-accounts: false /api/v3/prepaid-credit/operations/{operation_id}: get: tags: - Payment summary: Get a Prepaid credit operation - description: Get details of a Prepaid credit operation + description: |- + Get details of a Prepaid credit operation + + Not available to sub-accounts: the response is 403 (error 1601). operationId: getPrepaidCreditOperation parameters: - - name: operation_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/OperationId' responses: '200': description: OK @@ -7946,86 +5436,80 @@ paths: schema: $ref: '#/components/schemas/PrepaidCreditOperationResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - payment:read - /api/v3/prepaid-credit/topups: + x-sub-accounts: false + /api/v3/prepaid-credit/top-ups: get: tags: - Payment summary: List all topups - description: Get a list of all Prepaid credit topups + description: |- + Get a list of all Prepaid credit topups + + Not available to sub-accounts: the response is 403 (error 1601). operationId: listPrepaidCreditTopups parameters: - name: invoice_id in: query + description: Only the top-ups of the invoice with this ID required: false schema: type: integer - name: with_current_credit in: query + description: 'true: only the top-ups with credit left; false: only those used up' required: false schema: type: boolean - name: refund_expired in: query + description: >- + true: only the top-ups that can no longer be refunded; false: only + those that still can required: false schema: type: boolean - name: credit_expired in: query + description: >- + true: only the top-ups whose credit has expired; false: only those + whose credit is still valid required: false schema: type: boolean - name: date_created_from in: query + description: >- + Only the top-ups made at or after this time (ISO 8601 UTC: + YYYY-MM-DDTHH:MM:SSZ) required: false schema: type: string format: date-time - name: date_created_to in: query + description: >- + Only the top-ups made at or before this time (ISO 8601 UTC: + YYYY-MM-DDTHH:MM:SSZ) required: false schema: type: string format: date-time - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -8034,39 +5518,29 @@ paths: schema: $ref: '#/components/schemas/PrepaidCreditTopupPaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - payment:read + x-sub-accounts: false post: tags: - Payment summary: Topup Prepaid credit - description: Topup Prepaid credit + description: |- + Topup Prepaid credit + + Not available to sub-accounts: the response is 403 (error 1601). operationId: createPrepaidCreditTopup requestBody: required: true @@ -8075,54 +5549,46 @@ paths: schema: $ref: '#/components/schemas/BuyPrepaidCreditTopupRequest' responses: - '200': - description: OK + '201': + description: Created + headers: + Location: + description: URL of the order, when only one is created + required: false + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/OrderListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - payment:write - /api/v3/prepaid-credit/topups/{topup_id}: + x-sub-accounts: false + /api/v3/prepaid-credit/top-ups/{top_up_id}: get: tags: - Payment summary: Get a Prepaid credit topup - description: Get details of a Prepaid credit topup + description: |- + Get details of a Prepaid credit topup + + Not available to sub-accounts: the response is 403 (error 1601). operationId: getPrepaidCreditTopup parameters: - - name: topup_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/TopUpId' responses: '200': description: OK @@ -8131,40 +5597,30 @@ paths: schema: $ref: '#/components/schemas/PrepaidCreditTopupResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - payment:read - /api/v3/prepaid-credit/autorenew: + x-sub-accounts: false + /api/v3/prepaid-credit/auto-renewal: post: tags: - Payment summary: Activate Prepaid credit autorenew - description: Activate automatic renewal service with Prepaid credit + description: |- + Activate automatic renewal service with Prepaid credit + + Not available to sub-accounts: the response is 403 (error 1601). operationId: activatePrepaidCreditAutorenew responses: '200': @@ -8172,41 +5628,33 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PrepaidCreditResponse' - '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/schemas/PrepaidCreditResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - payment:write + x-sub-accounts: false delete: tags: - Payment summary: Revoke Prepaid credit autorenew - description: Revoke automatic renewal service with Prepaid credit + description: |- + Revoke automatic renewal service with Prepaid credit + + Not available to sub-accounts: the response is 403 (error 1601). operationId: revokePrepaidCreditAutorenew responses: '200': @@ -8216,34 +5664,23 @@ paths: schema: $ref: '#/components/schemas/PrepaidCreditResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - payment:write + x-sub-accounts: false /api/v3/purchases: get: tags: @@ -8254,448 +5691,150 @@ paths: parameters: - name: alive_only in: query + description: >- + Only the alive purchases, not cancelled or terminated (default); + false lists every purchase required: false schema: type: boolean default: true - name: suspended in: query + description: 'true: only the suspended purchases; false: only those not suspended' required: false schema: type: boolean - name: do_not_renew in: query + description: >- + true: only the purchases that will not renew at expiry; false: only + those that will required: false schema: type: boolean - name: purchase_id_primary in: query + description: Only the secondary purchases of the primary purchase with this ID required: false schema: type: integer - name: activation_date_from in: query + description: Only the purchases activated on or after this date (YYYY-MM-DD) required: false schema: type: string format: date - name: activation_date_to in: query + description: Only the purchases activated on or before this date (YYYY-MM-DD) required: false schema: type: string format: date - name: expire_date_from in: query + description: Only the purchases expiring on or after this date (YYYY-MM-DD) required: false schema: type: string format: date - name: expire_date_to in: query + description: Only the purchases expiring on or before this date (YYYY-MM-DD) required: false schema: type: string format: date - name: purchase_ids in: query + description: Comma-separated list of purchase IDs (e.g. `purchase_ids=1,2,3`) required: false + style: form + explode: false schema: type: array items: type: integer - name: service_code in: query + description: >- + Only the purchases of the service with this code; 404 if the service + does not exist required: false schema: type: string - name: service_category_code in: query + description: >- + Only the purchases of the services in the category with this code; + 404 if the category does not exist required: false schema: type: string - - name: search - in: query - required: false - schema: - type: string - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/PurchasePaginatedListResponse' - '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '429': - $ref: '#/components/responses/TooManyRequests' - security: - - oauth2: - - purchases:read - /api/v3/purchases/{purchase_id}: - get: - tags: - - Purchases - summary: Get purchase - description: Get a purchase - operationId: getPurchase - parameters: - - name: purchase_id - in: path - required: true - schema: - type: integer - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/PurchaseResponse' - '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '429': - $ref: '#/components/responses/TooManyRequests' - security: - - oauth2: - - purchases:read - /api/v3/purchases/{purchase_id}/can-change-renew-status/{status}: - get: - tags: - - Purchases - summary: Can change "to renew" status - description: Know if it's possible to change the status of "do_not_renew" on purchase - operationId: canChangePurchaseRenewStatus - parameters: - - name: purchase_id - in: path - required: true - schema: - type: integer - - name: status - in: path - required: true - schema: - type: string - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/PurchaseCanChangeRenewStatusResponse' - '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '429': - $ref: '#/components/responses/TooManyRequests' - security: - - oauth2: - - purchases:read - /api/v3/purchases/{purchase_id}/renew-status: - patch: - tags: - - Purchases - summary: Change "to renew" status - description: Change the status of "do_not_renew" on purchase - operationId: changePurchaseRenewStatus - parameters: - - name: purchase_id - in: path - required: true - schema: - type: integer - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/PurchaseRenewStatusChangeRequest' - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/PurchaseResponse' - '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '422': - description: Unprocessable Entity - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '429': - $ref: '#/components/responses/TooManyRequests' - security: - - oauth2: - - purchases:write - /api/v3/purchases/{purchase_id}/can-change-recurrence/{recurrence_id}: - get: - tags: - - Purchases - summary: Can change recurrence - description: Know if it's possible to change the recurrence on purchase - operationId: canChangePurchaseRecurrence - parameters: - - name: purchase_id - in: path - required: true - schema: - type: integer - - name: recurrence_id - in: path - required: true - schema: - type: integer - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/PurchaseCanChangeRecurrenceResponse' - '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '429': - $ref: '#/components/responses/TooManyRequests' - security: - - oauth2: - - purchases:read - /api/v3/purchases/{purchase_id}/recurrence: - patch: - tags: - - Purchases - summary: Change recurrence - description: Change the recurrence on purchase - operationId: changePurchaseRecurrence - parameters: - - name: purchase_id - in: path - required: true + - name: search + in: query + description: >- + Text to look for, also partially, in the name of the purchase, in + the customer note and in the name of the service + required: false schema: - type: integer - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/PurchaseRecurrenceChangeRequest' + type: string + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/PurchaseResponse' + $ref: '#/components/schemas/PurchasePaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '422': - description: Unprocessable Entity - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - - purchases:write - /api/v3/purchases/{purchase_id}/can-cancel: + - purchases:read + /api/v3/purchases/{purchase_id}: get: tags: - Purchases - summary: Can cancel - description: Know if it's possible to cancel a purchase - operationId: canCancelPurchase + summary: Get purchase + description: Get a purchase + operationId: getPurchase parameters: - - name: purchase_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/PurchaseId' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/PurchaseCanCancelResponse' + $ref: '#/components/schemas/PurchaseResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - purchases:read - /api/v3/purchases/{purchase_id}/cancel: delete: tags: - Purchases @@ -8703,212 +5842,165 @@ paths: description: Cancel a purchase (only on a "New" status purchase) operationId: cancelPurchase parameters: - - name: purchase_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/PurchaseId' responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/EmptyResponse' + '204': + description: No Content '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - purchases:write - /api/v3/purchases/{purchase_id}/can-renew: + /api/v3/purchases/{purchase_id}/can-change-renew-status: get: tags: - Purchases - summary: Can renew - description: Know if it's possible to renew a purchase - operationId: canRenewPurchase + summary: Can change "to renew" status + description: Know if it's possible to change the status of "do_not_renew" on purchase + operationId: canChangePurchaseRenewStatus parameters: - - name: purchase_id - in: path + - $ref: '#/components/parameters/PurchaseId' + - name: status + in: query + description: >- + Renew status to check: `true` to renew the purchase at expiry, + `false` not to renew it (1/0, yes/no and on/off are accepted too) required: true schema: - type: integer + type: boolean responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/PurchaseCanRenewResponse' + $ref: '#/components/schemas/PurchaseCanChangeRenewStatusResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - purchases:read - /api/v3/purchases/{purchase_id}/renew: - post: + /api/v3/purchases/{purchase_id}/renew-status: + patch: tags: - Purchases - summary: Renew - description: >- - Renew a purchase. It returns the orders created to renew the purchase - (usually one order). - operationId: renewPurchase + summary: Change "to renew" status + description: Change the status of "do_not_renew" on purchase + operationId: changePurchaseRenewStatus parameters: - - name: purchase_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/PurchaseId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PurchaseRenewStatusChangeRequest' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/OrderListResponse' + $ref: '#/components/schemas/PurchaseResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - purchases:write - /api/v3/purchases/{purchase_id}/can-change-service: + /api/v3/purchases/{purchase_id}/can-change-recurrence: get: tags: - Purchases - summary: Can change Service - description: >- - Know if it's possible to change the service of the purchase. It also - returns the collection of Services to which it is possible to make the - change. - operationId: canChangePurchaseService + summary: Can change recurrence + description: |- + Know if it's possible to change the recurrence on purchase + + Not available to sub-accounts: the response is 403 (error 1601). + operationId: canChangePurchaseRecurrence parameters: - - name: purchase_id - in: path + - $ref: '#/components/parameters/PurchaseId' + - name: recurrence_id + in: query + description: ID of the recurrence to check required: true schema: type: integer + minimum: 1 responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/PurchaseCanChangeServiceResponse' + $ref: '#/components/schemas/PurchaseCanChangeRecurrenceResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - purchases:read - /api/v3/purchases/{purchase_id}/comment: - delete: + x-sub-accounts: false + /api/v3/purchases/{purchase_id}/recurrence: + patch: tags: - Purchases - summary: Delete comment - description: Deletes the user's comment from purchase. - operationId: deletePurchaseComment + summary: Change recurrence + description: |- + Change the recurrence on purchase + + Not available to sub-accounts: the response is 403 (error 1601). + operationId: changePurchaseRecurrence parameters: - - name: purchase_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/PurchaseId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PurchaseRecurrenceChangeRequest' responses: '200': description: OK @@ -8917,1045 +6009,732 @@ paths: schema: $ref: '#/components/schemas/PurchaseResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - purchases:write - patch: + x-sub-accounts: false + /api/v3/purchases/{purchase_id}/can-cancel: + get: tags: - Purchases - summary: Change comment - description: >- - Change the user's comment on purchase (it is also reported on purchase's - invoices). - operationId: updatePurchaseComment + summary: Can cancel + description: Know if it's possible to cancel a purchase + operationId: canCancelPurchase parameters: - - name: purchase_id - in: path - required: true - schema: - type: integer - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/PurchaseCommentChangeRequest' + - $ref: '#/components/parameters/PurchaseId' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/PurchaseResponse' + $ref: '#/components/schemas/PurchaseCanCancelResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '422': - description: Unprocessable Entity - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - - purchases:write - /api/v3/purchases/{purchase_id}/billing-info: - delete: + - purchases:read + /api/v3/purchases/{purchase_id}/can-renew: + get: tags: - Purchases - summary: Delete billing info - description: Deletes all billing infos from purchase (ODA, CIG, CUP). - operationId: deletePurchaseBillingInfo + summary: Can renew + description: |- + Know if it's possible to renew a purchase + + Not available to sub-accounts: the response is 403 (error 1601). + operationId: canRenewPurchase parameters: - - name: purchase_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/PurchaseId' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/PurchaseResponse' + $ref: '#/components/schemas/PurchaseCanRenewResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - - purchases:write - patch: + - purchases:read + x-sub-accounts: false + /api/v3/purchases/{purchase_id}/renewals: + post: tags: - Purchases - summary: Change billing info - description: Changes the billing info on purchase (ODA, CIG, CUP, ...) - operationId: updatePurchaseBillingInfo + summary: Renew + description: >- + Renew a purchase. It returns the orders created to renew the purchase + (usually one order). + + + Not available to sub-accounts: the response is 403 (error 1601). + operationId: renewPurchase parameters: - - name: purchase_id - in: path - required: true - schema: - type: integer - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/PurchaseBillingInfoChangeRequest' + - $ref: '#/components/parameters/PurchaseId' responses: - '200': - description: OK - content: - application/json: + '201': + description: Created + headers: + Location: + description: URL of the order, when only one is created + required: false schema: - $ref: '#/components/schemas/PurchaseResponse' - '400': - description: Bad request + type: string content: application/json: schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/schemas/OrderListResponse' + '400': + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '422': - description: Unprocessable Entity - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - purchases:write - /api/v3/purchases/{purchase_id}/can-add-additional: + x-sub-accounts: false + /api/v3/purchases/{purchase_id}/can-change-service: get: tags: - Purchases - summary: Can add additional purchase - description: Know if it's possible to buy an additional purchase for the purchase. - operationId: canAddPurchaseAdditional + summary: Can change Service + description: >- + Know if it's possible to change the service of the purchase. It also + returns the collection of Services to which it is possible to make the + change. + + + Not available to sub-accounts: the response is 403 (error 1601). + operationId: canChangePurchaseService parameters: - - name: purchase_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/PurchaseId' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/PurchaseCanAddAdditionalResponse' + $ref: '#/components/schemas/PurchaseCanChangeServiceResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - purchases:read - /api/v3/server-monitorings: - get: + x-sub-accounts: false + /api/v3/purchases/{purchase_id}/comment: + delete: tags: - - Monitoring - summary: List server monitorings - description: Get a paginated list of server monitorings for the authenticated account - operationId: listServerMonitorings + - Purchases + summary: Delete comment + description: Deletes the user's comment from purchase. + operationId: deletePurchaseComment parameters: - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/PurchaseId' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/ServerMonitoringPaginatedListResponse' + $ref: '#/components/schemas/PurchaseResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - - servermonitoring:read - /api/v3/server-monitorings/{server_monitoring_id}: - get: + - purchases:write + patch: tags: - - Monitoring - summary: Get server monitoring - description: Get details of a server monitoring for the authenticated account - operationId: getServerMonitoring + - Purchases + summary: Change comment + description: >- + Change the user's comment on purchase (it is also reported on purchase's + invoices). + operationId: updatePurchaseComment parameters: - - name: server_monitoring_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/PurchaseId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PurchaseCommentChangeRequest' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/ServerMonitoringResponse' + $ref: '#/components/schemas/PurchaseResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - - servermonitoring:read - /api/v3/server-monitorings/{server_monitoring_id}/probes: - get: + - purchases:write + /api/v3/purchases/{purchase_id}/billing-info: + delete: tags: - - Monitoring - summary: List server monitoring probes - description: Get the probes associated with a server monitoring - operationId: listServerMonitoringProbes + - Purchases + summary: Delete billing info + description: |- + Deletes all billing infos from purchase (ODA, CIG, CUP). + + Not available to sub-accounts: the response is 403 (error 1601). + operationId: deletePurchaseBillingInfo parameters: - - name: server_monitoring_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/PurchaseId' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/ServerMonitoringProbeListResponse' + $ref: '#/components/schemas/PurchaseResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - - servermonitoring:read - post: + - purchases:write + x-sub-accounts: false + patch: tags: - - Monitoring - summary: Create server monitoring probe - description: Create a probe associated with a server monitoring - operationId: createServerMonitoringProbe + - Purchases + summary: Change billing info + description: |- + Changes the billing info on purchase (ODA, CIG, CUP, ...) + + Not available to sub-accounts: the response is 403 (error 1601). + operationId: updatePurchaseBillingInfo parameters: - - name: server_monitoring_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/PurchaseId' requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/ServerMonitoringProbeCreateRequest' + $ref: '#/components/schemas/PurchaseBillingInfoChangeRequest' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/ServerMonitoringProbeResponse' + $ref: '#/components/schemas/PurchaseResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found + $ref: '#/components/responses/NotFound' + '429': + $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' + security: + - oauth2: + - purchases:write + x-sub-accounts: false + /api/v3/purchases/{purchase_id}/can-add-additional: + get: + tags: + - Purchases + summary: Can add additional purchase + description: |- + Know if it's possible to buy an additional purchase for the purchase. + + Not available to sub-accounts: the response is 403 (error 1601). + operationId: canAddPurchaseAdditional + parameters: + - $ref: '#/components/parameters/PurchaseId' + responses: + '200': + description: OK content: application/json: schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/schemas/PurchaseCanAddAdditionalResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - - servermonitoring:write - /api/v3/server-monitorings/{server_monitoring_id}/probes/{probe_id}: + - purchases:read + x-sub-accounts: false + /api/v3/server-monitorings: get: tags: - Monitoring - summary: Get server monitoring probe - description: Get details of a probe associated with a server monitoring - operationId: getServerMonitoringProbe + summary: List server monitorings + description: Get a paginated list of server monitorings for the authenticated account + operationId: listServerMonitorings parameters: - - name: server_monitoring_id - in: path - required: true - schema: - type: integer - - name: probe_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/ServerMonitoringProbeResponse' + $ref: '#/components/schemas/ServerMonitoringPaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - servermonitoring:read - delete: + /api/v3/server-monitorings/{server_monitoring_id}: + get: tags: - Monitoring - summary: Delete server monitoring probe - description: Delete a probe associated with a server monitoring - operationId: deleteServerMonitoringProbe + summary: Get server monitoring + description: Get details of a server monitoring for the authenticated account + operationId: getServerMonitoring parameters: - - name: server_monitoring_id - in: path - required: true - schema: - type: integer - - name: probe_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ServerMonitoringId' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/EmptyResponse' + $ref: '#/components/schemas/ServerMonitoringResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - - servermonitoring:write - patch: + - servermonitoring:read + /api/v3/server-monitorings/{server_monitoring_id}/probes: + get: tags: - Monitoring - summary: Update server monitoring probe - description: Update a probe associated with a server monitoring - operationId: updateServerMonitoringProbe + summary: List server monitoring probes + description: Get the probes associated with a server monitoring + operationId: listServerMonitoringProbes parameters: - - name: server_monitoring_id - in: path - required: true - schema: - type: integer - - name: probe_id - in: path - required: true - schema: - type: integer - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/ServerMonitoringProbeUpdateRequest' + - $ref: '#/components/parameters/ServerMonitoringId' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/ServerMonitoringProbeResponse' + $ref: '#/components/schemas/ServerMonitoringProbeListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - - servermonitoring:write - /api/v3/server-monitorings/{server_monitoring_id}/probes/{probe_id}/chart: - get: + - servermonitoring:read + post: tags: - Monitoring - summary: Get server monitoring probe chart - description: Get chart data points for a probe associated with a server monitoring - operationId: getServerMonitoringProbeChart + summary: Create server monitoring probe + description: Create a probe associated with a server monitoring + operationId: createServerMonitoringProbe parameters: - - name: server_monitoring_id - in: path - required: true - schema: - type: integer - - name: probe_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ServerMonitoringId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ServerMonitoringProbeCreateRequest' responses: - '200': - description: OK - content: - application/json: + '201': + description: Created + headers: + Location: + description: URL of the created resource + required: true schema: - $ref: '#/components/schemas/ServerMonitoringProbeChartResponse' - '400': - description: Bad request + type: string content: application/json: schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/schemas/ServerMonitoringProbeResponse' + '400': + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - - servermonitoring:read - /api/v3/servers: + - servermonitoring:write + /api/v3/server-monitorings/{server_monitoring_id}/probes/{probe_id}: get: tags: - - Server - summary: List servers - description: Get list of servers - operationId: listServers + - Monitoring + summary: Get server monitoring probe + description: Get details of a probe associated with a server monitoring + operationId: getServerMonitoringProbe parameters: - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/ServerMonitoringId' + - $ref: '#/components/parameters/ProbeId' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/ServerPaginatedListResponse' + $ref: '#/components/schemas/ServerMonitoringProbeResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - - server:read - /api/v3/servers/{server_id}: - get: + - servermonitoring:read + delete: tags: - - Server - summary: Get server - description: Get server details - operationId: getServer + - Monitoring + summary: Delete server monitoring probe + description: Delete a probe associated with a server monitoring + operationId: deleteServerMonitoringProbe parameters: - - name: server_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ServerMonitoringId' + - $ref: '#/components/parameters/ProbeId' responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ServerResponse' + '204': + description: No Content '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - - server:read - /api/v3/servers/{server_id}/credentials: - get: + - servermonitoring:write + patch: tags: - - Server - summary: List server credentials - description: Get credentials for a server - operationId: listServerCredentials + - Monitoring + summary: Update server monitoring probe + description: Update a probe associated with a server monitoring + operationId: updateServerMonitoringProbe parameters: - - name: server_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ServerMonitoringId' + - $ref: '#/components/parameters/ProbeId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ServerMonitoringProbeUpdateRequest' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/ServerCredentialResponse' + $ref: '#/components/schemas/ServerMonitoringProbeResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - - server:read - /api/v3/servers/{server_id}/can-start: + - servermonitoring:write + /api/v3/server-monitorings/{server_monitoring_id}/probes/{probe_id}/chart: get: tags: - - Server - summary: Check if server can start - description: Check if server can start - operationId: canStartServer + - Monitoring + summary: Get server monitoring probe chart + description: Get chart data points for a probe associated with a server monitoring + operationId: getServerMonitoringProbeChart parameters: - - name: server_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ServerMonitoringId' + - $ref: '#/components/parameters/ProbeId' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/ServerCanActionResponse' + $ref: '#/components/schemas/ServerMonitoringProbeChartResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - - server:read - /api/v3/servers/{server_id}/can-reboot: + - servermonitoring:read + /api/v3/servers: get: tags: - Server - summary: Check if server can reboot - description: Check if server can reboot - operationId: canRebootServer + summary: List servers + description: Get list of servers + operationId: listServers parameters: - - name: server_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/ServerCanActionResponse' + $ref: '#/components/schemas/ServerPaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - server:read - /api/v3/servers/{server_id}/can-stop: + /api/v3/servers/{server_id}: get: tags: - Server - summary: Check if server can stop - description: Check if server can stop - operationId: canStopServer + summary: Get server + description: Get server details + operationId: getServer parameters: - - name: server_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ServerId' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/ServerCanActionResponse' + $ref: '#/components/schemas/ServerResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - server:read - /api/v3/servers/{server_id}/can-hard-reboot: + /api/v3/servers/{server_id}/credentials: get: tags: - Server - summary: Check if server can hard reboot - description: Check if server can hard reboot - operationId: canHardRebootServer + summary: List server credentials + description: Get credentials for a server + operationId: listServerCredentials parameters: - - name: server_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ServerId' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/ServerCanActionResponse' + $ref: '#/components/schemas/ServerCredentialResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - server:read - /api/v3/servers/{server_id}/can-hard-stop: + - server:secrets + /api/v3/servers/{server_id}/can-start: get: tags: - Server - summary: Check if server can hard stop - description: Check if server can hard stop - operationId: canHardStopServer + summary: Check if server can start + description: >- + Whether the server can be started now with `POST + /api/v3/servers/{server_id}/power-actions` and `action` `start`. + `can_action` is false for a physical server, which only has `reboot`, + and for the server of a private cloud; also while the server is not + ready, its service is not active or is under maintenance, another + operation does not allow the action, or the virtual machine is already + running + operationId: canStartServer parameters: - - name: server_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ServerId' responses: '200': description: OK @@ -9964,276 +6743,225 @@ paths: schema: $ref: '#/components/schemas/ServerCanActionResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - server:read - /api/v3/servers/{server_id}/start: - post: + /api/v3/servers/{server_id}/can-reboot: + get: tags: - Server - summary: Start server - description: Start a server - operationId: startServer + summary: Check if server can reboot + description: >- + Whether the server can be rebooted now with `POST + /api/v3/servers/{server_id}/power-actions` and `action` `reboot`, the + only power action of the physical servers. `can_action` is false for the + server of a private cloud, and while the server is not ready, its + service is not active or is under maintenance, another operation does + not allow the action, the virtual machine is not running, or the + physical server cannot be managed at its supplier + operationId: canRebootServer parameters: - - name: server_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ServerId' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/TaskResponse' + $ref: '#/components/schemas/ServerCanActionResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - - server:write - /api/v3/servers/{server_id}/reboot: - post: + - server:read + /api/v3/servers/{server_id}/can-stop: + get: tags: - Server - summary: Reboot server - description: Reboot a server - operationId: rebootServer + summary: Check if server can stop + description: >- + Whether the server can be stopped now with `POST + /api/v3/servers/{server_id}/power-actions` and `action` `stop`. + `can_action` is false for a physical server, which only has `reboot`, + and for the server of a private cloud; also while the server is not + ready, its service is not active or is under maintenance, another + operation does not allow the action, or the virtual machine is already + stopped + operationId: canStopServer parameters: - - name: server_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ServerId' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/TaskResponse' + $ref: '#/components/schemas/ServerCanActionResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - - server:write - /api/v3/servers/{server_id}/stop: - post: + - server:read + /api/v3/servers/{server_id}/can-hard-reboot: + get: tags: - Server - summary: Stop server - description: Stop a server - operationId: stopServer + summary: Check if server can hard reboot + description: >- + Whether the server can be forcibly rebooted now with `POST + /api/v3/servers/{server_id}/power-actions` and `action` `hard_reboot`. + `can_action` is false for a physical server, which only has `reboot`, + and for the server of a private cloud; also while the server is not + ready, its service is not active or is under maintenance, another + operation does not allow the action, or the virtual machine is not + running + operationId: canHardRebootServer parameters: - - name: server_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ServerId' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/TaskResponse' + $ref: '#/components/schemas/ServerCanActionResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - - server:write - /api/v3/servers/{server_id}/hard-reboot: - post: + - server:read + /api/v3/servers/{server_id}/can-hard-stop: + get: tags: - Server - summary: Hard reboot server - description: Hard reboot a server - operationId: hardRebootServer + summary: Check if server can hard stop + description: >- + Whether the server can be forcibly stopped now with `POST + /api/v3/servers/{server_id}/power-actions` and `action` `hard_stop`. + `can_action` is false for a physical server, which only has `reboot`, + and for the server of a private cloud; also while the server is not + ready, its service is not active or is under maintenance, another + operation does not allow the action, or the virtual machine is already + stopped + operationId: canHardStopServer parameters: - - name: server_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ServerId' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/TaskResponse' + $ref: '#/components/schemas/ServerCanActionResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - - server:write - /api/v3/servers/{server_id}/hard-stop: + - server:read + /api/v3/servers/{server_id}/power-actions: post: tags: - Server - summary: Hard stop server - description: Hard stop a server - operationId: hardStopServer - parameters: - - name: server_id - in: path - required: true - schema: - type: integer + summary: Start, stop or reboot a server + description: >- + Starts a power action on the server, chosen with `action`; the operation + goes on in the background as the returned Task. 403 for an action that + the server does not have (physical servers only have `reboot`); 409 + while the server is not ready, its service is not active or is under + maintenance, or another operation does not allow the action. Before, + each action had its own path (`…/start`, `…/reboot`, `…/stop`, + `…/hard-reboot`, `…/hard-stop`) + operationId: createServerPowerAction + parameters: + - $ref: '#/components/parameters/ServerId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ServerPowerActionRequest' responses: - '200': - description: OK + '202': + description: >- + Accepted: the operation goes on in the background, as the returned + Task + headers: + Location: + description: >- + URL of the Task: `/api/v3/tasks/{task_id}`. Reading it requires + the `purchases:read` scope + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/TaskResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - server:write @@ -10245,23 +6973,9 @@ paths: description: Get list of snapshots for server operationId: listServerSnapshots parameters: - - name: server_id - in: path - required: true - schema: - type: integer - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/ServerId' + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -10270,31 +6984,17 @@ paths: schema: $ref: '#/components/schemas/ServerSnapshotPaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - server:read @@ -10306,16 +7006,8 @@ paths: description: Get snapshot details for server operationId: getServerSnapshot parameters: - - name: server_id - in: path - required: true - schema: - type: integer - - name: snapshot_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ServerId' + - $ref: '#/components/parameters/SnapshotId' responses: '200': description: OK @@ -10324,31 +7016,17 @@ paths: schema: $ref: '#/components/schemas/ServerSnapshotResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - server:read @@ -10359,53 +7037,43 @@ paths: description: Delete a server snapshot operationId: deleteServerSnapshot parameters: - - name: server_id - in: path - required: true - schema: - type: integer - - name: snapshot_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ServerId' + - $ref: '#/components/parameters/SnapshotId' responses: - '200': - description: OK + '202': + description: >- + Accepted: the operation goes on in the background, as the returned + Task + headers: + Location: + description: >- + URL of the Task: `/api/v3/tasks/{task_id}`. Reading it requires + the `purchases:read` scope + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/TaskResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - server:write - /api/v3/servers/{server_id}/snapshots/{snapshot_id}/restore: + /api/v3/servers/{server_id}/snapshots/{snapshot_id}/restores: post: tags: - Server @@ -10413,49 +7081,39 @@ paths: description: Restore a server snapshot operationId: restoreServerSnapshot parameters: - - name: server_id - in: path - required: true - schema: - type: integer - - name: snapshot_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ServerId' + - $ref: '#/components/parameters/SnapshotId' responses: - '200': - description: OK + '202': + description: >- + Accepted: the operation goes on in the background, as the returned + Task + headers: + Location: + description: >- + URL of the Task: `/api/v3/tasks/{task_id}`. Reading it requires + the `purchases:read` scope + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/TaskResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - server:write @@ -10467,11 +7125,7 @@ paths: description: Get list of backups for server operationId: listServerBackups parameters: - - name: server_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ServerId' responses: '200': description: OK @@ -10480,31 +7134,17 @@ paths: schema: $ref: '#/components/schemas/ServerBackupListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - server:read @@ -10516,16 +7156,8 @@ paths: description: Get backup details for server operationId: getServerBackup parameters: - - name: server_id - in: path - required: true - schema: - type: integer - - name: server_backup_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ServerId' + - $ref: '#/components/parameters/ServerBackupId' responses: '200': description: OK @@ -10534,35 +7166,21 @@ paths: schema: $ref: '#/components/schemas/ServerBackupResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - server:read - /api/v3/servers/{server_id}/backups/{server_backup_id}/restore: + /api/v3/servers/{server_id}/backups/{server_backup_id}/restores: post: tags: - Server @@ -10570,53 +7188,43 @@ paths: description: Restore a server backup operationId: restoreServerBackup parameters: - - name: server_id - in: path - required: true - schema: - type: integer - - name: server_backup_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ServerId' + - $ref: '#/components/parameters/ServerBackupId' responses: - '200': - description: OK + '202': + description: >- + Accepted: the operation goes on in the background, as the returned + Task + headers: + Location: + description: >- + URL of the Task: `/api/v3/tasks/{task_id}`. Reading it requires + the `purchases:read` scope + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/TaskResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - server:write - /api/v3/servers/{server_id}/ip_addresses: + /api/v3/servers/{server_id}/ip-addresses: get: tags: - Server @@ -10624,11 +7232,7 @@ paths: description: Get list of IP addresses for server operationId: listServerIpAddresses parameters: - - name: server_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ServerId' responses: '200': description: OK @@ -10637,35 +7241,21 @@ paths: schema: $ref: '#/components/schemas/IpAddressListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - server:read - /api/v3/servers/{server_id}/ip_addresses/{ip_address_id}: + /api/v3/servers/{server_id}/ip-addresses/{ip_address_id}: get: tags: - Server @@ -10673,16 +7263,8 @@ paths: description: Get IP address details for server operationId: getServerIpAddress parameters: - - name: server_id - in: path - required: true - schema: - type: integer - - name: ip_address_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ServerId' + - $ref: '#/components/parameters/IpAddressId' responses: '200': description: OK @@ -10691,35 +7273,21 @@ paths: schema: $ref: '#/components/schemas/IpAddressResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - server:read - /api/v3/servers/{server_id}/ip_addresses/{ip_address_id}/rdns: + /api/v3/servers/{server_id}/ip-addresses/{ip_address_id}/rdns: delete: tags: - Server @@ -10727,16 +7295,8 @@ paths: description: Delete reverse DNS for an IP address operationId: deleteServerIpAddressReverseDns parameters: - - name: server_id - in: path - required: true - schema: - type: integer - - name: ip_address_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ServerId' + - $ref: '#/components/parameters/IpAddressId' responses: '200': description: OK @@ -10745,31 +7305,19 @@ paths: schema: $ref: '#/components/schemas/IpAddressResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - server:write @@ -10780,16 +7328,8 @@ paths: description: Update reverse DNS for an IP address operationId: updateServerIpAddressReverseDns parameters: - - name: server_id - in: path - required: true - schema: - type: integer - - name: ip_address_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ServerId' + - $ref: '#/components/parameters/IpAddressId' requestBody: required: true content: @@ -10804,35 +7344,23 @@ paths: schema: $ref: '#/components/schemas/IpAddressResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - server:write - /api/v3/servers/{server_id}/private_cloud: + /api/v3/servers/{server_id}/private-cloud: get: tags: - Server @@ -10840,11 +7368,7 @@ paths: description: Get private cloud details for server operationId: getServerPrivateCloud parameters: - - name: server_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ServerId' responses: '200': description: OK @@ -10853,47 +7377,70 @@ paths: schema: $ref: '#/components/schemas/PrivateCloudResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found + $ref: '#/components/responses/NotFound' + '429': + $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' + security: + - oauth2: + - server:read + /api/v3/servers/{server_id}/private-cloud/available-ip-addresses: + get: + tags: + - Server + summary: List free IP addresses of a private cloud + description: >- + Free and available IP addresses of the pool of the private cloud, the + ones to use as `ip_address_id` to create a VM of the private cloud or a + public network interface of one of its VMs. The server can be the + private cloud or one of its VMs. + operationId: listPrivateCloudAvailableIpAddresses + parameters: + - $ref: '#/components/parameters/ServerId' + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' + responses: + '200': + description: OK content: application/json: schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/schemas/IpAddressPaginatedListResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - server:read - /api/v3/servers/{server_id}/snapshots/automatic-snapshot: + /api/v3/servers/{server_id}/snapshot-schedule: get: tags: - Server summary: Get automatic snapshot settings - description: Get automatic snapshot settings + description: >- + Returns the automatic snapshot of the server (404 if none is + configured). Automatic snapshots must be included in the service plan + (for a private cloud VM, in the plan of the private cloud), otherwise + the response is 403. operationId: getServerAutomaticSnapshot parameters: - - name: server_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ServerId' responses: '200': description: OK @@ -10902,31 +7449,17 @@ paths: schema: $ref: '#/components/schemas/ServerAutomaticSnapshotResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - server:read @@ -10934,14 +7467,14 @@ paths: tags: - Server summary: Create automatic snapshot settings - description: Create automatic snapshot settings + description: >- + Configures the automatic snapshot of the server. A server has at most + one automatic snapshot: if one is already configured the response is 409 + and the configuration is changed with PATCH. Automatic snapshots must be + included in the service plan, otherwise the response is 403. operationId: createServerAutomaticSnapshot parameters: - - name: server_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ServerId' requestBody: required: true content: @@ -10949,38 +7482,32 @@ paths: schema: $ref: '#/components/schemas/ServerAutomaticSnapshotRequest' responses: - '200': - description: OK + '201': + description: Created + headers: + Location: + description: URL of the created resource + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/ServerAutomaticSnapshotResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - server:write @@ -10988,47 +7515,30 @@ paths: tags: - Server summary: Delete automatic snapshot settings - description: Delete automatic snapshot settings + description: >- + Removes the automatic snapshot of the server (404 if none is + configured). The snapshots it created that have no expiry date receive + the default expiry of the plan. operationId: deleteServerAutomaticSnapshot parameters: - - name: server_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ServerId' responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/EmptyResponse' + '204': + description: No Content '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - server:write @@ -11036,14 +7546,13 @@ paths: tags: - Server summary: Update automatic snapshot settings - description: Update automatic snapshot settings + description: >- + Replaces the configuration of the automatic snapshot of the server (404 + if none is configured). Automatic snapshots must be included in the + service plan, otherwise the response is 403. operationId: updateServerAutomaticSnapshot parameters: - - name: server_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ServerId' requestBody: required: true content: @@ -11058,96 +7567,75 @@ paths: schema: $ref: '#/components/schemas/ServerAutomaticSnapshotResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - server:write - /api/v3/servers/{server_id}/backups/first-save: - post: + /api/v3/servers/{server_id}/backups/exhibitions: + get: tags: - Server - summary: Start first backup save - description: Start first backup save - operationId: startServerFirstBackup + summary: List exposable server backups + description: >- + Lists the backups of the server that can be exposed with `POST + /api/v3/servers/{server_id}/backups/exhibitions`: the restorable backups + visible to the customer, one-off backups included. It does not tell + which backup is exposed now + operationId: listServerExposedBackups parameters: - - name: server_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ServerId' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/TaskResponse' + $ref: '#/components/schemas/ServerBackupListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - - server:write - /api/v3/servers/{server_id}/backups/exhibit: + - server:read post: tags: - Server summary: Expose a server backup - description: Expose a server backup + description: >- + Exposes a backup of the virtual machine (`backup_id`, one of `GET + /api/v3/servers/{server_id}/backups/exhibitions`) as an additional disk, + to read its files without restoring it: it replaces the backup exposed + before, the server may restart, and the operation goes on in the + background as the returned Task. Exposed backups are removed after a few + days, or with `DELETE /api/v3/servers/{server_id}/backups/exhibitions`. + 409 for a physical server or a virtual machine that is not on oVirt, + while the exposed backups are being deleted, while the server is not + ready, its service is not active or is under maintenance, or another + operation does not allow it operationId: exposeServerBackup parameters: - - name: server_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ServerId' requestBody: required: true content: @@ -11155,135 +7643,84 @@ paths: schema: $ref: '#/components/schemas/ServerBackupExhibitRequest' responses: - '200': - description: OK + '202': + description: >- + Accepted: the operation goes on in the background, as the returned + Task + headers: + Location: + description: >- + URL of the Task: `/api/v3/tasks/{task_id}`. Reading it requires + the `purchases:read` scope + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/TaskResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - server:write - /api/v3/servers/{server_id}/backups/exhibitions: - get: - tags: - - Server - summary: List exposed server backups - description: List server backups - operationId: listServerExposedBackups - parameters: - - name: server_id - in: path - required: true - schema: - type: integer - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ServerBackupListResponse' - '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '429': - $ref: '#/components/responses/TooManyRequests' - security: - - oauth2: - - server:read delete: tags: - Server summary: Delete exposed backups - description: Delete exposed backups + description: >- + Removes the backups exposed on the virtual machine with `POST + /api/v3/servers/{server_id}/backups/exhibitions`; the operation goes on + in the background as the returned Task. 409 while a backup is being + exposed, for a physical server or a virtual machine that is not on + oVirt, while the server is not ready, its service is not active or is + under maintenance, or another operation does not allow it operationId: deleteServerExposedBackups parameters: - - name: server_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ServerId' responses: - '200': - description: OK + '202': + description: >- + Accepted: the operation goes on in the background, as the returned + Task + headers: + Location: + description: >- + URL of the Task: `/api/v3/tasks/{task_id}`. Reading it requires + the `purchases:read` scope + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/TaskResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - server:write @@ -11292,47 +7729,31 @@ paths: tags: - Server summary: List server network interfaces - description: List server network interfaces + description: >- + Lists the active network interfaces (VIF) of the server, on public and + local networks; the deleted interfaces are not returned operationId: listServerNetworkInterfaces parameters: - - name: server_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ServerId' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/ServerNetworkInterfaceListResponse' - '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/schemas/ServerNetworkInterfaceListResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - server:read @@ -11340,14 +7761,13 @@ paths: tags: - Server summary: Create server network interface - description: Create server network interface + description: >- + Starts the creation of a network interface: local, on an active local + network of the cluster where the server resides, or public, on an IP + address. The creation is asynchronous and is returned as a Task. operationId: createServerNetworkInterface parameters: - - name: server_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ServerId' requestBody: required: true content: @@ -11355,38 +7775,36 @@ paths: schema: $ref: '#/components/schemas/ServerNetworkInterfaceCreateRequest' responses: - '200': - description: OK - content: - application/json: + '202': + description: >- + Accepted: the operation goes on in the background, as the returned + Task + headers: + Location: + description: >- + URL of the Task: `/api/v3/tasks/{task_id}`. Reading it requires + the `purchases:read` scope + required: true schema: - $ref: '#/components/schemas/ServerNetworkInterfaceResponse' - '400': - description: Bad request + type: string content: application/json: schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/schemas/TaskResponse' + '400': + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - server:write @@ -11395,19 +7813,13 @@ paths: tags: - Server summary: Get server network interface - description: Get server network interface + description: >- + Returns an active network interface (VIF) of the server; a deleted + interface responds 404 operationId: getServerNetworkInterface parameters: - - name: server_id - in: path - required: true - schema: - type: integer - - name: network_interface_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ServerId' + - $ref: '#/components/parameters/NetworkInterfaceId' responses: '200': description: OK @@ -11416,31 +7828,17 @@ paths: schema: $ref: '#/components/schemas/ServerNetworkInterfaceResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - server:read @@ -11448,68 +7846,63 @@ paths: tags: - Server summary: Delete server network interface - description: Delete server network interface + description: >- + Starts the deletion of an active network interface, returned as a Task. + The default interface and the one of the primary IP address cannot be + deleted. operationId: deleteServerNetworkInterface parameters: - - name: server_id - in: path - required: true - schema: - type: integer - - name: network_interface_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ServerId' + - $ref: '#/components/parameters/NetworkInterfaceId' responses: - '200': - description: OK - content: - application/json: + '202': + description: >- + Accepted: the operation goes on in the background, as the returned + Task + headers: + Location: + description: >- + URL of the Task: `/api/v3/tasks/{task_id}`. Reading it requires + the `purchases:read` scope + required: true schema: - $ref: '#/components/schemas/EmptyResponse' - '400': - description: Bad request + type: string content: application/json: schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/schemas/TaskResponse' + '400': + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - server:write - /api/v3/servers/{server_id}/reinstall: + /api/v3/servers/{server_id}/reinstallations: post: tags: - Server summary: Reinstall server - description: Reinstall server + description: >- + Reinstalls the virtual machine with its current template and operating + system: it deletes the virtual machine and its snapshots and creates it + again, after a safety backup unless `safety_backup_enabled` is false. + The operation goes on in the background as the returned Task. 409 for a + physical server, while the server is not ready, its service is not + active or is under maintenance, or another operation does not allow it operationId: reinstallServer parameters: - - name: server_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ServerId' requestBody: required: false content: @@ -11517,54 +7910,52 @@ paths: schema: $ref: '#/components/schemas/ServerReinstallRequest' responses: - '200': - description: OK + '202': + description: >- + Accepted: the operation goes on in the background, as the returned + Task + headers: + Location: + description: >- + URL of the Task: `/api/v3/tasks/{task_id}`. Reading it requires + the `purchases:read` scope + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/TaskResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - server:write - /api/v3/servers/{server_id}/private_cloud/virtual-machines: + /api/v3/servers/{server_id}/private-cloud/virtual-machines: post: tags: - Server summary: Create private cloud VM - description: Create private cloud VM + description: >- + Create private cloud VM. The response is 409 when the private cloud + already has the maximum number of virtual machines, its daily backup + space is already in use, it has no licences left for the template, or + another operation is in progress. operationId: createPrivateCloudVirtualMachine parameters: - - name: server_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ServerId' requestBody: required: true content: @@ -11572,92 +7963,86 @@ paths: schema: $ref: '#/components/schemas/PrivateCloudVmCreateRequest' responses: - '200': - description: OK + '202': + description: >- + Accepted: the operation goes on in the background, as the returned + Task + headers: + Location: + description: >- + URL of the Task: `/api/v3/tasks/{task_id}`. Reading it requires + the `purchases:read` scope + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/TaskResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - server:write - /api/v3/servers/{server_id}/private_cloud/virtual-machines/{vm_id}: + /api/v3/servers/{server_id}/private-cloud/virtual-machines/{vm_id}: delete: tags: - Server summary: Delete private cloud VM - description: Delete private cloud VM + description: >- + Deletes a virtual machine of the private cloud `server_id`, dismissing + its purchase; the operation goes on in the background as the returned + Task. 404 when the virtual machine is not on the private cloud; 409 when + `server_id` is not a private cloud, while the private cloud is not + active or is suspended, or while the purchase of the virtual machine + cannot be dismissed or another operation does not allow it operationId: deletePrivateCloudVirtualMachine parameters: - - name: server_id - in: path - required: true - schema: - type: integer - - name: vm_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ServerId' + - $ref: '#/components/parameters/VmId' responses: - '200': - description: OK + '202': + description: >- + Accepted: the operation goes on in the background, as the returned + Task + headers: + Location: + description: >- + URL of the Task: `/api/v3/tasks/{task_id}`. Reading it requires + the `purchases:read` scope + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/TaskResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - server:write @@ -11665,19 +8050,15 @@ paths: tags: - Server summary: Update private cloud VM - description: Update private cloud VM + description: >- + Updates the note and the resources of a private cloud VM. The change of + cpu, ram or disk starts an asynchronous operation, returned as a Task; + when none of them differs from the current value no operation starts and + `data` is null. operationId: updatePrivateCloudVirtualMachine parameters: - - name: server_id - in: path - required: true - schema: - type: integer - - name: vm_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ServerId' + - $ref: '#/components/parameters/VmId' requestBody: required: true content: @@ -11686,37 +8067,41 @@ paths: $ref: '#/components/schemas/PrivateCloudVmUpdateRequest' responses: '200': - description: OK + description: >- + None of cpu, ram or disk changes: no operation starts and `data` is + null content: application/json: schema: - $ref: '#/components/schemas/TaskResponse' - '400': - description: Bad request - content: - application/json: + $ref: '#/components/schemas/EmptyResponse' + '202': + description: Operation that changes cpu, ram or disk, as the returned Task + headers: + Location: + description: >- + URL of the Task: `/api/v3/tasks/{task_id}`. Reading it requires + the `purchases:read` scope + required: true schema: - $ref: '#/components/schemas/ApiError' - '401': - description: Not authorized + type: string content: application/json: schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/schemas/TaskResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - server:write @@ -11725,21 +8110,14 @@ paths: tags: - Shop summary: PEC products - description: Get a list of all PEC products that can be ordered + description: |- + Get a list of all PEC products that can be ordered + + Not available to sub-accounts: the response is 403 (error 1601). operationId: listPecProducts parameters: - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -11748,39 +8126,29 @@ paths: schema: $ref: '#/components/schemas/ServicePaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - shop:read + x-sub-accounts: false post: tags: - Shop summary: Buy PEC - description: Buy a new PEC product + description: |- + Buy a new PEC product + + Not available to sub-accounts: the response is 403 (error 1601). operationId: buyPec requestBody: required: true @@ -11789,47 +8157,45 @@ paths: schema: $ref: '#/components/schemas/BuyServicePecRequest' responses: - '200': - description: OK + '201': + description: Created + headers: + Location: + description: URL of the order, when only one is created + required: false + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/OrderListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - shop:write + x-sub-accounts: false /api/v3/shop/pec-domain: post: tags: - Shop summary: Buy PEC Domain - description: Buy a new PEC Domain product + description: |- + Buy a new PEC Domain product + + Not available to sub-accounts: the response is 403 (error 1601). operationId: buyPecDomain requestBody: required: true @@ -11838,47 +8204,45 @@ paths: schema: $ref: '#/components/schemas/BuyServicePecDomainRequest' responses: - '200': - description: OK + '201': + description: Created + headers: + Location: + description: URL of the order, when only one is created + required: false + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/OrderListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - shop:write + x-sub-accounts: false /api/v3/shop/object-storage: post: tags: - Shop summary: Buy Object Storage - description: Buy a new Object Storage product + description: |- + Buy a new Object Storage product + + Not available to sub-accounts: the response is 403 (error 1601). operationId: buyObjectStorage requestBody: required: true @@ -11887,61 +8251,49 @@ paths: schema: $ref: '#/components/schemas/BuyServiceObjectStorageRequest' responses: - '200': - description: OK + '201': + description: Created + headers: + Location: + description: URL of the order, when only one is created + required: false + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/OrderListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - shop:write + x-sub-accounts: false /api/v3/shop/cloud-storage: get: tags: - Shop summary: Cloud Storage products - description: Get a list of all Cloud Storage products that can be ordered + description: |- + Get a list of all Cloud Storage products that can be ordered + + Not available to sub-accounts: the response is 403 (error 1601). operationId: listCloudStorageProducts parameters: - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -11950,39 +8302,29 @@ paths: schema: $ref: '#/components/schemas/ServicePaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - shop:read + x-sub-accounts: false post: tags: - Shop summary: Buy Cloud Storage - description: Buy a new Cloud Storage product + description: |- + Buy a new Cloud Storage product + + Not available to sub-accounts: the response is 403 (error 1601). operationId: buyCloudStorage requestBody: required: true @@ -11991,61 +8333,49 @@ paths: schema: $ref: '#/components/schemas/BuyServiceCloudStorageRequest' responses: - '200': - description: OK + '201': + description: Created + headers: + Location: + description: URL of the order, when only one is created + required: false + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/OrderListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - shop:write - /api/v3/shop/sms-topup: + x-sub-accounts: false + /api/v3/shop/sms-top-up: get: tags: - Shop summary: SMS topups products - description: Get a list of all SMS topup products that can be ordered + description: |- + Get a list of all SMS topup products that can be ordered + + Not available to sub-accounts: the response is 403 (error 1601). operationId: listSmsTopupProducts parameters: - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -12054,39 +8384,29 @@ paths: schema: $ref: '#/components/schemas/ServicePaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - shop:read + x-sub-accounts: false post: tags: - Shop summary: Buy SMS topup - description: Buy a new SMS topup product + description: |- + Buy a new SMS topup product + + Not available to sub-accounts: the response is 403 (error 1601). operationId: buySmsTopup requestBody: required: true @@ -12095,61 +8415,49 @@ paths: schema: $ref: '#/components/schemas/BuyServiceSmsRequest' responses: - '200': - description: OK + '201': + description: Created + headers: + Location: + description: URL of the order, when only one is created + required: false + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/OrderListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - shop:write + x-sub-accounts: false /api/v3/shop/plesk-license: get: tags: - Shop summary: Plesk licenses products - description: Get a list of all Plesk license products that can be ordered + description: |- + Get a list of all Plesk license products that can be ordered + + Not available to sub-accounts: the response is 403 (error 1601). operationId: listPleskLicenseProducts parameters: - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -12158,39 +8466,29 @@ paths: schema: $ref: '#/components/schemas/ServicePaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - shop:read + x-sub-accounts: false post: tags: - Shop summary: Buy Plesk license - description: Buy a new Plesk license product + description: |- + Buy a new Plesk license product + + Not available to sub-accounts: the response is 403 (error 1601). operationId: buyPleskLicense requestBody: required: true @@ -12199,61 +8497,49 @@ paths: schema: $ref: '#/components/schemas/BuyServicePleskLicenseRequest' responses: - '200': - description: OK + '201': + description: Created + headers: + Location: + description: URL of the order, when only one is created + required: false + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/OrderListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - shop:write + x-sub-accounts: false /api/v3/shop/cpanel-license: get: tags: - Shop summary: cPanel licenses products - description: Get a list of all cPanel license products that can be ordered + description: |- + Get a list of all cPanel license products that can be ordered + + Not available to sub-accounts: the response is 403 (error 1601). operationId: listCpanelLicenseProducts parameters: - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -12262,39 +8548,29 @@ paths: schema: $ref: '#/components/schemas/ServicePaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - shop:read + x-sub-accounts: false post: tags: - Shop summary: Buy cPanel license - description: Buy a new cPanel license product + description: |- + Buy a new cPanel license product + + Not available to sub-accounts: the response is 403 (error 1601). operationId: buyCpanelLicense requestBody: required: true @@ -12303,61 +8579,49 @@ paths: schema: $ref: '#/components/schemas/BuyServiceCpanelLicenseRequest' responses: - '200': - description: OK + '201': + description: Created + headers: + Location: + description: URL of the order, when only one is created + required: false + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/OrderListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - shop:write + x-sub-accounts: false /api/v3/shop/ssl-certificate: get: tags: - Shop summary: SSL/TLS Certificates products - description: Get a list of all SSL/TLS Certificate products that can be ordered + description: |- + Get a list of all SSL/TLS Certificate products that can be ordered + + Not available to sub-accounts: the response is 403 (error 1601). operationId: listSslCertificateProducts parameters: - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -12366,39 +8630,29 @@ paths: schema: $ref: '#/components/schemas/ServicePaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - shop:read + x-sub-accounts: false post: tags: - Shop summary: Buy SSL/TLS Certificate - description: Buy a new SSL/TLS Certificate product + description: |- + Buy a new SSL/TLS Certificate product + + Not available to sub-accounts: the response is 403 (error 1601). operationId: buySslCertificate requestBody: required: true @@ -12407,61 +8661,49 @@ paths: schema: $ref: '#/components/schemas/BuyServiceSslCertificateRequest' responses: - '200': - description: OK + '201': + description: Created + headers: + Location: + description: URL of the order, when only one is created + required: false + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/OrderListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - shop:write + x-sub-accounts: false /api/v3/shop/microsoft-365/services: get: tags: - Shop summary: Microsoft 365 subscriptions - description: Get a list of all Microsoft 365 subscriptions that can be ordered + description: |- + Get a list of all Microsoft 365 subscriptions that can be ordered + + Not available to sub-accounts: the response is 403 (error 1601). operationId: listMicrosoft365Products parameters: - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -12470,62 +8712,42 @@ paths: schema: $ref: '#/components/schemas/ServicePaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - shop:read + x-sub-accounts: false /api/v3/shop/microsoft-365/tenants: get: tags: - Shop summary: Microsoft 365 tenants - description: Get a list of all Microsoft 365 already existing tenants + description: |- + Get a list of all Microsoft 365 already existing tenants + + Not available to sub-accounts: the response is 403 (error 1601). operationId: listShopMicrosoft365Tenants parameters: - name: account_id in: query - required: false - schema: - description: >- - ID of the account owner of the Microsoft 365 subscription used to - search for existing tenants. Available to Resellers only. - type: integer - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query + description: >- + ID of the account owner of the Microsoft 365 subscription used to + search for existing tenants. Available to Resellers only. required: false schema: type: integer - default: 15 + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -12534,48 +8756,42 @@ paths: schema: $ref: '#/components/schemas/Microsoft365TenantPaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - shop:read - /api/v3/shop/microsoft-365/domain-available: + x-sub-accounts: false + /api/v3/shop/microsoft-365/domain-availability: get: tags: - Shop summary: Check Microsoft 365 domain availability - description: Check if a new Microsoft 365 tenant domain is available + description: |- + Check if a new Microsoft 365 tenant domain is available + + Not available to sub-accounts: the response is 403 (error 1601). operationId: checkMicrosoft365DomainAvailability parameters: - name: domain_prefix in: query + description: >- + Prefix to search for (for ".onmicrosoft.com" tenant domains): + lowercase letters and digits, at most 27 characters required: true schema: - description: Prefix to search for (for ".onmicrosoft.com" tenant domains) type: string + pattern: ^[a-z0-9]{1,27}$ + example: mycompany responses: '200': description: OK @@ -12584,40 +8800,36 @@ paths: schema: $ref: '#/components/schemas/Microsoft365DomainAvailableResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - shop:read + x-sub-accounts: false /api/v3/shop/microsoft-365: post: tags: - Shop summary: Buy Microsoft 365 subscription - description: Buy a new Microsoft 365 subscription + description: >- + Buy a new Microsoft 365 subscription. The tenant data is checked before + the order is created: a tenant chosen with "select" that is not one of + the account is 404, a choice that cannot be applied (too many + subscriptions of the service on the tenant, domain prefix of an existing + tenant, domain to transfer that does not exist or new domain already + registered at Microsoft) is 409. + + + Not available to sub-accounts: the response is 403 (error 1601). operationId: buyMicrosoft365Subscription requestBody: required: true @@ -12626,61 +8838,49 @@ paths: schema: $ref: '#/components/schemas/BuyServiceMicrosoft365Request' responses: - '200': - description: OK + '201': + description: Created + headers: + Location: + description: URL of the order, when only one is created + required: false + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/OrderListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - shop:write + x-sub-accounts: false /api/v3/shop/active-monitoring: get: tags: - Shop summary: Active Monitoring products - description: Get a list of all Active Monitoring products that can be ordered + description: |- + Get a list of all Active Monitoring products that can be ordered + + Not available to sub-accounts: the response is 403 (error 1601). operationId: listActiveMonitoringProducts parameters: - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -12689,39 +8889,29 @@ paths: schema: $ref: '#/components/schemas/ServicePaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - shop:read + x-sub-accounts: false post: tags: - Shop summary: Buy Active Monitoring - description: Buy a new Active Monitoring product + description: |- + Buy a new Active Monitoring product + + Not available to sub-accounts: the response is 403 (error 1601). operationId: buyActiveMonitoring requestBody: required: true @@ -12730,61 +8920,49 @@ paths: schema: $ref: '#/components/schemas/BuyServiceActiveMonitoringRequest' responses: - '200': - description: OK + '201': + description: Created + headers: + Location: + description: URL of the order, when only one is created + required: false + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/OrderListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - shop:write + x-sub-accounts: false /api/v3/shop/private-cloud-sv: get: tags: - Shop summary: Private Cloud SV products - description: Get a list of all Private Cloud SV products that can be ordered + description: |- + Get a list of all Private Cloud SV products that can be ordered + + Not available to sub-accounts: the response is 403 (error 1601). operationId: listPrivateCloudSvProducts parameters: - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -12793,39 +8971,29 @@ paths: schema: $ref: '#/components/schemas/ServicePaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - shop:read + x-sub-accounts: false post: tags: - Shop summary: Buy Private Cloud SV - description: Buy a new Private Cloud SV product + description: |- + Buy a new Private Cloud SV product + + Not available to sub-accounts: the response is 403 (error 1601). operationId: buyPrivateCloudSv requestBody: required: true @@ -12834,61 +9002,49 @@ paths: schema: $ref: '#/components/schemas/BuyServicePrivateCloudSvRequest' responses: - '200': - description: OK + '201': + description: Created + headers: + Location: + description: URL of the order, when only one is created + required: false + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/OrderListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - shop:write + x-sub-accounts: false /api/v3/shop/dedicated-server: get: tags: - Shop summary: Dedicated Servers products - description: Get a list of all Dedicated Server products that can be ordered + description: |- + Get a list of all Dedicated Server products that can be ordered + + Not available to sub-accounts: the response is 403 (error 1601). operationId: listDedicatedServerProducts parameters: - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -12897,39 +9053,29 @@ paths: schema: $ref: '#/components/schemas/ServiceServerPaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - shop:read + x-sub-accounts: false post: tags: - Shop summary: Buy Dedicated Server - description: Buy a new Dedicated Server product + description: |- + Buy a new Dedicated Server product + + Not available to sub-accounts: the response is 403 (error 1601). operationId: buyDedicatedServer requestBody: required: true @@ -12938,348 +9084,177 @@ paths: schema: $ref: '#/components/schemas/BuyServiceDedicatedServerRequest' responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/OrderListResponse' - '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '429': - $ref: '#/components/responses/TooManyRequests' - security: - - oauth2: - - shop:write - /api/v3/shop/cloud-vps: - get: - tags: - - Shop - summary: Cloud VPS products - description: Get a list of all Cloud VPS products that can be ordered - operationId: listCloudVpsProducts - parameters: - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ServiceServerPaginatedListResponse' - '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '429': - $ref: '#/components/responses/TooManyRequests' - security: - - oauth2: - - shop:read - post: - tags: - - Shop - summary: Buy Cloud VPS - description: Buy a new Cloud VPS product - operationId: buyCloudVps - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/BuyServiceCloudVpsRequest' - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/OrderListResponse' - '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: Not found - content: - application/json: + '201': + description: Created + headers: + Location: + description: URL of the order, when only one is created + required: false schema: - $ref: '#/components/schemas/ApiError' - '429': - $ref: '#/components/responses/TooManyRequests' - security: - - oauth2: - - shop:write - /api/v3/shop/veeam-baas: - post: - tags: - - Shop - summary: Buy Veeam BaaS - description: Buy a new Veeam Backup as a Service product - operationId: buyVeeamBaas - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/BuyServiceVeeamBaasRequest' - responses: - '200': - description: OK + type: string content: application/json: schema: $ref: '#/components/schemas/OrderListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - shop:write - /api/v3/shop/securemail-by-libraesva: - post: + x-sub-accounts: false + /api/v3/shop/cloud-vps: + get: tags: - Shop - summary: Buy SecureMail by LibraESVA - description: Buy a new SecureMail by LibraESVA product - operationId: buySecureMail - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/BuyServiceSecuremailRequest' + summary: Cloud VPS products + description: |- + Get a list of all Cloud VPS products that can be ordered + + Not available to sub-accounts: the response is 403 (error 1601). + operationId: listCloudVpsProducts + parameters: + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/OrderListResponse' + $ref: '#/components/schemas/ServiceServerPaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - - shop:write - /api/v3/shop/securemail-by-libraesva-for-microsoft365: + - shop:read + x-sub-accounts: false post: tags: - Shop - summary: Buy SecureMail by LibraESVA for Microsoft 365 - description: Buy a new SecureMail by LibraESVA for Microsoft 365 product - operationId: buySecureMailForMicrosoft365 + summary: Buy Cloud VPS + description: |- + Buy a new Cloud VPS product + + Not available to sub-accounts: the response is 403 (error 1601). + operationId: buyCloudVps requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/BuyServiceSecuremailForMicrosoft365Request' + $ref: '#/components/schemas/BuyServiceCloudVpsRequest' responses: - '200': - description: OK + '201': + description: Created + headers: + Location: + description: URL of the order, when only one is created + required: false + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/OrderListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - shop:write - /api/v3/shop/securemail-by-libraesva-for-google-workspace: + x-sub-accounts: false + /api/v3/shop/veeam-baas: post: tags: - Shop - summary: Buy SecureMail by LibraESVA for Google Workspace - description: Buy a new SecureMail by LibraESVA for Google Workspace product - operationId: buySecureMailForGoogleWorkspace + summary: Buy Veeam BaaS + description: |- + Buy a new Veeam Backup as a Service product + + Not available to sub-accounts: the response is 403 (error 1601). + operationId: buyVeeamBaas requestBody: required: true content: application/json: schema: - $ref: >- - #/components/schemas/BuyServiceSecuremailForGoogleWorkspaceRequest + $ref: '#/components/schemas/BuyServiceVeeamBaasRequest' responses: - '200': - description: OK + '201': + description: Created + headers: + Location: + description: URL of the order, when only one is created + required: false + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/OrderListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - shop:write + x-sub-accounts: false /api/v3/shop/domain: post: tags: - Shop summary: Buy Domain - description: Buy a new Domain + description: >- + Buy a new Domain. A premium domain is ordered at the prices given by + `GET /api/v3/domains/availability`; when the registry gives no price, it + cannot be bought (409) + + + Not available to sub-accounts: the response is 403 (error 1601). operationId: buyDomain requestBody: required: true @@ -13288,41 +9263,36 @@ paths: schema: $ref: '#/components/schemas/BuyServiceDomainRequest' responses: - '200': - description: OK + '201': + description: Created + headers: + Location: + description: URL of the order, when only one is created + required: false + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/OrderListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - shop:write + x-sub-accounts: false /api/v3/sms: get: tags: @@ -13344,28 +9314,24 @@ paths: - ACCOMPLISHED - name: date_created_from in: query + description: >- + Only the SMS created at or after this time (ISO 8601 UTC: + YYYY-MM-DDTHH:MM:SSZ) required: false schema: type: string format: date-time - name: date_created_to in: query + description: >- + Only the SMS created at or before this time (ISO 8601 UTC: + YYYY-MM-DDTHH:MM:SSZ) required: false schema: type: string format: date-time - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -13374,31 +9340,17 @@ paths: schema: $ref: '#/components/schemas/SmsPaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - sms:read @@ -13415,38 +9367,32 @@ paths: schema: $ref: '#/components/schemas/SmsCreateRequest' responses: - '200': - description: OK + '201': + description: Created + headers: + Location: + description: URL of the created resource + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/SmsResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - sms:write @@ -13458,11 +9404,7 @@ paths: description: Get details of an SMS operationId: getSms parameters: - - name: sms_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/SmsId' responses: '200': description: OK @@ -13471,31 +9413,17 @@ paths: schema: $ref: '#/components/schemas/SmsResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - sms:read @@ -13506,44 +9434,24 @@ paths: description: Permanently delete an SMS operationId: deleteSms parameters: - - name: sms_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/SmsId' responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/EmptyResponse' + '204': + description: No Content '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - sms:write @@ -13555,11 +9463,7 @@ paths: description: Know if it's possible to cancel the sending of an SMS operationId: canCancelSms parameters: - - name: sms_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/SmsId' responses: '200': description: OK @@ -13568,31 +9472,17 @@ paths: schema: $ref: '#/components/schemas/SmsCanCancelResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - sms:read @@ -13604,11 +9494,7 @@ paths: description: Know if it's possible to permanently delete an SMS operationId: canDeleteSms parameters: - - name: sms_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/SmsId' responses: '200': description: OK @@ -13617,47 +9503,29 @@ paths: schema: $ref: '#/components/schemas/SmsCanDeleteResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - sms:read - /api/v3/sms/{sms_id}/cancel: - patch: + /api/v3/sms/{sms_id}/cancellation: + post: tags: - Sms summary: Cancel SMS sending description: Cancel the sending of an SMS operationId: cancelSms parameters: - - name: sms_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/SmsId' responses: '200': description: OK @@ -13666,31 +9534,19 @@ paths: schema: $ref: '#/components/schemas/SmsResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - sms:write @@ -13702,11 +9558,9 @@ paths: description: Get a list of all messages of an SMS operationId: listSmsMessages parameters: - - name: sms_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/SmsId' + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -13715,31 +9569,17 @@ paths: schema: $ref: '#/components/schemas/SmsMessagePaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - sms:read @@ -13751,16 +9591,8 @@ paths: description: Get an SMS message details operationId: getSmsMessage parameters: - - name: sms_id - in: path - required: true - schema: - type: integer - - name: message_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/SmsId' + - $ref: '#/components/parameters/MessageId' responses: '200': description: OK @@ -13769,35 +9601,21 @@ paths: schema: $ref: '#/components/schemas/SmsMessageResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - sms:read - /api/v3/sms/account: + /api/v3/sms-account: get: tags: - Sms @@ -13812,41 +9630,33 @@ paths: schema: $ref: '#/components/schemas/SmsAccountResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - sms:read - /api/v3/sms/countries: + /api/v3/sms-prices: get: tags: - Sms summary: List SMS prices - description: Get a list of all SMS prices for all supported Countries + description: |- + Get a list of all SMS prices for all supported Countries + + Not available to sub-accounts: the response is 403 (error 1601). operationId: listSmsPrices + parameters: + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -13855,40 +9665,30 @@ paths: schema: $ref: '#/components/schemas/SmsPricePaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - sms:read - /api/v3/sms/countries/{country_code}: + x-sub-accounts: false + /api/v3/sms-prices/{country_code}: get: tags: - Sms summary: Get SMS price - description: Get the SMS price for a specific Country + description: |- + Get the SMS price for a specific Country + + Not available to sub-accounts: the response is 403 (error 1601). operationId: getSmsPrice parameters: - name: country_code @@ -13905,35 +9705,22 @@ paths: schema: $ref: '#/components/schemas/SmsPriceResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - sms:read - /api/v3/sms/phonebooks: + x-sub-accounts: false + /api/v3/sms-phonebooks: get: tags: - Sms @@ -13941,18 +9728,8 @@ paths: description: Get a list of all Phonebooks operationId: listSmsPhonebooks parameters: - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -13961,31 +9738,17 @@ paths: schema: $ref: '#/components/schemas/SmsPhonebookPaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - sms:read @@ -14002,42 +9765,34 @@ paths: schema: $ref: '#/components/schemas/SmsPhonebookCreateRequest' responses: - '200': - description: OK + '201': + description: Created + headers: + Location: + description: URL of the created resource + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/SmsPhonebookResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - sms:write - /api/v3/sms/phonebooks/{phonebook_id}: + /api/v3/sms-phonebooks/{phonebook_id}: get: tags: - Sms @@ -14045,11 +9800,7 @@ paths: description: Get details of a Phonebook operationId: getSmsPhonebook parameters: - - name: phonebook_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/PhonebookId' responses: '200': description: OK @@ -14058,31 +9809,17 @@ paths: schema: $ref: '#/components/schemas/SmsPhonebookResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - sms:read @@ -14090,47 +9827,28 @@ paths: tags: - Sms summary: Delete a Phonebook - description: Delete a Phonebook + description: >- + Deletes the phonebook, which can no longer be used as recipients of an + SMS. Its contacts are not deleted and stay in the other phonebooks that + contain them operationId: deleteSmsPhonebook parameters: - - name: phonebook_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/PhonebookId' responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/EmptyResponse' + '204': + description: No Content '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - sms:write @@ -14141,11 +9859,7 @@ paths: description: Edit a Phonebook details operationId: updateSmsPhonebook parameters: - - name: phonebook_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/PhonebookId' requestBody: required: true content: @@ -14160,35 +9874,21 @@ paths: schema: $ref: '#/components/schemas/SmsPhonebookResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - sms:write - /api/v3/sms/phonebooks/{phonebook_id}/contacts: + /api/v3/sms-phonebooks/{phonebook_id}/contacts: get: tags: - Sms @@ -14196,23 +9896,9 @@ paths: description: Get a list of all Contacts of a Phonebook operationId: listSmsPhonebookContacts parameters: - - name: phonebook_id - in: path - required: true - schema: - type: integer - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/PhonebookId' + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -14221,31 +9907,17 @@ paths: schema: $ref: '#/components/schemas/SmsPhonebookContactPaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - sms:read @@ -14256,11 +9928,7 @@ paths: description: Replaces all the Contacts in a Phonebook operationId: replaceSmsPhonebookContacts parameters: - - name: phonebook_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/PhonebookId' requestBody: required: true content: @@ -14275,31 +9943,17 @@ paths: schema: $ref: '#/components/schemas/SmsPhonebookResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - sms:write @@ -14310,11 +9964,7 @@ paths: description: Add one or more contacts to a Phonebook operationId: addSmsPhonebookContacts parameters: - - name: phonebook_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/PhonebookId' requestBody: required: true content: @@ -14329,31 +9979,17 @@ paths: schema: $ref: '#/components/schemas/SmsPhonebookResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - sms:write @@ -14364,98 +10000,53 @@ paths: description: Removes all the Contacts from an existing Phonebook operationId: deleteAllSmsPhonebookContacts parameters: - - name: phonebook_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/PhonebookId' responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/EmptyResponse' + '204': + description: No Content '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - sms:write - /api/v3/sms/phonebooks/{phonebook_id}/contacts/{contact_id}: - delete: - tags: - - Sms - summary: Remove a Contact from a Phonebook - description: Remove a Contact from a Phonebook - operationId: deleteSmsPhonebookContact - parameters: - - name: phonebook_id - in: path - required: true - schema: - type: integer - - name: contact_id - in: path - required: true - schema: - type: integer + /api/v3/sms-phonebooks/{phonebook_id}/contacts/{contact_id}: + delete: + tags: + - Sms + summary: Remove a Contact from a Phonebook + description: >- + Removes the contact from the phonebook (404 if the phonebook does not + contain it). The contact is not deleted and stays in the other + phonebooks that contain it + operationId: deleteSmsPhonebookContact + parameters: + - $ref: '#/components/parameters/PhonebookId' + - $ref: '#/components/parameters/ContactId' responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/EmptyResponse' + '204': + description: No Content '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - sms:write @@ -14479,18 +10070,8 @@ paths: required: false schema: type: string - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -14499,31 +10080,17 @@ paths: schema: $ref: '#/components/schemas/SslCertificatePaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - ssl:read @@ -14535,11 +10102,7 @@ paths: description: Get details of an SSL Certificate operationId: getSslCertificate parameters: - - name: ssl_certificate_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/SslCertificateId' responses: '200': description: OK @@ -14548,31 +10111,17 @@ paths: schema: $ref: '#/components/schemas/SslCertificateResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - ssl:read @@ -14580,14 +10129,14 @@ paths: tags: - Ssl summary: Edit SSL certificate owner - description: Edit SSL certificate owner + description: >- + Changes the administrative contact of the certificate (the `admin_*` + fields) and returns the certificate; only the fields sent change. The + certificate already issued does not change: the CSRs we generate + afterwards take the organization, city, state and country of the contact operationId: updateSslCertificateOwner parameters: - - name: ssl_certificate_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/SslCertificateId' requestBody: required: true content: @@ -14602,31 +10151,17 @@ paths: schema: $ref: '#/components/schemas/SslCertificateResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - ssl:write @@ -14638,11 +10173,7 @@ paths: description: Get the keys of an SSL Certificate operationId: getSslCertificateKeys parameters: - - name: ssl_certificate_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/SslCertificateId' responses: '200': description: OK @@ -14651,35 +10182,22 @@ paths: schema: $ref: '#/components/schemas/SslCertificateKeysResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - ssl:read - /api/v3/ssl-certificates/approver-emails/{domain_name}: + - ssl:secrets + /api/v3/ssl-certificates/approver-emails: get: tags: - Ssl @@ -14688,10 +10206,12 @@ paths: operationId: listSslApproverEmails parameters: - name: domain_name - in: path + in: query + description: Domain name of the certificate required: true schema: type: string + minLength: 1 responses: '200': description: OK @@ -14700,96 +10220,65 @@ paths: schema: $ref: '#/components/schemas/SslCertificateApproverEmailsResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - ssl:read - /api/v3/ssl-certificates/{ssl_certificate_id}/can-reemit: + /api/v3/ssl-certificates/{ssl_certificate_id}/can-reissue: get: tags: - Ssl - summary: Can re-emit certificate - description: Know if it's possible to re-emit the SSL Certificate - operationId: canReemitSslCertificate + summary: Can reissue certificate + description: Know if it's possible to reissue the SSL Certificate + operationId: canReissueSslCertificate parameters: - - name: ssl_certificate_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/SslCertificateId' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/SslCertificateCanReemitResponse' + $ref: '#/components/schemas/SslCertificateCanReissueResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - ssl:read - /api/v3/ssl-certificates/{ssl_certificate_id}/reemit: + /api/v3/ssl-certificates/{ssl_certificate_id}/reissues: post: tags: - Ssl - summary: Re-emit certificate - description: Ask for the SSL Certificate to be re-emitted - operationId: reemitSslCertificate - parameters: - - name: ssl_certificate_id - in: path - required: true - schema: - type: integer + summary: Reissue certificate + description: >- + Asks for the SSL certificate to be reissued, optionally with a custom + CSR or private key. The reissue must be allowed (see `GET + /api/v3/ssl-certificates/{ssl_certificate_id}/can-reissue`), otherwise + the response is 409; the operation is asynchronous and is returned as a + Task. + operationId: reissueSslCertificate + parameters: + - $ref: '#/components/parameters/SslCertificateId' requestBody: required: true content: @@ -14797,42 +10286,40 @@ paths: schema: $ref: '#/components/schemas/SslCertificateReemitRequest' responses: - '200': - description: OK + '202': + description: >- + Accepted: the operation goes on in the background, as the returned + Task + headers: + Location: + description: >- + URL of the Task: `/api/v3/tasks/{task_id}`. Reading it requires + the `purchases:read` scope + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/TaskResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - ssl:write - /api/v3/ssl-certificates/{ssl_certificate_id}/export_formats: + /api/v3/ssl-certificates/{ssl_certificate_id}/export-formats: get: tags: - Ssl @@ -14840,11 +10327,7 @@ paths: description: Get a list of all export formats available for SSL Certificate keys operationId: listSslCertificateExportFormats parameters: - - name: ssl_certificate_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/SslCertificateId' responses: '200': description: OK @@ -14853,52 +10336,40 @@ paths: schema: $ref: '#/components/schemas/SslCertificateExportFormatListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - ssl:read - /api/v3/ssl-certificates/{ssl_certificate_id}/export_format/{format}: - get: + /api/v3/ssl-certificates/{ssl_certificate_id}/exports: + post: tags: - Ssl summary: Export SSL certificate keys - description: Export SSL certificate keys + description: >- + Exports the certificate and its keys in the requested format, as a + base64 encoded file. The format and, when needed, the passphrases travel + in the request body. The formats that include the private key (PK, + PK_CERT_CA, MULTI_ZIP) also require the ssl:secrets scope, otherwise the + response is 403. operationId: exportSslCertificate parameters: - - name: ssl_certificate_id - in: path - required: true - schema: - type: integer - - name: format - in: path - required: true - schema: - type: string + - $ref: '#/components/parameters/SslCertificateId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SslCertificateExportRequest' responses: '200': description: OK @@ -14907,31 +10378,19 @@ paths: schema: $ref: '#/components/schemas/SslCertificateExportResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - ssl:read @@ -14940,14 +10399,14 @@ paths: tags: - Ssl summary: Change SSL certificate CSR - description: Change SSL certificate CSR + description: >- + Sets a custom CSR for the certificate, after verifying it with the + certificate supplier, and returns the CSR of the certificate; sending + the current CSR changes nothing. The certificate is not reissued: see + `POST /api/v3/ssl-certificates/{ssl_certificate_id}/reissues` operationId: updateSslCertificateCsr parameters: - - name: ssl_certificate_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/SslCertificateId' requestBody: required: true content: @@ -14962,31 +10421,17 @@ paths: schema: $ref: '#/components/schemas/SslCertificateKeyResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - ssl:write @@ -14998,18 +10443,8 @@ paths: description: Get a list of all cloud storages operationId: listCloudStorages parameters: - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -15018,31 +10453,17 @@ paths: schema: $ref: '#/components/schemas/CloudStoragePaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - cloudstorage:read @@ -15054,48 +10475,30 @@ paths: description: Get cloud storage details operationId: getCloudStorage parameters: - - name: cloud_storage_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/CloudStorageId' responses: '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/CloudStorageResponse' - '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '401': - description: Not authorized + description: OK content: application/json: schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/schemas/CloudStorageResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - cloudstorage:read - /api/v3/cloud-storages/{cloud_storage_id}/size-upgrade: + /api/v3/cloud-storages/{cloud_storage_id}/size-upgrades: post: tags: - Storage @@ -15103,100 +10506,92 @@ paths: description: >- Upgrade the cloud storage size. Returns the generated Order to pay the additional size. + + + Not available to sub-accounts: the response is 403 (error 1601). operationId: upgradeCloudStorageSize parameters: - - name: cloud_storage_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/CloudStorageId' responses: - '200': - description: OK + '201': + description: Created + headers: + Location: + description: URL of the created resource + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/OrderResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - cloudstorage:write - /api/v3/cloud-storages/{cloud_storage_id}/size-downgrade: - patch: + x-sub-accounts: false + /api/v3/cloud-storages/{cloud_storage_id}/size-downgrades: + post: tags: - Storage summary: Downgrade cloud storage size description: >- Downgrade the cloud storage size. Returns the background Task created for the downgrade. + + + Not available to sub-accounts: the response is 403 (error 1601). operationId: downgradeCloudStorageSize parameters: - - name: cloud_storage_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/CloudStorageId' responses: - '200': - description: OK + '202': + description: >- + Accepted: the operation goes on in the background, as the returned + Task + headers: + Location: + description: >- + URL of the Task: `/api/v3/tasks/{task_id}`. Reading it requires + the `purchases:read` scope + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/TaskResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - cloudstorage:write + x-sub-accounts: false /api/v3/cloud-storages/{cloud_storage_id}/accesses: get: tags: @@ -15205,23 +10600,9 @@ paths: description: Get list of cloud storage NFS accesses operationId: listCloudStorageAccesses parameters: - - name: cloud_storage_id - in: path - required: true - schema: - type: integer - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/CloudStorageId' + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -15230,31 +10611,17 @@ paths: schema: $ref: '#/components/schemas/CloudStorageAccessPaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - cloudstorage:read @@ -15265,11 +10632,7 @@ paths: description: Create a new cloud storage NFS access operationId: createCloudStorageAccess parameters: - - name: cloud_storage_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/CloudStorageId' requestBody: required: true content: @@ -15277,38 +10640,32 @@ paths: schema: $ref: '#/components/schemas/CloudStorageAccessCreateRequest' responses: - '200': - description: OK + '201': + description: Created + headers: + Location: + description: URL of the created resource + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/CloudStorageAccessResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - cloudstorage:write @@ -15320,16 +10677,8 @@ paths: description: Get details of a cloud storage NFS access operationId: getCloudStorageAccess parameters: - - name: cloud_storage_id - in: path - required: true - schema: - type: integer - - name: access_id - in: path - required: true - schema: - type: string + - $ref: '#/components/parameters/CloudStorageId' + - $ref: '#/components/parameters/AccessId' responses: '200': description: OK @@ -15338,31 +10687,17 @@ paths: schema: $ref: '#/components/schemas/CloudStorageAccessResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - cloudstorage:read @@ -15373,49 +10708,25 @@ paths: description: Delete a cloud storage NFS access operationId: deleteCloudStorageAccess parameters: - - name: cloud_storage_id - in: path - required: true - schema: - type: integer - - name: access_id - in: path - required: true - schema: - type: string + - $ref: '#/components/parameters/CloudStorageId' + - $ref: '#/components/parameters/AccessId' responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/EmptyResponse' + '204': + description: No Content '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - cloudstorage:write @@ -15427,18 +10738,8 @@ paths: description: Get a list of all object storages operationId: listObjectStorages parameters: - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -15447,31 +10748,17 @@ paths: schema: $ref: '#/components/schemas/ObjectStoragePaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - objectstorage:read @@ -15483,11 +10770,7 @@ paths: description: Get object storage details operationId: getObjectStorage parameters: - - name: object_storage_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ObjectStorageId' responses: '200': description: OK @@ -15496,31 +10779,17 @@ paths: schema: $ref: '#/components/schemas/ObjectStorageResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - objectstorage:read @@ -15532,11 +10801,7 @@ paths: description: Get S3 access key and secret for object storage operationId: getObjectStorageS3Key parameters: - - name: object_storage_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ObjectStorageId' responses: '200': description: OK @@ -15545,34 +10810,21 @@ paths: schema: $ref: '#/components/schemas/ObjectStorageS3KeyResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - objectstorage:read + - objectstorage:secrets /api/v3/object-storages/{object_storage_id}/iam-users: get: tags: @@ -15581,23 +10833,9 @@ paths: description: Get list of object storage IAM users operationId: listObjectStorageIamUsers parameters: - - name: object_storage_id - in: path - required: true - schema: - type: integer - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/ObjectStorageId' + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -15606,31 +10844,17 @@ paths: schema: $ref: '#/components/schemas/ObjectStorageIamUserPaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - objectstorage:read @@ -15641,44 +10865,34 @@ paths: description: Create a new object storage IAM user operationId: createObjectStorageIamUser parameters: - - name: object_storage_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ObjectStorageId' responses: - '200': - description: OK + '201': + description: Created + headers: + Location: + description: URL of the created resource + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/ObjectStorageIamUserResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - objectstorage:write @@ -15690,16 +10904,8 @@ paths: description: Get object storage IAM user details operationId: getObjectStorageIamUser parameters: - - name: object_storage_id - in: path - required: true - schema: - type: integer - - name: iam_user_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ObjectStorageId' + - $ref: '#/components/parameters/IamUserId' responses: '200': description: OK @@ -15708,31 +10914,17 @@ paths: schema: $ref: '#/components/schemas/ObjectStorageIamUserResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - objectstorage:read @@ -15743,49 +10935,25 @@ paths: description: Delete an object storage IAM user operationId: deleteObjectStorageIamUser parameters: - - name: object_storage_id - in: path - required: true - schema: - type: integer - - name: iam_user_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ObjectStorageId' + - $ref: '#/components/parameters/IamUserId' responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/EmptyResponse' + '204': + description: No Content '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - objectstorage:write @@ -15797,23 +10965,9 @@ paths: description: Get list of object storage buckets operationId: listObjectStorageBuckets parameters: - - name: object_storage_id - in: path - required: true - schema: - type: integer - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/ObjectStorageId' + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -15822,31 +10976,17 @@ paths: schema: $ref: '#/components/schemas/ObjectStorageBucketPaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - objectstorage:read @@ -15858,16 +10998,8 @@ paths: description: Get object storage bucket details operationId: getObjectStorageBucket parameters: - - name: object_storage_id - in: path - required: true - schema: - type: integer - - name: bucket_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ObjectStorageId' + - $ref: '#/components/parameters/BucketId' responses: '200': description: OK @@ -15876,31 +11008,17 @@ paths: schema: $ref: '#/components/schemas/ObjectStorageBucketResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - objectstorage:read @@ -15912,11 +11030,7 @@ paths: description: Get list of cloud storage users operationId: listCloudStorageUsers parameters: - - name: cloud_storage_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/CloudStorageId' responses: '200': description: OK @@ -15925,31 +11039,17 @@ paths: schema: $ref: '#/components/schemas/CloudStorageUserListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - cloudstorage:read @@ -15961,16 +11061,8 @@ paths: description: Get cloud storage user details operationId: getCloudStorageUser parameters: - - name: cloud_storage_id - in: path - required: true - schema: - type: integer - - name: cloud_storage_user_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/CloudStorageId' + - $ref: '#/components/parameters/CloudStorageUserId' responses: '200': description: OK @@ -15979,31 +11071,17 @@ paths: schema: $ref: '#/components/schemas/CloudStorageUserResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - cloudstorage:read @@ -16014,53 +11092,28 @@ paths: description: Suspend a cloud storage user operationId: deleteCloudStorageUser parameters: - - name: cloud_storage_id - in: path - required: true - schema: - type: integer - - name: cloud_storage_user_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/CloudStorageId' + - $ref: '#/components/parameters/CloudStorageUserId' responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/EmptyResponse' + '204': + description: No Content '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - cloudstorage:write - /api/v3/cloud-storages/{cloud_storage_id}/users/{cloud_storage_user_id}/size: patch: tags: - Storage @@ -16068,16 +11121,8 @@ paths: description: Update cloud storage user quota operationId: updateCloudStorageUserSize parameters: - - name: cloud_storage_id - in: path - required: true - schema: - type: integer - - name: cloud_storage_user_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/CloudStorageId' + - $ref: '#/components/parameters/CloudStorageUserId' requestBody: required: true content: @@ -16092,31 +11137,19 @@ paths: schema: $ref: '#/components/schemas/CloudStorageUserResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - cloudstorage:write @@ -16128,16 +11161,8 @@ paths: description: Get object storage bucket chart data operationId: getObjectStorageBucketChart parameters: - - name: object_storage_id - in: path - required: true - schema: - type: integer - - name: bucket_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ObjectStorageId' + - $ref: '#/components/parameters/BucketId' responses: '200': description: OK @@ -16146,31 +11171,17 @@ paths: schema: $ref: '#/components/schemas/ObjectStorageBucketChartResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - objectstorage:read @@ -16182,28 +11193,10 @@ paths: description: Get list of object storage bucket firewall entries operationId: listObjectStorageBucketFirewallEntries parameters: - - name: object_storage_id - in: path - required: true - schema: - type: integer - - name: bucket_id - in: path - required: true - schema: - type: integer - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/ObjectStorageId' + - $ref: '#/components/parameters/BucketId' + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -16213,31 +11206,17 @@ paths: $ref: >- #/components/schemas/ObjectStorageBucketFirewallEntryPaginatedListResponse '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - objectstorage:read @@ -16245,19 +11224,16 @@ paths: tags: - Storage summary: Create object storage bucket firewall entry - description: Create object storage bucket firewall entry + description: >- + Starts adding an IP address or a subnet (CIDR) to the firewall of the + bucket, returned as a Task: the entry appears among the firewall entries + when the operation is completed. Firewall operations on the buckets of + an object storage run one at a time: while one is running, the request + is rejected with 409. operationId: createObjectStorageBucketFirewallEntry parameters: - - name: object_storage_id - in: path - required: true - schema: - type: integer - - name: bucket_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ObjectStorageId' + - $ref: '#/components/parameters/BucketId' requestBody: required: true content: @@ -16266,38 +11242,36 @@ paths: $ref: >- #/components/schemas/ObjectStorageBucketFirewallEntryCreateRequest responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ObjectStorageBucketFirewallEntryResponse' - '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '401': - description: Not authorized - content: - application/json: + '202': + description: >- + Accepted: the operation goes on in the background, as the returned + Task + headers: + Location: + description: >- + URL of the Task: `/api/v3/tasks/{task_id}`. Reading it requires + the `purchases:read` scope + required: true schema: - $ref: '#/components/schemas/ApiError' - '403': - description: Forbidden + type: string content: application/json: schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/schemas/TaskResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - objectstorage:write @@ -16309,21 +11283,9 @@ paths: description: Get object storage bucket firewall entry details operationId: getObjectStorageBucketFirewallEntry parameters: - - name: object_storage_id - in: path - required: true - schema: - type: integer - - name: bucket_id - in: path - required: true - schema: - type: integer - - name: entry_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ObjectStorageId' + - $ref: '#/components/parameters/BucketId' + - $ref: '#/components/parameters/EntryId' responses: '200': description: OK @@ -16332,31 +11294,17 @@ paths: schema: $ref: '#/components/schemas/ObjectStorageBucketFirewallEntryResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - objectstorage:read @@ -16364,57 +11312,47 @@ paths: tags: - Storage summary: Delete object storage bucket firewall entry - description: Delete object storage bucket firewall entry + description: >- + Starts removing the entry from the firewall of the bucket, returned as a + Task: the entry disappears when the operation is completed. Firewall + operations on the buckets of an object storage run one at a time: while + one is running, the request is rejected with 409. operationId: deleteObjectStorageBucketFirewallEntry parameters: - - name: object_storage_id - in: path - required: true - schema: - type: integer - - name: bucket_id - in: path - required: true - schema: - type: integer - - name: entry_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ObjectStorageId' + - $ref: '#/components/parameters/BucketId' + - $ref: '#/components/parameters/EntryId' responses: - '200': - description: OK - content: - application/json: + '202': + description: >- + Accepted: the operation goes on in the background, as the returned + Task + headers: + Location: + description: >- + URL of the Task: `/api/v3/tasks/{task_id}`. Reading it requires + the `purchases:read` scope + required: true schema: - $ref: '#/components/schemas/ObjectStorageBucketFirewallEntryResponse' - '400': - description: Bad request + type: string content: application/json: schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/schemas/TaskResponse' + '400': + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - objectstorage:write @@ -16426,16 +11364,8 @@ paths: description: Get list of object storage IAM user S3 keys operationId: listObjectStorageIamUserS3Keys parameters: - - name: object_storage_id - in: path - required: true - schema: - type: integer - - name: iam_user_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ObjectStorageId' + - $ref: '#/components/parameters/IamUserId' responses: '200': description: OK @@ -16444,31 +11374,17 @@ paths: schema: $ref: '#/components/schemas/ObjectStorageIamUserS3KeyListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - objectstorage:read @@ -16476,52 +11392,42 @@ paths: tags: - Storage summary: Create object storage IAM user S3 key - description: Create object storage IAM user S3 key + description: >- + Creates a new S3 key for the IAM user and returns it with its secret, + which afterwards is returned only with the objectstorage:secrets scope. + An IAM user has at most 2 keys: with 2 keys the request is rejected with + 409, as when the object storage is not active or is under maintenance. operationId: createObjectStorageIamUserS3Key parameters: - - name: object_storage_id - in: path - required: true - schema: - type: integer - - name: iam_user_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ObjectStorageId' + - $ref: '#/components/parameters/IamUserId' responses: - '200': - description: OK + '201': + description: Created + headers: + Location: + description: URL of the created resource + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/ObjectStorageIamUserS3KeyResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - objectstorage:write @@ -16533,21 +11439,9 @@ paths: description: Get object storage IAM user S3 key details operationId: getObjectStorageIamUserS3Key parameters: - - name: object_storage_id - in: path - required: true - schema: - type: integer - - name: iam_user_id - in: path - required: true - schema: - type: integer - - name: s3_key_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ObjectStorageId' + - $ref: '#/components/parameters/IamUserId' + - $ref: '#/components/parameters/S3KeyId' responses: '200': description: OK @@ -16556,31 +11450,17 @@ paths: schema: $ref: '#/components/schemas/ObjectStorageIamUserS3KeyResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - objectstorage:read @@ -16588,57 +11468,33 @@ paths: tags: - Storage summary: Delete object storage IAM user S3 key - description: Delete object storage IAM user S3 key + description: >- + Deletes the S3 key of the IAM user on the storage, so it can no longer + be used. A key already deleted is not found (404); the request is + rejected with 409 when the object storage is not active or is under + maintenance. operationId: deleteObjectStorageIamUserS3Key parameters: - - name: object_storage_id - in: path - required: true - schema: - type: integer - - name: iam_user_id - in: path - required: true - schema: - type: integer - - name: s3_key_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ObjectStorageId' + - $ref: '#/components/parameters/IamUserId' + - $ref: '#/components/parameters/S3KeyId' responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/EmptyResponse' + '204': + description: No Content '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - objectstorage:write @@ -16650,18 +11506,8 @@ paths: description: Get a list of all user sub accounts operationId: listSubAccounts parameters: - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -16670,31 +11516,17 @@ paths: schema: $ref: '#/components/schemas/AccountPaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - account:read @@ -16711,38 +11543,30 @@ paths: schema: $ref: '#/components/schemas/SubAccountCreateRequest' responses: - '200': - description: OK + '201': + description: Created + headers: + Location: + description: URL of the created resource + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/AccountResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - account:write @@ -16754,11 +11578,7 @@ paths: description: Get details of a user sub-account operationId: getSubAccount parameters: - - name: account_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/AccountId' responses: '200': description: OK @@ -16767,31 +11587,17 @@ paths: schema: $ref: '#/components/schemas/AccountResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - account:read @@ -16799,47 +11605,30 @@ paths: tags: - Account summary: Delete a user sub-account - description: Delete a user sub-account + description: >- + Deactivates the sub-account: it can no longer log in and is no longer + among the sub-accounts, and its One-Click payment methods, automatic + renewals, deferred payment and unified billing are revoked. The response + is 404 when the account is not an active sub-account of the reseller, + 403 when the account of the token cannot manage sub-accounts operationId: deleteSubAccount parameters: - - name: account_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/AccountId' responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/EmptyResponse' + '204': + description: No Content '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - account:write @@ -16847,14 +11636,14 @@ paths: tags: - Account summary: Edit a user sub-account - description: Edit an existing user sub-account + description: >- + Edit an existing user sub-account. Only the given fields change, with + the rules of the creation: a field required by the creation cannot be + emptied, and phone and mobile numbers are given together with their + prefix operationId: updateSubAccount parameters: - - name: account_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/AccountId' requestBody: required: true content: @@ -16869,31 +11658,17 @@ paths: schema: $ref: '#/components/schemas/AccountResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - account:write @@ -16907,32 +11682,29 @@ paths: parameters: - name: alive_only in: query + description: >- + Only the tasks of alive purchases, not cancelled or terminated + (default); false includes the tasks of every purchase required: false schema: type: boolean default: true - name: ask_user_error in: query + description: >- + Only the tasks whose `ask_user_error` is exactly this text: the + error found in the data provided by the customer required: false schema: type: string - name: purchase_id in: query + description: Only the tasks of the purchase with this ID required: false schema: type: integer - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -16941,31 +11713,17 @@ paths: schema: $ref: '#/components/schemas/TaskPaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - purchases:read @@ -16977,11 +11735,7 @@ paths: description: Get a task operationId: getTask parameters: - - name: task_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/TaskId' responses: '200': description: OK @@ -16990,31 +11744,17 @@ paths: schema: $ref: '#/components/schemas/TaskResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - purchases:read @@ -17026,11 +11766,7 @@ paths: description: Complete task with extra data operationId: completeTaskData parameters: - - name: task_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/TaskId' requestBody: required: true content: @@ -17043,38 +11779,36 @@ paths: type: object type: object responses: - '200': - description: OK + '202': + description: >- + Accepted: the operation goes on in the background, as the returned + Task + headers: + Location: + description: >- + URL of the Task: `/api/v3/tasks/{task_id}`. Reading it requires + the `purchases:read` scope + required: true + schema: + type: string content: application/json: schema: $ref: '#/components/schemas/TaskResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - purchases:write @@ -17083,7 +11817,10 @@ paths: tags: - Shop summary: List all TLDs - description: Get a list of all TLD extensions for domains + description: |- + Get a list of all TLD extensions for domains + + Not available to sub-accounts: the response is 403 (error 1601). operationId: listTlds parameters: - name: extension @@ -17114,18 +11851,8 @@ paths: required: false schema: type: string - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -17134,47 +11861,33 @@ paths: schema: $ref: '#/components/schemas/TldPaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - shop:read + x-sub-accounts: false /api/v3/tlds/{tld_id}: get: tags: - Shop summary: Get a TLD - description: Get details of a TLD extension + description: |- + Get details of a TLD extension + + Not available to sub-accounts: the response is 403 (error 1601). operationId: getTld parameters: - - name: tld_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/TldId' responses: '200': description: OK @@ -17183,82 +11896,68 @@ paths: schema: $ref: '#/components/schemas/TldResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - shop:read - /api/v3/upload: + x-sub-accounts: false + /api/v3/uploads: post: tags: - Account summary: Upload file - description: Upload one or more files + description: >- + Uploads a file, whose upload_id is then used by other calls (e.g. the + PEC documents). operationId: uploadFile requestBody: - required: false + required: true content: - application/json: + multipart/form-data: schema: + required: + - file + properties: + file: + description: >- + File to upload, at most 5 MB, with extension pdf, p7m, jpg, + jpeg, png, txt, doc, docx, xls or xlsx. The content must + match the extension + type: string + format: binary type: object responses: - '200': - description: OK + '201': + description: Created content: application/json: schema: $ref: '#/components/schemas/ApiUploadResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - - oauth2: [] + - oauth2: + - upload:write /api/v3/web-monitorings: get: tags: @@ -17267,18 +11966,8 @@ paths: description: Get a paginated list of web monitorings for the authenticated account operationId: listWebMonitorings parameters: - - name: page - in: query - required: false - schema: - type: integer - default: 1 - - name: per_page - in: query - required: false - schema: - type: integer - default: 15 + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: '200': description: OK @@ -17287,31 +11976,17 @@ paths: schema: $ref: '#/components/schemas/WebMonitoringPaginatedListResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - webmonitoring:read @@ -17323,11 +11998,7 @@ paths: description: Get details of a web monitoring for the authenticated account operationId: getWebMonitoring parameters: - - name: web_monitoring_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/WebMonitoringId' responses: '200': description: OK @@ -17336,31 +12007,17 @@ paths: schema: $ref: '#/components/schemas/WebMonitoringResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - webmonitoring:read @@ -17372,11 +12029,7 @@ paths: description: Get notification notices configuration for a web monitoring operationId: getWebMonitoringNotices parameters: - - name: web_monitoring_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/WebMonitoringId' responses: '200': description: OK @@ -17385,31 +12038,17 @@ paths: schema: $ref: '#/components/schemas/WebMonitoringNoticesResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - webmonitoring:read @@ -17420,11 +12059,7 @@ paths: description: Update notification notices configuration for a web monitoring operationId: updateWebMonitoringNotices parameters: - - name: web_monitoring_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/WebMonitoringId' requestBody: required: true content: @@ -17439,31 +12074,17 @@ paths: schema: $ref: '#/components/schemas/WebMonitoringNoticesResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - webmonitoring:write @@ -17475,11 +12096,7 @@ paths: description: Get download speed chart points for a web monitoring service operationId: getWebMonitoringDownloadSpeedChart parameters: - - name: web_monitoring_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/WebMonitoringId' responses: '200': description: OK @@ -17488,31 +12105,17 @@ paths: schema: $ref: '#/components/schemas/WebMonitoringDownloadSpeedChartResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - webmonitoring:read @@ -17524,11 +12127,7 @@ paths: description: Get response time chart points for a web monitoring service operationId: getWebMonitoringResponseTimeChart parameters: - - name: web_monitoring_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/WebMonitoringId' responses: '200': description: OK @@ -17537,31 +12136,17 @@ paths: schema: $ref: '#/components/schemas/WebMonitoringResponseTimeChartResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - webmonitoring:read @@ -17573,11 +12158,7 @@ paths: description: Get availability chart points for a web monitoring service operationId: getWebMonitoringAvailabilityChart parameters: - - name: web_monitoring_id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/WebMonitoringId' responses: '200': description: OK @@ -17586,31 +12167,17 @@ paths: schema: $ref: '#/components/schemas/WebMonitoringAvailabilityChartResponse' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/BadRequest' '401': - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/Forbidden' '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiError' + $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/ServerError' security: - oauth2: - webmonitoring:read @@ -17618,18 +12185,18 @@ paths: get: tags: - OAuth - summary: Esponi JWKS - description: Restituisce le chiavi pubbliche usate per firmare gli access token JWT. + summary: Get the JWKS + description: Returns the public keys used to sign the JWT access tokens. operationId: getJwks responses: '200': - description: Chiavi disponibili + description: Available keys content: application/json: schema: $ref: '#/components/schemas/JwksResponse' '500': - description: Impossibile esporre il JWKS + description: Unable to expose the JWKS content: application/json: schema: @@ -17639,15 +12206,15 @@ paths: post: tags: - OAuth - summary: Richiedi un access token + summary: Request an access token description: >- - Eroga un access token JWT tramite grant `client_credentials`. I - parametri `audience` e `scope` sono opzionali: senza `audience` il token - usa l'unica audience del client (un client con più audience deve - indicarla), senza `scope` riceve tutti gli scope assegnati al client, - come con `scope=api:full`. Gli scope interni sono concessi solo con - audience `api-internal`. La risposta riporta l'audience e gli scope - concessi. + Issues a JWT access token with the `client_credentials` grant. The + `audience` and `scope` parameters are optional: without `audience`, or + with an empty value, the token gets the only audience of the client (a + client with more audiences must send it); without `scope` it gets all + the scopes assigned to the client, as with `scope=api:full`. The + internal scopes are granted only with the `api-internal` audience. The + response reports the granted audience and scopes. operationId: requestAccessToken requestBody: required: true @@ -17662,45 +12229,47 @@ paths: enum: - client_credentials client_id: - description: Client ID se non fornito tramite Authorization header Basic. + description: >- + Client ID, when it is not sent in the Basic Authorization + header. type: - string - 'null' client_secret: description: >- - Client secret se non fornito tramite Authorization header - Basic. + Client secret, when it is not sent in the Basic + Authorization header. type: - string - 'null' scope: description: >- - Scope separati da spazio. Se omesso: tutti gli scope - assegnati al client. + Space-separated scopes. When omitted: all the scopes + assigned to the client. type: - string - 'null' audience: - description: 'Se omessa: l''unica audience del client.' + description: 'When omitted or empty: the only audience of the client.' anyOf: - $ref: '#/components/schemas/OAuthAudience' - type: 'null' type: object responses: '200': - description: Token emesso + description: Token issued content: application/json: schema: $ref: '#/components/schemas/OAuthTokenResponse' '400': - description: Richiesta non valida + description: Invalid request content: application/json: schema: $ref: '#/components/schemas/OAuthError' '401': - description: Autenticazione client fallita + description: Client authentication failed content: application/json: schema: @@ -17708,7 +12277,7 @@ paths: '429': $ref: '#/components/responses/TokenTooManyRequests' '500': - description: Errore inatteso + description: Unexpected error content: application/json: schema: @@ -17717,6 +12286,9 @@ paths: components: schemas: ApiError: + description: >- + Error response: the code in `error`, the description in `message`, the + errors for each field in `meta` for validation errors required: - error - message @@ -17724,25 +12296,52 @@ components: - meta properties: error: - description: Codice d'errore maggiore di zero + description: >- + Error code: 1000 validation failed (details in `meta.errors`), 1001 + bad request, 1100 access token missing, invalid, expired or revoked + (HTTP 401: request a new token and retry once), 1101 insufficient + scope (HTTP 403: the token lacks a scope listed in the + `WWW-Authenticate` header), 1102 the access token audience is not + valid for this API (HTTP 403), 1200 not found, 1201 not implemented, + 1202 method not allowed, 1300 rate limited, 1400 conflict with a + business rule or with the state of the resource, 1500 server error, + 1601 forbidden (for example a feature not included in the plan, an + operation not available to sub-accounts, the internal API without + administrator privileges, or a request from an IP address not + allowed for the account), 1700 payment declined by the payment + provider (HTTP 402: the orders are still to be paid), 1 other + errors. Do not retry 403 responses with a new token: the result does + not change. type: integer minimum: 1 - example: 400 + example: 1000 message: + description: Description of the error, for the developers of the client type: string example: Invalid request data: - description: Null nelle risposte d'errore - type: - - object - - 'null' + description: Always null in error responses + const: null meta: - description: Null nelle risposte d'errore + description: >- + Null, except in validation errors (HTTP 400 with error 1000), where + it contains `errors` + properties: + errors: + description: >- + Errors for each field: path of the field (e.g. cpu, + configuration.ram, ids[3]) => messages + type: object + additionalProperties: + type: array + items: + type: string type: - object - 'null' type: object PaginationMeta: + description: Pagination of a list, with the totals required: - total - count @@ -17751,17 +12350,25 @@ components: - per_page properties: total: + description: Number of items in the whole list type: integer count: + description: 'Number of items in this page: 0 beyond the last page' type: integer pages: + description: Number of pages of the list type: integer page: + description: Number of this page, starting from 1 type: integer per_page: + description: Maximum number of items in a page type: integer type: object SimplePaginationMeta: + description: >- + Pagination of a list without the totals: `next` says whether there is + another page required: - count - page @@ -17769,24 +12376,30 @@ components: - next properties: count: + description: 'Number of items in this page: 0 beyond the last page' type: integer page: + description: Number of this page, starting from 1 type: integer per_page: + description: Maximum number of items in a page type: integer next: description: Tells if there is another page after this one type: boolean type: object HealthStatus: + description: Status of the API required: - status properties: status: + description: '`ok` when the API is up' type: string example: ok type: object OAuthTokenResponse: + description: Access token issued by the token endpoint required: - token_type - expires_in @@ -17795,42 +12408,61 @@ components: - audience properties: token_type: + description: 'Type of the token: always `Bearer`' type: string example: Bearer expires_in: + description: Lifetime of the token, in seconds type: integer example: 600 access_token: + description: >- + Access token, a JWT signed with the keys of `GET + /.well-known/jwks.json`: send it in the `Authorization: Bearer` + header type: string example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9… scope: - description: Elenco degli scope concessi separati da spazio + description: Space-separated list of the granted scopes type: string example: purchases:read purchases:write audience: - description: Audience associata al token + description: >- + Audience of the token: `api-public` for the public API, + `api-internal` for the internal one type: string example: api-public type: object OAuthError: + description: >- + Error of the token endpoint, in the OAuth2 format (RFC 6749, section + 5.2) required: - error properties: error: + description: >- + OAuth2 error code, for example `invalid_client`, `invalid_scope` or + `rate_limited` type: string example: invalid_client error_description: + description: Description of the error, for the developers of the client type: - string - 'null' example: Client authentication failed. error_uri: + description: Page that describes the error, when there is one type: - string - 'null' example: https://docs.shellrent.com/oauth/errors#invalid_client type: object JwkKey: + description: >- + Public key that verifies the signature of the access tokens (JSON Web + Key, RFC 7517) required: - kid - kty @@ -17840,41 +12472,54 @@ components: - e properties: kid: + description: 'Id of the key: the `kid` in the header of the tokens it signs' type: string example: api-key-20240101 kty: + description: 'Key type: `RSA`' type: string example: RSA alg: + description: 'Signature algorithm: `RS256`' type: string example: RS256 use: + description: 'Use of the key: `sig`, signature' type: string example: sig 'n': - description: Modulo base64url + description: RSA modulus, base64url-encoded type: string example: uUp7zN1... e: - description: Esponente base64url + description: RSA public exponent, base64url-encoded type: string example: AQAB status: + description: >- + `active`: signs the new tokens; `trusted`: no longer signs, but + verifies the tokens already issued; `retired`: verifies the tokens + already issued until they expire, then leaves the set type: - string - 'null' example: trusted type: object JwksResponse: + description: Public keys of the API (JSON Web Key Set) required: - keys properties: keys: + description: Keys that verify the tokens, each with its status type: array items: $ref: '#/components/schemas/JwkKey' type: object OAuthAudience: + description: >- + Audience of an access token: `api-public` for the public API, + `api-internal` for the internal one type: string enum: - api-public @@ -17885,7 +12530,9 @@ components: - amount properties: amount: - description: Topup amount. + description: >- + Amount of the top-up in euros, before VAT: the order adds the VAT, + and the credit loaded is the total with VAT type: integer enum: - 50 @@ -17899,6 +12546,7 @@ components: - 1500 - 2000 type: object + additionalProperties: false BuyServiceActiveMonitoringRequest: required: - service_id @@ -17906,6 +12554,7 @@ components: service_id: description: ID of the Service to buy type: integer + minimum: 1 account_id: description: >- ID of the account of the user that will be the owner of the purchase @@ -17943,6 +12592,7 @@ components: type: object additionalProperties: false type: object + additionalProperties: false BuyServiceCloudStorageRequest: required: - service_id @@ -17950,8 +12600,13 @@ components: service_id: description: ID of the Service to buy type: integer + minimum: 1 recurrence_id: - description: ID of the Recurrence to assign to the purchased service + description: >- + ID of the billing recurrence of the purchased service: one of the + `recurrences_available` of the chosen service, as listed by `GET + /api/v3/shop/cloud-storage`. If omitted, the default recurrence of + the service (`recurrence`) is used. type: integer account_id: description: >- @@ -17959,127 +12614,133 @@ components: (available to Resellers only) type: integer type: object + additionalProperties: false BuyServiceCloudVpsRequest: required: - service_id - data - type: object - allOf: - - $ref: '#/components/schemas/BuyServiceDedicatedServerRequest' - - properties: - service_id: - description: ID of the Service to buy + properties: + service_id: + description: ID of the Service to buy + type: integer + minimum: 1 + recurrence_id: + description: >- + ID of the billing recurrence of the purchased service: one of the + `recurrences_available` of the chosen service, as listed by `GET + /api/v3/shop/cloud-vps`. If omitted, the default recurrence of the + service (`recurrence`) is used. + type: integer + account_id: + description: >- + ID of the account of the user that will be the owner of the purchase + (available to Resellers only) + type: integer + data: + description: Cloud VPS configuration details + required: + - SERVER_CONFIGURATION_CODE + - SERVER_TEMPLATE_CODE + - RAM_QUANTITY + - DISK_QUANTITY + - VCPU_QUANTITY + properties: + SERVER_CONFIGURATION_CODE: + description: >- + One of the server Templates compatible with the "Cloud VPS + Server" service to buy + type: string + SERVER_TEMPLATE_CODE: + description: >- + One of the server Operative Systems (OS) compatible with the + "Cloud VPS Server" service to buy and with the chosen server + Template + type: string + RAM_QUANTITY: + description: >- + RAM in GB. Min value may change depending on chosen server + configuration or template. type: integer - recurrence_id: - description: ID of the Recurrence to assign to the purchased service + maximum: 12 + minimum: 1 + DISK_QUANTITY: + description: >- + Disk size in GB. Min value may change depending on chosen server + configuration or template. type: integer - account_id: + enum: + - 20 + - 25 + - 30 + - 35 + - 40 + - 45 + - 50 + - 55 + - 60 + - 65 + - 70 + - 75 + - 80 + - 85 + - 90 + - 95 + - 100 + VCPU_QUANTITY: description: >- - ID of the account of the user that will be the owner of the - purchase (available to Resellers only) + Number of vCPU. Min value may change depending on chosen server + configuration or template. type: integer - data: - description: Cloud VPS configuration details - required: - - SERVER_CONFIGURATION_CODE - - SERVER_TEMPLATE_CODE - - RAM_QUANTITY - - DISK_QUANTITY - - VCPU_QUANTITY - properties: - SERVER_CONFIGURATION_CODE: - description: >- - One of the server Templates compatible with the "Cloud VPS - Server" service to buy - type: string - SERVER_TEMPLATE_CODE: - description: >- - One of the server Operative Systems (OS) compatible with the - "Cloud VPS Server" service to buy and with the chosen server - Template - type: string - RAM_QUANTITY: - description: >- - RAM in GB. Min value may change depending on chosen server - configuration or template. - type: integer - maximum: 12 - minimum: 1 - DISK_QUANTITY: - description: >- - Disk size in GB. Min value may change depending on chosen - server configuration or template. - type: integer - enum: - - 20 - - 25 - - 30 - - 35 - - 40 - - 45 - - 50 - - 55 - - 60 - - 65 - - 70 - - 75 - - 80 - - 85 - - 90 - - 95 - - 100 - VCPU_QUANTITY: - description: >- - Number of vCPU. Min value may change depending on chosen - server configuration or template. - type: integer - maximum: 8 - minimum: 1 - type: object - additionalProperties: false + maximum: 8 + minimum: 1 type: object + additionalProperties: false + type: object + additionalProperties: false BuyServiceCpanelLicenseRequest: required: - service_id - data - type: object - allOf: - - $ref: '#/components/schemas/BuyServicePleskLicenseRequest' - - properties: - service_id: - description: ID of the Service to buy - type: integer - account_id: + properties: + service_id: + description: ID of the Service to buy + type: integer + minimum: 1 + account_id: + description: >- + ID of the account of the user that will be the owner of the purchase + (available to Resellers only) + type: integer + data: + description: Details about where to install the license + required: + - installation_type + properties: + installation_type: + description: >- + Choose to install the license on an active server or on external + IP address + type: string + enum: + - internal_installation_type + - external_installation_type + purchase_server: description: >- - ID of the account of the user that will be the owner of the - purchase (available to Resellers only) + Id of the purchase of the server where the license will be + installed (`purchase_id` of `GET /api/v3/servers/{server_id}`), + not the id of the server. Required only if "installation_type" + has value "internal_installation_type" type: integer - data: - description: Details about where to install the license - properties: - installation_type: - description: >- - Choose to install the license on an active server or on - external IP address - type: string - enum: - - internal_installation_type - - external_installation_type - purchase_server: - description: >- - ID of the server where the license will be installed to. - Required only if "installation_type" has value - "internal_installation_type" - type: integer - ip_address: - description: >- - IP address of the external host where the license will be - installed to. Required only if "installation_type" has value - "external_installation_type" - type: string - type: object - additionalProperties: false + ip_address: + description: >- + IP address of the external host where the license will be + installed to. Required only if "installation_type" has value + "external_installation_type" + type: string type: object + additionalProperties: false + type: object + additionalProperties: false BuyServiceDedicatedServerRequest: required: - service_id @@ -18088,8 +12749,13 @@ components: service_id: description: ID of the Service to buy type: integer + minimum: 1 recurrence_id: - description: ID of the Recurrence to assign to the purchased service + description: >- + ID of the billing recurrence of the purchased service: one of the + `recurrences_available` of the chosen service, as listed by `GET + /api/v3/shop/dedicated-server`. If omitted, the default recurrence + of the service (`recurrence`) is used. type: integer account_id: description: >- @@ -18116,6 +12782,7 @@ components: type: object additionalProperties: false type: object + additionalProperties: false BuyServiceDomainRequest: required: - configuration @@ -18123,6 +12790,9 @@ components: properties: configuration: description: Domain purchase configuration options + required: + - domain_name + - extension properties: domain_name: description: >- @@ -18135,6 +12805,9 @@ components: type: object additionalProperties: false data: + description: >- + Registration data of the domain: the contacts that its TLD requires + and, for a transfer, the authcode required: - contact_data properties: @@ -18146,9 +12819,7 @@ components: description: >- Domain auth-info code (authcode). Required if the domain must be transferred. - type: - - string - - 'null' + type: string type: object additionalProperties: false account_id: @@ -18157,6 +12828,7 @@ components: (available to Resellers only) type: integer type: object + additionalProperties: false BuyServiceMicrosoft365Request: required: - service_id @@ -18165,11 +12837,15 @@ components: service_id: description: ID of the Service to buy type: integer + minimum: 1 quantity: - description: Number of seats + description: >- + Number of seats (user licenses) to purchase. It must be between + `quantity_min` and `quantity_max` of the chosen service, as listed + by `GET /api/v3/shop/microsoft-365/services`. If omitted, + `quantity_min` is used. Ignored for the services without + `quantity_max`. type: integer - default: 1 - maximum: 100 minimum: 1 account_id: description: >- @@ -18178,8 +12854,13 @@ components: type: integer data: description: >- - Information about the Microsoft 365 tenant to associate to the - subscription + Microsoft 365 tenant of the subscription. All the data is checked + before the order is created: with "select" the tenant must be one of + the account (409 if it already has 2 active subscriptions of the + same service); with "transfer" and "new" no tenant can have the + domain prefix already, and at Microsoft the ".onmicrosoft.com" + domain must exist ("transfer") or be available ("new"), otherwise + 409. Send only the fields of the chosen option. required: - tenant_choice properties: @@ -18196,99 +12877,103 @@ components: - new tenant_select: description: >- - Tenant ID to which to assign the subscription when selecting an - existing tenant - type: - - integer - - 'null' + ID of the tenant to which to assign the subscription, as listed + by `GET /api/v3/shop/microsoft-365/tenants`. Required with + "select", not allowed otherwise + type: integer + minimum: 1 domain_prefix: description: >- - Prefix of the ".onmicrosoft.com" tenant domain when creating or - transferring a tenant - type: - - string - - 'null' + Prefix of the ".onmicrosoft.com" tenant domain: lowercase + letters and digits, at most 27 characters. Required with + "transfer" and "new", not allowed otherwise + type: string + pattern: ^[a-z0-9]{1,27}$ + example: mycompany first_name: description: >- - Contact first name for the tenant when not selecting an existing - tenant - type: - - string - - 'null' + Contact first name for the tenant: letters, spaces and hyphens. + Required with "transfer" and "new", not allowed otherwise + type: string + pattern: ^[\p{L}\s\-]+$ + example: Mario last_name: description: >- - Contact last name for the tenant when not selecting an existing - tenant - type: - - string - - 'null' + Contact last name for the tenant: letters, spaces and hyphens. + Required with "transfer" and "new", not allowed otherwise + type: string + pattern: ^[\p{L}\s\-]+$ + example: Rossi company_name: description: >- - Company name for the tenant when not selecting an existing - tenant - type: - - string - - 'null' + Company name for the tenant: letters, digits and spaces. + Required with "transfer" and "new", not allowed otherwise + type: string + pattern: ^[\p{L}0-9\s]+$ + example: Rossi Srl address: - description: Address for the tenant when not selecting an existing tenant - type: - - string - - 'null' + description: >- + Address for the tenant. Required with "transfer" and "new", not + allowed otherwise + type: string + minLength: 1 + example: Via Roma 1 city: - description: City for the tenant when not selecting an existing tenant - type: - - string - - 'null' + description: >- + City for the tenant address: letters, spaces and hyphens. + Required with "transfer" and "new", not allowed otherwise + type: string + pattern: ^[\p{L}\s\-]+$ + example: Vicenza state: description: >- - State/Province for the tenant address when not selecting an - existing tenant - type: - - string - - 'null' + State/Province for the tenant address: letters, spaces and + hyphens. Required with "transfer" and "new", not allowed + otherwise + type: string + minLength: 3 + pattern: ^[\p{L}\s\-]+$ + example: Vicenza postal_code: description: >- - Postal code for the tenant address when not selecting an - existing tenant - type: - - string - - 'null' + Postal code for the tenant address: letters, digits and spaces. + Required with "transfer" and "new", not allowed otherwise + type: string + pattern: ^[a-zA-Z0-9\s]+$ + example: '36100' country: description: >- - ISO country code with 2 letters (e.g. "IT" or "ES") when not - selecting an existing tenant - type: - - string - - 'null' + ISO country code with 2 letters (e.g. "IT" or "ES"). Required + with "transfer" and "new", not allowed otherwise + type: string + pattern: ^[\p{L}\s\-]+$ + example: IT email_address: description: >- - Administrative email address for the tenant when not selecting - an existing tenant - type: - - string - - 'null' + Administrative email address for the tenant. Required with + "transfer" and "new", not allowed otherwise + type: string format: email phone_prefix: description: >- - Country code phone prefix with leading "+" sign when not - selecting an existing tenant - type: - - string - - 'null' + International phone prefix of a country, with the leading "+" + sign (e.g. "+44" for UK or "+39" for Italy). Required with + "transfer" and "new", not allowed otherwise + type: string + example: '+39' phone_number: description: >- - Phone number for the tenant contact when not selecting an - existing tenant - type: - - string - - 'null' + Phone number for the tenant contact: from 3 to 25 digits, + spaces, dots, hyphens and parentheses. Required with "transfer" + and "new", not allowed otherwise + type: string + pattern: ^[\d() .-]{3,25}$ + example: 0444 123456 locale: description: >- - Locale to use for the tenant when not selecting an existing - tenant - type: - - string - - 'null' + Locale to use for the tenant. Required with "transfer" and + "new", not allowed otherwise + type: string enum: - it_IT - en_US @@ -18296,32 +12981,23 @@ components: type: object additionalProperties: false type: object + additionalProperties: false BuyServiceObjectStorageRequest: - required: - - configuration properties: configuration: - description: Object Storage configuration options + description: >- + Object Storage configuration. If omitted, the smallest size allowed + by the service is used. properties: tb_size: - description: Number of TB to allocate + description: >- + Storage size, in TB. The allowed sizes depend on the Object + Storage service: from its minimum to its maximum quantity, in + steps of 1 TB up to 5 TB and of 5 TB above (for example 1, 2, 3, + 4, 5, 10, 15, 20). Any other value is rejected with a validation + error that lists the allowed sizes. If omitted, the smallest + allowed size is used. type: integer - default: 1 - enum: - - 1 - - 2 - - 3 - - 4 - - 5 - - 10 - - 15 - - 20 - - 25 - - 30 - - 35 - - 40 - - 45 - - 50 type: object additionalProperties: false account_id: @@ -18330,12 +13006,18 @@ components: (available to Resellers only) type: integer type: object + additionalProperties: false BuyServicePecDomainRequest: required: - data properties: data: - required: [] + description: >- + Domain to activate for PEC (certified email, "Posta Elettronica + Certificata") and data of its owner; the `transferin_*` documents + only for a transfer + required: + - domain_name properties: domain_name: description: >- @@ -18443,6 +13125,7 @@ components: (available to Resellers only) type: integer type: object + additionalProperties: false BuyServicePecRequest: required: - service_id @@ -18451,7 +13134,12 @@ components: service_id: description: ID of the Service to buy type: integer + minimum: 1 data: + description: >- + PEC (certified email, "Posta Elettronica Certificata") mailbox to + create and data of its owner; the `transferin_*` documents only for + a transfer required: - box_name - domain_select @@ -18568,6 +13256,7 @@ components: (available to Resellers only) type: integer type: object + additionalProperties: false BuyServicePleskLicenseRequest: required: - service_id @@ -18576,6 +13265,7 @@ components: service_id: description: ID of the Service to buy type: integer + minimum: 1 account_id: description: >- ID of the account of the user that will be the owner of the purchase @@ -18583,167 +13273,62 @@ components: type: integer data: description: Details about where to install the license - properties: - installation_type: - description: >- - Choose to install the license on an active server or on external - IP address - type: string - enum: - - internal_installation_type - - external_installation_type - purchase_server: - description: >- - ID of the server where the license will be installed to. - Required only if "installation_type" has value - "internal_installation_type" - type: integer - ip_address: - description: >- - IP address of the external host where the license will be - installed to. Required only if "installation_type" has value - "external_installation_type" - type: string - type: object - additionalProperties: false - type: object - BuyServicePrivateCloudSvRequest: - required: - - service_id - properties: - service_id: - description: ID of the Service to buy - type: integer - account_id: - description: >- - ID of the account of the user that will be the owner of the purchase - (available to Resellers only) - type: integer - data: - description: Private Cloud SV configuration options - properties: - ADDITIONAL_BACKUP_DISK_SERVICE_QUANTITY: - description: >- - Choose to configure the Private Cloud with or without additional - backup disk - type: integer - default: 1 - enum: - - 0 - - 1 - type: object - additionalProperties: false - type: object - BuyServiceSecuremailForGoogleWorkspaceRequest: - required: - - configuration - - data - type: object - allOf: - - $ref: '#/components/schemas/BuyServiceSecuremailForMicrosoft365Request' - - properties: - configuration: - description: SecureMail for Google Workspace configuration options - properties: - SERVICE_QUANTITY: - description: Number of mailboxes to protect. - type: integer - minimum: 1 - type: object - additionalProperties: false - data: - required: - - email_domain - - super_admin_email - - oauth2_json_file - - key_json_file - properties: - email_domain: - description: Domain name for the emails to be protected - type: string - super_admin_email: - description: Email address of the Google Workspace superadmin - type: string - format: email - oauth2_json_file: - description: 'ID of the uploaded file (first file, extension: "json")' - type: integer - key_json_file: - description: 'ID of the uploaded file (second file, extension: "json")' - type: integer - type: object - additionalProperties: false - account_id: - description: >- - ID of the account of the user that will be the owner of the - purchase (available to Resellers only) - type: integer - type: object - BuyServiceSecuremailForMicrosoft365Request: - required: - - configuration - - data - properties: - configuration: - description: SecureMail for Microsoft 365 configuration options - properties: - SERVICE_QUANTITY: - description: Number of mailboxes to protect. - type: integer - minimum: 1 - type: object - additionalProperties: false - data: required: - - tenant - - email_domain - - domain_fqn - - client_id - - client_secret + - installation_type properties: - tenant: - description: Prefix of the ".onmicrosoft.com" tenant domain - type: string - email_domain: - description: Domain name for the emails to be protected - type: string - domain_fqn: - description: FQDN of the Microsoft destination domain for emails - type: string - client_id: - description: Client ID for the connector generated on admin.microsoft.com + installation_type: + description: >- + Choose to install the license on an active server or on external + IP address type: string - client_secret: - description: Client secret for the connector generated on admin.microsoft.com + enum: + - internal_installation_type + - external_installation_type + purchase_server: + description: >- + Id of the purchase of the server where the license will be + installed (`purchase_id` of `GET /api/v3/servers/{server_id}`), + not the id of the server. Required only if "installation_type" + has value "internal_installation_type" + type: integer + ip_address: + description: >- + IP address of the external host where the license will be + installed to. Required only if "installation_type" has value + "external_installation_type" type: string type: object additionalProperties: false + type: object + additionalProperties: false + BuyServicePrivateCloudSvRequest: + required: + - service_id + properties: + service_id: + description: ID of the Service to buy + type: integer + minimum: 1 account_id: description: >- ID of the account of the user that will be the owner of the purchase (available to Resellers only) type: integer - type: object - BuyServiceSecuremailRequest: - required: - - configuration - properties: - configuration: - description: SecureMail configuration options + data: + description: Private Cloud SV configuration options properties: - SECURE_MAIL_HOSTING: + ADDITIONAL_BACKUP_DISK_SERVICE_QUANTITY: description: >- - Active Hosting purchase ID for which you are requesting to - secure the email service. + Choose to configure the Private Cloud with (1) or without (0) + additional backup disk. Default: 1 type: integer + enum: + - 0 + - 1 type: object additionalProperties: false - account_id: - description: >- - ID of the account of the user that will be the owner of the purchase - (available to Resellers only) - type: integer type: object + additionalProperties: false BuyServiceSmsRequest: required: - service_id @@ -18751,12 +13336,14 @@ components: service_id: description: ID of the Service to buy type: integer + minimum: 1 account_id: description: >- ID of the account of the user that will be the owner of the purchase (available to Resellers only) type: integer type: object + additionalProperties: false BuyServiceSslCertificateRequest: required: - service_id @@ -18765,6 +13352,7 @@ components: service_id: description: ID of the Service to buy type: integer + minimum: 1 account_id: description: >- ID of the account of the user that will be the owner of the purchase @@ -18799,6 +13387,7 @@ components: type: string format: email admin_role: + description: Role of the administrative contact of the certificate type: string enum: - Business Owner @@ -18806,6 +13395,7 @@ components: - President - Company Director admin_title: + description: Title of the administrative contact type: string enum: - Mrs @@ -18822,6 +13412,7 @@ components: type: string format: email admin_organization: + description: Organization of the administrative contact type: string admin_phone_cc: description: >- @@ -18850,29 +13441,35 @@ components: Use this only if you wish to provide your custom-generated CSR. If you specify your own generated CSR, you must provide the Private Key as well. - type: - - string - - 'null' + type: string private_key: description: >- Use this only if you wish to provide your custom-generated Private Key. If you specify your own generated Private Key, you must provide the CSR as well. - type: - - string - - 'null' + type: string type: object additionalProperties: false type: object + additionalProperties: false BuyServiceVeeamBaasRequest: - required: - - configuration properties: configuration: - description: Veeam BaaS configuration options + description: >- + Veeam BaaS configuration. Every field is optional: an omitted + workload quantity counts as 0, and an omitted configuration is the + same as an empty object. The limits of each workload quantity depend + on the corresponding workload service: a value outside them is + rejected with a validation error (code 1000) that states the limit + in `meta.errors`. properties: cloud_connect_gb: - description: 'Veeam Cloud Connect storage: quantity (in GB) of storage.' + description: >- + Veeam Cloud Connect: size of the backup storage, in GB. It must + be one of the storage sizes offered for the service: any other + value is rejected with a validation error that lists the allowed + sizes. If omitted, the default storage option of the service is + used. type: integer agent_server: description: 'Veeam Agent: number of "Server" workloads.' @@ -18897,12 +13494,15 @@ components: type: integer vbr_entplus_gb: description: >- - Veeam Backup & Replication (VBR) Enterprise Plus: number of - slots for "NAS" workloads. Each slot represents 250 GB of + Veeam Backup & Replication (VBR) Enterprise Plus: NAS backup + storage, as a number of slots of 250 GB each. Despite the name, + the value is a number of slots, not of GB: 1 = 250 GB, 2 = 500 + GB, up to 9 = 2,250 GB. Use 0 or omit the field for no NAS storage. type: integer - maximum: 250 + maximum: 9 minimum: 0 + example: 2 vbr_standard_vm: description: >- Veeam Backup & Replication (VBR) Standard: number of "VM in @@ -18919,7 +13519,7 @@ components: "Workstation" workloads. type: integer vb365_users: - description: 'Veeam Backup for Microsoft 365: number of Users.' + description: 'Veeam Backup for Microsoft 365: number of users.' type: integer cc_license_vm: description: >- @@ -18937,24 +13537,48 @@ components: (available to Resellers only) type: integer type: object + additionalProperties: false CloudStorageAccessCreateRequest: + description: >- + NFS access to create: an IPv4 address allowed to mount the storage of a + user + required: + - hostname + - username properties: hostname: + description: IPv4 address to allow to mount the storage via NFS type: string username: + description: >- + Username of the user whose storage the address can mount: the + `PRIMARY` user or an `ADDITIONAL` user of the cloud storage (`GET + /api/v3/cloud-storages/{cloud_storage_id}/users`) type: string type: object + additionalProperties: false CloudStorageUserSizeUpdateRequest: + description: New quota of an additional user of the cloud storage + required: + - quota_gb properties: quota_gb: + description: >- + New quota of the user, in GB (1 GB = 1024 MB), set as both its soft + and hard quota: from 0 to the soft quota of the `PRIMARY` user. Only + `ADDITIONAL` users can be changed type: number format: float type: object + additionalProperties: false DomainContactRequest: required: - contact_data properties: contact_data: + description: >- + Fields to change, one item per field; the fields not sent keep their + value type: array items: required: @@ -18962,73 +13586,105 @@ components: - data_value properties: data_field: + description: >- + Code of the field, as in `contact_data` of the contact (for + example `EMAIL`) type: string data_value: + description: >- + New value of the field; for `PHONE_PREFIX` and `FAX_PREFIX`, + the id of the country of the prefix, one of the `enum` of the + field in `contact_data` of `GET /api/v3/tlds/{tld_id}`; for + `BIRTHDAY`, a date `YYYY-MM-DD` type: string type: object type: object + additionalProperties: false DomainDnsNameserversChangeRequest: required: - ns_1_hostname - ns_2_hostname properties: ns_1_hostname: - description: Hostname of first nameserver - type: string - ns_1_ip: - description: IP address of first nameserver + description: >- + Hostname of the first nameserver. It cannot be a Shellrent + nameserver nor a host of the domain itself type: string ns_2_hostname: - description: Hostname of second nameserver - type: string - ns_2_ip: - description: IP address of second nameserver + description: >- + Hostname of the second nameserver. It cannot be a Shellrent + nameserver nor a host of the domain itself type: string ns_3_hostname: - description: Hostname of third nameserver - type: string - ns_3_ip: - description: IP address of third nameserver + description: >- + Hostname of the third nameserver (optional). It cannot be a + Shellrent nameserver nor a host of the domain itself type: string ns_4_hostname: - description: Hostname of fourth nameserver - type: string - ns_4_ip: - description: IP address of fourth nameserver + description: >- + Hostname of the fourth nameserver (optional). It cannot be a + Shellrent nameserver nor a host of the domain itself type: string type: object + additionalProperties: false DomainDnsNameserversCloudflareRequest: required: - account_email - api_token properties: account_email: + description: Email of the Cloudflare account that will manage the DNS zone type: string api_token: + description: >- + Global API key of the Cloudflare account (not an API token), used + together with `account_email` type: string type: object + additionalProperties: false DomainDnsRecordChangeRequest: required: - host - destination properties: host: + description: >- + Name of the record relative to the zone, `@` for the domain itself; + for SRV and TLSA records, without the service and the protocol type: string service: + description: Service of SRV records (e.g. `_sip`) and port of TLSA records type: string protocol: + description: 'Protocol of SRV and TLSA records: `_tcp`, `_udp` or `_tls`' type: string destination: + description: >- + Value of the record: the IPv4 address for A, the IPv6 address for + AAAA, the target hostname for CNAME, MX, NS, PTR and SRV, the text + for TXT and SPF, the value of the tag for CAA, the certificate + association data for TLSA type: string port: + description: Port of the service, required for SRV records type: string weight: + description: Weight of SRV records type: string priority: + description: Priority of MX and SRV records type: string ttl: + description: >- + TTL of the record, in seconds, for the Cloudflare records that are + not proxied (`0` or `1` for the automatic TTL); ignored with the + standard and external nameservers, where the records have the TTL of + the zone type: integer proxied: + description: >- + Whether the traffic of the record goes through the Cloudflare proxy; + only for the Cloudflare records that can be proxied type: boolean caa_data: description: Use this for CAA type record only @@ -19038,10 +13694,17 @@ components: - can_sign_http_exchanges properties: flag: + description: 'Flags of the CAA record: only `0` is accepted' type: integer tag_value: + description: >- + Tag of the CAA record, for example `issue` or `issuewild`; its + value goes in `destination` type: string can_sign_http_exchanges: + description: >- + Whether to add the parameter `cansignhttpexchanges=yes` to the + value of the tag type: boolean type: object tlsa_data: @@ -19052,13 +13715,23 @@ components: - matching_type properties: usage: + description: >- + Certificate usage: `0` (PKIX-TA), `1` (PKIX-EE), `2` (DANE-TA) + or `3` (DANE-EE) type: string selector: + description: >- + Selector: `0` for the full certificate, `1` for its public key + (SubjectPublicKeyInfo) type: string matching_type: + description: >- + Matching type: `0` for the data without hashing, `1` for + SHA-256, `2` for SHA-512 type: string type: object type: object + additionalProperties: false DomainDnsRecordRequest: required: - type @@ -19066,24 +13739,58 @@ components: - destination properties: type: + description: >- + Type of the record. `NS` and `PTR` records cannot be created, as in + the control panel type: string + enum: + - A + - AAAA + - CNAME + - MX + - SRV + - TXT + - SPF + - CAA + - TLSA host: + description: >- + Name of the record relative to the zone, `@` for the domain itself; + for SRV and TLSA records, without the service and the protocol type: string service: + description: Service of SRV records (e.g. `_sip`) and port of TLSA records type: string protocol: + description: 'Protocol of SRV and TLSA records: `_tcp`, `_udp` or `_tls`' type: string destination: + description: >- + Value of the record: the IPv4 address for A, the IPv6 address for + AAAA, the target hostname for CNAME, MX, NS, PTR and SRV, the text + for TXT and SPF, the value of the tag for CAA, the certificate + association data for TLSA type: string port: + description: Port of the service, required for SRV records type: string weight: + description: Weight of SRV records type: string priority: + description: Priority of MX and SRV records type: string ttl: + description: >- + Ignored: a new record has the TTL of the zone with the standard and + external nameservers, and the automatic TTL with Cloudflare, which + `PATCH /api/v3/domains/{domain_id}/dns/records/{record_id}` can + change type: integer proxied: + description: >- + Whether the traffic of the record goes through the Cloudflare proxy; + only with the Cloudflare nameservers type: boolean caa_data: description: Use this for CAA type record only @@ -19093,10 +13800,17 @@ components: - can_sign_http_exchanges properties: flag: + description: 'Flags of the CAA record: only `0` is accepted' type: integer tag_value: + description: >- + Tag of the CAA record, for example `issue` or `issuewild`; its + value goes in `destination` type: string can_sign_http_exchanges: + description: >- + Whether to add the parameter `cansignhttpexchanges=yes` to the + value of the tag type: boolean type: object tlsa_data: @@ -19107,20 +13821,42 @@ components: - matching_type properties: usage: + description: >- + Certificate usage: `0` (PKIX-TA), `1` (PKIX-EE), `2` (DANE-TA) + or `3` (DANE-EE) type: string selector: + description: >- + Selector: `0` for the full certificate, `1` for its public key + (SubjectPublicKeyInfo) type: string matching_type: + description: >- + Matching type: `0` for the data without hashing, `1` for + SHA-256, `2` for SHA-512 type: string type: object type: object + additionalProperties: false DomainDnsZoneRequest: required: - zone_ttl properties: zone_ttl: + description: >- + TTL of the zone, in seconds, which is also the TTL of every record: + one of the values of the control panel, from 1 to 24 hours. Only the + zones on our nameservers (standard and external types) have one: + with Cloudflare the response is 409 type: integer + enum: + - 3600 + - 14400 + - 28800 + - 57600 + - 86400 type: object + additionalProperties: false DomainDnssecRequest: required: - zone_ttl @@ -19128,7 +13864,10 @@ components: - ds_data_2 properties: zone_ttl: + description: TTL of the zone, in seconds type: integer + maximum: 2147483647 + minimum: 0 key_data_256: description: KEY DATA 256 records type: array @@ -19139,13 +13878,18 @@ components: - public_key properties: protocol: + description: Protocol of the key, `3` for DNSSEC type: integer algorithm: + description: >- + DNSSEC algorithm of the key: `8` (RSA/SHA-256) or `13` + (ECDSAP256SHA256) type: integer enum: - 8 - 13 public_key: + description: Public key, in base64 type: string type: object key_data_257: @@ -19158,13 +13902,18 @@ components: - public_key properties: protocol: + description: Protocol of the key, `3` for DNSSEC type: integer algorithm: + description: >- + DNSSEC algorithm of the key: `8` (RSA/SHA-256) or `13` + (ECDSAP256SHA256) type: integer enum: - 8 - 13 public_key: + description: Public key, in base64 type: string type: object ds_data_1: @@ -19176,16 +13925,24 @@ components: - digest properties: key_tag: + description: Key tag of the DNSKEY the record refers to type: integer algorithm: + description: >- + DNSSEC algorithm of the key, for example `8` (RSA/SHA-256) or + `13` (ECDSAP256SHA256) type: integer digest_type: + description: >- + Algorithm of the digest: `1` (SHA-1), `2` (SHA-256) or `4` + (SHA-384) type: integer enum: - 1 - 2 - 4 digest: + description: Digest of the DNSKEY, in hexadecimal type: string type: object ds_data_2: @@ -19197,166 +13954,303 @@ components: - digest properties: key_tag: + description: Key tag of the DNSKEY the record refers to type: integer algorithm: + description: >- + DNSSEC algorithm of the key, for example `8` (RSA/SHA-256) or + `13` (ECDSAP256SHA256) type: integer digest_type: + description: >- + Algorithm of the digest: `1` (SHA-1), `2` (SHA-256) or `4` + (SHA-384) type: integer enum: - 1 - 2 - 4 digest: + description: Digest of the DNSKEY, in hexadecimal type: string type: object type: object + additionalProperties: false HostingBackupExposeRequest: + description: >- + Backups to expose: they are copied, without restoring them, into the FTP + space of the hosting properties: web_backup_id: + description: >- + The `backup_id` of a backup with category `web` returned by `GET + /api/v3/hostings/{hosting_id}/backups`. Send at least one of + web_backup_id and db_backup_id type: - integer - 'null' db_backup_id: + description: >- + The `backup_id` of a backup with category `database` returned by + `GET /api/v3/hostings/{hosting_id}/backups`. Send at least one of + web_backup_id and db_backup_id type: - integer - 'null' type: object + additionalProperties: false HostingCronjobCreateRequest: + required: + - request_protocol + - request_url properties: request_protocol: description: http or https type: string + enum: + - http + - https request_url: - description: URL without protocol + description: >- + URL to call, without protocol (e.g. `www.example.com/cron.php`): a + leading http:// or https:// is removed and request_protocol is used type: string http_request_method: + description: HTTP method of the call type: string default: GET + enum: + - GET + - POST plan_month: + description: >- + Month in which the cronjob runs, from 1 (January) to 12 (December). + Omit it, or send null or an empty string, to run it every month type: - string - 'null' + pattern: ^([1-9]|1[0-2])?$ + example: '1' plan_monthday: + description: >- + Days of the month, as a comma-separated list of values from 1 to 31 + (e.g. `1,15`). Omit it, or send null or an empty string, to run it + every day type: - string - 'null' plan_weekday: + description: >- + Day of the week, from 1 (Monday) to 7 (Sunday). Omit it, or send + null or an empty string, to run it every day of the week type: - string - 'null' + pattern: ^[1-7]?$ + example: '1' plan_hour: + description: >- + Hours, as a comma-separated list of values from 0 to 23 (e.g. + `0,12`). Omit it, or send null or an empty string, to run it every + hour type: - string - 'null' plan_minute: + description: >- + Minutes, as a comma-separated list of values from 0 to 59 (e.g. + `0,30`). Omit it, or send null or an empty string, to run it every + minute type: - string - 'null' type: object - HostingDatabaseCreateRequest: - properties: - database_name: - description: Optional database name. - type: - - string - - 'null' - name: - description: Alias of database_name. - type: - - string - - 'null' - type: object + additionalProperties: false HostingEmailAliasCreateRequest: + required: + - alias_name + - goto properties: alias_name: description: Alias local-part without domain. type: string goto: + description: Destination addresses of the alias, at least one type: array items: type: string format: email type: object + additionalProperties: false HostingEmailCatchAllRequest: + required: + - goto properties: goto: + description: >- + Destination addresses of the catch-all, at least one: they replace + the current ones type: array items: type: string format: email type: object + additionalProperties: false HostingEmailWblistRequest: + description: >- + Sender to add to the allow list or the block list of the antispam: a + whole domain or an address properties: domain: + description: Sender domain; send either `domain` or `mailbox` type: - string - 'null' mailbox: + description: Sender address; send either `domain` or `mailbox` type: - string - 'null' format: email type: object + additionalProperties: false HostingFileProtectionUpdateRequest: + required: + - enable properties: enable: + description: Whether to enable (true) or disable (false) the file protection type: boolean type: object + additionalProperties: false HostingHttpVersionUpdateRequest: + required: + - version properties: version: - description: HTTP version identifier. + description: 'HTTP version: 1 for HTTP/1.1, 2 for HTTP/2' type: string + enum: + - '1' + - '2' type: object + additionalProperties: false HostingModSecurityRuleBulkRequest: + description: Rules of the hosting to disable + required: + - rule_ids properties: rule_ids: + description: >- + Ids of the rules (`rule_id`) to add to the disabled rules of the + hosting type: array items: type: integer type: object + additionalProperties: false HostingModSecurityRuleCreateRequest: + description: ModSecurity rule to disable on the hosting + required: + - rule_number properties: rule_number: + description: Number of the ModSecurity rule to disable on the hosting type: integer description: - type: - - string - - 'null' + description: >- + Description of the rule; used only when the hosting does not have + the rule yet + type: string type: object + additionalProperties: false HostingModSecurityUpdateRequest: + required: + - enable properties: enable: + description: Whether to enable (true) or disable (false) ModSecurity type: boolean type: object + additionalProperties: false HostingPhpSettingsUpdateRequest: + required: + - setting + - value properties: setting: - description: PHP setting key. + description: PHP directive to change type: string + enum: + - opcache.enable + - display_errors + - memory_limit + - post_max_size + - upload_max_filesize + - max_execution_time + - max_input_time value: - description: PHP setting value. - type: string - type: object + description: >- + New value of the directive. Suggested values: opcache.enable 1 or 0; + display_errors On or Off; memory_limit from 64M to 512M (64M, 96M, + 128M, 160M, 192M, 224M, 256M, 288M, 320M, 384M, 448M, 512M); + post_max_size and upload_max_filesize from 1M to 512M (1M, 2M, 4M, + 8M, 16M, 24M, 32M, 40M, 48M, 64M, 80M, 96M, 112M, 128M, 160M, 192M, + 224M, 256M, 512M); max_execution_time and max_input_time in seconds, + from 10 to 600. Other values are accepted if they are numbers, + optionally followed by M, between the smallest and the largest + suggested value + type: string + type: object + additionalProperties: false HostingPhpVersionUpdateRequest: + required: + - version properties: version: - description: PHP version identifier. + description: >- + PHP version, one of those returned by `GET + /api/v3/hostings/{hosting_id}/php-versions` (e.g. `8.3`) type: string type: object + additionalProperties: false HostingSslCertificateInstallRequest: + description: >- + SSL certificate to install on the hosting; with no body, a Let's Encrypt + certificate for the website properties: ssl_certificate_id: + description: >- + Id of a purchased SSL certificate to install (`GET + /api/v3/ssl-certificates/{ssl_certificate_id}`); omit it, or send + null, to install a Let's Encrypt certificate, issued if the hosting + has none type: - integer - 'null' destination_type: + description: >- + Where to install the certificate: `web` for the website, `mail` for + the mail servers, `all` for both. `mail` and `all` require `cn_type` + `WILDCARD`; on a subdomain only `web` is allowed type: string default: web + enum: + - all + - web + - mail cn_type: + description: >- + Type of the certificate: `NORMAL`, or `WILDCARD` for a wildcard + certificate. Without `ssl_certificate_id` it chooses the Let's + Encrypt certificate to install type: string default: NORMAL + enum: + - NORMAL + - WILDCARD type: object + additionalProperties: false HostingSubdomainCreateRequest: required: - level_name @@ -19364,10 +14258,9 @@ components: level_name: description: Third-level subdomain name (without the main domain). type: string - subdomain: - description: Alias of level_name. - type: string + minLength: 1 type: object + additionalProperties: false Microsoft365SubscriptionQuantityRequest: required: - quantity @@ -19377,52 +14270,41 @@ components: type: integer minimum: 1 type: object + additionalProperties: false ObjectStorageBucketFirewallEntryCreateRequest: + description: Address or subnet to allow in the firewall of a bucket + required: + - ip properties: ip: + description: IPv4 or IPv6 address, or a subnet in CIDR notation type: string + example: 192.0.2.0/24 type: object - OrderPayRequest: + additionalProperties: false + OneClickPaymentCreateRequest: description: >- - Pays one or more orders. The payment mode is chosen by three fields, - evaluated in this order: 1) use_prepaid_credit set to true: pays with - the available Prepaid Credit; 2) use_one_click set to true: tries the - saved One-Click payment methods in priority order until one is - successfully authorized; 3) one_click_id: pays with that specific - One-Click payment method. Provide one of them: if more are provided, - only the first one in this order is used. If none is provided the - request fails, unless the amount to pay is zero: in that case no payment - mode is needed. + Pays one or more orders together with a One-Click payment method, in a + single attempt required: - order_ids properties: - use_prepaid_credit: - description: >- - Payment mode 1: set to true to pay with the available Prepaid - Credit. Takes precedence over use_one_click and one_click_id. - type: boolean - use_one_click: - description: >- - Payment mode 2: set to true to use the saved One-Click payment - methods. Payment will be attempted using saved methods in priority - order until one is successfully authorized. Ignored if - use_prepaid_credit is true; takes precedence over one_click_id. - type: boolean - one_click_id: - description: >- - Payment mode 3: identifier of the One-Click payment method to use, - to pay only with that specific method. Ignored if use_prepaid_credit - or use_one_click is true. - type: integer order_ids: - description: >- - IDs of the orders to be paid (1 ID or more order IDs to pay - together) + description: IDs of the orders to pay together type: array items: type: integer + minimum: 1 minItems: 1 + one_click_id: + description: >- + The One-Click payment method to use. Without it, the default one: + the first active method, in the order chosen by the customer. Only + that method is tried + type: integer + minimum: 1 type: object + additionalProperties: false PecMailboxOwnerChangeCreateRequest: required: - owner_id @@ -19434,15 +14316,16 @@ components: description: ID of an existing PEC owner profile to assign to the mailbox type: integer contract_upload_id: - description: ID of contract document uploaded with /api/v3/upload + description: ID of contract document uploaded with `POST /api/v3/uploads` type: integer identity_document_upload_id: - description: ID of identity document uploaded with /api/v3/upload + description: ID of identity document uploaded with `POST /api/v3/uploads` type: integer order_module_upload_id: - description: ID of order module document uploaded with /api/v3/upload + description: ID of order module document uploaded with `POST /api/v3/uploads` type: integer type: object + additionalProperties: false PecMailboxUpdateRequest: properties: report_email: @@ -19460,73 +14343,149 @@ components: type: string example: owner@example.com type: object + additionalProperties: false + PrepaidCreditPaymentCreateRequest: + description: Pays one or more orders together with the prepaid credit + required: + - order_ids + properties: + order_ids: + description: IDs of the orders to pay together + type: array + items: + type: integer + minimum: 1 + minItems: 1 + type: object + additionalProperties: false PrivateCloudVmCreateRequest: + description: >- + Virtual machine to create on the private cloud: `template_vm_id` to copy + a template VM, otherwise both `server_configuration_id` and + `template_id`; and either `ip_address_id` or `use_local_ip` true, not + both required: - cpu - ram - disk properties: cpu: + description: >- + Number of CPU cores (vCPUs) of the virtual machine: between + `min_vm_cpu` and `max_vm_cpu` of `GET + /api/v3/servers/{server_id}/private-cloud`, and within the vCPUs + still free on the private cloud type: integer minimum: 1 ram: + description: >- + RAM of the virtual machine, in MB: between `min_vm_ram` and + `max_vm_ram` of `GET /api/v3/servers/{server_id}/private-cloud`, and + within the RAM still free on the private cloud type: integer minimum: 1 disk: + description: >- + Disk space of the virtual machine, in GB: between `min_vm_disk` and + `max_vm_disk` of `GET /api/v3/servers/{server_id}/private-cloud`, + within the disk and backup space still free on the private cloud + and, with `template_vm_id`, not lower than the disk of the template + VM type: integer minimum: 1 server_configuration_id: description: Server configuration ID type: integer + minimum: 1 template_id: description: Server template ID (OS) type: integer + minimum: 1 template_vm_id: description: Template VM ID (optional alternative to configuration/template) type: integer + minimum: 1 ip_address_id: description: Primary IP address ID type: integer + minimum: 1 use_local_ip: description: Use local IP instead of public IP type: boolean + default: false ssh_key_id: description: SSH key ID to associate with the VM type: integer + minimum: 1 note: description: Optional note type: string type: object + additionalProperties: false PrivateCloudVmUpdateRequest: properties: cpu: + description: >- + Number of CPU cores. Omit it to keep the current value; the allowed + range depends on the resources available on the private cloud type: integer minimum: 1 ram: + description: >- + RAM of the virtual machine, in megabytes. Omit it to keep the + current value; the allowed range depends on the resources available + on the private cloud type: integer minimum: 1 disk: + description: >- + Disk space of the virtual machine, in gigabytes: it cannot be lower + than the current one. Omit it to keep the current value type: integer minimum: 1 note: - type: string + description: >- + Note of the virtual machine. Omit it to keep the current note; send + an empty string or null to remove it + type: + - string + - 'null' type: object + additionalProperties: false PurchaseBillingInfoChangeRequest: + description: >- + Billing data of the purchase to change: at least one of `oda`, `cig` and + `cup`; the ones omitted stay unchanged properties: oda: + description: >- + Number of the purchase order (ODA, "Ordine di Acquisto") of an + Italian public administration, reported on the invoices of the + purchase type: string cig: + description: >- + CIG ("Codice Identificativo Gara"), the Italian code of a public + tender, reported on the invoices of the purchase type: string cup: + description: >- + CUP ("Codice Unico di Progetto"), the Italian code of a public + investment project, reported on the invoices of the purchase type: string type: object + additionalProperties: false PurchaseCommentChangeRequest: required: - comment properties: comment: + description: >- + Comment of the user on the purchase, also shown in the description + of its invoices type: string type: object + additionalProperties: false PurchaseRecurrenceChangeRequest: required: - recurrence_id @@ -19535,6 +14494,7 @@ components: description: ID of the recurrence to use on the purchase type: integer type: object + additionalProperties: false PurchaseRenewStatusChangeRequest: required: - do_not_renew @@ -19543,47 +14503,60 @@ components: description: If true, the purchase will not renew. type: boolean type: object - SecuremailQuantityRequest: - required: - - quantity - properties: - quantity: - description: Final number of protected mailboxes for the SecureMail subscription - type: integer - minimum: 1 - type: object + additionalProperties: false ServerAutomaticSnapshotRequest: + description: Schedule of the automatic snapshots of a server required: - name - day_of_week - hour_of_day properties: name: + description: >- + Name of the snapshots: only letters, numbers, spaces, underscores + and dashes type: string day_of_week: description: Days of week (1-7, where 1 is Monday) type: array items: type: integer + maximum: 7 + minimum: 1 hour_of_day: - description: Time in HH:MM + description: >- + Time of the snapshot, in 24-hour HH:MM format. Times after 01:00 and + before 04:59 are not allowed type: string + pattern: ^([01][0-9]|2[0-3]):[0-5][0-9]$ + example: '23:30' type: object + additionalProperties: false ServerBackupExhibitRequest: + description: Backup of the server to expose required: - backup_id properties: backup_id: description: ID of the server backup to expose type: integer + minimum: 1 type: object + additionalProperties: false ServerIpAddressReverseUpdateRequest: + required: + - reverse_dns properties: reverse_dns: + description: >- + Hostname to set as reverse DNS of the IP address; null or an empty + string removes it, like `DELETE + /api/v3/servers/{server_id}/ip-addresses/{ip_address_id}/rdns` type: - string - 'null' type: object + additionalProperties: false ServerMonitoringProbeCreateRequest: required: - server_monitoring_item_template_id @@ -19603,6 +14576,7 @@ components: description: Notification phone number for this probe. type: string type: object + additionalProperties: false ServerMonitoringProbeUpdateRequest: properties: notification_email: @@ -19618,15 +14592,46 @@ components: type: string example: '3331234567' type: object + additionalProperties: false ServerNetworkInterfaceCreateRequest: properties: network_id: - description: Local network ID (for local VIF) + description: >- + For a local network interface: ID of an active local network of the + cluster where the server resides (for a private cloud VM, a local + network of the private cloud). Send either network_id or + ip_address_id type: integer + minimum: 1 ip_address_id: - description: Server IP address ID (for public VIF) + description: >- + For a public network interface: ID of an IP address without an + active network interface. For a private cloud VM it is a free and + available IP address of the private cloud, which is assigned to the + VM; for the other servers an available IP address of the server. + Send either network_id or ip_address_id type: integer + minimum: 1 + type: object + additionalProperties: false + ServerPowerActionRequest: + required: + - action + properties: + action: + description: >- + Power action: physical servers only have `reboot`. Whether it is + possible can be checked first with the matching check of the server, + for example `GET /api/v3/servers/{server_id}/can-hard-reboot` + type: string + enum: + - start + - stop + - reboot + - hard_reboot + - hard_stop type: object + additionalProperties: false ServerReinstallRequest: properties: safety_backup_enabled: @@ -19634,6 +14639,7 @@ components: type: boolean default: true type: object + additionalProperties: false SmsCreateRequest: description: >- Sends an SMS. Recipients: provide exactly one of phone_numbers or @@ -19652,7 +14658,6 @@ components: type: array items: type: string - pattern: ^00[1-9]\d{6,14}$ example: '00393331122444' minItems: 1 phonebooks: @@ -19685,10 +14690,11 @@ components: send_date: description: >- Date and time from which to send the SMS. If not specified, the SMS - is sent immediately. + is sent immediately (ISO 8601 UTC: YYYY-MM-DDTHH:MM:SSZ) type: string format: date-time type: object + additionalProperties: false SmsPhonebookAddContactsRequest: required: - phone_numbers @@ -19708,7 +14714,6 @@ components: prefix (digits only, no spaces/separators). Example: 00393331122444. type: string - pattern: ^00[1-9]\d{6,14}$ name: type: string surname: @@ -19718,6 +14723,7 @@ components: format: date type: object type: object + additionalProperties: false SmsPhonebookCreateRequest: required: - name @@ -19737,7 +14743,6 @@ components: prefix (digits only, no spaces/separators). Example: 00393331122444. type: string - pattern: ^00[1-9]\d{6,14}$ name: type: string surname: @@ -19750,6 +14755,7 @@ components: description: Name of the Phonebook. type: string type: object + additionalProperties: false SmsPhonebookEditRequest: required: - name @@ -19758,80 +14764,120 @@ components: description: Name of the Phonebook. type: string type: object + additionalProperties: false SslCertificateChangeCsrRequest: required: - csr properties: csr: + description: >- + Custom CSR in PEM format, verified with the certificate supplier; + sending the current CSR changes nothing + type: string + type: object + additionalProperties: false + SslCertificateExportRequest: + required: + - format + properties: + format: + description: >- + Export format: one of the codes of `GET + /api/v3/ssl-certificates/{ssl_certificate_id}/export-formats`, which + lists the formats available for the certificate + type: string + enum: + - PK + - CERT + - CERT_PEM + - CA + - CA_PEM + - CERT_CA + - CERT_CA_PEM + - PK_CERT_CA + - MULTI_ZIP + - HASH_SHA256 + - HASH_SHA512 + current_passphrase: + description: Passphrase of the current private key, if it is protected by one + type: string + passphrase: + description: >- + Passphrase that protects the exported file, for the formats that + require it (see requires_passphrase in the export formats). If + omitted, current_passphrase is used type: string type: object + additionalProperties: false SslCertificateOwnerRequest: properties: admin_title: - type: - - string - - 'null' + description: >- + Title of the administrative contact, one of the values of the order: + `Mrs`, `Mr`, `Miss`, `Ms`, `Dr` or `Rev` + type: string admin_role: - type: - - string - - 'null' + description: >- + Role of the administrative contact, one of the values of the order: + `Business Owner`, `Website Owner`, `President` or `Company Director` + type: string admin_first_name: - type: - - string - - 'null' - admin_last_name: - type: - - string - - 'null' + description: First name of the administrative contact + type: string + admin_last_name: + description: Last name of the administrative contact + type: string admin_email: - type: - - string - - 'null' + description: Email of the administrative contact + type: string format: email admin_organization: - type: - - string - - 'null' + description: Organization of the administrative contact + type: string admin_phone_cc: - type: - - string - - 'null' + description: >- + International dialling code of the phone of the administrative + contact, without `+` (for example `39`) + type: string admin_phone_number: - type: - - string - - 'null' + description: >- + Phone number of the administrative contact, without the dialling + code + type: string admin_address: - type: - - string - - 'null' + description: Address of the administrative contact + type: string admin_city: - type: - - string - - 'null' + description: City of the administrative contact + type: string admin_state: - type: - - string - - 'null' + description: State or province of the administrative contact + type: string admin_postal_code: - type: - - string - - 'null' + description: Postal code of the administrative contact + type: string admin_country: - type: - - string - - 'null' + description: >- + Country of the administrative contact, as ISO 3166-1 alpha-2 code + (for example `IT`) + type: string type: object + additionalProperties: false SslCertificateReemitRequest: properties: private_key: - type: - - string - - 'null' + description: >- + Custom private key in PEM format, without passphrase. Omit it, or + send an empty string or the current key, to keep the current one + type: string csr_key: - type: - - string - - 'null' + description: >- + Custom CSR in PEM format, verified with the certificate supplier. + Omit it, or send an empty string or the current CSR, to keep the + current one + type: string type: object + additionalProperties: false SubAccountCreateRequest: required: - person_password @@ -19846,17 +14892,26 @@ components: - administrative_email properties: person_password: + description: >- + Password of the account: at least 13 characters, with at least one + uppercase letter, one lowercase letter, one number and one symbol type: string administrative_person_name: + description: First name of the administrative contact of the account type: string administrative_person_surname: + description: Surname of the administrative contact type: string administrative_address: + description: Address of the administrative contact type: string administrative_city: + description: City of the administrative contact type: string administrative_state: - description: State or province + description: >- + Acronym of the Italian province, ie. "VI" for Vicenza, or "EE" for + an address outside Italy type: string administrative_country: description: >- @@ -19864,6 +14919,7 @@ components: etc. type: string administrative_postal_code: + description: Postal code of the administrative contact type: string administrative_phone_prefix: description: >- @@ -19875,52 +14931,86 @@ components: type: string administrative_mobile_prefix: description: >- - International phone code (prefix) for "Phone", ie. "39" for Italy, + International phone code (prefix) for "Mobile", ie. "39" for Italy, "44" for United Kingdom type: string administrative_mobile: description: Mobile phone number without international phone code type: string administrative_email: + description: Email address of the administrative contact type: string format: email type: object + additionalProperties: false SubAccountUpdateRequest: properties: person_password: + description: >- + New password of the account: at least 13 characters, with at least + one uppercase letter, one lowercase letter, one number and one + symbol type: string username_alias: + description: >- + Alternative username of the account, also valid to log in; null or + empty to remove it type: - string - 'null' administrative_person_name: + description: First name of the administrative contact of the account type: string administrative_person_surname: + description: Surname of the administrative contact type: string administrative_address: + description: Address of the administrative contact type: string administrative_city: + description: City of the administrative contact type: string administrative_state: - description: State or province + description: >- + Acronym of the Italian province, ie. "VI" for Vicenza, or "EE" for + an address outside Italy type: string administrative_country: - description: Country ISO code with 2 letters + description: >- + Country ISO code with 2 letters, ie. "IT" for Italy, "ES" for Spain, + etc. type: string administrative_postal_code: + description: Postal code of the administrative contact type: string administrative_phone_prefix: + description: >- + International phone code (prefix) for "Phone", ie. "39" for Italy, + "44" for United Kingdom; empty for Italy. Required with + `administrative_phone` type: string administrative_phone: + description: >- + Phone number without international phone code, digits only. Required + with `administrative_phone_prefix` type: string administrative_mobile_prefix: + description: >- + International phone code (prefix) for "Mobile", ie. "39" for Italy, + "44" for United Kingdom; empty for Italy. Required with + `administrative_mobile` type: string administrative_mobile: + description: >- + Mobile phone number without international phone code, digits only. + Required with `administrative_mobile_prefix` type: string administrative_email: + description: Email address of the administrative contact type: string format: email type: object + additionalProperties: false WebMonitoringNoticesUpdateRequest: properties: notification_email: @@ -19935,7 +15025,11 @@ components: description: Enable or disable SSL expiry notices. type: boolean type: object + additionalProperties: false AccountBilling: + description: >- + Billing profile: the holder the documents are made out to, with its tax + and electronic invoicing data required: - account_billing_id - legal_entity @@ -19968,6 +15062,7 @@ components: $ref: '#/components/schemas/LegalEntity' tax_regime: $ref: '#/components/schemas/TaxRegime' + description: Tax regime of the profile, which sets the VAT of its documents organization: type: - string @@ -19985,60 +15080,105 @@ components: city: type: string state: + description: >- + Province: the acronym of the Italian province, for example `VI`, or + `EE` outside Italy type: string postal_code: type: string country: $ref: '#/components/schemas/Country' gender: + description: 'Gender of the holder: `M` or `F`; null when not given' type: - string - 'null' birth_date: + description: Date of birth of the holder; null when not given type: - string - 'null' format: date birth_place: + description: Place of birth of the holder; null when not given type: - string - 'null' phone: - type: string + description: >- + Phone, usually in the form `0039.0123456789`: `00` and the + international prefix, a dot, the number; null when not given + type: + - string + - 'null' vat_number: + description: >- + VAT number of the holder (`partita IVA` in Italy); null when it has + none type: - string - 'null' is_vat_group: + description: >- + Whether the holder belongs to an Italian VAT group (`Gruppo IVA`), + whose members share the VAT number and have each their own tax code type: boolean fiscal_code: + description: Tax code of the holder (`codice fiscale` in Italy) type: string edocument_pec: + description: >- + PEC address (certified email, `Posta Elettronica Certificata`) to + which SDI, the Italian e-invoicing exchange system, delivers the + electronic invoices when there is no recipient code; null when not + given type: - string - 'null' edocument_code: + description: >- + Recipient code (`Codice Destinatario`) with which SDI, the Italian + e-invoicing exchange system, delivers the electronic invoices: 7 + characters, 6 for the public administration; null when not given type: - string - 'null' exporter_expiry: + description: >- + Expiry date of the declaration of intent (`dichiarazione d'intento`) + of a habitual exporter, whose invoices are without VAT; null when + not given type: - string - 'null' format: date exporter_number: + description: >- + Protocol number of the declaration of intent of a habitual exporter, + written on the electronic invoices; null when not given type: - string - 'null' exporter_date: + description: >- + Date of the electronic receipt of the declaration of intent, issued + by the Italian Revenue Agency (`Agenzia delle Entrate`); null when + not given type: - string - 'null' format: date is_split_payment: + description: >- + Whether split payment (`scissione dei pagamenti`) applies: the tax + regime is `SPLIT_PAYMENT`, and the customer pays the VAT of the + invoices directly to the Italian State type: boolean type: object Account: + description: >- + User account, with the data of its administrative contact: without one, + these data are null and the country is Italy required: - account_id - username @@ -20058,18 +15198,32 @@ components: account_id: type: integer username: - type: string + description: Username assigned to the account when it is created, used to log in + type: + - string + - 'null' username_alias: + description: >- + Alternative username chosen for the account, also valid to log in; + null when not set type: - string - 'null' account_name: - type: string + description: >- + Display name of the account: first name and surname of the + administrative contact, or its organization, or the username; empty + when the account has no administrative contact + type: + - string + - 'null' name: + description: First name of the administrative contact type: - string - 'null' surname: + description: Surname of the administrative contact type: - string - 'null' @@ -20078,6 +15232,10 @@ components: - string - 'null' phone: + description: >- + Phone of the administrative contact, usually in the form + `0039.0123456789`: `00` and the international prefix, a dot, the + number type: - string - 'null' @@ -20090,6 +15248,9 @@ components: - string - 'null' state: + description: >- + Province of the administrative contact: the acronym of the Italian + province, for example `VI`, or `EE` outside Italy type: - string - 'null' @@ -20104,17 +15265,23 @@ components: format: date-time type: object AmountSimple: + description: Amount in euros, without the VAT details of `Amount` required: - amount - currency properties: amount: + description: Amount, in euros type: number format: float currency: + description: 'Currency code: always `EUR`' type: string type: object Amount: + description: >- + Amount in euros: the taxable amount and, when computed with a tax + regime, the VAT rate, the VAT and the total, which are null otherwise required: - amount - currency @@ -20129,10 +15296,10 @@ components: - 'null' format: float currency: - description: Currency (EUR, USD, GBP, ...) + description: 'Currency code: always `EUR`' type: string tax_rate: - description: VAT rate in cents (iva/vat) + description: VAT rate as a fraction, for example `0.22` for 22% type: - number - 'null' @@ -20151,25 +15318,38 @@ components: format: float type: object BillingData: + description: 'Italian public administration codes of a document row: CIG, CUP and ODA' required: - cig_value - cup_value - oda_value properties: cig_value: + description: >- + CIG (`Codice Identificativo Gara`), the Italian code of the public + tender; null when not given type: - string - 'null' cup_value: + description: >- + CUP (`Codice Unico di Progetto`), the Italian code of the public + investment project; null when not given type: - string - 'null' oda_value: + description: >- + ODA (`Ordine di Acquisto`), the code of the purchase order; null + when not given type: - string - 'null' type: object CloudStorageAccess: + description: >- + NFS access to a cloud storage: an IPv4 address allowed to mount the + storage of a user required: - access_id - cloud_storage_id @@ -20177,19 +15357,30 @@ components: - username properties: access_id: - type: string + description: 'Id of the access, used in its path: the IPv4 address in `hostname`' + type: + - string + - 'null' cloud_storage_id: + description: >- + Id of the cloud storage (`GET + /api/v3/cloud-storages/{cloud_storage_id}`) type: integer hostname: + description: IPv4 address allowed to mount the storage via NFS type: - string - 'null' username: + description: >- + Username of the cloud storage user whose storage the address can + mount (`GET /api/v3/cloud-storages/{cloud_storage_id}/users`) type: - string - 'null' type: object CloudStorage: + description: Cloud storage of the account, with its hosts and the space used required: - cloud_storage_id - purchase_id @@ -20203,36 +15394,57 @@ components: cloud_storage_id: type: integer purchase_id: + description: >- + Id of the purchase of the cloud storage (`GET + /api/v3/purchases/{purchase_id}`) type: - integer - 'null' name: + description: >- + Code of the cloud storage (7 hexadecimal characters), used in its + hosts and in the username of its main user type: - string - 'null' read_write_host: + description: >- + Host for the read-write access to the storage, without the domain: + the full name is `.serverlet.com` type: - string - 'null' read_only_host: + description: >- + Host for the read-only access to the storage, served by its replica, + without the domain: the full name is + `.serverlet.com` type: - string - 'null' app_host: + description: >- + Host of the web file manager (Nextcloud), without the domain: it is + reachable at `https://.serverlet.com` type: - string - 'null' group_disk_used_bytes: + description: >- + Space used by the cloud storage with all its users, those of the + services included, in bytes, at the last sync (`date_sync`) type: - integer - 'null' date_sync: + description: Date of the last sync of the used space with the storage server type: - string - 'null' format: date-time type: object CloudStorageUser: + description: User of a cloud storage, with its quotas and the space used required: - cloud_storage_user_id - cloud_storage_id @@ -20252,12 +15464,23 @@ components: cloud_storage_user_id: type: integer cloud_storage_id: + description: >- + Id of the cloud storage (`GET + /api/v3/cloud-storages/{cloud_storage_id}`) type: integer purchase_id: + description: >- + Id of the purchase of the user (`GET + /api/v3/purchases/{purchase_id}`): the cloud storage purchase, or + the own purchase of an `ADDITIONAL` user type: - integer - 'null' type: + description: >- + Type of the user: `PRIMARY` (main user), `ADDITIONAL` (additional + user, with its own purchase), or `DISASTER_RECOVERY`, `TEMPLATE_VM` + and `SELF_CLOUD` for the users managed by those services type: - string - 'null' @@ -20266,41 +15489,65 @@ components: - string - 'null' password: + description: Password of the user; null without the cloudstorage:secrets scope type: - string - 'null' path: + description: Home path of the user on the storage type: - string - 'null' soft_quota_gb: + description: >- + Soft quota of the user, in GB (1 GB = 1024 MB): it can be exceeded, + up to the hard quota, for a grace period type: - number - 'null' format: float hard_quota_gb: + description: >- + Hard quota of the user, in GB (1 GB = 1024 MB): the limit that the + used space cannot exceed type: - number - 'null' format: float used_space_bytes: + description: >- + Space used by the user at the last sync of the cloud storage, in + bytes; null before the first sync type: - integer - 'null' allocated_space_bytes: + description: >- + Space allocated to the user, that is its hard quota at the last sync + of the cloud storage, in bytes; null before the first sync type: - integer - 'null' grace_period_seconds: + description: >- + Grace period left to go back under the soft quota, in seconds, saved + the last time the user was found over quota; `0` if never. Only + `PRIMARY` users are checked: `0` for the `ADDITIONAL` ones, null for + the users of the services type: - integer - 'null' last_alert: + description: >- + Date of the last email that warned the customer that the user is + over its soft quota, sent at most once a week and only for `PRIMARY` + users; null if it was not over quota at the last check type: - string - 'null' format: date-time active: + description: 'Whether the user is active: deleted users are not returned' type: - boolean - 'null' @@ -20322,85 +15569,25 @@ components: description: ie. ITA type: string country_name: + description: >- + Name of the country in Italian; the local name when there is no + translation type: string local_name: + description: Name of the country in its own language, for example `Deutschland` type: string phone_code: - description: +39, +44, ... + description: International calling code, without `+`, for example `39` type: string continent: - description: Europe, America, ... + description: Continent, in English, for example `Europe` or `North America` type: string region: - description: Macro region + description: 'Area of the country: `EU` (European Union) or `EXTRAEU`' type: string type: object - CpanelLicense: - required: - - license_id - - purchase_id - - purchase_server_id - - service_name - - purchase_name - - license_ref - - key_number - - ip_address - - is_els - - operative_system - - purchase_status_code - - date_activation - - date_expiry - properties: - license_id: - type: integer - purchase_id: - type: integer - purchase_server_id: - type: - - integer - - 'null' - service_name: - type: - - string - - 'null' - purchase_name: - type: - - string - - 'null' - license_ref: - type: - - string - - 'null' - key_number: - type: - - string - - 'null' - ip_address: - type: - - string - - 'null' - is_els: - type: boolean - operative_system: - type: - - string - - 'null' - purchase_status_code: - type: - - string - - 'null' - date_activation: - type: - - string - - 'null' - format: date - date_expiry: - type: - - string - - 'null' - format: date - type: object CreditnoteRow: + description: Row of a credit note required: - creditnote_row_id - creditnote_id @@ -20415,10 +15602,20 @@ components: creditnote_row_id: type: integer creditnote_id: + description: Id of the credit note (`GET /api/v3/credit-notes/{credit_note_id}`) type: integer invoice_row_id: - type: integer + description: >- + Id of the invoice row that the credit note row refers to (`GET + /api/v3/invoices/{invoice_id}/rows/{row_id}`); null when it refers + to none + type: + - integer + - 'null' reason: + description: >- + Reason of the row, in Italian, for example `Errato Addebito` (wrong + charge) or `Servizio non Erogato` (service not provided) type: - string - 'null' @@ -20429,17 +15626,22 @@ components: billing_data: $ref: '#/components/schemas/BillingData' date_start: + description: >- + Start of the period the row refers to; null when the row has no + period type: - string - 'null' format: date date_end: + description: End of the period the row refers to; null when the row has no period type: - string - 'null' format: date type: object Creditnote: + description: Credit note of the account, with its total and electronic invoicing data required: - creditnote_id - invoice_id @@ -20460,81 +15662,138 @@ components: creditnote_id: type: integer invoice_id: - type: integer + description: >- + Id of the invoice the credit note refers to (`GET + /api/v3/invoices/{invoice_id}`); null when it refers to none + type: + - integer + - 'null' billing: $ref: '#/components/schemas/AccountBilling' sdi_document_status: + description: >- + Status of the credit note on SDI, the Italian e-invoicing exchange + system; null for the credit notes not sent through SDI, issued + before electronic invoicing anyOf: - $ref: '#/components/schemas/SdiDocumentStatus' - type: 'null' sdi_document_type: $ref: '#/components/schemas/SdiDocumentType' tax_regime: + description: >- + Tax regime set on the credit note; null when it uses the one of the + billing profile (`billing.tax_regime`) anyOf: - $ref: '#/components/schemas/TaxRegime' - type: 'null' date_emitted: + description: Date of issue of the credit note type: string format: date creditnote_year: - type: string + description: Year of the numbering of the credit note + type: + - integer + - 'null' creditnote_number: + description: >- + Complete number of the credit note: the year followed by the number + on 6 digits, for example `2025000123` type: string creditnote_caption: + description: >- + Legal note of the tax regime printed on the credit note, in Italian, + such as the law under which VAT is not applied; null when the regime + has none type: - string - 'null' sdi_identifier: - type: string + description: >- + Identifier assigned by SDI to the credit note; null when it has not + been sent to SDI + type: + - string + - 'null' sdi_filename: - type: string + description: >- + Name of the file sent to SDI; null when not sent, and for the credit + notes issued before November 2024 + type: + - string + - 'null' total_amount: $ref: '#/components/schemas/Amount' rows_count: + description: >- + Number of rows of the credit note (`GET + /api/v3/credit-notes/{credit_note_id}/rows`) type: integer date_created: type: string format: date-time type: object DnsRecordCaaData: + description: >- + Flags and tag of a CAA record; the value of the tag is in `destination` + of the record required: - flag - tag_value - can_sign_http_exchanges properties: flag: + description: Flags of the CAA record; the API writes only `0` type: - integer - 'null' tag_value: + description: Tag of the CAA record, for example `issue` or `issuewild` type: - string - 'null' can_sign_http_exchanges: + description: >- + Whether the value of the tag has the parameter + `cansignhttpexchanges=yes`; null when the parameter is missing type: - boolean - 'null' type: object DnsRecordTlsaData: + description: >- + Parameters of a TLSA record; the certificate association data is in + `destination` of the record required: - usage - selector - matching_type properties: usage: + description: >- + Certificate usage: `0` (PKIX-TA), `1` (PKIX-EE), `2` (DANE-TA) or + `3` (DANE-EE) type: - string - 'null' selector: + description: >- + Selector: `0` for the full certificate, `1` for its public key + (SubjectPublicKeyInfo) type: - string - 'null' matching_type: + description: >- + Matching type: `0` for the data without hashing, `1` for SHA-256, + `2` for SHA-512 type: - string - 'null' type: object DnsRecord: + description: Record of the DNS zone of a domain required: - record_id - type @@ -20553,55 +15812,95 @@ components: record_id: type: string type: + description: Type of the record, for example `A`, `CNAME`, `MX` or `TXT` type: string host: + description: >- + Name of the record relative to the zone, `@` for the domain itself; + for SRV and TLSA records, without the service and the protocol type: string service: + description: >- + Service of SRV records (for example `_sip`) and port of TLSA records + (for example `_443`), with the underscore; null for the other types type: - string - 'null' protocol: + description: >- + Protocol of SRV and TLSA records: `_tcp`, `_udp` or `_tls`; null for + the other types type: - string - 'null' destination: + description: >- + Value of the record: the IPv4 address for A, the IPv6 address for + AAAA, the target hostname for CNAME, MX, NS, PTR and SRV, the text + for TXT and SPF, the value of the tag for CAA, the certificate + association data for TLSA type: string port: - type: string + description: Port of the service, for SRV records; null for the other types + type: + - string + - 'null' weight: + description: Weight of SRV records; `0` for the other types type: - integer - 'null' priority: + description: >- + Priority of MX and SRV records; null for the other types and, with + the standard and external nameservers, when it is `0` type: - integer - 'null' ttl: + description: >- + TTL of the record, in seconds: with Cloudflare null means automatic, + with the standard and external nameservers it is the TTL of the zone + (`PATCH /api/v3/domains/{domain_id}/dns`) type: - integer - 'null' proxied: + description: >- + Whether the traffic of the record goes through the Cloudflare proxy; + always false with the other nameserver types type: boolean caa_data: + description: Data of CAA records; null for the other types anyOf: - $ref: '#/components/schemas/DnsRecordCaaData' - type: 'null' tlsa_data: + description: Data of TLSA records; null for the other types anyOf: - $ref: '#/components/schemas/DnsRecordTlsaData' - type: 'null' type: object DnsType: + description: Nameserver type of a domain, which decides where its DNS zone is managed required: - type_code - type_name properties: type_code: + description: >- + Code of the nameserver type: `INTERNAL` (our "standard" + nameservers), `EXTERNAL` (nameservers of a third party) or + `CLOUDFLARE` (Cloudflare nameservers, with a Cloudflare account) type: string type_name: + description: >- + Name of the nameserver type, in Italian: `Standard`, `Esterna` or + `Cloudflare` type: string type: object DnsZone: + description: DNS zone of a domain, on our nameservers or at Cloudflare required: - zone_id - zone_name @@ -20609,17 +15908,29 @@ components: - ttl properties: zone_id: + description: Id of the zone on our nameservers or at Cloudflare type: string zone_name: + description: 'Name of the zone: the domain name in punycode' type: string nameservers: + description: >- + Hostnames of the nameservers of the zone; with Cloudflare, the ones + that Cloudflare assigned to it type: array items: type: string ttl: - type: integer + description: >- + TTL of the zone, in seconds, which with the standard and external + nameservers is also the TTL of every record; null with Cloudflare, + whose zones have no TTL + type: + - integer + - 'null' type: object DnssecDsData: + description: DS (delegation signer) record of the domain required: - zone_ttl - key_tag @@ -20628,17 +15939,27 @@ components: - digest_value properties: zone_ttl: + description: TTL of the zone, in seconds type: integer key_tag: + description: Key tag of the DNSKEY the record refers to type: integer key_algorithm: + description: >- + DNSSEC algorithm of the key, for example `8` (RSA/SHA-256) or `13` + (ECDSAP256SHA256) type: integer digest_type: + description: >- + Algorithm of the digest, for example `1` (SHA-1), `2` (SHA-256) or + `4` (SHA-384) type: integer digest_value: + description: Digest of the DNSKEY, in hexadecimal type: string type: object DnssecKeyData: + description: DNSKEY record of the domain required: - zone_ttl - flags @@ -20647,27 +15968,62 @@ components: - public_key properties: zone_ttl: + description: TTL of the zone, in seconds type: integer flags: + description: >- + Flags of the key: `256` for a zone signing key (ZSK), `257` for a + key signing key (KSK) type: integer key_protocol: + description: Protocol of the key, `3` for DNSSEC type: integer key_algorithm: + description: >- + DNSSEC algorithm of the key, for example `8` (RSA/SHA-256) or `13` + (ECDSAP256SHA256) type: integer public_key: + description: Public key, in base64 type: string type: object DomainAvailability: + description: >- + Availability of a domain name (whois): how it can be bought and, for + premium domains, our prices required: - domain_name - availability + - premium + - premium_prices properties: domain_name: $ref: '#/components/schemas/DomainName' availability: + description: >- + How the domain can be bought: `A` (available: it can be registered), + `T` (already registered: it can be transferred) or `R` (expired with + us: it can be restored) type: string + premium: + description: >- + Whether the registry sells the domain at a premium price, which it + sets itself + type: boolean + premium_prices: + description: >- + Our prices for the premium domain; null when the domain is not + premium, when the registry gave no price (the domain cannot be + bought) and for sub-accounts + anyOf: + - $ref: '#/components/schemas/DomainPremiumPrices' + - type: 'null' type: object DomainCanChangeNameservers: + description: >- + Nameserver types that can be activated on the domain now: none while the + purchase of the domain is not active or has an operation running, or + while the nameservers are being changed required: - domain_id - can_activate_standard @@ -20677,23 +16033,46 @@ components: domain_id: type: integer can_activate_standard: + description: >- + Whether the standard nameservers can be activated (`PUT + /api/v3/domains/{domain_id}/dns/standard`); false when they are the + current ones type: boolean can_activate_cloudflare: + description: >- + Whether the Cloudflare nameservers can be activated (`PUT + /api/v3/domains/{domain_id}/dns/cloudflare`); false when they are + the current ones type: boolean can_activate_external: + description: >- + Whether the external nameservers can be activated (`PUT + /api/v3/domains/{domain_id}/dns/external`); false when they are the + current ones type: boolean type: object DomainContactData: + description: Field of the data of a domain contact required: - data_field - data_value properties: data_field: + description: >- + Code of the field, for example `FIRST_NAME`, `EMAIL` or + `DOT_IT_ENTITY_TYPE` (see `contact_data` of `GET + /api/v3/tlds/{tld_id}`) type: string data_value: - type: string + description: >- + Value of the field; for `PHONE_PREFIX` and `FAX_PREFIX`, the id of + the country of the prefix; for `BIRTHDAY`, a date `YYYY-MM-DD` + type: + - string + - 'null' type: object DomainContact: + description: Contact of a domain at the registry, with its data required: - domain_contact_id - domain_id @@ -20704,17 +16083,28 @@ components: domain_contact_id: type: integer domain_id: + description: Id of the domain (`GET /api/v3/domains/{domain_id}`) type: integer type: + description: >- + Role of the contact: `R` (registrant), `A` (administrative), `T` + (technical) or `O` (organization) type: string to_sync: - type: boolean + description: >- + Whether the contact has changes not yet sent to the registry (`POST + /api/v3/domains/{domain_id}/contacts/synchronizations`) + type: + - boolean + - 'null' contact_data: + description: Data of the contact, one item per field type: array items: $ref: '#/components/schemas/DomainContactData' type: object DomainData: + description: Data of the domain at the registry required: - registry_status - incoming_authcode @@ -20732,61 +16122,173 @@ components: - date_created properties: registry_status: + description: >- + Status of the domain as the registry reports it, for example `ok`, + `clientTransferProhibited` or `pendingDelete` type: - string - 'null' incoming_authcode: + description: >- + Authcode given for the incoming transfer of the domain; null without + the `domains:secrets` scope type: - string - 'null' outgoing_authcode: + description: >- + Authcode to transfer the domain to another registrar; null without + the `domains:secrets` scope type: - string - 'null' registry_nameservers: + description: >- + Nameservers of the domain at the registry, as a text in the format + of the registry (usually hostnames separated by commas) type: - string - 'null' registry_expiry: + description: Expiry of the domain at the registry type: - string - 'null' format: date-time registry_created: + description: Registration of the domain at the registry type: - string - 'null' format: date-time registry_updated: + description: Last update of the domain at the registry type: - string - 'null' format: date-time registry_deletion: + description: >- + Deletion of the domain at the registry, when the registry reports + one type: - string - 'null' format: date-time date_deactivation: + description: >- + When these data were deactivated because the registrar no longer has + the domain (for example after an outgoing transfer); null while they + are active type: - string - 'null' format: date-time identity_validation_status: + description: >- + Status of the validation of the identity of the registrant: + `VERIFIED`, `NOT_VERIFIED`, `PENDING` or `FAILED` type: - string - 'null' is_on_hold: + description: Whether the domain is on hold at the registry (status `clientHold`) type: boolean transfer_wrong_authcode: - type: boolean + description: >- + Whether the incoming transfer failed because of a wrong authcode; + null when not known + type: + - boolean + - 'null' transfer_locked: - type: boolean + description: >- + Whether the incoming transfer failed because the domain is locked at + the current registrar; null when not known + type: + - boolean + - 'null' date_created: + description: >- + When these data were recorded: a new version is recorded each time + the data at the registry change type: string format: date-time type: object + DomainDetail: + description: >- + Domain of the account, with its nameservers, its data at the registry + and the status of DNSSEC + required: + - domain_id + - tld_id + - domain_name + - dns_type + - dns_account + - nameservers + - domain_data + - contacts_count + - dnssec_enabled + - date_info_last + - date_dns_check + - vanity_nameserver_enabled + properties: + domain_id: + type: integer + tld_id: + description: Id of the TLD of the domain (`GET /api/v3/tlds/{tld_id}`) + type: integer + domain_name: + $ref: '#/components/schemas/DomainName' + dns_type: + $ref: '#/components/schemas/DnsType' + dns_account: + description: >- + Email of the Cloudflare account that manages the DNS zone, with the + Cloudflare nameservers; null with the other nameserver types, and + when the zone is on our own Cloudflare account + type: + - string + - 'null' + nameservers: + description: Nameservers of the domain; `sort` gives their order + type: array + items: + $ref: '#/components/schemas/DomainNameserver' + domain_data: + description: Data of the domain at the registry; null when there are none + anyOf: + - $ref: '#/components/schemas/DomainData' + - type: 'null' + contacts_count: + description: Number of active contacts of the domain + type: integer + dnssec_enabled: + description: >- + DNSSEC is enabled on the DNS zone of the domain, or the domain has + active external DNSSEC keys. Always false for DNS types other than + internal and external + type: boolean + date_info_last: + description: When the data of the domain were last requested from the registry + type: + - string + - 'null' + format: date-time + date_dns_check: + description: When the DNS zone and the DNSSEC of the domain were last checked + type: + - string + - 'null' + format: date-time + vanity_nameserver_enabled: + description: >- + Whether the domain uses vanity nameservers: our nameservers with + hostnames of the domain itself (for example `ns1.example.com`) + type: boolean + type: object DomainDnssecCanActivate: + description: Whether DNSSEC can be activated on the domain, or its data changed required: - domain_id - can_active @@ -20794,9 +16296,15 @@ components: domain_id: type: integer can_active: + description: >- + Whether DNSSEC can be activated now (`POST + /api/v3/domains/{domain_id}/dnssec`, standard nameservers) or its + data changed (`PATCH /api/v3/domains/{domain_id}/dnssec`, external + nameservers) type: boolean type: object DomainDnssecCanDeactivate: + description: Whether DNSSEC can be deactivated on the domain, or its data removed required: - domain_id - can_deactivate @@ -20804,23 +16312,36 @@ components: domain_id: type: integer can_deactivate: + description: >- + Whether DNSSEC can be deactivated now (standard nameservers) or its + data removed (external nameservers) with `DELETE + /api/v3/domains/{domain_id}/dnssec` type: boolean type: object DomainDnssec: + description: >- + Active DNSSEC records of the domain: the ones of our zone with the + standard nameservers, the ones set with `PATCH + /api/v3/domains/{domain_id}/dnssec` with the external nameservers required: - ds_data - key_data properties: ds_data: + description: DS records type: array items: $ref: '#/components/schemas/DnssecDsData' key_data: + description: DNSKEY records type: array items: $ref: '#/components/schemas/DnssecKeyData' type: object DomainName: + description: >- + Name of a domain, whole and split into name and extension, in Unicode + and in punycode required: - unicode - punycode @@ -20830,31 +16351,91 @@ components: - punycode_tld properties: unicode: + description: Full domain name in Unicode, for example `farò.it` type: - string - 'null' punycode: + description: Full domain name in punycode, for example `xn--far-ena.it` type: - string - 'null' unicode_name: + description: Name without the extension, in Unicode type: - string - 'null' punycode_name: + description: Name without the extension, in punycode type: - string - 'null' unicode_tld: + description: Extension (TLD) without the leading dot, in Unicode type: - string - 'null' punycode_tld: + description: Extension (TLD) without the leading dot, in punycode + type: + - string + - 'null' + type: object + DomainNameserver: + required: + - hostname + - address_ipv4 + - address_ipv6 + - sort + properties: + hostname: + type: string + address_ipv4: + description: >- + IPv4 address of the nameserver, saved when the nameservers were set; + null when not known + type: + - string + - 'null' + address_ipv6: + description: IPv6 address of the nameserver; not filled in for now, always null type: - string - 'null' + sort: + description: Position of the nameserver, from `1` + type: integer + type: object + DomainPremiumPrices: + description: >- + Our prices for a premium domain, without VAT: the cost asked by the + registry plus our markup. The order of a premium domain uses these + prices + required: + - activation_price + - renew_price + - restore_price + - transfer_price + properties: + activation_price: + $ref: '#/components/schemas/Amount' + description: Registration price + renew_price: + $ref: '#/components/schemas/Amount' + description: Renewal price + restore_price: + description: Restore price; null when the registry gave none + anyOf: + - $ref: '#/components/schemas/Amount' + - type: 'null' + transfer_price: + description: Transfer price; null when the registry gave none + anyOf: + - $ref: '#/components/schemas/Amount' + - type: 'null' type: object Domain: + description: Domain of the account, with its nameservers and its data at the registry required: - domain_id - tld_id @@ -20864,7 +16445,6 @@ components: - nameservers - domain_data - contacts_count - - dnssec_enabled - date_info_last - date_dns_check - vanity_nameserver_enabled @@ -20872,41 +16452,55 @@ components: domain_id: type: integer tld_id: + description: Id of the TLD of the domain (`GET /api/v3/tlds/{tld_id}`) type: integer domain_name: $ref: '#/components/schemas/DomainName' dns_type: $ref: '#/components/schemas/DnsType' dns_account: + description: >- + Email of the Cloudflare account that manages the DNS zone, with the + Cloudflare nameservers; null with the other nameserver types, and + when the zone is on our own Cloudflare account type: - string - 'null' nameservers: + description: Nameservers of the domain; `sort` gives their order type: array items: - type: string + $ref: '#/components/schemas/DomainNameserver' domain_data: + description: Data of the domain at the registry; null when there are none anyOf: - $ref: '#/components/schemas/DomainData' - type: 'null' contacts_count: + description: Number of active contacts of the domain type: integer - dnssec_enabled: - type: boolean date_info_last: + description: When the data of the domain were last requested from the registry type: - string - 'null' format: date-time date_dns_check: + description: When the DNS zone and the DNSSEC of the domain were last checked type: - string - 'null' format: date-time vanity_nameserver_enabled: + description: >- + Whether the domain uses vanity nameservers: our nameservers with + hostnames of the domain itself (for example `ns1.example.com`) type: boolean type: object HostingAntivirusRemovalScan: + description: >- + Antivirus cleaning of the hosting, which removes or cleans the infected + files and database contents required: - removal_scan_id - hosting_id @@ -20918,16 +16512,24 @@ components: removal_scan_id: type: integer hosting_id: + description: Id of the hosting (`GET /api/v3/hostings/{hosting_id}`) type: integer task_id: + description: >- + Id of the task of the cleaning (`GET /api/v3/tasks/{task_id}`); null + when the task is not available type: - integer - 'null' status: + description: >- + Whether the cleaning succeeded; null until the antivirus sends the + result type: - boolean - 'null' error: + description: Error message of a failed cleaning; null otherwise type: - string - 'null' @@ -20936,6 +16538,7 @@ components: format: date-time type: object HostingAntivirusScan: + description: Antivirus scan of the hosting required: - antivirus_id - hosting_id @@ -20955,36 +16558,57 @@ components: antivirus_id: type: integer hosting_id: - type: integer + description: >- + Id of the main hosting (`GET /api/v3/hostings/{hosting_id}`): the + scan covers its whole space, subdomains included + type: + - integer + - 'null' status_code: + description: >- + Status of the scan: `RUNNING`, `FAILED`, `SUCCESS` (no infection + found) or `PROBLEM` (infections found) type: - string - 'null' status_name: + description: Translated name of the status, for display type: - string - 'null' status_color: + description: Color of the status, in hexadecimal, for display type: - string - 'null' antivirus_type: + description: 'Type of the scan: `M` manual, `A` automatic' type: string scan_id: + description: Id of the scan on the web server; null until the scan completes type: - string - 'null' date_started: + description: >- + Start of the scan, as sent by the antivirus; null until the scan + completes, and for a failed scan type: - string - 'null' format: date-time date_completed: + description: >- + End of the scan, as sent by the antivirus; null until the scan + completes, and for a failed scan type: - string - 'null' format: date-time date_timeout: + description: >- + When the scan was marked as failed because it ran too long; null + otherwise type: - string - 'null' @@ -20993,19 +16617,25 @@ components: type: string format: date-time total_files: + description: Files scanned; null when zero, and until the scan completes type: - integer - 'null' total_infected: + description: Infected files found; null when zero, and until the scan completes type: - integer - 'null' total_cleaned: + description: >- + Infected files cleaned by the antivirus; null when zero, and until + the scan completes type: - integer - 'null' type: object HostingAntivirus: + description: Antivirus scan running on the hosting, or the latest one required: - antivirus_id - hosting_id @@ -21021,52 +16651,83 @@ components: - total_cleaned properties: antivirus_id: + description: >- + Id of the scan (`GET + /api/v3/hostings/{hosting_id}/antivirus/scans/{antivirus_id}`) type: integer hosting_id: - type: integer + description: >- + Id of the main hosting (`GET /api/v3/hostings/{hosting_id}`): the + scan covers its whole space, subdomains included + type: + - integer + - 'null' status_code: + description: >- + Status of the scan: `RUNNING`, `FAILED`, `SUCCESS` (no infection + found) or `PROBLEM` (infections found) type: - string - 'null' status_name: + description: Translated name of the status, for display type: - string - 'null' status_color: + description: Color of the status, in hexadecimal, for display type: - string - 'null' antivirus_type: + description: 'Type of the scan: `M` manual, `A` automatic' type: string date_started: + description: >- + Start of the scan, as sent by the antivirus; null until the scan + completes, and for a failed scan type: - string - 'null' format: date-time date_completed: + description: >- + End of the scan, as sent by the antivirus; null until the scan + completes, and for a failed scan type: - string - 'null' format: date-time date_timeout: + description: >- + When the scan was marked as failed because it ran too long; null + otherwise type: - string - 'null' format: date-time total_files: + description: Files scanned; null when zero, and until the scan completes type: - integer - 'null' total_infected: + description: Infected files found; null when zero, and until the scan completes type: - integer - 'null' total_cleaned: + description: >- + Infected files cleaned by the antivirus; null when zero, and until + the scan completes type: - integer - 'null' type: object HostingBackup: + description: >- + Backup that contains the hosting: a backup of a web, database or mail + server, with the database or the mailbox of the hosting that it saved required: - hosting_backup_id - hosting_id @@ -21084,49 +16745,78 @@ components: - date_created properties: hosting_backup_id: + description: >- + Id of the backup in the hosting (`GET + /api/v3/hostings/{hosting_id}/backups/{hosting_backup_id}`) type: integer hosting_id: + description: Id of the hosting (`GET /api/v3/hostings/{hosting_id}`) type: integer backup_id: + description: >- + Id of the server backup, which can include other hostings: send it + to `POST /api/v3/hostings/{hosting_id}/backups/exhibitions` type: integer category: + description: >- + Category of the backed up server: `web` (web contents), `database` + or `mail` type: - string - 'null' backup_type_code: + description: >- + Type of the backup, for example `HOSTING_DAILY`, `HOSTING_WEEKLY`, + `HOSTING_MONTHLY` or `HOSTING_UNA_TANTUM` (one-off backup) type: - string - 'null' backup_frequency_code: + description: >- + Frequency of the backup: `D` daily, `W` weekly, `M` monthly, `C` + one-off type: - string - 'null' backup_date: + description: When the server backup was taken type: - string - 'null' format: date-time backup_size: + description: 'Size of the server backup, in MB: it can include other hostings' type: - integer - 'null' backup_duration: + description: Duration of the server backup, as `HH:MM:SS` type: - string - 'null' exit_status: + description: 'Exit code of the server backup: 0 when it succeeded' type: - integer - 'null' error_type: + description: >- + Outcome message of the server backup, in Italian, for example `Tutto + ok` (all fine) type: - string - 'null' mailbox_name: + description: >- + Mailbox saved, for a backup of category `mail`; null for the other + categories type: - string - 'null' database_name: + description: >- + Database saved, for a backup of category `database`; null for the + other categories type: - string - 'null' @@ -21137,6 +16827,7 @@ components: format: date-time type: object HostingCredential: + description: Active FTP or database account of the hosting, with its password required: - credential_id - type @@ -21148,19 +16839,31 @@ components: credential_id: type: integer type: + description: >- + Type of the account: `FTP` (main FTP account), `FTP_SECONDARY` + (additional FTP account), `DATABASE_MYSQL` or `DATABASE_MSSQL` + (database account) type: string username: type: string password: + description: >- + Password of the account, in clear text, as in the control panel: a + temporary random one while the account is suspended type: string root_path: + description: >- + Root directory of an `FTP_SECONDARY` account; null for the other + accounts type: - string - 'null' is_active: + description: Whether the account is active type: boolean type: object HostingCronjob: + description: 'Cron job of the hosting: a URL called on a schedule' required: - cronjob_id - hosting_id @@ -21179,36 +16882,63 @@ components: cronjob_id: type: integer hosting_id: + description: >- + Id of the hosting of the request: cron jobs belong to the purchase, + so a subdomain lists those of its main hosting type: integer purchase_id: + description: >- + Id of the purchase of the hosting (`GET + /api/v3/purchases/{purchase_id}`) type: integer request_url: + description: URL called by the cron job, with the protocol type: string http_request_method: + description: 'HTTP method of the call: `GET` or `POST`' type: - string - 'null' plan_month: + description: >- + Months, from 1 (January) to 12 (December), as a comma-separated list + like in the creation (for example `1,6`); null for every month type: - string - 'null' plan_monthday: + description: >- + Days of the month, from 1 to 31, as a comma-separated list like in + the creation (for example `1,15`); null for every day type: - string - 'null' plan_weekday: + description: >- + Days of the week, from 1 (Monday) to 7 (Sunday), as a + comma-separated list like in the creation (for example `1,5`); null + for every day of the week type: - string - 'null' plan_hour: + description: >- + Hours, from 0 to 23, as a comma-separated list like in the creation + (for example `0,12`); null for every hour type: - string - 'null' plan_minute: + description: >- + Minutes, from 0 to 59, as a comma-separated list like in the + creation (for example `0,30`); null for every minute type: - string - 'null' active: + description: >- + Whether the cron job is active: deleted cron jobs, and the old + versions of changed ones, stay in the list as inactive type: boolean date_created: type: @@ -21216,12 +16946,16 @@ components: - 'null' format: date-time date_disabled: + description: >- + When the cron job was deleted or replaced by a new version; null + while it is active type: - string - 'null' format: date-time type: object HostingDatabase: + description: Database of the hosting, with the account that owns it required: - database_id - name @@ -21232,29 +16966,42 @@ components: - table_count properties: database_id: + description: 'Id of the database: its name' type: string name: type: string type: + description: 'Type of the database: `MYSQL` or `MSSQL` (Microsoft SQL Server)' type: string credential_id: + description: >- + Id of the database account that owns the database, as in `GET + /api/v3/hostings/{hosting_id}/credentials` type: - integer - 'null' username: + description: Username of the database account type: - string - 'null' supplier_code: + description: >- + Id of the database on Plesk, for the hostings managed with Plesk; + null for the others type: - string - 'null' table_count: + description: Number of tables in the database; null for the databases on Plesk type: - integer - 'null' type: object HostingDnsRecord: + description: >- + Default DNS record of the hosting, from its web server or its mail + server required: - dns_record_id - type @@ -21275,57 +17022,88 @@ components: dns_record_id: type: integer type: + description: Type of the record, for example `A`, `CNAME`, `MX`, `TXT` or `SRV` type: string host: + description: >- + Name of the record relative to the domain: `@` for the domain + itself, otherwise for example `www` or `mail` type: string destination: + description: >- + Value of the record: the IP address of `A` records, the target host + of `CNAME`, `MX` and `SRV` records, the text of `TXT` records type: string priority: + description: Priority of `MX` and `SRV` records type: - integer - 'null' weight: + description: Weight of `SRV` records type: - integer - 'null' port: + description: Port of `SRV` records type: - integer - 'null' service: + description: >- + Service of `SRV` records (for example `_autodiscover`) and port of + `TLSA` records type: - string - 'null' protocol: + description: 'Protocol of `SRV` and `TLSA` records: `_tcp`, `_udp` or `_tls`' type: - string - 'null' caa_flag: + description: Flag of `CAA` records type: - integer - 'null' caa_tag: + description: >- + Tag of `CAA` records: `issue`, `issuewild`, `iodef-http` or + `iodef-mail` type: - string - 'null' caa_can_sign_http_exchanges: + description: >- + Whether the `CAA` record allows certificates for signed HTTP + exchanges (`cansignhttpexchanges=yes`) type: - boolean - 'null' tlsa_usage: + description: >- + Certificate usage of `TLSA` records: 0 PKIX-TA, 1 PKIX-EE, 2 + DANE-TA, 3 DANE-EE type: - - string + - integer - 'null' tlsa_selector: + description: >- + Selector of `TLSA` records: 0 for the full certificate, 1 for the + public key type: - - string + - integer - 'null' tlsa_matching_type: + description: >- + Matching type of `TLSA` records: 0 for the exact data, 1 for + SHA-256, 2 for SHA-512 type: - - string + - integer - 'null' type: object HostingEmailAlias: + description: Email alias of the mail domain of the hosting, with its destinations required: - alias_id - address @@ -21338,29 +17116,42 @@ components: - does_exist properties: alias_id: + description: 'Id of the alias: its address, as in `address`' type: string address: + description: Address of the alias, with the domain in punycode type: string address_idna: + description: Address of the alias, with the domain in Unicode type: string goto: + description: Destination addresses, separated by commas type: - string - 'null' goto_idna: + description: >- + Destination addresses, separated by commas, with the domains in + Unicode type: - string - 'null' domain: + description: Mail domain of the alias, in punycode type: string domain_idna: + description: Mail domain of the alias, in Unicode type: string is_active: + description: Whether the alias is active type: boolean does_exist: type: boolean type: object HostingEmailAllowList: + description: >- + Sender in the allow list of the antispam of the mail domain of the + hosting: a whole domain or an address required: - allow_list_id - hosting_id @@ -21371,20 +17162,29 @@ components: allow_list_id: type: integer hosting_id: + description: Id of the hosting (`GET /api/v3/hostings/{hosting_id}`) type: integer sender: - type: string + description: 'Sender of the entry: the domain or the address' + type: + - string + - 'null' domain: + description: Sender domain; null when the entry is for an address type: - string - 'null' mailbox: + description: Sender address; null when the entry is for a whole domain type: - string - 'null' format: email type: object - HostingEmailBlocList: + HostingEmailBlockList: + description: >- + Sender in the block list of the antispam of the mail domain of the + hosting: a whole domain or an address required: - block_list_id - hosting_id @@ -21395,20 +17195,27 @@ components: block_list_id: type: integer hosting_id: + description: Id of the hosting (`GET /api/v3/hostings/{hosting_id}`) type: integer sender: - type: string + description: 'Sender of the entry: the domain or the address' + type: + - string + - 'null' domain: + description: Sender domain; null when the entry is for an address type: - string - 'null' mailbox: + description: Sender address; null when the entry is for a whole domain type: - string - 'null' format: email type: object HostingEmailCatchAll: + description: Catch-all of the mail domain of the hosting required: - is_active - address @@ -21416,18 +17223,29 @@ components: - destinations properties: is_active: + description: >- + Whether the catch-all is set: mail sent to addresses of the domain + that do not exist goes to `destinations` type: boolean address: + description: 'Address of the catch-all: `@` and the mail domain, in punycode' type: string address_idna: + description: Address of the catch-all, with the domain in Unicode type: string destinations: + description: >- + Destination addresses of the catch-all, with the domains in Unicode; + empty when it is not set type: array items: type: string format: email type: object HostingModSecurityRule: + description: >- + ModSecurity rule of the hosting, found by a scan or added by hand, and + whether it is disabled required: - rule_id - hosting_id @@ -21438,17 +17256,28 @@ components: rule_id: type: integer hosting_id: + description: Id of the hosting (`GET /api/v3/hostings/{hosting_id}`) type: integer rule_number: + description: Number of the rule in ModSecurity type: string description: + description: >- + Message of the rule found by the scan, or the description given when + it was added type: - string - 'null' included: + description: >- + Whether the rule is disabled on the hosting: it is in the list of + rules that ModSecurity does not apply type: boolean type: object HostingModSecurityScan: + description: >- + Scan of the ModSecurity rules that generated errors or blocks on the + hosting required: - scan_id - hosting_id @@ -21460,20 +17289,32 @@ components: scan_id: type: integer hosting_id: - type: integer + description: Id of the hosting (`GET /api/v3/hostings/{hosting_id}`) + type: + - integer + - 'null' date_created: type: string format: date-time error: + description: Error of the scan; null when it succeeded type: - string - 'null' rules_found: + description: >- + Number of rules found by the scan: those that generated errors or + blocks on the day of the scan type: integer rules_excluded: + description: >- + Number of rules found by the scan that are disabled on the hosting + now (`included` true in `GET + /api/v3/hostings/{hosting_id}/modsecurity/rules`) type: integer type: object HostingModSecurity: + description: Status of ModSecurity, the web application firewall, on the hosting required: - hosting_id - is_available @@ -21484,44 +17325,94 @@ components: - custom_set properties: hosting_id: + description: Id of the hosting (`GET /api/v3/hostings/{hosting_id}`) type: integer is_available: + description: >- + Whether ModSecurity can be managed: only on Linux hostings, and not + while the purchase is suspended or in maintenance type: boolean is_active: + description: >- + Whether ModSecurity is enabled (`PATCH + /api/v3/hostings/{hosting_id}/modsecurity`) type: boolean firewall_compatible: + description: >- + Whether the rules of ModSecurity can be managed on the web server of + the hosting: false on dedicated web servers and when ModSecurity is + not available type: boolean full_strict: + description: >- + Whether ModSecurity filters all the traffic, with no disabled rule; + null when `firewall_compatible` is false type: - boolean - 'null' custom_rules: + description: >- + Numbers of the rules disabled on the hosting, as read from the web + server; null when the hosting has no custom configuration type: - array - 'null' items: type: string custom_set: + description: >- + Rule sets of the custom configuration of the hosting, as read from + the web server; null when the hosting has no custom configuration type: - array - 'null' items: type: string type: object + HostingPhpSetting: + description: PHP directive changed on the hosting, with its value + required: + - setting + - value + properties: + setting: + description: >- + PHP directive, as in `PATCH + /api/v3/hostings/{hosting_id}/php-settings` + type: string + enum: + - opcache.enable + - display_errors + - memory_limit + - post_max_size + - upload_max_filesize + - max_execution_time + - max_input_time + value: + description: Value set on the hosting + type: string + type: object HostingPhpVersion: + description: PHP version available for the hosting required: - version - is_current - is_default properties: version: + description: >- + PHP version, for example `8.3`: send it to `PATCH + /api/v3/hostings/{hosting_id}/php-version` type: string is_current: + description: Whether the hosting uses this version type: boolean is_default: + description: Whether it is the default version of the web server type: boolean type: object HostingSslCertificate: + description: SSL certificate installed on the website or on the mail of the hosting required: - hosting_ssl_certificate_id - hosting_id @@ -21536,38 +17427,60 @@ components: hosting_ssl_certificate_id: type: integer hosting_id: + description: Id of the hosting (`GET /api/v3/hostings/{hosting_id}`) type: integer ssl_certificate_id: + description: >- + Id of the purchased SSL certificate (`GET + /api/v3/ssl-certificates/{ssl_certificate_id}`); null for the other + certificates type: - integer - 'null' lets_encrypt_id: + description: Id of the Let's Encrypt certificate; null for the other certificates type: - integer - 'null' external_certificate_id: + description: >- + Id of the external certificate, whose keys were uploaded by the + customer; null for the other certificates type: - integer - 'null' cn_type: + description: >- + Type of the certificate: `NORMAL`, or `WILDCARD` for a wildcard + certificate type: - string - 'null' installation_date: + description: >- + When the certificate was installed; null until the installation + completes type: - string - 'null' format: date-time https_rewrite: + description: Whether the visits over HTTP are redirected to HTTPS (301) type: - boolean - 'null' destination_type: + description: >- + Where the certificate is installed: `web` for the website, `mail` + for the mail servers type: - string - 'null' type: object Hosting: + description: >- + Hosting of the account: a main hosting, bought with a purchase, or one + of its subdomains required: - hosting_id - purchase_id @@ -21580,52 +17493,103 @@ components: - domain_full_name - domain_full_name_idna - php_version + - http_version + - file_protection_enabled + - php_settings - is_active properties: hosting_id: type: integer purchase_id: + description: >- + Id of the purchase of the hosting (`GET + /api/v3/purchases/{purchase_id}`); null for a subdomain, which + belongs to the purchase of its main hosting type: - integer - 'null' parent_hosting_id: + description: >- + Id of the main hosting of a subdomain (`GET + /api/v3/hostings/{hosting_id}`); null for a main hosting type: - integer - 'null' is_primary: + description: >- + Whether it is a main hosting; false for a subdomain (`POST + /api/v3/hostings/{hosting_id}/subdomains`) type: boolean host_name: + description: >- + Host name, in Unicode: the hostname of a main hosting (usually its + domain), the level name of a subdomain (for example `blog`) type: - string - 'null' host_name_idna: + description: '`host_name` in punycode' type: - string - 'null' full_name: + description: >- + Full hostname, in Unicode: for a subdomain, the level name followed + by the hostname of the main hosting type: - string - 'null' full_name_idna: + description: '`full_name` in punycode' type: - string - 'null' domain_full_name: + description: >- + Hostname on the domain of the purchase, in Unicode: the domain for a + main hosting, the subdomain of the domain for a subdomain type: - string - 'null' domain_full_name_idna: + description: '`domain_full_name` in punycode' type: - string - 'null' php_version: + description: >- + PHP version of the hosting, for example `8.3` (`PATCH + /api/v3/hostings/{hosting_id}/php-version`); null or empty when not + set type: - string - 'null' + http_version: + description: >- + HTTP version of the hosting: 1 for HTTP/1.1, 2 for HTTP/2 (`PATCH + /api/v3/hostings/{hosting_id}/http-version`) + type: string + file_protection_enabled: + description: >- + Whether the file protection is enabled (`PATCH + /api/v3/hostings/{hosting_id}/file-protection`) + type: boolean + php_settings: + description: >- + PHP directives changed on the hosting (`PATCH + /api/v3/hostings/{hosting_id}/php-settings`): the others have the + default value of the web server + type: array + items: + $ref: '#/components/schemas/HostingPhpSetting' is_active: + description: >- + Whether the hosting is active: always true, since deleted subdomains + are not returned type: boolean type: object InvoiceRow: + description: Row of an invoice required: - invoice_row_id - invoice_id @@ -21645,50 +17609,73 @@ components: invoice_row_id: type: integer invoice_id: + description: Id of the invoice (`GET /api/v3/invoices/{invoice_id}`) type: integer invoice_id_deposit: + description: >- + Id of the deposit invoice that the row deducts, in a balance invoice + (`GET /api/v3/invoices/{invoice_id}`); null for the other rows type: - integer - 'null' service: + description: Service of the row; null when the row is not for a service anyOf: - $ref: '#/components/schemas/Service' - type: 'null' purchase: + description: Purchase of the row; null when the row is not for a purchase anyOf: - $ref: '#/components/schemas/Purchase' - type: 'null' description: type: string unit_description: + description: >- + Unit of `unit_quantity`: `h` (hours) or `m` (minutes); null when the + row is not priced by unit type: - string - 'null' unit_quantity: + description: >- + Quantity, in the unit of `unit_description`; null when the row is + not priced by unit type: - number - 'null' format: float unit_amount: $ref: '#/components/schemas/Amount' + description: >- + Price of one unit; its `amount` is null when the row is not priced + by unit amount: $ref: '#/components/schemas/Amount' billing_data: $ref: '#/components/schemas/BillingData' is_recurring: + description: >- + Whether the row is for a recurring charge, such as a service renewed + periodically, and not a one-time one type: boolean date_start: + description: >- + Start of the period the row refers to; null when the row has no + period type: - string - 'null' format: date date_end: + description: End of the period the row refers to; null when the row has no period type: - string - 'null' format: date type: object Invoice: + description: Invoice of the account, with its totals and electronic invoicing data required: - invoice_id - billing @@ -21715,39 +17702,71 @@ components: billing: $ref: '#/components/schemas/AccountBilling' type: + description: >- + Type of the invoice: `NORMAL`, `DEPOSIT` (top-up of the prepaid + credit) or `BALANCE` (paid with the prepaid credit: some rows deduct + the deposit invoices) type: - string - 'null' sdi_document_status: + description: >- + Status of the invoice on SDI, the Italian e-invoicing exchange + system; null for the invoices not sent through SDI, issued before + electronic invoicing anyOf: - $ref: '#/components/schemas/SdiDocumentStatus' - type: 'null' sdi_document_type: + description: >- + Type of the electronic document on SDI; `TD01` (invoice) when the + invoice has none anyOf: - $ref: '#/components/schemas/SdiDocumentType' - type: 'null' date_emitted: + description: Date of issue of the invoice type: string format: date invoice_year: - type: integer + description: Year of the numbering of the invoice + type: + - integer + - 'null' invoice_number: + description: >- + Complete number of the invoice: the year followed by the number on 6 + digits, for example `2025000123` type: string invoice_caption: + description: >- + Legal note of the tax regime printed on the invoice, in Italian, + such as the law under which VAT is not applied; null when the regime + has none type: - string - 'null' invoice_caption_additional: + description: >- + Additional reason (`Causale`) of the electronic invoice; null when + there is none type: - string - 'null' payed: + description: Whether the invoice is paid type: boolean sdi_identifier: + description: >- + Identifier assigned by SDI to the invoice; null when it has not been + sent to SDI type: - string - 'null' sdi_filename: + description: >- + Name of the file sent to SDI; null when not sent, and for most + invoices issued before November 2024 type: - string - 'null' @@ -21755,19 +17774,32 @@ components: $ref: '#/components/schemas/Amount' amount_no_balance: $ref: '#/components/schemas/Amount' + description: >- + Total of the invoice without the rows that deduct deposit invoices; + the same as `total_amount` except for `BALANCE` invoices payment_amount: $ref: '#/components/schemas/Amount' + description: >- + Amount to pay: the taxable amount in `amount`, with the VAT and the + total to pay. With split payment the customer pays only the taxable + amount, because the VAT goes to the State, so the VAT fields are + null orders: + description: Ids of the orders of the invoice (`GET /api/v3/orders/{order_id}`) type: array items: type: integer rows_count: + description: >- + Number of rows of the invoice (`GET + /api/v3/invoices/{invoice_id}/rows`) type: integer date_created: type: string format: date-time type: object IpAddress: + description: IP address of a server, with its reverse DNS and its state required: - ip_address_id - server_id @@ -21783,28 +17815,52 @@ components: ip_address_id: type: integer server_id: + description: >- + Id of the server the IP address is assigned to (`GET + /api/v3/servers/{server_id}`); null for the free IP addresses of a + private cloud (`GET + /api/v3/servers/{server_id}/private-cloud/available-ip-addresses`) type: - integer - 'null' ip_address: type: string reverse_dns: + description: >- + Reverse DNS set on the IP address, changed with `PATCH + /api/v3/servers/{server_id}/ip-addresses/{ip_address_id}/rdns`; null + when it is not set type: - string - 'null' reverse_dns_external: + description: >- + Reverse DNS of the IP address as last read from its supplier; null + when the supplier has none type: - string - 'null' mac_address: + description: >- + MAC address associated with the IP address, such as the virtual MAC + of the supplier or the one of its network interface; null when there + is none type: - string - 'null' blocked_for_spam: + description: Whether the supplier blocked the IP address for spam type: boolean active: + description: >- + Whether the IP address is active: false once it has been revoked or + cancelled at the supplier type: boolean available: + description: >- + Whether the IP address can be used: an address that is not + available, such as the gateway of its block, cannot be assigned to a + network interface or to a virtual machine type: boolean date_created: type: @@ -21813,16 +17869,24 @@ components: format: date-time type: object LegalEntityGroup: + description: Group of legal forms, such as private individuals or Italian companies required: - group_code - group_name properties: group_code: + description: >- + Code of the group, currently `PRIVATE`, + `ITALIAN_INDIVIDUAL_COMPANY`, `ITALIAN_LIMITED_COMPANY`, + `ITALIAN_COOPERATIVE_COMPANY`, `ITALIAN_PUBLIC_ADMINISTRATION`, + `FOREIGN_COMPANY` or `OTHER` type: string group_name: + description: Name of the group, in Italian type: string type: object LegalEntity: + description: Legal form of the holder of a billing profile, with its group required: - legal_entity_group - tax_regime @@ -21834,16 +17898,114 @@ components: tax_regime: $ref: '#/components/schemas/TaxRegime' entity_code: + description: >- + Code of the legal form: `ITA_PVT`, `NOITA_PVT`, `ITA_INDIVIDUALE`, + `ITA_CAPITALI`, `ITA_PERSONE`, `ITA_ASSNOCOMM`, `ITA_ASSCOMM`, + `ITA_ALTRO`, `ITA_PA`, `EU_ALTRO`, `NOEU_ALTRO`, `VATICAN_NOPVT`, + `SANMARINO_NOPVT` or `FORBIDDEN_NOITA_NOPVT` type: string entity_name: + description: Name of the legal form, in Italian type: string type: object + License: + description: >- + cPanel or Plesk license of the account, with the server or the IP + address where it is installed + required: + - license_id + - purchase_id + - purchase_server_id + - service_name + - purchase_name + - key_number + - ip_address + - is_els + - operative_system + - purchase_status_code + - date_activation + - date_expiry + properties: + license_id: + type: integer + purchase_id: + description: >- + Id of the purchase of the license (`GET + /api/v3/purchases/{purchase_id}`) + type: integer + purchase_server_id: + description: >- + Id of the purchase of the server where the license is installed + (`GET /api/v3/purchases/{purchase_id}`); null for a license on an + external host (`ip_address`) or without a server + type: + - integer + - 'null' + service_name: + description: Name of the service of the purchase, in Italian + type: + - string + - 'null' + purchase_name: + description: >- + Object name of the purchase, as `purchase_name.object_name` of the + purchase + type: + - string + - 'null' + key_number: + description: Key number of a Plesk license; null for cPanel licenses + type: + - string + - 'null' + ip_address: + description: >- + IP address of the external host where the license is installed, + instead of a server (`purchase_server_id`) + type: + - string + - 'null' + is_els: + description: >- + Whether the server runs an obsolete operating system, covered by the + Extended Lifecycle Support (ELS) of the supplier and charged as an + additional fee + type: boolean + operative_system: + description: >- + Operating system of the server, as reported by the license supplier; + null until reported + type: + - string + - 'null' + purchase_status_code: + description: >- + Status code of the purchase (`status_code` of `PurchaseStatus`): + `NEW_V2`, `ACTIVE_V2` or `DELIVERED_V2` + type: + - string + - 'null' + date_activation: + description: Activation date of the purchase (`date_activation` of the purchase) + type: + - string + - 'null' + format: date + date_expiry: + description: Expiry date of the purchase (`date_expiry` of the purchase) + type: + - string + - 'null' + format: date + type: object Microsoft365DomainAvailable: + description: >- + Availability of a `.onmicrosoft.com` domain for a new Microsoft 365 + tenant required: - domain_prefix - microsoft_domain - available - - microsoft_uuid properties: domain_prefix: description: Requested tenant domain prefix @@ -21852,15 +18014,15 @@ components: description: Full ".onmicrosoft.com" domain type: string available: - description: Whether the domain is available + description: >- + Whether the domain is available for a new tenant: false if a tenant + already has it at Microsoft type: boolean - microsoft_uuid: - description: Microsoft tenant UUID if available - type: - - string - - 'null' type: object Microsoft365: + description: >- + Microsoft 365 subscription of the account, with its status at the + supplier and its tenant required: - microsoft365_id - purchase_id @@ -21882,68 +18044,113 @@ components: microsoft365_id: type: integer purchase_id: + description: >- + Id of the purchase of the subscription (`GET + /api/v3/purchases/{purchase_id}`) type: integer tenant_id: + description: >- + Id of the tenant of the subscription (`GET + /api/v3/microsoft-365-tenants/{microsoft_365_tenant_id}`) type: - integer - 'null' service_name: + description: Name of the service of the purchase, in Italian type: - string - 'null' purchase_name: + description: >- + Object name of the purchase (`purchase_name.object_name` of the + purchase): the prefix of the tenant domain, null until it is set type: - string - 'null' supplier_code: + description: >- + Reference of the subscription at the supplier; null until the + supplier provisions it type: - string - 'null' supplier_status: + description: >- + Status of the subscription as the supplier reports it, for example + `active`, `suspended` or `canceled`; null until known type: - string - 'null' order_code: + description: >- + Code of the order placed at the supplier for the subscription; null + until it is placed type: - string - 'null' order_reference: + description: >- + Reference of the order at the supplier; null until the supplier + assigns it type: - string - 'null' order_status: + description: >- + Status of the order at the supplier, for example `Order queued`, + `Fulfilled` or `Archived`; null until the order is placed type: - string - 'null' order_need_submit: + description: >- + Whether the order at the supplier ended with a warning and must be + submitted again type: boolean autorenew_enabled: + description: Whether the subscription renews automatically at the supplier type: boolean is_trial: + description: Whether the subscription is a trial type: boolean subscription_activation_date: + description: >- + Activation date of the subscription at the supplier; null until + known type: - string - 'null' format: date subscription_expiry_date: + description: Expiry date of the subscription at the supplier; null until known type: - string - 'null' format: date tenant: + description: Tenant of the subscription anyOf: - $ref: '#/components/schemas/Microsoft365Tenant' - type: 'null' type: object Microsoft365PartnerLink: + description: >- + Link to approve the Microsoft partner relationship, needed to transfer a + tenant required: - partner_link properties: partner_link: + description: >- + URL where the partner relationship of the tenant is approved at + Microsoft, before buying a subscription with `tenant_choice` + `transfer` type: string type: object Microsoft365Tenant: + description: >- + Microsoft 365 tenant of the account, with its contact data and the state + of the Microsoft Customer Agreement required: - tenant_id - microsoft_uuid @@ -21971,18 +18178,24 @@ components: tenant_id: type: integer microsoft_uuid: + description: Id of the tenant at Microsoft (tenant UUID); null until detected type: - string - 'null' domain_prefix: + description: Prefix of the `.onmicrosoft.com` domain of the tenant type: - string - 'null' microsoft_domain: + description: Full `.onmicrosoft.com` domain of the tenant type: - string - 'null' imported: + description: >- + Whether the tenant was transferred from another partner + (`tenant_choice` `transfer`) instead of created new (`new`) type: boolean first_name: type: @@ -21993,6 +18206,9 @@ components: - string - 'null' country: + description: >- + Country of the tenant, as an ISO 3166-1 alpha-2 code, for example + `IT` type: - string - 'null' @@ -22009,6 +18225,7 @@ components: - string - 'null' state: + description: State or province of the tenant address type: - string - 'null' @@ -22022,6 +18239,7 @@ components: - 'null' format: email phone_prefix: + description: International phone prefix with the leading `+`, for example `+39` type: - string - 'null' @@ -22030,30 +18248,50 @@ components: - string - 'null' locale: + description: Locale of the tenant, for example `it_IT` or `en_US` type: - string - 'null' account_login: + description: >- + Username of the administrator account of the tenant, whose password + is sent by email; null when not available type: - string - 'null' mca_compliant: - type: boolean + description: >- + Whether the Microsoft Customer Agreement (MCA) has been accepted for + the tenant; null until checked + type: + - boolean + - 'null' mca_sign_date: + description: >- + Date and time the Microsoft Customer Agreement was accepted; null + when not known type: - string - 'null' format: date-time mca_template_id: + description: >- + Template of the accepted Microsoft Customer Agreement, as an id or + as the URL of the agreement; null when not accepted type: - string - 'null' mca_error: + description: >- + Message of the supplier on the check of the Microsoft Customer + Agreement, for example `customer is not provisioned yet`; null when + there is none type: - string - 'null' type: object ObjectStorageBucketChart: + description: Daily usage history of a bucket, for a chart required: - object_storage_id - bucket_id @@ -22061,29 +18299,57 @@ components: - points properties: object_storage_id: + description: >- + Id of the object storage (`GET + /api/v3/object-storages/{object_storage_id}`) type: integer bucket_id: + description: >- + Id of the bucket (`GET + /api/v3/object-storages/{object_storage_id}/buckets/{bucket_id}`) type: integer interval: + description: >- + Interval between two points, as an ISO 8601 duration: always `P1D`, + one point per day type: string example: P1D points: + description: Usage of the bucket day by day, oldest first type: array items: + required: + - x + - active_storage_bytes + - deleted_storage_bytes + - active_objects + - deleted_objects + - api_calls_count + - storage_wrote_bytes + - storage_read_bytes + - ingress_traffic_bytes + - egress_traffic_bytes properties: x: description: UNIX timestamp in milliseconds type: number format: float active_storage_bytes: + description: Space used by the active objects on the day, in bytes type: integer deleted_storage_bytes: + description: >- + Space of the deleted objects still counted on the day, in + bytes type: integer active_objects: + description: Number of active objects on the day type: integer deleted_objects: + description: Number of deleted objects still counted on the day type: integer api_calls_count: + description: Number of API calls on the day type: integer storage_wrote_bytes: type: integer @@ -22096,6 +18362,9 @@ components: type: object type: object ObjectStorageBucketFirewallEntry: + description: >- + Entry of the firewall of a bucket: when the bucket has entries, the + requests from other addresses are denied required: - entry_id - object_storage_id @@ -22107,14 +18376,24 @@ components: entry_id: type: integer object_storage_id: + description: >- + Id of the object storage (`GET + /api/v3/object-storages/{object_storage_id}`) type: integer bucket_id: + description: >- + Id of the bucket (`GET + /api/v3/object-storages/{object_storage_id}/buckets/{bucket_id}`) type: integer ip: + description: >- + IPv4 or IPv6 address, or subnet in CIDR notation, allowed to access + the bucket type: - string - 'null' active: + description: 'Whether the entry is active: removed entries are not returned' type: - boolean - 'null' @@ -22125,6 +18404,9 @@ components: format: date-time type: object ObjectStorageBucket: + description: >- + Bucket of an object storage, with its usage from the latest daily usage + data of the storage: a null figure means zero or not available yet required: - bucket_id - object_storage_id @@ -22153,12 +18435,20 @@ components: bucket_id: type: integer object_storage_id: + description: >- + Id of the object storage (`GET + /api/v3/object-storages/{object_storage_id}`) type: integer sub_account_id: + description: >- + Id of the sub-account of the object storage, the account at the + storage that holds its buckets and IAM users (not the account id of + the storage) type: - integer - 'null' region_id: + description: Id of the storage region of the bucket type: - integer - 'null' @@ -22167,10 +18457,12 @@ components: - integer - 'null' code: + description: Progressive number of the bucket in the object storage type: - - string + - integer - 'null' code_full: + description: Same value as `name` type: - string - 'null' @@ -22183,55 +18475,76 @@ components: - string - 'null' versioning: + description: >- + Versioning status of the bucket: `ENABLED`, `SUSPENDED`, or + `DISABLED` if it has never been enabled type: - string - 'null' creation_date: + description: Date the bucket was created on the storage type: - string - 'null' - format: date-time + format: date arn: + description: >- + ARN (Amazon Resource Name) of the bucket, used in the policies + (`arn:aws:s3:::`) type: - string - 'null' policy_json: + description: >- + Policy of the bucket on the storage, as a JSON string, with the + firewall entries; null if the bucket has none type: - string - 'null' active_storage_bytes: + description: Space used by the active objects, in bytes type: - integer - 'null' deleted_storage_bytes: + description: >- + Space of the deleted objects that still counts toward the purchased + space, in bytes type: - integer - 'null' active_objects: + description: Number of active objects type: - integer - 'null' deleted_objects: + description: Number of deleted objects still counted in `deleted_storage_bytes` type: - integer - 'null' api_calls_count: + description: Number of API calls in the day of the latest usage data type: - integer - 'null' storage_wrote_bytes: + description: Data written in the day of the latest usage data, in bytes type: - integer - 'null' storage_read_bytes: + description: Data read in the day of the latest usage data, in bytes type: - integer - 'null' egress_traffic_bytes: + description: Outgoing traffic in the day of the latest usage data, in bytes type: - integer - 'null' ingress_traffic_bytes: + description: Incoming traffic in the day of the latest usage data, in bytes type: - integer - 'null' @@ -22242,6 +18555,7 @@ components: format: date type: object ObjectStorageIamUserS3Key: + description: S3 key of an IAM user of an object storage required: - s3_key_id - object_storage_id @@ -22255,22 +18569,39 @@ components: s3_key_id: type: integer object_storage_id: + description: >- + Id of the object storage (`GET + /api/v3/object-storages/{object_storage_id}`) type: integer iam_user_id: + description: >- + Id of the IAM user (`GET + /api/v3/object-storages/{object_storage_id}/iam-users/{iam_user_id}`) type: integer access_key: + description: Access key ID, to use with `secret_key` in the S3 clients type: - string - 'null' secret_key: + description: >- + Secret of the S3 key; returned when the key is created and, + afterwards, only with the objectstorage:secrets scope (null + otherwise) type: - string - 'null' status: + description: >- + Status of the key in the IAM service of the storage, for example + `Active` type: - string - 'null' active: + description: >- + Whether the key is active: deleted keys are not returned; its state + on the storage is in `status` type: - boolean - 'null' @@ -22281,6 +18612,9 @@ components: format: date-time type: object ObjectStorageIamUser: + description: >- + IAM user of an object storage: a user of the storage with its own S3 + keys required: - iam_user_id - object_storage_id @@ -22290,39 +18624,48 @@ components: - iam_id - arn - active - - firewall_policy - date_created properties: iam_user_id: type: integer object_storage_id: + description: >- + Id of the object storage (`GET + /api/v3/object-storages/{object_storage_id}`) type: integer sub_account_id: + description: >- + Id of the sub-account of the object storage, the account at the + storage that holds its buckets and IAM users (not the account id of + the storage) type: integer code: + description: Progressive number of the IAM user in the object storage type: - - string + - integer - 'null' code_full: + description: Username of the IAM user on the storage type: - string - 'null' iam_id: + description: Id of the user in the IAM service of the storage type: - string - 'null' arn: + description: >- + ARN (Amazon Resource Name) of the IAM user, used in the policies + (`arn:aws:iam:::user/`) type: - string - 'null' active: + description: 'Whether the IAM user is active: deleted users are not returned' type: - boolean - 'null' - firewall_policy: - type: - - string - - 'null' date_created: type: - string @@ -22330,6 +18673,9 @@ components: format: date-time type: object ObjectStorageS3Key: + description: >- + Main S3 key of an object storage: the key of the root user of its + account at the storage, with the secret required: - object_storage_id - sub_account_id @@ -22340,31 +18686,53 @@ components: - secret_key properties: object_storage_id: + description: >- + Id of the object storage (`GET + /api/v3/object-storages/{object_storage_id}`) type: integer sub_account_id: + description: >- + Id of the sub-account of the object storage, the account at the + storage that holds its buckets and IAM users (not the account id of + the storage) type: integer username: + description: Name of the sub-account at the storage type: - string - 'null' user_id: + description: >- + Id of the root user of the sub-account in the IAM service of the + storage type: - string - 'null' arn: + description: >- + ARN (Amazon Resource Name) of the root user of the sub-account, used + in the policies (`arn:aws:iam:::root`) type: - string - 'null' access_key: + description: >- + Access key ID, to use with `secret_key` in the S3 clients; null if + the sub-account has no key saved type: - string - 'null' secret_key: + description: Secret of the key; null if the sub-account has no key saved type: - string - 'null' type: object ObjectStorage: + description: >- + S3-compatible object storage of the account, with the usage of all its + buckets from the latest daily usage data of the storage: a null figure + means zero or not available yet required: - object_storage_id - purchase_id @@ -22387,81 +18755,115 @@ components: object_storage_id: type: integer purchase_id: + description: >- + Id of the purchase of the object storage (`GET + /api/v3/purchases/{purchase_id}`) type: - integer - 'null' name: + description: >- + Name of the object storage account at the storage, the same as + `code_full` type: - string - 'null' email: + description: >- + Contact email of the object storage account at the storage, + generated by the service (`@serverlet.it`) type: - string - 'null' code: type: - - string + - integer - 'null' code_full: + description: Code of the object storage account at the storage, used as its name type: - string - 'null' active: + description: >- + Whether the object storage account is active at the storage: false + after its deletion type: - boolean - 'null' active_storage_bytes: + description: Space used by the active objects, in bytes type: - integer - 'null' deleted_storage_bytes: + description: >- + Space of the deleted objects that still counts toward the purchased + space, in bytes type: - integer - 'null' active_objects: + description: Number of active objects type: - integer - 'null' deleted_objects: + description: Number of deleted objects still counted in `deleted_storage_bytes` type: - integer - 'null' api_calls_count: + description: Number of API calls in the day of the latest usage data type: - integer - 'null' storage_wrote_bytes: + description: Data written in the day of the latest usage data, in bytes type: - integer - 'null' storage_read_bytes: + description: Data read in the day of the latest usage data, in bytes type: - integer - 'null' egress_traffic_bytes: + description: Outgoing traffic in the day of the latest usage data, in bytes type: - integer - 'null' ingress_traffic_bytes: + description: Incoming traffic in the day of the latest usage data, in bytes type: - integer - 'null' reference_date: + description: >- + Date the object storage account was created at the storage: it is + not the date of the usage figures type: - string - 'null' format: date type: object OneClickAutorenew: + description: Automatic renewal with One-Click payment, with the methods it uses required: - one_click_preference properties: one_click_preference: + description: >- + Active One-Click methods, in the order in which the automatic + payments try them until one is authorized type: array items: $ref: '#/components/schemas/OneClick' type: object OneClick: + description: >- + One-Click payment method: a card or an account saved by the customer, + used for One-Click payments and automatic renewals required: - one_click_id - payment_method @@ -22474,18 +18876,37 @@ components: one_click_id: type: integer payment_method: + description: >- + Name of the payment method, in Italian, for example `Carta di + credito` or `PayPal` type: string description: - type: string + description: >- + Description of the method: the name of the payment method followed + by the card (brand, last digits and expiry) or the email of the + account + type: + - string + - 'null' method_type: + description: >- + Type of the method: `VISA`, `MASTERCARD`, `MAESTRO`, + `AMERICAN_EXPRESS`, `PAYPAL`, `APPLEPAY`, `GOOGLEPAY`, `AMAZONPAY` + or `SATISPAY`; null when unknown type: - string - 'null' creditcard_pan: + description: >- + Number of the card, masked or reduced to the last digits; null for + the methods without a card type: - string - 'null' date_expiry: + description: >- + Expiry of the method: the expiry of the card or, without a card, + four years after the activation type: - string - 'null' @@ -22493,58 +18914,86 @@ components: date_created: type: string format: date-time - one_click_preference: - type: array - items: - $ref: '#/components/schemas/OneClick' type: object OrderCanCancel: + description: Whether an order can be cancelled required: - order_id - can_cancel properties: order_id: + description: Id of the order (`GET /api/v3/orders/{order_id}`) type: integer can_cancel: + description: >- + Whether the order can be cancelled with `DELETE + /api/v3/orders/{order_id}`: not when it is completed, closed or + cancelled, or when one of its purchases does not allow it type: boolean type: object OrderCanPay: + description: Whether an order can be paid, with the orders to pay together with it required: - order_id + - amount + - orders - can_pay properties: order_id: + description: Id of the order (`GET /api/v3/orders/{order_id}`) type: integer amount: - $ref: '#/components/schemas/AmountSimple' + description: >- + Amount to pay with the payment method of the request, the commission + of the method included; null when the order cannot be paid with it + anyOf: + - $ref: '#/components/schemas/AmountSimple' + - type: 'null' orders: + description: >- + Orders paid together with this one; empty when the order cannot be + paid type: array items: $ref: '#/components/schemas/Order' can_pay: + description: >- + Whether the order can be paid now with the payment method of the + request, together with the orders in `orders`: the One-Click method + is active and not expired, the prepaid credit can be used for these + orders and is enough type: boolean type: object OrderInvoiceStatus: + description: Invoicing status of an order required: - status_code - status_name properties: status_code: + description: >- + One of `UNKNOWN`, `EVALUATION`, `NO_INVOICE` (not to be invoiced), + `READY`, `PROCESSING`, `TO_INVOICE`, `INVOICING` or `INVOICED` type: string status_name: + description: Name of the status, in Italian type: string type: object OrderPaymentStatus: + description: Payment status of an order required: - status_code - status_name properties: status_code: + description: One of `NOT_PAYED`, `PARTIALLY_PAYED` or `PAYED` type: string status_name: + description: Name of the status, in Italian type: string type: object OrderRow: + description: 'Row of an order: a service of a purchase, with its price' required: - order_row_id - order_id @@ -22557,35 +19006,49 @@ components: order_row_id: type: integer order_id: + description: Id of the order (`GET /api/v3/orders/{order_id}`) type: integer service: + description: Id of the service ordered (`service_id` of `Service`) type: - integer - 'null' purchase: + description: Id of the purchase (`GET /api/v3/purchases/{purchase_id}`) type: - integer - 'null' recurrence: + description: >- + Id of the recurrence, the billing period of the row (`recurrence_id` + of `Recurrence`) type: - integer - 'null' price: $ref: '#/components/schemas/Amount' + description: Price of the row, with the promotion applied base_price: $ref: '#/components/schemas/Amount' + description: Price of the row before the promotion type: object OrderStatus: + description: Processing status of an order required: - status_code - status_name properties: status_code: + description: >- + One of `NEW`, `TO_MANAGE` (to be processed), `EMITTED` (completed), + `CANCELED` or `CLOSED` type: string status_name: + description: Name of the status shown to the customer, in Italian type: string type: object Order: + description: Order of the account, with its statuses, amounts and invoice required: - order_id - type @@ -22608,6 +19071,7 @@ components: order_id: type: integer type: + description: 'Type of the order: `P` (purchase), `R` (renewal) or `U` (update)' type: string status: $ref: '#/components/schemas/OrderStatus' @@ -22616,42 +19080,202 @@ components: invoice_status: $ref: '#/components/schemas/OrderInvoiceStatus' invoice: + description: Invoice of the order; null while the order is not invoiced anyOf: - $ref: '#/components/schemas/Invoice' - type: 'null' billing: $ref: '#/components/schemas/AccountBilling' intent_type: + description: >- + Intent of the order: `DEFAULT`, `DEPOSIT` (top-up of the prepaid + credit) or `BALANCE` (paid with the prepaid credit) type: string date_payed: + description: Date on which the order was fully paid; null while it is not + type: + - string + - 'null' + format: date + date_confirmed: + description: >- + When the order was confirmed with deferred payment, to be paid + later; null otherwise + type: + - string + - 'null' + format: date-time + payed: + description: Whether the order is fully paid + type: boolean + total_amount: + $ref: '#/components/schemas/Amount' + description: Total of the order and of the orders paid together with it + payment_amount: + $ref: '#/components/schemas/Amount' + description: >- + Amount still to pay for the order and the orders paid together with + it, VAT included except in split payment; only `amount` is set + origin: + description: >- + Where the order was created: `web` (control panel or cart), `api` + (this API), `api2` (API v2) or `cli` (automatic procedures, such as + the renewals) + type: string + promotions: + description: >- + Promotions applied to the rows of the order; those that increase the + price are shown only to administrators + type: array + items: + $ref: '#/components/schemas/Promotion' + rows_count: + description: Number of rows of the order (`GET /api/v3/orders/{order_id}/rows`) + type: integer + date_created: + type: string + format: date-time + type: object + PaymentProviderData: + description: >- + Data of an attempt of the payment, as given by the payment provider: + which fields are set, and their format, depend on the provider + required: + - payed + - authorization_token + - authorization_code + - status + - status_code + - message + - payer_name + - payer_surname + - payer_email + - bank_issuer + - creditcard_pan + - creditcard_issuer + - creditcard_expiration + - region + - transaction_type + - payment_type + - payment_date + - product_type + - nationality + properties: + payed: + description: Whether the attempt was paid + type: + - boolean + - 'null' + authorization_token: + description: Id of the authorization or of the order at the provider + type: + - string + - 'null' + authorization_code: + description: Authorization code of the transaction at the provider + type: + - string + - 'null' + status: + description: >- + Status of the attempt at the provider, for example `OK` or + `COMPLETED` + type: + - string + - 'null' + status_code: + description: >- + Result code of the provider, for example `0` or `DECLINED`; + `THRESHOLD_EXCEEDED` when the attempt was refused for the payment + limits + type: + - string + - 'null' + message: + description: Message of the provider about the result type: - string - 'null' - format: date - date_confirmed: + payer_name: + description: First name of the payer, as given by the provider + type: + - string + - 'null' + payer_surname: + description: Surname of the payer, as given by the provider + type: + - string + - 'null' + payer_email: + description: Email address of the payer, as given by the provider + type: + - string + - 'null' + bank_issuer: + description: >- + Bank of the payer: the issuer of the card or the bank of the + transfer + type: + - string + - 'null' + creditcard_pan: + description: Number of the card, masked or reduced to the last digits + type: + - string + - 'null' + creditcard_issuer: + description: Brand of the card, for example `VISA`, `MASTERCARD` or `AMEX` + type: + - string + - 'null' + creditcard_expiration: + description: >- + Expiry of the card as `YYYY-MM-DD`, the last day of its month; for + the methods without a card, the expiry set for the authorization + type: + - string + - 'null' + region: + description: Area of the card or of the payment, for example `EUROPE` or `SEPA` + type: + - string + - 'null' + transaction_type: + description: >- + Type of the transaction at the provider, for example `NO_3DSECURE`, + `DEBIT` or `TRF` (transfer) + type: + - string + - 'null' + payment_type: + description: >- + Type of the payment at the provider, for example + `PAYMENT_METHOD_TOKEN` or `CARD`; `Storno` for a payment created by + the cancellation of another one + type: + - string + - 'null' + payment_date: + description: When the transaction took place at the provider type: - string - 'null' format: date-time - payed: - type: boolean - total_amount: - $ref: '#/components/schemas/Amount' - payment_amount: - $ref: '#/components/schemas/Amount' - origin: - type: string - promotions: - type: array - items: - $ref: '#/components/schemas/Promotion' - rows_count: - type: integer - date_created: - type: string - format: date-time + product_type: + description: Product of the card as given by the provider, for example `VISA` + type: + - string + - 'null' + nationality: + description: >- + Country of the card or of the payer, as an ISO 3166-1 alpha-2 or + alpha-3 code depending on the provider + type: + - string + - 'null' type: object Payment: + description: Payment of one or more orders, with the data of the payment provider required: - payment_id - payment_method @@ -22666,30 +19290,53 @@ components: payment_id: type: integer payment_method: + description: >- + Name of the payment method, in Italian, for example `Carta di + credito` or `Bonifico Bancario` type: string payment_code: + description: >- + Unique code of the payment: `SR` followed by letters and digits, to + write in the reason of a bank transfer type: string amount_total: $ref: '#/components/schemas/AmountSimple' + description: Amount of the payment, commission of the payment method included amount_payed: $ref: '#/components/schemas/AmountSimple' + description: Amount paid so far date_payment: + description: >- + When the payment was made (the latest paid attempt); null when + nothing has been paid type: - string - 'null' format: date-time payed: + description: >- + Whether the payment is complete: `amount_payed` reaches + `amount_total` type: boolean prepaid_credit_operations: + description: >- + Uses of the prepaid credit made by the payment; empty unless the + payment is with the prepaid credit type: array items: $ref: '#/components/schemas/PrepaidCreditOperation' provider_data: - type: - - object - - 'null' + description: >- + Data of the payment provider, from the paid attempt or the latest + one; null when the payment has no attempts + anyOf: + - $ref: '#/components/schemas/PaymentProviderData' + - type: 'null' type: object PecDomain: + description: >- + Domain certified for PEC (certified email, Posta Elettronica + Certificata), whose mailboxes have its name after the `@` required: - pec_domain_id - purchase_id @@ -22707,18 +19354,30 @@ components: pec_domain_id: type: integer purchase_id: + description: >- + Id of the purchase of the PEC domain (`GET + /api/v3/purchases/{purchase_id}`) type: - integer - 'null' purchase_name: + description: >- + Name of the purchase object, as `purchase_name.object_name` of the + purchase type: - string - 'null' purchase_status_code: + description: >- + Status code of the purchase, for example `DELIVERED_V2` or `NEW_V2` + (not active yet) type: - string - 'null' purchase_pec_owner_id: + description: >- + Id of the current owner of the PEC domain, as `pec_owner_id` in the + owner changes type: - integer - 'null' @@ -22727,21 +19386,46 @@ components: - string - 'null' provider_domain_id: + description: >- + Id of the domain at Aruba, the PEC provider; null until the domain + is certified there type: - string - 'null' transfer_in: - type: boolean + description: >- + Whether the PEC domain already existed at the provider and was + transferred to us (incoming transfer) + type: + - boolean + - 'null' force_decertify_domain: + description: >- + Whether the activation is stopped because the provider refused to + certify the domain: the domain must be decertified first type: boolean aruba_public: + description: >- + Whether it is a public PEC domain of Aruba, shared by many customers + (for example `pec.it`) type: boolean shellrent_public: + description: >- + Whether it is one of our public PEC domains, shared by many + customers (for example `postacert.eu`) type: boolean can_require_owner_change: + description: >- + Whether an owner change can be requested now (`POST + /api/v3/pec-domains/{pec_domain_id}/owner-changes`): false when the + purchase is not active, when another request was not approved or + when the domain is not at the provider yet type: boolean type: object PecOwnerChange: + description: >- + Request to change the owner of a PEC mailbox or of a PEC domain, with + its documents and its status required: - owner_change_id - pec_id @@ -22754,8 +19438,6 @@ components: - has_identity_document - has_contract_document - has_order_module_document - - person_id_accept - - person_id_reject - owner_old - owner_new - date_created @@ -22765,50 +19447,61 @@ components: - integer - 'null' pec_id: + description: >- + Id of the PEC mailbox of the request (`GET + /api/v3/pec-mailboxes/{pec_id}`); null for the requests of a PEC + domain type: - integer - 'null' pec_domain_id: + description: >- + Id of the PEC domain of the request (`GET + /api/v3/pec-domains/{pec_domain_id}`); null for the requests of a + mailbox type: - integer - 'null' status_code: + description: >- + Status of the request: `PENDENT` (documents not sent yet), + `PENDENT_APPROVAL` (waiting for our approval), `APPROVED` or + `REJECTED` type: - string - 'null' rejection_reason: + description: Reason of the rejection; null unless the request was rejected type: - string - 'null' submission_date: + description: When the documents were sent; null until they are type: - string - 'null' format: date-time acceptance_date: + description: When the request was approved type: - string - 'null' format: date-time rejection_date: + description: When the request was rejected type: - string - 'null' format: date-time has_identity_document: + description: Whether the request has the identity document type: boolean has_contract_document: + description: Whether the request has the contract type: boolean has_order_module_document: + description: Whether the request has the order form type: boolean - person_id_accept: - type: - - integer - - 'null' - person_id_reject: - type: - - integer - - 'null' owner_old: $ref: '#/components/schemas/PecOwnerSummary' owner_new: @@ -22820,6 +19513,10 @@ components: format: date-time type: object PecOwnerSummary: + description: >- + Owner (titolare) of a PEC mailbox or domain: the person and, for + organizations, the data of the organization; all the fields are null + when there is no owner required: - pec_owner_id - owner_legal_entity_type @@ -22833,47 +19530,79 @@ components: - company_fiscal_code properties: pec_owner_id: + description: Id of the owner, as `owner_id` of the owner change requests type: - integer - 'null' owner_legal_entity_type: + description: >- + Legal form of the owner: `PRIVATO` (private individual), + `LIBERO_PROFESSIONISTA` (self-employed professional), + `DITTA_INDIVIDUALE` or the old `AZIENDA_DITTA_INDIVIDUALE` (sole + proprietorship), `AZIENDA` (company), `PUBBLICA_AMMINISTRAZIONE` + (public administration) or `NO_PROFIT` (non-profit organization) type: - string - 'null' admin_first_name: + description: >- + First name of the owner or, for organizations, of the person who + acts for them type: - string - 'null' admin_last_name: + description: >- + Last name of the owner or, for organizations, of the person who acts + for them type: - string - 'null' admin_email: + description: >- + Email of the owner or, for organizations, of the person who acts for + them type: - string - 'null' admin_fiscal_code: + description: >- + Codice fiscale (Italian tax code) of the owner or, for + organizations, of the person who acts for them type: - string - 'null' admin_vat_number: + description: VAT number (partita IVA) of the owner; not used for `PRIVATO` type: - string - 'null' company_name: + description: >- + Business name of the organization, for `DITTA_INDIVIDUALE`, + `AZIENDA`, `PUBBLICA_AMMINISTRAZIONE` and `NO_PROFIT` type: - string - 'null' company_email: + description: >- + Email of the organization, for `AZIENDA`, `PUBBLICA_AMMINISTRAZIONE` + and `NO_PROFIT` type: - string - 'null' company_fiscal_code: + description: >- + Codice fiscale (Italian tax code) of the organization, for + `AZIENDA`, `PUBBLICA_AMMINISTRAZIONE` and `NO_PROFIT` type: - string - 'null' type: object Pec: + description: >- + PEC (certified email, Posta Elettronica Certificata) mailbox of the + account required: - pec_id - purchase_id @@ -22896,22 +19625,37 @@ components: pec_id: type: integer purchase_id: + description: >- + Id of the purchase of the mailbox (`GET + /api/v3/purchases/{purchase_id}`) type: - integer - 'null' purchase_name: + description: >- + Name of the purchase object, as `purchase_name.object_name` of the + purchase type: - string - 'null' purchase_status_code: + description: >- + Status code of the purchase, for example `ACTIVE_V2` or `NEW_V2` + (not active yet) type: - string - 'null' box_name: + description: >- + Name of the mailbox, the part of the address before `@`; null until + it is chosen type: - string - 'null' full_box_name: + description: >- + Address of the mailbox (`box_name@domain`); empty until the name is + chosen type: - string - 'null' @@ -22920,145 +19664,125 @@ components: - string - 'null' report_email: + description: Notification email for the PEC reports of the mailbox type: - string - 'null' report_sms: + description: >- + Phone number that receives the SMS notifications of the mailbox; + null when the SMS service is not active type: - string - 'null' password_recovery_email: + description: Email used to recover the password of the mailbox type: - string - 'null' inbox_usage: + description: Space used in the inbox, in MB type: - number - 'null' format: float archive_usage: + description: Space used in the archive, in MB type: - number - 'null' format: float extra_inbox: + description: Additional inbox space bought, in GB type: - integer - 'null' extra_archive: + description: Additional archive space bought, in GB type: - integer - 'null' transfer_in: + description: >- + Whether the mailbox already existed and was transferred to us + (incoming transfer) type: boolean owner_not_assignable: + description: >- + Whether Aruba, the PEC provider, refused to assign the chosen owner + to the mailbox during the activation type: boolean password_wrong: + description: >- + Whether the password of the mailbox saved for the backups turned out + wrong; the backups need the right one type: boolean type: object - PleskLicense: - required: - - license_id - - purchase_id - - purchase_server_id - - service_name - - purchase_name - - license_ref - - key_number - - ip_address - - is_els - - operative_system - - purchase_status_code - - date_activation - - date_expiry - properties: - license_id: - type: integer - purchase_id: - type: integer - purchase_server_id: - type: - - integer - - 'null' - service_name: - type: - - string - - 'null' - purchase_name: - type: - - string - - 'null' - license_ref: - type: - - string - - 'null' - key_number: - type: - - string - - 'null' - ip_address: - type: - - string - - 'null' - is_els: - type: boolean - operative_system: - type: - - string - - 'null' - purchase_status_code: - type: - - string - - 'null' - date_activation: - type: - - string - - 'null' - format: date - date_expiry: - type: - - string - - 'null' - format: date - type: object PrepaidCreditOperation: + description: >- + Operation on the prepaid credit, such as a top-up or a payment with the + credit required: - operation_id - operation_id_related - prepaid_credit_topup - operation_type + - creditnote - amount - date_created properties: operation_id: type: integer operation_id_related: + description: >- + Id of the payment with the credit (`REDEMPTION`) that the operation + cancels, for `REDEMPTION_CANCELLATION` (`GET + /api/v3/prepaid-credit/operations/{operation_id}`); null for the + other types type: - integer - 'null' prepaid_credit_topup: $ref: '#/components/schemas/PrepaidCreditTopup' + description: Top-up whose credit the operation adds or uses operation_type: $ref: '#/components/schemas/PrepaidCreditOperationType' creditnote: - $ref: '#/components/schemas/Creditnote' + description: >- + Credit note issued for the operation, for `REFUND` and + `CREDIT_CANCELLATION`; null for the other types + anyOf: + - $ref: '#/components/schemas/Creditnote' + - type: 'null' amount: $ref: '#/components/schemas/AmountSimple' + description: >- + Amount of the operation: positive when it adds credit, negative when + it uses or removes it date_created: type: string format: date-time type: object PrepaidCreditOperationType: + description: Type of an operation on the prepaid credit required: - type_code - type_description properties: type_code: + description: >- + One of `TOP_UP`, `REDEMPTION` (payment with the credit), + `REDEMPTION_CANCELLATION`, `PAYMENT_CANCELLATION`, `REFUND`, + `CREDIT_CANCELLATION`, `RESET_CREDIT` or `RESELLER_SHOP_REFUND` type: string type_description: + description: Name of the type, in Italian type: string type: object PrepaidCreditTopup: + description: >- + Top-up of the prepaid credit, with its deposit invoice and the credit + left required: - topup_id - invoice @@ -23071,19 +19795,28 @@ components: topup_id: type: integer invoice: + description: Deposit invoice of the top-up; null until it is issued anyOf: - $ref: '#/components/schemas/Invoice' - type: 'null' initial_credit: $ref: '#/components/schemas/AmountSimple' + description: Credit loaded by the top-up, VAT included current_credit: $ref: '#/components/schemas/AmountSimple' + description: Credit of the top-up not used yet refund_expiry: + description: >- + Last day on which the credit left can be refunded; null when there + is no limit type: - string - 'null' format: date credit_expiry: + description: >- + Expiry date of the credit of the top-up; null when it does not + expire type: - string - 'null' @@ -23093,6 +19826,7 @@ components: format: date-time type: object PrepaidCredit: + description: Prepaid credit of the account, with its alert threshold required: - credit_amount - credit_threshold @@ -23101,15 +19835,22 @@ components: credit_amount: $ref: '#/components/schemas/AmountSimple' credit_threshold: + description: >- + Alert threshold: when the credit falls below it, the customer + receives an email; null without a threshold anyOf: - $ref: '#/components/schemas/AmountSimple' - type: 'null' threshold_exceeded: + description: Whether the credit is below the threshold; null without a threshold type: - boolean - 'null' type: object PrivateCloud: + description: >- + Private cloud, with the resources of its plan and the limits of its + virtual machines required: - purchase_id - server_id @@ -23129,69 +19870,98 @@ components: - max_disk_backup properties: purchase_id: + description: >- + Id of the purchase of the private cloud (`GET + /api/v3/purchases/{purchase_id}`) type: integer server_id: + description: >- + Id of the server of the private cloud (`GET + /api/v3/servers/{server_id}`) type: - integer - 'null' max_vm: + description: Maximum number of virtual machines of the private cloud type: - integer - 'null' available_vm: + description: >- + Number of virtual machines that can still be created: `max_vm` minus + the current ones type: - integer - 'null' max_cpu: + description: Total vCPUs of the private cloud, `cpu_overallocation` included type: - integer - 'null' cpu_overallocation: + description: >- + vCPUs of `max_cpu` that come from overallocation (extra cores); null + when the private cloud has none type: - integer - 'null' min_vm_cpu: + description: Minimum vCPUs of a virtual machine type: - integer - 'null' max_vm_cpu: + description: Maximum vCPUs of a virtual machine type: - integer - 'null' max_ram: + description: Total RAM of the private cloud, in MB type: - integer - 'null' min_vm_ram: + description: Minimum RAM of a virtual machine, in MB type: - integer - 'null' max_vm_ram: + description: Maximum RAM of a virtual machine, in MB type: - integer - 'null' max_disk: + description: Total disk space of the private cloud, in GB type: - integer - 'null' min_vm_disk: + description: Minimum disk space of a virtual machine, in GB type: - integer - 'null' max_vm_disk: + description: Maximum disk space of a virtual machine, in GB type: - integer - 'null' max_backup: + description: Total backup space of the private cloud, in GB type: - integer - 'null' max_disk_backup: + description: >- + Daily backup space of the private cloud, in GB: the disk space of + its virtual machines with the daily backup cannot go beyond it type: - integer - 'null' type: object Promotion: + description: >- + Promotion applied to a row of an order: of the `percentage_*` and + `amount_*` fields, only the one of its type is set required: - promocode - description @@ -23204,96 +19974,147 @@ components: - date_applied properties: promocode: + description: >- + Promotional code used; null when the promotion applies without a + code type: - string - 'null' description: - type: string + description: Promotion description; null when the promotion has none + type: + - string + - 'null' percentage_increase: + description: Price increase, in percent; null for the other types type: - number - 'null' format: float percentage_decrease: + description: Discount, in percent; null for the other types type: - number - 'null' format: float amount_increase: + description: Price increase, as an amount before VAT; null for the other types anyOf: - $ref: '#/components/schemas/Amount' - type: 'null' amount_decrease: + description: Discount, as an amount before VAT; null for the other types anyOf: - $ref: '#/components/schemas/Amount' - type: 'null' amount_fixed: + description: >- + Fixed price set by the promotion, before VAT; null for the other + types anyOf: - $ref: '#/components/schemas/Amount' - type: 'null' applied_amount: + description: >- + Difference between the base price and the price of the order row + (`base_price` and `price` of `OrderRow`): negative when the + promotion increases the price anyOf: - $ref: '#/components/schemas/Amount' - type: 'null' date_applied: + description: When the promotion was applied to the order type: string format: date-time type: object PurchaseCanAddAdditional: + description: >- + Whether additional services can be bought for the purchase, with the + services available required: - purchase_id - can_add_additional - services properties: purchase_id: + description: Id of the purchase (`GET /api/v3/purchases/{purchase_id}`) type: integer can_add_additional: + description: Whether additional services can be bought for the purchase now type: boolean services: - description: Collection of Services to which it is possible to make the change. + description: >- + Additional services that can be bought for the purchase; empty when + `can_add_additional` is false type: array items: $ref: '#/components/schemas/Service' type: object PurchaseCanCancel: + description: >- + Whether the purchase can be cancelled (`DELETE + /api/v3/purchases/{purchase_id}`) required: - purchase_id - can_cancel properties: purchase_id: + description: Id of the purchase (`GET /api/v3/purchases/{purchase_id}`) type: integer can_cancel: + description: >- + Whether the purchase can be cancelled: only before its activation, + and if its additional purchases can be cancelled too type: boolean type: object PurchaseCanChangeRecurrence: + description: >- + Whether the recurrence of the purchase can be changed (`PATCH + /api/v3/purchases/{purchase_id}/recurrence`) required: - purchase_id - can_change_recurrence properties: purchase_id: + description: Id of the purchase (`GET /api/v3/purchases/{purchase_id}`) type: integer can_change_recurrence: + description: >- + Whether the recurrence can be changed to the one in the + `recurrence_id` query parameter type: boolean type: object PurchaseCanChangeRenewStatus: + description: >- + Whether the renew status of the purchase can be changed (`PATCH + /api/v3/purchases/{purchase_id}/renew-status`) required: - purchase_id - can_change_renew_status properties: purchase_id: + description: Id of the purchase (`GET /api/v3/purchases/{purchase_id}`) type: integer can_change_renew_status: + description: >- + Whether the renew status can be set to the one in the `status` query + parameter type: boolean type: object PurchaseCanChangeService: + description: >- + Whether the service of the purchase can be changed (plan change), with + the services available required: - purchase_id - can_change_service - services properties: purchase_id: + description: Id of the purchase (`GET /api/v3/purchases/{purchase_id}`) type: integer can_change_service: + description: Whether the purchase allows a change of service now type: boolean services: description: Collection of Services to which it is possible to make the change. @@ -23302,16 +20123,27 @@ components: $ref: '#/components/schemas/ServiceChange' type: object PurchaseCanRenew: + description: >- + Whether the purchase can be renewed now (`POST + /api/v3/purchases/{purchase_id}/renewals`) required: - purchase_id - can_renew properties: purchase_id: + description: Id of the purchase (`GET /api/v3/purchases/{purchase_id}`) type: integer can_renew: + description: >- + Whether the purchase can be renewed now: possible from + `recurrence.days_renew` days before the expiry, when it is set to + renew and has no pending order type: boolean type: object PurchaseName: + description: >- + Names of the purchase: the name of the service, the name of its object + and the two together required: - name - full_name @@ -23325,16 +20157,24 @@ components: type: string object_name: description: Name of the purchase object (ie. domain name, server hostname, etc.) - type: string + type: + - string + - 'null' type: object PurchaseProvisioningStatus: + description: Operation in progress on the purchase, such as its activation or renewal required: - status_code - status_name properties: status_code: + description: >- + Code of the operation in progress: `SLEEPY` (none), `TO_ACTIVATE`, + `TO_RENEW`, `TO_SUSPEND`, `TO_RESUME` (reactivation), `TO_DISMISS` + or `TO_CANCEL` type: string status_name: + description: Name of the operation in progress, in Italian type: string type: object PurchaseStatus: @@ -23343,11 +20183,20 @@ components: - status_name properties: status_code: + description: >- + Status code: `NEW_V2` (just created), `ACTIVE_V2` (active), + `DELIVERED_V2` (active without renewals), `DISMISSED_V2` (at the end + of its life), `CANCELED_V2` (cancelled before the activation) or + `DELETED_V2` (deleted one-off purchase) type: string status_name: + description: Name of the status, in Italian type: string type: object Purchase: + description: >- + Purchase of a service, with its status, prices, recurrence, billing data + and the resources linked to it required: - purchase_id - account @@ -23383,7 +20232,6 @@ components: - monitoring_id - license_id - microsoft365_id - - securemail_id - cloud_storage_id - object_storage_id - veeam_baas_id @@ -23436,15 +20284,21 @@ components: description: Current purchase quantity (instances). type: integer activation_price: - $ref: '#/components/schemas/Amount' - description: Purchase price. + description: Purchase price; null for sub-accounts. + anyOf: + - $ref: '#/components/schemas/Amount' + - type: 'null' renew_price: - description: Renew price (applied on recurring purchases only). + description: >- + Renew price (applied on recurring purchases only); null for + sub-accounts. anyOf: - $ref: '#/components/schemas/Amount' - type: 'null' restore_price: - description: Restore/reactivation price (applied on domains only). + description: >- + Restore/reactivation price (applied on domains only); null for + sub-accounts. anyOf: - $ref: '#/components/schemas/Amount' - type: 'null' @@ -23480,7 +20334,9 @@ components: type: boolean comment: description: User comment (will be included in invoice description). - type: string + type: + - string + - 'null' billing_data: $ref: '#/components/schemas/BillingData' description: Billing data (ODA, CIG, CUP...). @@ -23539,11 +20395,6 @@ components: type: - integer - 'null' - securemail_id: - description: ID of the SecureMail by LibraESVA associated with this purchase. - type: - - integer - - 'null' cloud_storage_id: description: ID of the cloud storage associated with this purchase. type: @@ -23565,16 +20416,30 @@ components: format: date-time type: object RecurrenceFrequency: + description: >- + Frequency of a recurrence: a number of years, months or weeks, or a + one-off charge required: - family - value properties: family: + description: >- + Unit of the frequency: `Y` (years), `M` (months), `W` (weeks) or `U` + (one-off, without renewals) type: string value: - type: integer + description: >- + Number of units of the frequency, for example 12 with `M`; null with + `U` + type: + - integer + - 'null' type: object Recurrence: + description: >- + Billing recurrence: its frequency and, in days, the timings of renewal, + suspension and dismission required: - recurrence_id - frequency @@ -23593,162 +20458,101 @@ components: frequency: $ref: '#/components/schemas/RecurrenceFrequency' days_renew: + description: >- + Days before the expiry from which the purchase can be renewed and + the renewal order is created type: - integer - 'null' days_autorenew: + description: Days before the expiry when the automatic renewal is attempted type: - integer - 'null' days_suspension: + description: >- + Days after the expiry when a purchase not renewed is suspended; null + if it is not suspended type: - integer - 'null' days_restore: + description: >- + Days after the expiry from which the restore price is charged in + addition to the renewal price type: - integer - 'null' days_dismission: + description: Days after the expiry when a purchase not renewed is dismissed + type: + - integer + - 'null' + days_cancel: + description: >- + Days after the start of the activation when a purchase never + activated is cancelled automatically type: - integer - 'null' - days_cancel: - type: integer days_renew_dismission: + description: >- + Days after the expiry when a purchase whose renewal was not + completed is dismissed automatically type: - integer - 'null' days_no_secondary: + description: >- + Days before the expiry from which additional services can no longer + be bought for the purchase type: - integer - 'null' days_no_service_change: + description: >- + Days before the expiry from which the service of the purchase can no + longer be changed type: - integer - 'null' type: object SdiDocumentStatus: + description: >- + Status of an electronic document on SDI (`Sistema di Interscambio`), the + Italian e-invoicing exchange system required: - status_code - status_name properties: status_code: + description: >- + One of `TO_SIGN`, `TO_SEND`, `SENT`, `DELIVERED`, `NOT_DELIVERED` or + `DISCARDED` (rejected by SDI) type: string status_name: + description: Name of the status, in Italian type: string type: object SdiDocumentType: + description: >- + Type of an electronic document on SDI, the Italian e-invoicing exchange + system (`TipoDocumento`) required: - type_code - type_description properties: type_code: + description: >- + Code of the type, for example `TD01` (invoice), `TD02` (deposit + invoice) or `TD04` (credit note) type: string type_description: - type: string - type: object - SecuremailMailbox: - required: - - mailbox_id - - email_address - - status - - is_primary - - valid_recipient_id - - aliases_count - properties: - mailbox_id: - type: integer - email_address: - type: - - string - - 'null' - status: - type: - - string - - 'null' - is_primary: - type: boolean - valid_recipient_id: - type: - - integer - - 'null' - aliases_count: - type: integer - type: object - SecuremailStatistics: - required: - - quantity - - protected_mailboxes - - not_protected_mailboxes - - weekly_elaborated_messages - - weekly_spam_messages - - weekly_blocked_spam_percentage - properties: - quantity: - type: integer - protected_mailboxes: - type: integer - not_protected_mailboxes: - type: integer - weekly_elaborated_messages: - type: integer - weekly_spam_messages: - type: integer - weekly_blocked_spam_percentage: - type: integer - type: object - Securemail: - required: - - securemail_id - - purchase_id - - service_name - - purchase_name - - purchase_status_code - - quantity - - domain - - relay_to - - relay_to_port - - is_feasible - - provider - properties: - securemail_id: - type: integer - purchase_id: - type: integer - service_name: - type: - - string - - 'null' - purchase_name: - type: - - string - - 'null' - purchase_status_code: - type: - - string - - 'null' - quantity: - type: - - integer - - 'null' - domain: - type: - - string - - 'null' - relay_to: - type: - - string - - 'null' - relay_to_port: - type: - - integer - - 'null' - is_feasible: - type: boolean - provider: + description: Description of the type, in Italian type: string type: object ServerAutomaticSnapshot: + description: Schedule of the automatic snapshots of a server required: - snapshot_id - server_id @@ -23758,21 +20562,28 @@ components: - is_active properties: snapshot_id: + description: Id of the schedule (not of a snapshot) type: integer server_id: + description: Id of the server (`GET /api/v3/servers/{server_id}`) type: integer name: + description: Name of the snapshots that the schedule creates type: string days_of_week: + description: Days of the week of the snapshots, from 1 (Monday) to 7 (Sunday) type: array items: type: integer hour_of_day: + description: Time of the snapshots, in 24-hour `HH:MM` format type: string is_active: + description: Whether the schedule is active type: boolean type: object ServerBackup: + description: Backup of a server that the customer can see required: - server_backup_id - backup_recurrent_id @@ -23791,69 +20602,99 @@ components: - exit_status - error_type - date_created - - backup_path - checksum - - backup_path_parent - backup_user_visibility properties: server_backup_id: type: integer backup_recurrent_id: + description: >- + Id of the run of the recurrent backup that made the backup; null for + a one-off backup type: - integer - 'null' backup_server_id_parent: + description: >- + Id of the backup this one is based on, for incremental backups; null + otherwise type: - integer - 'null' server_id: - type: integer + description: Id of the backed up server (`GET /api/v3/servers/{server_id}`) + type: + - integer + - 'null' cluster_id_server_residence: + description: Id of the cluster where the server resides type: - integer - 'null' cluster_id_backup_residence: + description: Id of the cluster where the backup is kept type: - integer - 'null' backup_type_id: + description: Id of the backup type type: - integer - 'null' backup_mode: + description: >- + Strategy of the backup type: `FULL`, `INC` (incremental) or `DIFF` + (differential) type: - string - 'null' backup_frequency_id: + description: Id of the frequency of the backup type type: - integer - 'null' backup_type_code: + description: >- + Code of the backup type, for example `CLOUD_DAILY`, `CLOUD_WEEKLY` + or `CLOUD_UNA_TANTUM` (one-off) type: - string - 'null' backup_frequency_code: + description: >- + Frequency of the backup type: `D` daily, `W` weekly, `HM` twice a + month, `M` monthly, `HY` every six months, `Y` yearly, `C` one-off, + `R` private cloud replication type: - string - 'null' backup_date: + description: Date the backup was taken type: - string - 'null' format: date-time backup_size: + description: Size of the backup, in MB type: - integer - 'null' backup_duration: + description: >- + Duration of the backup, as text in the `H:MM:SS` form, preceded by + the days for longer backups (for example `1 day, 2:03:04`) type: - string - 'null' exit_status: + description: 'Exit status of the backup: `0` if it succeeded' type: - integer - 'null' error_type: + description: >- + Error of the backup, as a code or a message (for example + `DOWNLOAD_DISK_FAILED`); `N.A.` when it succeeded type: - string - 'null' @@ -23862,34 +20703,37 @@ components: - string - 'null' format: date-time - backup_path: - type: - - string - - 'null' checksum: - type: - - string - - 'null' - backup_path_parent: + description: Checksum of the backup, sent by the backup scripts; null if not sent type: - string - 'null' backup_user_visibility: + description: >- + Whether the customer can see the backup: only the most recent + successful backups of each type are visible, as many as the + retention of the type, and only those are returned type: - boolean - 'null' type: object ServerCanAction: + description: Result of the check of a power action of the server required: - server_id - can_action properties: server_id: + description: Id of the server (`GET /api/v3/servers/{server_id}`) type: integer can_action: + description: >- + Whether the power action can start now with `POST + /api/v3/servers/{server_id}/power-actions` type: boolean type: object ServerCredential: + description: Root credentials of the server required: - type - username @@ -23897,19 +20741,26 @@ components: - visible properties: type: + description: 'Type of the credentials: always `root`' type: string username: + description: Username of the root user of the server; null when it is not set type: - string - 'null' password: + description: Password of the root user; null when `visible` is false type: - string - 'null' visible: + description: >- + Whether `password` is returned: false when the root password is not + set or is not visible to the customer type: boolean type: object ServerMonitoringProbeChart: + description: Values measured by a probe of a server monitoring in the last day required: - server_monitoring_id - probe_id @@ -23917,15 +20768,28 @@ components: - points properties: server_monitoring_id: + description: >- + Id of the server monitoring (`GET + /api/v3/server-monitorings/{server_monitoring_id}`) type: integer probe_id: + description: >- + Id of the probe (`GET + /api/v3/server-monitorings/{server_monitoring_id}/probes/{probe_id}`) type: integer interval: + description: >- + Period covered by the chart, as an ISO 8601 duration: always `P1D`, + the last day type: string example: P1D points: + description: Values measured by the probe in the period, in time order type: array items: + required: + - x + - 'y' properties: x: description: UNIX timestamp in milliseconds @@ -23938,6 +20802,9 @@ components: type: object type: object ServerMonitoringProbe: + description: >- + Probe of a server monitoring: a check of the monitored host, with its + state and its notification contacts required: - probe_id - server_monitoring_id @@ -23960,59 +20827,109 @@ components: probe_id: type: integer server_monitoring_id: + description: >- + Id of the server monitoring of the probe (`GET + /api/v3/server-monitorings/{server_monitoring_id}`) type: integer template_id: + description: >- + Id of the probe template, the `server_monitoring_item_template_id` + of `POST /api/v3/server-monitorings/{server_monitoring_id}/probes` type: - integer - 'null' template_code: + description: >- + Code of the probe template, for example `SERVER_DOWN`, + `HTTP_SERVICE_DOWN` or `FREE_DISK_SPACE` type: - string - 'null' template_name: + description: Name of the probe template type: - string - 'null' monitoring_item_id: + description: >- + Id of the item of the probe in the monitoring system (Zabbix); null + until the probe is created there type: - integer - 'null' monitoring_trigger_id: + description: >- + Id of the trigger of the probe in the monitoring system (Zabbix); + null until it is created there type: - integer - 'null' is_default: + description: >- + Whether it is the default probe of the monitoring, the ICMP check of + the host (template `SERVER_DOWN`) type: boolean advanced_item: + description: >- + Whether the probe counts towards `probe_limit` of the monitoring, + like the probes added with `POST + /api/v3/server-monitorings/{server_monitoring_id}/probes`; the + statistics probes do not type: boolean is_error: - type: boolean + description: >- + Whether the probe is in error; null when no problem was detected or + the solved problem has already been notified + type: + - boolean + - 'null' monitoring_item_disabled: + description: Whether the probe is disabled in the monitoring system type: boolean action_enabled: + description: >- + Whether the automatic action of the probe is enabled; the actions + run only on the `plus` monitorings type: boolean notification_email: + description: >- + Email address that receives the notifications of the probe; empty or + null when the probe sends no email type: - string - 'null' notification_sms: + description: >- + Phone number that receives the notifications of the probe by SMS, an + Italian number without the international prefix; empty or null when + the probe sends no SMS type: - string - 'null' date_problem: + description: >- + When the last problem detected by the probe started; null when there + is no problem type: - string - 'null' format: date-time date_last_notification: + description: >- + When the last notification of the problem was sent; null when none + was sent for the current problem type: - string - 'null' format: date-time active: + description: 'Whether the probe is active: the endpoints return only active probes' type: boolean type: object ServerMonitoring: + description: >- + Server monitoring service of the account, with the host it checks and + its settings required: - server_monitoring_id - purchase_monitoring_id @@ -24034,59 +20951,102 @@ components: server_monitoring_id: type: integer purchase_monitoring_id: + description: >- + Id of the purchase of the monitoring service (`GET + /api/v3/purchases/{purchase_id}`) type: - integer - 'null' purchase_server_id: + description: >- + Id of the purchase of the monitored server (`GET + /api/v3/purchases/{purchase_id}`); null when the monitoring checks a + hostname or an IP address type: - integer - 'null' service_name: + description: Name of the service of the monitoring purchase type: - string - 'null' purchase_name: + description: >- + Name of the object of the monitoring purchase, usually the monitored + hostname or IP address type: - string - 'null' purchase_status_code: + description: >- + Status code of the monitoring purchase, for example `ACTIVE_V2` or + `NEW_V2` (not active yet) type: - string - 'null' monitoring_key: + description: >- + Host checked by the monitoring: the hostname of the monitored + server, or the hostname or IP address given type: - string - 'null' is_server_monitored: + description: >- + Whether the monitoring checks a server, given by its purchase + (`purchase_server_id`) or by its hostname type: boolean is_ip_monitored: + description: Whether the monitoring checks an IP address type: boolean is_external_device_monitored: + description: >- + Whether the monitoring checks an external device, given by hostname + or IP address instead of a server or an IP address of the account type: boolean monitoring_host_enabled: + description: Whether the monitoring of the host is enabled type: boolean monitoring_type: + description: >- + Type of the monitoring: `default` (Base) or `plus` (Managed), which + can also run the automatic actions of the probes type: - string - 'null' probe_limit: + description: >- + Maximum number of probes of the monitoring, counting the probes with + `advanced_item` type: - integer - 'null' severity_level: + description: >- + Severity of the problems detected by the probes: `default`, `high` + or `disaster` type: - string - 'null' email_notification: + description: >- + Default email address for the notifications of the probes; each + probe has its own (`notification_email`) type: - string - 'null' sms_notification: + description: >- + Default phone number for the SMS notifications of the probes; each + probe has its own (`notification_sms`) type: - string - 'null' type: object ServerNetworkInterface: + description: >- + Network interface (VIF) of a virtual machine, on a public or a local + network required: - network_interface_id - server_id @@ -24106,48 +21066,76 @@ components: network_interface_id: type: integer server_id: + description: >- + Id of the server of the interface (`GET + /api/v3/servers/{server_id}`) type: integer network_id: + description: >- + Id of the network of the interface: for a local network, the + `network_id` accepted by `POST + /api/v3/servers/{server_id}/network-interfaces` type: - integer - 'null' ip_address_id: + description: >- + Id of the IP address of the interface (`GET + /api/v3/servers/{server_id}/ip-addresses/{ip_address_id}`); always + null on a local network type: - integer - 'null' vif_uuid: + description: UUID of the interface on the hypervisor type: - string - 'null' device_name: + description: >- + Device of the interface: usually its number (`0` for `eth0`), + otherwise a name such as `ens3` type: - string - 'null' mac_address: + description: MAC address of the interface type: - string - 'null' is_default: + description: >- + Whether it is the default interface of the server, which cannot be + deleted type: - boolean - 'null' is_active: + description: >- + Whether the interface is active: the endpoints return only active + interfaces type: - boolean - 'null' network_type: + description: 'Type of the network: `P` for public, `L` for local' type: - string - 'null' network_label: + description: Name of the network type: - string - 'null' network_bridge: + description: >- + Bridge of the network on the hypervisor, for example `xenbr0`; + `N.D.` when the hypervisor does not report it type: - string - 'null' ip_address: + description: IP address of the interface; null when `ip_address_id` is null type: - string - 'null' @@ -24158,6 +21146,9 @@ components: format: date-time type: object ServerOs: + description: >- + Operating system that can be installed with a server template, with its + minimum requirements required: - os_code - os_name @@ -24166,8 +21157,12 @@ components: - min_disk properties: os_code: + description: >- + Code of the operating system, to send as `SERVER_TEMPLATE_CODE` in + `data` when buying the service type: string os_name: + description: Name of the operating system type: string min_ram: description: Min RAM (GB), for VPS/VM only @@ -24186,6 +21181,7 @@ components: - 'null' type: object ServerSnapshot: + description: Snapshot of a virtual server required: - snapshot_id - server_id @@ -24198,18 +21194,28 @@ components: snapshot_id: type: integer server_id: + description: Id of the server (`GET /api/v3/servers/{server_id}`) type: integer snapshot_name: type: - string - 'null' snapshot_reference: + description: >- + Id of the snapshot on the virtualization platform; null until the + snapshot is created type: - string - 'null' active: + description: >- + Whether the snapshot is active: false once it is deleted or expired. + The list returns only active snapshots type: boolean date_expiry: + description: >- + Date after which the snapshot is deleted automatically; null if it + does not expire type: - string - 'null' @@ -24221,6 +21227,9 @@ components: format: date-time type: object ServerTemplate: + description: >- + Server template that can be chosen when buying the service, with the + operating systems compatible with it required: - template_code - template_name @@ -24231,10 +21240,15 @@ components: - operative_systems properties: template_code: + description: >- + Code of the server template, to send as `SERVER_CONFIGURATION_CODE` + in `data` when buying the service type: string template_name: + description: Short name of the server template type: string template_name_alternative: + description: Longer name of the server template; null when it has none type: - string - 'null' @@ -24260,6 +21274,9 @@ components: $ref: '#/components/schemas/ServerOs' type: object Server: + description: >- + Server of the account: dedicated server, cloud server, private cloud or + virtual machine of a private cloud required: - server_id - purchase_id @@ -24275,6 +21292,9 @@ components: server_id: type: integer purchase_id: + description: >- + Id of the purchase of the server (`GET + /api/v3/purchases/{purchase_id}`) type: - integer - 'null' @@ -24283,22 +21303,36 @@ components: - string - 'null' server_type: + description: >- + Type of the server: `PH` for a dedicated (physical) server, `VM` for + a virtual machine, `HV` for a hypervisor or a private cloud type: - string - 'null' active: + description: 'Whether the server is active: false once it has been deleted' type: boolean consolidated: + description: Whether the server is ready, with its provisioning complete type: boolean ip_address_id: + description: >- + Id of the primary IP address of the server (`GET + /api/v3/servers/{server_id}/ip-addresses/{ip_address_id}`) type: - integer - 'null' ip_address: + description: Primary IP address of the server type: - string - 'null' service_category_code: + description: >- + Code of the service category of the server: `DEDICATED` (dedicated + server), `CLOUD` (Cloud Server), `CLOUD_SERVER_IOPS` (Cloud VPS), + `CLOUD_SERVER_HA` (Cloud Server HA), `PRIVATE_CLOUD` (private cloud) + or `PRIVATE_CLOUD_VM` (virtual machine of a private cloud) type: - string - 'null' @@ -24316,15 +21350,24 @@ components: - area_name properties: category_code: + description: Code of the category, for example `PEC` or `CLOUD_STORAGE` type: string category_name: + description: Name of the category, in Italian type: string area_code: - type: string + description: >- + Code of the area that groups the category, for example `HOSTING`, + `DOMAIN` or `LICENSE` + type: + - string + - 'null' area_name: + description: Name of the area, in Italian type: string type: object ServiceChange: + description: Service the purchase can change to, with the price of the change required: - service - activation_price @@ -24333,19 +21376,142 @@ components: $ref: '#/components/schemas/Service' activation_price: $ref: '#/components/schemas/Amount' + description: >- + Price of the change to this service, computed on the time left + before the renewal of the purchase + type: object + ServiceServer: + description: >- + Server service of the price list, with the templates and operating + systems it can be bought with + required: + - service_id + - service_category + - service_name + - recurrence + - recurrences_available + - tld_id + - service_code + - service_url + - activation_price + - renew_price + - restore_price + - transfer_price + - is_primary + - is_secondary + - is_presale + - is_aftersale + - is_quantifiable + - quantity_min + - quantity_max + - templates + properties: + service_id: + type: integer + service_category: + $ref: '#/components/schemas/ServiceCategory' + service_name: + description: Name of the service, in Italian + type: string + recurrence: + $ref: '#/components/schemas/Recurrence' + recurrences_available: + description: >- + Recurrences that can be chosen when buying the service + (`recurrence_id`) + type: array + items: + $ref: '#/components/schemas/Recurrence' + tld_id: + description: >- + Id of the TLD of a domain service (`GET /api/v3/tlds/{tld_id}`); + null for the other services + type: + - integer + - 'null' + service_code: + description: >- + Code of the service, for example `DEDICATED_SERVER_ADVANCE` or + `CLOUD_VPS_STD_IOPS` + type: string + service_url: + description: URL of the cart page of the service + type: string + activation_price: + $ref: '#/components/schemas/Amount' + description: Activation price of the price list + renew_price: + description: Renew price of the price list; null when the service has none + anyOf: + - $ref: '#/components/schemas/Amount' + - type: 'null' + restore_price: + description: Restore price of the price list; null when the service has none + anyOf: + - $ref: '#/components/schemas/Amount' + - type: 'null' + transfer_price: + description: Transfer price of the price list; null when the service has none + anyOf: + - $ref: '#/components/schemas/Amount' + - type: 'null' + is_primary: + description: Whether the service can be sold as a primary service + type: + - boolean + - 'null' + is_secondary: + description: Whether the service is an additional service of a primary one + type: + - boolean + - 'null' + is_presale: + description: >- + Whether the service can be bought as an additional service together + with its primary service (presale) + type: + - boolean + - 'null' + is_aftersale: + description: >- + Whether the service can be bought as an additional service after the + activation of its primary service (aftersale) + type: + - boolean + - 'null' + is_quantifiable: + description: >- + Whether the service can be added to the cart more than once; the + quantity of one purchase is set by `quantity_min` and `quantity_max` + type: + - boolean + - 'null' + quantity_min: + description: Minimum quantity of the service in one purchase + type: + - integer + - 'null' + quantity_max: + description: >- + Maximum quantity of the service in one purchase; null when the + quantity cannot be chosen + type: + - integer + - 'null' + templates: + description: >- + Server templates compatible with the service, with their operating + systems: `template_code` and `os_code` are the values of + `SERVER_CONFIGURATION_CODE` and `SERVER_TEMPLATE_CODE` when buying + it + type: array + items: + $ref: '#/components/schemas/ServerTemplate' type: object - ServiceServer: - required: - - templates - allOf: - - $ref: '#/components/schemas/Service' - - properties: - templates: - type: array - items: - $ref: '#/components/schemas/ServerTemplate' - type: object Service: + description: >- + Service of the price list, with its category, recurrences, prices and + purchase options required: - service_id - service_category @@ -24372,65 +21538,104 @@ components: service_category: $ref: '#/components/schemas/ServiceCategory' service_name: + description: Name of the service, in Italian type: string recurrence: $ref: '#/components/schemas/Recurrence' recurrences_available: + description: >- + Recurrences that can be chosen when buying the service + (`recurrence_id`) type: array items: $ref: '#/components/schemas/Recurrence' tld_id: + description: >- + Id of the TLD of a domain service (`GET /api/v3/tlds/{tld_id}`); + null for the other services type: - integer - 'null' service_code: + description: Code of the service, for example `CLOUD_STORAGE_100` or `BOX_PEC` type: string service_url: + description: URL of the cart page of the service type: string activation_price: - $ref: '#/components/schemas/Amount' + description: Activation price of the price list; null for sub-accounts + anyOf: + - $ref: '#/components/schemas/Amount' + - type: 'null' renew_price: + description: >- + Renew price of the price list; null when the service has none and + for sub-accounts anyOf: - $ref: '#/components/schemas/Amount' - type: 'null' restore_price: + description: >- + Restore price of the price list; null when the service has none and + for sub-accounts anyOf: - $ref: '#/components/schemas/Amount' - type: 'null' transfer_price: + description: >- + Transfer price of the price list; null when the service has none and + for sub-accounts anyOf: - $ref: '#/components/schemas/Amount' - type: 'null' is_primary: + description: Whether the service can be sold as a primary service type: - boolean - 'null' is_secondary: + description: Whether the service is an additional service of a primary one type: - boolean - 'null' is_presale: + description: >- + Whether the service can be bought as an additional service together + with its primary service (presale) type: - boolean - 'null' is_aftersale: + description: >- + Whether the service can be bought as an additional service after the + activation of its primary service (aftersale) type: - boolean - 'null' is_quantifiable: + description: >- + Whether the service can be added to the cart more than once; the + quantity of one purchase is set by `quantity_min` and `quantity_max` type: - boolean - 'null' quantity_min: + description: Minimum quantity of the service in one purchase type: - integer - 'null' quantity_max: + description: >- + Maximum quantity of the service in one purchase; null when the + quantity cannot be chosen type: - integer - 'null' type: object SmsAccount: + description: >- + SMS credit of the account, with the estimated number of SMS it is enough + for required: - credit - sms_standard @@ -24450,29 +21655,39 @@ components: type: integer type: object SmsCanCancel: + description: >- + Whether the sending of an SMS can be cancelled (`POST + /api/v3/sms/{sms_id}/cancellation`) required: - sms_id - can_cancel properties: sms_id: + description: Id of the SMS (`GET /api/v3/sms/{sms_id}`) type: integer can_cancel: + description: 'Whether the sending can be cancelled: only while it is `PROCESSING`' type: boolean type: object SmsCanDelete: + description: Whether an SMS can be deleted (`DELETE /api/v3/sms/{sms_id}`) required: - sms_id - can_delete properties: sms_id: + description: Id of the SMS (`GET /api/v3/sms/{sms_id}`) type: integer can_delete: + description: 'Whether the SMS can be deleted: only a `DRAFT`' type: boolean type: object SmsMessage: + description: Message of an SMS sending to one recipient, with its delivery data required: - id - sms_id + - sms_price - contact_name - phone_number - date_sent @@ -24482,21 +21697,35 @@ components: id: type: integer sms_id: + description: Id of the SMS sending (`GET /api/v3/sms/{sms_id}`) type: integer sms_price: - $ref: '#/components/schemas/SmsPrice' + description: Price list of the destination country; null for sub-accounts + anyOf: + - $ref: '#/components/schemas/SmsPrice' + - type: 'null' contact_name: + description: >- + Surname and name of the recipient, when taken from a phonebook; + otherwise empty or null type: - string - 'null' phone_number: + description: >- + Phone number of the recipient in international format with the `00` + prefix, for example `00393331122444` type: string date_sent: + description: Date and time the message was sent; null until it is sent type: - string - 'null' format: date-time date_delivered: + description: >- + Date and time the message was delivered; null until the delivery is + confirmed type: - string - 'null' @@ -24508,6 +21737,7 @@ components: - 'null' type: object SmsPhonebookContact: + description: Contact of the SMS phonebooks of the account required: - id - phonebooks @@ -24520,12 +21750,18 @@ components: id: type: integer phonebooks: + description: >- + Ids of the phonebooks that contain the contact (`GET + /api/v3/sms-phonebooks/{phonebook_id}`) type: array items: type: integer country: $ref: '#/components/schemas/Country' phone_number: + description: >- + Phone number without the international prefix: the country is in + `country` type: string name: type: @@ -24542,6 +21778,7 @@ components: format: date type: object SmsPhonebook: + description: Phonebook of SMS recipients of the account required: - id - name @@ -24554,9 +21791,13 @@ components: - string - 'null' contacts_count: + description: >- + Number of contacts in the phonebook (`GET + /api/v3/sms-phonebooks/{phonebook_id}/contacts`) type: integer type: object SmsPrice: + description: Prices of an SMS sent to a country, for each delivery quality required: - country - standard_price @@ -24570,12 +21811,16 @@ components: premium_price: $ref: '#/components/schemas/Amount' valid_from: + description: Date and time from which these prices apply type: - string - 'null' format: date-time type: object Sms: + description: >- + SMS sending of the account: one message to one or more recipients (`GET + /api/v3/sms/{sms_id}/messages`) required: - id - quality @@ -24591,10 +21836,16 @@ components: id: type: integer quality: + description: 'Delivery quality: `STANDARD` or `PREMIUM`' type: string status: + description: >- + Status of the sending: `DRAFT` (not confirmed), `PROCESSING` (being + sent), `ACCOMPLISHED` (all the messages sent) or `CANCELLED` + (sending stopped) type: string sender: + description: Sender name, for the `PREMIUM` quality type: - string - 'null' @@ -24603,21 +21854,27 @@ components: - string - 'null' send_from: + description: Date and time from which the messages are sent type: - string - 'null' format: date-time date_approved: + description: Date and time the sending was confirmed; null for a `DRAFT` type: - string - 'null' format: date-time stop_date: + description: Date and time the sending was stopped; null if it was not type: - string - 'null' format: date-time sms_count: + description: >- + Number of SMS the message takes for each recipient: a long text is + split into several SMS type: - integer - 'null' @@ -24626,6 +21883,9 @@ components: format: date-time type: object SslCertificateApproverEmails: + description: >- + Email addresses that can approve the validation of a domain name + (`approver_email` of the certificate) required: - domain_name - approver_emails @@ -24633,21 +21893,33 @@ components: domain_name: type: string approver_emails: + description: >- + Addresses `admin`, `webmaster`, `hostmaster`, `postmaster` and + `administrator` at the domain name and at each of its parent domains type: array items: type: string type: object - SslCertificateCanReemit: + SslCertificateCanReissue: + description: Whether a certificate can be reissued now required: - ssl_certificate_id - - can_reemit + - can_reissue properties: ssl_certificate_id: type: integer - can_reemit: + can_reissue: + description: >- + Whether the certificate can be reissued now (`POST + /api/v3/ssl-certificates/{ssl_certificate_id}/reissues`): it + includes reissues, its purchase is active with no operation running + and no other reissue is in progress type: boolean type: object SslCertificateExportFormat: + description: >- + Format in which a certificate and its keys can be exported (`POST + /api/v3/ssl-certificates/{ssl_certificate_id}/exports`) required: - format - name @@ -24657,6 +21929,10 @@ components: - requires_passphrase properties: format: + description: >- + Code of the format, for `format` of the export: one of `PK`, `CERT`, + `CERT_PEM`, `CA`, `CA_PEM`, `CERT_CA`, `CERT_CA_PEM`, `PK_CERT_CA`, + `MULTI_ZIP`, `HASH_SHA256` or `HASH_SHA512` type: string name: type: string @@ -24665,26 +21941,42 @@ components: - string - 'null' filename: + description: Name of the exported file, for example `certificate.pem` type: string available: + description: >- + Whether the certificate can be exported in this format; otherwise + the export is rejected with 409 type: boolean requires_passphrase: + description: >- + Whether the format takes `passphrase` of the export request, which + protects the file: true for `PK` and `PK_CERT_CA` type: boolean type: object SslCertificateExport: + description: >- + File with the certificate or its keys in the requested format, encoded + in base64 required: - format - filename - content_base64 properties: format: + description: >- + Code of the exported format, as in the request; `MULTI_ZIP` when the + file is a ZIP archive type: string filename: + description: Name to give to the file, for example `certificate.pem` type: string content_base64: + description: Content of the file, encoded in base64 type: string type: object SslCertificateKey: + description: CSR of a certificate required: - ssl_certificate_id - csr @@ -24692,11 +21984,15 @@ components: ssl_certificate_id: type: integer csr: + description: CSR of the certificate, in PEM format (the custom one, when set) type: - string - 'null' type: object SslCertificateKeys: + description: >- + Keys of a certificate in PEM format: CSR, private key, issued + certificate and certificate of the intermediate authority required: - ssl_certificate_id - csr @@ -24707,23 +22003,36 @@ components: ssl_certificate_id: type: integer csr: + description: CSR of the certificate, in PEM format (the custom one, when set) type: - string - 'null' private_key: + description: >- + Private key of the certificate, in PEM format (the custom one, when + set) type: - string - 'null' public_key: + description: >- + Certificate issued by the certification authority, in PEM format; + empty until it is issued type: - string - 'null' certificate_authority: + description: >- + Certificate of the intermediate certification authority, in PEM + format; empty until the certificate is issued type: - string - 'null' type: object SslCertificate: + description: >- + SSL or code signing certificate of the account, with its validation data + and its administrative contact required: - ssl_certificate_id - purchase_id @@ -24754,95 +22063,151 @@ components: ssl_certificate_id: type: integer purchase_id: + description: >- + Id of the purchase of the certificate (`GET + /api/v3/purchases/{purchase_id}`) type: integer domain_name: type: - string - 'null' cn_type: + description: >- + Type of the common name: `NORMAL` (a single name) or `WILDCARD` (a + wildcard name, for the subdomains) type: - string - 'null' validation_type: + description: >- + Validation level: `DV` (domain validation), `OV` (organization + validation) or `EV` (extended validation) type: - string - 'null' san_max: + description: >- + Maximum number of additional names (SAN, Subject Alternative Names) + the certificate can include type: integer can_reissue: + description: >- + Whether the certificate includes reissues; `GET + /api/v3/ssl-certificates/{ssl_certificate_id}/can-reissue` tells + whether one can start now type: boolean validation_method: + description: >- + How the domain is validated: `APPROVER_EMAIL` (by email to + `approver_email`) or `DNS` (with a CNAME record that we add to the + zone of the domain, see `csr_md5_hash`) type: - string - 'null' valid_to: + description: Expiry of the certificate, at the end of the day (Italian time) type: - string - 'null' format: date-time csr_md5_hash: + description: >- + MD5 hash of the CSR for the DNS validation, in uppercase + hexadecimal: the name of the CNAME record is `_` followed by this + hash; null without a DNS validation type: - string - 'null' csr_sha256_hash: + description: >- + SHA-256 hash of the CSR for the DNS validation, in uppercase + hexadecimal split in two by a dot: the destination of the CNAME + record starts with it; null without a DNS validation type: - string - 'null' certificate_status: + description: >- + Status of the certificate at the certification authority, for + example `Issued`, `Expired`, `Rejected` or `Revoked` type: - string - 'null' approver_email: + description: >- + Address that receives the request to approve the validation of the + domain, with the `APPROVER_EMAIL` method (see `GET + /api/v3/ssl-certificates/approver-emails`) type: - string - 'null' format: email admin_first_name: + description: First name of the administrative contact of the certificate type: - string - 'null' admin_last_name: + description: Last name of the administrative contact type: - string - 'null' admin_organization: + description: Organization of the administrative contact type: - string - 'null' admin_role: + description: >- + Role of the administrative contact: `Business Owner`, `Website + Owner`, `President` or `Company Director` type: - string - 'null' admin_email: + description: Email of the administrative contact type: - string - 'null' format: email admin_phone_cc: + description: >- + International dialling code of the phone of the administrative + contact, for example `39` type: - string - 'null' admin_phone_number: + description: >- + Phone number of the administrative contact, without the dialling + code type: - string - 'null' admin_address: + description: Address of the administrative contact type: - string - 'null' admin_city: + description: City of the administrative contact type: - string - 'null' admin_state: + description: State or province of the administrative contact type: - string - 'null' admin_postal_code: + description: Postal code of the administrative contact type: - string - 'null' admin_country: + description: >- + Country of the administrative contact, as ISO 3166-1 alpha-2 code + (for example `IT`) type: - string - 'null' @@ -24853,11 +22218,22 @@ components: - status_name properties: status_code: + description: >- + Status code: `TO_EXECUTE` (queued), `MACHINE` (running), `WAIT` + (paused), `HUMAN_INTERVENTION` (checked by an operator), `ASK_USER` + (waiting for data, `POST /api/v3/tasks/{task_id}/data`), `DONE` + (completed) or `FAIL` (failed) type: string status_name: + description: >- + Name of the status for the customers, in Italian, as in the control + panel (for example `In verifica` for `HUMAN_INTERVENTION`) type: string type: object Task: + description: >- + Operation on a purchase that goes on in the background, with its status + and progress (`GET /api/v3/tasks/{task_id}`) required: - task_id - purchase_id @@ -24865,33 +22241,48 @@ components: - executed_instructions - total_instructions - is_started + - ask_user_error - date_started properties: task_id: type: integer purchase_id: + description: >- + Id of the purchase the task works on (`GET + /api/v3/purchases/{purchase_id}`) type: integer task_status: $ref: '#/components/schemas/TaskStatus' executed_instructions: + description: >- + Number of the step reached by the task, out of `total_instructions`: + equal to it when the task is done or failed type: - integer - 'null' total_instructions: + description: Total number of steps of the task type: - integer - 'null' is_started: + description: Whether the execution of the task has started type: boolean ask_user_error: + description: >- + Error found in the data provided for the task, null when there is + none: the corrected data are sent with `POST + /api/v3/tasks/{task_id}/data` type: - string - 'null' date_started: + description: Date and time the task was created type: string format: date-time type: object TaxRegime: + description: 'Tax regime: how VAT applies to the documents' required: - regime_code - regime_name @@ -24899,14 +22290,23 @@ components: - tax_rate properties: regime_code: + description: >- + One of `ORDINARY`, `SPLIT_PAYMENT`, `EU_VIES`, `EU_EXPORTER` + (habitual exporter), `EXTRA_EU`, `VATICAN`, `SANMARINO` or `ART_26` type: string regime_name: + description: Name of the regime, in Italian, for example `Ordinario` type: string code_edocument: + description: >- + Nature code of the operation on the electronic invoice (`Natura`) + when VAT is not applied, for example `N2.1`; null for the regimes + with VAT type: - string - 'null' tax_rate: + description: VAT rate as a fraction, for example `0.22` for 22% type: number format: float type: object @@ -24932,6 +22332,9 @@ components: type: string type: object Tld: + description: >- + TLD (domain extension), with the rules for the names and for the + contacts of its domains required: - tld_id - extension @@ -24957,55 +22360,101 @@ components: tld_id: type: integer extension: + description: >- + Extension without the leading dot, in Unicode (for example `it` or + `co.uk`) type: string punycode: + description: Extension in punycode type: string country: + description: >- + Country of the TLD, for the country-code TLDs (ccTLD); null for the + others anyOf: - $ref: '#/components/schemas/Country' - type: 'null' char_min: + description: Minimum length of the name, without the extension type: - integer - 'null' char_max: + description: Maximum length of the name, without the extension type: - integer - 'null' hyphen_allowed: + description: Whether the name can contain hyphens type: boolean number_allowed: + description: Whether the name can contain numbers type: boolean punycode_allowed: + description: Whether the name can contain international characters (IDN) type: boolean dnssec_enabled: + description: Whether the TLD supports DNSSEC type: boolean rdap_enabled: + description: Whether the availability of the names is checked with RDAP type: boolean rdap_url: - type: string + description: URL of the RDAP service used for the TLD; null when not set + type: + - string + - 'null' contact_data: + description: >- + Fields of the contact data of the domains of the TLD, with their + type and allowed values (the authcode excluded) type: array items: $ref: '#/components/schemas/TldContactSpecification' update_contact_r: - type: boolean + description: >- + Whether the registrant contact (`R`) can be changed (`PATCH + /api/v3/domains/{domain_id}/contacts/{domain_contact_id}`) + type: + - boolean + - 'null' update_contact_a: - type: boolean + description: Whether the administrative contact (`A`) can be changed + type: + - boolean + - 'null' update_contact_t: - type: boolean + description: Whether the technical contact (`T`) can be changed + type: + - boolean + - 'null' update_contact_o: - type: boolean + description: Whether the organization contact (`O`) can be changed + type: + - boolean + - 'null' update_contact_additional: + description: >- + Whether a change of the contacts must also send the additional data + of the TLD to the registry type: boolean update_contact_transfer: + description: >- + Whether a transfer must also send the additional data of the TLD to + the registry type: boolean transfer_authcode: + description: Whether the transfer of a domain of the TLD requires the authcode type: boolean type: object ApiUpload: + description: >- + File uploaded with `POST /api/v3/uploads`, to reference by its + `upload_id` in the calls that take a document, such as the PEC transfer + documents required: - upload_id + - mimetype - filename - original_filename - file_extension @@ -25014,22 +22463,32 @@ components: upload_id: type: integer mimetype: - type: string + description: >- + MIME type associated with the extension of the file, for example + `application/pdf` + type: + - string + - 'null' filename: + description: Name given to the file by the service when storing it type: string original_filename: + description: Name of the file as uploaded by the client type: - string - 'null' file_extension: + description: Extension of the file name, in lowercase, for example `pdf` type: - string - 'null' upload_date: + description: Date and time of the upload type: string - format: date + format: date-time type: object WebMonitoringAvailabilityChart: + description: Availability of the monitored site in the last hour required: - web_monitoring_id - interval @@ -25038,14 +22497,30 @@ components: - points properties: web_monitoring_id: + description: >- + Id of the web monitoring (`GET + /api/v3/web-monitorings/{web_monitoring_id}`) type: integer interval: + description: >- + Period covered by the chart, as an ISO 8601 duration: always `PT1H`, + the last hour type: string example: PT1H unit: + description: >- + Unit of the `y` values: always `status`, a code explained in + `legend` type: string example: status legend: + description: >- + Codes of the `y` values: 0 up, 1 down (HTTP 5xx), 2 warning (HTTP + 4xx) + required: + - up + - down + - warning properties: up: type: integer @@ -25058,8 +22533,12 @@ components: example: 2 type: object points: + description: Checks of the last hour, one point per check type: array items: + required: + - x + - 'y' properties: x: description: UNIX timestamp in milliseconds @@ -25071,6 +22550,7 @@ components: type: object type: object WebMonitoringDownloadSpeedChart: + description: Download speed of the monitored site in the last hour required: - web_monitoring_id - interval @@ -25078,16 +22558,27 @@ components: - points properties: web_monitoring_id: + description: >- + Id of the web monitoring (`GET + /api/v3/web-monitorings/{web_monitoring_id}`) type: integer interval: + description: >- + Period covered by the chart, as an ISO 8601 duration: always `PT1H`, + the last hour type: string example: PT1H unit: + description: 'Unit of the `y` values: always `KB/s`' type: string example: KB/s points: + description: Download speeds measured in the last hour, one point per check type: array items: + required: + - x + - 'y' properties: x: description: UNIX timestamp in milliseconds @@ -25100,6 +22591,7 @@ components: type: object type: object WebMonitoringNotices: + description: Notice settings of a web monitoring required: - web_monitoring_id - notification_email @@ -25107,19 +22599,34 @@ components: - send_ssl_notify properties: web_monitoring_id: + description: >- + Id of the web monitoring (`GET + /api/v3/web-monitorings/{web_monitoring_id}`) type: integer notification_email: + description: >- + Email address for the notices of the monitoring (site down or back + up, SSL expiry); without it no email notice is sent type: - string - 'null' notification_sms: + description: >- + Italian mobile number for the SMS notices, without the international + prefix; without it no SMS is sent type: - string - 'null' send_ssl_notify: - type: boolean + description: >- + Whether the notices of the expiry of the SSL certificate of the site + are sent + type: + - boolean + - 'null' type: object WebMonitoringResponseTimeChart: + description: Response time of the monitored site in the last hour required: - web_monitoring_id - interval @@ -25127,16 +22634,27 @@ components: - points properties: web_monitoring_id: + description: >- + Id of the web monitoring (`GET + /api/v3/web-monitorings/{web_monitoring_id}`) type: integer interval: + description: >- + Period covered by the chart, as an ISO 8601 duration: always `PT1H`, + the last hour type: string example: PT1H unit: + description: 'Unit of the `y` values: always `ms`' type: string example: ms points: + description: Response times measured in the last hour, one point per check type: array items: + required: + - x + - 'y' properties: x: description: UNIX timestamp in milliseconds @@ -25149,6 +22667,9 @@ components: type: object type: object WebMonitoring: + description: >- + Monitoring of a website: checks of the availability of the domain, and + notices required: - web_monitoring_id - purchase_id @@ -25172,18 +22693,26 @@ components: web_monitoring_id: type: integer purchase_id: + description: >- + Id of the purchase of the monitoring (`GET + /api/v3/purchases/{purchase_id}`) type: - integer - 'null' service_name: + description: Name of the service of the purchase type: - string - 'null' purchase_name: + description: 'Name of the object of the purchase: the monitored domain' type: - string - 'null' purchase_status_code: + description: >- + Status code of the purchase, for example `ACTIVE_V2` or + `DISMISSED_V2` type: - string - 'null' @@ -25192,204 +22721,79 @@ components: - string - 'null' host_ref: + description: Id of the monitored host on the monitoring system type: - string - 'null' web_scenario_ref: + description: Id of the check of the site (web scenario) on the monitoring system type: - string - 'null' status: + description: >- + Status of the site: `healthy`, `problem` (a recent check got an HTTP + status outside 2xx) or `frequent_problem` type: - string - 'null' email_notification: + description: >- + Email address for the notices of the monitoring (site down or back + up, SSL expiry); without it no email notice is sent type: - string - 'null' sms_notification: + description: >- + Italian mobile number for the SMS notices, without the international + prefix; without it no SMS is sent type: - string - - 'null' - ips: - type: - - string - - 'null' - ip_isp: - type: - - string - - 'null' - ip_location: - type: - - string - - 'null' - last_http_response: - type: - - integer - - 'null' - last_down_date: - type: - - string - - 'null' - format: date-time - send_ssl_notify: - type: boolean - active: - type: boolean - type: object - HealthStatusResponse: - type: object - required: - - error - - message - - data - - meta - properties: - error: - type: integer - example: 0 - message: - type: - - string - - 'null' - data: - $ref: '#/components/schemas/HealthStatus' - meta: - type: - - object - - 'null' - EmptyResponse: - type: object - required: - - error - - message - - data - - meta - properties: - error: - type: integer - example: 0 - message: - type: - - string - - 'null' - data: - type: - - object - - 'null' - meta: - type: - - object - - 'null' - AccountResponse: - type: object - required: - - error - - message - - data - - meta - properties: - error: - type: integer - example: 0 - message: - type: - - string - - 'null' - data: - $ref: '#/components/schemas/Account' - meta: - type: - - object - - 'null' - CreditnotePaginatedListResponse: - type: object - required: - - error - - message - - data - - meta - properties: - error: - type: integer - example: 0 - message: - type: - - string - - 'null' - data: - type: array - items: - $ref: '#/components/schemas/Creditnote' - meta: - $ref: '#/components/schemas/PaginationMeta' - CreditnoteResponse: - type: object - required: - - error - - message - - data - - meta - properties: - error: - type: integer - example: 0 - message: + - 'null' + ips: + description: IP address the monitored domain resolves to type: - string - 'null' - data: - $ref: '#/components/schemas/Creditnote' - meta: + ip_isp: + description: Internet service provider of the IP address type: - - object + - string - 'null' - CreditnoteRowListResponse: - type: object - required: - - error - - message - - data - - meta - properties: - error: - type: integer - example: 0 - message: + ip_location: + description: >- + Country of the IP address, as ISO 3166-1 alpha-2 code (for example + `IT`) type: - string - 'null' - data: - type: array - items: - $ref: '#/components/schemas/CreditnoteRow' - meta: + last_http_response: + description: HTTP status code of the last check, for example `200` type: - - object + - integer - 'null' - CreditnoteRowResponse: - type: object - required: - - error - - message - - data - - meta - properties: - error: - type: integer - example: 0 - message: + last_down_date: + description: Last time a check found the site down (HTTP status outside 2xx) type: - string - 'null' - data: - $ref: '#/components/schemas/CreditnoteRow' - meta: + format: date-time + send_ssl_notify: + description: >- + Whether the notices of the expiry of the SSL certificate of the site + are sent type: - - object + - boolean + - 'null' + active: + description: Whether the monitoring is active + type: + - boolean - 'null' - DomainPaginatedListResponse: type: object + AccountPaginatedListResponse: + description: Successful response with a page of `Account` required: - error - message @@ -25397,20 +22801,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: + description: 'Items of the page: an empty list beyond the last page' type: array items: - $ref: '#/components/schemas/Domain' + $ref: '#/components/schemas/Account' meta: $ref: '#/components/schemas/PaginationMeta' - DomainResponse: + description: Pagination of the list type: object + AccountResponse: + description: Successful response with one `Account` required: - error - message @@ -25418,20 +22827,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/Domain' + $ref: '#/components/schemas/Account' + description: Resource returned by the operation meta: - type: - - object - - 'null' - DomainAvailabilityResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + ApiUploadResponse: + description: Successful response with one `ApiUpload` required: - error - message @@ -25439,20 +22851,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/DomainAvailability' + $ref: '#/components/schemas/ApiUpload' + description: Resource returned by the operation meta: - type: - - object - - 'null' - DomainDnssecResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + CloudStorageAccessPaginatedListResponse: + description: Successful response with a page of `CloudStorageAccess` required: - error - message @@ -25460,20 +22875,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/DomainDnssec' + description: 'Items of the page: an empty list beyond the last page' + type: array + items: + $ref: '#/components/schemas/CloudStorageAccess' meta: - type: - - object - - 'null' - TaskResponse: + $ref: '#/components/schemas/PaginationMeta' + description: Pagination of the list type: object + CloudStorageAccessResponse: + description: Successful response with one `CloudStorageAccess` required: - error - message @@ -25481,20 +22901,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/Task' + $ref: '#/components/schemas/CloudStorageAccess' + description: Resource returned by the operation meta: - type: - - object - - 'null' - DomainDnssecCanActivateResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + CloudStoragePaginatedListResponse: + description: Successful response with a page of `CloudStorage` required: - error - message @@ -25502,20 +22925,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/DomainDnssecCanActivate' + description: 'Items of the page: an empty list beyond the last page' + type: array + items: + $ref: '#/components/schemas/CloudStorage' meta: - type: - - object - - 'null' - DomainDnssecCanDeactivateResponse: + $ref: '#/components/schemas/PaginationMeta' + description: Pagination of the list type: object + CloudStorageResponse: + description: Successful response with one `CloudStorage` required: - error - message @@ -25523,20 +22951,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/DomainDnssecCanDeactivate' + $ref: '#/components/schemas/CloudStorage' + description: Resource returned by the operation meta: - type: - - object - - 'null' - DnsZoneResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + CloudStorageUserListResponse: + description: Successful response with a list of `CloudStorageUser` required: - error - message @@ -25544,20 +22975,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/DnsZone' + description: Items returned by the operation + type: array + items: + $ref: '#/components/schemas/CloudStorageUser' meta: - type: - - object - - 'null' - DomainCanChangeNameserversResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + CloudStorageUserResponse: + description: Successful response with one `CloudStorageUser` required: - error - message @@ -25565,20 +23001,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/DomainCanChangeNameservers' + $ref: '#/components/schemas/CloudStorageUser' + description: Resource returned by the operation meta: - type: - - object - - 'null' - DnsRecordPaginatedListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + CreditnotePaginatedListResponse: + description: Successful response with a page of `Creditnote` required: - error - message @@ -25586,20 +23025,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: + description: 'Items of the page: an empty list beyond the last page' type: array items: - $ref: '#/components/schemas/DnsRecord' + $ref: '#/components/schemas/Creditnote' meta: - $ref: '#/components/schemas/SimplePaginationMeta' - DnsRecordResponse: + $ref: '#/components/schemas/PaginationMeta' + description: Pagination of the list type: object + CreditnoteResponse: + description: Successful response with one `Creditnote` required: - error - message @@ -25607,20 +23051,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/DnsRecord' + $ref: '#/components/schemas/Creditnote' + description: Resource returned by the operation meta: - type: - - object - - 'null' - DomainContactListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + CreditnoteRowListResponse: + description: Successful response with a list of `CreditnoteRow` required: - error - message @@ -25628,22 +23075,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: + description: Items returned by the operation type: array items: - $ref: '#/components/schemas/DomainContact' + $ref: '#/components/schemas/CreditnoteRow' meta: - type: - - object - - 'null' - DomainContactResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + CreditnoteRowResponse: + description: Successful response with one `CreditnoteRow` required: - error - message @@ -25651,20 +23101,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/DomainContact' + $ref: '#/components/schemas/CreditnoteRow' + description: Resource returned by the operation meta: - type: - - object - - 'null' - HostingPaginatedListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + DnsRecordPaginatedListResponse: + description: Successful response with a page of `DnsRecord` required: - error - message @@ -25672,20 +23125,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: + description: 'Items of the page: an empty list beyond the last page' type: array items: - $ref: '#/components/schemas/Hosting' + $ref: '#/components/schemas/DnsRecord' meta: - $ref: '#/components/schemas/PaginationMeta' - HostingResponse: + $ref: '#/components/schemas/SimplePaginationMeta' + description: Pagination of the list, without the totals type: object + DnsRecordResponse: + description: Successful response with one `DnsRecord` required: - error - message @@ -25693,20 +23151,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/Hosting' + $ref: '#/components/schemas/DnsRecord' + description: Resource returned by the operation meta: - type: - - object - - 'null' - HostingCredentialListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + DnsZoneResponse: + description: Successful response with one `DnsZone` required: - error - message @@ -25714,22 +23175,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - type: array - items: - $ref: '#/components/schemas/HostingCredential' + $ref: '#/components/schemas/DnsZone' + description: Resource returned by the operation meta: - type: - - object - - 'null' - HostingDnsRecordListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + DomainAvailabilityResponse: + description: Successful response with one `DomainAvailability` required: - error - message @@ -25737,22 +23199,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - type: array - items: - $ref: '#/components/schemas/HostingDnsRecord' + $ref: '#/components/schemas/DomainAvailability' + description: Resource returned by the operation meta: - type: - - object - - 'null' - HostingDatabaseListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + DomainCanChangeNameserversResponse: + description: Successful response with one `DomainCanChangeNameservers` required: - error - message @@ -25760,22 +23223,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - type: array - items: - $ref: '#/components/schemas/HostingDatabase' + $ref: '#/components/schemas/DomainCanChangeNameservers' + description: Resource returned by the operation meta: - type: - - object - - 'null' - HostingDatabaseResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + DomainContactListResponse: + description: Successful response with a list of `DomainContact` required: - error - message @@ -25783,20 +23247,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/HostingDatabase' + description: Items returned by the operation + type: array + items: + $ref: '#/components/schemas/DomainContact' meta: - type: - - object - - 'null' - HostingEmailAliasListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + DomainContactResponse: + description: Successful response with one `DomainContact` required: - error - message @@ -25804,22 +23273,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - type: array - items: - $ref: '#/components/schemas/HostingEmailAlias' + $ref: '#/components/schemas/DomainContact' + description: Resource returned by the operation meta: - type: - - object - - 'null' - HostingEmailAliasResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + DomainDetailResponse: + description: Successful response with one `DomainDetail` required: - error - message @@ -25827,20 +23297,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/HostingEmailAlias' + $ref: '#/components/schemas/DomainDetail' + description: Resource returned by the operation meta: - type: - - object - - 'null' - HostingEmailCatchAllResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + DomainDnssecCanActivateResponse: + description: Successful response with one `DomainDnssecCanActivate` required: - error - message @@ -25848,20 +23321,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/HostingEmailCatchAll' + $ref: '#/components/schemas/DomainDnssecCanActivate' + description: Resource returned by the operation meta: - type: - - object - - 'null' - HostingEmailAllowListPaginatedListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + DomainDnssecCanDeactivateResponse: + description: Successful response with one `DomainDnssecCanDeactivate` required: - error - message @@ -25869,20 +23345,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - type: array - items: - $ref: '#/components/schemas/HostingEmailAllowList' + $ref: '#/components/schemas/DomainDnssecCanDeactivate' + description: Resource returned by the operation meta: - $ref: '#/components/schemas/PaginationMeta' - HostingEmailAllowListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + DomainDnssecResponse: + description: Successful response with one `DomainDnssec` required: - error - message @@ -25890,20 +23369,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/HostingEmailAllowList' + $ref: '#/components/schemas/DomainDnssec' + description: Resource returned by the operation meta: - type: - - object - - 'null' - HostingEmailBlocListPaginatedListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + DomainPaginatedListResponse: + description: Successful response with a page of `Domain` required: - error - message @@ -25911,41 +23393,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: + description: 'Items of the page: an empty list beyond the last page' type: array items: - $ref: '#/components/schemas/HostingEmailBlocList' + $ref: '#/components/schemas/Domain' meta: $ref: '#/components/schemas/PaginationMeta' - HostingEmailBlocListResponse: - type: object - required: - - error - - message - - data - - meta - properties: - error: - type: integer - example: 0 - message: - type: - - string - - 'null' - data: - $ref: '#/components/schemas/HostingEmailBlocList' - meta: - type: - - object - - 'null' - HostingCronjobPaginatedListResponse: + description: Pagination of the list type: object + EmptyResponse: + description: Successful response without data required: - error - message @@ -25953,20 +23419,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' - data: - type: array - items: - $ref: '#/components/schemas/HostingCronjob' + data: + description: 'Always null: the operation returns no data' + const: null meta: - $ref: '#/components/schemas/PaginationMeta' - HostingCronjobResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + HealthStatusResponse: + description: Successful response with one `HealthStatus` required: - error - message @@ -25974,20 +23443,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/HostingCronjob' + $ref: '#/components/schemas/HealthStatus' + description: Resource returned by the operation meta: - type: - - object - - 'null' - HostingModSecurityResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + HostingAntivirusNullableResponse: + description: Successful response with one `HostingAntivirus`, or null required: - error - message @@ -25995,20 +23467,27 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/HostingModSecurity' + description: >- + Resource returned by the operation, or null: the description of the + response says when + anyOf: + - $ref: '#/components/schemas/HostingAntivirus' + - type: 'null' meta: - type: - - object - - 'null' - HostingModSecurityScanPaginatedListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + HostingAntivirusRemovalScanPaginatedListResponse: + description: Successful response with a page of `HostingAntivirusRemovalScan` required: - error - message @@ -26016,20 +23495,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: + description: 'Items of the page: an empty list beyond the last page' type: array items: - $ref: '#/components/schemas/HostingModSecurityScan' + $ref: '#/components/schemas/HostingAntivirusRemovalScan' meta: $ref: '#/components/schemas/PaginationMeta' - HostingModSecurityScanResponse: + description: Pagination of the list type: object + HostingAntivirusRemovalScanResponse: + description: Successful response with one `HostingAntivirusRemovalScan` required: - error - message @@ -26037,20 +23521,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/HostingModSecurityScan' + $ref: '#/components/schemas/HostingAntivirusRemovalScan' + description: Resource returned by the operation meta: - type: - - object - - 'null' - HostingModSecurityRuleListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + HostingAntivirusScanPaginatedListResponse: + description: Successful response with a page of `HostingAntivirusScan` required: - error - message @@ -26058,22 +23545,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: + description: 'Items of the page: an empty list beyond the last page' type: array items: - $ref: '#/components/schemas/HostingModSecurityRule' + $ref: '#/components/schemas/HostingAntivirusScan' meta: - type: - - object - - 'null' - HostingModSecurityRuleResponse: + $ref: '#/components/schemas/PaginationMeta' + description: Pagination of the list type: object + HostingAntivirusScanResponse: + description: Successful response with one `HostingAntivirusScan` required: - error - message @@ -26081,20 +23571,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/HostingModSecurityRule' + $ref: '#/components/schemas/HostingAntivirusScan' + description: Resource returned by the operation meta: - type: - - object - - 'null' - HostingPhpVersionListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + HostingBackupListResponse: + description: Successful response with a list of `HostingBackup` required: - error - message @@ -26102,22 +23595,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: + description: Items returned by the operation type: array items: - $ref: '#/components/schemas/HostingPhpVersion' + $ref: '#/components/schemas/HostingBackup' meta: - type: - - object - - 'null' - HostingAntivirusScanPaginatedListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + HostingBackupResponse: + description: Successful response with one `HostingBackup` required: - error - message @@ -26125,20 +23621,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - type: array - items: - $ref: '#/components/schemas/HostingAntivirusScan' + $ref: '#/components/schemas/HostingBackup' + description: Resource returned by the operation meta: - $ref: '#/components/schemas/PaginationMeta' - HostingAntivirusScanResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + HostingCredentialListResponse: + description: Successful response with a list of `HostingCredential` required: - error - message @@ -26146,20 +23645,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/HostingAntivirusScan' + description: Items returned by the operation + type: array + items: + $ref: '#/components/schemas/HostingCredential' meta: - type: - - object - - 'null' - HostingAntivirusRemovalScanPaginatedListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + HostingCronjobPaginatedListResponse: + description: Successful response with a page of `HostingCronjob` required: - error - message @@ -26167,20 +23671,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: + description: 'Items of the page: an empty list beyond the last page' type: array items: - $ref: '#/components/schemas/HostingAntivirusRemovalScan' + $ref: '#/components/schemas/HostingCronjob' meta: $ref: '#/components/schemas/PaginationMeta' - HostingAntivirusRemovalScanResponse: + description: Pagination of the list type: object + HostingCronjobResponse: + description: Successful response with one `HostingCronjob` required: - error - message @@ -26188,20 +23697,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/HostingAntivirusRemovalScan' + $ref: '#/components/schemas/HostingCronjob' + description: Resource returned by the operation meta: - type: - - object - - 'null' - HostingSslCertificateListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + HostingDatabaseListResponse: + description: Successful response with a list of `HostingDatabase` required: - error - message @@ -26209,22 +23721,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: + description: Items returned by the operation type: array items: - $ref: '#/components/schemas/HostingSslCertificate' + $ref: '#/components/schemas/HostingDatabase' meta: - type: - - object - - 'null' - HostingSslCertificateResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + HostingDatabaseResponse: + description: Successful response with one `HostingDatabase` required: - error - message @@ -26232,20 +23747,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/HostingSslCertificate' + $ref: '#/components/schemas/HostingDatabase' + description: Resource returned by the operation meta: - type: - - object - - 'null' - HostingBackupListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + HostingDnsRecordListResponse: + description: Successful response with a list of `HostingDnsRecord` required: - error - message @@ -26253,22 +23771,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: + description: Items returned by the operation type: array items: - $ref: '#/components/schemas/HostingBackup' + $ref: '#/components/schemas/HostingDnsRecord' meta: - type: - - object - - 'null' - HostingBackupResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + HostingEmailAliasListResponse: + description: Successful response with a list of `HostingEmailAlias` required: - error - message @@ -26276,20 +23797,49 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/HostingBackup' + description: Items returned by the operation + type: array + items: + $ref: '#/components/schemas/HostingEmailAlias' meta: + description: 'Always null: only the paginated lists have a `meta`' + const: null + type: object + HostingEmailAliasResponse: + description: Successful response with one `HostingEmailAlias` + required: + - error + - message + - data + - meta + properties: + error: + description: Always 0 in a successful response + type: integer + const: 0 + message: + description: Always null in a successful response type: - - object + - string - 'null' - InvoicePaginatedListResponse: + data: + $ref: '#/components/schemas/HostingEmailAlias' + description: Resource returned by the operation + meta: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + HostingEmailAllowListPaginatedListResponse: + description: Successful response with a page of `HostingEmailAllowList` required: - error - message @@ -26297,20 +23847,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: + description: 'Items of the page: an empty list beyond the last page' type: array items: - $ref: '#/components/schemas/Invoice' + $ref: '#/components/schemas/HostingEmailAllowList' meta: $ref: '#/components/schemas/PaginationMeta' - InvoiceResponse: + description: Pagination of the list type: object + HostingEmailAllowListResponse: + description: Successful response with one `HostingEmailAllowList` required: - error - message @@ -26318,20 +23873,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/Invoice' + $ref: '#/components/schemas/HostingEmailAllowList' + description: Resource returned by the operation meta: - type: - - object - - 'null' - InvoiceRowListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + HostingEmailBlockListPaginatedListResponse: + description: Successful response with a page of `HostingEmailBlockList` required: - error - message @@ -26339,22 +23897,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: + description: 'Items of the page: an empty list beyond the last page' type: array items: - $ref: '#/components/schemas/InvoiceRow' + $ref: '#/components/schemas/HostingEmailBlockList' meta: - type: - - object - - 'null' - InvoiceRowResponse: + $ref: '#/components/schemas/PaginationMeta' + description: Pagination of the list type: object + HostingEmailBlockListResponse: + description: Successful response with one `HostingEmailBlockList` required: - error - message @@ -26362,20 +23923,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/InvoiceRow' + $ref: '#/components/schemas/HostingEmailBlockList' + description: Resource returned by the operation meta: - type: - - object - - 'null' - PleskLicensePaginatedListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + HostingEmailCatchAllResponse: + description: Successful response with one `HostingEmailCatchAll` required: - error - message @@ -26383,20 +23947,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - type: array - items: - $ref: '#/components/schemas/PleskLicense' + $ref: '#/components/schemas/HostingEmailCatchAll' + description: Resource returned by the operation meta: - $ref: '#/components/schemas/PaginationMeta' - CpanelLicensePaginatedListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + HostingModSecurityResponse: + description: Successful response with one `HostingModSecurity` required: - error - message @@ -26404,20 +23971,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - type: array - items: - $ref: '#/components/schemas/CpanelLicense' + $ref: '#/components/schemas/HostingModSecurity' + description: Resource returned by the operation meta: - $ref: '#/components/schemas/PaginationMeta' - CpanelLicenseResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + HostingModSecurityRuleListResponse: + description: Successful response with a list of `HostingModSecurityRule` required: - error - message @@ -26425,20 +23995,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/CpanelLicense' + description: Items returned by the operation + type: array + items: + $ref: '#/components/schemas/HostingModSecurityRule' meta: - type: - - object - - 'null' - PleskLicenseResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + HostingModSecurityRuleResponse: + description: Successful response with one `HostingModSecurityRule` required: - error - message @@ -26446,20 +24021,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/PleskLicense' + $ref: '#/components/schemas/HostingModSecurityRule' + description: Resource returned by the operation meta: - type: - - object - - 'null' - SecuremailPaginatedListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + HostingModSecurityScanPaginatedListResponse: + description: Successful response with a page of `HostingModSecurityScan` required: - error - message @@ -26467,20 +24045,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: + description: 'Items of the page: an empty list beyond the last page' type: array items: - $ref: '#/components/schemas/Securemail' + $ref: '#/components/schemas/HostingModSecurityScan' meta: $ref: '#/components/schemas/PaginationMeta' - SecuremailResponse: + description: Pagination of the list type: object + HostingModSecurityScanResponse: + description: Successful response with one `HostingModSecurityScan` required: - error - message @@ -26488,20 +24071,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/Securemail' + $ref: '#/components/schemas/HostingModSecurityScan' + description: Resource returned by the operation meta: - type: - - object - - 'null' - SecuremailStatisticsResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + HostingPaginatedListResponse: + description: Successful response with a page of `Hosting` required: - error - message @@ -26509,20 +24095,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/SecuremailStatistics' + description: 'Items of the page: an empty list beyond the last page' + type: array + items: + $ref: '#/components/schemas/Hosting' meta: - type: - - object - - 'null' - SecuremailMailboxPaginatedListResponse: + $ref: '#/components/schemas/PaginationMeta' + description: Pagination of the list type: object + HostingPhpVersionListResponse: + description: Successful response with a list of `HostingPhpVersion` required: - error - message @@ -26530,20 +24121,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: + description: Items returned by the operation type: array items: - $ref: '#/components/schemas/SecuremailMailbox' + $ref: '#/components/schemas/HostingPhpVersion' meta: - $ref: '#/components/schemas/PaginationMeta' - OrderResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + HostingResponse: + description: Successful response with one `Hosting` required: - error - message @@ -26551,20 +24147,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/Order' + $ref: '#/components/schemas/Hosting' + description: Resource returned by the operation meta: - type: - - object - - 'null' - Microsoft365PaginatedListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + HostingSslCertificateListResponse: + description: Successful response with a list of `HostingSslCertificate` required: - error - message @@ -26572,20 +24171,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: + description: Items returned by the operation type: array items: - $ref: '#/components/schemas/Microsoft365' + $ref: '#/components/schemas/HostingSslCertificate' meta: - $ref: '#/components/schemas/PaginationMeta' - Microsoft365Response: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + HostingSslCertificateResponse: + description: Successful response with one `HostingSslCertificate` required: - error - message @@ -26593,20 +24197,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/Microsoft365' + $ref: '#/components/schemas/HostingSslCertificate' + description: Resource returned by the operation meta: - type: - - object - - 'null' - Microsoft365TenantPaginatedListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + InvoicePaginatedListResponse: + description: Successful response with a page of `Invoice` required: - error - message @@ -26614,20 +24221,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: + description: 'Items of the page: an empty list beyond the last page' type: array items: - $ref: '#/components/schemas/Microsoft365Tenant' + $ref: '#/components/schemas/Invoice' meta: $ref: '#/components/schemas/PaginationMeta' - Microsoft365TenantResponse: + description: Pagination of the list type: object + InvoiceResponse: + description: Successful response with one `Invoice` required: - error - message @@ -26635,20 +24247,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/Microsoft365Tenant' + $ref: '#/components/schemas/Invoice' + description: Resource returned by the operation meta: - type: - - object - - 'null' - Microsoft365PartnerLinkResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + InvoiceRowListResponse: + description: Successful response with a list of `InvoiceRow` required: - error - message @@ -26656,20 +24271,49 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/Microsoft365PartnerLink' + description: Items returned by the operation + type: array + items: + $ref: '#/components/schemas/InvoiceRow' meta: + description: 'Always null: only the paginated lists have a `meta`' + const: null + type: object + InvoiceRowResponse: + description: Successful response with one `InvoiceRow` + required: + - error + - message + - data + - meta + properties: + error: + description: Always 0 in a successful response + type: integer + const: 0 + message: + description: Always null in a successful response type: - - object + - string - 'null' - OneClickPaginatedListResponse: + data: + $ref: '#/components/schemas/InvoiceRow' + description: Resource returned by the operation + meta: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + IpAddressListResponse: + description: Successful response with a list of `IpAddress` required: - error - message @@ -26677,20 +24321,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: + description: Items returned by the operation type: array items: - $ref: '#/components/schemas/OneClick' + $ref: '#/components/schemas/IpAddress' meta: - $ref: '#/components/schemas/PaginationMeta' - OneClickResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + IpAddressPaginatedListResponse: + description: Successful response with a page of `IpAddress` required: - error - message @@ -26698,20 +24347,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/OneClick' + description: 'Items of the page: an empty list beyond the last page' + type: array + items: + $ref: '#/components/schemas/IpAddress' meta: - type: - - object - - 'null' - OneClickAutorenewResponse: + $ref: '#/components/schemas/PaginationMeta' + description: Pagination of the list type: object + IpAddressResponse: + description: Successful response with one `IpAddress` required: - error - message @@ -26719,20 +24373,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/OneClickAutorenew' + $ref: '#/components/schemas/IpAddress' + description: Resource returned by the operation meta: - type: - - object - - 'null' - OrderPaginatedListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + LicensePaginatedListResponse: + description: Successful response with a page of `License` required: - error - message @@ -26740,20 +24397,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: + description: 'Items of the page: an empty list beyond the last page' type: array items: - $ref: '#/components/schemas/Order' + $ref: '#/components/schemas/License' meta: $ref: '#/components/schemas/PaginationMeta' - OrderCanCancelResponse: + description: Pagination of the list type: object + LicenseResponse: + description: Successful response with one `License` required: - error - message @@ -26761,20 +24423,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/OrderCanCancel' + $ref: '#/components/schemas/License' + description: Resource returned by the operation meta: - type: - - object - - 'null' - OrderCanPayResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + Microsoft365DomainAvailableResponse: + description: Successful response with one `Microsoft365DomainAvailable` required: - error - message @@ -26782,20 +24447,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/OrderCanPay' + $ref: '#/components/schemas/Microsoft365DomainAvailable' + description: Resource returned by the operation meta: - type: - - object - - 'null' - OrderRowListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + Microsoft365PaginatedListResponse: + description: Successful response with a page of `Microsoft365` required: - error - message @@ -26803,22 +24471,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: + description: 'Items of the page: an empty list beyond the last page' type: array items: - $ref: '#/components/schemas/OrderRow' + $ref: '#/components/schemas/Microsoft365' meta: - type: - - object - - 'null' - OrderRowResponse: + $ref: '#/components/schemas/PaginationMeta' + description: Pagination of the list type: object + Microsoft365PartnerLinkResponse: + description: Successful response with one `Microsoft365PartnerLink` required: - error - message @@ -26826,20 +24497,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/OrderRow' + $ref: '#/components/schemas/Microsoft365PartnerLink' + description: Resource returned by the operation meta: - type: - - object - - 'null' - PaymentPaginatedListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + Microsoft365Response: + description: Successful response with one `Microsoft365` required: - error - message @@ -26847,20 +24521,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - type: array - items: - $ref: '#/components/schemas/Payment' + $ref: '#/components/schemas/Microsoft365' + description: Resource returned by the operation meta: - $ref: '#/components/schemas/PaginationMeta' - PaymentResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + Microsoft365TenantPaginatedListResponse: + description: Successful response with a page of `Microsoft365Tenant` required: - error - message @@ -26868,20 +24545,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/Payment' + description: 'Items of the page: an empty list beyond the last page' + type: array + items: + $ref: '#/components/schemas/Microsoft365Tenant' meta: - type: - - object - - 'null' - PecDomainPaginatedListResponse: + $ref: '#/components/schemas/PaginationMeta' + description: Pagination of the list type: object + Microsoft365TenantResponse: + description: Successful response with one `Microsoft365Tenant` required: - error - message @@ -26889,20 +24571,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - type: array - items: - $ref: '#/components/schemas/PecDomain' + $ref: '#/components/schemas/Microsoft365Tenant' + description: Resource returned by the operation meta: - $ref: '#/components/schemas/PaginationMeta' - PecDomainResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + ObjectStorageBucketChartResponse: + description: Successful response with one `ObjectStorageBucketChart` required: - error - message @@ -26910,20 +24595,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/PecDomain' + $ref: '#/components/schemas/ObjectStorageBucketChart' + description: Resource returned by the operation meta: - type: - - object - - 'null' - PecOwnerChangePaginatedListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + ObjectStorageBucketFirewallEntryPaginatedListResponse: + description: Successful response with a page of `ObjectStorageBucketFirewallEntry` required: - error - message @@ -26931,20 +24619,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: + description: 'Items of the page: an empty list beyond the last page' type: array items: - $ref: '#/components/schemas/PecOwnerChange' + $ref: '#/components/schemas/ObjectStorageBucketFirewallEntry' meta: $ref: '#/components/schemas/PaginationMeta' - PecOwnerChangeResponse: + description: Pagination of the list type: object + ObjectStorageBucketFirewallEntryResponse: + description: Successful response with one `ObjectStorageBucketFirewallEntry` required: - error - message @@ -26952,20 +24645,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/PecOwnerChange' + $ref: '#/components/schemas/ObjectStorageBucketFirewallEntry' + description: Resource returned by the operation meta: - type: - - object - - 'null' - PecPaginatedListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + ObjectStorageBucketPaginatedListResponse: + description: Successful response with a page of `ObjectStorageBucket` required: - error - message @@ -26973,20 +24669,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: + description: 'Items of the page: an empty list beyond the last page' type: array items: - $ref: '#/components/schemas/Pec' + $ref: '#/components/schemas/ObjectStorageBucket' meta: $ref: '#/components/schemas/PaginationMeta' - PecResponse: + description: Pagination of the list type: object + ObjectStorageBucketResponse: + description: Successful response with one `ObjectStorageBucket` required: - error - message @@ -26994,20 +24695,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/Pec' + $ref: '#/components/schemas/ObjectStorageBucket' + description: Resource returned by the operation meta: - type: - - object - - 'null' - PrepaidCreditResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + ObjectStorageIamUserPaginatedListResponse: + description: Successful response with a page of `ObjectStorageIamUser` required: - error - message @@ -27015,20 +24719,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/PrepaidCredit' + description: 'Items of the page: an empty list beyond the last page' + type: array + items: + $ref: '#/components/schemas/ObjectStorageIamUser' meta: - type: - - object - - 'null' - PrepaidCreditOperationPaginatedListResponse: + $ref: '#/components/schemas/PaginationMeta' + description: Pagination of the list type: object + ObjectStorageIamUserResponse: + description: Successful response with one `ObjectStorageIamUser` required: - error - message @@ -27036,20 +24745,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - type: array - items: - $ref: '#/components/schemas/PrepaidCreditOperation' + $ref: '#/components/schemas/ObjectStorageIamUser' + description: Resource returned by the operation meta: - $ref: '#/components/schemas/PaginationMeta' - PrepaidCreditOperationResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + ObjectStorageIamUserS3KeyListResponse: + description: Successful response with a list of `ObjectStorageIamUserS3Key` required: - error - message @@ -27057,20 +24769,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/PrepaidCreditOperation' + description: Items returned by the operation + type: array + items: + $ref: '#/components/schemas/ObjectStorageIamUserS3Key' meta: - type: - - object - - 'null' - PrepaidCreditTopupPaginatedListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + ObjectStorageIamUserS3KeyResponse: + description: Successful response with one `ObjectStorageIamUserS3Key` required: - error - message @@ -27078,20 +24795,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - type: array - items: - $ref: '#/components/schemas/PrepaidCreditTopup' + $ref: '#/components/schemas/ObjectStorageIamUserS3Key' + description: Resource returned by the operation meta: - $ref: '#/components/schemas/PaginationMeta' - OrderListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + ObjectStoragePaginatedListResponse: + description: Successful response with a page of `ObjectStorage` required: - error - message @@ -27099,22 +24819,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: + description: 'Items of the page: an empty list beyond the last page' type: array items: - $ref: '#/components/schemas/Order' + $ref: '#/components/schemas/ObjectStorage' meta: - type: - - object - - 'null' - PrepaidCreditTopupResponse: + $ref: '#/components/schemas/PaginationMeta' + description: Pagination of the list type: object + ObjectStorageResponse: + description: Successful response with one `ObjectStorage` required: - error - message @@ -27122,20 +24845,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/PrepaidCreditTopup' + $ref: '#/components/schemas/ObjectStorage' + description: Resource returned by the operation meta: - type: - - object - - 'null' - PurchasePaginatedListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + ObjectStorageS3KeyResponse: + description: Successful response with one `ObjectStorageS3Key` required: - error - message @@ -27143,20 +24869,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - type: array - items: - $ref: '#/components/schemas/Purchase' + $ref: '#/components/schemas/ObjectStorageS3Key' + description: Resource returned by the operation meta: - $ref: '#/components/schemas/PaginationMeta' - PurchaseResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + OneClickAutorenewResponse: + description: Successful response with one `OneClickAutorenew` required: - error - message @@ -27164,20 +24893,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/Purchase' + $ref: '#/components/schemas/OneClickAutorenew' + description: Resource returned by the operation meta: - type: - - object - - 'null' - PurchaseCanChangeRenewStatusResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + OneClickPaginatedListResponse: + description: Successful response with a page of `OneClick` required: - error - message @@ -27185,20 +24917,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/PurchaseCanChangeRenewStatus' + description: 'Items of the page: an empty list beyond the last page' + type: array + items: + $ref: '#/components/schemas/OneClick' meta: - type: - - object - - 'null' - PurchaseCanChangeRecurrenceResponse: + $ref: '#/components/schemas/PaginationMeta' + description: Pagination of the list type: object + OneClickResponse: + description: Successful response with one `OneClick` required: - error - message @@ -27206,20 +24943,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/PurchaseCanChangeRecurrence' + $ref: '#/components/schemas/OneClick' + description: Resource returned by the operation meta: - type: - - object - - 'null' - PurchaseCanCancelResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + OrderCanCancelResponse: + description: Successful response with one `OrderCanCancel` required: - error - message @@ -27227,20 +24967,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/PurchaseCanCancel' + $ref: '#/components/schemas/OrderCanCancel' + description: Resource returned by the operation meta: - type: - - object - - 'null' - PurchaseCanRenewResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + OrderCanPayResponse: + description: Successful response with one `OrderCanPay` required: - error - message @@ -27248,20 +24991,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/PurchaseCanRenew' + $ref: '#/components/schemas/OrderCanPay' + description: Resource returned by the operation meta: - type: - - object - - 'null' - PurchaseCanChangeServiceResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + OrderListResponse: + description: Successful response with a list of `Order` required: - error - message @@ -27269,20 +25015,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/PurchaseCanChangeService' + description: Items returned by the operation + type: array + items: + $ref: '#/components/schemas/Order' meta: - type: - - object - - 'null' - PurchaseCanAddAdditionalResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + OrderPaginatedListResponse: + description: Successful response with a page of `Order` required: - error - message @@ -27290,20 +25041,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/PurchaseCanAddAdditional' + description: 'Items of the page: an empty list beyond the last page' + type: array + items: + $ref: '#/components/schemas/Order' meta: - type: - - object - - 'null' - ServerMonitoringPaginatedListResponse: + $ref: '#/components/schemas/PaginationMeta' + description: Pagination of the list type: object + OrderResponse: + description: Successful response with one `Order` required: - error - message @@ -27311,20 +25067,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - type: array - items: - $ref: '#/components/schemas/ServerMonitoring' + $ref: '#/components/schemas/Order' + description: Resource returned by the operation meta: - $ref: '#/components/schemas/PaginationMeta' - ServerMonitoringResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + OrderRowListResponse: + description: Successful response with a list of `OrderRow` required: - error - message @@ -27332,20 +25091,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/ServerMonitoring' + description: Items returned by the operation + type: array + items: + $ref: '#/components/schemas/OrderRow' meta: - type: - - object - - 'null' - ServerMonitoringProbeListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + OrderRowResponse: + description: Successful response with one `OrderRow` required: - error - message @@ -27353,22 +25117,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - type: array - items: - $ref: '#/components/schemas/ServerMonitoringProbe' + $ref: '#/components/schemas/OrderRow' + description: Resource returned by the operation meta: - type: - - object - - 'null' - ServerMonitoringProbeResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + PaymentPaginatedListResponse: + description: Successful response with a page of `Payment` required: - error - message @@ -27376,20 +25141,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/ServerMonitoringProbe' + description: 'Items of the page: an empty list beyond the last page' + type: array + items: + $ref: '#/components/schemas/Payment' meta: - type: - - object - - 'null' - ServerMonitoringProbeChartResponse: + $ref: '#/components/schemas/PaginationMeta' + description: Pagination of the list type: object + PaymentResponse: + description: Successful response with one `Payment` required: - error - message @@ -27397,20 +25167,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/ServerMonitoringProbeChart' + $ref: '#/components/schemas/Payment' + description: Resource returned by the operation meta: - type: - - object - - 'null' - ServerPaginatedListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + PecDomainPaginatedListResponse: + description: Successful response with a page of `PecDomain` required: - error - message @@ -27418,20 +25191,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: + description: 'Items of the page: an empty list beyond the last page' type: array items: - $ref: '#/components/schemas/Server' + $ref: '#/components/schemas/PecDomain' meta: $ref: '#/components/schemas/PaginationMeta' - ServerResponse: + description: Pagination of the list type: object + PecDomainResponse: + description: Successful response with one `PecDomain` required: - error - message @@ -27439,20 +25217,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/Server' + $ref: '#/components/schemas/PecDomain' + description: Resource returned by the operation meta: - type: - - object - - 'null' - ServerCredentialResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + PecOwnerChangePaginatedListResponse: + description: Successful response with a page of `PecOwnerChange` required: - error - message @@ -27460,20 +25241,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/ServerCredential' + description: 'Items of the page: an empty list beyond the last page' + type: array + items: + $ref: '#/components/schemas/PecOwnerChange' meta: - type: - - object - - 'null' - ServerCanActionResponse: + $ref: '#/components/schemas/PaginationMeta' + description: Pagination of the list type: object + PecOwnerChangeResponse: + description: Successful response with one `PecOwnerChange` required: - error - message @@ -27481,20 +25267,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/ServerCanAction' + $ref: '#/components/schemas/PecOwnerChange' + description: Resource returned by the operation meta: - type: - - object - - 'null' - ServerSnapshotPaginatedListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + PecPaginatedListResponse: + description: Successful response with a page of `Pec` required: - error - message @@ -27502,20 +25291,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: + description: 'Items of the page: an empty list beyond the last page' type: array items: - $ref: '#/components/schemas/ServerSnapshot' + $ref: '#/components/schemas/Pec' meta: $ref: '#/components/schemas/PaginationMeta' - ServerSnapshotResponse: + description: Pagination of the list type: object + PecResponse: + description: Successful response with one `Pec` required: - error - message @@ -27523,20 +25317,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/ServerSnapshot' + $ref: '#/components/schemas/Pec' + description: Resource returned by the operation meta: - type: - - object - - 'null' - ServerBackupListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + PrepaidCreditOperationPaginatedListResponse: + description: Successful response with a page of `PrepaidCreditOperation` required: - error - message @@ -27544,22 +25341,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: + description: 'Items of the page: an empty list beyond the last page' type: array items: - $ref: '#/components/schemas/ServerBackup' + $ref: '#/components/schemas/PrepaidCreditOperation' meta: - type: - - object - - 'null' - ServerBackupResponse: + $ref: '#/components/schemas/PaginationMeta' + description: Pagination of the list type: object + PrepaidCreditOperationResponse: + description: Successful response with one `PrepaidCreditOperation` required: - error - message @@ -27567,20 +25367,47 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/ServerBackup' + $ref: '#/components/schemas/PrepaidCreditOperation' + description: Resource returned by the operation meta: + description: 'Always null: only the paginated lists have a `meta`' + const: null + type: object + PrepaidCreditResponse: + description: Successful response with one `PrepaidCredit` + required: + - error + - message + - data + - meta + properties: + error: + description: Always 0 in a successful response + type: integer + const: 0 + message: + description: Always null in a successful response type: - - object + - string - 'null' - IpAddressListResponse: + data: + $ref: '#/components/schemas/PrepaidCredit' + description: Resource returned by the operation + meta: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + PrepaidCreditTopupPaginatedListResponse: + description: Successful response with a page of `PrepaidCreditTopup` required: - error - message @@ -27588,22 +25415,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: + description: 'Items of the page: an empty list beyond the last page' type: array items: - $ref: '#/components/schemas/IpAddress' + $ref: '#/components/schemas/PrepaidCreditTopup' meta: - type: - - object - - 'null' - IpAddressResponse: + $ref: '#/components/schemas/PaginationMeta' + description: Pagination of the list type: object + PrepaidCreditTopupResponse: + description: Successful response with one `PrepaidCreditTopup` required: - error - message @@ -27611,20 +25441,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/IpAddress' + $ref: '#/components/schemas/PrepaidCreditTopup' + description: Resource returned by the operation meta: - type: - - object - - 'null' - PrivateCloudResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + PrivateCloudResponse: + description: Successful response with one `PrivateCloud` required: - error - message @@ -27632,20 +25465,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: $ref: '#/components/schemas/PrivateCloud' + description: Resource returned by the operation meta: - type: - - object - - 'null' - ServerAutomaticSnapshotResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + PurchaseCanAddAdditionalResponse: + description: Successful response with one `PurchaseCanAddAdditional` required: - error - message @@ -27653,20 +25489,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/ServerAutomaticSnapshot' + $ref: '#/components/schemas/PurchaseCanAddAdditional' + description: Resource returned by the operation meta: - type: - - object - - 'null' - ServerNetworkInterfaceListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + PurchaseCanCancelResponse: + description: Successful response with one `PurchaseCanCancel` required: - error - message @@ -27674,22 +25513,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - type: array - items: - $ref: '#/components/schemas/ServerNetworkInterface' + $ref: '#/components/schemas/PurchaseCanCancel' + description: Resource returned by the operation meta: - type: - - object - - 'null' - ServerNetworkInterfaceResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + PurchaseCanChangeRecurrenceResponse: + description: Successful response with one `PurchaseCanChangeRecurrence` required: - error - message @@ -27697,20 +25537,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/ServerNetworkInterface' + $ref: '#/components/schemas/PurchaseCanChangeRecurrence' + description: Resource returned by the operation meta: - type: - - object - - 'null' - ServicePaginatedListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + PurchaseCanChangeRenewStatusResponse: + description: Successful response with one `PurchaseCanChangeRenewStatus` required: - error - message @@ -27718,20 +25561,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - type: array - items: - $ref: '#/components/schemas/Service' + $ref: '#/components/schemas/PurchaseCanChangeRenewStatus' + description: Resource returned by the operation meta: - $ref: '#/components/schemas/PaginationMeta' - Microsoft365DomainAvailableResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + PurchaseCanChangeServiceResponse: + description: Successful response with one `PurchaseCanChangeService` required: - error - message @@ -27739,20 +25585,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/Microsoft365DomainAvailable' + $ref: '#/components/schemas/PurchaseCanChangeService' + description: Resource returned by the operation meta: - type: - - object - - 'null' - ServiceServerPaginatedListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + PurchaseCanRenewResponse: + description: Successful response with one `PurchaseCanRenew` required: - error - message @@ -27760,20 +25609,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - type: array - items: - $ref: '#/components/schemas/ServiceServer' + $ref: '#/components/schemas/PurchaseCanRenew' + description: Resource returned by the operation meta: - $ref: '#/components/schemas/PaginationMeta' - SmsPaginatedListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + PurchasePaginatedListResponse: + description: Successful response with a page of `Purchase` required: - error - message @@ -27781,20 +25633,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: + description: 'Items of the page: an empty list beyond the last page' type: array items: - $ref: '#/components/schemas/Sms' + $ref: '#/components/schemas/Purchase' meta: $ref: '#/components/schemas/PaginationMeta' - SmsResponse: + description: Pagination of the list type: object + PurchaseResponse: + description: Successful response with one `Purchase` required: - error - message @@ -27802,20 +25659,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/Sms' + $ref: '#/components/schemas/Purchase' + description: Resource returned by the operation meta: - type: - - object - - 'null' - SmsCanCancelResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + ServerAutomaticSnapshotResponse: + description: Successful response with one `ServerAutomaticSnapshot` required: - error - message @@ -27823,20 +25683,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/SmsCanCancel' + $ref: '#/components/schemas/ServerAutomaticSnapshot' + description: Resource returned by the operation meta: - type: - - object - - 'null' - SmsCanDeleteResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + ServerBackupListResponse: + description: Successful response with a list of `ServerBackup` required: - error - message @@ -27844,20 +25707,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/SmsCanDelete' + description: Items returned by the operation + type: array + items: + $ref: '#/components/schemas/ServerBackup' meta: - type: - - object - - 'null' - SmsMessagePaginatedListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + ServerBackupResponse: + description: Successful response with one `ServerBackup` required: - error - message @@ -27865,20 +25733,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - type: array - items: - $ref: '#/components/schemas/SmsMessage' + $ref: '#/components/schemas/ServerBackup' + description: Resource returned by the operation meta: - $ref: '#/components/schemas/PaginationMeta' - SmsMessageResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + ServerCanActionResponse: + description: Successful response with one `ServerCanAction` required: - error - message @@ -27886,20 +25757,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/SmsMessage' + $ref: '#/components/schemas/ServerCanAction' + description: Resource returned by the operation meta: - type: - - object - - 'null' - SmsAccountResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + ServerCredentialResponse: + description: Successful response with one `ServerCredential` required: - error - message @@ -27907,20 +25781,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/SmsAccount' + $ref: '#/components/schemas/ServerCredential' + description: Resource returned by the operation meta: - type: - - object - - 'null' - SmsPricePaginatedListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + ServerMonitoringPaginatedListResponse: + description: Successful response with a page of `ServerMonitoring` required: - error - message @@ -27928,20 +25805,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: + description: 'Items of the page: an empty list beyond the last page' type: array items: - $ref: '#/components/schemas/SmsPrice' + $ref: '#/components/schemas/ServerMonitoring' meta: $ref: '#/components/schemas/PaginationMeta' - SmsPriceResponse: + description: Pagination of the list type: object + ServerMonitoringProbeChartResponse: + description: Successful response with one `ServerMonitoringProbeChart` required: - error - message @@ -27949,20 +25831,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/SmsPrice' + $ref: '#/components/schemas/ServerMonitoringProbeChart' + description: Resource returned by the operation meta: - type: - - object - - 'null' - SmsPhonebookPaginatedListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + ServerMonitoringProbeListResponse: + description: Successful response with a list of `ServerMonitoringProbe` required: - error - message @@ -27970,20 +25855,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: + description: Items returned by the operation type: array items: - $ref: '#/components/schemas/SmsPhonebook' + $ref: '#/components/schemas/ServerMonitoringProbe' meta: - $ref: '#/components/schemas/PaginationMeta' - SmsPhonebookResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + ServerMonitoringProbeResponse: + description: Successful response with one `ServerMonitoringProbe` required: - error - message @@ -27991,20 +25881,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/SmsPhonebook' + $ref: '#/components/schemas/ServerMonitoringProbe' + description: Resource returned by the operation meta: - type: - - object - - 'null' - SmsPhonebookContactPaginatedListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + ServerMonitoringResponse: + description: Successful response with one `ServerMonitoring` required: - error - message @@ -28012,20 +25905,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - type: array - items: - $ref: '#/components/schemas/SmsPhonebookContact' + $ref: '#/components/schemas/ServerMonitoring' + description: Resource returned by the operation meta: - $ref: '#/components/schemas/PaginationMeta' - SslCertificatePaginatedListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + ServerNetworkInterfaceListResponse: + description: Successful response with a list of `ServerNetworkInterface` required: - error - message @@ -28033,20 +25929,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: + description: Items returned by the operation type: array items: - $ref: '#/components/schemas/SslCertificate' + $ref: '#/components/schemas/ServerNetworkInterface' meta: - $ref: '#/components/schemas/PaginationMeta' - SslCertificateResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + ServerNetworkInterfaceResponse: + description: Successful response with one `ServerNetworkInterface` required: - error - message @@ -28054,20 +25955,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/SslCertificate' + $ref: '#/components/schemas/ServerNetworkInterface' + description: Resource returned by the operation meta: - type: - - object - - 'null' - SslCertificateKeysResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + ServerPaginatedListResponse: + description: Successful response with a page of `Server` required: - error - message @@ -28075,20 +25979,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/SslCertificateKeys' + description: 'Items of the page: an empty list beyond the last page' + type: array + items: + $ref: '#/components/schemas/Server' meta: - type: - - object - - 'null' - SslCertificateApproverEmailsResponse: + $ref: '#/components/schemas/PaginationMeta' + description: Pagination of the list type: object + ServerResponse: + description: Successful response with one `Server` required: - error - message @@ -28096,20 +26005,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/SslCertificateApproverEmails' + $ref: '#/components/schemas/Server' + description: Resource returned by the operation meta: - type: - - object - - 'null' - SslCertificateCanReemitResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + ServerSnapshotPaginatedListResponse: + description: Successful response with a page of `ServerSnapshot` required: - error - message @@ -28117,20 +26029,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/SslCertificateCanReemit' + description: 'Items of the page: an empty list beyond the last page' + type: array + items: + $ref: '#/components/schemas/ServerSnapshot' meta: - type: - - object - - 'null' - SslCertificateExportFormatListResponse: + $ref: '#/components/schemas/PaginationMeta' + description: Pagination of the list type: object + ServerSnapshotResponse: + description: Successful response with one `ServerSnapshot` required: - error - message @@ -28138,22 +26055,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - type: array - items: - $ref: '#/components/schemas/SslCertificateExportFormat' + $ref: '#/components/schemas/ServerSnapshot' + description: Resource returned by the operation meta: - type: - - object - - 'null' - SslCertificateExportResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + ServicePaginatedListResponse: + description: Successful response with a page of `Service` required: - error - message @@ -28161,20 +26079,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/SslCertificateExport' + description: 'Items of the page: an empty list beyond the last page' + type: array + items: + $ref: '#/components/schemas/Service' meta: - type: - - object - - 'null' - SslCertificateKeyResponse: + $ref: '#/components/schemas/PaginationMeta' + description: Pagination of the list type: object + ServiceServerPaginatedListResponse: + description: Successful response with a page of `ServiceServer` required: - error - message @@ -28182,20 +26105,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/SslCertificateKey' + description: 'Items of the page: an empty list beyond the last page' + type: array + items: + $ref: '#/components/schemas/ServiceServer' meta: - type: - - object - - 'null' - CloudStoragePaginatedListResponse: + $ref: '#/components/schemas/PaginationMeta' + description: Pagination of the list type: object + SmsAccountResponse: + description: Successful response with one `SmsAccount` required: - error - message @@ -28203,20 +26131,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - type: array - items: - $ref: '#/components/schemas/CloudStorage' + $ref: '#/components/schemas/SmsAccount' + description: Resource returned by the operation meta: - $ref: '#/components/schemas/PaginationMeta' - CloudStorageResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + SmsCanCancelResponse: + description: Successful response with one `SmsCanCancel` required: - error - message @@ -28224,20 +26155,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/CloudStorage' + $ref: '#/components/schemas/SmsCanCancel' + description: Resource returned by the operation meta: - type: - - object - - 'null' - CloudStorageAccessPaginatedListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + SmsCanDeleteResponse: + description: Successful response with one `SmsCanDelete` required: - error - message @@ -28245,20 +26179,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - type: array - items: - $ref: '#/components/schemas/CloudStorageAccess' + $ref: '#/components/schemas/SmsCanDelete' + description: Resource returned by the operation meta: - $ref: '#/components/schemas/PaginationMeta' - CloudStorageAccessResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + SmsMessagePaginatedListResponse: + description: Successful response with a page of `SmsMessage` required: - error - message @@ -28266,20 +26203,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/CloudStorageAccess' + description: 'Items of the page: an empty list beyond the last page' + type: array + items: + $ref: '#/components/schemas/SmsMessage' meta: - type: - - object - - 'null' - ObjectStoragePaginatedListResponse: + $ref: '#/components/schemas/PaginationMeta' + description: Pagination of the list type: object + SmsMessageResponse: + description: Successful response with one `SmsMessage` required: - error - message @@ -28287,20 +26229,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - type: array - items: - $ref: '#/components/schemas/ObjectStorage' + $ref: '#/components/schemas/SmsMessage' + description: Resource returned by the operation meta: - $ref: '#/components/schemas/PaginationMeta' - ObjectStorageResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + SmsPaginatedListResponse: + description: Successful response with a page of `Sms` required: - error - message @@ -28308,20 +26253,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/ObjectStorage' + description: 'Items of the page: an empty list beyond the last page' + type: array + items: + $ref: '#/components/schemas/Sms' meta: - type: - - object - - 'null' - ObjectStorageS3KeyResponse: + $ref: '#/components/schemas/PaginationMeta' + description: Pagination of the list type: object + SmsPhonebookContactPaginatedListResponse: + description: Successful response with a page of `SmsPhonebookContact` required: - error - message @@ -28329,20 +26279,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/ObjectStorageS3Key' + description: 'Items of the page: an empty list beyond the last page' + type: array + items: + $ref: '#/components/schemas/SmsPhonebookContact' meta: - type: - - object - - 'null' - ObjectStorageIamUserPaginatedListResponse: + $ref: '#/components/schemas/PaginationMeta' + description: Pagination of the list type: object + SmsPhonebookPaginatedListResponse: + description: Successful response with a page of `SmsPhonebook` required: - error - message @@ -28350,20 +26305,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: + description: 'Items of the page: an empty list beyond the last page' type: array items: - $ref: '#/components/schemas/ObjectStorageIamUser' + $ref: '#/components/schemas/SmsPhonebook' meta: $ref: '#/components/schemas/PaginationMeta' - ObjectStorageIamUserResponse: + description: Pagination of the list type: object + SmsPhonebookResponse: + description: Successful response with one `SmsPhonebook` required: - error - message @@ -28371,20 +26331,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/ObjectStorageIamUser' + $ref: '#/components/schemas/SmsPhonebook' + description: Resource returned by the operation meta: - type: - - object - - 'null' - ObjectStorageBucketPaginatedListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + SmsPricePaginatedListResponse: + description: Successful response with a page of `SmsPrice` required: - error - message @@ -28392,20 +26355,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: + description: 'Items of the page: an empty list beyond the last page' type: array items: - $ref: '#/components/schemas/ObjectStorageBucket' + $ref: '#/components/schemas/SmsPrice' meta: $ref: '#/components/schemas/PaginationMeta' - ObjectStorageBucketResponse: + description: Pagination of the list type: object + SmsPriceResponse: + description: Successful response with one `SmsPrice` required: - error - message @@ -28413,20 +26381,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/ObjectStorageBucket' + $ref: '#/components/schemas/SmsPrice' + description: Resource returned by the operation meta: - type: - - object - - 'null' - CloudStorageUserListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + SmsResponse: + description: Successful response with one `Sms` required: - error - message @@ -28434,22 +26405,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - type: array - items: - $ref: '#/components/schemas/CloudStorageUser' + $ref: '#/components/schemas/Sms' + description: Resource returned by the operation meta: - type: - - object - - 'null' - CloudStorageUserResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + SslCertificateApproverEmailsResponse: + description: Successful response with one `SslCertificateApproverEmails` required: - error - message @@ -28457,20 +26429,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/CloudStorageUser' + $ref: '#/components/schemas/SslCertificateApproverEmails' + description: Resource returned by the operation meta: - type: - - object - - 'null' - ObjectStorageBucketChartResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + SslCertificateCanReissueResponse: + description: Successful response with one `SslCertificateCanReissue` required: - error - message @@ -28478,20 +26453,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/ObjectStorageBucketChart' + $ref: '#/components/schemas/SslCertificateCanReissue' + description: Resource returned by the operation meta: - type: - - object - - 'null' - ObjectStorageBucketFirewallEntryPaginatedListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + SslCertificateExportFormatListResponse: + description: Successful response with a list of `SslCertificateExportFormat` required: - error - message @@ -28499,20 +26477,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: + description: Items returned by the operation type: array items: - $ref: '#/components/schemas/ObjectStorageBucketFirewallEntry' + $ref: '#/components/schemas/SslCertificateExportFormat' meta: - $ref: '#/components/schemas/PaginationMeta' - ObjectStorageBucketFirewallEntryResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + SslCertificateExportResponse: + description: Successful response with one `SslCertificateExport` required: - error - message @@ -28520,20 +26503,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/ObjectStorageBucketFirewallEntry' + $ref: '#/components/schemas/SslCertificateExport' + description: Resource returned by the operation meta: - type: - - object - - 'null' - ObjectStorageIamUserS3KeyListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + SslCertificateKeyResponse: + description: Successful response with one `SslCertificateKey` required: - error - message @@ -28541,22 +26527,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - type: array - items: - $ref: '#/components/schemas/ObjectStorageIamUserS3Key' + $ref: '#/components/schemas/SslCertificateKey' + description: Resource returned by the operation meta: - type: - - object - - 'null' - ObjectStorageIamUserS3KeyResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + SslCertificateKeysResponse: + description: Successful response with one `SslCertificateKeys` required: - error - message @@ -28564,20 +26551,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/ObjectStorageIamUserS3Key' + $ref: '#/components/schemas/SslCertificateKeys' + description: Resource returned by the operation meta: - type: - - object - - 'null' - AccountPaginatedListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + SslCertificatePaginatedListResponse: + description: Successful response with a page of `SslCertificate` required: - error - message @@ -28585,20 +26575,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: + description: 'Items of the page: an empty list beyond the last page' type: array items: - $ref: '#/components/schemas/Account' + $ref: '#/components/schemas/SslCertificate' meta: $ref: '#/components/schemas/PaginationMeta' - TaskPaginatedListResponse: + description: Pagination of the list type: object + SslCertificateResponse: + description: Successful response with one `SslCertificate` required: - error - message @@ -28606,20 +26601,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - type: array - items: - $ref: '#/components/schemas/Task' + $ref: '#/components/schemas/SslCertificate' + description: Resource returned by the operation meta: - $ref: '#/components/schemas/PaginationMeta' - TldPaginatedListResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + TaskPaginatedListResponse: + description: Successful response with a page of `Task` required: - error - message @@ -28627,20 +26625,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: + description: 'Items of the page: an empty list beyond the last page' type: array items: - $ref: '#/components/schemas/Tld' + $ref: '#/components/schemas/Task' meta: $ref: '#/components/schemas/PaginationMeta' - TldResponse: + description: Pagination of the list type: object + TaskResponse: + description: Successful response with one `Task` required: - error - message @@ -28648,20 +26651,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/Tld' + $ref: '#/components/schemas/Task' + description: Resource returned by the operation meta: - type: - - object - - 'null' - ApiUploadResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + TldPaginatedListResponse: + description: Successful response with a page of `Tld` required: - error - message @@ -28669,20 +26675,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/ApiUpload' + description: 'Items of the page: an empty list beyond the last page' + type: array + items: + $ref: '#/components/schemas/Tld' meta: - type: - - object - - 'null' - WebMonitoringPaginatedListResponse: + $ref: '#/components/schemas/PaginationMeta' + description: Pagination of the list type: object + TldResponse: + description: Successful response with one `Tld` required: - error - message @@ -28690,20 +26701,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - type: array - items: - $ref: '#/components/schemas/WebMonitoring' + $ref: '#/components/schemas/Tld' + description: Resource returned by the operation meta: - $ref: '#/components/schemas/PaginationMeta' - WebMonitoringResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + WebMonitoringAvailabilityChartResponse: + description: Successful response with one `WebMonitoringAvailabilityChart` required: - error - message @@ -28711,20 +26725,47 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/WebMonitoring' + $ref: '#/components/schemas/WebMonitoringAvailabilityChart' + description: Resource returned by the operation meta: + description: 'Always null: only the paginated lists have a `meta`' + const: null + type: object + WebMonitoringDownloadSpeedChartResponse: + description: Successful response with one `WebMonitoringDownloadSpeedChart` + required: + - error + - message + - data + - meta + properties: + error: + description: Always 0 in a successful response + type: integer + const: 0 + message: + description: Always null in a successful response type: - - object + - string - 'null' - WebMonitoringNoticesResponse: + data: + $ref: '#/components/schemas/WebMonitoringDownloadSpeedChart' + description: Resource returned by the operation + meta: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + WebMonitoringNoticesResponse: + description: Successful response with one `WebMonitoringNotices` required: - error - message @@ -28732,20 +26773,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: $ref: '#/components/schemas/WebMonitoringNotices' + description: Resource returned by the operation meta: - type: - - object - - 'null' - WebMonitoringDownloadSpeedChartResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + WebMonitoringPaginatedListResponse: + description: Successful response with a page of `WebMonitoring` required: - error - message @@ -28753,20 +26797,25 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/WebMonitoringDownloadSpeedChart' + description: 'Items of the page: an empty list beyond the last page' + type: array + items: + $ref: '#/components/schemas/WebMonitoring' meta: - type: - - object - - 'null' - WebMonitoringResponseTimeChartResponse: + $ref: '#/components/schemas/PaginationMeta' + description: Pagination of the list type: object + WebMonitoringResponse: + description: Successful response with one `WebMonitoring` required: - error - message @@ -28774,20 +26823,23 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/WebMonitoringResponseTimeChart' + $ref: '#/components/schemas/WebMonitoring' + description: Resource returned by the operation meta: - type: - - object - - 'null' - WebMonitoringAvailabilityChartResponse: + description: 'Always null: only the paginated lists have a `meta`' + const: null type: object + WebMonitoringResponseTimeChartResponse: + description: Successful response with one `WebMonitoringResponseTimeChart` required: - error - message @@ -28795,24 +26847,86 @@ components: - meta properties: error: + description: Always 0 in a successful response type: integer - example: 0 + const: 0 message: + description: Always null in a successful response type: - string - 'null' data: - $ref: '#/components/schemas/WebMonitoringAvailabilityChart' + $ref: '#/components/schemas/WebMonitoringResponseTimeChart' + description: Resource returned by the operation meta: - type: - - object - - 'null' + description: 'Always null: only the paginated lists have a `meta`' + const: null + type: object responses: + BadRequest: + description: >- + The request is not valid: error 1000 with the errors for each field in + `meta.errors`, error 1001 (or 1) for other invalid input + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + Unauthorized: + description: >- + The access token is missing, invalid, expired or revoked (error 1100): + request a new token and retry once + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + Forbidden: + description: >- + The access token is valid but not enough: missing scope (error 1101), + token for the other API (error 1102), missing permission, feature not + included in the plan, operation not available to sub-accounts, internal + API without administrator privileges or IP address not allowed (error + 1601). A new token does not change the result + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + PaymentDeclined: + description: >- + The payment provider declined the payment (error 1700): the message is + the one of the provider, and the orders are still to be paid + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + NotFound: + description: >- + The resource does not exist or does not belong to the account (error + 1200) + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + ServerError: + description: Unexpected server error (error 1500) + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + Conflict: + description: >- + The request conflicts with a business rule or with the current state of + the resource (error 1400) + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' TooManyRequests: - description: 'Troppe richieste: riprova dopo i secondi indicati in Retry-After' + description: >- + Too many requests (error 1300): retry after the seconds in the + `Retry-After` header headers: Retry-After: - description: Secondi da attendere prima di riprovare + description: Seconds to wait before retrying schema: type: integer minimum: 1 @@ -28822,11 +26936,11 @@ components: $ref: '#/components/schemas/ApiError' TokenTooManyRequests: description: >- - Troppe richieste al token endpoint (errore OAuth2 `rate_limited`): - riprova dopo i secondi indicati in Retry-After + Too many requests to the token endpoint (OAuth2 error `rate_limited`): + retry after the seconds in the `Retry-After` header headers: Retry-After: - description: Secondi da attendere prima di riprovare + description: Seconds to wait before retrying schema: type: integer minimum: 1 @@ -28834,38 +26948,474 @@ components: application/json: schema: $ref: '#/components/schemas/OAuthError' + parameters: + Page: + name: page + in: query + description: >- + Page number, starting from 1. A page beyond the last one returns an + empty `data` list (with the requested `page` in `meta`). + required: false + schema: + type: integer + default: 1 + maximum: 1000000 + minimum: 1 + PerPage: + name: per_page + in: query + description: >- + Number of items per page. Values outside the allowed range are rejected + with a validation error. + required: false + schema: + type: integer + default: 20 + maximum: 50 + minimum: 1 + AccessId: + name: access_id + in: path + description: >- + Access of the cloud storage: the `access_id` field of the accesses list, + that is the hostname allowed to mount the storage + required: true + schema: + type: string + AccountId: + name: account_id + in: path + description: ID of the sub-account + required: true + schema: + type: integer + AliasId: + name: alias_id + in: path + description: >- + Email alias: the `alias_id` field of the aliases list, that is the + address of the alias + required: true + schema: + type: string + AllowListId: + name: allow_list_id + in: path + description: ID of the allow list entry + required: true + schema: + type: integer + AntivirusId: + name: antivirus_id + in: path + description: ID of the antivirus scan + required: true + schema: + type: integer + BlockListId: + name: block_list_id + in: path + description: ID of the block list entry + required: true + schema: + type: integer + BucketId: + name: bucket_id + in: path + description: ID of the bucket + required: true + schema: + type: integer + CloudStorageId: + name: cloud_storage_id + in: path + description: ID of the cloud storage + required: true + schema: + type: integer + CloudStorageUserId: + name: cloud_storage_user_id + in: path + description: ID of the cloud storage user + required: true + schema: + type: integer + ContactId: + name: contact_id + in: path + description: ID of the phonebook contact + required: true + schema: + type: integer + CreditNoteId: + name: credit_note_id + in: path + description: ID of the credit note + required: true + schema: + type: integer + CronJobId: + name: cron_job_id + in: path + description: ID of the cron job + required: true + schema: + type: integer + DatabaseId: + name: database_id + in: path + description: >- + Database of the hosting: the `database_id` field of the databases list, + that is the name of the database + required: true + schema: + type: string + DomainContactId: + name: domain_contact_id + in: path + description: ID of the domain contact + required: true + schema: + type: integer + DomainId: + name: domain_id + in: path + description: ID of the domain + required: true + schema: + type: integer + EntryId: + name: entry_id + in: path + description: ID of the firewall entry of the bucket + required: true + schema: + type: integer + HostingBackupId: + name: hosting_backup_id + in: path + description: ID of the hosting backup + required: true + schema: + type: integer + HostingId: + name: hosting_id + in: path + description: ID of the hosting + required: true + schema: + type: integer + HostingSslCertificateId: + name: hosting_ssl_certificate_id + in: path + description: ID of the SSL certificate of the hosting + required: true + schema: + type: integer + IamUserId: + name: iam_user_id + in: path + description: ID of the IAM user + required: true + schema: + type: integer + InvoiceId: + name: invoice_id + in: path + description: ID of the invoice + required: true + schema: + type: integer + IpAddressId: + name: ip_address_id + in: path + description: ID of the IP address of the server + required: true + schema: + type: integer + LicenseId: + name: license_id + in: path + description: ID of the license + required: true + schema: + type: integer + MessageId: + name: message_id + in: path + description: ID of the message of the SMS + required: true + schema: + type: integer + Microsoft365SubscriptionId: + name: microsoft_365_subscription_id + in: path + description: ID of the Microsoft 365 subscription + required: true + schema: + type: integer + Microsoft365TenantId: + name: microsoft_365_tenant_id + in: path + description: ID of the Microsoft 365 tenant + required: true + schema: + type: integer + NetworkInterfaceId: + name: network_interface_id + in: path + description: ID of the network interface + required: true + schema: + type: integer + ObjectStorageId: + name: object_storage_id + in: path + description: ID of the object storage + required: true + schema: + type: integer + OneClickId: + name: one_click_id + in: path + description: ID of the One-Click payment + required: true + schema: + type: integer + OperationId: + name: operation_id + in: path + description: ID of the prepaid credit operation + required: true + schema: + type: integer + OrderId: + name: order_id + in: path + description: ID of the order + required: true + schema: + type: integer + OwnerChangeId: + name: owner_change_id + in: path + description: ID of the owner change + required: true + schema: + type: integer + PaymentId: + name: payment_id + in: path + description: ID of the payment + required: true + schema: + type: integer + PecDomainId: + name: pec_domain_id + in: path + description: ID of the PEC domain + required: true + schema: + type: integer + PecId: + name: pec_id + in: path + description: ID of the PEC mailbox + required: true + schema: + type: integer + PhonebookId: + name: phonebook_id + in: path + description: ID of the phonebook + required: true + schema: + type: integer + ProbeId: + name: probe_id + in: path + description: ID of the monitoring probe + required: true + schema: + type: integer + PurchaseId: + name: purchase_id + in: path + description: ID of the purchase + required: true + schema: + type: integer + RecordId: + name: record_id + in: path + description: 'DNS record: the `record_id` field of the records list' + required: true + schema: + type: string + RemovalScanId: + name: removal_scan_id + in: path + description: ID of the antivirus removal scan + required: true + schema: + type: integer + RowId: + name: row_id + in: path + description: ID of the row + required: true + schema: + type: integer + RuleId: + name: rule_id + in: path + description: ID of the ModSecurity rule + required: true + schema: + type: integer + S3KeyId: + name: s3_key_id + in: path + description: ID of the S3 key + required: true + schema: + type: integer + ScanId: + name: scan_id + in: path + description: ID of the ModSecurity scan + required: true + schema: + type: integer + ServerBackupId: + name: server_backup_id + in: path + description: ID of the server backup + required: true + schema: + type: integer + ServerId: + name: server_id + in: path + description: ID of the server + required: true + schema: + type: integer + ServerMonitoringId: + name: server_monitoring_id + in: path + description: ID of the server monitoring + required: true + schema: + type: integer + ServiceId: + name: service_id + in: path + description: ID of the Microsoft 365 service of the catalog + required: true + schema: + type: integer + SmsId: + name: sms_id + in: path + description: ID of the SMS + required: true + schema: + type: integer + SnapshotId: + name: snapshot_id + in: path + description: ID of the snapshot + required: true + schema: + type: integer + SslCertificateId: + name: ssl_certificate_id + in: path + description: ID of the SSL certificate + required: true + schema: + type: integer + TaskId: + name: task_id + in: path + description: ID of the task + required: true + schema: + type: integer + TldId: + name: tld_id + in: path + description: ID of the TLD + required: true + schema: + type: integer + TopUpId: + name: top_up_id + in: path + description: ID of the prepaid credit top-up + required: true + schema: + type: integer + VmId: + name: vm_id + in: path + description: ID of the virtual machine + required: true + schema: + type: integer + WebMonitoringId: + name: web_monitoring_id + in: path + description: ID of the web monitoring + required: true + schema: + type: integer securitySchemes: oauth2: type: oauth2 - description: OAuth2 client credentials con scopes + description: OAuth2 client credentials with scopes flows: clientCredentials: tokenUrl: https://api.shellrent.com/oauth/token scopes: - api:full: Tutti gli scope assegnati al client + api:full: All the scopes assigned to the client account:read: Account read account:write: Account write billing:read: Billing read cloudstorage:read: Cloud Storage read cloudstorage:write: Cloud Storage write + cloudstorage:secrets: >- + Cloud Storage secrets: passwords of the cloud storage users + (together with cloudstorage:read) domains:read: Domains read domains:write: Domains write + domains:secrets: >- + Domains secrets: authcodes of the domains (together with + domains:read) hosting:read: Hosting read hosting:write: Hosting write + hosting:secrets: >- + Hosting secrets: credentials of the hostings (together with + hosting:read) m365:read: m365 read m365:write: m365 write objectstorage:read: Object Storage read objectstorage:write: Object Storage write + objectstorage:secrets: >- + Object Storage secrets: S3 secret keys (together with + objectstorage:read) payment:read: Payment read payment:write: Payment write pec:read: Pec read pec:write: Pec write purchases:read: Purchases read purchases:write: Purchases write - securemail:read: Securemail read - securemail:write: Securemail write server:read: Server read server:write: Server write + server:secrets: >- + Server secrets: credentials of the servers (together with + server:read) servermonitoring:read: Server Monitoring read servermonitoring:write: Server Monitoring write shop:read: Shop read @@ -28874,6 +27424,10 @@ components: sms:write: Sms write ssl:read: Ssl read ssl:write: Ssl write + ssl:secrets: >- + Ssl secrets: private keys of the certificates and exports that + include them (together with ssl:read) weblicense:read: Web License read webmonitoring:read: Web Monitoring read webmonitoring:write: Web Monitoring write + upload:write: Upload of files used by other calls (e.g. PEC documents) diff --git a/src/shellrent_sdk/_errors.py b/src/shellrent_sdk/_errors.py index 047950d..25a6e5a 100644 --- a/src/shellrent_sdk/_errors.py +++ b/src/shellrent_sdk/_errors.py @@ -91,6 +91,8 @@ def unwrap( ) -> object: """Returns the parsed body of a successful response and raises an exception for the others. + A 204 No Content response has no body: ``unwrap()`` returns ``None``. + Takes the result of the ``sync_detailed()`` and ``asyncio_detailed()`` functions:: purchase = unwrap(get_purchase.sync_detailed(123, client=client)) @@ -112,8 +114,8 @@ def unwrap(response: Response[T | ApiError]) -> T: Raises: ApiException: An error response documented in the specification (``error_type``). - UnexpectedStatus: Any other response outside 2xx, or without a parsed body - (``unexpected_status_type``). + UnexpectedStatus: Any other response outside 2xx, or a 2xx other than 204 without a parsed + body (``unexpected_status_type``). """ if error_type is None: # Imported here: importing the models takes a while, and the CLI does not need them. @@ -124,6 +126,8 @@ def unwrap(response: Response[T | ApiError]) -> T: parsed = response.parsed if isinstance(parsed, error_type): raise ApiException(response.status_code, parsed, response.headers, response.content) + if response.status_code == 204: + return None if parsed is None or not 200 <= response.status_code < 300: if unexpected_status_type is None: unexpected_status_type = UnexpectedStatus diff --git a/src/shellrent_sdk/client/api/account/create_sub_account.py b/src/shellrent_sdk/client/api/account/create_sub_account.py index ee38f50..d083538 100644 --- a/src/shellrent_sdk/client/api/account/create_sub_account.py +++ b/src/shellrent_sdk/client/api/account/create_sub_account.py @@ -33,10 +33,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> AccountResponse | ApiError | None: - if response.status_code == 200: - response_200 = AccountResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = AccountResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -63,6 +63,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/account/delete_sub_account.py b/src/shellrent_sdk/client/api/account/delete_sub_account.py index 89a6fcc..2398d43 100644 --- a/src/shellrent_sdk/client/api/account/delete_sub_account.py +++ b/src/shellrent_sdk/client/api/account/delete_sub_account.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, cast from urllib.parse import quote import httpx @@ -7,7 +7,6 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.empty_response import EmptyResponse from ...types import Response @@ -27,11 +26,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | EmptyResponse | None: - if response.status_code == 200: - response_200 = EmptyResponse.from_dict(response.json()) - - return response_200 +) -> Any | ApiError | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -58,6 +56,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -66,7 +69,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,10 +82,13 @@ def sync_detailed( account_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Delete a user sub-account - Delete a user sub-account + Deactivates the sub-account: it can no longer log in and is no longer among the sub-accounts, and + its One-Click payment methods, automatic renewals, deferred payment and unified billing are revoked. + The response is 404 when the account is not an active sub-account of the reseller, 403 when the + account of the token cannot manage sub-accounts Args: account_id (int): @@ -92,7 +98,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -110,10 +116,13 @@ def sync( account_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Delete a user sub-account - Delete a user sub-account + Deactivates the sub-account: it can no longer log in and is no longer among the sub-accounts, and + its One-Click payment methods, automatic renewals, deferred payment and unified billing are revoked. + The response is 404 when the account is not an active sub-account of the reseller, 403 when the + account of the token cannot manage sub-accounts Args: account_id (int): @@ -123,7 +132,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return sync_detailed( @@ -136,10 +145,13 @@ async def asyncio_detailed( account_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Delete a user sub-account - Delete a user sub-account + Deactivates the sub-account: it can no longer log in and is no longer among the sub-accounts, and + its One-Click payment methods, automatic renewals, deferred payment and unified billing are revoked. + The response is 404 when the account is not an active sub-account of the reseller, 403 when the + account of the token cannot manage sub-accounts Args: account_id (int): @@ -149,7 +161,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -165,10 +177,13 @@ async def asyncio( account_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Delete a user sub-account - Delete a user sub-account + Deactivates the sub-account: it can no longer log in and is no longer among the sub-accounts, and + its One-Click payment methods, automatic renewals, deferred payment and unified billing are revoked. + The response is 404 when the account is not an active sub-account of the reseller, 403 when the + account of the token cannot manage sub-accounts Args: account_id (int): @@ -178,7 +193,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return ( diff --git a/src/shellrent_sdk/client/api/account/get_account.py b/src/shellrent_sdk/client/api/account/get_account.py index 7e9be28..afce2b0 100644 --- a/src/shellrent_sdk/client/api/account/get_account.py +++ b/src/shellrent_sdk/client/api/account/get_account.py @@ -53,6 +53,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/account/get_sub_account.py b/src/shellrent_sdk/client/api/account/get_sub_account.py index bbb0f7b..b5be4df 100644 --- a/src/shellrent_sdk/client/api/account/get_sub_account.py +++ b/src/shellrent_sdk/client/api/account/get_sub_account.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/account/list_sub_accounts.py b/src/shellrent_sdk/client/api/account/list_sub_accounts.py index 780fde4..2bf6bb9 100644 --- a/src/shellrent_sdk/client/api/account/list_sub_accounts.py +++ b/src/shellrent_sdk/client/api/account/list_sub_accounts.py @@ -13,7 +13,7 @@ def _get_kwargs( *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -66,6 +66,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -87,7 +92,7 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[AccountPaginatedListResponse | ApiError]: """List all sub accounts @@ -95,7 +100,7 @@ def sync_detailed( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -121,7 +126,7 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> AccountPaginatedListResponse | ApiError | None: """List all sub accounts @@ -129,7 +134,7 @@ def sync( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -150,7 +155,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[AccountPaginatedListResponse | ApiError]: """List all sub accounts @@ -158,7 +163,7 @@ async def asyncio_detailed( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -182,7 +187,7 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> AccountPaginatedListResponse | ApiError | None: """List all sub accounts @@ -190,7 +195,7 @@ async def asyncio( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/account/update_sub_account.py b/src/shellrent_sdk/client/api/account/update_sub_account.py index f2a8785..9eb7880 100644 --- a/src/shellrent_sdk/client/api/account/update_sub_account.py +++ b/src/shellrent_sdk/client/api/account/update_sub_account.py @@ -67,6 +67,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -92,7 +97,9 @@ def sync_detailed( ) -> Response[AccountResponse | ApiError]: """Edit a user sub-account - Edit an existing user sub-account + Edit an existing user sub-account. Only the given fields change, with the rules of the creation: a + field required by the creation cannot be emptied, and phone and mobile numbers are given together + with their prefix Args: account_id (int): @@ -126,7 +133,9 @@ def sync( ) -> AccountResponse | ApiError | None: """Edit a user sub-account - Edit an existing user sub-account + Edit an existing user sub-account. Only the given fields change, with the rules of the creation: a + field required by the creation cannot be emptied, and phone and mobile numbers are given together + with their prefix Args: account_id (int): @@ -155,7 +164,9 @@ async def asyncio_detailed( ) -> Response[AccountResponse | ApiError]: """Edit a user sub-account - Edit an existing user sub-account + Edit an existing user sub-account. Only the given fields change, with the rules of the creation: a + field required by the creation cannot be emptied, and phone and mobile numbers are given together + with their prefix Args: account_id (int): @@ -187,7 +198,9 @@ async def asyncio( ) -> AccountResponse | ApiError | None: """Edit a user sub-account - Edit an existing user sub-account + Edit an existing user sub-account. Only the given fields change, with the rules of the creation: a + field required by the creation cannot be emptied, and phone and mobile numbers are given together + with their prefix Args: account_id (int): diff --git a/src/shellrent_sdk/client/api/account/upload_file.py b/src/shellrent_sdk/client/api/account/upload_file.py index be9ef92..b3122eb 100644 --- a/src/shellrent_sdk/client/api/account/upload_file.py +++ b/src/shellrent_sdk/client/api/account/upload_file.py @@ -8,24 +8,23 @@ from ...models.api_error import ApiError from ...models.api_upload_response import ApiUploadResponse from ...models.upload_file_body import UploadFileBody -from ...types import UNSET, Response, Unset +from ...types import Response def _get_kwargs( *, - body: UploadFileBody | Unset = UNSET, + body: UploadFileBody, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "post", - "url": "/api/v3/upload", + "url": "/api/v3/uploads", } - if not isinstance(body, Unset): - _kwargs["json"] = body.to_dict() + _kwargs["files"] = body.to_multipart() - headers["Content-Type"] = "application/json" + headers["Content-Type"] = "multipart/form-data; boundary=+++" _kwargs["headers"] = headers return _kwargs @@ -34,10 +33,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | ApiUploadResponse | None: - if response.status_code == 200: - response_200 = ApiUploadResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = ApiUploadResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -64,6 +63,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -84,14 +88,14 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - body: UploadFileBody | Unset = UNSET, + body: UploadFileBody, ) -> Response[ApiError | ApiUploadResponse]: """Upload file - Upload one or more files + Uploads a file, whose upload_id is then used by other calls (e.g. the PEC documents). Args: - body (UploadFileBody | Unset): + body (UploadFileBody): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -115,14 +119,14 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - body: UploadFileBody | Unset = UNSET, + body: UploadFileBody, ) -> ApiError | ApiUploadResponse | None: """Upload file - Upload one or more files + Uploads a file, whose upload_id is then used by other calls (e.g. the PEC documents). Args: - body (UploadFileBody | Unset): + body (UploadFileBody): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -141,14 +145,14 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - body: UploadFileBody | Unset = UNSET, + body: UploadFileBody, ) -> Response[ApiError | ApiUploadResponse]: """Upload file - Upload one or more files + Uploads a file, whose upload_id is then used by other calls (e.g. the PEC documents). Args: - body (UploadFileBody | Unset): + body (UploadFileBody): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -170,14 +174,14 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - body: UploadFileBody | Unset = UNSET, + body: UploadFileBody, ) -> ApiError | ApiUploadResponse | None: """Upload file - Upload one or more files + Uploads a file, whose upload_id is then used by other calls (e.g. the PEC documents). Args: - body (UploadFileBody | Unset): + body (UploadFileBody): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/billing/download_credit_note_pdf.py b/src/shellrent_sdk/client/api/billing/download_credit_note_pdf.py index db966f0..562cc97 100644 --- a/src/shellrent_sdk/client/api/billing/download_credit_note_pdf.py +++ b/src/shellrent_sdk/client/api/billing/download_credit_note_pdf.py @@ -12,13 +12,13 @@ def _get_kwargs( - creditnote_id: int, + credit_note_id: int, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v3/creditnotes/{creditnote_id}/download/pdf".format( - creditnote_id=quote(str(creditnote_id), safe=""), + "url": "/api/v3/credit-notes/{credit_note_id}/pdf".format( + credit_note_id=quote(str(credit_note_id), safe=""), ), } @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -76,7 +81,7 @@ def _build_response( def sync_detailed( - creditnote_id: int, + credit_note_id: int, *, client: AuthenticatedClient, ) -> Response[ApiError | File]: @@ -84,8 +89,10 @@ def sync_detailed( Download the courtesy PDF file of a Credit note + Not available to sub-accounts: the response is 403 (error 1601). + Args: - creditnote_id (int): + credit_note_id (int): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -96,7 +103,7 @@ def sync_detailed( """ kwargs = _get_kwargs( - creditnote_id=creditnote_id, + credit_note_id=credit_note_id, ) response = client.get_httpx_client().request( @@ -107,7 +114,7 @@ def sync_detailed( def sync( - creditnote_id: int, + credit_note_id: int, *, client: AuthenticatedClient, ) -> ApiError | File | None: @@ -115,8 +122,10 @@ def sync( Download the courtesy PDF file of a Credit note + Not available to sub-accounts: the response is 403 (error 1601). + Args: - creditnote_id (int): + credit_note_id (int): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -127,13 +136,13 @@ def sync( """ return sync_detailed( - creditnote_id=creditnote_id, + credit_note_id=credit_note_id, client=client, ).parsed async def asyncio_detailed( - creditnote_id: int, + credit_note_id: int, *, client: AuthenticatedClient, ) -> Response[ApiError | File]: @@ -141,8 +150,10 @@ async def asyncio_detailed( Download the courtesy PDF file of a Credit note + Not available to sub-accounts: the response is 403 (error 1601). + Args: - creditnote_id (int): + credit_note_id (int): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -153,7 +164,7 @@ async def asyncio_detailed( """ kwargs = _get_kwargs( - creditnote_id=creditnote_id, + credit_note_id=credit_note_id, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -162,7 +173,7 @@ async def asyncio_detailed( async def asyncio( - creditnote_id: int, + credit_note_id: int, *, client: AuthenticatedClient, ) -> ApiError | File | None: @@ -170,8 +181,10 @@ async def asyncio( Download the courtesy PDF file of a Credit note + Not available to sub-accounts: the response is 403 (error 1601). + Args: - creditnote_id (int): + credit_note_id (int): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -183,7 +196,7 @@ async def asyncio( return ( await asyncio_detailed( - creditnote_id=creditnote_id, + credit_note_id=credit_note_id, client=client, ) ).parsed diff --git a/src/shellrent_sdk/client/api/billing/download_credit_note_xml.py b/src/shellrent_sdk/client/api/billing/download_credit_note_xml.py index 5c84747..cd3b46f 100644 --- a/src/shellrent_sdk/client/api/billing/download_credit_note_xml.py +++ b/src/shellrent_sdk/client/api/billing/download_credit_note_xml.py @@ -12,7 +12,7 @@ def _get_kwargs( - creditnote_id: int, + credit_note_id: int, *, prefer_xml: bool | Unset = UNSET, ) -> dict[str, Any]: @@ -25,8 +25,8 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v3/creditnotes/{creditnote_id}/download".format( - creditnote_id=quote(str(creditnote_id), safe=""), + "url": "/api/v3/credit-notes/{credit_note_id}/xml".format( + credit_note_id=quote(str(credit_note_id), safe=""), ), "params": params, } @@ -67,6 +67,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -85,7 +90,7 @@ def _build_response( def sync_detailed( - creditnote_id: int, + credit_note_id: int, *, client: AuthenticatedClient, prefer_xml: bool | Unset = UNSET, @@ -94,8 +99,10 @@ def sync_detailed( Download the XML file of a Credit note + Not available to sub-accounts: the response is 403 (error 1601). + Args: - creditnote_id (int): + credit_note_id (int): prefer_xml (bool | Unset): Raises: @@ -107,7 +114,7 @@ def sync_detailed( """ kwargs = _get_kwargs( - creditnote_id=creditnote_id, + credit_note_id=credit_note_id, prefer_xml=prefer_xml, ) @@ -119,7 +126,7 @@ def sync_detailed( def sync( - creditnote_id: int, + credit_note_id: int, *, client: AuthenticatedClient, prefer_xml: bool | Unset = UNSET, @@ -128,8 +135,10 @@ def sync( Download the XML file of a Credit note + Not available to sub-accounts: the response is 403 (error 1601). + Args: - creditnote_id (int): + credit_note_id (int): prefer_xml (bool | Unset): Raises: @@ -141,14 +150,14 @@ def sync( """ return sync_detailed( - creditnote_id=creditnote_id, + credit_note_id=credit_note_id, client=client, prefer_xml=prefer_xml, ).parsed async def asyncio_detailed( - creditnote_id: int, + credit_note_id: int, *, client: AuthenticatedClient, prefer_xml: bool | Unset = UNSET, @@ -157,8 +166,10 @@ async def asyncio_detailed( Download the XML file of a Credit note + Not available to sub-accounts: the response is 403 (error 1601). + Args: - creditnote_id (int): + credit_note_id (int): prefer_xml (bool | Unset): Raises: @@ -170,7 +181,7 @@ async def asyncio_detailed( """ kwargs = _get_kwargs( - creditnote_id=creditnote_id, + credit_note_id=credit_note_id, prefer_xml=prefer_xml, ) @@ -180,7 +191,7 @@ async def asyncio_detailed( async def asyncio( - creditnote_id: int, + credit_note_id: int, *, client: AuthenticatedClient, prefer_xml: bool | Unset = UNSET, @@ -189,8 +200,10 @@ async def asyncio( Download the XML file of a Credit note + Not available to sub-accounts: the response is 403 (error 1601). + Args: - creditnote_id (int): + credit_note_id (int): prefer_xml (bool | Unset): Raises: @@ -203,7 +216,7 @@ async def asyncio( return ( await asyncio_detailed( - creditnote_id=creditnote_id, + credit_note_id=credit_note_id, client=client, prefer_xml=prefer_xml, ) diff --git a/src/shellrent_sdk/client/api/billing/download_invoice_pdf.py b/src/shellrent_sdk/client/api/billing/download_invoice_pdf.py index 51cf4ec..23249be 100644 --- a/src/shellrent_sdk/client/api/billing/download_invoice_pdf.py +++ b/src/shellrent_sdk/client/api/billing/download_invoice_pdf.py @@ -17,7 +17,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v3/invoices/{invoice_id}/download/pdf".format( + "url": "/api/v3/invoices/{invoice_id}/pdf".format( invoice_id=quote(str(invoice_id), safe=""), ), } @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -84,6 +89,8 @@ def sync_detailed( Download the courtesy PDF file of an Invoice + Not available to sub-accounts: the response is 403 (error 1601). + Args: invoice_id (int): @@ -115,6 +122,8 @@ def sync( Download the courtesy PDF file of an Invoice + Not available to sub-accounts: the response is 403 (error 1601). + Args: invoice_id (int): @@ -141,6 +150,8 @@ async def asyncio_detailed( Download the courtesy PDF file of an Invoice + Not available to sub-accounts: the response is 403 (error 1601). + Args: invoice_id (int): @@ -170,6 +181,8 @@ async def asyncio( Download the courtesy PDF file of an Invoice + Not available to sub-accounts: the response is 403 (error 1601). + Args: invoice_id (int): diff --git a/src/shellrent_sdk/client/api/billing/download_invoice_xml.py b/src/shellrent_sdk/client/api/billing/download_invoice_xml.py index 1a8068b..6840088 100644 --- a/src/shellrent_sdk/client/api/billing/download_invoice_xml.py +++ b/src/shellrent_sdk/client/api/billing/download_invoice_xml.py @@ -25,7 +25,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v3/invoices/{invoice_id}/download".format( + "url": "/api/v3/invoices/{invoice_id}/xml".format( invoice_id=quote(str(invoice_id), safe=""), ), "params": params, @@ -67,6 +67,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -94,6 +99,8 @@ def sync_detailed( Download the XML file of an Invoice + Not available to sub-accounts: the response is 403 (error 1601). + Args: invoice_id (int): prefer_xml (bool | Unset): @@ -128,6 +135,8 @@ def sync( Download the XML file of an Invoice + Not available to sub-accounts: the response is 403 (error 1601). + Args: invoice_id (int): prefer_xml (bool | Unset): @@ -157,6 +166,8 @@ async def asyncio_detailed( Download the XML file of an Invoice + Not available to sub-accounts: the response is 403 (error 1601). + Args: invoice_id (int): prefer_xml (bool | Unset): @@ -189,6 +200,8 @@ async def asyncio( Download the XML file of an Invoice + Not available to sub-accounts: the response is 403 (error 1601). + Args: invoice_id (int): prefer_xml (bool | Unset): diff --git a/src/shellrent_sdk/client/api/billing/get_credit_note.py b/src/shellrent_sdk/client/api/billing/get_credit_note.py index 4ff24bd..940522a 100644 --- a/src/shellrent_sdk/client/api/billing/get_credit_note.py +++ b/src/shellrent_sdk/client/api/billing/get_credit_note.py @@ -12,13 +12,13 @@ def _get_kwargs( - creditnote_id: int, + credit_note_id: int, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v3/creditnotes/{creditnote_id}".format( - creditnote_id=quote(str(creditnote_id), safe=""), + "url": "/api/v3/credit-notes/{credit_note_id}".format( + credit_note_id=quote(str(credit_note_id), safe=""), ), } @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -76,7 +81,7 @@ def _build_response( def sync_detailed( - creditnote_id: int, + credit_note_id: int, *, client: AuthenticatedClient, ) -> Response[ApiError | CreditnoteResponse]: @@ -84,8 +89,10 @@ def sync_detailed( Get details of a credit note + Not available to sub-accounts: the response is 403 (error 1601). + Args: - creditnote_id (int): + credit_note_id (int): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -96,7 +103,7 @@ def sync_detailed( """ kwargs = _get_kwargs( - creditnote_id=creditnote_id, + credit_note_id=credit_note_id, ) response = client.get_httpx_client().request( @@ -107,7 +114,7 @@ def sync_detailed( def sync( - creditnote_id: int, + credit_note_id: int, *, client: AuthenticatedClient, ) -> ApiError | CreditnoteResponse | None: @@ -115,8 +122,10 @@ def sync( Get details of a credit note + Not available to sub-accounts: the response is 403 (error 1601). + Args: - creditnote_id (int): + credit_note_id (int): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -127,13 +136,13 @@ def sync( """ return sync_detailed( - creditnote_id=creditnote_id, + credit_note_id=credit_note_id, client=client, ).parsed async def asyncio_detailed( - creditnote_id: int, + credit_note_id: int, *, client: AuthenticatedClient, ) -> Response[ApiError | CreditnoteResponse]: @@ -141,8 +150,10 @@ async def asyncio_detailed( Get details of a credit note + Not available to sub-accounts: the response is 403 (error 1601). + Args: - creditnote_id (int): + credit_note_id (int): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -153,7 +164,7 @@ async def asyncio_detailed( """ kwargs = _get_kwargs( - creditnote_id=creditnote_id, + credit_note_id=credit_note_id, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -162,7 +173,7 @@ async def asyncio_detailed( async def asyncio( - creditnote_id: int, + credit_note_id: int, *, client: AuthenticatedClient, ) -> ApiError | CreditnoteResponse | None: @@ -170,8 +181,10 @@ async def asyncio( Get details of a credit note + Not available to sub-accounts: the response is 403 (error 1601). + Args: - creditnote_id (int): + credit_note_id (int): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -183,7 +196,7 @@ async def asyncio( return ( await asyncio_detailed( - creditnote_id=creditnote_id, + credit_note_id=credit_note_id, client=client, ) ).parsed diff --git a/src/shellrent_sdk/client/api/billing/get_credit_note_row.py b/src/shellrent_sdk/client/api/billing/get_credit_note_row.py index cb525a6..0749229 100644 --- a/src/shellrent_sdk/client/api/billing/get_credit_note_row.py +++ b/src/shellrent_sdk/client/api/billing/get_credit_note_row.py @@ -12,14 +12,14 @@ def _get_kwargs( - creditnote_id: int, + credit_note_id: int, row_id: int, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v3/creditnotes/{creditnote_id}/rows/{row_id}".format( - creditnote_id=quote(str(creditnote_id), safe=""), + "url": "/api/v3/credit-notes/{credit_note_id}/rows/{row_id}".format( + credit_note_id=quote(str(credit_note_id), safe=""), row_id=quote(str(row_id), safe=""), ), } @@ -60,6 +60,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -78,7 +83,7 @@ def _build_response( def sync_detailed( - creditnote_id: int, + credit_note_id: int, row_id: int, *, client: AuthenticatedClient, @@ -87,8 +92,10 @@ def sync_detailed( Get details of a Credit note row + Not available to sub-accounts: the response is 403 (error 1601). + Args: - creditnote_id (int): + credit_note_id (int): row_id (int): Raises: @@ -100,7 +107,7 @@ def sync_detailed( """ kwargs = _get_kwargs( - creditnote_id=creditnote_id, + credit_note_id=credit_note_id, row_id=row_id, ) @@ -112,7 +119,7 @@ def sync_detailed( def sync( - creditnote_id: int, + credit_note_id: int, row_id: int, *, client: AuthenticatedClient, @@ -121,8 +128,10 @@ def sync( Get details of a Credit note row + Not available to sub-accounts: the response is 403 (error 1601). + Args: - creditnote_id (int): + credit_note_id (int): row_id (int): Raises: @@ -134,14 +143,14 @@ def sync( """ return sync_detailed( - creditnote_id=creditnote_id, + credit_note_id=credit_note_id, row_id=row_id, client=client, ).parsed async def asyncio_detailed( - creditnote_id: int, + credit_note_id: int, row_id: int, *, client: AuthenticatedClient, @@ -150,8 +159,10 @@ async def asyncio_detailed( Get details of a Credit note row + Not available to sub-accounts: the response is 403 (error 1601). + Args: - creditnote_id (int): + credit_note_id (int): row_id (int): Raises: @@ -163,7 +174,7 @@ async def asyncio_detailed( """ kwargs = _get_kwargs( - creditnote_id=creditnote_id, + credit_note_id=credit_note_id, row_id=row_id, ) @@ -173,7 +184,7 @@ async def asyncio_detailed( async def asyncio( - creditnote_id: int, + credit_note_id: int, row_id: int, *, client: AuthenticatedClient, @@ -182,8 +193,10 @@ async def asyncio( Get details of a Credit note row + Not available to sub-accounts: the response is 403 (error 1601). + Args: - creditnote_id (int): + credit_note_id (int): row_id (int): Raises: @@ -196,7 +209,7 @@ async def asyncio( return ( await asyncio_detailed( - creditnote_id=creditnote_id, + credit_note_id=credit_note_id, row_id=row_id, client=client, ) diff --git a/src/shellrent_sdk/client/api/billing/get_invoice.py b/src/shellrent_sdk/client/api/billing/get_invoice.py index 864e93a..f4d5214 100644 --- a/src/shellrent_sdk/client/api/billing/get_invoice.py +++ b/src/shellrent_sdk/client/api/billing/get_invoice.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -84,6 +89,8 @@ def sync_detailed( Get details of an invoice + Not available to sub-accounts: the response is 403 (error 1601). + Args: invoice_id (int): @@ -115,6 +122,8 @@ def sync( Get details of an invoice + Not available to sub-accounts: the response is 403 (error 1601). + Args: invoice_id (int): @@ -141,6 +150,8 @@ async def asyncio_detailed( Get details of an invoice + Not available to sub-accounts: the response is 403 (error 1601). + Args: invoice_id (int): @@ -170,6 +181,8 @@ async def asyncio( Get details of an invoice + Not available to sub-accounts: the response is 403 (error 1601). + Args: invoice_id (int): diff --git a/src/shellrent_sdk/client/api/billing/get_invoice_row.py b/src/shellrent_sdk/client/api/billing/get_invoice_row.py index 0d3ae0b..6712ede 100644 --- a/src/shellrent_sdk/client/api/billing/get_invoice_row.py +++ b/src/shellrent_sdk/client/api/billing/get_invoice_row.py @@ -60,6 +60,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -87,6 +92,8 @@ def sync_detailed( Get details of an Invoice row + Not available to sub-accounts: the response is 403 (error 1601). + Args: invoice_id (int): row_id (int): @@ -121,6 +128,8 @@ def sync( Get details of an Invoice row + Not available to sub-accounts: the response is 403 (error 1601). + Args: invoice_id (int): row_id (int): @@ -150,6 +159,8 @@ async def asyncio_detailed( Get details of an Invoice row + Not available to sub-accounts: the response is 403 (error 1601). + Args: invoice_id (int): row_id (int): @@ -182,6 +193,8 @@ async def asyncio( Get details of an Invoice row + Not available to sub-accounts: the response is 403 (error 1601). + Args: invoice_id (int): row_id (int): diff --git a/src/shellrent_sdk/client/api/billing/list_credit_note_rows.py b/src/shellrent_sdk/client/api/billing/list_credit_note_rows.py index 9d3fc55..997fed5 100644 --- a/src/shellrent_sdk/client/api/billing/list_credit_note_rows.py +++ b/src/shellrent_sdk/client/api/billing/list_credit_note_rows.py @@ -12,13 +12,13 @@ def _get_kwargs( - creditnote_id: int, + credit_note_id: int, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v3/creditnotes/{creditnote_id}/rows".format( - creditnote_id=quote(str(creditnote_id), safe=""), + "url": "/api/v3/credit-notes/{credit_note_id}/rows".format( + credit_note_id=quote(str(credit_note_id), safe=""), ), } @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -76,7 +81,7 @@ def _build_response( def sync_detailed( - creditnote_id: int, + credit_note_id: int, *, client: AuthenticatedClient, ) -> Response[ApiError | CreditnoteRowListResponse]: @@ -84,8 +89,10 @@ def sync_detailed( Get the list of all the rows of a Credit Note + Not available to sub-accounts: the response is 403 (error 1601). + Args: - creditnote_id (int): + credit_note_id (int): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -96,7 +103,7 @@ def sync_detailed( """ kwargs = _get_kwargs( - creditnote_id=creditnote_id, + credit_note_id=credit_note_id, ) response = client.get_httpx_client().request( @@ -107,7 +114,7 @@ def sync_detailed( def sync( - creditnote_id: int, + credit_note_id: int, *, client: AuthenticatedClient, ) -> ApiError | CreditnoteRowListResponse | None: @@ -115,8 +122,10 @@ def sync( Get the list of all the rows of a Credit Note + Not available to sub-accounts: the response is 403 (error 1601). + Args: - creditnote_id (int): + credit_note_id (int): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -127,13 +136,13 @@ def sync( """ return sync_detailed( - creditnote_id=creditnote_id, + credit_note_id=credit_note_id, client=client, ).parsed async def asyncio_detailed( - creditnote_id: int, + credit_note_id: int, *, client: AuthenticatedClient, ) -> Response[ApiError | CreditnoteRowListResponse]: @@ -141,8 +150,10 @@ async def asyncio_detailed( Get the list of all the rows of a Credit Note + Not available to sub-accounts: the response is 403 (error 1601). + Args: - creditnote_id (int): + credit_note_id (int): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -153,7 +164,7 @@ async def asyncio_detailed( """ kwargs = _get_kwargs( - creditnote_id=creditnote_id, + credit_note_id=credit_note_id, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -162,7 +173,7 @@ async def asyncio_detailed( async def asyncio( - creditnote_id: int, + credit_note_id: int, *, client: AuthenticatedClient, ) -> ApiError | CreditnoteRowListResponse | None: @@ -170,8 +181,10 @@ async def asyncio( Get the list of all the rows of a Credit Note + Not available to sub-accounts: the response is 403 (error 1601). + Args: - creditnote_id (int): + credit_note_id (int): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -183,7 +196,7 @@ async def asyncio( return ( await asyncio_detailed( - creditnote_id=creditnote_id, + credit_note_id=credit_note_id, client=client, ) ).parsed diff --git a/src/shellrent_sdk/client/api/billing/list_credit_notes.py b/src/shellrent_sdk/client/api/billing/list_credit_notes.py index c5173f4..0a0b28e 100644 --- a/src/shellrent_sdk/client/api/billing/list_credit_notes.py +++ b/src/shellrent_sdk/client/api/billing/list_credit_notes.py @@ -16,7 +16,7 @@ def _get_kwargs( date_emission_from: datetime.date | Unset = UNSET, date_emission_to: datetime.date | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -39,7 +39,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v3/creditnotes", + "url": "/api/v3/credit-notes", "params": params, } @@ -79,6 +79,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -102,17 +107,19 @@ def sync_detailed( date_emission_from: datetime.date | Unset = UNSET, date_emission_to: datetime.date | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | CreditnotePaginatedListResponse]: """List all Credit notes Get a list of all Credit notes + Not available to sub-accounts: the response is 403 (error 1601). + Args: date_emission_from (datetime.date | Unset): date_emission_to (datetime.date | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -142,17 +149,19 @@ def sync( date_emission_from: datetime.date | Unset = UNSET, date_emission_to: datetime.date | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | CreditnotePaginatedListResponse | None: """List all Credit notes Get a list of all Credit notes + Not available to sub-accounts: the response is 403 (error 1601). + Args: date_emission_from (datetime.date | Unset): date_emission_to (datetime.date | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -177,17 +186,19 @@ async def asyncio_detailed( date_emission_from: datetime.date | Unset = UNSET, date_emission_to: datetime.date | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | CreditnotePaginatedListResponse]: """List all Credit notes Get a list of all Credit notes + Not available to sub-accounts: the response is 403 (error 1601). + Args: date_emission_from (datetime.date | Unset): date_emission_to (datetime.date | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -215,17 +226,19 @@ async def asyncio( date_emission_from: datetime.date | Unset = UNSET, date_emission_to: datetime.date | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | CreditnotePaginatedListResponse | None: """List all Credit notes Get a list of all Credit notes + Not available to sub-accounts: the response is 403 (error 1601). + Args: date_emission_from (datetime.date | Unset): date_emission_to (datetime.date | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/billing/list_invoice_rows.py b/src/shellrent_sdk/client/api/billing/list_invoice_rows.py index 7edc737..5ee16ba 100644 --- a/src/shellrent_sdk/client/api/billing/list_invoice_rows.py +++ b/src/shellrent_sdk/client/api/billing/list_invoice_rows.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -84,6 +89,8 @@ def sync_detailed( Get the list of all the rows of an Invoice + Not available to sub-accounts: the response is 403 (error 1601). + Args: invoice_id (int): @@ -115,6 +122,8 @@ def sync( Get the list of all the rows of an Invoice + Not available to sub-accounts: the response is 403 (error 1601). + Args: invoice_id (int): @@ -141,6 +150,8 @@ async def asyncio_detailed( Get the list of all the rows of an Invoice + Not available to sub-accounts: the response is 403 (error 1601). + Args: invoice_id (int): @@ -170,6 +181,8 @@ async def asyncio( Get the list of all the rows of an Invoice + Not available to sub-accounts: the response is 403 (error 1601). + Args: invoice_id (int): diff --git a/src/shellrent_sdk/client/api/billing/list_invoices.py b/src/shellrent_sdk/client/api/billing/list_invoices.py index bcd30ba..536c514 100644 --- a/src/shellrent_sdk/client/api/billing/list_invoices.py +++ b/src/shellrent_sdk/client/api/billing/list_invoices.py @@ -17,7 +17,7 @@ def _get_kwargs( date_emission_to: datetime.date | Unset = UNSET, payed: bool | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -82,6 +82,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -106,18 +111,20 @@ def sync_detailed( date_emission_to: datetime.date | Unset = UNSET, payed: bool | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | InvoicePaginatedListResponse]: """List all Invoices Get a list of all Invoices + Not available to sub-accounts: the response is 403 (error 1601). + Args: date_emission_from (datetime.date | Unset): date_emission_to (datetime.date | Unset): payed (bool | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -149,18 +156,20 @@ def sync( date_emission_to: datetime.date | Unset = UNSET, payed: bool | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | InvoicePaginatedListResponse | None: """List all Invoices Get a list of all Invoices + Not available to sub-accounts: the response is 403 (error 1601). + Args: date_emission_from (datetime.date | Unset): date_emission_to (datetime.date | Unset): payed (bool | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -187,18 +196,20 @@ async def asyncio_detailed( date_emission_to: datetime.date | Unset = UNSET, payed: bool | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | InvoicePaginatedListResponse]: """List all Invoices Get a list of all Invoices + Not available to sub-accounts: the response is 403 (error 1601). + Args: date_emission_from (datetime.date | Unset): date_emission_to (datetime.date | Unset): payed (bool | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -228,18 +239,20 @@ async def asyncio( date_emission_to: datetime.date | Unset = UNSET, payed: bool | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | InvoicePaginatedListResponse | None: """List all Invoices Get a list of all Invoices + Not available to sub-accounts: the response is 403 (error 1601). + Args: date_emission_from (datetime.date | Unset): date_emission_to (datetime.date | Unset): payed (bool | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/domains/activate_domain_dnssec.py b/src/shellrent_sdk/client/api/domains/activate_domain_dnssec.py index 10bc92d..306a633 100644 --- a/src/shellrent_sdk/client/api/domains/activate_domain_dnssec.py +++ b/src/shellrent_sdk/client/api/domains/activate_domain_dnssec.py @@ -28,10 +28,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | TaskResponse | None: - if response.status_code == 200: - response_200 = TaskResponse.from_dict(response.json()) + if response.status_code == 202: + response_202 = TaskResponse.from_dict(response.json()) - return response_200 + return response_202 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -53,11 +53,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -82,7 +92,8 @@ def sync_detailed( ) -> Response[ApiError | TaskResponse]: """Activate DNSSEC - Activate DNSSEC (for domains with "standard" nameservers only) + Activate DNSSEC (for domains with "standard" nameservers only). When the purchase of the domain is + suspended, the request is rejected with 409 Args: domain_id (int): @@ -113,7 +124,8 @@ def sync( ) -> ApiError | TaskResponse | None: """Activate DNSSEC - Activate DNSSEC (for domains with "standard" nameservers only) + Activate DNSSEC (for domains with "standard" nameservers only). When the purchase of the domain is + suspended, the request is rejected with 409 Args: domain_id (int): @@ -139,7 +151,8 @@ async def asyncio_detailed( ) -> Response[ApiError | TaskResponse]: """Activate DNSSEC - Activate DNSSEC (for domains with "standard" nameservers only) + Activate DNSSEC (for domains with "standard" nameservers only). When the purchase of the domain is + suspended, the request is rejected with 409 Args: domain_id (int): @@ -168,7 +181,8 @@ async def asyncio( ) -> ApiError | TaskResponse | None: """Activate DNSSEC - Activate DNSSEC (for domains with "standard" nameservers only) + Activate DNSSEC (for domains with "standard" nameservers only). When the purchase of the domain is + suspended, the request is rejected with 409 Args: domain_id (int): diff --git a/src/shellrent_sdk/client/api/domains/apply_domain_contact_changes.py b/src/shellrent_sdk/client/api/domains/apply_domain_contact_changes.py index 5c90d0d..83db15b 100644 --- a/src/shellrent_sdk/client/api/domains/apply_domain_contact_changes.py +++ b/src/shellrent_sdk/client/api/domains/apply_domain_contact_changes.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, cast from urllib.parse import quote import httpx @@ -7,7 +7,6 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.empty_response import EmptyResponse from ...types import Response @@ -17,7 +16,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/api/v3/domains/{domain_id}/contacts/apply".format( + "url": "/api/v3/domains/{domain_id}/contacts/synchronizations".format( domain_id=quote(str(domain_id), safe=""), ), } @@ -27,11 +26,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | EmptyResponse | None: - if response.status_code == 200: - response_200 = EmptyResponse.from_dict(response.json()) - - return response_200 +) -> Any | ApiError | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -58,6 +56,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -66,7 +69,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +82,7 @@ def sync_detailed( domain_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Apply contacts changes Apply changes made on contacts to the domain (send changes to domain's Registry) @@ -92,7 +95,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -110,7 +113,7 @@ def sync( domain_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Apply contacts changes Apply changes made on contacts to the domain (send changes to domain's Registry) @@ -123,7 +126,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return sync_detailed( @@ -136,7 +139,7 @@ async def asyncio_detailed( domain_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Apply contacts changes Apply changes made on contacts to the domain (send changes to domain's Registry) @@ -149,7 +152,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -165,7 +168,7 @@ async def asyncio( domain_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Apply contacts changes Apply changes made on contacts to the domain (send changes to domain's Registry) @@ -178,7 +181,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return ( diff --git a/src/shellrent_sdk/client/api/domains/can_activate_domain_dnssec.py b/src/shellrent_sdk/client/api/domains/can_activate_domain_dnssec.py index 78837c4..fafd4ad 100644 --- a/src/shellrent_sdk/client/api/domains/can_activate_domain_dnssec.py +++ b/src/shellrent_sdk/client/api/domains/can_activate_domain_dnssec.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/domains/can_change_domain_nameservers.py b/src/shellrent_sdk/client/api/domains/can_change_domain_nameservers.py index 1aa651c..7286b04 100644 --- a/src/shellrent_sdk/client/api/domains/can_change_domain_nameservers.py +++ b/src/shellrent_sdk/client/api/domains/can_change_domain_nameservers.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/domains/can_deactivate_domain_dnssec.py b/src/shellrent_sdk/client/api/domains/can_deactivate_domain_dnssec.py index a556a14..3575e7c 100644 --- a/src/shellrent_sdk/client/api/domains/can_deactivate_domain_dnssec.py +++ b/src/shellrent_sdk/client/api/domains/can_deactivate_domain_dnssec.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/domains/check_domain_availability.py b/src/shellrent_sdk/client/api/domains/check_domain_availability.py index 071ffc4..61fbae5 100644 --- a/src/shellrent_sdk/client/api/domains/check_domain_availability.py +++ b/src/shellrent_sdk/client/api/domains/check_domain_availability.py @@ -63,6 +63,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -87,7 +92,9 @@ def sync_detailed( ) -> Response[ApiError | DomainAvailabilityResponse]: """Domain whois - Search availability status for a domain (whois) + Search availability status for a domain (whois). A premium domain, sold at a price set by the + registry, comes with our prices, which its order (`POST /api/v3/shop/domain`) uses; sub-accounts get + no prices Args: domain_full_name (str | Unset): @@ -118,7 +125,9 @@ def sync( ) -> ApiError | DomainAvailabilityResponse | None: """Domain whois - Search availability status for a domain (whois) + Search availability status for a domain (whois). A premium domain, sold at a price set by the + registry, comes with our prices, which its order (`POST /api/v3/shop/domain`) uses; sub-accounts get + no prices Args: domain_full_name (str | Unset): @@ -144,7 +153,9 @@ async def asyncio_detailed( ) -> Response[ApiError | DomainAvailabilityResponse]: """Domain whois - Search availability status for a domain (whois) + Search availability status for a domain (whois). A premium domain, sold at a price set by the + registry, comes with our prices, which its order (`POST /api/v3/shop/domain`) uses; sub-accounts get + no prices Args: domain_full_name (str | Unset): @@ -173,7 +184,9 @@ async def asyncio( ) -> ApiError | DomainAvailabilityResponse | None: """Domain whois - Search availability status for a domain (whois) + Search availability status for a domain (whois). A premium domain, sold at a price set by the + registry, comes with our prices, which its order (`POST /api/v3/shop/domain`) uses; sub-accounts get + no prices Args: domain_full_name (str | Unset): diff --git a/src/shellrent_sdk/client/api/domains/create_domain_dns_record.py b/src/shellrent_sdk/client/api/domains/create_domain_dns_record.py index 6a2fa6a..494f28a 100644 --- a/src/shellrent_sdk/client/api/domains/create_domain_dns_record.py +++ b/src/shellrent_sdk/client/api/domains/create_domain_dns_record.py @@ -37,10 +37,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | DnsRecordResponse | None: - if response.status_code == 200: - response_200 = DnsRecordResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = DnsRecordResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -67,6 +67,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -92,7 +97,8 @@ def sync_detailed( ) -> Response[ApiError | DnsRecordResponse]: """Create DNS record - Create a new DNS record + Creates a record in the DNS zone of the domain. `NS` and `PTR` records cannot be created, as in the + control panel (400) Args: domain_id (int): @@ -126,7 +132,8 @@ def sync( ) -> ApiError | DnsRecordResponse | None: """Create DNS record - Create a new DNS record + Creates a record in the DNS zone of the domain. `NS` and `PTR` records cannot be created, as in the + control panel (400) Args: domain_id (int): @@ -155,7 +162,8 @@ async def asyncio_detailed( ) -> Response[ApiError | DnsRecordResponse]: """Create DNS record - Create a new DNS record + Creates a record in the DNS zone of the domain. `NS` and `PTR` records cannot be created, as in the + control panel (400) Args: domain_id (int): @@ -187,7 +195,8 @@ async def asyncio( ) -> ApiError | DnsRecordResponse | None: """Create DNS record - Create a new DNS record + Creates a record in the DNS zone of the domain. `NS` and `PTR` records cannot be created, as in the + control panel (400) Args: domain_id (int): diff --git a/src/shellrent_sdk/client/api/domains/deactivate_domain_dnssec.py b/src/shellrent_sdk/client/api/domains/deactivate_domain_dnssec.py index 0617119..2c33dd5 100644 --- a/src/shellrent_sdk/client/api/domains/deactivate_domain_dnssec.py +++ b/src/shellrent_sdk/client/api/domains/deactivate_domain_dnssec.py @@ -28,10 +28,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | TaskResponse | None: - if response.status_code == 200: - response_200 = TaskResponse.from_dict(response.json()) + if response.status_code == 202: + response_202 = TaskResponse.from_dict(response.json()) - return response_200 + return response_202 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -53,11 +53,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -83,7 +93,8 @@ def sync_detailed( """Deactivate DNSSEC Deactivate DNSSEC (for domains with "standard" nameservers) or remove all DNSSEC data records (for - domains with "external" nameservers) + domains with "external" nameservers). When the purchase of the domain is suspended, the request is + rejected with 409 Args: domain_id (int): @@ -115,7 +126,8 @@ def sync( """Deactivate DNSSEC Deactivate DNSSEC (for domains with "standard" nameservers) or remove all DNSSEC data records (for - domains with "external" nameservers) + domains with "external" nameservers). When the purchase of the domain is suspended, the request is + rejected with 409 Args: domain_id (int): @@ -142,7 +154,8 @@ async def asyncio_detailed( """Deactivate DNSSEC Deactivate DNSSEC (for domains with "standard" nameservers) or remove all DNSSEC data records (for - domains with "external" nameservers) + domains with "external" nameservers). When the purchase of the domain is suspended, the request is + rejected with 409 Args: domain_id (int): @@ -172,7 +185,8 @@ async def asyncio( """Deactivate DNSSEC Deactivate DNSSEC (for domains with "standard" nameservers) or remove all DNSSEC data records (for - domains with "external" nameservers) + domains with "external" nameservers). When the purchase of the domain is suspended, the request is + rejected with 409 Args: domain_id (int): diff --git a/src/shellrent_sdk/client/api/domains/delete_domain_dns_record.py b/src/shellrent_sdk/client/api/domains/delete_domain_dns_record.py index 70c4b73..e376f14 100644 --- a/src/shellrent_sdk/client/api/domains/delete_domain_dns_record.py +++ b/src/shellrent_sdk/client/api/domains/delete_domain_dns_record.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, cast from urllib.parse import quote import httpx @@ -7,7 +7,6 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.empty_response import EmptyResponse from ...types import Response @@ -29,11 +28,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | EmptyResponse | None: - if response.status_code == 200: - response_200 = EmptyResponse.from_dict(response.json()) - - return response_200 +) -> Any | ApiError | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -60,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -68,7 +71,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -82,10 +85,11 @@ def sync_detailed( record_id: str, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Delete DNS record - Delete an existing DNS record + Deletes a record of the DNS zone of the domain. `NS` and `PTR` records cannot be deleted, as in the + control panel (403) Args: domain_id (int): @@ -96,7 +100,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -116,10 +120,11 @@ def sync( record_id: str, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Delete DNS record - Delete an existing DNS record + Deletes a record of the DNS zone of the domain. `NS` and `PTR` records cannot be deleted, as in the + control panel (403) Args: domain_id (int): @@ -130,7 +135,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return sync_detailed( @@ -145,10 +150,11 @@ async def asyncio_detailed( record_id: str, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Delete DNS record - Delete an existing DNS record + Deletes a record of the DNS zone of the domain. `NS` and `PTR` records cannot be deleted, as in the + control panel (403) Args: domain_id (int): @@ -159,7 +165,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -177,10 +183,11 @@ async def asyncio( record_id: str, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Delete DNS record - Delete an existing DNS record + Deletes a record of the DNS zone of the domain. `NS` and `PTR` records cannot be deleted, as in the + control panel (403) Args: domain_id (int): @@ -191,7 +198,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return ( diff --git a/src/shellrent_sdk/client/api/domains/get_domain.py b/src/shellrent_sdk/client/api/domains/get_domain.py index 36f75c2..bf25b22 100644 --- a/src/shellrent_sdk/client/api/domains/get_domain.py +++ b/src/shellrent_sdk/client/api/domains/get_domain.py @@ -7,7 +7,7 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.domain_response import DomainResponse +from ...models.domain_detail_response import DomainDetailResponse from ...types import Response @@ -27,9 +27,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | DomainResponse | None: +) -> ApiError | DomainDetailResponse | None: if response.status_code == 200: - response_200 = DomainResponse.from_dict(response.json()) + response_200 = DomainDetailResponse.from_dict(response.json()) return response_200 @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -66,7 +71,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | DomainResponse]: +) -> Response[ApiError | DomainDetailResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,10 +84,10 @@ def sync_detailed( domain_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | DomainResponse]: +) -> Response[ApiError | DomainDetailResponse]: """Get domain - Get a domain + Get a domain. Unlike the list, it has dnssec_enabled, which needs the DNS zone of the domain Args: domain_id (int): @@ -92,7 +97,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | DomainResponse] + Response[ApiError | DomainDetailResponse] """ kwargs = _get_kwargs( @@ -110,10 +115,10 @@ def sync( domain_id: int, *, client: AuthenticatedClient, -) -> ApiError | DomainResponse | None: +) -> ApiError | DomainDetailResponse | None: """Get domain - Get a domain + Get a domain. Unlike the list, it has dnssec_enabled, which needs the DNS zone of the domain Args: domain_id (int): @@ -123,7 +128,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | DomainResponse + ApiError | DomainDetailResponse """ return sync_detailed( @@ -136,10 +141,10 @@ async def asyncio_detailed( domain_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | DomainResponse]: +) -> Response[ApiError | DomainDetailResponse]: """Get domain - Get a domain + Get a domain. Unlike the list, it has dnssec_enabled, which needs the DNS zone of the domain Args: domain_id (int): @@ -149,7 +154,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | DomainResponse] + Response[ApiError | DomainDetailResponse] """ kwargs = _get_kwargs( @@ -165,10 +170,10 @@ async def asyncio( domain_id: int, *, client: AuthenticatedClient, -) -> ApiError | DomainResponse | None: +) -> ApiError | DomainDetailResponse | None: """Get domain - Get a domain + Get a domain. Unlike the list, it has dnssec_enabled, which needs the DNS zone of the domain Args: domain_id (int): @@ -178,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | DomainResponse + ApiError | DomainDetailResponse """ return ( diff --git a/src/shellrent_sdk/client/api/domains/get_domain_contact.py b/src/shellrent_sdk/client/api/domains/get_domain_contact.py index 1a1d03b..270ad18 100644 --- a/src/shellrent_sdk/client/api/domains/get_domain_contact.py +++ b/src/shellrent_sdk/client/api/domains/get_domain_contact.py @@ -60,6 +60,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/domains/get_domain_dns_record.py b/src/shellrent_sdk/client/api/domains/get_domain_dns_record.py index 0bf1d59..4285a12 100644 --- a/src/shellrent_sdk/client/api/domains/get_domain_dns_record.py +++ b/src/shellrent_sdk/client/api/domains/get_domain_dns_record.py @@ -60,6 +60,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/domains/get_domain_dns_zone.py b/src/shellrent_sdk/client/api/domains/get_domain_dns_zone.py index 5b2112e..84dab6f 100644 --- a/src/shellrent_sdk/client/api/domains/get_domain_dns_zone.py +++ b/src/shellrent_sdk/client/api/domains/get_domain_dns_zone.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/domains/get_domain_dnssec.py b/src/shellrent_sdk/client/api/domains/get_domain_dnssec.py index 22864ed..b42590d 100644 --- a/src/shellrent_sdk/client/api/domains/get_domain_dnssec.py +++ b/src/shellrent_sdk/client/api/domains/get_domain_dnssec.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/domains/list_domain_contacts.py b/src/shellrent_sdk/client/api/domains/list_domain_contacts.py index a6d3922..88d0984 100644 --- a/src/shellrent_sdk/client/api/domains/list_domain_contacts.py +++ b/src/shellrent_sdk/client/api/domains/list_domain_contacts.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/domains/list_domain_dns_records.py b/src/shellrent_sdk/client/api/domains/list_domain_dns_records.py index 66728e1..26d6a64 100644 --- a/src/shellrent_sdk/client/api/domains/list_domain_dns_records.py +++ b/src/shellrent_sdk/client/api/domains/list_domain_dns_records.py @@ -18,7 +18,7 @@ def _get_kwargs( host: str | Unset = UNSET, destination: str | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -79,6 +79,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -104,7 +109,7 @@ def sync_detailed( host: str | Unset = UNSET, destination: str | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | DnsRecordPaginatedListResponse]: """List DNS records @@ -118,7 +123,7 @@ def sync_detailed( host (str | Unset): destination (str | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -152,7 +157,7 @@ def sync( host: str | Unset = UNSET, destination: str | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | DnsRecordPaginatedListResponse | None: """List DNS records @@ -166,7 +171,7 @@ def sync( host (str | Unset): destination (str | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -195,7 +200,7 @@ async def asyncio_detailed( host: str | Unset = UNSET, destination: str | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | DnsRecordPaginatedListResponse]: """List DNS records @@ -209,7 +214,7 @@ async def asyncio_detailed( host (str | Unset): destination (str | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -241,7 +246,7 @@ async def asyncio( host: str | Unset = UNSET, destination: str | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | DnsRecordPaginatedListResponse | None: """List DNS records @@ -255,7 +260,7 @@ async def asyncio( host (str | Unset): destination (str | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/domains/list_domains.py b/src/shellrent_sdk/client/api/domains/list_domains.py index 64fc4d2..eba0fb2 100644 --- a/src/shellrent_sdk/client/api/domains/list_domains.py +++ b/src/shellrent_sdk/client/api/domains/list_domains.py @@ -17,7 +17,7 @@ def _get_kwargs( tld_id: int | Unset = UNSET, tld_extension: str | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -78,6 +78,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -103,7 +108,7 @@ def sync_detailed( tld_id: int | Unset = UNSET, tld_extension: str | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | DomainPaginatedListResponse]: """List domains @@ -115,7 +120,7 @@ def sync_detailed( tld_id (int | Unset): tld_extension (str | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -149,7 +154,7 @@ def sync( tld_id: int | Unset = UNSET, tld_extension: str | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | DomainPaginatedListResponse | None: """List domains @@ -161,7 +166,7 @@ def sync( tld_id (int | Unset): tld_extension (str | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -190,7 +195,7 @@ async def asyncio_detailed( tld_id: int | Unset = UNSET, tld_extension: str | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | DomainPaginatedListResponse]: """List domains @@ -202,7 +207,7 @@ async def asyncio_detailed( tld_id (int | Unset): tld_extension (str | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -234,7 +239,7 @@ async def asyncio( tld_id: int | Unset = UNSET, tld_extension: str | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | DomainPaginatedListResponse | None: """List domains @@ -246,7 +251,7 @@ async def asyncio( tld_id (int | Unset): tld_extension (str | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/domains/set_domain_cloudflare_nameservers.py b/src/shellrent_sdk/client/api/domains/set_domain_cloudflare_nameservers.py index ef1304d..63ada4c 100644 --- a/src/shellrent_sdk/client/api/domains/set_domain_cloudflare_nameservers.py +++ b/src/shellrent_sdk/client/api/domains/set_domain_cloudflare_nameservers.py @@ -39,10 +39,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | TaskResponse | None: - if response.status_code == 200: - response_200 = TaskResponse.from_dict(response.json()) + if response.status_code == 202: + response_202 = TaskResponse.from_dict(response.json()) - return response_200 + return response_202 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -64,11 +64,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/domains/set_domain_external_nameservers.py b/src/shellrent_sdk/client/api/domains/set_domain_external_nameservers.py index 30d9028..290b21e 100644 --- a/src/shellrent_sdk/client/api/domains/set_domain_external_nameservers.py +++ b/src/shellrent_sdk/client/api/domains/set_domain_external_nameservers.py @@ -20,8 +20,8 @@ def _get_kwargs( headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { - "method": "patch", - "url": "/api/v3/domains/{domain_id}/dns/change-nameservers".format( + "method": "put", + "url": "/api/v3/domains/{domain_id}/dns/external".format( domain_id=quote(str(domain_id), safe=""), ), } @@ -37,10 +37,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | TaskResponse | None: - if response.status_code == 200: - response_200 = TaskResponse.from_dict(response.json()) + if response.status_code == 202: + response_202 = TaskResponse.from_dict(response.json()) - return response_200 + return response_202 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -62,11 +62,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/domains/set_domain_standard_nameservers.py b/src/shellrent_sdk/client/api/domains/set_domain_standard_nameservers.py index fe5d570..53f9b26 100644 --- a/src/shellrent_sdk/client/api/domains/set_domain_standard_nameservers.py +++ b/src/shellrent_sdk/client/api/domains/set_domain_standard_nameservers.py @@ -28,10 +28,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | TaskResponse | None: - if response.status_code == 200: - response_200 = TaskResponse.from_dict(response.json()) + if response.status_code == 202: + response_202 = TaskResponse.from_dict(response.json()) - return response_200 + return response_202 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -53,11 +53,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/domains/update_domain_contact.py b/src/shellrent_sdk/client/api/domains/update_domain_contact.py index 02616a3..f5dd054 100644 --- a/src/shellrent_sdk/client/api/domains/update_domain_contact.py +++ b/src/shellrent_sdk/client/api/domains/update_domain_contact.py @@ -64,11 +64,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/domains/update_domain_dns_record.py b/src/shellrent_sdk/client/api/domains/update_domain_dns_record.py index 79ddaed..bc46188 100644 --- a/src/shellrent_sdk/client/api/domains/update_domain_dns_record.py +++ b/src/shellrent_sdk/client/api/domains/update_domain_dns_record.py @@ -69,6 +69,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -95,7 +100,8 @@ def sync_detailed( ) -> Response[ApiError | DnsRecordResponse]: """Modify DNS record - Modify an existing DNS record + Changes a record of the DNS zone of the domain; its type cannot change. `NS` and `PTR` records + cannot be changed, as in the control panel (403) Args: domain_id (int): @@ -132,7 +138,8 @@ def sync( ) -> ApiError | DnsRecordResponse | None: """Modify DNS record - Modify an existing DNS record + Changes a record of the DNS zone of the domain; its type cannot change. `NS` and `PTR` records + cannot be changed, as in the control panel (403) Args: domain_id (int): @@ -164,7 +171,8 @@ async def asyncio_detailed( ) -> Response[ApiError | DnsRecordResponse]: """Modify DNS record - Modify an existing DNS record + Changes a record of the DNS zone of the domain; its type cannot change. `NS` and `PTR` records + cannot be changed, as in the control panel (403) Args: domain_id (int): @@ -199,7 +207,8 @@ async def asyncio( ) -> ApiError | DnsRecordResponse | None: """Modify DNS record - Modify an existing DNS record + Changes a record of the DNS zone of the domain; its type cannot change. `NS` and `PTR` records + cannot be changed, as in the control panel (403) Args: domain_id (int): diff --git a/src/shellrent_sdk/client/api/domains/update_domain_dns_zone.py b/src/shellrent_sdk/client/api/domains/update_domain_dns_zone.py index 7e013c9..9792c19 100644 --- a/src/shellrent_sdk/client/api/domains/update_domain_dns_zone.py +++ b/src/shellrent_sdk/client/api/domains/update_domain_dns_zone.py @@ -62,11 +62,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -92,7 +102,9 @@ def sync_detailed( ) -> Response[ApiError | DnsZoneResponse]: """Change DNS Zone data - Change DNS Zone data + Changes the TTL of the DNS zone of the domain and returns the zone. Only the zones on our + nameservers (standard and external types) have a TTL, which is also the TTL of all their records: + with the Cloudflare nameservers the response is 409. 404 when the domain has no DNS zone Args: domain_id (int): @@ -126,7 +138,9 @@ def sync( ) -> ApiError | DnsZoneResponse | None: """Change DNS Zone data - Change DNS Zone data + Changes the TTL of the DNS zone of the domain and returns the zone. Only the zones on our + nameservers (standard and external types) have a TTL, which is also the TTL of all their records: + with the Cloudflare nameservers the response is 409. 404 when the domain has no DNS zone Args: domain_id (int): @@ -155,7 +169,9 @@ async def asyncio_detailed( ) -> Response[ApiError | DnsZoneResponse]: """Change DNS Zone data - Change DNS Zone data + Changes the TTL of the DNS zone of the domain and returns the zone. Only the zones on our + nameservers (standard and external types) have a TTL, which is also the TTL of all their records: + with the Cloudflare nameservers the response is 409. 404 when the domain has no DNS zone Args: domain_id (int): @@ -187,7 +203,9 @@ async def asyncio( ) -> ApiError | DnsZoneResponse | None: """Change DNS Zone data - Change DNS Zone data + Changes the TTL of the DNS zone of the domain and returns the zone. Only the zones on our + nameservers (standard and external types) have a TTL, which is also the TTL of all their records: + with the Cloudflare nameservers the response is 409. 404 when the domain has no DNS zone Args: domain_id (int): diff --git a/src/shellrent_sdk/client/api/domains/update_domain_dnssec.py b/src/shellrent_sdk/client/api/domains/update_domain_dnssec.py index 134338c..17bb9b7 100644 --- a/src/shellrent_sdk/client/api/domains/update_domain_dnssec.py +++ b/src/shellrent_sdk/client/api/domains/update_domain_dnssec.py @@ -37,10 +37,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | TaskResponse | None: - if response.status_code == 200: - response_200 = TaskResponse.from_dict(response.json()) + if response.status_code == 202: + response_202 = TaskResponse.from_dict(response.json()) - return response_200 + return response_202 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -62,11 +62,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -92,7 +102,8 @@ def sync_detailed( ) -> Response[ApiError | TaskResponse]: """Change DNSSEC data - Add or change DNSSEC data records (for domains with "external" nameservers only) + Add or change DNSSEC data records (for domains with "external" nameservers only). When the purchase + of the domain is suspended, the request is rejected with 409 Args: domain_id (int): @@ -126,7 +137,8 @@ def sync( ) -> ApiError | TaskResponse | None: """Change DNSSEC data - Add or change DNSSEC data records (for domains with "external" nameservers only) + Add or change DNSSEC data records (for domains with "external" nameservers only). When the purchase + of the domain is suspended, the request is rejected with 409 Args: domain_id (int): @@ -155,7 +167,8 @@ async def asyncio_detailed( ) -> Response[ApiError | TaskResponse]: """Change DNSSEC data - Add or change DNSSEC data records (for domains with "external" nameservers only) + Add or change DNSSEC data records (for domains with "external" nameservers only). When the purchase + of the domain is suspended, the request is rejected with 409 Args: domain_id (int): @@ -187,7 +200,8 @@ async def asyncio( ) -> ApiError | TaskResponse | None: """Change DNSSEC data - Add or change DNSSEC data records (for domains with "external" nameservers only) + Add or change DNSSEC data records (for domains with "external" nameservers only). When the purchase + of the domain is suspended, the request is rejected with 409 Args: domain_id (int): diff --git a/src/shellrent_sdk/client/api/health/get_health.py b/src/shellrent_sdk/client/api/health/get_health.py index d6bff83..d53c534 100644 --- a/src/shellrent_sdk/client/api/health/get_health.py +++ b/src/shellrent_sdk/client/api/health/get_health.py @@ -38,6 +38,11 @@ def _parse_response( return response_403 + if response.status_code == 429: + response_429 = ApiError.from_dict(response.json()) + + return response_429 + if response.status_code == 500: response_500 = ApiError.from_dict(response.json()) @@ -64,9 +69,9 @@ def sync_detailed( *, client: AuthenticatedClient, ) -> Response[ApiError | HealthStatusResponse]: - """Verifica lo stato del servizio + """Check the service status - Restituisce lo stato corrente dell'API. + Returns the current status of the API. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -89,9 +94,9 @@ def sync( *, client: AuthenticatedClient, ) -> ApiError | HealthStatusResponse | None: - """Verifica lo stato del servizio + """Check the service status - Restituisce lo stato corrente dell'API. + Returns the current status of the API. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -110,9 +115,9 @@ async def asyncio_detailed( *, client: AuthenticatedClient, ) -> Response[ApiError | HealthStatusResponse]: - """Verifica lo stato del servizio + """Check the service status - Restituisce lo stato corrente dell'API. + Returns the current status of the API. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -133,9 +138,9 @@ async def asyncio( *, client: AuthenticatedClient, ) -> ApiError | HealthStatusResponse | None: - """Verifica lo stato del servizio + """Check the service status - Restituisce lo stato corrente dell'API. + Returns the current status of the API. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/hosting/create_hosting_allow_list_entry.py b/src/shellrent_sdk/client/api/hosting/create_hosting_allow_list_entry.py index 1423ecb..738d478 100644 --- a/src/shellrent_sdk/client/api/hosting/create_hosting_allow_list_entry.py +++ b/src/shellrent_sdk/client/api/hosting/create_hosting_allow_list_entry.py @@ -37,10 +37,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | HostingEmailAllowListResponse | None: - if response.status_code == 200: - response_200 = HostingEmailAllowListResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = HostingEmailAllowListResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -67,6 +67,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -96,7 +101,8 @@ def sync_detailed( Args: hosting_id (int): - body (HostingEmailWblistRequest): + body (HostingEmailWblistRequest): Sender to add to the allow list or the block list of the + antispam: a whole domain or an address Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -130,7 +136,8 @@ def sync( Args: hosting_id (int): - body (HostingEmailWblistRequest): + body (HostingEmailWblistRequest): Sender to add to the allow list or the block list of the + antispam: a whole domain or an address Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -159,7 +166,8 @@ async def asyncio_detailed( Args: hosting_id (int): - body (HostingEmailWblistRequest): + body (HostingEmailWblistRequest): Sender to add to the allow list or the block list of the + antispam: a whole domain or an address Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -191,7 +199,8 @@ async def asyncio( Args: hosting_id (int): - body (HostingEmailWblistRequest): + body (HostingEmailWblistRequest): Sender to add to the allow list or the block list of the + antispam: a whole domain or an address Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/hosting/create_hosting_block_list_entry.py b/src/shellrent_sdk/client/api/hosting/create_hosting_block_list_entry.py index e489bc0..965d241 100644 --- a/src/shellrent_sdk/client/api/hosting/create_hosting_block_list_entry.py +++ b/src/shellrent_sdk/client/api/hosting/create_hosting_block_list_entry.py @@ -7,7 +7,7 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.hosting_email_bloc_list_response import HostingEmailBlocListResponse +from ...models.hosting_email_block_list_response import HostingEmailBlockListResponse from ...models.hosting_email_wblist_request import HostingEmailWblistRequest from ...types import Response @@ -36,11 +36,11 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | HostingEmailBlocListResponse | None: - if response.status_code == 200: - response_200 = HostingEmailBlocListResponse.from_dict(response.json()) +) -> ApiError | HostingEmailBlockListResponse | None: + if response.status_code == 201: + response_201 = HostingEmailBlockListResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -67,6 +67,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -75,7 +80,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | HostingEmailBlocListResponse]: +) -> Response[ApiError | HostingEmailBlockListResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -89,21 +94,22 @@ def sync_detailed( *, client: AuthenticatedClient, body: HostingEmailWblistRequest, -) -> Response[ApiError | HostingEmailBlocListResponse]: +) -> Response[ApiError | HostingEmailBlockListResponse]: """Create block list entry Create a new block list entry for hosting Args: hosting_id (int): - body (HostingEmailWblistRequest): + body (HostingEmailWblistRequest): Sender to add to the allow list or the block list of the + antispam: a whole domain or an address Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | HostingEmailBlocListResponse] + Response[ApiError | HostingEmailBlockListResponse] """ kwargs = _get_kwargs( @@ -123,21 +129,22 @@ def sync( *, client: AuthenticatedClient, body: HostingEmailWblistRequest, -) -> ApiError | HostingEmailBlocListResponse | None: +) -> ApiError | HostingEmailBlockListResponse | None: """Create block list entry Create a new block list entry for hosting Args: hosting_id (int): - body (HostingEmailWblistRequest): + body (HostingEmailWblistRequest): Sender to add to the allow list or the block list of the + antispam: a whole domain or an address Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | HostingEmailBlocListResponse + ApiError | HostingEmailBlockListResponse """ return sync_detailed( @@ -152,21 +159,22 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: HostingEmailWblistRequest, -) -> Response[ApiError | HostingEmailBlocListResponse]: +) -> Response[ApiError | HostingEmailBlockListResponse]: """Create block list entry Create a new block list entry for hosting Args: hosting_id (int): - body (HostingEmailWblistRequest): + body (HostingEmailWblistRequest): Sender to add to the allow list or the block list of the + antispam: a whole domain or an address Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | HostingEmailBlocListResponse] + Response[ApiError | HostingEmailBlockListResponse] """ kwargs = _get_kwargs( @@ -184,21 +192,22 @@ async def asyncio( *, client: AuthenticatedClient, body: HostingEmailWblistRequest, -) -> ApiError | HostingEmailBlocListResponse | None: +) -> ApiError | HostingEmailBlockListResponse | None: """Create block list entry Create a new block list entry for hosting Args: hosting_id (int): - body (HostingEmailWblistRequest): + body (HostingEmailWblistRequest): Sender to add to the allow list or the block list of the + antispam: a whole domain or an address Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | HostingEmailBlocListResponse + ApiError | HostingEmailBlockListResponse """ return ( diff --git a/src/shellrent_sdk/client/api/hosting/create_hosting_catch_all.py b/src/shellrent_sdk/client/api/hosting/create_hosting_catch_all.py deleted file mode 100644 index 08798b0..0000000 --- a/src/shellrent_sdk/client/api/hosting/create_hosting_catch_all.py +++ /dev/null @@ -1,210 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.api_error import ApiError -from ...models.hosting_email_catch_all_request import HostingEmailCatchAllRequest -from ...models.hosting_email_catch_all_response import HostingEmailCatchAllResponse -from ...types import Response - - -def _get_kwargs( - hosting_id: int, - *, - body: HostingEmailCatchAllRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/api/v3/hostings/{hosting_id}/email/catch-all".format( - hosting_id=quote(str(hosting_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | HostingEmailCatchAllResponse | None: - if response.status_code == 200: - response_200 = HostingEmailCatchAllResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 400: - response_400 = ApiError.from_dict(response.json()) - - return response_400 - - if response.status_code == 401: - response_401 = ApiError.from_dict(response.json()) - - return response_401 - - if response.status_code == 403: - response_403 = ApiError.from_dict(response.json()) - - return response_403 - - if response.status_code == 404: - response_404 = ApiError.from_dict(response.json()) - - return response_404 - - if response.status_code == 429: - response_429 = ApiError.from_dict(response.json()) - - return response_429 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | HostingEmailCatchAllResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - hosting_id: int, - *, - client: AuthenticatedClient, - body: HostingEmailCatchAllRequest, -) -> Response[ApiError | HostingEmailCatchAllResponse]: - """Create catch-all alias - - Create a catch-all alias with destinations - - Args: - hosting_id (int): - body (HostingEmailCatchAllRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApiError | HostingEmailCatchAllResponse] - """ - - kwargs = _get_kwargs( - hosting_id=hosting_id, - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - hosting_id: int, - *, - client: AuthenticatedClient, - body: HostingEmailCatchAllRequest, -) -> ApiError | HostingEmailCatchAllResponse | None: - """Create catch-all alias - - Create a catch-all alias with destinations - - Args: - hosting_id (int): - body (HostingEmailCatchAllRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApiError | HostingEmailCatchAllResponse - """ - - return sync_detailed( - hosting_id=hosting_id, - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - hosting_id: int, - *, - client: AuthenticatedClient, - body: HostingEmailCatchAllRequest, -) -> Response[ApiError | HostingEmailCatchAllResponse]: - """Create catch-all alias - - Create a catch-all alias with destinations - - Args: - hosting_id (int): - body (HostingEmailCatchAllRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApiError | HostingEmailCatchAllResponse] - """ - - kwargs = _get_kwargs( - hosting_id=hosting_id, - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - hosting_id: int, - *, - client: AuthenticatedClient, - body: HostingEmailCatchAllRequest, -) -> ApiError | HostingEmailCatchAllResponse | None: - """Create catch-all alias - - Create a catch-all alias with destinations - - Args: - hosting_id (int): - body (HostingEmailCatchAllRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApiError | HostingEmailCatchAllResponse - """ - - return ( - await asyncio_detailed( - hosting_id=hosting_id, - client=client, - body=body, - ) - ).parsed diff --git a/src/shellrent_sdk/client/api/hosting/create_hosting_cronjob.py b/src/shellrent_sdk/client/api/hosting/create_hosting_cronjob.py index 974df08..6c50211 100644 --- a/src/shellrent_sdk/client/api/hosting/create_hosting_cronjob.py +++ b/src/shellrent_sdk/client/api/hosting/create_hosting_cronjob.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/api/v3/hostings/{hosting_id}/cronjobs".format( + "url": "/api/v3/hostings/{hosting_id}/cron-jobs".format( hosting_id=quote(str(hosting_id), safe=""), ), } @@ -37,10 +37,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | HostingCronjobResponse | None: - if response.status_code == 200: - response_200 = HostingCronjobResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = HostingCronjobResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -62,11 +62,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/hosting/create_hosting_database.py b/src/shellrent_sdk/client/api/hosting/create_hosting_database.py index b0374dd..298b0eb 100644 --- a/src/shellrent_sdk/client/api/hosting/create_hosting_database.py +++ b/src/shellrent_sdk/client/api/hosting/create_hosting_database.py @@ -7,17 +7,13 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.hosting_database_create_request import HostingDatabaseCreateRequest from ...models.hosting_database_response import HostingDatabaseResponse from ...types import Response def _get_kwargs( hosting_id: int, - *, - body: HostingDatabaseCreateRequest, ) -> dict[str, Any]: - headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "post", @@ -26,21 +22,16 @@ def _get_kwargs( ), } - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers return _kwargs def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | HostingDatabaseResponse | None: - if response.status_code == 200: - response_200 = HostingDatabaseResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = HostingDatabaseResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -62,11 +53,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -88,15 +89,15 @@ def sync_detailed( hosting_id: int, *, client: AuthenticatedClient, - body: HostingDatabaseCreateRequest, ) -> Response[ApiError | HostingDatabaseResponse]: """Create hosting database - Create hosting database + Create a database of the hosting. The request has no body: as in the control panel, the name is + `_`, with the first free n. If the database server already uses + that name for another account, it adds a suffix: the response has the actual name Args: hosting_id (int): - body (HostingDatabaseCreateRequest): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -108,7 +109,6 @@ def sync_detailed( kwargs = _get_kwargs( hosting_id=hosting_id, - body=body, ) response = client.get_httpx_client().request( @@ -122,15 +122,15 @@ def sync( hosting_id: int, *, client: AuthenticatedClient, - body: HostingDatabaseCreateRequest, ) -> ApiError | HostingDatabaseResponse | None: """Create hosting database - Create hosting database + Create a database of the hosting. The request has no body: as in the control panel, the name is + `_`, with the first free n. If the database server already uses + that name for another account, it adds a suffix: the response has the actual name Args: hosting_id (int): - body (HostingDatabaseCreateRequest): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -143,7 +143,6 @@ def sync( return sync_detailed( hosting_id=hosting_id, client=client, - body=body, ).parsed @@ -151,15 +150,15 @@ async def asyncio_detailed( hosting_id: int, *, client: AuthenticatedClient, - body: HostingDatabaseCreateRequest, ) -> Response[ApiError | HostingDatabaseResponse]: """Create hosting database - Create hosting database + Create a database of the hosting. The request has no body: as in the control panel, the name is + `_`, with the first free n. If the database server already uses + that name for another account, it adds a suffix: the response has the actual name Args: hosting_id (int): - body (HostingDatabaseCreateRequest): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -171,7 +170,6 @@ async def asyncio_detailed( kwargs = _get_kwargs( hosting_id=hosting_id, - body=body, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -183,15 +181,15 @@ async def asyncio( hosting_id: int, *, client: AuthenticatedClient, - body: HostingDatabaseCreateRequest, ) -> ApiError | HostingDatabaseResponse | None: """Create hosting database - Create hosting database + Create a database of the hosting. The request has no body: as in the control panel, the name is + `_`, with the first free n. If the database server already uses + that name for another account, it adds a suffix: the response has the actual name Args: hosting_id (int): - body (HostingDatabaseCreateRequest): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -205,6 +203,5 @@ async def asyncio( await asyncio_detailed( hosting_id=hosting_id, client=client, - body=body, ) ).parsed diff --git a/src/shellrent_sdk/client/api/hosting/create_hosting_email_alias.py b/src/shellrent_sdk/client/api/hosting/create_hosting_email_alias.py index 04f9f7b..6db1f16 100644 --- a/src/shellrent_sdk/client/api/hosting/create_hosting_email_alias.py +++ b/src/shellrent_sdk/client/api/hosting/create_hosting_email_alias.py @@ -37,10 +37,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | HostingEmailAliasResponse | None: - if response.status_code == 200: - response_200 = HostingEmailAliasResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = HostingEmailAliasResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -62,11 +62,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/hosting/create_hosting_mod_security_rule.py b/src/shellrent_sdk/client/api/hosting/create_hosting_mod_security_rule.py index ded4d80..ee15131 100644 --- a/src/shellrent_sdk/client/api/hosting/create_hosting_mod_security_rule.py +++ b/src/shellrent_sdk/client/api/hosting/create_hosting_mod_security_rule.py @@ -42,6 +42,11 @@ def _parse_response( return response_200 + if response.status_code == 201: + response_201 = HostingModSecurityRuleResponse.from_dict(response.json()) + + return response_201 + if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -67,6 +72,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -92,11 +102,13 @@ def sync_detailed( ) -> Response[ApiError | HostingModSecurityRuleResponse]: """Create ModSecurity rule - Add a ModSecurity rule by rule number + Disables the ModSecurity rule `rule_number` on the hosting, so that ModSecurity no longer applies + it, and returns the rule with `included` true. Responds 200 instead of 201 when the hosting already + had the rule, found by a scan or added before Args: hosting_id (int): - body (HostingModSecurityRuleCreateRequest): + body (HostingModSecurityRuleCreateRequest): ModSecurity rule to disable on the hosting Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -126,11 +138,13 @@ def sync( ) -> ApiError | HostingModSecurityRuleResponse | None: """Create ModSecurity rule - Add a ModSecurity rule by rule number + Disables the ModSecurity rule `rule_number` on the hosting, so that ModSecurity no longer applies + it, and returns the rule with `included` true. Responds 200 instead of 201 when the hosting already + had the rule, found by a scan or added before Args: hosting_id (int): - body (HostingModSecurityRuleCreateRequest): + body (HostingModSecurityRuleCreateRequest): ModSecurity rule to disable on the hosting Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -155,11 +169,13 @@ async def asyncio_detailed( ) -> Response[ApiError | HostingModSecurityRuleResponse]: """Create ModSecurity rule - Add a ModSecurity rule by rule number + Disables the ModSecurity rule `rule_number` on the hosting, so that ModSecurity no longer applies + it, and returns the rule with `included` true. Responds 200 instead of 201 when the hosting already + had the rule, found by a scan or added before Args: hosting_id (int): - body (HostingModSecurityRuleCreateRequest): + body (HostingModSecurityRuleCreateRequest): ModSecurity rule to disable on the hosting Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -187,11 +203,13 @@ async def asyncio( ) -> ApiError | HostingModSecurityRuleResponse | None: """Create ModSecurity rule - Add a ModSecurity rule by rule number + Disables the ModSecurity rule `rule_number` on the hosting, so that ModSecurity no longer applies + it, and returns the rule with `included` true. Responds 200 instead of 201 when the hosting already + had the rule, found by a scan or added before Args: hosting_id (int): - body (HostingModSecurityRuleCreateRequest): + body (HostingModSecurityRuleCreateRequest): ModSecurity rule to disable on the hosting Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/hosting/create_hosting_subdomain.py b/src/shellrent_sdk/client/api/hosting/create_hosting_subdomain.py index 4d16755..a3c2220 100644 --- a/src/shellrent_sdk/client/api/hosting/create_hosting_subdomain.py +++ b/src/shellrent_sdk/client/api/hosting/create_hosting_subdomain.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/api/v3/hostings/{hosting_id}".format( + "url": "/api/v3/hostings/{hosting_id}/subdomains".format( hosting_id=quote(str(hosting_id), safe=""), ), } @@ -37,10 +37,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | HostingResponse | None: - if response.status_code == 200: - response_200 = HostingResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = HostingResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -62,11 +62,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -92,7 +102,10 @@ def sync_detailed( ) -> Response[ApiError | HostingResponse]: """Create subdomain - Create subdomain + Creates a subdomain of a main hosting and returns it. When the DNS of the domain is a purchase of + the same account, it also adds the A record of the subdomain. Not available (403) when the plan does + not include subdomains; 409 on a subdomain, when the limit is reached or when the subdomain or its + DNS record already exists Args: hosting_id (int): @@ -126,7 +139,10 @@ def sync( ) -> ApiError | HostingResponse | None: """Create subdomain - Create subdomain + Creates a subdomain of a main hosting and returns it. When the DNS of the domain is a purchase of + the same account, it also adds the A record of the subdomain. Not available (403) when the plan does + not include subdomains; 409 on a subdomain, when the limit is reached or when the subdomain or its + DNS record already exists Args: hosting_id (int): @@ -155,7 +171,10 @@ async def asyncio_detailed( ) -> Response[ApiError | HostingResponse]: """Create subdomain - Create subdomain + Creates a subdomain of a main hosting and returns it. When the DNS of the domain is a purchase of + the same account, it also adds the A record of the subdomain. Not available (403) when the plan does + not include subdomains; 409 on a subdomain, when the limit is reached or when the subdomain or its + DNS record already exists Args: hosting_id (int): @@ -187,7 +206,10 @@ async def asyncio( ) -> ApiError | HostingResponse | None: """Create subdomain - Create subdomain + Creates a subdomain of a main hosting and returns it. When the DNS of the domain is a purchase of + the same account, it also adds the A record of the subdomain. Not available (403) when the plan does + not include subdomains; 409 on a subdomain, when the limit is reached or when the subdomain or its + DNS record already exists Args: hosting_id (int): diff --git a/src/shellrent_sdk/client/api/hosting/delete_all_hosting_mod_security_rules.py b/src/shellrent_sdk/client/api/hosting/delete_all_hosting_mod_security_rules.py index 82f2608..b777fbd 100644 --- a/src/shellrent_sdk/client/api/hosting/delete_all_hosting_mod_security_rules.py +++ b/src/shellrent_sdk/client/api/hosting/delete_all_hosting_mod_security_rules.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, cast from urllib.parse import quote import httpx @@ -7,7 +7,6 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.empty_response import EmptyResponse from ...types import Response @@ -27,11 +26,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | EmptyResponse | None: - if response.status_code == 200: - response_200 = EmptyResponse.from_dict(response.json()) - - return response_200 +) -> Any | ApiError | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -58,6 +56,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -66,7 +69,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,10 +82,11 @@ def sync_detailed( hosting_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Delete all ModSecurity rules - Disable all ModSecurity rules for a hosting + Enables again all the ModSecurity rules disabled on the hosting: ModSecurity applies them again and + their `included` becomes false. The rules stay in the list Args: hosting_id (int): @@ -92,7 +96,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -110,10 +114,11 @@ def sync( hosting_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Delete all ModSecurity rules - Disable all ModSecurity rules for a hosting + Enables again all the ModSecurity rules disabled on the hosting: ModSecurity applies them again and + their `included` becomes false. The rules stay in the list Args: hosting_id (int): @@ -123,7 +128,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return sync_detailed( @@ -136,10 +141,11 @@ async def asyncio_detailed( hosting_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Delete all ModSecurity rules - Disable all ModSecurity rules for a hosting + Enables again all the ModSecurity rules disabled on the hosting: ModSecurity applies them again and + their `included` becomes false. The rules stay in the list Args: hosting_id (int): @@ -149,7 +155,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -165,10 +171,11 @@ async def asyncio( hosting_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Delete all ModSecurity rules - Disable all ModSecurity rules for a hosting + Enables again all the ModSecurity rules disabled on the hosting: ModSecurity applies them again and + their `included` becomes false. The rules stay in the list Args: hosting_id (int): @@ -178,7 +185,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return ( diff --git a/src/shellrent_sdk/client/api/hosting/delete_hosting_allow_list_entry.py b/src/shellrent_sdk/client/api/hosting/delete_hosting_allow_list_entry.py index c234133..9c2afe9 100644 --- a/src/shellrent_sdk/client/api/hosting/delete_hosting_allow_list_entry.py +++ b/src/shellrent_sdk/client/api/hosting/delete_hosting_allow_list_entry.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, cast from urllib.parse import quote import httpx @@ -7,7 +7,6 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.empty_response import EmptyResponse from ...types import Response @@ -29,11 +28,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | EmptyResponse | None: - if response.status_code == 200: - response_200 = EmptyResponse.from_dict(response.json()) - - return response_200 +) -> Any | ApiError | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -60,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -68,7 +71,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -82,7 +85,7 @@ def sync_detailed( allow_list_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Delete allow list entry Delete an allow list entry for hosting @@ -96,7 +99,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -116,7 +119,7 @@ def sync( allow_list_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Delete allow list entry Delete an allow list entry for hosting @@ -130,7 +133,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return sync_detailed( @@ -145,7 +148,7 @@ async def asyncio_detailed( allow_list_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Delete allow list entry Delete an allow list entry for hosting @@ -159,7 +162,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -177,7 +180,7 @@ async def asyncio( allow_list_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Delete allow list entry Delete an allow list entry for hosting @@ -191,7 +194,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return ( diff --git a/src/shellrent_sdk/client/api/hosting/delete_hosting_block_list_entry.py b/src/shellrent_sdk/client/api/hosting/delete_hosting_block_list_entry.py index 6141708..ed76640 100644 --- a/src/shellrent_sdk/client/api/hosting/delete_hosting_block_list_entry.py +++ b/src/shellrent_sdk/client/api/hosting/delete_hosting_block_list_entry.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, cast from urllib.parse import quote import httpx @@ -7,7 +7,6 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.empty_response import EmptyResponse from ...types import Response @@ -29,11 +28,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | EmptyResponse | None: - if response.status_code == 200: - response_200 = EmptyResponse.from_dict(response.json()) - - return response_200 +) -> Any | ApiError | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -60,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -68,7 +71,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -82,7 +85,7 @@ def sync_detailed( block_list_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Delete block list entry Delete a block list entry for hosting @@ -96,7 +99,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -116,7 +119,7 @@ def sync( block_list_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Delete block list entry Delete a block list entry for hosting @@ -130,7 +133,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return sync_detailed( @@ -145,7 +148,7 @@ async def asyncio_detailed( block_list_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Delete block list entry Delete a block list entry for hosting @@ -159,7 +162,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -177,7 +180,7 @@ async def asyncio( block_list_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Delete block list entry Delete a block list entry for hosting @@ -191,7 +194,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return ( diff --git a/src/shellrent_sdk/client/api/hosting/delete_hosting_catch_all.py b/src/shellrent_sdk/client/api/hosting/delete_hosting_catch_all.py index 3f982de..afd4525 100644 --- a/src/shellrent_sdk/client/api/hosting/delete_hosting_catch_all.py +++ b/src/shellrent_sdk/client/api/hosting/delete_hosting_catch_all.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, cast from urllib.parse import quote import httpx @@ -7,7 +7,6 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.empty_response import EmptyResponse from ...types import Response @@ -27,11 +26,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | EmptyResponse | None: - if response.status_code == 200: - response_200 = EmptyResponse.from_dict(response.json()) - - return response_200 +) -> Any | ApiError | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -53,11 +51,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -66,7 +74,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +87,7 @@ def sync_detailed( hosting_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Delete catch-all alias Delete the catch-all alias @@ -92,7 +100,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -110,7 +118,7 @@ def sync( hosting_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Delete catch-all alias Delete the catch-all alias @@ -123,7 +131,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return sync_detailed( @@ -136,7 +144,7 @@ async def asyncio_detailed( hosting_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Delete catch-all alias Delete the catch-all alias @@ -149,7 +157,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -165,7 +173,7 @@ async def asyncio( hosting_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Delete catch-all alias Delete the catch-all alias @@ -178,7 +186,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return ( diff --git a/src/shellrent_sdk/client/api/hosting/delete_hosting_cronjob.py b/src/shellrent_sdk/client/api/hosting/delete_hosting_cronjob.py index 6019153..9c72320 100644 --- a/src/shellrent_sdk/client/api/hosting/delete_hosting_cronjob.py +++ b/src/shellrent_sdk/client/api/hosting/delete_hosting_cronjob.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, cast from urllib.parse import quote import httpx @@ -7,20 +7,19 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.empty_response import EmptyResponse from ...types import Response def _get_kwargs( hosting_id: int, - cronjob_id: int, + cron_job_id: int, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", - "url": "/api/v3/hostings/{hosting_id}/cronjobs/{cronjob_id}".format( + "url": "/api/v3/hostings/{hosting_id}/cron-jobs/{cron_job_id}".format( hosting_id=quote(str(hosting_id), safe=""), - cronjob_id=quote(str(cronjob_id), safe=""), + cron_job_id=quote(str(cron_job_id), safe=""), ), } @@ -29,11 +28,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | EmptyResponse | None: - if response.status_code == 200: - response_200 = EmptyResponse.from_dict(response.json()) - - return response_200 +) -> Any | ApiError | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -60,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -68,7 +71,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,29 +82,29 @@ def _build_response( def sync_detailed( hosting_id: int, - cronjob_id: int, + cron_job_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Delete hosting cronjob Delete a cronjob for hosting Args: hosting_id (int): - cronjob_id (int): + cron_job_id (int): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( hosting_id=hosting_id, - cronjob_id=cronjob_id, + cron_job_id=cron_job_id, ) response = client.get_httpx_client().request( @@ -113,58 +116,58 @@ def sync_detailed( def sync( hosting_id: int, - cronjob_id: int, + cron_job_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Delete hosting cronjob Delete a cronjob for hosting Args: hosting_id (int): - cronjob_id (int): + cron_job_id (int): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return sync_detailed( hosting_id=hosting_id, - cronjob_id=cronjob_id, + cron_job_id=cron_job_id, client=client, ).parsed async def asyncio_detailed( hosting_id: int, - cronjob_id: int, + cron_job_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Delete hosting cronjob Delete a cronjob for hosting Args: hosting_id (int): - cronjob_id (int): + cron_job_id (int): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( hosting_id=hosting_id, - cronjob_id=cronjob_id, + cron_job_id=cron_job_id, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -174,30 +177,30 @@ async def asyncio_detailed( async def asyncio( hosting_id: int, - cronjob_id: int, + cron_job_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Delete hosting cronjob Delete a cronjob for hosting Args: hosting_id (int): - cronjob_id (int): + cron_job_id (int): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return ( await asyncio_detailed( hosting_id=hosting_id, - cronjob_id=cronjob_id, + cron_job_id=cron_job_id, client=client, ) ).parsed diff --git a/src/shellrent_sdk/client/api/hosting/delete_hosting_email_alias.py b/src/shellrent_sdk/client/api/hosting/delete_hosting_email_alias.py index 44b6bec..ed70e32 100644 --- a/src/shellrent_sdk/client/api/hosting/delete_hosting_email_alias.py +++ b/src/shellrent_sdk/client/api/hosting/delete_hosting_email_alias.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, cast from urllib.parse import quote import httpx @@ -7,7 +7,6 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.empty_response import EmptyResponse from ...types import Response @@ -29,11 +28,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | EmptyResponse | None: - if response.status_code == 200: - response_200 = EmptyResponse.from_dict(response.json()) - - return response_200 +) -> Any | ApiError | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -55,11 +53,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -68,7 +76,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -82,7 +90,7 @@ def sync_detailed( alias_id: str, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Delete hosting email alias Delete an email alias @@ -96,7 +104,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -116,7 +124,7 @@ def sync( alias_id: str, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Delete hosting email alias Delete an email alias @@ -130,7 +138,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return sync_detailed( @@ -145,7 +153,7 @@ async def asyncio_detailed( alias_id: str, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Delete hosting email alias Delete an email alias @@ -159,7 +167,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -177,7 +185,7 @@ async def asyncio( alias_id: str, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Delete hosting email alias Delete an email alias @@ -191,7 +199,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return ( diff --git a/src/shellrent_sdk/client/api/hosting/delete_hosting_exposed_backup.py b/src/shellrent_sdk/client/api/hosting/delete_hosting_exposed_backup.py index dde44b3..5351c52 100644 --- a/src/shellrent_sdk/client/api/hosting/delete_hosting_exposed_backup.py +++ b/src/shellrent_sdk/client/api/hosting/delete_hosting_exposed_backup.py @@ -30,10 +30,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | TaskResponse | None: - if response.status_code == 200: - response_200 = TaskResponse.from_dict(response.json()) + if response.status_code == 202: + response_202 = TaskResponse.from_dict(response.json()) - return response_200 + return response_202 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -55,11 +55,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/hosting/delete_hosting_mod_security_rule.py b/src/shellrent_sdk/client/api/hosting/delete_hosting_mod_security_rule.py index fdfeea8..0572606 100644 --- a/src/shellrent_sdk/client/api/hosting/delete_hosting_mod_security_rule.py +++ b/src/shellrent_sdk/client/api/hosting/delete_hosting_mod_security_rule.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, cast from urllib.parse import quote import httpx @@ -7,7 +7,6 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.empty_response import EmptyResponse from ...types import Response @@ -29,11 +28,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | EmptyResponse | None: - if response.status_code == 200: - response_200 = EmptyResponse.from_dict(response.json()) - - return response_200 +) -> Any | ApiError | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -60,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -68,7 +71,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -82,10 +85,11 @@ def sync_detailed( rule_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Delete ModSecurity rule - Disable a ModSecurity rule by id + Enables again the ModSecurity rule `rule_id` on the hosting: ModSecurity applies it again and its + `included` becomes false. The rule stays in the list Args: hosting_id (int): @@ -96,7 +100,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -116,10 +120,11 @@ def sync( rule_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Delete ModSecurity rule - Disable a ModSecurity rule by id + Enables again the ModSecurity rule `rule_id` on the hosting: ModSecurity applies it again and its + `included` becomes false. The rule stays in the list Args: hosting_id (int): @@ -130,7 +135,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return sync_detailed( @@ -145,10 +150,11 @@ async def asyncio_detailed( rule_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Delete ModSecurity rule - Disable a ModSecurity rule by id + Enables again the ModSecurity rule `rule_id` on the hosting: ModSecurity applies it again and its + `included` becomes false. The rule stays in the list Args: hosting_id (int): @@ -159,7 +165,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -177,10 +183,11 @@ async def asyncio( rule_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Delete ModSecurity rule - Disable a ModSecurity rule by id + Enables again the ModSecurity rule `rule_id` on the hosting: ModSecurity applies it again and its + `included` becomes false. The rule stays in the list Args: hosting_id (int): @@ -191,7 +198,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return ( diff --git a/src/shellrent_sdk/client/api/hosting/delete_hosting_subdomain.py b/src/shellrent_sdk/client/api/hosting/delete_hosting_subdomain.py index ae8807f..8115e94 100644 --- a/src/shellrent_sdk/client/api/hosting/delete_hosting_subdomain.py +++ b/src/shellrent_sdk/client/api/hosting/delete_hosting_subdomain.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, cast from urllib.parse import quote import httpx @@ -7,7 +7,6 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.empty_response import EmptyResponse from ...types import Response @@ -27,11 +26,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | EmptyResponse | None: - if response.status_code == 200: - response_200 = EmptyResponse.from_dict(response.json()) - - return response_200 +) -> Any | ApiError | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -53,11 +51,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -66,7 +74,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,10 +87,12 @@ def sync_detailed( hosting_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Delete subdomain - Delete subdomain + Deletes a subdomain: it removes it from the web server, uninstalls its SSL certificates and, when + the DNS of the domain is a purchase of the same account, deletes its DNS record. Not available (403) + when the plan does not include subdomains; 409 on a main hosting Args: hosting_id (int): @@ -92,7 +102,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -110,10 +120,12 @@ def sync( hosting_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Delete subdomain - Delete subdomain + Deletes a subdomain: it removes it from the web server, uninstalls its SSL certificates and, when + the DNS of the domain is a purchase of the same account, deletes its DNS record. Not available (403) + when the plan does not include subdomains; 409 on a main hosting Args: hosting_id (int): @@ -123,7 +135,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return sync_detailed( @@ -136,10 +148,12 @@ async def asyncio_detailed( hosting_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Delete subdomain - Delete subdomain + Deletes a subdomain: it removes it from the web server, uninstalls its SSL certificates and, when + the DNS of the domain is a purchase of the same account, deletes its DNS record. Not available (403) + when the plan does not include subdomains; 409 on a main hosting Args: hosting_id (int): @@ -149,7 +163,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -165,10 +179,12 @@ async def asyncio( hosting_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Delete subdomain - Delete subdomain + Deletes a subdomain: it removes it from the web server, uninstalls its SSL certificates and, when + the DNS of the domain is a purchase of the same account, deletes its DNS record. Not available (403) + when the plan does not include subdomains; 409 on a main hosting Args: hosting_id (int): @@ -178,7 +194,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return ( diff --git a/src/shellrent_sdk/client/api/hosting/enable_hosting_mod_security_rules.py b/src/shellrent_sdk/client/api/hosting/enable_hosting_mod_security_rules.py index a3b9f46..3c437d8 100644 --- a/src/shellrent_sdk/client/api/hosting/enable_hosting_mod_security_rules.py +++ b/src/shellrent_sdk/client/api/hosting/enable_hosting_mod_security_rules.py @@ -67,6 +67,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -92,11 +97,12 @@ def sync_detailed( ) -> Response[ApiError | HostingModSecurityRuleListResponse]: """Enable ModSecurity rules - Enable multiple ModSecurity rules by id + Disables on the hosting the ModSecurity rules with the given ids (`rule_id`), so that ModSecurity no + longer applies them, and returns them with `included` true Args: hosting_id (int): - body (HostingModSecurityRuleBulkRequest): + body (HostingModSecurityRuleBulkRequest): Rules of the hosting to disable Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -126,11 +132,12 @@ def sync( ) -> ApiError | HostingModSecurityRuleListResponse | None: """Enable ModSecurity rules - Enable multiple ModSecurity rules by id + Disables on the hosting the ModSecurity rules with the given ids (`rule_id`), so that ModSecurity no + longer applies them, and returns them with `included` true Args: hosting_id (int): - body (HostingModSecurityRuleBulkRequest): + body (HostingModSecurityRuleBulkRequest): Rules of the hosting to disable Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -155,11 +162,12 @@ async def asyncio_detailed( ) -> Response[ApiError | HostingModSecurityRuleListResponse]: """Enable ModSecurity rules - Enable multiple ModSecurity rules by id + Disables on the hosting the ModSecurity rules with the given ids (`rule_id`), so that ModSecurity no + longer applies them, and returns them with `included` true Args: hosting_id (int): - body (HostingModSecurityRuleBulkRequest): + body (HostingModSecurityRuleBulkRequest): Rules of the hosting to disable Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -187,11 +195,12 @@ async def asyncio( ) -> ApiError | HostingModSecurityRuleListResponse | None: """Enable ModSecurity rules - Enable multiple ModSecurity rules by id + Disables on the hosting the ModSecurity rules with the given ids (`rule_id`), so that ModSecurity no + longer applies them, and returns them with `included` true Args: hosting_id (int): - body (HostingModSecurityRuleBulkRequest): + body (HostingModSecurityRuleBulkRequest): Rules of the hosting to disable Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/hosting/expose_hosting_backups.py b/src/shellrent_sdk/client/api/hosting/expose_hosting_backups.py index 567a82c..0cbfc78 100644 --- a/src/shellrent_sdk/client/api/hosting/expose_hosting_backups.py +++ b/src/shellrent_sdk/client/api/hosting/expose_hosting_backups.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/api/v3/hostings/{hosting_id}/backups/exhibit".format( + "url": "/api/v3/hostings/{hosting_id}/backups/exhibitions".format( hosting_id=quote(str(hosting_id), safe=""), ), } @@ -37,10 +37,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | TaskResponse | None: - if response.status_code == 200: - response_200 = TaskResponse.from_dict(response.json()) + if response.status_code == 202: + response_202 = TaskResponse.from_dict(response.json()) - return response_200 + return response_202 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -62,11 +62,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -92,11 +102,13 @@ def sync_detailed( ) -> Response[ApiError | TaskResponse]: """Expose hosting backups - Expose backups for hosting + Exposes a web backup, a database backup or both, chosen among those of the backup list by + `backup_id` and `category`. The exposure is asynchronous and is returned as a Task. Args: hosting_id (int): - body (HostingBackupExposeRequest): + body (HostingBackupExposeRequest): Backups to expose: they are copied, without restoring + them, into the FTP space of the hosting Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -126,11 +138,13 @@ def sync( ) -> ApiError | TaskResponse | None: """Expose hosting backups - Expose backups for hosting + Exposes a web backup, a database backup or both, chosen among those of the backup list by + `backup_id` and `category`. The exposure is asynchronous and is returned as a Task. Args: hosting_id (int): - body (HostingBackupExposeRequest): + body (HostingBackupExposeRequest): Backups to expose: they are copied, without restoring + them, into the FTP space of the hosting Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -155,11 +169,13 @@ async def asyncio_detailed( ) -> Response[ApiError | TaskResponse]: """Expose hosting backups - Expose backups for hosting + Exposes a web backup, a database backup or both, chosen among those of the backup list by + `backup_id` and `category`. The exposure is asynchronous and is returned as a Task. Args: hosting_id (int): - body (HostingBackupExposeRequest): + body (HostingBackupExposeRequest): Backups to expose: they are copied, without restoring + them, into the FTP space of the hosting Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -187,11 +203,13 @@ async def asyncio( ) -> ApiError | TaskResponse | None: """Expose hosting backups - Expose backups for hosting + Exposes a web backup, a database backup or both, chosen among those of the backup list by + `backup_id` and `category`. The exposure is asynchronous and is returned as a Task. Args: hosting_id (int): - body (HostingBackupExposeRequest): + body (HostingBackupExposeRequest): Backups to expose: they are copied, without restoring + them, into the FTP space of the hosting Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/hosting/get_hosting.py b/src/shellrent_sdk/client/api/hosting/get_hosting.py index 26506e8..6795b7a 100644 --- a/src/shellrent_sdk/client/api/hosting/get_hosting.py +++ b/src/shellrent_sdk/client/api/hosting/get_hosting.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/hosting/get_hosting_allow_list_entry.py b/src/shellrent_sdk/client/api/hosting/get_hosting_allow_list_entry.py index 2408100..f1db9ec 100644 --- a/src/shellrent_sdk/client/api/hosting/get_hosting_allow_list_entry.py +++ b/src/shellrent_sdk/client/api/hosting/get_hosting_allow_list_entry.py @@ -60,6 +60,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/hosting/get_hosting_antivirus.py b/src/shellrent_sdk/client/api/hosting/get_hosting_antivirus.py index b0b3584..f691281 100644 --- a/src/shellrent_sdk/client/api/hosting/get_hosting_antivirus.py +++ b/src/shellrent_sdk/client/api/hosting/get_hosting_antivirus.py @@ -7,7 +7,7 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.get_hosting_antivirus_response_200 import GetHostingAntivirusResponse200 +from ...models.hosting_antivirus_nullable_response import HostingAntivirusNullableResponse from ...types import Response @@ -27,9 +27,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | GetHostingAntivirusResponse200 | None: +) -> ApiError | HostingAntivirusNullableResponse | None: if response.status_code == 200: - response_200 = GetHostingAntivirusResponse200.from_dict(response.json()) + response_200 = HostingAntivirusNullableResponse.from_dict(response.json()) return response_200 @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -66,7 +71,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | GetHostingAntivirusResponse200]: +) -> Response[ApiError | HostingAntivirusNullableResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +84,7 @@ def sync_detailed( hosting_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | GetHostingAntivirusResponse200]: +) -> Response[ApiError | HostingAntivirusNullableResponse]: """Get antivirus status Get latest antivirus scan status for hosting @@ -92,7 +97,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | GetHostingAntivirusResponse200] + Response[ApiError | HostingAntivirusNullableResponse] """ kwargs = _get_kwargs( @@ -110,7 +115,7 @@ def sync( hosting_id: int, *, client: AuthenticatedClient, -) -> ApiError | GetHostingAntivirusResponse200 | None: +) -> ApiError | HostingAntivirusNullableResponse | None: """Get antivirus status Get latest antivirus scan status for hosting @@ -123,7 +128,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | GetHostingAntivirusResponse200 + ApiError | HostingAntivirusNullableResponse """ return sync_detailed( @@ -136,7 +141,7 @@ async def asyncio_detailed( hosting_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | GetHostingAntivirusResponse200]: +) -> Response[ApiError | HostingAntivirusNullableResponse]: """Get antivirus status Get latest antivirus scan status for hosting @@ -149,7 +154,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | GetHostingAntivirusResponse200] + Response[ApiError | HostingAntivirusNullableResponse] """ kwargs = _get_kwargs( @@ -165,7 +170,7 @@ async def asyncio( hosting_id: int, *, client: AuthenticatedClient, -) -> ApiError | GetHostingAntivirusResponse200 | None: +) -> ApiError | HostingAntivirusNullableResponse | None: """Get antivirus status Get latest antivirus scan status for hosting @@ -178,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | GetHostingAntivirusResponse200 + ApiError | HostingAntivirusNullableResponse """ return ( diff --git a/src/shellrent_sdk/client/api/hosting/get_hosting_antivirus_removal_scan.py b/src/shellrent_sdk/client/api/hosting/get_hosting_antivirus_removal_scan.py index 1812fa9..21f1215 100644 --- a/src/shellrent_sdk/client/api/hosting/get_hosting_antivirus_removal_scan.py +++ b/src/shellrent_sdk/client/api/hosting/get_hosting_antivirus_removal_scan.py @@ -60,6 +60,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/hosting/get_hosting_antivirus_scan.py b/src/shellrent_sdk/client/api/hosting/get_hosting_antivirus_scan.py index bf8ceb6..3eb5719 100644 --- a/src/shellrent_sdk/client/api/hosting/get_hosting_antivirus_scan.py +++ b/src/shellrent_sdk/client/api/hosting/get_hosting_antivirus_scan.py @@ -60,6 +60,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/hosting/get_hosting_backup.py b/src/shellrent_sdk/client/api/hosting/get_hosting_backup.py index 83a5349..5641238 100644 --- a/src/shellrent_sdk/client/api/hosting/get_hosting_backup.py +++ b/src/shellrent_sdk/client/api/hosting/get_hosting_backup.py @@ -60,6 +60,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -85,7 +90,8 @@ def sync_detailed( ) -> Response[ApiError | HostingBackupResponse]: """Get hosting backup - Get details of a hosting backup + Returns a backup among those of the backup list (active, successful and completed backups); any + other backup responds 404. Args: hosting_id (int): @@ -119,7 +125,8 @@ def sync( ) -> ApiError | HostingBackupResponse | None: """Get hosting backup - Get details of a hosting backup + Returns a backup among those of the backup list (active, successful and completed backups); any + other backup responds 404. Args: hosting_id (int): @@ -148,7 +155,8 @@ async def asyncio_detailed( ) -> Response[ApiError | HostingBackupResponse]: """Get hosting backup - Get details of a hosting backup + Returns a backup among those of the backup list (active, successful and completed backups); any + other backup responds 404. Args: hosting_id (int): @@ -180,7 +188,8 @@ async def asyncio( ) -> ApiError | HostingBackupResponse | None: """Get hosting backup - Get details of a hosting backup + Returns a backup among those of the backup list (active, successful and completed backups); any + other backup responds 404. Args: hosting_id (int): diff --git a/src/shellrent_sdk/client/api/hosting/get_hosting_block_list_entry.py b/src/shellrent_sdk/client/api/hosting/get_hosting_block_list_entry.py index f820331..f52f033 100644 --- a/src/shellrent_sdk/client/api/hosting/get_hosting_block_list_entry.py +++ b/src/shellrent_sdk/client/api/hosting/get_hosting_block_list_entry.py @@ -7,7 +7,7 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.hosting_email_bloc_list_response import HostingEmailBlocListResponse +from ...models.hosting_email_block_list_response import HostingEmailBlockListResponse from ...types import Response @@ -29,9 +29,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | HostingEmailBlocListResponse | None: +) -> ApiError | HostingEmailBlockListResponse | None: if response.status_code == 200: - response_200 = HostingEmailBlocListResponse.from_dict(response.json()) + response_200 = HostingEmailBlockListResponse.from_dict(response.json()) return response_200 @@ -60,6 +60,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -68,7 +73,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | HostingEmailBlocListResponse]: +) -> Response[ApiError | HostingEmailBlockListResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -82,7 +87,7 @@ def sync_detailed( block_list_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | HostingEmailBlocListResponse]: +) -> Response[ApiError | HostingEmailBlockListResponse]: """Get hosting block list entry Get block list entry details for hosting @@ -96,7 +101,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | HostingEmailBlocListResponse] + Response[ApiError | HostingEmailBlockListResponse] """ kwargs = _get_kwargs( @@ -116,7 +121,7 @@ def sync( block_list_id: int, *, client: AuthenticatedClient, -) -> ApiError | HostingEmailBlocListResponse | None: +) -> ApiError | HostingEmailBlockListResponse | None: """Get hosting block list entry Get block list entry details for hosting @@ -130,7 +135,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | HostingEmailBlocListResponse + ApiError | HostingEmailBlockListResponse """ return sync_detailed( @@ -145,7 +150,7 @@ async def asyncio_detailed( block_list_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | HostingEmailBlocListResponse]: +) -> Response[ApiError | HostingEmailBlockListResponse]: """Get hosting block list entry Get block list entry details for hosting @@ -159,7 +164,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | HostingEmailBlocListResponse] + Response[ApiError | HostingEmailBlockListResponse] """ kwargs = _get_kwargs( @@ -177,7 +182,7 @@ async def asyncio( block_list_id: int, *, client: AuthenticatedClient, -) -> ApiError | HostingEmailBlocListResponse | None: +) -> ApiError | HostingEmailBlockListResponse | None: """Get hosting block list entry Get block list entry details for hosting @@ -191,7 +196,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | HostingEmailBlocListResponse + ApiError | HostingEmailBlockListResponse """ return ( diff --git a/src/shellrent_sdk/client/api/hosting/get_hosting_catch_all.py b/src/shellrent_sdk/client/api/hosting/get_hosting_catch_all.py index 3a5acbc..638acfc 100644 --- a/src/shellrent_sdk/client/api/hosting/get_hosting_catch_all.py +++ b/src/shellrent_sdk/client/api/hosting/get_hosting_catch_all.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/hosting/get_hosting_credentials.py b/src/shellrent_sdk/client/api/hosting/get_hosting_credentials.py index 51b7fa3..e6975ee 100644 --- a/src/shellrent_sdk/client/api/hosting/get_hosting_credentials.py +++ b/src/shellrent_sdk/client/api/hosting/get_hosting_credentials.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -82,7 +87,8 @@ def sync_detailed( ) -> Response[ApiError | HostingCredentialListResponse]: """Get hosting credentials - Get hosting credentials + Lists the active FTP, secondary FTP, MySQL and MSSQL accounts of the hosting, with their passwords. + The accounts belong to the purchase: a subdomain returns those of its main hosting Args: hosting_id (int): @@ -113,7 +119,8 @@ def sync( ) -> ApiError | HostingCredentialListResponse | None: """Get hosting credentials - Get hosting credentials + Lists the active FTP, secondary FTP, MySQL and MSSQL accounts of the hosting, with their passwords. + The accounts belong to the purchase: a subdomain returns those of its main hosting Args: hosting_id (int): @@ -139,7 +146,8 @@ async def asyncio_detailed( ) -> Response[ApiError | HostingCredentialListResponse]: """Get hosting credentials - Get hosting credentials + Lists the active FTP, secondary FTP, MySQL and MSSQL accounts of the hosting, with their passwords. + The accounts belong to the purchase: a subdomain returns those of its main hosting Args: hosting_id (int): @@ -168,7 +176,8 @@ async def asyncio( ) -> ApiError | HostingCredentialListResponse | None: """Get hosting credentials - Get hosting credentials + Lists the active FTP, secondary FTP, MySQL and MSSQL accounts of the hosting, with their passwords. + The accounts belong to the purchase: a subdomain returns those of its main hosting Args: hosting_id (int): diff --git a/src/shellrent_sdk/client/api/hosting/get_hosting_cronjob.py b/src/shellrent_sdk/client/api/hosting/get_hosting_cronjob.py index bfa0819..35cbffa 100644 --- a/src/shellrent_sdk/client/api/hosting/get_hosting_cronjob.py +++ b/src/shellrent_sdk/client/api/hosting/get_hosting_cronjob.py @@ -13,14 +13,14 @@ def _get_kwargs( hosting_id: int, - cronjob_id: int, + cron_job_id: int, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v3/hostings/{hosting_id}/cronjobs/{cronjob_id}".format( + "url": "/api/v3/hostings/{hosting_id}/cron-jobs/{cron_job_id}".format( hosting_id=quote(str(hosting_id), safe=""), - cronjob_id=quote(str(cronjob_id), safe=""), + cron_job_id=quote(str(cron_job_id), safe=""), ), } @@ -60,6 +60,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -79,7 +84,7 @@ def _build_response( def sync_detailed( hosting_id: int, - cronjob_id: int, + cron_job_id: int, *, client: AuthenticatedClient, ) -> Response[ApiError | HostingCronjobResponse]: @@ -89,7 +94,7 @@ def sync_detailed( Args: hosting_id (int): - cronjob_id (int): + cron_job_id (int): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -101,7 +106,7 @@ def sync_detailed( kwargs = _get_kwargs( hosting_id=hosting_id, - cronjob_id=cronjob_id, + cron_job_id=cron_job_id, ) response = client.get_httpx_client().request( @@ -113,7 +118,7 @@ def sync_detailed( def sync( hosting_id: int, - cronjob_id: int, + cron_job_id: int, *, client: AuthenticatedClient, ) -> ApiError | HostingCronjobResponse | None: @@ -123,7 +128,7 @@ def sync( Args: hosting_id (int): - cronjob_id (int): + cron_job_id (int): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -135,14 +140,14 @@ def sync( return sync_detailed( hosting_id=hosting_id, - cronjob_id=cronjob_id, + cron_job_id=cron_job_id, client=client, ).parsed async def asyncio_detailed( hosting_id: int, - cronjob_id: int, + cron_job_id: int, *, client: AuthenticatedClient, ) -> Response[ApiError | HostingCronjobResponse]: @@ -152,7 +157,7 @@ async def asyncio_detailed( Args: hosting_id (int): - cronjob_id (int): + cron_job_id (int): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -164,7 +169,7 @@ async def asyncio_detailed( kwargs = _get_kwargs( hosting_id=hosting_id, - cronjob_id=cronjob_id, + cron_job_id=cron_job_id, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -174,7 +179,7 @@ async def asyncio_detailed( async def asyncio( hosting_id: int, - cronjob_id: int, + cron_job_id: int, *, client: AuthenticatedClient, ) -> ApiError | HostingCronjobResponse | None: @@ -184,7 +189,7 @@ async def asyncio( Args: hosting_id (int): - cronjob_id (int): + cron_job_id (int): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -197,7 +202,7 @@ async def asyncio( return ( await asyncio_detailed( hosting_id=hosting_id, - cronjob_id=cronjob_id, + cron_job_id=cron_job_id, client=client, ) ).parsed diff --git a/src/shellrent_sdk/client/api/hosting/get_hosting_database.py b/src/shellrent_sdk/client/api/hosting/get_hosting_database.py index 4c0ae4a..bf27a34 100644 --- a/src/shellrent_sdk/client/api/hosting/get_hosting_database.py +++ b/src/shellrent_sdk/client/api/hosting/get_hosting_database.py @@ -60,6 +60,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -85,7 +90,8 @@ def sync_detailed( ) -> Response[ApiError | HostingDatabaseResponse]: """Get hosting database - Get hosting database + Returns a database of the hosting, read from the database servers: `database_id` is the name of the + database. 404 when the hosting has no database with that name Args: hosting_id (int): @@ -119,7 +125,8 @@ def sync( ) -> ApiError | HostingDatabaseResponse | None: """Get hosting database - Get hosting database + Returns a database of the hosting, read from the database servers: `database_id` is the name of the + database. 404 when the hosting has no database with that name Args: hosting_id (int): @@ -148,7 +155,8 @@ async def asyncio_detailed( ) -> Response[ApiError | HostingDatabaseResponse]: """Get hosting database - Get hosting database + Returns a database of the hosting, read from the database servers: `database_id` is the name of the + database. 404 when the hosting has no database with that name Args: hosting_id (int): @@ -180,7 +188,8 @@ async def asyncio( ) -> ApiError | HostingDatabaseResponse | None: """Get hosting database - Get hosting database + Returns a database of the hosting, read from the database servers: `database_id` is the name of the + database. 404 when the hosting has no database with that name Args: hosting_id (int): diff --git a/src/shellrent_sdk/client/api/hosting/get_hosting_email_alias.py b/src/shellrent_sdk/client/api/hosting/get_hosting_email_alias.py index 6a95780..df3564c 100644 --- a/src/shellrent_sdk/client/api/hosting/get_hosting_email_alias.py +++ b/src/shellrent_sdk/client/api/hosting/get_hosting_email_alias.py @@ -60,6 +60,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/hosting/get_hosting_mod_security.py b/src/shellrent_sdk/client/api/hosting/get_hosting_mod_security.py index 2d7f32a..601e459 100644 --- a/src/shellrent_sdk/client/api/hosting/get_hosting_mod_security.py +++ b/src/shellrent_sdk/client/api/hosting/get_hosting_mod_security.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/hosting/get_hosting_mod_security_rule.py b/src/shellrent_sdk/client/api/hosting/get_hosting_mod_security_rule.py index 034b808..4fa3fe5 100644 --- a/src/shellrent_sdk/client/api/hosting/get_hosting_mod_security_rule.py +++ b/src/shellrent_sdk/client/api/hosting/get_hosting_mod_security_rule.py @@ -60,6 +60,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/hosting/get_hosting_mod_security_scan.py b/src/shellrent_sdk/client/api/hosting/get_hosting_mod_security_scan.py index dec0750..677c2e1 100644 --- a/src/shellrent_sdk/client/api/hosting/get_hosting_mod_security_scan.py +++ b/src/shellrent_sdk/client/api/hosting/get_hosting_mod_security_scan.py @@ -60,6 +60,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/hosting/get_hosting_ssl_certificate.py b/src/shellrent_sdk/client/api/hosting/get_hosting_ssl_certificate.py index 999ad91..8554219 100644 --- a/src/shellrent_sdk/client/api/hosting/get_hosting_ssl_certificate.py +++ b/src/shellrent_sdk/client/api/hosting/get_hosting_ssl_certificate.py @@ -60,6 +60,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/hosting/install_hosting_ssl_certificate.py b/src/shellrent_sdk/client/api/hosting/install_hosting_ssl_certificate.py index 1df258d..41bde30 100644 --- a/src/shellrent_sdk/client/api/hosting/install_hosting_ssl_certificate.py +++ b/src/shellrent_sdk/client/api/hosting/install_hosting_ssl_certificate.py @@ -38,10 +38,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | TaskResponse | None: - if response.status_code == 200: - response_200 = TaskResponse.from_dict(response.json()) + if response.status_code == 202: + response_202 = TaskResponse.from_dict(response.json()) - return response_200 + return response_202 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -63,11 +63,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -97,7 +107,8 @@ def sync_detailed( Args: hosting_id (int): - body (HostingSslCertificateInstallRequest | Unset): + body (HostingSslCertificateInstallRequest | Unset): SSL certificate to install on the + hosting; with no body, a Let's Encrypt certificate for the website Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -131,7 +142,8 @@ def sync( Args: hosting_id (int): - body (HostingSslCertificateInstallRequest | Unset): + body (HostingSslCertificateInstallRequest | Unset): SSL certificate to install on the + hosting; with no body, a Let's Encrypt certificate for the website Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -160,7 +172,8 @@ async def asyncio_detailed( Args: hosting_id (int): - body (HostingSslCertificateInstallRequest | Unset): + body (HostingSslCertificateInstallRequest | Unset): SSL certificate to install on the + hosting; with no body, a Let's Encrypt certificate for the website Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -192,7 +205,8 @@ async def asyncio( Args: hosting_id (int): - body (HostingSslCertificateInstallRequest | Unset): + body (HostingSslCertificateInstallRequest | Unset): SSL certificate to install on the + hosting; with no body, a Let's Encrypt certificate for the website Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/hosting/list_hosting_allow_list_entries.py b/src/shellrent_sdk/client/api/hosting/list_hosting_allow_list_entries.py index cb39be8..a1f475d 100644 --- a/src/shellrent_sdk/client/api/hosting/list_hosting_allow_list_entries.py +++ b/src/shellrent_sdk/client/api/hosting/list_hosting_allow_list_entries.py @@ -17,7 +17,7 @@ def _get_kwargs( hosting_id: int, *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -72,6 +72,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -94,7 +99,7 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | HostingEmailAllowListPaginatedListResponse]: """List hosting allow list @@ -103,7 +108,7 @@ def sync_detailed( Args: hosting_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -131,7 +136,7 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | HostingEmailAllowListPaginatedListResponse | None: """List hosting allow list @@ -140,7 +145,7 @@ def sync( Args: hosting_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -163,7 +168,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | HostingEmailAllowListPaginatedListResponse]: """List hosting allow list @@ -172,7 +177,7 @@ async def asyncio_detailed( Args: hosting_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -198,7 +203,7 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | HostingEmailAllowListPaginatedListResponse | None: """List hosting allow list @@ -207,7 +212,7 @@ async def asyncio( Args: hosting_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/hosting/list_hosting_antivirus_removal_scans.py b/src/shellrent_sdk/client/api/hosting/list_hosting_antivirus_removal_scans.py index e82c153..40e0c7d 100644 --- a/src/shellrent_sdk/client/api/hosting/list_hosting_antivirus_removal_scans.py +++ b/src/shellrent_sdk/client/api/hosting/list_hosting_antivirus_removal_scans.py @@ -17,7 +17,7 @@ def _get_kwargs( hosting_id: int, *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -72,6 +72,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -94,7 +99,7 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | HostingAntivirusRemovalScanPaginatedListResponse]: """List antivirus removal scans @@ -103,7 +108,7 @@ def sync_detailed( Args: hosting_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -131,7 +136,7 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | HostingAntivirusRemovalScanPaginatedListResponse | None: """List antivirus removal scans @@ -140,7 +145,7 @@ def sync( Args: hosting_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -163,7 +168,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | HostingAntivirusRemovalScanPaginatedListResponse]: """List antivirus removal scans @@ -172,7 +177,7 @@ async def asyncio_detailed( Args: hosting_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -198,7 +203,7 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | HostingAntivirusRemovalScanPaginatedListResponse | None: """List antivirus removal scans @@ -207,7 +212,7 @@ async def asyncio( Args: hosting_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/hosting/list_hosting_antivirus_scans.py b/src/shellrent_sdk/client/api/hosting/list_hosting_antivirus_scans.py index fce2f45..67b2cb4 100644 --- a/src/shellrent_sdk/client/api/hosting/list_hosting_antivirus_scans.py +++ b/src/shellrent_sdk/client/api/hosting/list_hosting_antivirus_scans.py @@ -17,7 +17,7 @@ def _get_kwargs( hosting_id: int, *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -72,6 +72,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -94,7 +99,7 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | HostingAntivirusScanPaginatedListResponse]: """List antivirus scans @@ -103,7 +108,7 @@ def sync_detailed( Args: hosting_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -131,7 +136,7 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | HostingAntivirusScanPaginatedListResponse | None: """List antivirus scans @@ -140,7 +145,7 @@ def sync( Args: hosting_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -163,7 +168,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | HostingAntivirusScanPaginatedListResponse]: """List antivirus scans @@ -172,7 +177,7 @@ async def asyncio_detailed( Args: hosting_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -198,7 +203,7 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | HostingAntivirusScanPaginatedListResponse | None: """List antivirus scans @@ -207,7 +212,7 @@ async def asyncio( Args: hosting_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/hosting/list_hosting_backups.py b/src/shellrent_sdk/client/api/hosting/list_hosting_backups.py index a2e87a0..16afd34 100644 --- a/src/shellrent_sdk/client/api/hosting/list_hosting_backups.py +++ b/src/shellrent_sdk/client/api/hosting/list_hosting_backups.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/hosting/list_hosting_block_list_entries.py b/src/shellrent_sdk/client/api/hosting/list_hosting_block_list_entries.py index ca23806..df5f872 100644 --- a/src/shellrent_sdk/client/api/hosting/list_hosting_block_list_entries.py +++ b/src/shellrent_sdk/client/api/hosting/list_hosting_block_list_entries.py @@ -7,8 +7,8 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.hosting_email_bloc_list_paginated_list_response import ( - HostingEmailBlocListPaginatedListResponse, +from ...models.hosting_email_block_list_paginated_list_response import ( + HostingEmailBlockListPaginatedListResponse, ) from ...types import UNSET, Response, Unset @@ -17,7 +17,7 @@ def _get_kwargs( hosting_id: int, *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -41,9 +41,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | HostingEmailBlocListPaginatedListResponse | None: +) -> ApiError | HostingEmailBlockListPaginatedListResponse | None: if response.status_code == 200: - response_200 = HostingEmailBlocListPaginatedListResponse.from_dict(response.json()) + response_200 = HostingEmailBlockListPaginatedListResponse.from_dict(response.json()) return response_200 @@ -72,6 +72,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -80,7 +85,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | HostingEmailBlocListPaginatedListResponse]: +) -> Response[ApiError | HostingEmailBlockListPaginatedListResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -94,8 +99,8 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, -) -> Response[ApiError | HostingEmailBlocListPaginatedListResponse]: + per_page: int | Unset = 20, +) -> Response[ApiError | HostingEmailBlockListPaginatedListResponse]: """List hosting block list Get list of block list entries for hosting @@ -103,14 +108,14 @@ def sync_detailed( Args: hosting_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | HostingEmailBlocListPaginatedListResponse] + Response[ApiError | HostingEmailBlockListPaginatedListResponse] """ kwargs = _get_kwargs( @@ -131,8 +136,8 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, -) -> ApiError | HostingEmailBlocListPaginatedListResponse | None: + per_page: int | Unset = 20, +) -> ApiError | HostingEmailBlockListPaginatedListResponse | None: """List hosting block list Get list of block list entries for hosting @@ -140,14 +145,14 @@ def sync( Args: hosting_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | HostingEmailBlocListPaginatedListResponse + ApiError | HostingEmailBlockListPaginatedListResponse """ return sync_detailed( @@ -163,8 +168,8 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, -) -> Response[ApiError | HostingEmailBlocListPaginatedListResponse]: + per_page: int | Unset = 20, +) -> Response[ApiError | HostingEmailBlockListPaginatedListResponse]: """List hosting block list Get list of block list entries for hosting @@ -172,14 +177,14 @@ async def asyncio_detailed( Args: hosting_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | HostingEmailBlocListPaginatedListResponse] + Response[ApiError | HostingEmailBlockListPaginatedListResponse] """ kwargs = _get_kwargs( @@ -198,8 +203,8 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, -) -> ApiError | HostingEmailBlocListPaginatedListResponse | None: + per_page: int | Unset = 20, +) -> ApiError | HostingEmailBlockListPaginatedListResponse | None: """List hosting block list Get list of block list entries for hosting @@ -207,14 +212,14 @@ async def asyncio( Args: hosting_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | HostingEmailBlocListPaginatedListResponse + ApiError | HostingEmailBlockListPaginatedListResponse """ return ( diff --git a/src/shellrent_sdk/client/api/hosting/list_hosting_cronjobs.py b/src/shellrent_sdk/client/api/hosting/list_hosting_cronjobs.py index eb24c41..37a0dd6 100644 --- a/src/shellrent_sdk/client/api/hosting/list_hosting_cronjobs.py +++ b/src/shellrent_sdk/client/api/hosting/list_hosting_cronjobs.py @@ -15,7 +15,7 @@ def _get_kwargs( hosting_id: int, *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -28,7 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v3/hostings/{hosting_id}/cronjobs".format( + "url": "/api/v3/hostings/{hosting_id}/cron-jobs".format( hosting_id=quote(str(hosting_id), safe=""), ), "params": params, @@ -70,6 +70,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -92,7 +97,7 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | HostingCronjobPaginatedListResponse]: """List hosting cronjobs @@ -101,7 +106,7 @@ def sync_detailed( Args: hosting_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -129,7 +134,7 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | HostingCronjobPaginatedListResponse | None: """List hosting cronjobs @@ -138,7 +143,7 @@ def sync( Args: hosting_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -161,7 +166,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | HostingCronjobPaginatedListResponse]: """List hosting cronjobs @@ -170,7 +175,7 @@ async def asyncio_detailed( Args: hosting_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -196,7 +201,7 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | HostingCronjobPaginatedListResponse | None: """List hosting cronjobs @@ -205,7 +210,7 @@ async def asyncio( Args: hosting_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/hosting/list_hosting_databases.py b/src/shellrent_sdk/client/api/hosting/list_hosting_databases.py index c77680e..949cf6e 100644 --- a/src/shellrent_sdk/client/api/hosting/list_hosting_databases.py +++ b/src/shellrent_sdk/client/api/hosting/list_hosting_databases.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -82,7 +87,8 @@ def sync_detailed( ) -> Response[ApiError | HostingDatabaseListResponse]: """Get hosting databases - Get hosting databases + Lists the MySQL and MSSQL databases of the hosting, read from the database servers, with the account + that owns them. The databases belong to the purchase: a subdomain returns those of its main hosting Args: hosting_id (int): @@ -113,7 +119,8 @@ def sync( ) -> ApiError | HostingDatabaseListResponse | None: """Get hosting databases - Get hosting databases + Lists the MySQL and MSSQL databases of the hosting, read from the database servers, with the account + that owns them. The databases belong to the purchase: a subdomain returns those of its main hosting Args: hosting_id (int): @@ -139,7 +146,8 @@ async def asyncio_detailed( ) -> Response[ApiError | HostingDatabaseListResponse]: """Get hosting databases - Get hosting databases + Lists the MySQL and MSSQL databases of the hosting, read from the database servers, with the account + that owns them. The databases belong to the purchase: a subdomain returns those of its main hosting Args: hosting_id (int): @@ -168,7 +176,8 @@ async def asyncio( ) -> ApiError | HostingDatabaseListResponse | None: """Get hosting databases - Get hosting databases + Lists the MySQL and MSSQL databases of the hosting, read from the database servers, with the account + that owns them. The databases belong to the purchase: a subdomain returns those of its main hosting Args: hosting_id (int): diff --git a/src/shellrent_sdk/client/api/hosting/list_hosting_dns_records.py b/src/shellrent_sdk/client/api/hosting/list_hosting_dns_records.py index 2304d03..32c0273 100644 --- a/src/shellrent_sdk/client/api/hosting/list_hosting_dns_records.py +++ b/src/shellrent_sdk/client/api/hosting/list_hosting_dns_records.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -82,7 +87,9 @@ def sync_detailed( ) -> Response[ApiError | HostingDnsRecordListResponse]: """Get hosting DNS records - Get hosting DNS records + Lists the default DNS records of the hosting: those of its web server and of its mail server, which + point the domain to the hosting. They are not read from the DNS zone of the domain; a subdomain + returns those of its main hosting Args: hosting_id (int): @@ -113,7 +120,9 @@ def sync( ) -> ApiError | HostingDnsRecordListResponse | None: """Get hosting DNS records - Get hosting DNS records + Lists the default DNS records of the hosting: those of its web server and of its mail server, which + point the domain to the hosting. They are not read from the DNS zone of the domain; a subdomain + returns those of its main hosting Args: hosting_id (int): @@ -139,7 +148,9 @@ async def asyncio_detailed( ) -> Response[ApiError | HostingDnsRecordListResponse]: """Get hosting DNS records - Get hosting DNS records + Lists the default DNS records of the hosting: those of its web server and of its mail server, which + point the domain to the hosting. They are not read from the DNS zone of the domain; a subdomain + returns those of its main hosting Args: hosting_id (int): @@ -168,7 +179,9 @@ async def asyncio( ) -> ApiError | HostingDnsRecordListResponse | None: """Get hosting DNS records - Get hosting DNS records + Lists the default DNS records of the hosting: those of its web server and of its mail server, which + point the domain to the hosting. They are not read from the DNS zone of the domain; a subdomain + returns those of its main hosting Args: hosting_id (int): diff --git a/src/shellrent_sdk/client/api/hosting/list_hosting_email_aliases.py b/src/shellrent_sdk/client/api/hosting/list_hosting_email_aliases.py index 39b9c59..b1864ca 100644 --- a/src/shellrent_sdk/client/api/hosting/list_hosting_email_aliases.py +++ b/src/shellrent_sdk/client/api/hosting/list_hosting_email_aliases.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/hosting/list_hosting_exposed_backups.py b/src/shellrent_sdk/client/api/hosting/list_hosting_exposed_backups.py index 6b2ea03..1285795 100644 --- a/src/shellrent_sdk/client/api/hosting/list_hosting_exposed_backups.py +++ b/src/shellrent_sdk/client/api/hosting/list_hosting_exposed_backups.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/hosting/list_hosting_mod_security_rules.py b/src/shellrent_sdk/client/api/hosting/list_hosting_mod_security_rules.py index 66a5a4e..ceae22c 100644 --- a/src/shellrent_sdk/client/api/hosting/list_hosting_mod_security_rules.py +++ b/src/shellrent_sdk/client/api/hosting/list_hosting_mod_security_rules.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -82,7 +87,8 @@ def sync_detailed( ) -> Response[ApiError | HostingModSecurityRuleListResponse]: """List ModSecurity rules - Get ModSecurity rules for a hosting + Lists the ModSecurity rules of the hosting, found by the scans or added by hand. A rule with + `included` true is disabled on the hosting: ModSecurity does not apply it Args: hosting_id (int): @@ -113,7 +119,8 @@ def sync( ) -> ApiError | HostingModSecurityRuleListResponse | None: """List ModSecurity rules - Get ModSecurity rules for a hosting + Lists the ModSecurity rules of the hosting, found by the scans or added by hand. A rule with + `included` true is disabled on the hosting: ModSecurity does not apply it Args: hosting_id (int): @@ -139,7 +146,8 @@ async def asyncio_detailed( ) -> Response[ApiError | HostingModSecurityRuleListResponse]: """List ModSecurity rules - Get ModSecurity rules for a hosting + Lists the ModSecurity rules of the hosting, found by the scans or added by hand. A rule with + `included` true is disabled on the hosting: ModSecurity does not apply it Args: hosting_id (int): @@ -168,7 +176,8 @@ async def asyncio( ) -> ApiError | HostingModSecurityRuleListResponse | None: """List ModSecurity rules - Get ModSecurity rules for a hosting + Lists the ModSecurity rules of the hosting, found by the scans or added by hand. A rule with + `included` true is disabled on the hosting: ModSecurity does not apply it Args: hosting_id (int): diff --git a/src/shellrent_sdk/client/api/hosting/list_hosting_mod_security_scans.py b/src/shellrent_sdk/client/api/hosting/list_hosting_mod_security_scans.py index 492262b..a75a3a7 100644 --- a/src/shellrent_sdk/client/api/hosting/list_hosting_mod_security_scans.py +++ b/src/shellrent_sdk/client/api/hosting/list_hosting_mod_security_scans.py @@ -17,7 +17,7 @@ def _get_kwargs( hosting_id: int, *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -72,6 +72,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -94,7 +99,7 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | HostingModSecurityScanPaginatedListResponse]: """List ModSecurity scans @@ -103,7 +108,7 @@ def sync_detailed( Args: hosting_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -131,7 +136,7 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | HostingModSecurityScanPaginatedListResponse | None: """List ModSecurity scans @@ -140,7 +145,7 @@ def sync( Args: hosting_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -163,7 +168,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | HostingModSecurityScanPaginatedListResponse]: """List ModSecurity scans @@ -172,7 +177,7 @@ async def asyncio_detailed( Args: hosting_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -198,7 +203,7 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | HostingModSecurityScanPaginatedListResponse | None: """List ModSecurity scans @@ -207,7 +212,7 @@ async def asyncio( Args: hosting_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/hosting/list_hosting_php_versions.py b/src/shellrent_sdk/client/api/hosting/list_hosting_php_versions.py index 03fd57b..0a18a7d 100644 --- a/src/shellrent_sdk/client/api/hosting/list_hosting_php_versions.py +++ b/src/shellrent_sdk/client/api/hosting/list_hosting_php_versions.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/hosting/list_hosting_ssl_certificates.py b/src/shellrent_sdk/client/api/hosting/list_hosting_ssl_certificates.py index 44bb289..a83395d 100644 --- a/src/shellrent_sdk/client/api/hosting/list_hosting_ssl_certificates.py +++ b/src/shellrent_sdk/client/api/hosting/list_hosting_ssl_certificates.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/hosting/list_hostings.py b/src/shellrent_sdk/client/api/hosting/list_hostings.py index a80e155..58eae33 100644 --- a/src/shellrent_sdk/client/api/hosting/list_hostings.py +++ b/src/shellrent_sdk/client/api/hosting/list_hostings.py @@ -13,7 +13,7 @@ def _get_kwargs( *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -66,6 +66,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -87,15 +92,16 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | HostingPaginatedListResponse]: """List all hostings - Get a list of all hostings + Lists the active main hostings of the account, one for each hosting purchase; their subdomains are + not included Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -121,15 +127,16 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | HostingPaginatedListResponse | None: """List all hostings - Get a list of all hostings + Lists the active main hostings of the account, one for each hosting purchase; their subdomains are + not included Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -150,15 +157,16 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | HostingPaginatedListResponse]: """List all hostings - Get a list of all hostings + Lists the active main hostings of the account, one for each hosting purchase; their subdomains are + not included Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -182,15 +190,16 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | HostingPaginatedListResponse | None: """List all hostings - Get a list of all hostings + Lists the active main hostings of the account, one for each hosting purchase; their subdomains are + not included Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/hosting/remove_hosting_ssl_certificate.py b/src/shellrent_sdk/client/api/hosting/remove_hosting_ssl_certificate.py index c3aabdc..b93fbe7 100644 --- a/src/shellrent_sdk/client/api/hosting/remove_hosting_ssl_certificate.py +++ b/src/shellrent_sdk/client/api/hosting/remove_hosting_ssl_certificate.py @@ -30,10 +30,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | TaskResponse | None: - if response.status_code == 200: - response_200 = TaskResponse.from_dict(response.json()) + if response.status_code == 202: + response_202 = TaskResponse.from_dict(response.json()) - return response_200 + return response_202 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -55,11 +55,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/hosting/restore_hosting_backup.py b/src/shellrent_sdk/client/api/hosting/restore_hosting_backup.py index 15cf89e..64a738a 100644 --- a/src/shellrent_sdk/client/api/hosting/restore_hosting_backup.py +++ b/src/shellrent_sdk/client/api/hosting/restore_hosting_backup.py @@ -18,7 +18,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/api/v3/hostings/{hosting_id}/backups/{hosting_backup_id}/restore".format( + "url": "/api/v3/hostings/{hosting_id}/backups/{hosting_backup_id}/restores".format( hosting_id=quote(str(hosting_id), safe=""), hosting_backup_id=quote(str(hosting_backup_id), safe=""), ), @@ -30,10 +30,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | TaskResponse | None: - if response.status_code == 200: - response_200 = TaskResponse.from_dict(response.json()) + if response.status_code == 202: + response_202 = TaskResponse.from_dict(response.json()) - return response_200 + return response_202 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -55,11 +55,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -85,7 +95,8 @@ def sync_detailed( ) -> Response[ApiError | TaskResponse]: """Restore hosting backup - Start a restore of a hosting backup (web contents) + Starts the restore of the web contents of a backup among those of the backup list. The restore is + asynchronous and is returned as a Task. Args: hosting_id (int): @@ -119,7 +130,8 @@ def sync( ) -> ApiError | TaskResponse | None: """Restore hosting backup - Start a restore of a hosting backup (web contents) + Starts the restore of the web contents of a backup among those of the backup list. The restore is + asynchronous and is returned as a Task. Args: hosting_id (int): @@ -148,7 +160,8 @@ async def asyncio_detailed( ) -> Response[ApiError | TaskResponse]: """Restore hosting backup - Start a restore of a hosting backup (web contents) + Starts the restore of the web contents of a backup among those of the backup list. The restore is + asynchronous and is returned as a Task. Args: hosting_id (int): @@ -180,7 +193,8 @@ async def asyncio( ) -> ApiError | TaskResponse | None: """Restore hosting backup - Start a restore of a hosting backup (web contents) + Starts the restore of the web contents of a backup among those of the backup list. The restore is + asynchronous and is returned as a Task. Args: hosting_id (int): diff --git a/src/shellrent_sdk/client/api/hosting/start_hosting_antivirus_removal_scan.py b/src/shellrent_sdk/client/api/hosting/start_hosting_antivirus_removal_scan.py index a612300..6b691ea 100644 --- a/src/shellrent_sdk/client/api/hosting/start_hosting_antivirus_removal_scan.py +++ b/src/shellrent_sdk/client/api/hosting/start_hosting_antivirus_removal_scan.py @@ -28,10 +28,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | HostingAntivirusRemovalScanResponse | None: - if response.status_code == 200: - response_200 = HostingAntivirusRemovalScanResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = HostingAntivirusRemovalScanResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -53,11 +53,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/hosting/start_hosting_antivirus_scan.py b/src/shellrent_sdk/client/api/hosting/start_hosting_antivirus_scan.py index 00865de..7e2e787 100644 --- a/src/shellrent_sdk/client/api/hosting/start_hosting_antivirus_scan.py +++ b/src/shellrent_sdk/client/api/hosting/start_hosting_antivirus_scan.py @@ -28,10 +28,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | HostingAntivirusScanResponse | None: - if response.status_code == 200: - response_200 = HostingAntivirusScanResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = HostingAntivirusScanResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -53,11 +53,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/hosting/start_hosting_first_backup.py b/src/shellrent_sdk/client/api/hosting/start_hosting_first_backup.py index e4f16c9..8a65a6b 100644 --- a/src/shellrent_sdk/client/api/hosting/start_hosting_first_backup.py +++ b/src/shellrent_sdk/client/api/hosting/start_hosting_first_backup.py @@ -17,7 +17,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/api/v3/hostings/{hosting_id}/backups/first-save".format( + "url": "/api/v3/hostings/{hosting_id}/backups".format( hosting_id=quote(str(hosting_id), safe=""), ), } @@ -28,10 +28,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | TaskResponse | None: - if response.status_code == 200: - response_200 = TaskResponse.from_dict(response.json()) + if response.status_code == 202: + response_202 = TaskResponse.from_dict(response.json()) - return response_200 + return response_202 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -53,11 +53,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/hosting/update_hosting_catch_all.py b/src/shellrent_sdk/client/api/hosting/update_hosting_catch_all.py index 07781b6..d048356 100644 --- a/src/shellrent_sdk/client/api/hosting/update_hosting_catch_all.py +++ b/src/shellrent_sdk/client/api/hosting/update_hosting_catch_all.py @@ -42,6 +42,11 @@ def _parse_response( return response_200 + if response.status_code == 201: + response_201 = HostingEmailCatchAllResponse.from_dict(response.json()) + + return response_201 + if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -62,11 +67,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -90,9 +105,10 @@ def sync_detailed( client: AuthenticatedClient, body: HostingEmailCatchAllRequest, ) -> Response[ApiError | HostingEmailCatchAllResponse]: - """Update catch-all alias + """Create or replace catch-all alias - Update a catch-all alias destinations + Sets the destinations of the catch-all alias: the response is 201 when the alias is created, 200 + when it replaces the current one Args: hosting_id (int): @@ -124,9 +140,10 @@ def sync( client: AuthenticatedClient, body: HostingEmailCatchAllRequest, ) -> ApiError | HostingEmailCatchAllResponse | None: - """Update catch-all alias + """Create or replace catch-all alias - Update a catch-all alias destinations + Sets the destinations of the catch-all alias: the response is 201 when the alias is created, 200 + when it replaces the current one Args: hosting_id (int): @@ -153,9 +170,10 @@ async def asyncio_detailed( client: AuthenticatedClient, body: HostingEmailCatchAllRequest, ) -> Response[ApiError | HostingEmailCatchAllResponse]: - """Update catch-all alias + """Create or replace catch-all alias - Update a catch-all alias destinations + Sets the destinations of the catch-all alias: the response is 201 when the alias is created, 200 + when it replaces the current one Args: hosting_id (int): @@ -185,9 +203,10 @@ async def asyncio( client: AuthenticatedClient, body: HostingEmailCatchAllRequest, ) -> ApiError | HostingEmailCatchAllResponse | None: - """Update catch-all alias + """Create or replace catch-all alias - Update a catch-all alias destinations + Sets the destinations of the catch-all alias: the response is 201 when the alias is created, 200 + when it replaces the current one Args: hosting_id (int): diff --git a/src/shellrent_sdk/client/api/hosting/update_hosting_file_protection.py b/src/shellrent_sdk/client/api/hosting/update_hosting_file_protection.py index 2707819..1e82f5e 100644 --- a/src/shellrent_sdk/client/api/hosting/update_hosting_file_protection.py +++ b/src/shellrent_sdk/client/api/hosting/update_hosting_file_protection.py @@ -67,6 +67,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -92,7 +97,7 @@ def sync_detailed( ) -> Response[ApiError | HostingResponse]: """Update file protection status - Enable or disable file protection + Enable or disable file protection. Returns the updated hosting, with `file_protection_enabled` Args: hosting_id (int): @@ -126,7 +131,7 @@ def sync( ) -> ApiError | HostingResponse | None: """Update file protection status - Enable or disable file protection + Enable or disable file protection. Returns the updated hosting, with `file_protection_enabled` Args: hosting_id (int): @@ -155,7 +160,7 @@ async def asyncio_detailed( ) -> Response[ApiError | HostingResponse]: """Update file protection status - Enable or disable file protection + Enable or disable file protection. Returns the updated hosting, with `file_protection_enabled` Args: hosting_id (int): @@ -187,7 +192,7 @@ async def asyncio( ) -> ApiError | HostingResponse | None: """Update file protection status - Enable or disable file protection + Enable or disable file protection. Returns the updated hosting, with `file_protection_enabled` Args: hosting_id (int): diff --git a/src/shellrent_sdk/client/api/hosting/update_hosting_http_version.py b/src/shellrent_sdk/client/api/hosting/update_hosting_http_version.py index 7fcdd63..984e392 100644 --- a/src/shellrent_sdk/client/api/hosting/update_hosting_http_version.py +++ b/src/shellrent_sdk/client/api/hosting/update_hosting_http_version.py @@ -62,11 +62,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -92,7 +102,9 @@ def sync_detailed( ) -> Response[ApiError | HostingResponse]: """Update HTTP version - Change HTTP version for hosting + Change HTTP version for hosting. Returns the updated hosting, with `http_version`. Not available + (403) on a dedicated web server, on a non-Linux hosting or without multi-PHP; 409 while the purchase + is suspended or the hosting is under maintenance Args: hosting_id (int): @@ -126,7 +138,9 @@ def sync( ) -> ApiError | HostingResponse | None: """Update HTTP version - Change HTTP version for hosting + Change HTTP version for hosting. Returns the updated hosting, with `http_version`. Not available + (403) on a dedicated web server, on a non-Linux hosting or without multi-PHP; 409 while the purchase + is suspended or the hosting is under maintenance Args: hosting_id (int): @@ -155,7 +169,9 @@ async def asyncio_detailed( ) -> Response[ApiError | HostingResponse]: """Update HTTP version - Change HTTP version for hosting + Change HTTP version for hosting. Returns the updated hosting, with `http_version`. Not available + (403) on a dedicated web server, on a non-Linux hosting or without multi-PHP; 409 while the purchase + is suspended or the hosting is under maintenance Args: hosting_id (int): @@ -187,7 +203,9 @@ async def asyncio( ) -> ApiError | HostingResponse | None: """Update HTTP version - Change HTTP version for hosting + Change HTTP version for hosting. Returns the updated hosting, with `http_version`. Not available + (403) on a dedicated web server, on a non-Linux hosting or without multi-PHP; 409 while the purchase + is suspended or the hosting is under maintenance Args: hosting_id (int): diff --git a/src/shellrent_sdk/client/api/hosting/update_hosting_mod_security.py b/src/shellrent_sdk/client/api/hosting/update_hosting_mod_security.py index 352d459..02c2445 100644 --- a/src/shellrent_sdk/client/api/hosting/update_hosting_mod_security.py +++ b/src/shellrent_sdk/client/api/hosting/update_hosting_mod_security.py @@ -67,6 +67,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/hosting/update_hosting_php_settings.py b/src/shellrent_sdk/client/api/hosting/update_hosting_php_settings.py index 843a6b9..ca9537d 100644 --- a/src/shellrent_sdk/client/api/hosting/update_hosting_php_settings.py +++ b/src/shellrent_sdk/client/api/hosting/update_hosting_php_settings.py @@ -62,11 +62,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -92,7 +102,10 @@ def sync_detailed( ) -> Response[ApiError | HostingResponse]: """Update PHP settings - Update a PHP setting for hosting + Update a PHP setting for hosting. Returns the updated hosting: `php_settings` lists the directives + changed from the default value of the web server. Not available (403) on a dedicated web server, on + a non-Linux hosting or without multi-PHP; 409 while the purchase is suspended or the hosting is + under maintenance Args: hosting_id (int): @@ -126,7 +139,10 @@ def sync( ) -> ApiError | HostingResponse | None: """Update PHP settings - Update a PHP setting for hosting + Update a PHP setting for hosting. Returns the updated hosting: `php_settings` lists the directives + changed from the default value of the web server. Not available (403) on a dedicated web server, on + a non-Linux hosting or without multi-PHP; 409 while the purchase is suspended or the hosting is + under maintenance Args: hosting_id (int): @@ -155,7 +171,10 @@ async def asyncio_detailed( ) -> Response[ApiError | HostingResponse]: """Update PHP settings - Update a PHP setting for hosting + Update a PHP setting for hosting. Returns the updated hosting: `php_settings` lists the directives + changed from the default value of the web server. Not available (403) on a dedicated web server, on + a non-Linux hosting or without multi-PHP; 409 while the purchase is suspended or the hosting is + under maintenance Args: hosting_id (int): @@ -187,7 +206,10 @@ async def asyncio( ) -> ApiError | HostingResponse | None: """Update PHP settings - Update a PHP setting for hosting + Update a PHP setting for hosting. Returns the updated hosting: `php_settings` lists the directives + changed from the default value of the web server. Not available (403) on a dedicated web server, on + a non-Linux hosting or without multi-PHP; 409 while the purchase is suspended or the hosting is + under maintenance Args: hosting_id (int): diff --git a/src/shellrent_sdk/client/api/hosting/update_hosting_php_version.py b/src/shellrent_sdk/client/api/hosting/update_hosting_php_version.py index 258ea37..5677bfc 100644 --- a/src/shellrent_sdk/client/api/hosting/update_hosting_php_version.py +++ b/src/shellrent_sdk/client/api/hosting/update_hosting_php_version.py @@ -62,11 +62,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -92,7 +102,9 @@ def sync_detailed( ) -> Response[ApiError | HostingResponse]: """Update PHP version - Change PHP version for hosting + Change PHP version for hosting. Returns the updated hosting, with `php_version`. Not available (403) + on a dedicated web server, on a non-Linux hosting or without multi-PHP; 409 while the purchase is + suspended or the hosting is under maintenance Args: hosting_id (int): @@ -126,7 +138,9 @@ def sync( ) -> ApiError | HostingResponse | None: """Update PHP version - Change PHP version for hosting + Change PHP version for hosting. Returns the updated hosting, with `php_version`. Not available (403) + on a dedicated web server, on a non-Linux hosting or without multi-PHP; 409 while the purchase is + suspended or the hosting is under maintenance Args: hosting_id (int): @@ -155,7 +169,9 @@ async def asyncio_detailed( ) -> Response[ApiError | HostingResponse]: """Update PHP version - Change PHP version for hosting + Change PHP version for hosting. Returns the updated hosting, with `php_version`. Not available (403) + on a dedicated web server, on a non-Linux hosting or without multi-PHP; 409 while the purchase is + suspended or the hosting is under maintenance Args: hosting_id (int): @@ -187,7 +203,9 @@ async def asyncio( ) -> ApiError | HostingResponse | None: """Update PHP version - Change PHP version for hosting + Change PHP version for hosting. Returns the updated hosting, with `php_version`. Not available (403) + on a dedicated web server, on a non-Linux hosting or without multi-PHP; 409 while the purchase is + suspended or the hosting is under maintenance Args: hosting_id (int): diff --git a/src/shellrent_sdk/client/api/license_/downgrade_microsoft_365_subscription_quantity.py b/src/shellrent_sdk/client/api/license_/downgrade_microsoft_365_subscription_quantity.py index adfc077..173f2fe 100644 --- a/src/shellrent_sdk/client/api/license_/downgrade_microsoft_365_subscription_quantity.py +++ b/src/shellrent_sdk/client/api/license_/downgrade_microsoft_365_subscription_quantity.py @@ -15,16 +15,16 @@ def _get_kwargs( - microsoft365_id: int, + microsoft_365_subscription_id: int, *, body: Microsoft365SubscriptionQuantityRequest, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { - "method": "patch", - "url": "/api/v3/microsoft365-subscriptions/{microsoft365_id}/quantity-downgrade".format( - microsoft365_id=quote(str(microsoft365_id), safe=""), + "method": "post", + "url": "/api/v3/microsoft-365-subscriptions/{microsoft_365_subscription_id}/quantity-downgrades".format( + microsoft_365_subscription_id=quote(str(microsoft_365_subscription_id), safe=""), ), } @@ -39,10 +39,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | TaskResponse | None: - if response.status_code == 200: - response_200 = TaskResponse.from_dict(response.json()) + if response.status_code == 202: + response_202 = TaskResponse.from_dict(response.json()) - return response_200 + return response_202 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -64,11 +64,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -87,7 +97,7 @@ def _build_response( def sync_detailed( - microsoft365_id: int, + microsoft_365_subscription_id: int, *, client: AuthenticatedClient, body: Microsoft365SubscriptionQuantityRequest, @@ -96,8 +106,10 @@ def sync_detailed( Decrease the Microsoft 365 seats quantity. Returns the background Task created for seat removal. + Not available to sub-accounts: the response is 403 (error 1601). + Args: - microsoft365_id (int): + microsoft_365_subscription_id (int): body (Microsoft365SubscriptionQuantityRequest): Raises: @@ -109,7 +121,7 @@ def sync_detailed( """ kwargs = _get_kwargs( - microsoft365_id=microsoft365_id, + microsoft_365_subscription_id=microsoft_365_subscription_id, body=body, ) @@ -121,7 +133,7 @@ def sync_detailed( def sync( - microsoft365_id: int, + microsoft_365_subscription_id: int, *, client: AuthenticatedClient, body: Microsoft365SubscriptionQuantityRequest, @@ -130,8 +142,10 @@ def sync( Decrease the Microsoft 365 seats quantity. Returns the background Task created for seat removal. + Not available to sub-accounts: the response is 403 (error 1601). + Args: - microsoft365_id (int): + microsoft_365_subscription_id (int): body (Microsoft365SubscriptionQuantityRequest): Raises: @@ -143,14 +157,14 @@ def sync( """ return sync_detailed( - microsoft365_id=microsoft365_id, + microsoft_365_subscription_id=microsoft_365_subscription_id, client=client, body=body, ).parsed async def asyncio_detailed( - microsoft365_id: int, + microsoft_365_subscription_id: int, *, client: AuthenticatedClient, body: Microsoft365SubscriptionQuantityRequest, @@ -159,8 +173,10 @@ async def asyncio_detailed( Decrease the Microsoft 365 seats quantity. Returns the background Task created for seat removal. + Not available to sub-accounts: the response is 403 (error 1601). + Args: - microsoft365_id (int): + microsoft_365_subscription_id (int): body (Microsoft365SubscriptionQuantityRequest): Raises: @@ -172,7 +188,7 @@ async def asyncio_detailed( """ kwargs = _get_kwargs( - microsoft365_id=microsoft365_id, + microsoft_365_subscription_id=microsoft_365_subscription_id, body=body, ) @@ -182,7 +198,7 @@ async def asyncio_detailed( async def asyncio( - microsoft365_id: int, + microsoft_365_subscription_id: int, *, client: AuthenticatedClient, body: Microsoft365SubscriptionQuantityRequest, @@ -191,8 +207,10 @@ async def asyncio( Decrease the Microsoft 365 seats quantity. Returns the background Task created for seat removal. + Not available to sub-accounts: the response is 403 (error 1601). + Args: - microsoft365_id (int): + microsoft_365_subscription_id (int): body (Microsoft365SubscriptionQuantityRequest): Raises: @@ -205,7 +223,7 @@ async def asyncio( return ( await asyncio_detailed( - microsoft365_id=microsoft365_id, + microsoft_365_subscription_id=microsoft_365_subscription_id, client=client, body=body, ) diff --git a/src/shellrent_sdk/client/api/license_/downgrade_secure_mail_quantity.py b/src/shellrent_sdk/client/api/license_/downgrade_secure_mail_quantity.py deleted file mode 100644 index 908edf8..0000000 --- a/src/shellrent_sdk/client/api/license_/downgrade_secure_mail_quantity.py +++ /dev/null @@ -1,214 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.api_error import ApiError -from ...models.securemail_quantity_request import SecuremailQuantityRequest -from ...models.task_response import TaskResponse -from ...types import Response - - -def _get_kwargs( - securemail_id: int, - *, - body: SecuremailQuantityRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "patch", - "url": "/api/v3/securemails/{securemail_id}/quantity-downgrade".format( - securemail_id=quote(str(securemail_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | TaskResponse | None: - if response.status_code == 200: - response_200 = TaskResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 400: - response_400 = ApiError.from_dict(response.json()) - - return response_400 - - if response.status_code == 401: - response_401 = ApiError.from_dict(response.json()) - - return response_401 - - if response.status_code == 403: - response_403 = ApiError.from_dict(response.json()) - - return response_403 - - if response.status_code == 404: - response_404 = ApiError.from_dict(response.json()) - - return response_404 - - if response.status_code == 429: - response_429 = ApiError.from_dict(response.json()) - - return response_429 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | TaskResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - securemail_id: int, - *, - client: AuthenticatedClient, - body: SecuremailQuantityRequest, -) -> Response[ApiError | TaskResponse]: - """Downgrade SecureMail quantity - - Decrease the SecureMail protected mailboxes quantity. Returns the background Task created for the - alignment. - - Args: - securemail_id (int): - body (SecuremailQuantityRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApiError | TaskResponse] - """ - - kwargs = _get_kwargs( - securemail_id=securemail_id, - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - securemail_id: int, - *, - client: AuthenticatedClient, - body: SecuremailQuantityRequest, -) -> ApiError | TaskResponse | None: - """Downgrade SecureMail quantity - - Decrease the SecureMail protected mailboxes quantity. Returns the background Task created for the - alignment. - - Args: - securemail_id (int): - body (SecuremailQuantityRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApiError | TaskResponse - """ - - return sync_detailed( - securemail_id=securemail_id, - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - securemail_id: int, - *, - client: AuthenticatedClient, - body: SecuremailQuantityRequest, -) -> Response[ApiError | TaskResponse]: - """Downgrade SecureMail quantity - - Decrease the SecureMail protected mailboxes quantity. Returns the background Task created for the - alignment. - - Args: - securemail_id (int): - body (SecuremailQuantityRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApiError | TaskResponse] - """ - - kwargs = _get_kwargs( - securemail_id=securemail_id, - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - securemail_id: int, - *, - client: AuthenticatedClient, - body: SecuremailQuantityRequest, -) -> ApiError | TaskResponse | None: - """Downgrade SecureMail quantity - - Decrease the SecureMail protected mailboxes quantity. Returns the background Task created for the - alignment. - - Args: - securemail_id (int): - body (SecuremailQuantityRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApiError | TaskResponse - """ - - return ( - await asyncio_detailed( - securemail_id=securemail_id, - client=client, - body=body, - ) - ).parsed diff --git a/src/shellrent_sdk/client/api/license_/get_cpanel_license.py b/src/shellrent_sdk/client/api/license_/get_cpanel_license.py index 631510a..e604f90 100644 --- a/src/shellrent_sdk/client/api/license_/get_cpanel_license.py +++ b/src/shellrent_sdk/client/api/license_/get_cpanel_license.py @@ -7,7 +7,7 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.cpanel_license_response import CpanelLicenseResponse +from ...models.license_response import LicenseResponse from ...types import Response @@ -27,9 +27,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | CpanelLicenseResponse | None: +) -> ApiError | LicenseResponse | None: if response.status_code == 200: - response_200 = CpanelLicenseResponse.from_dict(response.json()) + response_200 = LicenseResponse.from_dict(response.json()) return response_200 @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -66,7 +71,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | CpanelLicenseResponse]: +) -> Response[ApiError | LicenseResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +84,7 @@ def sync_detailed( license_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | CpanelLicenseResponse]: +) -> Response[ApiError | LicenseResponse]: """Get cPanel license Get details of a cPanel license @@ -92,7 +97,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | CpanelLicenseResponse] + Response[ApiError | LicenseResponse] """ kwargs = _get_kwargs( @@ -110,7 +115,7 @@ def sync( license_id: int, *, client: AuthenticatedClient, -) -> ApiError | CpanelLicenseResponse | None: +) -> ApiError | LicenseResponse | None: """Get cPanel license Get details of a cPanel license @@ -123,7 +128,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | CpanelLicenseResponse + ApiError | LicenseResponse """ return sync_detailed( @@ -136,7 +141,7 @@ async def asyncio_detailed( license_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | CpanelLicenseResponse]: +) -> Response[ApiError | LicenseResponse]: """Get cPanel license Get details of a cPanel license @@ -149,7 +154,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | CpanelLicenseResponse] + Response[ApiError | LicenseResponse] """ kwargs = _get_kwargs( @@ -165,7 +170,7 @@ async def asyncio( license_id: int, *, client: AuthenticatedClient, -) -> ApiError | CpanelLicenseResponse | None: +) -> ApiError | LicenseResponse | None: """Get cPanel license Get details of a cPanel license @@ -178,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | CpanelLicenseResponse + ApiError | LicenseResponse """ return ( diff --git a/src/shellrent_sdk/client/api/license_/get_microsoft_365_partner_link.py b/src/shellrent_sdk/client/api/license_/get_microsoft_365_partner_link.py index e5e07d4..8ba0f13 100644 --- a/src/shellrent_sdk/client/api/license_/get_microsoft_365_partner_link.py +++ b/src/shellrent_sdk/client/api/license_/get_microsoft_365_partner_link.py @@ -17,7 +17,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v3/microsoft365-subscriptions/partner-link/{service_id}".format( + "url": "/api/v3/shop/microsoft-365/services/{service_id}/partner-link".format( service_id=quote(str(service_id), safe=""), ), } @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -84,6 +89,8 @@ def sync_detailed( Get the partner authorization link for Microsoft 365 subscriptions + Not available to sub-accounts: the response is 403 (error 1601). + Args: service_id (int): @@ -115,6 +122,8 @@ def sync( Get the partner authorization link for Microsoft 365 subscriptions + Not available to sub-accounts: the response is 403 (error 1601). + Args: service_id (int): @@ -141,6 +150,8 @@ async def asyncio_detailed( Get the partner authorization link for Microsoft 365 subscriptions + Not available to sub-accounts: the response is 403 (error 1601). + Args: service_id (int): @@ -170,6 +181,8 @@ async def asyncio( Get the partner authorization link for Microsoft 365 subscriptions + Not available to sub-accounts: the response is 403 (error 1601). + Args: service_id (int): diff --git a/src/shellrent_sdk/client/api/license_/get_microsoft_365_subscription.py b/src/shellrent_sdk/client/api/license_/get_microsoft_365_subscription.py index 39a9dfe..93591b6 100644 --- a/src/shellrent_sdk/client/api/license_/get_microsoft_365_subscription.py +++ b/src/shellrent_sdk/client/api/license_/get_microsoft_365_subscription.py @@ -12,13 +12,13 @@ def _get_kwargs( - microsoft365_id: int, + microsoft_365_subscription_id: int, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v3/microsoft365-subscriptions/{microsoft365_id}".format( - microsoft365_id=quote(str(microsoft365_id), safe=""), + "url": "/api/v3/microsoft-365-subscriptions/{microsoft_365_subscription_id}".format( + microsoft_365_subscription_id=quote(str(microsoft_365_subscription_id), safe=""), ), } @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -76,7 +81,7 @@ def _build_response( def sync_detailed( - microsoft365_id: int, + microsoft_365_subscription_id: int, *, client: AuthenticatedClient, ) -> Response[ApiError | Microsoft365Response]: @@ -85,7 +90,7 @@ def sync_detailed( Get details of a Microsoft 365 subscription Args: - microsoft365_id (int): + microsoft_365_subscription_id (int): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -96,7 +101,7 @@ def sync_detailed( """ kwargs = _get_kwargs( - microsoft365_id=microsoft365_id, + microsoft_365_subscription_id=microsoft_365_subscription_id, ) response = client.get_httpx_client().request( @@ -107,7 +112,7 @@ def sync_detailed( def sync( - microsoft365_id: int, + microsoft_365_subscription_id: int, *, client: AuthenticatedClient, ) -> ApiError | Microsoft365Response | None: @@ -116,7 +121,7 @@ def sync( Get details of a Microsoft 365 subscription Args: - microsoft365_id (int): + microsoft_365_subscription_id (int): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -127,13 +132,13 @@ def sync( """ return sync_detailed( - microsoft365_id=microsoft365_id, + microsoft_365_subscription_id=microsoft_365_subscription_id, client=client, ).parsed async def asyncio_detailed( - microsoft365_id: int, + microsoft_365_subscription_id: int, *, client: AuthenticatedClient, ) -> Response[ApiError | Microsoft365Response]: @@ -142,7 +147,7 @@ async def asyncio_detailed( Get details of a Microsoft 365 subscription Args: - microsoft365_id (int): + microsoft_365_subscription_id (int): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -153,7 +158,7 @@ async def asyncio_detailed( """ kwargs = _get_kwargs( - microsoft365_id=microsoft365_id, + microsoft_365_subscription_id=microsoft_365_subscription_id, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -162,7 +167,7 @@ async def asyncio_detailed( async def asyncio( - microsoft365_id: int, + microsoft_365_subscription_id: int, *, client: AuthenticatedClient, ) -> ApiError | Microsoft365Response | None: @@ -171,7 +176,7 @@ async def asyncio( Get details of a Microsoft 365 subscription Args: - microsoft365_id (int): + microsoft_365_subscription_id (int): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -183,7 +188,7 @@ async def asyncio( return ( await asyncio_detailed( - microsoft365_id=microsoft365_id, + microsoft_365_subscription_id=microsoft_365_subscription_id, client=client, ) ).parsed diff --git a/src/shellrent_sdk/client/api/license_/get_microsoft_365_tenant.py b/src/shellrent_sdk/client/api/license_/get_microsoft_365_tenant.py index 6fe2566..7ab3d30 100644 --- a/src/shellrent_sdk/client/api/license_/get_microsoft_365_tenant.py +++ b/src/shellrent_sdk/client/api/license_/get_microsoft_365_tenant.py @@ -17,7 +17,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v3/microsoft365-tenants/{microsoft_365_tenant_id}".format( + "url": "/api/v3/microsoft-365-tenants/{microsoft_365_tenant_id}".format( microsoft_365_tenant_id=quote(str(microsoft_365_tenant_id), safe=""), ), } @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/license_/get_plesk_license.py b/src/shellrent_sdk/client/api/license_/get_plesk_license.py index 6dcff53..4e0a3cd 100644 --- a/src/shellrent_sdk/client/api/license_/get_plesk_license.py +++ b/src/shellrent_sdk/client/api/license_/get_plesk_license.py @@ -7,7 +7,7 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.plesk_license_response import PleskLicenseResponse +from ...models.license_response import LicenseResponse from ...types import Response @@ -27,9 +27,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | PleskLicenseResponse | None: +) -> ApiError | LicenseResponse | None: if response.status_code == 200: - response_200 = PleskLicenseResponse.from_dict(response.json()) + response_200 = LicenseResponse.from_dict(response.json()) return response_200 @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -66,7 +71,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | PleskLicenseResponse]: +) -> Response[ApiError | LicenseResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +84,7 @@ def sync_detailed( license_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | PleskLicenseResponse]: +) -> Response[ApiError | LicenseResponse]: """Get Plesk license Get details of a Plesk license @@ -92,7 +97,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | PleskLicenseResponse] + Response[ApiError | LicenseResponse] """ kwargs = _get_kwargs( @@ -110,7 +115,7 @@ def sync( license_id: int, *, client: AuthenticatedClient, -) -> ApiError | PleskLicenseResponse | None: +) -> ApiError | LicenseResponse | None: """Get Plesk license Get details of a Plesk license @@ -123,7 +128,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | PleskLicenseResponse + ApiError | LicenseResponse """ return sync_detailed( @@ -136,7 +141,7 @@ async def asyncio_detailed( license_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | PleskLicenseResponse]: +) -> Response[ApiError | LicenseResponse]: """Get Plesk license Get details of a Plesk license @@ -149,7 +154,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | PleskLicenseResponse] + Response[ApiError | LicenseResponse] """ kwargs = _get_kwargs( @@ -165,7 +170,7 @@ async def asyncio( license_id: int, *, client: AuthenticatedClient, -) -> ApiError | PleskLicenseResponse | None: +) -> ApiError | LicenseResponse | None: """Get Plesk license Get details of a Plesk license @@ -178,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | PleskLicenseResponse + ApiError | LicenseResponse """ return ( diff --git a/src/shellrent_sdk/client/api/license_/get_secure_mail_statistics.py b/src/shellrent_sdk/client/api/license_/get_secure_mail_statistics.py deleted file mode 100644 index 29aa81c..0000000 --- a/src/shellrent_sdk/client/api/license_/get_secure_mail_statistics.py +++ /dev/null @@ -1,189 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.api_error import ApiError -from ...models.securemail_statistics_response import SecuremailStatisticsResponse -from ...types import Response - - -def _get_kwargs( - securemail_id: int, -) -> dict[str, Any]: - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/api/v3/securemails/{securemail_id}/statistics".format( - securemail_id=quote(str(securemail_id), safe=""), - ), - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | SecuremailStatisticsResponse | None: - if response.status_code == 200: - response_200 = SecuremailStatisticsResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 400: - response_400 = ApiError.from_dict(response.json()) - - return response_400 - - if response.status_code == 401: - response_401 = ApiError.from_dict(response.json()) - - return response_401 - - if response.status_code == 403: - response_403 = ApiError.from_dict(response.json()) - - return response_403 - - if response.status_code == 404: - response_404 = ApiError.from_dict(response.json()) - - return response_404 - - if response.status_code == 429: - response_429 = ApiError.from_dict(response.json()) - - return response_429 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | SecuremailStatisticsResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - securemail_id: int, - *, - client: AuthenticatedClient, -) -> Response[ApiError | SecuremailStatisticsResponse]: - """Get SecureMail statistics - - Get statistics for a SecureMail by LibraESVA subscription - - Args: - securemail_id (int): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApiError | SecuremailStatisticsResponse] - """ - - kwargs = _get_kwargs( - securemail_id=securemail_id, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - securemail_id: int, - *, - client: AuthenticatedClient, -) -> ApiError | SecuremailStatisticsResponse | None: - """Get SecureMail statistics - - Get statistics for a SecureMail by LibraESVA subscription - - Args: - securemail_id (int): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApiError | SecuremailStatisticsResponse - """ - - return sync_detailed( - securemail_id=securemail_id, - client=client, - ).parsed - - -async def asyncio_detailed( - securemail_id: int, - *, - client: AuthenticatedClient, -) -> Response[ApiError | SecuremailStatisticsResponse]: - """Get SecureMail statistics - - Get statistics for a SecureMail by LibraESVA subscription - - Args: - securemail_id (int): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApiError | SecuremailStatisticsResponse] - """ - - kwargs = _get_kwargs( - securemail_id=securemail_id, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - securemail_id: int, - *, - client: AuthenticatedClient, -) -> ApiError | SecuremailStatisticsResponse | None: - """Get SecureMail statistics - - Get statistics for a SecureMail by LibraESVA subscription - - Args: - securemail_id (int): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApiError | SecuremailStatisticsResponse - """ - - return ( - await asyncio_detailed( - securemail_id=securemail_id, - client=client, - ) - ).parsed diff --git a/src/shellrent_sdk/client/api/license_/list_cpanel_licenses.py b/src/shellrent_sdk/client/api/license_/list_cpanel_licenses.py index 5b3b6da..1f01e1c 100644 --- a/src/shellrent_sdk/client/api/license_/list_cpanel_licenses.py +++ b/src/shellrent_sdk/client/api/license_/list_cpanel_licenses.py @@ -6,14 +6,14 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.cpanel_license_paginated_list_response import CpanelLicensePaginatedListResponse +from ...models.license_paginated_list_response import LicensePaginatedListResponse from ...types import UNSET, Response, Unset def _get_kwargs( *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -35,9 +35,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | CpanelLicensePaginatedListResponse | None: +) -> ApiError | LicensePaginatedListResponse | None: if response.status_code == 200: - response_200 = CpanelLicensePaginatedListResponse.from_dict(response.json()) + response_200 = LicensePaginatedListResponse.from_dict(response.json()) return response_200 @@ -66,6 +66,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -74,7 +79,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | CpanelLicensePaginatedListResponse]: +) -> Response[ApiError | LicensePaginatedListResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -87,22 +92,22 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, -) -> Response[ApiError | CpanelLicensePaginatedListResponse]: + per_page: int | Unset = 20, +) -> Response[ApiError | LicensePaginatedListResponse]: """List cPanel licenses Get a paginated list of cPanel licenses for the authenticated account Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | CpanelLicensePaginatedListResponse] + Response[ApiError | LicensePaginatedListResponse] """ kwargs = _get_kwargs( @@ -121,22 +126,22 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, -) -> ApiError | CpanelLicensePaginatedListResponse | None: + per_page: int | Unset = 20, +) -> ApiError | LicensePaginatedListResponse | None: """List cPanel licenses Get a paginated list of cPanel licenses for the authenticated account Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | CpanelLicensePaginatedListResponse + ApiError | LicensePaginatedListResponse """ return sync_detailed( @@ -150,22 +155,22 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, -) -> Response[ApiError | CpanelLicensePaginatedListResponse]: + per_page: int | Unset = 20, +) -> Response[ApiError | LicensePaginatedListResponse]: """List cPanel licenses Get a paginated list of cPanel licenses for the authenticated account Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | CpanelLicensePaginatedListResponse] + Response[ApiError | LicensePaginatedListResponse] """ kwargs = _get_kwargs( @@ -182,22 +187,22 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, -) -> ApiError | CpanelLicensePaginatedListResponse | None: + per_page: int | Unset = 20, +) -> ApiError | LicensePaginatedListResponse | None: """List cPanel licenses Get a paginated list of cPanel licenses for the authenticated account Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | CpanelLicensePaginatedListResponse + ApiError | LicensePaginatedListResponse """ return ( diff --git a/src/shellrent_sdk/client/api/license_/list_microsoft_365_subscriptions.py b/src/shellrent_sdk/client/api/license_/list_microsoft_365_subscriptions.py index 04093c7..9c7ce58 100644 --- a/src/shellrent_sdk/client/api/license_/list_microsoft_365_subscriptions.py +++ b/src/shellrent_sdk/client/api/license_/list_microsoft_365_subscriptions.py @@ -13,7 +13,7 @@ def _get_kwargs( *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -26,7 +26,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v3/microsoft365-subscriptions", + "url": "/api/v3/microsoft-365-subscriptions", "params": params, } @@ -66,6 +66,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -87,7 +92,7 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | Microsoft365PaginatedListResponse]: """List Microsoft 365 subscriptions @@ -95,7 +100,7 @@ def sync_detailed( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -121,7 +126,7 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | Microsoft365PaginatedListResponse | None: """List Microsoft 365 subscriptions @@ -129,7 +134,7 @@ def sync( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -150,7 +155,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | Microsoft365PaginatedListResponse]: """List Microsoft 365 subscriptions @@ -158,7 +163,7 @@ async def asyncio_detailed( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -182,7 +187,7 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | Microsoft365PaginatedListResponse | None: """List Microsoft 365 subscriptions @@ -190,7 +195,7 @@ async def asyncio( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/license_/list_microsoft_365_tenants.py b/src/shellrent_sdk/client/api/license_/list_microsoft_365_tenants.py index 762d9b7..df07379 100644 --- a/src/shellrent_sdk/client/api/license_/list_microsoft_365_tenants.py +++ b/src/shellrent_sdk/client/api/license_/list_microsoft_365_tenants.py @@ -15,7 +15,7 @@ def _get_kwargs( *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -28,7 +28,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v3/microsoft365-tenants", + "url": "/api/v3/microsoft-365-tenants", "params": params, } @@ -68,6 +68,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -89,7 +94,7 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | Microsoft365TenantPaginatedListResponse]: """List Microsoft 365 tenants @@ -97,7 +102,7 @@ def sync_detailed( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -123,7 +128,7 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | Microsoft365TenantPaginatedListResponse | None: """List Microsoft 365 tenants @@ -131,7 +136,7 @@ def sync( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -152,7 +157,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | Microsoft365TenantPaginatedListResponse]: """List Microsoft 365 tenants @@ -160,7 +165,7 @@ async def asyncio_detailed( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -184,7 +189,7 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | Microsoft365TenantPaginatedListResponse | None: """List Microsoft 365 tenants @@ -192,7 +197,7 @@ async def asyncio( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/license_/list_plesk_licenses.py b/src/shellrent_sdk/client/api/license_/list_plesk_licenses.py index 86df553..b79df39 100644 --- a/src/shellrent_sdk/client/api/license_/list_plesk_licenses.py +++ b/src/shellrent_sdk/client/api/license_/list_plesk_licenses.py @@ -6,14 +6,14 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.plesk_license_paginated_list_response import PleskLicensePaginatedListResponse +from ...models.license_paginated_list_response import LicensePaginatedListResponse from ...types import UNSET, Response, Unset def _get_kwargs( *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -35,9 +35,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | PleskLicensePaginatedListResponse | None: +) -> ApiError | LicensePaginatedListResponse | None: if response.status_code == 200: - response_200 = PleskLicensePaginatedListResponse.from_dict(response.json()) + response_200 = LicensePaginatedListResponse.from_dict(response.json()) return response_200 @@ -66,6 +66,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -74,7 +79,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | PleskLicensePaginatedListResponse]: +) -> Response[ApiError | LicensePaginatedListResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -87,22 +92,22 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, -) -> Response[ApiError | PleskLicensePaginatedListResponse]: + per_page: int | Unset = 20, +) -> Response[ApiError | LicensePaginatedListResponse]: """List Plesk licenses Get a paginated list of Plesk licenses for the authenticated account Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | PleskLicensePaginatedListResponse] + Response[ApiError | LicensePaginatedListResponse] """ kwargs = _get_kwargs( @@ -121,22 +126,22 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, -) -> ApiError | PleskLicensePaginatedListResponse | None: + per_page: int | Unset = 20, +) -> ApiError | LicensePaginatedListResponse | None: """List Plesk licenses Get a paginated list of Plesk licenses for the authenticated account Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | PleskLicensePaginatedListResponse + ApiError | LicensePaginatedListResponse """ return sync_detailed( @@ -150,22 +155,22 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, -) -> Response[ApiError | PleskLicensePaginatedListResponse]: + per_page: int | Unset = 20, +) -> Response[ApiError | LicensePaginatedListResponse]: """List Plesk licenses Get a paginated list of Plesk licenses for the authenticated account Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | PleskLicensePaginatedListResponse] + Response[ApiError | LicensePaginatedListResponse] """ kwargs = _get_kwargs( @@ -182,22 +187,22 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, -) -> ApiError | PleskLicensePaginatedListResponse | None: + per_page: int | Unset = 20, +) -> ApiError | LicensePaginatedListResponse | None: """List Plesk licenses Get a paginated list of Plesk licenses for the authenticated account Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | PleskLicensePaginatedListResponse + ApiError | LicensePaginatedListResponse """ return ( diff --git a/src/shellrent_sdk/client/api/license_/list_secure_mails.py b/src/shellrent_sdk/client/api/license_/list_secure_mails.py deleted file mode 100644 index e1a145a..0000000 --- a/src/shellrent_sdk/client/api/license_/list_secure_mails.py +++ /dev/null @@ -1,209 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.api_error import ApiError -from ...models.securemail_paginated_list_response import SecuremailPaginatedListResponse -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - page: int | Unset = 1, - per_page: int | Unset = 15, -) -> dict[str, Any]: - - params: dict[str, Any] = {} - - params["page"] = page - - params["per_page"] = per_page - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/api/v3/securemails", - "params": params, - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | SecuremailPaginatedListResponse | None: - if response.status_code == 200: - response_200 = SecuremailPaginatedListResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 400: - response_400 = ApiError.from_dict(response.json()) - - return response_400 - - if response.status_code == 401: - response_401 = ApiError.from_dict(response.json()) - - return response_401 - - if response.status_code == 403: - response_403 = ApiError.from_dict(response.json()) - - return response_403 - - if response.status_code == 404: - response_404 = ApiError.from_dict(response.json()) - - return response_404 - - if response.status_code == 429: - response_429 = ApiError.from_dict(response.json()) - - return response_429 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | SecuremailPaginatedListResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - per_page: int | Unset = 15, -) -> Response[ApiError | SecuremailPaginatedListResponse]: - """List SecureMail subscriptions - - Get a paginated list of SecureMail by LibraESVA subscriptions for the authenticated account - - Args: - page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApiError | SecuremailPaginatedListResponse] - """ - - kwargs = _get_kwargs( - page=page, - per_page=per_page, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - per_page: int | Unset = 15, -) -> ApiError | SecuremailPaginatedListResponse | None: - """List SecureMail subscriptions - - Get a paginated list of SecureMail by LibraESVA subscriptions for the authenticated account - - Args: - page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApiError | SecuremailPaginatedListResponse - """ - - return sync_detailed( - client=client, - page=page, - per_page=per_page, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - per_page: int | Unset = 15, -) -> Response[ApiError | SecuremailPaginatedListResponse]: - """List SecureMail subscriptions - - Get a paginated list of SecureMail by LibraESVA subscriptions for the authenticated account - - Args: - page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApiError | SecuremailPaginatedListResponse] - """ - - kwargs = _get_kwargs( - page=page, - per_page=per_page, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - page: int | Unset = 1, - per_page: int | Unset = 15, -) -> ApiError | SecuremailPaginatedListResponse | None: - """List SecureMail subscriptions - - Get a paginated list of SecureMail by LibraESVA subscriptions for the authenticated account - - Args: - page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApiError | SecuremailPaginatedListResponse - """ - - return ( - await asyncio_detailed( - client=client, - page=page, - per_page=per_page, - ) - ).parsed diff --git a/src/shellrent_sdk/client/api/license_/upgrade_microsoft_365_subscription_quantity.py b/src/shellrent_sdk/client/api/license_/upgrade_microsoft_365_subscription_quantity.py index d4c7d2b..4263693 100644 --- a/src/shellrent_sdk/client/api/license_/upgrade_microsoft_365_subscription_quantity.py +++ b/src/shellrent_sdk/client/api/license_/upgrade_microsoft_365_subscription_quantity.py @@ -15,7 +15,7 @@ def _get_kwargs( - microsoft365_id: int, + microsoft_365_subscription_id: int, *, body: Microsoft365SubscriptionQuantityRequest, ) -> dict[str, Any]: @@ -23,8 +23,8 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/api/v3/microsoft365-subscriptions/{microsoft365_id}/quantity-upgrade".format( - microsoft365_id=quote(str(microsoft365_id), safe=""), + "url": "/api/v3/microsoft-365-subscriptions/{microsoft_365_subscription_id}/quantity-upgrades".format( + microsoft_365_subscription_id=quote(str(microsoft_365_subscription_id), safe=""), ), } @@ -39,10 +39,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | OrderResponse | None: - if response.status_code == 200: - response_200 = OrderResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = OrderResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -64,11 +64,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -87,7 +97,7 @@ def _build_response( def sync_detailed( - microsoft365_id: int, + microsoft_365_subscription_id: int, *, client: AuthenticatedClient, body: Microsoft365SubscriptionQuantityRequest, @@ -96,8 +106,10 @@ def sync_detailed( Increase the Microsoft 365 seats quantity. Returns the generated Order to pay the additional seats. + Not available to sub-accounts: the response is 403 (error 1601). + Args: - microsoft365_id (int): + microsoft_365_subscription_id (int): body (Microsoft365SubscriptionQuantityRequest): Raises: @@ -109,7 +121,7 @@ def sync_detailed( """ kwargs = _get_kwargs( - microsoft365_id=microsoft365_id, + microsoft_365_subscription_id=microsoft_365_subscription_id, body=body, ) @@ -121,7 +133,7 @@ def sync_detailed( def sync( - microsoft365_id: int, + microsoft_365_subscription_id: int, *, client: AuthenticatedClient, body: Microsoft365SubscriptionQuantityRequest, @@ -130,8 +142,10 @@ def sync( Increase the Microsoft 365 seats quantity. Returns the generated Order to pay the additional seats. + Not available to sub-accounts: the response is 403 (error 1601). + Args: - microsoft365_id (int): + microsoft_365_subscription_id (int): body (Microsoft365SubscriptionQuantityRequest): Raises: @@ -143,14 +157,14 @@ def sync( """ return sync_detailed( - microsoft365_id=microsoft365_id, + microsoft_365_subscription_id=microsoft_365_subscription_id, client=client, body=body, ).parsed async def asyncio_detailed( - microsoft365_id: int, + microsoft_365_subscription_id: int, *, client: AuthenticatedClient, body: Microsoft365SubscriptionQuantityRequest, @@ -159,8 +173,10 @@ async def asyncio_detailed( Increase the Microsoft 365 seats quantity. Returns the generated Order to pay the additional seats. + Not available to sub-accounts: the response is 403 (error 1601). + Args: - microsoft365_id (int): + microsoft_365_subscription_id (int): body (Microsoft365SubscriptionQuantityRequest): Raises: @@ -172,7 +188,7 @@ async def asyncio_detailed( """ kwargs = _get_kwargs( - microsoft365_id=microsoft365_id, + microsoft_365_subscription_id=microsoft_365_subscription_id, body=body, ) @@ -182,7 +198,7 @@ async def asyncio_detailed( async def asyncio( - microsoft365_id: int, + microsoft_365_subscription_id: int, *, client: AuthenticatedClient, body: Microsoft365SubscriptionQuantityRequest, @@ -191,8 +207,10 @@ async def asyncio( Increase the Microsoft 365 seats quantity. Returns the generated Order to pay the additional seats. + Not available to sub-accounts: the response is 403 (error 1601). + Args: - microsoft365_id (int): + microsoft_365_subscription_id (int): body (Microsoft365SubscriptionQuantityRequest): Raises: @@ -205,7 +223,7 @@ async def asyncio( return ( await asyncio_detailed( - microsoft365_id=microsoft365_id, + microsoft_365_subscription_id=microsoft_365_subscription_id, client=client, body=body, ) diff --git a/src/shellrent_sdk/client/api/license_/upgrade_secure_mail_quantity.py b/src/shellrent_sdk/client/api/license_/upgrade_secure_mail_quantity.py deleted file mode 100644 index 5c3aaf1..0000000 --- a/src/shellrent_sdk/client/api/license_/upgrade_secure_mail_quantity.py +++ /dev/null @@ -1,214 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.api_error import ApiError -from ...models.order_response import OrderResponse -from ...models.securemail_quantity_request import SecuremailQuantityRequest -from ...types import Response - - -def _get_kwargs( - securemail_id: int, - *, - body: SecuremailQuantityRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/api/v3/securemails/{securemail_id}/quantity-upgrade".format( - securemail_id=quote(str(securemail_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | OrderResponse | None: - if response.status_code == 200: - response_200 = OrderResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 400: - response_400 = ApiError.from_dict(response.json()) - - return response_400 - - if response.status_code == 401: - response_401 = ApiError.from_dict(response.json()) - - return response_401 - - if response.status_code == 403: - response_403 = ApiError.from_dict(response.json()) - - return response_403 - - if response.status_code == 404: - response_404 = ApiError.from_dict(response.json()) - - return response_404 - - if response.status_code == 429: - response_429 = ApiError.from_dict(response.json()) - - return response_429 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | OrderResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - securemail_id: int, - *, - client: AuthenticatedClient, - body: SecuremailQuantityRequest, -) -> Response[ApiError | OrderResponse]: - """Upgrade SecureMail quantity - - Increase the SecureMail protected mailboxes quantity. Returns the generated Order to pay the - additional mailboxes. - - Args: - securemail_id (int): - body (SecuremailQuantityRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApiError | OrderResponse] - """ - - kwargs = _get_kwargs( - securemail_id=securemail_id, - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - securemail_id: int, - *, - client: AuthenticatedClient, - body: SecuremailQuantityRequest, -) -> ApiError | OrderResponse | None: - """Upgrade SecureMail quantity - - Increase the SecureMail protected mailboxes quantity. Returns the generated Order to pay the - additional mailboxes. - - Args: - securemail_id (int): - body (SecuremailQuantityRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApiError | OrderResponse - """ - - return sync_detailed( - securemail_id=securemail_id, - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - securemail_id: int, - *, - client: AuthenticatedClient, - body: SecuremailQuantityRequest, -) -> Response[ApiError | OrderResponse]: - """Upgrade SecureMail quantity - - Increase the SecureMail protected mailboxes quantity. Returns the generated Order to pay the - additional mailboxes. - - Args: - securemail_id (int): - body (SecuremailQuantityRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApiError | OrderResponse] - """ - - kwargs = _get_kwargs( - securemail_id=securemail_id, - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - securemail_id: int, - *, - client: AuthenticatedClient, - body: SecuremailQuantityRequest, -) -> ApiError | OrderResponse | None: - """Upgrade SecureMail quantity - - Increase the SecureMail protected mailboxes quantity. Returns the generated Order to pay the - additional mailboxes. - - Args: - securemail_id (int): - body (SecuremailQuantityRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApiError | OrderResponse - """ - - return ( - await asyncio_detailed( - securemail_id=securemail_id, - client=client, - body=body, - ) - ).parsed diff --git a/src/shellrent_sdk/client/api/monitoring/create_server_monitoring_probe.py b/src/shellrent_sdk/client/api/monitoring/create_server_monitoring_probe.py index 50876e8..540db5c 100644 --- a/src/shellrent_sdk/client/api/monitoring/create_server_monitoring_probe.py +++ b/src/shellrent_sdk/client/api/monitoring/create_server_monitoring_probe.py @@ -37,10 +37,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | ServerMonitoringProbeResponse | None: - if response.status_code == 200: - response_200 = ServerMonitoringProbeResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = ServerMonitoringProbeResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -62,11 +62,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/monitoring/delete_server_monitoring_probe.py b/src/shellrent_sdk/client/api/monitoring/delete_server_monitoring_probe.py index 288550c..3c7f09f 100644 --- a/src/shellrent_sdk/client/api/monitoring/delete_server_monitoring_probe.py +++ b/src/shellrent_sdk/client/api/monitoring/delete_server_monitoring_probe.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, cast from urllib.parse import quote import httpx @@ -7,7 +7,6 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.empty_response import EmptyResponse from ...types import Response @@ -29,11 +28,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | EmptyResponse | None: - if response.status_code == 200: - response_200 = EmptyResponse.from_dict(response.json()) - - return response_200 +) -> Any | ApiError | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -55,11 +53,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -68,7 +76,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -82,7 +90,7 @@ def sync_detailed( probe_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Delete server monitoring probe Delete a probe associated with a server monitoring @@ -96,7 +104,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -116,7 +124,7 @@ def sync( probe_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Delete server monitoring probe Delete a probe associated with a server monitoring @@ -130,7 +138,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return sync_detailed( @@ -145,7 +153,7 @@ async def asyncio_detailed( probe_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Delete server monitoring probe Delete a probe associated with a server monitoring @@ -159,7 +167,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -177,7 +185,7 @@ async def asyncio( probe_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Delete server monitoring probe Delete a probe associated with a server monitoring @@ -191,7 +199,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return ( diff --git a/src/shellrent_sdk/client/api/monitoring/get_server_monitoring.py b/src/shellrent_sdk/client/api/monitoring/get_server_monitoring.py index 7a9ea06..709d193 100644 --- a/src/shellrent_sdk/client/api/monitoring/get_server_monitoring.py +++ b/src/shellrent_sdk/client/api/monitoring/get_server_monitoring.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/monitoring/get_server_monitoring_probe.py b/src/shellrent_sdk/client/api/monitoring/get_server_monitoring_probe.py index ddbd318..abe4a32 100644 --- a/src/shellrent_sdk/client/api/monitoring/get_server_monitoring_probe.py +++ b/src/shellrent_sdk/client/api/monitoring/get_server_monitoring_probe.py @@ -60,6 +60,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/monitoring/get_server_monitoring_probe_chart.py b/src/shellrent_sdk/client/api/monitoring/get_server_monitoring_probe_chart.py index bbe2c42..6a7057a 100644 --- a/src/shellrent_sdk/client/api/monitoring/get_server_monitoring_probe_chart.py +++ b/src/shellrent_sdk/client/api/monitoring/get_server_monitoring_probe_chart.py @@ -60,6 +60,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/monitoring/get_web_monitoring.py b/src/shellrent_sdk/client/api/monitoring/get_web_monitoring.py index 0c9aee1..e6cc600 100644 --- a/src/shellrent_sdk/client/api/monitoring/get_web_monitoring.py +++ b/src/shellrent_sdk/client/api/monitoring/get_web_monitoring.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/monitoring/get_web_monitoring_availability_chart.py b/src/shellrent_sdk/client/api/monitoring/get_web_monitoring_availability_chart.py index 0c69086..31d8ac6 100644 --- a/src/shellrent_sdk/client/api/monitoring/get_web_monitoring_availability_chart.py +++ b/src/shellrent_sdk/client/api/monitoring/get_web_monitoring_availability_chart.py @@ -60,6 +60,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/monitoring/get_web_monitoring_download_speed_chart.py b/src/shellrent_sdk/client/api/monitoring/get_web_monitoring_download_speed_chart.py index 9b7441d..709a942 100644 --- a/src/shellrent_sdk/client/api/monitoring/get_web_monitoring_download_speed_chart.py +++ b/src/shellrent_sdk/client/api/monitoring/get_web_monitoring_download_speed_chart.py @@ -60,6 +60,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/monitoring/get_web_monitoring_notices.py b/src/shellrent_sdk/client/api/monitoring/get_web_monitoring_notices.py index d8ddddd..dc5ab5d 100644 --- a/src/shellrent_sdk/client/api/monitoring/get_web_monitoring_notices.py +++ b/src/shellrent_sdk/client/api/monitoring/get_web_monitoring_notices.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/monitoring/get_web_monitoring_response_time_chart.py b/src/shellrent_sdk/client/api/monitoring/get_web_monitoring_response_time_chart.py index 5dd1421..9efb396 100644 --- a/src/shellrent_sdk/client/api/monitoring/get_web_monitoring_response_time_chart.py +++ b/src/shellrent_sdk/client/api/monitoring/get_web_monitoring_response_time_chart.py @@ -60,6 +60,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/monitoring/list_server_monitoring_probes.py b/src/shellrent_sdk/client/api/monitoring/list_server_monitoring_probes.py index 6c7df8d..a6279d2 100644 --- a/src/shellrent_sdk/client/api/monitoring/list_server_monitoring_probes.py +++ b/src/shellrent_sdk/client/api/monitoring/list_server_monitoring_probes.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/monitoring/list_server_monitorings.py b/src/shellrent_sdk/client/api/monitoring/list_server_monitorings.py index 6621779..906fc29 100644 --- a/src/shellrent_sdk/client/api/monitoring/list_server_monitorings.py +++ b/src/shellrent_sdk/client/api/monitoring/list_server_monitorings.py @@ -15,7 +15,7 @@ def _get_kwargs( *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -68,6 +68,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -89,7 +94,7 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | ServerMonitoringPaginatedListResponse]: """List server monitorings @@ -97,7 +102,7 @@ def sync_detailed( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -123,7 +128,7 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | ServerMonitoringPaginatedListResponse | None: """List server monitorings @@ -131,7 +136,7 @@ def sync( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -152,7 +157,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | ServerMonitoringPaginatedListResponse]: """List server monitorings @@ -160,7 +165,7 @@ async def asyncio_detailed( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -184,7 +189,7 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | ServerMonitoringPaginatedListResponse | None: """List server monitorings @@ -192,7 +197,7 @@ async def asyncio( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/monitoring/list_web_monitorings.py b/src/shellrent_sdk/client/api/monitoring/list_web_monitorings.py index 02f596a..f8d55db 100644 --- a/src/shellrent_sdk/client/api/monitoring/list_web_monitorings.py +++ b/src/shellrent_sdk/client/api/monitoring/list_web_monitorings.py @@ -13,7 +13,7 @@ def _get_kwargs( *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -66,6 +66,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -87,7 +92,7 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | WebMonitoringPaginatedListResponse]: """List web monitorings @@ -95,7 +100,7 @@ def sync_detailed( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -121,7 +126,7 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | WebMonitoringPaginatedListResponse | None: """List web monitorings @@ -129,7 +134,7 @@ def sync( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -150,7 +155,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | WebMonitoringPaginatedListResponse]: """List web monitorings @@ -158,7 +163,7 @@ async def asyncio_detailed( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -182,7 +187,7 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | WebMonitoringPaginatedListResponse | None: """List web monitorings @@ -190,7 +195,7 @@ async def asyncio( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/monitoring/update_server_monitoring_probe.py b/src/shellrent_sdk/client/api/monitoring/update_server_monitoring_probe.py index e54154b..614cd57 100644 --- a/src/shellrent_sdk/client/api/monitoring/update_server_monitoring_probe.py +++ b/src/shellrent_sdk/client/api/monitoring/update_server_monitoring_probe.py @@ -64,11 +64,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/monitoring/update_web_monitoring_notices.py b/src/shellrent_sdk/client/api/monitoring/update_web_monitoring_notices.py index 7cb3fa9..7b47bfd 100644 --- a/src/shellrent_sdk/client/api/monitoring/update_web_monitoring_notices.py +++ b/src/shellrent_sdk/client/api/monitoring/update_web_monitoring_notices.py @@ -67,6 +67,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/o_auth/get_jwks.py b/src/shellrent_sdk/client/api/o_auth/get_jwks.py index 4b8196f..c719ba8 100644 --- a/src/shellrent_sdk/client/api/o_auth/get_jwks.py +++ b/src/shellrent_sdk/client/api/o_auth/get_jwks.py @@ -54,9 +54,9 @@ def sync_detailed( *, client: AuthenticatedClient | Client, ) -> Response[JwksResponse | OAuthError]: - """Esponi JWKS + """Get the JWKS - Restituisce le chiavi pubbliche usate per firmare gli access token JWT. + Returns the public keys used to sign the JWT access tokens. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -79,9 +79,9 @@ def sync( *, client: AuthenticatedClient | Client, ) -> JwksResponse | OAuthError | None: - """Esponi JWKS + """Get the JWKS - Restituisce le chiavi pubbliche usate per firmare gli access token JWT. + Returns the public keys used to sign the JWT access tokens. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -100,9 +100,9 @@ async def asyncio_detailed( *, client: AuthenticatedClient | Client, ) -> Response[JwksResponse | OAuthError]: - """Esponi JWKS + """Get the JWKS - Restituisce le chiavi pubbliche usate per firmare gli access token JWT. + Returns the public keys used to sign the JWT access tokens. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -123,9 +123,9 @@ async def asyncio( *, client: AuthenticatedClient | Client, ) -> JwksResponse | OAuthError | None: - """Esponi JWKS + """Get the JWKS - Restituisce le chiavi pubbliche usate per firmare gli access token JWT. + Returns the public keys used to sign the JWT access tokens. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/o_auth/request_access_token.py b/src/shellrent_sdk/client/api/o_auth/request_access_token.py index c17fcc7..6325cdf 100644 --- a/src/shellrent_sdk/client/api/o_auth/request_access_token.py +++ b/src/shellrent_sdk/client/api/o_auth/request_access_token.py @@ -79,13 +79,13 @@ def sync_detailed( client: AuthenticatedClient | Client, body: RequestAccessTokenBody, ) -> Response[OAuthError | OAuthTokenResponse]: - """Richiedi un access token + """Request an access token - Eroga un access token JWT tramite grant `client_credentials`. I parametri `audience` e `scope` sono - opzionali: senza `audience` il token usa l'unica audience del client (un client con più audience - deve indicarla), senza `scope` riceve tutti gli scope assegnati al client, come con - `scope=api:full`. Gli scope interni sono concessi solo con audience `api-internal`. La risposta - riporta l'audience e gli scope concessi. + Issues a JWT access token with the `client_credentials` grant. The `audience` and `scope` parameters + are optional: without `audience`, or with an empty value, the token gets the only audience of the + client (a client with more audiences must send it); without `scope` it gets all the scopes assigned + to the client, as with `scope=api:full`. The internal scopes are granted only with the `api- + internal` audience. The response reports the granted audience and scopes. Args: body (RequestAccessTokenBody): @@ -114,13 +114,13 @@ def sync( client: AuthenticatedClient | Client, body: RequestAccessTokenBody, ) -> OAuthError | OAuthTokenResponse | None: - """Richiedi un access token + """Request an access token - Eroga un access token JWT tramite grant `client_credentials`. I parametri `audience` e `scope` sono - opzionali: senza `audience` il token usa l'unica audience del client (un client con più audience - deve indicarla), senza `scope` riceve tutti gli scope assegnati al client, come con - `scope=api:full`. Gli scope interni sono concessi solo con audience `api-internal`. La risposta - riporta l'audience e gli scope concessi. + Issues a JWT access token with the `client_credentials` grant. The `audience` and `scope` parameters + are optional: without `audience`, or with an empty value, the token gets the only audience of the + client (a client with more audiences must send it); without `scope` it gets all the scopes assigned + to the client, as with `scope=api:full`. The internal scopes are granted only with the `api- + internal` audience. The response reports the granted audience and scopes. Args: body (RequestAccessTokenBody): @@ -144,13 +144,13 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, body: RequestAccessTokenBody, ) -> Response[OAuthError | OAuthTokenResponse]: - """Richiedi un access token + """Request an access token - Eroga un access token JWT tramite grant `client_credentials`. I parametri `audience` e `scope` sono - opzionali: senza `audience` il token usa l'unica audience del client (un client con più audience - deve indicarla), senza `scope` riceve tutti gli scope assegnati al client, come con - `scope=api:full`. Gli scope interni sono concessi solo con audience `api-internal`. La risposta - riporta l'audience e gli scope concessi. + Issues a JWT access token with the `client_credentials` grant. The `audience` and `scope` parameters + are optional: without `audience`, or with an empty value, the token gets the only audience of the + client (a client with more audiences must send it); without `scope` it gets all the scopes assigned + to the client, as with `scope=api:full`. The internal scopes are granted only with the `api- + internal` audience. The response reports the granted audience and scopes. Args: body (RequestAccessTokenBody): @@ -177,13 +177,13 @@ async def asyncio( client: AuthenticatedClient | Client, body: RequestAccessTokenBody, ) -> OAuthError | OAuthTokenResponse | None: - """Richiedi un access token + """Request an access token - Eroga un access token JWT tramite grant `client_credentials`. I parametri `audience` e `scope` sono - opzionali: senza `audience` il token usa l'unica audience del client (un client con più audience - deve indicarla), senza `scope` riceve tutti gli scope assegnati al client, come con - `scope=api:full`. Gli scope interni sono concessi solo con audience `api-internal`. La risposta - riporta l'audience e gli scope concessi. + Issues a JWT access token with the `client_credentials` grant. The `audience` and `scope` parameters + are optional: without `audience`, or with an empty value, the token gets the only audience of the + client (a client with more audiences must send it); without `scope` it gets all the scopes assigned + to the client, as with `scope=api:full`. The internal scopes are granted only with the `api- + internal` audience. The response reports the granted audience and scopes. Args: body (RequestAccessTokenBody): diff --git a/src/shellrent_sdk/client/api/payment/activate_one_click_autorenew.py b/src/shellrent_sdk/client/api/payment/activate_one_click_autorenew.py index 8cd9073..dd01ff6 100644 --- a/src/shellrent_sdk/client/api/payment/activate_one_click_autorenew.py +++ b/src/shellrent_sdk/client/api/payment/activate_one_click_autorenew.py @@ -14,7 +14,7 @@ def _get_kwargs() -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "post", - "url": "/api/v3/one-clicks/autorenew", + "url": "/api/v3/one-clicks/auto-renewal", } return _kwargs @@ -23,10 +23,10 @@ def _get_kwargs() -> dict[str, Any]: def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | OneClickAutorenewResponse | None: - if response.status_code == 200: - response_200 = OneClickAutorenewResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = OneClickAutorenewResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -48,11 +48,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -78,6 +88,8 @@ def sync_detailed( Activate automatic renewal service with One-Click Payment + Not available to sub-accounts: the response is 403 (error 1601). + Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. @@ -103,6 +115,8 @@ def sync( Activate automatic renewal service with One-Click Payment + Not available to sub-accounts: the response is 403 (error 1601). + Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. @@ -124,6 +138,8 @@ async def asyncio_detailed( Activate automatic renewal service with One-Click Payment + Not available to sub-accounts: the response is 403 (error 1601). + Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. @@ -147,6 +163,8 @@ async def asyncio( Activate automatic renewal service with One-Click Payment + Not available to sub-accounts: the response is 403 (error 1601). + Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. diff --git a/src/shellrent_sdk/client/api/payment/activate_prepaid_credit_autorenew.py b/src/shellrent_sdk/client/api/payment/activate_prepaid_credit_autorenew.py index 4ad5c59..16be0b1 100644 --- a/src/shellrent_sdk/client/api/payment/activate_prepaid_credit_autorenew.py +++ b/src/shellrent_sdk/client/api/payment/activate_prepaid_credit_autorenew.py @@ -14,7 +14,7 @@ def _get_kwargs() -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "post", - "url": "/api/v3/prepaid-credit/autorenew", + "url": "/api/v3/prepaid-credit/auto-renewal", } return _kwargs @@ -48,11 +48,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -78,6 +88,8 @@ def sync_detailed( Activate automatic renewal service with Prepaid credit + Not available to sub-accounts: the response is 403 (error 1601). + Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. @@ -103,6 +115,8 @@ def sync( Activate automatic renewal service with Prepaid credit + Not available to sub-accounts: the response is 403 (error 1601). + Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. @@ -124,6 +138,8 @@ async def asyncio_detailed( Activate automatic renewal service with Prepaid credit + Not available to sub-accounts: the response is 403 (error 1601). + Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. @@ -147,6 +163,8 @@ async def asyncio( Activate automatic renewal service with Prepaid credit + Not available to sub-accounts: the response is 403 (error 1601). + Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. diff --git a/src/shellrent_sdk/client/api/payment/create_one_click_payment.py b/src/shellrent_sdk/client/api/payment/create_one_click_payment.py new file mode 100644 index 0000000..5ee1707 --- /dev/null +++ b/src/shellrent_sdk/client/api/payment/create_one_click_payment.py @@ -0,0 +1,249 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.api_error import ApiError +from ...models.one_click_payment_create_request import OneClickPaymentCreateRequest +from ...models.payment_response import PaymentResponse +from ...types import Response + + +def _get_kwargs( + *, + body: OneClickPaymentCreateRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/payments/one-click", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | ApiError | PaymentResponse | None: + if response.status_code == 201: + response_201 = PaymentResponse.from_dict(response.json()) + + return response_201 + + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 + + if response.status_code == 400: + response_400 = ApiError.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ApiError.from_dict(response.json()) + + return response_401 + + if response.status_code == 402: + response_402 = ApiError.from_dict(response.json()) + + return response_402 + + if response.status_code == 403: + response_403 = ApiError.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ApiError.from_dict(response.json()) + + return response_404 + + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + + if response.status_code == 429: + response_429 = ApiError.from_dict(response.json()) + + return response_429 + + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | ApiError | PaymentResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: OneClickPaymentCreateRequest, +) -> Response[Any | ApiError | PaymentResponse]: + """Pay orders with One-Click + + Pays one or more orders together with a One-Click payment method: the one in `one_click_id` or, + without it, the default one (the first active method in the order chosen by the customer). Only that + method is tried: when the provider declines the payment the response is 402, with the message of the + provider, and the orders are still to be paid. When there is nothing to pay (total 0.00) the orders + are confirmed without a payment and the response is 204. The response is 409 when payments are not + possible at this time, the orders cannot be paid together, there is no active One-Click payment + method, or the payment exceeds the payment limits allowed at this time (for example in the evening). + + Not available to sub-accounts: the response is 403 (error 1601). + + Args: + body (OneClickPaymentCreateRequest): Pays one or more orders together with a One-Click + payment method, in a single attempt + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | ApiError | PaymentResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: OneClickPaymentCreateRequest, +) -> Any | ApiError | PaymentResponse | None: + """Pay orders with One-Click + + Pays one or more orders together with a One-Click payment method: the one in `one_click_id` or, + without it, the default one (the first active method in the order chosen by the customer). Only that + method is tried: when the provider declines the payment the response is 402, with the message of the + provider, and the orders are still to be paid. When there is nothing to pay (total 0.00) the orders + are confirmed without a payment and the response is 204. The response is 409 when payments are not + possible at this time, the orders cannot be paid together, there is no active One-Click payment + method, or the payment exceeds the payment limits allowed at this time (for example in the evening). + + Not available to sub-accounts: the response is 403 (error 1601). + + Args: + body (OneClickPaymentCreateRequest): Pays one or more orders together with a One-Click + payment method, in a single attempt + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | ApiError | PaymentResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: OneClickPaymentCreateRequest, +) -> Response[Any | ApiError | PaymentResponse]: + """Pay orders with One-Click + + Pays one or more orders together with a One-Click payment method: the one in `one_click_id` or, + without it, the default one (the first active method in the order chosen by the customer). Only that + method is tried: when the provider declines the payment the response is 402, with the message of the + provider, and the orders are still to be paid. When there is nothing to pay (total 0.00) the orders + are confirmed without a payment and the response is 204. The response is 409 when payments are not + possible at this time, the orders cannot be paid together, there is no active One-Click payment + method, or the payment exceeds the payment limits allowed at this time (for example in the evening). + + Not available to sub-accounts: the response is 403 (error 1601). + + Args: + body (OneClickPaymentCreateRequest): Pays one or more orders together with a One-Click + payment method, in a single attempt + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | ApiError | PaymentResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: OneClickPaymentCreateRequest, +) -> Any | ApiError | PaymentResponse | None: + """Pay orders with One-Click + + Pays one or more orders together with a One-Click payment method: the one in `one_click_id` or, + without it, the default one (the first active method in the order chosen by the customer). Only that + method is tried: when the provider declines the payment the response is 402, with the message of the + provider, and the orders are still to be paid. When there is nothing to pay (total 0.00) the orders + are confirmed without a payment and the response is 204. The response is 409 when payments are not + possible at this time, the orders cannot be paid together, there is no active One-Click payment + method, or the payment exceeds the payment limits allowed at this time (for example in the evening). + + Not available to sub-accounts: the response is 403 (error 1601). + + Args: + body (OneClickPaymentCreateRequest): Pays one or more orders together with a One-Click + payment method, in a single attempt + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | ApiError | PaymentResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/payment/create_prepaid_credit_payment.py b/src/shellrent_sdk/client/api/payment/create_prepaid_credit_payment.py new file mode 100644 index 0000000..5c8b86a --- /dev/null +++ b/src/shellrent_sdk/client/api/payment/create_prepaid_credit_payment.py @@ -0,0 +1,241 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.api_error import ApiError +from ...models.payment_response import PaymentResponse +from ...models.prepaid_credit_payment_create_request import PrepaidCreditPaymentCreateRequest +from ...types import Response + + +def _get_kwargs( + *, + body: PrepaidCreditPaymentCreateRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/payments/prepaid-credit", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | ApiError | PaymentResponse | None: + if response.status_code == 201: + response_201 = PaymentResponse.from_dict(response.json()) + + return response_201 + + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 + + if response.status_code == 400: + response_400 = ApiError.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ApiError.from_dict(response.json()) + + return response_401 + + if response.status_code == 402: + response_402 = ApiError.from_dict(response.json()) + + return response_402 + + if response.status_code == 403: + response_403 = ApiError.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ApiError.from_dict(response.json()) + + return response_404 + + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + + if response.status_code == 429: + response_429 = ApiError.from_dict(response.json()) + + return response_429 + + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | ApiError | PaymentResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: PrepaidCreditPaymentCreateRequest, +) -> Response[Any | ApiError | PaymentResponse]: + """Pay orders with the prepaid credit + + Pays one or more orders together with the prepaid credit. When there is nothing to pay (total 0.00) + the orders are confirmed without a payment and the response is 204. The response is 409 when + payments are not possible at this time, the orders cannot be paid together, the prepaid credit + cannot be used for them (for example because it is not enough), or the payment exceeds the payment + limits allowed at this time. + + Not available to sub-accounts: the response is 403 (error 1601). + + Args: + body (PrepaidCreditPaymentCreateRequest): Pays one or more orders together with the + prepaid credit + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | ApiError | PaymentResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: PrepaidCreditPaymentCreateRequest, +) -> Any | ApiError | PaymentResponse | None: + """Pay orders with the prepaid credit + + Pays one or more orders together with the prepaid credit. When there is nothing to pay (total 0.00) + the orders are confirmed without a payment and the response is 204. The response is 409 when + payments are not possible at this time, the orders cannot be paid together, the prepaid credit + cannot be used for them (for example because it is not enough), or the payment exceeds the payment + limits allowed at this time. + + Not available to sub-accounts: the response is 403 (error 1601). + + Args: + body (PrepaidCreditPaymentCreateRequest): Pays one or more orders together with the + prepaid credit + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | ApiError | PaymentResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: PrepaidCreditPaymentCreateRequest, +) -> Response[Any | ApiError | PaymentResponse]: + """Pay orders with the prepaid credit + + Pays one or more orders together with the prepaid credit. When there is nothing to pay (total 0.00) + the orders are confirmed without a payment and the response is 204. The response is 409 when + payments are not possible at this time, the orders cannot be paid together, the prepaid credit + cannot be used for them (for example because it is not enough), or the payment exceeds the payment + limits allowed at this time. + + Not available to sub-accounts: the response is 403 (error 1601). + + Args: + body (PrepaidCreditPaymentCreateRequest): Pays one or more orders together with the + prepaid credit + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | ApiError | PaymentResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: PrepaidCreditPaymentCreateRequest, +) -> Any | ApiError | PaymentResponse | None: + """Pay orders with the prepaid credit + + Pays one or more orders together with the prepaid credit. When there is nothing to pay (total 0.00) + the orders are confirmed without a payment and the response is 204. The response is 409 when + payments are not possible at this time, the orders cannot be paid together, the prepaid credit + cannot be used for them (for example because it is not enough), or the payment exceeds the payment + limits allowed at this time. + + Not available to sub-accounts: the response is 403 (error 1601). + + Args: + body (PrepaidCreditPaymentCreateRequest): Pays one or more orders together with the + prepaid credit + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | ApiError | PaymentResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/payment/create_prepaid_credit_topup.py b/src/shellrent_sdk/client/api/payment/create_prepaid_credit_topup.py index e6951a0..99dc097 100644 --- a/src/shellrent_sdk/client/api/payment/create_prepaid_credit_topup.py +++ b/src/shellrent_sdk/client/api/payment/create_prepaid_credit_topup.py @@ -19,7 +19,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/api/v3/prepaid-credit/topups", + "url": "/api/v3/prepaid-credit/top-ups", } _kwargs["json"] = body.to_dict() @@ -33,10 +33,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | OrderListResponse | None: - if response.status_code == 200: - response_200 = OrderListResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = OrderListResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -63,6 +63,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -89,6 +94,8 @@ def sync_detailed( Topup Prepaid credit + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyPrepaidCreditTopupRequest): @@ -120,6 +127,8 @@ def sync( Topup Prepaid credit + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyPrepaidCreditTopupRequest): @@ -146,6 +155,8 @@ async def asyncio_detailed( Topup Prepaid credit + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyPrepaidCreditTopupRequest): @@ -175,6 +186,8 @@ async def asyncio( Topup Prepaid credit + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyPrepaidCreditTopupRequest): diff --git a/src/shellrent_sdk/client/api/payment/get_one_click.py b/src/shellrent_sdk/client/api/payment/get_one_click.py index b6e4638..5153978 100644 --- a/src/shellrent_sdk/client/api/payment/get_one_click.py +++ b/src/shellrent_sdk/client/api/payment/get_one_click.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -84,6 +89,8 @@ def sync_detailed( Get details of an active One-Click Payment + Not available to sub-accounts: the response is 403 (error 1601). + Args: one_click_id (int): @@ -115,6 +122,8 @@ def sync( Get details of an active One-Click Payment + Not available to sub-accounts: the response is 403 (error 1601). + Args: one_click_id (int): @@ -141,6 +150,8 @@ async def asyncio_detailed( Get details of an active One-Click Payment + Not available to sub-accounts: the response is 403 (error 1601). + Args: one_click_id (int): @@ -170,6 +181,8 @@ async def asyncio( Get details of an active One-Click Payment + Not available to sub-accounts: the response is 403 (error 1601). + Args: one_click_id (int): diff --git a/src/shellrent_sdk/client/api/payment/get_one_click_autorenew.py b/src/shellrent_sdk/client/api/payment/get_one_click_autorenew.py index bf3ec57..a666200 100644 --- a/src/shellrent_sdk/client/api/payment/get_one_click_autorenew.py +++ b/src/shellrent_sdk/client/api/payment/get_one_click_autorenew.py @@ -14,7 +14,7 @@ def _get_kwargs() -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v3/one-clicks/autorenew", + "url": "/api/v3/one-clicks/auto-renewal", } return _kwargs @@ -53,6 +53,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -78,6 +83,8 @@ def sync_detailed( Get the status of the automatic renewal service with One-Click Payment + Not available to sub-accounts: the response is 403 (error 1601). + Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. @@ -103,6 +110,8 @@ def sync( Get the status of the automatic renewal service with One-Click Payment + Not available to sub-accounts: the response is 403 (error 1601). + Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. @@ -124,6 +133,8 @@ async def asyncio_detailed( Get the status of the automatic renewal service with One-Click Payment + Not available to sub-accounts: the response is 403 (error 1601). + Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. @@ -147,6 +158,8 @@ async def asyncio( Get the status of the automatic renewal service with One-Click Payment + Not available to sub-accounts: the response is 403 (error 1601). + Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. diff --git a/src/shellrent_sdk/client/api/payment/get_payment.py b/src/shellrent_sdk/client/api/payment/get_payment.py index 449361c..f256964 100644 --- a/src/shellrent_sdk/client/api/payment/get_payment.py +++ b/src/shellrent_sdk/client/api/payment/get_payment.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -84,6 +89,8 @@ def sync_detailed( Get details of a payment + Not available to sub-accounts: the response is 403 (error 1601). + Args: payment_id (int): @@ -115,6 +122,8 @@ def sync( Get details of a payment + Not available to sub-accounts: the response is 403 (error 1601). + Args: payment_id (int): @@ -141,6 +150,8 @@ async def asyncio_detailed( Get details of a payment + Not available to sub-accounts: the response is 403 (error 1601). + Args: payment_id (int): @@ -170,6 +181,8 @@ async def asyncio( Get details of a payment + Not available to sub-accounts: the response is 403 (error 1601). + Args: payment_id (int): diff --git a/src/shellrent_sdk/client/api/payment/get_prepaid_credit.py b/src/shellrent_sdk/client/api/payment/get_prepaid_credit.py index 3247807..eb2ecd8 100644 --- a/src/shellrent_sdk/client/api/payment/get_prepaid_credit.py +++ b/src/shellrent_sdk/client/api/payment/get_prepaid_credit.py @@ -53,6 +53,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -78,6 +83,8 @@ def sync_detailed( Get details of the Prepaid Credit for the account + Not available to sub-accounts: the response is 403 (error 1601). + Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. @@ -103,6 +110,8 @@ def sync( Get details of the Prepaid Credit for the account + Not available to sub-accounts: the response is 403 (error 1601). + Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. @@ -124,6 +133,8 @@ async def asyncio_detailed( Get details of the Prepaid Credit for the account + Not available to sub-accounts: the response is 403 (error 1601). + Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. @@ -147,6 +158,8 @@ async def asyncio( Get details of the Prepaid Credit for the account + Not available to sub-accounts: the response is 403 (error 1601). + Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. diff --git a/src/shellrent_sdk/client/api/payment/get_prepaid_credit_operation.py b/src/shellrent_sdk/client/api/payment/get_prepaid_credit_operation.py index a2a3f9f..4c111e3 100644 --- a/src/shellrent_sdk/client/api/payment/get_prepaid_credit_operation.py +++ b/src/shellrent_sdk/client/api/payment/get_prepaid_credit_operation.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -84,6 +89,8 @@ def sync_detailed( Get details of a Prepaid credit operation + Not available to sub-accounts: the response is 403 (error 1601). + Args: operation_id (int): @@ -115,6 +122,8 @@ def sync( Get details of a Prepaid credit operation + Not available to sub-accounts: the response is 403 (error 1601). + Args: operation_id (int): @@ -141,6 +150,8 @@ async def asyncio_detailed( Get details of a Prepaid credit operation + Not available to sub-accounts: the response is 403 (error 1601). + Args: operation_id (int): @@ -170,6 +181,8 @@ async def asyncio( Get details of a Prepaid credit operation + Not available to sub-accounts: the response is 403 (error 1601). + Args: operation_id (int): diff --git a/src/shellrent_sdk/client/api/payment/get_prepaid_credit_topup.py b/src/shellrent_sdk/client/api/payment/get_prepaid_credit_topup.py index c340fc7..50276d0 100644 --- a/src/shellrent_sdk/client/api/payment/get_prepaid_credit_topup.py +++ b/src/shellrent_sdk/client/api/payment/get_prepaid_credit_topup.py @@ -12,13 +12,13 @@ def _get_kwargs( - topup_id: int, + top_up_id: int, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v3/prepaid-credit/topups/{topup_id}".format( - topup_id=quote(str(topup_id), safe=""), + "url": "/api/v3/prepaid-credit/top-ups/{top_up_id}".format( + top_up_id=quote(str(top_up_id), safe=""), ), } @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -76,7 +81,7 @@ def _build_response( def sync_detailed( - topup_id: int, + top_up_id: int, *, client: AuthenticatedClient, ) -> Response[ApiError | PrepaidCreditTopupResponse]: @@ -84,8 +89,10 @@ def sync_detailed( Get details of a Prepaid credit topup + Not available to sub-accounts: the response is 403 (error 1601). + Args: - topup_id (int): + top_up_id (int): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -96,7 +103,7 @@ def sync_detailed( """ kwargs = _get_kwargs( - topup_id=topup_id, + top_up_id=top_up_id, ) response = client.get_httpx_client().request( @@ -107,7 +114,7 @@ def sync_detailed( def sync( - topup_id: int, + top_up_id: int, *, client: AuthenticatedClient, ) -> ApiError | PrepaidCreditTopupResponse | None: @@ -115,8 +122,10 @@ def sync( Get details of a Prepaid credit topup + Not available to sub-accounts: the response is 403 (error 1601). + Args: - topup_id (int): + top_up_id (int): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -127,13 +136,13 @@ def sync( """ return sync_detailed( - topup_id=topup_id, + top_up_id=top_up_id, client=client, ).parsed async def asyncio_detailed( - topup_id: int, + top_up_id: int, *, client: AuthenticatedClient, ) -> Response[ApiError | PrepaidCreditTopupResponse]: @@ -141,8 +150,10 @@ async def asyncio_detailed( Get details of a Prepaid credit topup + Not available to sub-accounts: the response is 403 (error 1601). + Args: - topup_id (int): + top_up_id (int): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -153,7 +164,7 @@ async def asyncio_detailed( """ kwargs = _get_kwargs( - topup_id=topup_id, + top_up_id=top_up_id, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -162,7 +173,7 @@ async def asyncio_detailed( async def asyncio( - topup_id: int, + top_up_id: int, *, client: AuthenticatedClient, ) -> ApiError | PrepaidCreditTopupResponse | None: @@ -170,8 +181,10 @@ async def asyncio( Get details of a Prepaid credit topup + Not available to sub-accounts: the response is 403 (error 1601). + Args: - topup_id (int): + top_up_id (int): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -183,7 +196,7 @@ async def asyncio( return ( await asyncio_detailed( - topup_id=topup_id, + top_up_id=top_up_id, client=client, ) ).parsed diff --git a/src/shellrent_sdk/client/api/payment/list_one_clicks.py b/src/shellrent_sdk/client/api/payment/list_one_clicks.py index 75141a9..6d84fc2 100644 --- a/src/shellrent_sdk/client/api/payment/list_one_clicks.py +++ b/src/shellrent_sdk/client/api/payment/list_one_clicks.py @@ -17,7 +17,7 @@ def _get_kwargs( date_created_from: datetime.datetime | Unset = UNSET, date_created_to: datetime.datetime | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -82,6 +82,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -106,18 +111,20 @@ def sync_detailed( date_created_from: datetime.datetime | Unset = UNSET, date_created_to: datetime.datetime | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | OneClickPaginatedListResponse]: """List all One-Clicks Get a list of all active One-Click Payments + Not available to sub-accounts: the response is 403 (error 1601). + Args: payment_method (str | Unset): date_created_from (datetime.datetime | Unset): date_created_to (datetime.datetime | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -149,18 +156,20 @@ def sync( date_created_from: datetime.datetime | Unset = UNSET, date_created_to: datetime.datetime | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | OneClickPaginatedListResponse | None: """List all One-Clicks Get a list of all active One-Click Payments + Not available to sub-accounts: the response is 403 (error 1601). + Args: payment_method (str | Unset): date_created_from (datetime.datetime | Unset): date_created_to (datetime.datetime | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -187,18 +196,20 @@ async def asyncio_detailed( date_created_from: datetime.datetime | Unset = UNSET, date_created_to: datetime.datetime | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | OneClickPaginatedListResponse]: """List all One-Clicks Get a list of all active One-Click Payments + Not available to sub-accounts: the response is 403 (error 1601). + Args: payment_method (str | Unset): date_created_from (datetime.datetime | Unset): date_created_to (datetime.datetime | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -228,18 +239,20 @@ async def asyncio( date_created_from: datetime.datetime | Unset = UNSET, date_created_to: datetime.datetime | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | OneClickPaginatedListResponse | None: """List all One-Clicks Get a list of all active One-Click Payments + Not available to sub-accounts: the response is 403 (error 1601). + Args: payment_method (str | Unset): date_created_from (datetime.datetime | Unset): date_created_to (datetime.datetime | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/payment/list_payments.py b/src/shellrent_sdk/client/api/payment/list_payments.py index 5826909..0f81281 100644 --- a/src/shellrent_sdk/client/api/payment/list_payments.py +++ b/src/shellrent_sdk/client/api/payment/list_payments.py @@ -17,7 +17,7 @@ def _get_kwargs( date_payment_from: datetime.datetime | Unset = UNSET, date_payment_to: datetime.datetime | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -82,6 +82,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -106,18 +111,20 @@ def sync_detailed( date_payment_from: datetime.datetime | Unset = UNSET, date_payment_to: datetime.datetime | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | PaymentPaginatedListResponse]: """List all Payments Get a list of all Payments + Not available to sub-accounts: the response is 403 (error 1601). + Args: payment_method (str | Unset): date_payment_from (datetime.datetime | Unset): date_payment_to (datetime.datetime | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -149,18 +156,20 @@ def sync( date_payment_from: datetime.datetime | Unset = UNSET, date_payment_to: datetime.datetime | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | PaymentPaginatedListResponse | None: """List all Payments Get a list of all Payments + Not available to sub-accounts: the response is 403 (error 1601). + Args: payment_method (str | Unset): date_payment_from (datetime.datetime | Unset): date_payment_to (datetime.datetime | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -187,18 +196,20 @@ async def asyncio_detailed( date_payment_from: datetime.datetime | Unset = UNSET, date_payment_to: datetime.datetime | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | PaymentPaginatedListResponse]: """List all Payments Get a list of all Payments + Not available to sub-accounts: the response is 403 (error 1601). + Args: payment_method (str | Unset): date_payment_from (datetime.datetime | Unset): date_payment_to (datetime.datetime | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -228,18 +239,20 @@ async def asyncio( date_payment_from: datetime.datetime | Unset = UNSET, date_payment_to: datetime.datetime | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | PaymentPaginatedListResponse | None: """List all Payments Get a list of all Payments + Not available to sub-accounts: the response is 403 (error 1601). + Args: payment_method (str | Unset): date_payment_from (datetime.datetime | Unset): date_payment_to (datetime.datetime | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/payment/list_prepaid_credit_operations.py b/src/shellrent_sdk/client/api/payment/list_prepaid_credit_operations.py index ea96213..74a1f6e 100644 --- a/src/shellrent_sdk/client/api/payment/list_prepaid_credit_operations.py +++ b/src/shellrent_sdk/client/api/payment/list_prepaid_credit_operations.py @@ -18,7 +18,7 @@ def _get_kwargs( date_created_from: datetime.datetime | Unset = UNSET, date_created_to: datetime.datetime | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -81,6 +81,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -104,17 +109,19 @@ def sync_detailed( date_created_from: datetime.datetime | Unset = UNSET, date_created_to: datetime.datetime | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | PrepaidCreditOperationPaginatedListResponse]: """List all Prepaid credit operations Get a list of all Prepaid credit operations + Not available to sub-accounts: the response is 403 (error 1601). + Args: date_created_from (datetime.datetime | Unset): date_created_to (datetime.datetime | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -144,17 +151,19 @@ def sync( date_created_from: datetime.datetime | Unset = UNSET, date_created_to: datetime.datetime | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | PrepaidCreditOperationPaginatedListResponse | None: """List all Prepaid credit operations Get a list of all Prepaid credit operations + Not available to sub-accounts: the response is 403 (error 1601). + Args: date_created_from (datetime.datetime | Unset): date_created_to (datetime.datetime | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -179,17 +188,19 @@ async def asyncio_detailed( date_created_from: datetime.datetime | Unset = UNSET, date_created_to: datetime.datetime | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | PrepaidCreditOperationPaginatedListResponse]: """List all Prepaid credit operations Get a list of all Prepaid credit operations + Not available to sub-accounts: the response is 403 (error 1601). + Args: date_created_from (datetime.datetime | Unset): date_created_to (datetime.datetime | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -217,17 +228,19 @@ async def asyncio( date_created_from: datetime.datetime | Unset = UNSET, date_created_to: datetime.datetime | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | PrepaidCreditOperationPaginatedListResponse | None: """List all Prepaid credit operations Get a list of all Prepaid credit operations + Not available to sub-accounts: the response is 403 (error 1601). + Args: date_created_from (datetime.datetime | Unset): date_created_to (datetime.datetime | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/payment/list_prepaid_credit_topups.py b/src/shellrent_sdk/client/api/payment/list_prepaid_credit_topups.py index 3a941a3..e9c0ff3 100644 --- a/src/shellrent_sdk/client/api/payment/list_prepaid_credit_topups.py +++ b/src/shellrent_sdk/client/api/payment/list_prepaid_credit_topups.py @@ -22,7 +22,7 @@ def _get_kwargs( date_created_from: datetime.datetime | Unset = UNSET, date_created_to: datetime.datetime | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -53,7 +53,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v3/prepaid-credit/topups", + "url": "/api/v3/prepaid-credit/top-ups", "params": params, } @@ -93,6 +93,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -120,12 +125,14 @@ def sync_detailed( date_created_from: datetime.datetime | Unset = UNSET, date_created_to: datetime.datetime | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | PrepaidCreditTopupPaginatedListResponse]: """List all topups Get a list of all Prepaid credit topups + Not available to sub-accounts: the response is 403 (error 1601). + Args: invoice_id (int | Unset): with_current_credit (bool | Unset): @@ -134,7 +141,7 @@ def sync_detailed( date_created_from (datetime.datetime | Unset): date_created_to (datetime.datetime | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -172,12 +179,14 @@ def sync( date_created_from: datetime.datetime | Unset = UNSET, date_created_to: datetime.datetime | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | PrepaidCreditTopupPaginatedListResponse | None: """List all topups Get a list of all Prepaid credit topups + Not available to sub-accounts: the response is 403 (error 1601). + Args: invoice_id (int | Unset): with_current_credit (bool | Unset): @@ -186,7 +195,7 @@ def sync( date_created_from (datetime.datetime | Unset): date_created_to (datetime.datetime | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -219,12 +228,14 @@ async def asyncio_detailed( date_created_from: datetime.datetime | Unset = UNSET, date_created_to: datetime.datetime | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | PrepaidCreditTopupPaginatedListResponse]: """List all topups Get a list of all Prepaid credit topups + Not available to sub-accounts: the response is 403 (error 1601). + Args: invoice_id (int | Unset): with_current_credit (bool | Unset): @@ -233,7 +244,7 @@ async def asyncio_detailed( date_created_from (datetime.datetime | Unset): date_created_to (datetime.datetime | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -269,12 +280,14 @@ async def asyncio( date_created_from: datetime.datetime | Unset = UNSET, date_created_to: datetime.datetime | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | PrepaidCreditTopupPaginatedListResponse | None: """List all topups Get a list of all Prepaid credit topups + Not available to sub-accounts: the response is 403 (error 1601). + Args: invoice_id (int | Unset): with_current_credit (bool | Unset): @@ -283,7 +296,7 @@ async def asyncio( date_created_from (datetime.datetime | Unset): date_created_to (datetime.datetime | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/payment/revoke_one_click_autorenew.py b/src/shellrent_sdk/client/api/payment/revoke_one_click_autorenew.py index 0b830d1..7f38b0d 100644 --- a/src/shellrent_sdk/client/api/payment/revoke_one_click_autorenew.py +++ b/src/shellrent_sdk/client/api/payment/revoke_one_click_autorenew.py @@ -1,12 +1,11 @@ from http import HTTPStatus -from typing import Any +from typing import Any, cast import httpx from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.empty_response import EmptyResponse from ...types import Response @@ -14,7 +13,7 @@ def _get_kwargs() -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", - "url": "/api/v3/one-clicks/autorenew", + "url": "/api/v3/one-clicks/auto-renewal", } return _kwargs @@ -22,11 +21,10 @@ def _get_kwargs() -> dict[str, Any]: def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | EmptyResponse | None: - if response.status_code == 200: - response_200 = EmptyResponse.from_dict(response.json()) - - return response_200 +) -> Any | ApiError | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -48,11 +46,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -61,7 +69,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -73,17 +81,19 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Revoke One-Click autorenew Revoke automatic renewal service with One-Click Payment + Not available to sub-accounts: the response is 403 (error 1601). + Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs() @@ -98,17 +108,19 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Revoke One-Click autorenew Revoke automatic renewal service with One-Click Payment + Not available to sub-accounts: the response is 403 (error 1601). + Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return sync_detailed( @@ -119,17 +131,19 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Revoke One-Click autorenew Revoke automatic renewal service with One-Click Payment + Not available to sub-accounts: the response is 403 (error 1601). + Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs() @@ -142,17 +156,19 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Revoke One-Click autorenew Revoke automatic renewal service with One-Click Payment + Not available to sub-accounts: the response is 403 (error 1601). + Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return ( diff --git a/src/shellrent_sdk/client/api/payment/revoke_prepaid_credit_autorenew.py b/src/shellrent_sdk/client/api/payment/revoke_prepaid_credit_autorenew.py index ae9e26d..c38537e 100644 --- a/src/shellrent_sdk/client/api/payment/revoke_prepaid_credit_autorenew.py +++ b/src/shellrent_sdk/client/api/payment/revoke_prepaid_credit_autorenew.py @@ -14,7 +14,7 @@ def _get_kwargs() -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "delete", - "url": "/api/v3/prepaid-credit/autorenew", + "url": "/api/v3/prepaid-credit/auto-renewal", } return _kwargs @@ -48,11 +48,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -78,6 +88,8 @@ def sync_detailed( Revoke automatic renewal service with Prepaid credit + Not available to sub-accounts: the response is 403 (error 1601). + Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. @@ -103,6 +115,8 @@ def sync( Revoke automatic renewal service with Prepaid credit + Not available to sub-accounts: the response is 403 (error 1601). + Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. @@ -124,6 +138,8 @@ async def asyncio_detailed( Revoke automatic renewal service with Prepaid credit + Not available to sub-accounts: the response is 403 (error 1601). + Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. @@ -147,6 +163,8 @@ async def asyncio( Revoke automatic renewal service with Prepaid credit + Not available to sub-accounts: the response is 403 (error 1601). + Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. diff --git a/src/shellrent_sdk/client/api/pec/create_pec_domain_owner_change.py b/src/shellrent_sdk/client/api/pec/create_pec_domain_owner_change.py index 1c9aca3..4b1a407 100644 --- a/src/shellrent_sdk/client/api/pec/create_pec_domain_owner_change.py +++ b/src/shellrent_sdk/client/api/pec/create_pec_domain_owner_change.py @@ -37,10 +37,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | PecOwnerChangeResponse | None: - if response.status_code == 200: - response_200 = PecOwnerChangeResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = PecOwnerChangeResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -62,11 +62,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/pec/create_pec_mailbox_owner_change.py b/src/shellrent_sdk/client/api/pec/create_pec_mailbox_owner_change.py index 145d33c..9e2b982 100644 --- a/src/shellrent_sdk/client/api/pec/create_pec_mailbox_owner_change.py +++ b/src/shellrent_sdk/client/api/pec/create_pec_mailbox_owner_change.py @@ -37,10 +37,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | PecOwnerChangeResponse | None: - if response.status_code == 200: - response_200 = PecOwnerChangeResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = PecOwnerChangeResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -62,11 +62,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/pec/get_pec_domain.py b/src/shellrent_sdk/client/api/pec/get_pec_domain.py index 3ddfd67..268955c 100644 --- a/src/shellrent_sdk/client/api/pec/get_pec_domain.py +++ b/src/shellrent_sdk/client/api/pec/get_pec_domain.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/pec/get_pec_domain_owner_change.py b/src/shellrent_sdk/client/api/pec/get_pec_domain_owner_change.py index 795d64f..ffb0ed2 100644 --- a/src/shellrent_sdk/client/api/pec/get_pec_domain_owner_change.py +++ b/src/shellrent_sdk/client/api/pec/get_pec_domain_owner_change.py @@ -60,6 +60,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/pec/get_pec_mailbox.py b/src/shellrent_sdk/client/api/pec/get_pec_mailbox.py index abdf44f..713fa97 100644 --- a/src/shellrent_sdk/client/api/pec/get_pec_mailbox.py +++ b/src/shellrent_sdk/client/api/pec/get_pec_mailbox.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/license_/get_secure_mail.py b/src/shellrent_sdk/client/api/pec/get_pec_mailbox_owner_change.py similarity index 62% rename from src/shellrent_sdk/client/api/license_/get_secure_mail.py rename to src/shellrent_sdk/client/api/pec/get_pec_mailbox_owner_change.py index 9d84d3d..c2abd39 100644 --- a/src/shellrent_sdk/client/api/license_/get_secure_mail.py +++ b/src/shellrent_sdk/client/api/pec/get_pec_mailbox_owner_change.py @@ -7,18 +7,20 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.securemail_response import SecuremailResponse +from ...models.pec_owner_change_response import PecOwnerChangeResponse from ...types import Response def _get_kwargs( - securemail_id: int, + pec_id: int, + owner_change_id: int, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v3/securemails/{securemail_id}".format( - securemail_id=quote(str(securemail_id), safe=""), + "url": "/api/v3/pec-mailboxes/{pec_id}/owner-changes/{owner_change_id}".format( + pec_id=quote(str(pec_id), safe=""), + owner_change_id=quote(str(owner_change_id), safe=""), ), } @@ -27,9 +29,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | SecuremailResponse | None: +) -> ApiError | PecOwnerChangeResponse | None: if response.status_code == 200: - response_200 = SecuremailResponse.from_dict(response.json()) + response_200 = PecOwnerChangeResponse.from_dict(response.json()) return response_200 @@ -58,6 +60,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -66,7 +73,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | SecuremailResponse]: +) -> Response[ApiError | PecOwnerChangeResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -76,27 +83,30 @@ def _build_response( def sync_detailed( - securemail_id: int, + pec_id: int, + owner_change_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | SecuremailResponse]: - """Get SecureMail subscription +) -> Response[ApiError | PecOwnerChangeResponse]: + """Get PEC mailbox owner change - Get details of a SecureMail by LibraESVA subscription + Get details of a specific owner change request for a PEC mailbox Args: - securemail_id (int): + pec_id (int): + owner_change_id (int): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | SecuremailResponse] + Response[ApiError | PecOwnerChangeResponse] """ kwargs = _get_kwargs( - securemail_id=securemail_id, + pec_id=pec_id, + owner_change_id=owner_change_id, ) response = client.get_httpx_client().request( @@ -107,53 +117,59 @@ def sync_detailed( def sync( - securemail_id: int, + pec_id: int, + owner_change_id: int, *, client: AuthenticatedClient, -) -> ApiError | SecuremailResponse | None: - """Get SecureMail subscription +) -> ApiError | PecOwnerChangeResponse | None: + """Get PEC mailbox owner change - Get details of a SecureMail by LibraESVA subscription + Get details of a specific owner change request for a PEC mailbox Args: - securemail_id (int): + pec_id (int): + owner_change_id (int): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | SecuremailResponse + ApiError | PecOwnerChangeResponse """ return sync_detailed( - securemail_id=securemail_id, + pec_id=pec_id, + owner_change_id=owner_change_id, client=client, ).parsed async def asyncio_detailed( - securemail_id: int, + pec_id: int, + owner_change_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | SecuremailResponse]: - """Get SecureMail subscription +) -> Response[ApiError | PecOwnerChangeResponse]: + """Get PEC mailbox owner change - Get details of a SecureMail by LibraESVA subscription + Get details of a specific owner change request for a PEC mailbox Args: - securemail_id (int): + pec_id (int): + owner_change_id (int): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | SecuremailResponse] + Response[ApiError | PecOwnerChangeResponse] """ kwargs = _get_kwargs( - securemail_id=securemail_id, + pec_id=pec_id, + owner_change_id=owner_change_id, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -162,28 +178,31 @@ async def asyncio_detailed( async def asyncio( - securemail_id: int, + pec_id: int, + owner_change_id: int, *, client: AuthenticatedClient, -) -> ApiError | SecuremailResponse | None: - """Get SecureMail subscription +) -> ApiError | PecOwnerChangeResponse | None: + """Get PEC mailbox owner change - Get details of a SecureMail by LibraESVA subscription + Get details of a specific owner change request for a PEC mailbox Args: - securemail_id (int): + pec_id (int): + owner_change_id (int): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | SecuremailResponse + ApiError | PecOwnerChangeResponse """ return ( await asyncio_detailed( - securemail_id=securemail_id, + pec_id=pec_id, + owner_change_id=owner_change_id, client=client, ) ).parsed diff --git a/src/shellrent_sdk/client/api/pec/list_pec_domain_owner_changes.py b/src/shellrent_sdk/client/api/pec/list_pec_domain_owner_changes.py index 311cdc4..7254265 100644 --- a/src/shellrent_sdk/client/api/pec/list_pec_domain_owner_changes.py +++ b/src/shellrent_sdk/client/api/pec/list_pec_domain_owner_changes.py @@ -15,7 +15,7 @@ def _get_kwargs( pec_domain_id: int, *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -70,6 +70,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -92,7 +97,7 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | PecOwnerChangePaginatedListResponse]: """List PEC domain owner changes @@ -101,7 +106,7 @@ def sync_detailed( Args: pec_domain_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -129,7 +134,7 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | PecOwnerChangePaginatedListResponse | None: """List PEC domain owner changes @@ -138,7 +143,7 @@ def sync( Args: pec_domain_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -161,7 +166,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | PecOwnerChangePaginatedListResponse]: """List PEC domain owner changes @@ -170,7 +175,7 @@ async def asyncio_detailed( Args: pec_domain_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -196,7 +201,7 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | PecOwnerChangePaginatedListResponse | None: """List PEC domain owner changes @@ -205,7 +210,7 @@ async def asyncio( Args: pec_domain_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/pec/list_pec_domains.py b/src/shellrent_sdk/client/api/pec/list_pec_domains.py index f2807cf..0db67c1 100644 --- a/src/shellrent_sdk/client/api/pec/list_pec_domains.py +++ b/src/shellrent_sdk/client/api/pec/list_pec_domains.py @@ -13,7 +13,7 @@ def _get_kwargs( *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -66,6 +66,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -87,7 +92,7 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | PecDomainPaginatedListResponse]: """List PEC domains @@ -95,7 +100,7 @@ def sync_detailed( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -121,7 +126,7 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | PecDomainPaginatedListResponse | None: """List PEC domains @@ -129,7 +134,7 @@ def sync( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -150,7 +155,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | PecDomainPaginatedListResponse]: """List PEC domains @@ -158,7 +163,7 @@ async def asyncio_detailed( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -182,7 +187,7 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | PecDomainPaginatedListResponse | None: """List PEC domains @@ -190,7 +195,7 @@ async def asyncio( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/pec/list_pec_mailbox_owner_changes.py b/src/shellrent_sdk/client/api/pec/list_pec_mailbox_owner_changes.py index 0eec287..152f484 100644 --- a/src/shellrent_sdk/client/api/pec/list_pec_mailbox_owner_changes.py +++ b/src/shellrent_sdk/client/api/pec/list_pec_mailbox_owner_changes.py @@ -15,7 +15,7 @@ def _get_kwargs( pec_id: int, *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -70,6 +70,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -92,7 +97,7 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | PecOwnerChangePaginatedListResponse]: """List PEC mailbox owner changes @@ -101,7 +106,7 @@ def sync_detailed( Args: pec_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -129,7 +134,7 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | PecOwnerChangePaginatedListResponse | None: """List PEC mailbox owner changes @@ -138,7 +143,7 @@ def sync( Args: pec_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -161,7 +166,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | PecOwnerChangePaginatedListResponse]: """List PEC mailbox owner changes @@ -170,7 +175,7 @@ async def asyncio_detailed( Args: pec_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -196,7 +201,7 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | PecOwnerChangePaginatedListResponse | None: """List PEC mailbox owner changes @@ -205,7 +210,7 @@ async def asyncio( Args: pec_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/pec/list_pec_mailboxes.py b/src/shellrent_sdk/client/api/pec/list_pec_mailboxes.py index bc5e856..30b5a2e 100644 --- a/src/shellrent_sdk/client/api/pec/list_pec_mailboxes.py +++ b/src/shellrent_sdk/client/api/pec/list_pec_mailboxes.py @@ -13,7 +13,7 @@ def _get_kwargs( *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -66,6 +66,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -87,7 +92,7 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | PecPaginatedListResponse]: """List PEC mailboxes @@ -95,7 +100,7 @@ def sync_detailed( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -121,7 +126,7 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | PecPaginatedListResponse | None: """List PEC mailboxes @@ -129,7 +134,7 @@ def sync( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -150,7 +155,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | PecPaginatedListResponse]: """List PEC mailboxes @@ -158,7 +163,7 @@ async def asyncio_detailed( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -182,7 +187,7 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | PecPaginatedListResponse | None: """List PEC mailboxes @@ -190,7 +195,7 @@ async def asyncio( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/pec/update_pec_mailbox.py b/src/shellrent_sdk/client/api/pec/update_pec_mailbox.py index 9b87ba8..3609f03 100644 --- a/src/shellrent_sdk/client/api/pec/update_pec_mailbox.py +++ b/src/shellrent_sdk/client/api/pec/update_pec_mailbox.py @@ -67,6 +67,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/purchases/can_add_purchase_additional.py b/src/shellrent_sdk/client/api/purchases/can_add_purchase_additional.py index b046e95..074b1d6 100644 --- a/src/shellrent_sdk/client/api/purchases/can_add_purchase_additional.py +++ b/src/shellrent_sdk/client/api/purchases/can_add_purchase_additional.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -84,6 +89,8 @@ def sync_detailed( Know if it's possible to buy an additional purchase for the purchase. + Not available to sub-accounts: the response is 403 (error 1601). + Args: purchase_id (int): @@ -115,6 +122,8 @@ def sync( Know if it's possible to buy an additional purchase for the purchase. + Not available to sub-accounts: the response is 403 (error 1601). + Args: purchase_id (int): @@ -141,6 +150,8 @@ async def asyncio_detailed( Know if it's possible to buy an additional purchase for the purchase. + Not available to sub-accounts: the response is 403 (error 1601). + Args: purchase_id (int): @@ -170,6 +181,8 @@ async def asyncio( Know if it's possible to buy an additional purchase for the purchase. + Not available to sub-accounts: the response is 403 (error 1601). + Args: purchase_id (int): diff --git a/src/shellrent_sdk/client/api/purchases/can_cancel_purchase.py b/src/shellrent_sdk/client/api/purchases/can_cancel_purchase.py index b68dcf1..157a1f5 100644 --- a/src/shellrent_sdk/client/api/purchases/can_cancel_purchase.py +++ b/src/shellrent_sdk/client/api/purchases/can_cancel_purchase.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/purchases/can_change_purchase_recurrence.py b/src/shellrent_sdk/client/api/purchases/can_change_purchase_recurrence.py index 4274dd1..74f09f3 100644 --- a/src/shellrent_sdk/client/api/purchases/can_change_purchase_recurrence.py +++ b/src/shellrent_sdk/client/api/purchases/can_change_purchase_recurrence.py @@ -8,20 +8,27 @@ from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError from ...models.purchase_can_change_recurrence_response import PurchaseCanChangeRecurrenceResponse -from ...types import Response +from ...types import UNSET, Response def _get_kwargs( purchase_id: int, + *, recurrence_id: int, ) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["recurrence_id"] = recurrence_id + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v3/purchases/{purchase_id}/can-change-recurrence/{recurrence_id}".format( + "url": "/api/v3/purchases/{purchase_id}/can-change-recurrence".format( purchase_id=quote(str(purchase_id), safe=""), - recurrence_id=quote(str(recurrence_id), safe=""), ), + "params": params, } return _kwargs @@ -60,6 +67,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -79,14 +91,16 @@ def _build_response( def sync_detailed( purchase_id: int, - recurrence_id: int, *, client: AuthenticatedClient, + recurrence_id: int, ) -> Response[ApiError | PurchaseCanChangeRecurrenceResponse]: """Can change recurrence Know if it's possible to change the recurrence on purchase + Not available to sub-accounts: the response is 403 (error 1601). + Args: purchase_id (int): recurrence_id (int): @@ -113,14 +127,16 @@ def sync_detailed( def sync( purchase_id: int, - recurrence_id: int, *, client: AuthenticatedClient, + recurrence_id: int, ) -> ApiError | PurchaseCanChangeRecurrenceResponse | None: """Can change recurrence Know if it's possible to change the recurrence on purchase + Not available to sub-accounts: the response is 403 (error 1601). + Args: purchase_id (int): recurrence_id (int): @@ -135,21 +151,23 @@ def sync( return sync_detailed( purchase_id=purchase_id, - recurrence_id=recurrence_id, client=client, + recurrence_id=recurrence_id, ).parsed async def asyncio_detailed( purchase_id: int, - recurrence_id: int, *, client: AuthenticatedClient, + recurrence_id: int, ) -> Response[ApiError | PurchaseCanChangeRecurrenceResponse]: """Can change recurrence Know if it's possible to change the recurrence on purchase + Not available to sub-accounts: the response is 403 (error 1601). + Args: purchase_id (int): recurrence_id (int): @@ -174,14 +192,16 @@ async def asyncio_detailed( async def asyncio( purchase_id: int, - recurrence_id: int, *, client: AuthenticatedClient, + recurrence_id: int, ) -> ApiError | PurchaseCanChangeRecurrenceResponse | None: """Can change recurrence Know if it's possible to change the recurrence on purchase + Not available to sub-accounts: the response is 403 (error 1601). + Args: purchase_id (int): recurrence_id (int): @@ -197,7 +217,7 @@ async def asyncio( return ( await asyncio_detailed( purchase_id=purchase_id, - recurrence_id=recurrence_id, client=client, + recurrence_id=recurrence_id, ) ).parsed diff --git a/src/shellrent_sdk/client/api/purchases/can_change_purchase_renew_status.py b/src/shellrent_sdk/client/api/purchases/can_change_purchase_renew_status.py index f42f516..86f290b 100644 --- a/src/shellrent_sdk/client/api/purchases/can_change_purchase_renew_status.py +++ b/src/shellrent_sdk/client/api/purchases/can_change_purchase_renew_status.py @@ -8,20 +8,27 @@ from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError from ...models.purchase_can_change_renew_status_response import PurchaseCanChangeRenewStatusResponse -from ...types import Response +from ...types import UNSET, Response def _get_kwargs( purchase_id: int, - status: str, + *, + status: bool, ) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["status"] = status + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v3/purchases/{purchase_id}/can-change-renew-status/{status}".format( + "url": "/api/v3/purchases/{purchase_id}/can-change-renew-status".format( purchase_id=quote(str(purchase_id), safe=""), - status=quote(str(status), safe=""), ), + "params": params, } return _kwargs @@ -60,6 +67,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -79,9 +91,9 @@ def _build_response( def sync_detailed( purchase_id: int, - status: str, *, client: AuthenticatedClient, + status: bool, ) -> Response[ApiError | PurchaseCanChangeRenewStatusResponse]: """Can change "to renew" status @@ -89,7 +101,7 @@ def sync_detailed( Args: purchase_id (int): - status (str): + status (bool): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -113,9 +125,9 @@ def sync_detailed( def sync( purchase_id: int, - status: str, *, client: AuthenticatedClient, + status: bool, ) -> ApiError | PurchaseCanChangeRenewStatusResponse | None: """Can change "to renew" status @@ -123,7 +135,7 @@ def sync( Args: purchase_id (int): - status (str): + status (bool): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -135,16 +147,16 @@ def sync( return sync_detailed( purchase_id=purchase_id, - status=status, client=client, + status=status, ).parsed async def asyncio_detailed( purchase_id: int, - status: str, *, client: AuthenticatedClient, + status: bool, ) -> Response[ApiError | PurchaseCanChangeRenewStatusResponse]: """Can change "to renew" status @@ -152,7 +164,7 @@ async def asyncio_detailed( Args: purchase_id (int): - status (str): + status (bool): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -174,9 +186,9 @@ async def asyncio_detailed( async def asyncio( purchase_id: int, - status: str, *, client: AuthenticatedClient, + status: bool, ) -> ApiError | PurchaseCanChangeRenewStatusResponse | None: """Can change "to renew" status @@ -184,7 +196,7 @@ async def asyncio( Args: purchase_id (int): - status (str): + status (bool): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -197,7 +209,7 @@ async def asyncio( return ( await asyncio_detailed( purchase_id=purchase_id, - status=status, client=client, + status=status, ) ).parsed diff --git a/src/shellrent_sdk/client/api/purchases/can_change_purchase_service.py b/src/shellrent_sdk/client/api/purchases/can_change_purchase_service.py index 2cc72d7..54fcf4a 100644 --- a/src/shellrent_sdk/client/api/purchases/can_change_purchase_service.py +++ b/src/shellrent_sdk/client/api/purchases/can_change_purchase_service.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -85,6 +90,8 @@ def sync_detailed( Know if it's possible to change the service of the purchase. It also returns the collection of Services to which it is possible to make the change. + Not available to sub-accounts: the response is 403 (error 1601). + Args: purchase_id (int): @@ -117,6 +124,8 @@ def sync( Know if it's possible to change the service of the purchase. It also returns the collection of Services to which it is possible to make the change. + Not available to sub-accounts: the response is 403 (error 1601). + Args: purchase_id (int): @@ -144,6 +153,8 @@ async def asyncio_detailed( Know if it's possible to change the service of the purchase. It also returns the collection of Services to which it is possible to make the change. + Not available to sub-accounts: the response is 403 (error 1601). + Args: purchase_id (int): @@ -174,6 +185,8 @@ async def asyncio( Know if it's possible to change the service of the purchase. It also returns the collection of Services to which it is possible to make the change. + Not available to sub-accounts: the response is 403 (error 1601). + Args: purchase_id (int): diff --git a/src/shellrent_sdk/client/api/purchases/can_renew_purchase.py b/src/shellrent_sdk/client/api/purchases/can_renew_purchase.py index 9811b5b..72f3e07 100644 --- a/src/shellrent_sdk/client/api/purchases/can_renew_purchase.py +++ b/src/shellrent_sdk/client/api/purchases/can_renew_purchase.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -84,6 +89,8 @@ def sync_detailed( Know if it's possible to renew a purchase + Not available to sub-accounts: the response is 403 (error 1601). + Args: purchase_id (int): @@ -115,6 +122,8 @@ def sync( Know if it's possible to renew a purchase + Not available to sub-accounts: the response is 403 (error 1601). + Args: purchase_id (int): @@ -141,6 +150,8 @@ async def asyncio_detailed( Know if it's possible to renew a purchase + Not available to sub-accounts: the response is 403 (error 1601). + Args: purchase_id (int): @@ -170,6 +181,8 @@ async def asyncio( Know if it's possible to renew a purchase + Not available to sub-accounts: the response is 403 (error 1601). + Args: purchase_id (int): diff --git a/src/shellrent_sdk/client/api/purchases/cancel_purchase.py b/src/shellrent_sdk/client/api/purchases/cancel_purchase.py index 8299e9b..e169746 100644 --- a/src/shellrent_sdk/client/api/purchases/cancel_purchase.py +++ b/src/shellrent_sdk/client/api/purchases/cancel_purchase.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, cast from urllib.parse import quote import httpx @@ -7,7 +7,6 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.empty_response import EmptyResponse from ...types import Response @@ -17,7 +16,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "delete", - "url": "/api/v3/purchases/{purchase_id}/cancel".format( + "url": "/api/v3/purchases/{purchase_id}".format( purchase_id=quote(str(purchase_id), safe=""), ), } @@ -27,11 +26,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | EmptyResponse | None: - if response.status_code == 200: - response_200 = EmptyResponse.from_dict(response.json()) - - return response_200 +) -> Any | ApiError | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -53,11 +51,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -66,7 +74,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +87,7 @@ def sync_detailed( purchase_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Cancel purchase Cancel a purchase (only on a "New" status purchase) @@ -92,7 +100,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -110,7 +118,7 @@ def sync( purchase_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Cancel purchase Cancel a purchase (only on a "New" status purchase) @@ -123,7 +131,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return sync_detailed( @@ -136,7 +144,7 @@ async def asyncio_detailed( purchase_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Cancel purchase Cancel a purchase (only on a "New" status purchase) @@ -149,7 +157,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -165,7 +173,7 @@ async def asyncio( purchase_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Cancel purchase Cancel a purchase (only on a "New" status purchase) @@ -178,7 +186,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return ( diff --git a/src/shellrent_sdk/client/api/purchases/change_purchase_recurrence.py b/src/shellrent_sdk/client/api/purchases/change_purchase_recurrence.py index 6e92b33..d3775ee 100644 --- a/src/shellrent_sdk/client/api/purchases/change_purchase_recurrence.py +++ b/src/shellrent_sdk/client/api/purchases/change_purchase_recurrence.py @@ -62,16 +62,21 @@ def _parse_response( return response_404 - if response.status_code == 422: - response_422 = ApiError.from_dict(response.json()) + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) - return response_422 + return response_409 if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -99,6 +104,8 @@ def sync_detailed( Change the recurrence on purchase + Not available to sub-accounts: the response is 403 (error 1601). + Args: purchase_id (int): body (PurchaseRecurrenceChangeRequest): @@ -133,6 +140,8 @@ def sync( Change the recurrence on purchase + Not available to sub-accounts: the response is 403 (error 1601). + Args: purchase_id (int): body (PurchaseRecurrenceChangeRequest): @@ -162,6 +171,8 @@ async def asyncio_detailed( Change the recurrence on purchase + Not available to sub-accounts: the response is 403 (error 1601). + Args: purchase_id (int): body (PurchaseRecurrenceChangeRequest): @@ -194,6 +205,8 @@ async def asyncio( Change the recurrence on purchase + Not available to sub-accounts: the response is 403 (error 1601). + Args: purchase_id (int): body (PurchaseRecurrenceChangeRequest): diff --git a/src/shellrent_sdk/client/api/purchases/change_purchase_renew_status.py b/src/shellrent_sdk/client/api/purchases/change_purchase_renew_status.py index 9161f20..c6426e8 100644 --- a/src/shellrent_sdk/client/api/purchases/change_purchase_renew_status.py +++ b/src/shellrent_sdk/client/api/purchases/change_purchase_renew_status.py @@ -62,16 +62,21 @@ def _parse_response( return response_404 - if response.status_code == 422: - response_422 = ApiError.from_dict(response.json()) + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) - return response_422 + return response_409 if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/purchases/complete_task_data.py b/src/shellrent_sdk/client/api/purchases/complete_task_data.py index 4934fee..dc282fc 100644 --- a/src/shellrent_sdk/client/api/purchases/complete_task_data.py +++ b/src/shellrent_sdk/client/api/purchases/complete_task_data.py @@ -37,10 +37,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | TaskResponse | None: - if response.status_code == 200: - response_200 = TaskResponse.from_dict(response.json()) + if response.status_code == 202: + response_202 = TaskResponse.from_dict(response.json()) - return response_200 + return response_202 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -62,11 +62,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/purchases/delete_purchase_billing_info.py b/src/shellrent_sdk/client/api/purchases/delete_purchase_billing_info.py index 9df0846..fbec5e2 100644 --- a/src/shellrent_sdk/client/api/purchases/delete_purchase_billing_info.py +++ b/src/shellrent_sdk/client/api/purchases/delete_purchase_billing_info.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -84,6 +89,8 @@ def sync_detailed( Deletes all billing infos from purchase (ODA, CIG, CUP). + Not available to sub-accounts: the response is 403 (error 1601). + Args: purchase_id (int): @@ -115,6 +122,8 @@ def sync( Deletes all billing infos from purchase (ODA, CIG, CUP). + Not available to sub-accounts: the response is 403 (error 1601). + Args: purchase_id (int): @@ -141,6 +150,8 @@ async def asyncio_detailed( Deletes all billing infos from purchase (ODA, CIG, CUP). + Not available to sub-accounts: the response is 403 (error 1601). + Args: purchase_id (int): @@ -170,6 +181,8 @@ async def asyncio( Deletes all billing infos from purchase (ODA, CIG, CUP). + Not available to sub-accounts: the response is 403 (error 1601). + Args: purchase_id (int): diff --git a/src/shellrent_sdk/client/api/purchases/delete_purchase_comment.py b/src/shellrent_sdk/client/api/purchases/delete_purchase_comment.py index 9c7b118..3ae1334 100644 --- a/src/shellrent_sdk/client/api/purchases/delete_purchase_comment.py +++ b/src/shellrent_sdk/client/api/purchases/delete_purchase_comment.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/purchases/get_purchase.py b/src/shellrent_sdk/client/api/purchases/get_purchase.py index 5a7a10a..676a98b 100644 --- a/src/shellrent_sdk/client/api/purchases/get_purchase.py +++ b/src/shellrent_sdk/client/api/purchases/get_purchase.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/purchases/get_task.py b/src/shellrent_sdk/client/api/purchases/get_task.py index 8cabbba..80bfe8b 100644 --- a/src/shellrent_sdk/client/api/purchases/get_task.py +++ b/src/shellrent_sdk/client/api/purchases/get_task.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/purchases/list_purchases.py b/src/shellrent_sdk/client/api/purchases/list_purchases.py index c67cb74..1fadd76 100644 --- a/src/shellrent_sdk/client/api/purchases/list_purchases.py +++ b/src/shellrent_sdk/client/api/purchases/list_purchases.py @@ -26,7 +26,7 @@ def _get_kwargs( service_category_code: str | Unset = UNSET, search: str | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -119,6 +119,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -152,7 +157,7 @@ def sync_detailed( service_category_code: str | Unset = UNSET, search: str | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | PurchasePaginatedListResponse]: """List purchases @@ -172,7 +177,7 @@ def sync_detailed( service_category_code (str | Unset): search (str | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -222,7 +227,7 @@ def sync( service_category_code: str | Unset = UNSET, search: str | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | PurchasePaginatedListResponse | None: """List purchases @@ -242,7 +247,7 @@ def sync( service_category_code (str | Unset): search (str | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -287,7 +292,7 @@ async def asyncio_detailed( service_category_code: str | Unset = UNSET, search: str | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | PurchasePaginatedListResponse]: """List purchases @@ -307,7 +312,7 @@ async def asyncio_detailed( service_category_code (str | Unset): search (str | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -355,7 +360,7 @@ async def asyncio( service_category_code: str | Unset = UNSET, search: str | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | PurchasePaginatedListResponse | None: """List purchases @@ -375,7 +380,7 @@ async def asyncio( service_category_code (str | Unset): search (str | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/purchases/list_tasks.py b/src/shellrent_sdk/client/api/purchases/list_tasks.py index 4e3cd61..1a82407 100644 --- a/src/shellrent_sdk/client/api/purchases/list_tasks.py +++ b/src/shellrent_sdk/client/api/purchases/list_tasks.py @@ -16,7 +16,7 @@ def _get_kwargs( ask_user_error: str | Unset = UNSET, purchase_id: int | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -75,6 +75,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -99,7 +104,7 @@ def sync_detailed( ask_user_error: str | Unset = UNSET, purchase_id: int | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | TaskPaginatedListResponse]: """List purchases tasks @@ -110,7 +115,7 @@ def sync_detailed( ask_user_error (str | Unset): purchase_id (int | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -142,7 +147,7 @@ def sync( ask_user_error: str | Unset = UNSET, purchase_id: int | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | TaskPaginatedListResponse | None: """List purchases tasks @@ -153,7 +158,7 @@ def sync( ask_user_error (str | Unset): purchase_id (int | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -180,7 +185,7 @@ async def asyncio_detailed( ask_user_error: str | Unset = UNSET, purchase_id: int | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | TaskPaginatedListResponse]: """List purchases tasks @@ -191,7 +196,7 @@ async def asyncio_detailed( ask_user_error (str | Unset): purchase_id (int | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -221,7 +226,7 @@ async def asyncio( ask_user_error: str | Unset = UNSET, purchase_id: int | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | TaskPaginatedListResponse | None: """List purchases tasks @@ -232,7 +237,7 @@ async def asyncio( ask_user_error (str | Unset): purchase_id (int | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/purchases/renew_purchase.py b/src/shellrent_sdk/client/api/purchases/renew_purchase.py index fb71aad..c68ecf6 100644 --- a/src/shellrent_sdk/client/api/purchases/renew_purchase.py +++ b/src/shellrent_sdk/client/api/purchases/renew_purchase.py @@ -17,7 +17,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/api/v3/purchases/{purchase_id}/renew".format( + "url": "/api/v3/purchases/{purchase_id}/renewals".format( purchase_id=quote(str(purchase_id), safe=""), ), } @@ -28,10 +28,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | OrderListResponse | None: - if response.status_code == 200: - response_200 = OrderListResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = OrderListResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -53,11 +53,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -84,6 +94,8 @@ def sync_detailed( Renew a purchase. It returns the orders created to renew the purchase (usually one order). + Not available to sub-accounts: the response is 403 (error 1601). + Args: purchase_id (int): @@ -115,6 +127,8 @@ def sync( Renew a purchase. It returns the orders created to renew the purchase (usually one order). + Not available to sub-accounts: the response is 403 (error 1601). + Args: purchase_id (int): @@ -141,6 +155,8 @@ async def asyncio_detailed( Renew a purchase. It returns the orders created to renew the purchase (usually one order). + Not available to sub-accounts: the response is 403 (error 1601). + Args: purchase_id (int): @@ -170,6 +186,8 @@ async def asyncio( Renew a purchase. It returns the orders created to renew the purchase (usually one order). + Not available to sub-accounts: the response is 403 (error 1601). + Args: purchase_id (int): diff --git a/src/shellrent_sdk/client/api/purchases/update_purchase_billing_info.py b/src/shellrent_sdk/client/api/purchases/update_purchase_billing_info.py index 37c5e8a..0735ad9 100644 --- a/src/shellrent_sdk/client/api/purchases/update_purchase_billing_info.py +++ b/src/shellrent_sdk/client/api/purchases/update_purchase_billing_info.py @@ -62,16 +62,16 @@ def _parse_response( return response_404 - if response.status_code == 422: - response_422 = ApiError.from_dict(response.json()) - - return response_422 - if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -99,9 +99,12 @@ def sync_detailed( Changes the billing info on purchase (ODA, CIG, CUP, ...) + Not available to sub-accounts: the response is 403 (error 1601). + Args: purchase_id (int): - body (PurchaseBillingInfoChangeRequest): + body (PurchaseBillingInfoChangeRequest): Billing data of the purchase to change: at least + one of `oda`, `cig` and `cup`; the ones omitted stay unchanged Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -133,9 +136,12 @@ def sync( Changes the billing info on purchase (ODA, CIG, CUP, ...) + Not available to sub-accounts: the response is 403 (error 1601). + Args: purchase_id (int): - body (PurchaseBillingInfoChangeRequest): + body (PurchaseBillingInfoChangeRequest): Billing data of the purchase to change: at least + one of `oda`, `cig` and `cup`; the ones omitted stay unchanged Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -162,9 +168,12 @@ async def asyncio_detailed( Changes the billing info on purchase (ODA, CIG, CUP, ...) + Not available to sub-accounts: the response is 403 (error 1601). + Args: purchase_id (int): - body (PurchaseBillingInfoChangeRequest): + body (PurchaseBillingInfoChangeRequest): Billing data of the purchase to change: at least + one of `oda`, `cig` and `cup`; the ones omitted stay unchanged Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -194,9 +203,12 @@ async def asyncio( Changes the billing info on purchase (ODA, CIG, CUP, ...) + Not available to sub-accounts: the response is 403 (error 1601). + Args: purchase_id (int): - body (PurchaseBillingInfoChangeRequest): + body (PurchaseBillingInfoChangeRequest): Billing data of the purchase to change: at least + one of `oda`, `cig` and `cup`; the ones omitted stay unchanged Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/purchases/update_purchase_comment.py b/src/shellrent_sdk/client/api/purchases/update_purchase_comment.py index 6872085..7e76fba 100644 --- a/src/shellrent_sdk/client/api/purchases/update_purchase_comment.py +++ b/src/shellrent_sdk/client/api/purchases/update_purchase_comment.py @@ -62,16 +62,16 @@ def _parse_response( return response_404 - if response.status_code == 422: - response_422 = ApiError.from_dict(response.json()) - - return response_422 - if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/server/can_hard_reboot_server.py b/src/shellrent_sdk/client/api/server/can_hard_reboot_server.py index 41c0542..929d988 100644 --- a/src/shellrent_sdk/client/api/server/can_hard_reboot_server.py +++ b/src/shellrent_sdk/client/api/server/can_hard_reboot_server.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -82,7 +87,11 @@ def sync_detailed( ) -> Response[ApiError | ServerCanActionResponse]: """Check if server can hard reboot - Check if server can hard reboot + Whether the server can be forcibly rebooted now with `POST /api/v3/servers/{server_id}/power- + actions` and `action` `hard_reboot`. `can_action` is false for a physical server, which only has + `reboot`, and for the server of a private cloud; also while the server is not ready, its service is + not active or is under maintenance, another operation does not allow the action, or the virtual + machine is not running Args: server_id (int): @@ -113,7 +122,11 @@ def sync( ) -> ApiError | ServerCanActionResponse | None: """Check if server can hard reboot - Check if server can hard reboot + Whether the server can be forcibly rebooted now with `POST /api/v3/servers/{server_id}/power- + actions` and `action` `hard_reboot`. `can_action` is false for a physical server, which only has + `reboot`, and for the server of a private cloud; also while the server is not ready, its service is + not active or is under maintenance, another operation does not allow the action, or the virtual + machine is not running Args: server_id (int): @@ -139,7 +152,11 @@ async def asyncio_detailed( ) -> Response[ApiError | ServerCanActionResponse]: """Check if server can hard reboot - Check if server can hard reboot + Whether the server can be forcibly rebooted now with `POST /api/v3/servers/{server_id}/power- + actions` and `action` `hard_reboot`. `can_action` is false for a physical server, which only has + `reboot`, and for the server of a private cloud; also while the server is not ready, its service is + not active or is under maintenance, another operation does not allow the action, or the virtual + machine is not running Args: server_id (int): @@ -168,7 +185,11 @@ async def asyncio( ) -> ApiError | ServerCanActionResponse | None: """Check if server can hard reboot - Check if server can hard reboot + Whether the server can be forcibly rebooted now with `POST /api/v3/servers/{server_id}/power- + actions` and `action` `hard_reboot`. `can_action` is false for a physical server, which only has + `reboot`, and for the server of a private cloud; also while the server is not ready, its service is + not active or is under maintenance, another operation does not allow the action, or the virtual + machine is not running Args: server_id (int): diff --git a/src/shellrent_sdk/client/api/server/can_hard_stop_server.py b/src/shellrent_sdk/client/api/server/can_hard_stop_server.py index 6d4c0d1..214521d 100644 --- a/src/shellrent_sdk/client/api/server/can_hard_stop_server.py +++ b/src/shellrent_sdk/client/api/server/can_hard_stop_server.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -82,7 +87,11 @@ def sync_detailed( ) -> Response[ApiError | ServerCanActionResponse]: """Check if server can hard stop - Check if server can hard stop + Whether the server can be forcibly stopped now with `POST /api/v3/servers/{server_id}/power-actions` + and `action` `hard_stop`. `can_action` is false for a physical server, which only has `reboot`, and + for the server of a private cloud; also while the server is not ready, its service is not active or + is under maintenance, another operation does not allow the action, or the virtual machine is already + stopped Args: server_id (int): @@ -113,7 +122,11 @@ def sync( ) -> ApiError | ServerCanActionResponse | None: """Check if server can hard stop - Check if server can hard stop + Whether the server can be forcibly stopped now with `POST /api/v3/servers/{server_id}/power-actions` + and `action` `hard_stop`. `can_action` is false for a physical server, which only has `reboot`, and + for the server of a private cloud; also while the server is not ready, its service is not active or + is under maintenance, another operation does not allow the action, or the virtual machine is already + stopped Args: server_id (int): @@ -139,7 +152,11 @@ async def asyncio_detailed( ) -> Response[ApiError | ServerCanActionResponse]: """Check if server can hard stop - Check if server can hard stop + Whether the server can be forcibly stopped now with `POST /api/v3/servers/{server_id}/power-actions` + and `action` `hard_stop`. `can_action` is false for a physical server, which only has `reboot`, and + for the server of a private cloud; also while the server is not ready, its service is not active or + is under maintenance, another operation does not allow the action, or the virtual machine is already + stopped Args: server_id (int): @@ -168,7 +185,11 @@ async def asyncio( ) -> ApiError | ServerCanActionResponse | None: """Check if server can hard stop - Check if server can hard stop + Whether the server can be forcibly stopped now with `POST /api/v3/servers/{server_id}/power-actions` + and `action` `hard_stop`. `can_action` is false for a physical server, which only has `reboot`, and + for the server of a private cloud; also while the server is not ready, its service is not active or + is under maintenance, another operation does not allow the action, or the virtual machine is already + stopped Args: server_id (int): diff --git a/src/shellrent_sdk/client/api/server/can_reboot_server.py b/src/shellrent_sdk/client/api/server/can_reboot_server.py index bbd3538..ab9846c 100644 --- a/src/shellrent_sdk/client/api/server/can_reboot_server.py +++ b/src/shellrent_sdk/client/api/server/can_reboot_server.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -82,7 +87,11 @@ def sync_detailed( ) -> Response[ApiError | ServerCanActionResponse]: """Check if server can reboot - Check if server can reboot + Whether the server can be rebooted now with `POST /api/v3/servers/{server_id}/power-actions` and + `action` `reboot`, the only power action of the physical servers. `can_action` is false for the + server of a private cloud, and while the server is not ready, its service is not active or is under + maintenance, another operation does not allow the action, the virtual machine is not running, or the + physical server cannot be managed at its supplier Args: server_id (int): @@ -113,7 +122,11 @@ def sync( ) -> ApiError | ServerCanActionResponse | None: """Check if server can reboot - Check if server can reboot + Whether the server can be rebooted now with `POST /api/v3/servers/{server_id}/power-actions` and + `action` `reboot`, the only power action of the physical servers. `can_action` is false for the + server of a private cloud, and while the server is not ready, its service is not active or is under + maintenance, another operation does not allow the action, the virtual machine is not running, or the + physical server cannot be managed at its supplier Args: server_id (int): @@ -139,7 +152,11 @@ async def asyncio_detailed( ) -> Response[ApiError | ServerCanActionResponse]: """Check if server can reboot - Check if server can reboot + Whether the server can be rebooted now with `POST /api/v3/servers/{server_id}/power-actions` and + `action` `reboot`, the only power action of the physical servers. `can_action` is false for the + server of a private cloud, and while the server is not ready, its service is not active or is under + maintenance, another operation does not allow the action, the virtual machine is not running, or the + physical server cannot be managed at its supplier Args: server_id (int): @@ -168,7 +185,11 @@ async def asyncio( ) -> ApiError | ServerCanActionResponse | None: """Check if server can reboot - Check if server can reboot + Whether the server can be rebooted now with `POST /api/v3/servers/{server_id}/power-actions` and + `action` `reboot`, the only power action of the physical servers. `can_action` is false for the + server of a private cloud, and while the server is not ready, its service is not active or is under + maintenance, another operation does not allow the action, the virtual machine is not running, or the + physical server cannot be managed at its supplier Args: server_id (int): diff --git a/src/shellrent_sdk/client/api/server/can_start_server.py b/src/shellrent_sdk/client/api/server/can_start_server.py index a3b5343..2396b82 100644 --- a/src/shellrent_sdk/client/api/server/can_start_server.py +++ b/src/shellrent_sdk/client/api/server/can_start_server.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -82,7 +87,10 @@ def sync_detailed( ) -> Response[ApiError | ServerCanActionResponse]: """Check if server can start - Check if server can start + Whether the server can be started now with `POST /api/v3/servers/{server_id}/power-actions` and + `action` `start`. `can_action` is false for a physical server, which only has `reboot`, and for the + server of a private cloud; also while the server is not ready, its service is not active or is under + maintenance, another operation does not allow the action, or the virtual machine is already running Args: server_id (int): @@ -113,7 +121,10 @@ def sync( ) -> ApiError | ServerCanActionResponse | None: """Check if server can start - Check if server can start + Whether the server can be started now with `POST /api/v3/servers/{server_id}/power-actions` and + `action` `start`. `can_action` is false for a physical server, which only has `reboot`, and for the + server of a private cloud; also while the server is not ready, its service is not active or is under + maintenance, another operation does not allow the action, or the virtual machine is already running Args: server_id (int): @@ -139,7 +150,10 @@ async def asyncio_detailed( ) -> Response[ApiError | ServerCanActionResponse]: """Check if server can start - Check if server can start + Whether the server can be started now with `POST /api/v3/servers/{server_id}/power-actions` and + `action` `start`. `can_action` is false for a physical server, which only has `reboot`, and for the + server of a private cloud; also while the server is not ready, its service is not active or is under + maintenance, another operation does not allow the action, or the virtual machine is already running Args: server_id (int): @@ -168,7 +182,10 @@ async def asyncio( ) -> ApiError | ServerCanActionResponse | None: """Check if server can start - Check if server can start + Whether the server can be started now with `POST /api/v3/servers/{server_id}/power-actions` and + `action` `start`. `can_action` is false for a physical server, which only has `reboot`, and for the + server of a private cloud; also while the server is not ready, its service is not active or is under + maintenance, another operation does not allow the action, or the virtual machine is already running Args: server_id (int): diff --git a/src/shellrent_sdk/client/api/server/can_stop_server.py b/src/shellrent_sdk/client/api/server/can_stop_server.py index 4dfab09..20e95d6 100644 --- a/src/shellrent_sdk/client/api/server/can_stop_server.py +++ b/src/shellrent_sdk/client/api/server/can_stop_server.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -82,7 +87,10 @@ def sync_detailed( ) -> Response[ApiError | ServerCanActionResponse]: """Check if server can stop - Check if server can stop + Whether the server can be stopped now with `POST /api/v3/servers/{server_id}/power-actions` and + `action` `stop`. `can_action` is false for a physical server, which only has `reboot`, and for the + server of a private cloud; also while the server is not ready, its service is not active or is under + maintenance, another operation does not allow the action, or the virtual machine is already stopped Args: server_id (int): @@ -113,7 +121,10 @@ def sync( ) -> ApiError | ServerCanActionResponse | None: """Check if server can stop - Check if server can stop + Whether the server can be stopped now with `POST /api/v3/servers/{server_id}/power-actions` and + `action` `stop`. `can_action` is false for a physical server, which only has `reboot`, and for the + server of a private cloud; also while the server is not ready, its service is not active or is under + maintenance, another operation does not allow the action, or the virtual machine is already stopped Args: server_id (int): @@ -139,7 +150,10 @@ async def asyncio_detailed( ) -> Response[ApiError | ServerCanActionResponse]: """Check if server can stop - Check if server can stop + Whether the server can be stopped now with `POST /api/v3/servers/{server_id}/power-actions` and + `action` `stop`. `can_action` is false for a physical server, which only has `reboot`, and for the + server of a private cloud; also while the server is not ready, its service is not active or is under + maintenance, another operation does not allow the action, or the virtual machine is already stopped Args: server_id (int): @@ -168,7 +182,10 @@ async def asyncio( ) -> ApiError | ServerCanActionResponse | None: """Check if server can stop - Check if server can stop + Whether the server can be stopped now with `POST /api/v3/servers/{server_id}/power-actions` and + `action` `stop`. `can_action` is false for a physical server, which only has `reboot`, and for the + server of a private cloud; also while the server is not ready, its service is not active or is under + maintenance, another operation does not allow the action, or the virtual machine is already stopped Args: server_id (int): diff --git a/src/shellrent_sdk/client/api/server/create_private_cloud_virtual_machine.py b/src/shellrent_sdk/client/api/server/create_private_cloud_virtual_machine.py index eb70613..e634c36 100644 --- a/src/shellrent_sdk/client/api/server/create_private_cloud_virtual_machine.py +++ b/src/shellrent_sdk/client/api/server/create_private_cloud_virtual_machine.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/api/v3/servers/{server_id}/private_cloud/virtual-machines".format( + "url": "/api/v3/servers/{server_id}/private-cloud/virtual-machines".format( server_id=quote(str(server_id), safe=""), ), } @@ -37,10 +37,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | TaskResponse | None: - if response.status_code == 200: - response_200 = TaskResponse.from_dict(response.json()) + if response.status_code == 202: + response_202 = TaskResponse.from_dict(response.json()) - return response_200 + return response_202 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -62,11 +62,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -92,11 +102,15 @@ def sync_detailed( ) -> Response[ApiError | TaskResponse]: """Create private cloud VM - Create private cloud VM + Create private cloud VM. The response is 409 when the private cloud already has the maximum number + of virtual machines, its daily backup space is already in use, it has no licences left for the + template, or another operation is in progress. Args: server_id (int): - body (PrivateCloudVmCreateRequest): + body (PrivateCloudVmCreateRequest): Virtual machine to create on the private cloud: + `template_vm_id` to copy a template VM, otherwise both `server_configuration_id` and + `template_id`; and either `ip_address_id` or `use_local_ip` true, not both Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -126,11 +140,15 @@ def sync( ) -> ApiError | TaskResponse | None: """Create private cloud VM - Create private cloud VM + Create private cloud VM. The response is 409 when the private cloud already has the maximum number + of virtual machines, its daily backup space is already in use, it has no licences left for the + template, or another operation is in progress. Args: server_id (int): - body (PrivateCloudVmCreateRequest): + body (PrivateCloudVmCreateRequest): Virtual machine to create on the private cloud: + `template_vm_id` to copy a template VM, otherwise both `server_configuration_id` and + `template_id`; and either `ip_address_id` or `use_local_ip` true, not both Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -155,11 +173,15 @@ async def asyncio_detailed( ) -> Response[ApiError | TaskResponse]: """Create private cloud VM - Create private cloud VM + Create private cloud VM. The response is 409 when the private cloud already has the maximum number + of virtual machines, its daily backup space is already in use, it has no licences left for the + template, or another operation is in progress. Args: server_id (int): - body (PrivateCloudVmCreateRequest): + body (PrivateCloudVmCreateRequest): Virtual machine to create on the private cloud: + `template_vm_id` to copy a template VM, otherwise both `server_configuration_id` and + `template_id`; and either `ip_address_id` or `use_local_ip` true, not both Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -187,11 +209,15 @@ async def asyncio( ) -> ApiError | TaskResponse | None: """Create private cloud VM - Create private cloud VM + Create private cloud VM. The response is 409 when the private cloud already has the maximum number + of virtual machines, its daily backup space is already in use, it has no licences left for the + template, or another operation is in progress. Args: server_id (int): - body (PrivateCloudVmCreateRequest): + body (PrivateCloudVmCreateRequest): Virtual machine to create on the private cloud: + `template_vm_id` to copy a template VM, otherwise both `server_configuration_id` and + `template_id`; and either `ip_address_id` or `use_local_ip` true, not both Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/server/create_server_automatic_snapshot.py b/src/shellrent_sdk/client/api/server/create_server_automatic_snapshot.py index b282bab..682ee0a 100644 --- a/src/shellrent_sdk/client/api/server/create_server_automatic_snapshot.py +++ b/src/shellrent_sdk/client/api/server/create_server_automatic_snapshot.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/api/v3/servers/{server_id}/snapshots/automatic-snapshot".format( + "url": "/api/v3/servers/{server_id}/snapshot-schedule".format( server_id=quote(str(server_id), safe=""), ), } @@ -37,10 +37,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | ServerAutomaticSnapshotResponse | None: - if response.status_code == 200: - response_200 = ServerAutomaticSnapshotResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = ServerAutomaticSnapshotResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -62,11 +62,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -92,11 +102,13 @@ def sync_detailed( ) -> Response[ApiError | ServerAutomaticSnapshotResponse]: """Create automatic snapshot settings - Create automatic snapshot settings + Configures the automatic snapshot of the server. A server has at most one automatic snapshot: if one + is already configured the response is 409 and the configuration is changed with PATCH. Automatic + snapshots must be included in the service plan, otherwise the response is 403. Args: server_id (int): - body (ServerAutomaticSnapshotRequest): + body (ServerAutomaticSnapshotRequest): Schedule of the automatic snapshots of a server Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -126,11 +138,13 @@ def sync( ) -> ApiError | ServerAutomaticSnapshotResponse | None: """Create automatic snapshot settings - Create automatic snapshot settings + Configures the automatic snapshot of the server. A server has at most one automatic snapshot: if one + is already configured the response is 409 and the configuration is changed with PATCH. Automatic + snapshots must be included in the service plan, otherwise the response is 403. Args: server_id (int): - body (ServerAutomaticSnapshotRequest): + body (ServerAutomaticSnapshotRequest): Schedule of the automatic snapshots of a server Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -155,11 +169,13 @@ async def asyncio_detailed( ) -> Response[ApiError | ServerAutomaticSnapshotResponse]: """Create automatic snapshot settings - Create automatic snapshot settings + Configures the automatic snapshot of the server. A server has at most one automatic snapshot: if one + is already configured the response is 409 and the configuration is changed with PATCH. Automatic + snapshots must be included in the service plan, otherwise the response is 403. Args: server_id (int): - body (ServerAutomaticSnapshotRequest): + body (ServerAutomaticSnapshotRequest): Schedule of the automatic snapshots of a server Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -187,11 +203,13 @@ async def asyncio( ) -> ApiError | ServerAutomaticSnapshotResponse | None: """Create automatic snapshot settings - Create automatic snapshot settings + Configures the automatic snapshot of the server. A server has at most one automatic snapshot: if one + is already configured the response is 409 and the configuration is changed with PATCH. Automatic + snapshots must be included in the service plan, otherwise the response is 403. Args: server_id (int): - body (ServerAutomaticSnapshotRequest): + body (ServerAutomaticSnapshotRequest): Schedule of the automatic snapshots of a server Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/server/create_server_network_interface.py b/src/shellrent_sdk/client/api/server/create_server_network_interface.py index 70d4750..3fffeaa 100644 --- a/src/shellrent_sdk/client/api/server/create_server_network_interface.py +++ b/src/shellrent_sdk/client/api/server/create_server_network_interface.py @@ -8,7 +8,7 @@ from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError from ...models.server_network_interface_create_request import ServerNetworkInterfaceCreateRequest -from ...models.server_network_interface_response import ServerNetworkInterfaceResponse +from ...models.task_response import TaskResponse from ...types import Response @@ -36,11 +36,11 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | ServerNetworkInterfaceResponse | None: - if response.status_code == 200: - response_200 = ServerNetworkInterfaceResponse.from_dict(response.json()) +) -> ApiError | TaskResponse | None: + if response.status_code == 202: + response_202 = TaskResponse.from_dict(response.json()) - return response_200 + return response_202 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -62,11 +62,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -75,7 +85,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | ServerNetworkInterfaceResponse]: +) -> Response[ApiError | TaskResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -89,10 +99,12 @@ def sync_detailed( *, client: AuthenticatedClient, body: ServerNetworkInterfaceCreateRequest, -) -> Response[ApiError | ServerNetworkInterfaceResponse]: +) -> Response[ApiError | TaskResponse]: """Create server network interface - Create server network interface + Starts the creation of a network interface: local, on an active local network of the cluster where + the server resides, or public, on an IP address. The creation is asynchronous and is returned as a + Task. Args: server_id (int): @@ -103,7 +115,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | ServerNetworkInterfaceResponse] + Response[ApiError | TaskResponse] """ kwargs = _get_kwargs( @@ -123,10 +135,12 @@ def sync( *, client: AuthenticatedClient, body: ServerNetworkInterfaceCreateRequest, -) -> ApiError | ServerNetworkInterfaceResponse | None: +) -> ApiError | TaskResponse | None: """Create server network interface - Create server network interface + Starts the creation of a network interface: local, on an active local network of the cluster where + the server resides, or public, on an IP address. The creation is asynchronous and is returned as a + Task. Args: server_id (int): @@ -137,7 +151,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | ServerNetworkInterfaceResponse + ApiError | TaskResponse """ return sync_detailed( @@ -152,10 +166,12 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: ServerNetworkInterfaceCreateRequest, -) -> Response[ApiError | ServerNetworkInterfaceResponse]: +) -> Response[ApiError | TaskResponse]: """Create server network interface - Create server network interface + Starts the creation of a network interface: local, on an active local network of the cluster where + the server resides, or public, on an IP address. The creation is asynchronous and is returned as a + Task. Args: server_id (int): @@ -166,7 +182,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | ServerNetworkInterfaceResponse] + Response[ApiError | TaskResponse] """ kwargs = _get_kwargs( @@ -184,10 +200,12 @@ async def asyncio( *, client: AuthenticatedClient, body: ServerNetworkInterfaceCreateRequest, -) -> ApiError | ServerNetworkInterfaceResponse | None: +) -> ApiError | TaskResponse | None: """Create server network interface - Create server network interface + Starts the creation of a network interface: local, on an active local network of the cluster where + the server resides, or public, on an IP address. The creation is asynchronous and is returned as a + Task. Args: server_id (int): @@ -198,7 +216,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | ServerNetworkInterfaceResponse + ApiError | TaskResponse """ return ( diff --git a/src/shellrent_sdk/client/api/server/hard_reboot_server.py b/src/shellrent_sdk/client/api/server/create_server_power_action.py similarity index 56% rename from src/shellrent_sdk/client/api/server/hard_reboot_server.py rename to src/shellrent_sdk/client/api/server/create_server_power_action.py index bd88b11..e7fd427 100644 --- a/src/shellrent_sdk/client/api/server/hard_reboot_server.py +++ b/src/shellrent_sdk/client/api/server/create_server_power_action.py @@ -7,31 +7,40 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError +from ...models.server_power_action_request import ServerPowerActionRequest from ...models.task_response import TaskResponse from ...types import Response def _get_kwargs( server_id: int, + *, + body: ServerPowerActionRequest, ) -> dict[str, Any]: + headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "post", - "url": "/api/v3/servers/{server_id}/hard-reboot".format( + "url": "/api/v3/servers/{server_id}/power-actions".format( server_id=quote(str(server_id), safe=""), ), } + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers return _kwargs def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | TaskResponse | None: - if response.status_code == 200: - response_200 = TaskResponse.from_dict(response.json()) + if response.status_code == 202: + response_202 = TaskResponse.from_dict(response.json()) - return response_200 + return response_202 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -53,11 +62,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -79,13 +98,19 @@ def sync_detailed( server_id: int, *, client: AuthenticatedClient, + body: ServerPowerActionRequest, ) -> Response[ApiError | TaskResponse]: - """Hard reboot server + """Start, stop or reboot a server - Hard reboot a server + Starts a power action on the server, chosen with `action`; the operation goes on in the background + as the returned Task. 403 for an action that the server does not have (physical servers only have + `reboot`); 409 while the server is not ready, its service is not active or is under maintenance, or + another operation does not allow the action. Before, each action had its own path (`…/start`, + `…/reboot`, `…/stop`, `…/hard-reboot`, `…/hard-stop`) Args: server_id (int): + body (ServerPowerActionRequest): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -97,6 +122,7 @@ def sync_detailed( kwargs = _get_kwargs( server_id=server_id, + body=body, ) response = client.get_httpx_client().request( @@ -110,13 +136,19 @@ def sync( server_id: int, *, client: AuthenticatedClient, + body: ServerPowerActionRequest, ) -> ApiError | TaskResponse | None: - """Hard reboot server + """Start, stop or reboot a server - Hard reboot a server + Starts a power action on the server, chosen with `action`; the operation goes on in the background + as the returned Task. 403 for an action that the server does not have (physical servers only have + `reboot`); 409 while the server is not ready, its service is not active or is under maintenance, or + another operation does not allow the action. Before, each action had its own path (`…/start`, + `…/reboot`, `…/stop`, `…/hard-reboot`, `…/hard-stop`) Args: server_id (int): + body (ServerPowerActionRequest): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -129,6 +161,7 @@ def sync( return sync_detailed( server_id=server_id, client=client, + body=body, ).parsed @@ -136,13 +169,19 @@ async def asyncio_detailed( server_id: int, *, client: AuthenticatedClient, + body: ServerPowerActionRequest, ) -> Response[ApiError | TaskResponse]: - """Hard reboot server + """Start, stop or reboot a server - Hard reboot a server + Starts a power action on the server, chosen with `action`; the operation goes on in the background + as the returned Task. 403 for an action that the server does not have (physical servers only have + `reboot`); 409 while the server is not ready, its service is not active or is under maintenance, or + another operation does not allow the action. Before, each action had its own path (`…/start`, + `…/reboot`, `…/stop`, `…/hard-reboot`, `…/hard-stop`) Args: server_id (int): + body (ServerPowerActionRequest): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -154,6 +193,7 @@ async def asyncio_detailed( kwargs = _get_kwargs( server_id=server_id, + body=body, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -165,13 +205,19 @@ async def asyncio( server_id: int, *, client: AuthenticatedClient, + body: ServerPowerActionRequest, ) -> ApiError | TaskResponse | None: - """Hard reboot server + """Start, stop or reboot a server - Hard reboot a server + Starts a power action on the server, chosen with `action`; the operation goes on in the background + as the returned Task. 403 for an action that the server does not have (physical servers only have + `reboot`); 409 while the server is not ready, its service is not active or is under maintenance, or + another operation does not allow the action. Before, each action had its own path (`…/start`, + `…/reboot`, `…/stop`, `…/hard-reboot`, `…/hard-stop`) Args: server_id (int): + body (ServerPowerActionRequest): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -185,5 +231,6 @@ async def asyncio( await asyncio_detailed( server_id=server_id, client=client, + body=body, ) ).parsed diff --git a/src/shellrent_sdk/client/api/server/delete_private_cloud_virtual_machine.py b/src/shellrent_sdk/client/api/server/delete_private_cloud_virtual_machine.py index 98c3a1c..ae73814 100644 --- a/src/shellrent_sdk/client/api/server/delete_private_cloud_virtual_machine.py +++ b/src/shellrent_sdk/client/api/server/delete_private_cloud_virtual_machine.py @@ -18,7 +18,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "delete", - "url": "/api/v3/servers/{server_id}/private_cloud/virtual-machines/{vm_id}".format( + "url": "/api/v3/servers/{server_id}/private-cloud/virtual-machines/{vm_id}".format( server_id=quote(str(server_id), safe=""), vm_id=quote(str(vm_id), safe=""), ), @@ -30,10 +30,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | TaskResponse | None: - if response.status_code == 200: - response_200 = TaskResponse.from_dict(response.json()) + if response.status_code == 202: + response_202 = TaskResponse.from_dict(response.json()) - return response_200 + return response_202 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -55,11 +55,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -85,7 +95,11 @@ def sync_detailed( ) -> Response[ApiError | TaskResponse]: """Delete private cloud VM - Delete private cloud VM + Deletes a virtual machine of the private cloud `server_id`, dismissing its purchase; the operation + goes on in the background as the returned Task. 404 when the virtual machine is not on the private + cloud; 409 when `server_id` is not a private cloud, while the private cloud is not active or is + suspended, or while the purchase of the virtual machine cannot be dismissed or another operation + does not allow it Args: server_id (int): @@ -119,7 +133,11 @@ def sync( ) -> ApiError | TaskResponse | None: """Delete private cloud VM - Delete private cloud VM + Deletes a virtual machine of the private cloud `server_id`, dismissing its purchase; the operation + goes on in the background as the returned Task. 404 when the virtual machine is not on the private + cloud; 409 when `server_id` is not a private cloud, while the private cloud is not active or is + suspended, or while the purchase of the virtual machine cannot be dismissed or another operation + does not allow it Args: server_id (int): @@ -148,7 +166,11 @@ async def asyncio_detailed( ) -> Response[ApiError | TaskResponse]: """Delete private cloud VM - Delete private cloud VM + Deletes a virtual machine of the private cloud `server_id`, dismissing its purchase; the operation + goes on in the background as the returned Task. 404 when the virtual machine is not on the private + cloud; 409 when `server_id` is not a private cloud, while the private cloud is not active or is + suspended, or while the purchase of the virtual machine cannot be dismissed or another operation + does not allow it Args: server_id (int): @@ -180,7 +202,11 @@ async def asyncio( ) -> ApiError | TaskResponse | None: """Delete private cloud VM - Delete private cloud VM + Deletes a virtual machine of the private cloud `server_id`, dismissing its purchase; the operation + goes on in the background as the returned Task. 404 when the virtual machine is not on the private + cloud; 409 when `server_id` is not a private cloud, while the private cloud is not active or is + suspended, or while the purchase of the virtual machine cannot be dismissed or another operation + does not allow it Args: server_id (int): diff --git a/src/shellrent_sdk/client/api/server/delete_server_automatic_snapshot.py b/src/shellrent_sdk/client/api/server/delete_server_automatic_snapshot.py index ffecaf1..d3ee42f 100644 --- a/src/shellrent_sdk/client/api/server/delete_server_automatic_snapshot.py +++ b/src/shellrent_sdk/client/api/server/delete_server_automatic_snapshot.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, cast from urllib.parse import quote import httpx @@ -7,7 +7,6 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.empty_response import EmptyResponse from ...types import Response @@ -17,7 +16,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "delete", - "url": "/api/v3/servers/{server_id}/snapshots/automatic-snapshot".format( + "url": "/api/v3/servers/{server_id}/snapshot-schedule".format( server_id=quote(str(server_id), safe=""), ), } @@ -27,11 +26,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | EmptyResponse | None: - if response.status_code == 200: - response_200 = EmptyResponse.from_dict(response.json()) - - return response_200 +) -> Any | ApiError | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -53,11 +51,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -66,7 +74,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,10 +87,11 @@ def sync_detailed( server_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Delete automatic snapshot settings - Delete automatic snapshot settings + Removes the automatic snapshot of the server (404 if none is configured). The snapshots it created + that have no expiry date receive the default expiry of the plan. Args: server_id (int): @@ -92,7 +101,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -110,10 +119,11 @@ def sync( server_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Delete automatic snapshot settings - Delete automatic snapshot settings + Removes the automatic snapshot of the server (404 if none is configured). The snapshots it created + that have no expiry date receive the default expiry of the plan. Args: server_id (int): @@ -123,7 +133,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return sync_detailed( @@ -136,10 +146,11 @@ async def asyncio_detailed( server_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Delete automatic snapshot settings - Delete automatic snapshot settings + Removes the automatic snapshot of the server (404 if none is configured). The snapshots it created + that have no expiry date receive the default expiry of the plan. Args: server_id (int): @@ -149,7 +160,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -165,10 +176,11 @@ async def asyncio( server_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Delete automatic snapshot settings - Delete automatic snapshot settings + Removes the automatic snapshot of the server (404 if none is configured). The snapshots it created + that have no expiry date receive the default expiry of the plan. Args: server_id (int): @@ -178,7 +190,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return ( diff --git a/src/shellrent_sdk/client/api/server/delete_server_exposed_backups.py b/src/shellrent_sdk/client/api/server/delete_server_exposed_backups.py index 755b067..ff29165 100644 --- a/src/shellrent_sdk/client/api/server/delete_server_exposed_backups.py +++ b/src/shellrent_sdk/client/api/server/delete_server_exposed_backups.py @@ -28,10 +28,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | TaskResponse | None: - if response.status_code == 200: - response_200 = TaskResponse.from_dict(response.json()) + if response.status_code == 202: + response_202 = TaskResponse.from_dict(response.json()) - return response_200 + return response_202 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -53,11 +53,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -82,7 +92,11 @@ def sync_detailed( ) -> Response[ApiError | TaskResponse]: """Delete exposed backups - Delete exposed backups + Removes the backups exposed on the virtual machine with `POST + /api/v3/servers/{server_id}/backups/exhibitions`; the operation goes on in the background as the + returned Task. 409 while a backup is being exposed, for a physical server or a virtual machine that + is not on oVirt, while the server is not ready, its service is not active or is under maintenance, + or another operation does not allow it Args: server_id (int): @@ -113,7 +127,11 @@ def sync( ) -> ApiError | TaskResponse | None: """Delete exposed backups - Delete exposed backups + Removes the backups exposed on the virtual machine with `POST + /api/v3/servers/{server_id}/backups/exhibitions`; the operation goes on in the background as the + returned Task. 409 while a backup is being exposed, for a physical server or a virtual machine that + is not on oVirt, while the server is not ready, its service is not active or is under maintenance, + or another operation does not allow it Args: server_id (int): @@ -139,7 +157,11 @@ async def asyncio_detailed( ) -> Response[ApiError | TaskResponse]: """Delete exposed backups - Delete exposed backups + Removes the backups exposed on the virtual machine with `POST + /api/v3/servers/{server_id}/backups/exhibitions`; the operation goes on in the background as the + returned Task. 409 while a backup is being exposed, for a physical server or a virtual machine that + is not on oVirt, while the server is not ready, its service is not active or is under maintenance, + or another operation does not allow it Args: server_id (int): @@ -168,7 +190,11 @@ async def asyncio( ) -> ApiError | TaskResponse | None: """Delete exposed backups - Delete exposed backups + Removes the backups exposed on the virtual machine with `POST + /api/v3/servers/{server_id}/backups/exhibitions`; the operation goes on in the background as the + returned Task. 409 while a backup is being exposed, for a physical server or a virtual machine that + is not on oVirt, while the server is not ready, its service is not active or is under maintenance, + or another operation does not allow it Args: server_id (int): diff --git a/src/shellrent_sdk/client/api/server/delete_server_ip_address_reverse_dns.py b/src/shellrent_sdk/client/api/server/delete_server_ip_address_reverse_dns.py index 951618e..54259f0 100644 --- a/src/shellrent_sdk/client/api/server/delete_server_ip_address_reverse_dns.py +++ b/src/shellrent_sdk/client/api/server/delete_server_ip_address_reverse_dns.py @@ -18,7 +18,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "delete", - "url": "/api/v3/servers/{server_id}/ip_addresses/{ip_address_id}/rdns".format( + "url": "/api/v3/servers/{server_id}/ip-addresses/{ip_address_id}/rdns".format( server_id=quote(str(server_id), safe=""), ip_address_id=quote(str(ip_address_id), safe=""), ), @@ -55,11 +55,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/server/delete_server_network_interface.py b/src/shellrent_sdk/client/api/server/delete_server_network_interface.py index 2974e7e..48f459c 100644 --- a/src/shellrent_sdk/client/api/server/delete_server_network_interface.py +++ b/src/shellrent_sdk/client/api/server/delete_server_network_interface.py @@ -7,7 +7,7 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.empty_response import EmptyResponse +from ...models.task_response import TaskResponse from ...types import Response @@ -29,11 +29,11 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | EmptyResponse | None: - if response.status_code == 200: - response_200 = EmptyResponse.from_dict(response.json()) +) -> ApiError | TaskResponse | None: + if response.status_code == 202: + response_202 = TaskResponse.from_dict(response.json()) - return response_200 + return response_202 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -55,11 +55,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -68,7 +78,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | EmptyResponse]: +) -> Response[ApiError | TaskResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -82,10 +92,11 @@ def sync_detailed( network_interface_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[ApiError | TaskResponse]: """Delete server network interface - Delete server network interface + Starts the deletion of an active network interface, returned as a Task. The default interface and + the one of the primary IP address cannot be deleted. Args: server_id (int): @@ -96,7 +107,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[ApiError | TaskResponse] """ kwargs = _get_kwargs( @@ -116,10 +127,11 @@ def sync( network_interface_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> ApiError | TaskResponse | None: """Delete server network interface - Delete server network interface + Starts the deletion of an active network interface, returned as a Task. The default interface and + the one of the primary IP address cannot be deleted. Args: server_id (int): @@ -130,7 +142,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + ApiError | TaskResponse """ return sync_detailed( @@ -145,10 +157,11 @@ async def asyncio_detailed( network_interface_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[ApiError | TaskResponse]: """Delete server network interface - Delete server network interface + Starts the deletion of an active network interface, returned as a Task. The default interface and + the one of the primary IP address cannot be deleted. Args: server_id (int): @@ -159,7 +172,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[ApiError | TaskResponse] """ kwargs = _get_kwargs( @@ -177,10 +190,11 @@ async def asyncio( network_interface_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> ApiError | TaskResponse | None: """Delete server network interface - Delete server network interface + Starts the deletion of an active network interface, returned as a Task. The default interface and + the one of the primary IP address cannot be deleted. Args: server_id (int): @@ -191,7 +205,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + ApiError | TaskResponse """ return ( diff --git a/src/shellrent_sdk/client/api/server/delete_server_snapshot.py b/src/shellrent_sdk/client/api/server/delete_server_snapshot.py index f088327..5938c51 100644 --- a/src/shellrent_sdk/client/api/server/delete_server_snapshot.py +++ b/src/shellrent_sdk/client/api/server/delete_server_snapshot.py @@ -30,10 +30,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | TaskResponse | None: - if response.status_code == 200: - response_200 = TaskResponse.from_dict(response.json()) + if response.status_code == 202: + response_202 = TaskResponse.from_dict(response.json()) - return response_200 + return response_202 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -55,11 +55,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/server/expose_server_backup.py b/src/shellrent_sdk/client/api/server/expose_server_backup.py index f408fad..cb194db 100644 --- a/src/shellrent_sdk/client/api/server/expose_server_backup.py +++ b/src/shellrent_sdk/client/api/server/expose_server_backup.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/api/v3/servers/{server_id}/backups/exhibit".format( + "url": "/api/v3/servers/{server_id}/backups/exhibitions".format( server_id=quote(str(server_id), safe=""), ), } @@ -37,10 +37,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | TaskResponse | None: - if response.status_code == 200: - response_200 = TaskResponse.from_dict(response.json()) + if response.status_code == 202: + response_202 = TaskResponse.from_dict(response.json()) - return response_200 + return response_202 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -62,11 +62,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -92,11 +102,17 @@ def sync_detailed( ) -> Response[ApiError | TaskResponse]: """Expose a server backup - Expose a server backup + Exposes a backup of the virtual machine (`backup_id`, one of `GET + /api/v3/servers/{server_id}/backups/exhibitions`) as an additional disk, to read its files without + restoring it: it replaces the backup exposed before, the server may restart, and the operation goes + on in the background as the returned Task. Exposed backups are removed after a few days, or with + `DELETE /api/v3/servers/{server_id}/backups/exhibitions`. 409 for a physical server or a virtual + machine that is not on oVirt, while the exposed backups are being deleted, while the server is not + ready, its service is not active or is under maintenance, or another operation does not allow it Args: server_id (int): - body (ServerBackupExhibitRequest): + body (ServerBackupExhibitRequest): Backup of the server to expose Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -126,11 +142,17 @@ def sync( ) -> ApiError | TaskResponse | None: """Expose a server backup - Expose a server backup + Exposes a backup of the virtual machine (`backup_id`, one of `GET + /api/v3/servers/{server_id}/backups/exhibitions`) as an additional disk, to read its files without + restoring it: it replaces the backup exposed before, the server may restart, and the operation goes + on in the background as the returned Task. Exposed backups are removed after a few days, or with + `DELETE /api/v3/servers/{server_id}/backups/exhibitions`. 409 for a physical server or a virtual + machine that is not on oVirt, while the exposed backups are being deleted, while the server is not + ready, its service is not active or is under maintenance, or another operation does not allow it Args: server_id (int): - body (ServerBackupExhibitRequest): + body (ServerBackupExhibitRequest): Backup of the server to expose Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -155,11 +177,17 @@ async def asyncio_detailed( ) -> Response[ApiError | TaskResponse]: """Expose a server backup - Expose a server backup + Exposes a backup of the virtual machine (`backup_id`, one of `GET + /api/v3/servers/{server_id}/backups/exhibitions`) as an additional disk, to read its files without + restoring it: it replaces the backup exposed before, the server may restart, and the operation goes + on in the background as the returned Task. Exposed backups are removed after a few days, or with + `DELETE /api/v3/servers/{server_id}/backups/exhibitions`. 409 for a physical server or a virtual + machine that is not on oVirt, while the exposed backups are being deleted, while the server is not + ready, its service is not active or is under maintenance, or another operation does not allow it Args: server_id (int): - body (ServerBackupExhibitRequest): + body (ServerBackupExhibitRequest): Backup of the server to expose Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -187,11 +215,17 @@ async def asyncio( ) -> ApiError | TaskResponse | None: """Expose a server backup - Expose a server backup + Exposes a backup of the virtual machine (`backup_id`, one of `GET + /api/v3/servers/{server_id}/backups/exhibitions`) as an additional disk, to read its files without + restoring it: it replaces the backup exposed before, the server may restart, and the operation goes + on in the background as the returned Task. Exposed backups are removed after a few days, or with + `DELETE /api/v3/servers/{server_id}/backups/exhibitions`. 409 for a physical server or a virtual + machine that is not on oVirt, while the exposed backups are being deleted, while the server is not + ready, its service is not active or is under maintenance, or another operation does not allow it Args: server_id (int): - body (ServerBackupExhibitRequest): + body (ServerBackupExhibitRequest): Backup of the server to expose Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/server/get_server.py b/src/shellrent_sdk/client/api/server/get_server.py index d7146ae..887e3ec 100644 --- a/src/shellrent_sdk/client/api/server/get_server.py +++ b/src/shellrent_sdk/client/api/server/get_server.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/server/get_server_automatic_snapshot.py b/src/shellrent_sdk/client/api/server/get_server_automatic_snapshot.py index 4ef6dbc..b26d80b 100644 --- a/src/shellrent_sdk/client/api/server/get_server_automatic_snapshot.py +++ b/src/shellrent_sdk/client/api/server/get_server_automatic_snapshot.py @@ -17,7 +17,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v3/servers/{server_id}/snapshots/automatic-snapshot".format( + "url": "/api/v3/servers/{server_id}/snapshot-schedule".format( server_id=quote(str(server_id), safe=""), ), } @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -82,7 +87,9 @@ def sync_detailed( ) -> Response[ApiError | ServerAutomaticSnapshotResponse]: """Get automatic snapshot settings - Get automatic snapshot settings + Returns the automatic snapshot of the server (404 if none is configured). Automatic snapshots must + be included in the service plan (for a private cloud VM, in the plan of the private cloud), + otherwise the response is 403. Args: server_id (int): @@ -113,7 +120,9 @@ def sync( ) -> ApiError | ServerAutomaticSnapshotResponse | None: """Get automatic snapshot settings - Get automatic snapshot settings + Returns the automatic snapshot of the server (404 if none is configured). Automatic snapshots must + be included in the service plan (for a private cloud VM, in the plan of the private cloud), + otherwise the response is 403. Args: server_id (int): @@ -139,7 +148,9 @@ async def asyncio_detailed( ) -> Response[ApiError | ServerAutomaticSnapshotResponse]: """Get automatic snapshot settings - Get automatic snapshot settings + Returns the automatic snapshot of the server (404 if none is configured). Automatic snapshots must + be included in the service plan (for a private cloud VM, in the plan of the private cloud), + otherwise the response is 403. Args: server_id (int): @@ -168,7 +179,9 @@ async def asyncio( ) -> ApiError | ServerAutomaticSnapshotResponse | None: """Get automatic snapshot settings - Get automatic snapshot settings + Returns the automatic snapshot of the server (404 if none is configured). Automatic snapshots must + be included in the service plan (for a private cloud VM, in the plan of the private cloud), + otherwise the response is 403. Args: server_id (int): diff --git a/src/shellrent_sdk/client/api/server/get_server_backup.py b/src/shellrent_sdk/client/api/server/get_server_backup.py index a196e40..eb2bbeb 100644 --- a/src/shellrent_sdk/client/api/server/get_server_backup.py +++ b/src/shellrent_sdk/client/api/server/get_server_backup.py @@ -60,6 +60,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/server/get_server_ip_address.py b/src/shellrent_sdk/client/api/server/get_server_ip_address.py index ac24ab1..5df3cce 100644 --- a/src/shellrent_sdk/client/api/server/get_server_ip_address.py +++ b/src/shellrent_sdk/client/api/server/get_server_ip_address.py @@ -18,7 +18,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v3/servers/{server_id}/ip_addresses/{ip_address_id}".format( + "url": "/api/v3/servers/{server_id}/ip-addresses/{ip_address_id}".format( server_id=quote(str(server_id), safe=""), ip_address_id=quote(str(ip_address_id), safe=""), ), @@ -60,6 +60,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/server/get_server_network_interface.py b/src/shellrent_sdk/client/api/server/get_server_network_interface.py index 695eff8..7db8629 100644 --- a/src/shellrent_sdk/client/api/server/get_server_network_interface.py +++ b/src/shellrent_sdk/client/api/server/get_server_network_interface.py @@ -60,6 +60,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -85,7 +90,7 @@ def sync_detailed( ) -> Response[ApiError | ServerNetworkInterfaceResponse]: """Get server network interface - Get server network interface + Returns an active network interface (VIF) of the server; a deleted interface responds 404 Args: server_id (int): @@ -119,7 +124,7 @@ def sync( ) -> ApiError | ServerNetworkInterfaceResponse | None: """Get server network interface - Get server network interface + Returns an active network interface (VIF) of the server; a deleted interface responds 404 Args: server_id (int): @@ -148,7 +153,7 @@ async def asyncio_detailed( ) -> Response[ApiError | ServerNetworkInterfaceResponse]: """Get server network interface - Get server network interface + Returns an active network interface (VIF) of the server; a deleted interface responds 404 Args: server_id (int): @@ -180,7 +185,7 @@ async def asyncio( ) -> ApiError | ServerNetworkInterfaceResponse | None: """Get server network interface - Get server network interface + Returns an active network interface (VIF) of the server; a deleted interface responds 404 Args: server_id (int): diff --git a/src/shellrent_sdk/client/api/server/get_server_private_cloud.py b/src/shellrent_sdk/client/api/server/get_server_private_cloud.py index 3111ce3..7b64fe6 100644 --- a/src/shellrent_sdk/client/api/server/get_server_private_cloud.py +++ b/src/shellrent_sdk/client/api/server/get_server_private_cloud.py @@ -17,7 +17,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v3/servers/{server_id}/private_cloud".format( + "url": "/api/v3/servers/{server_id}/private-cloud".format( server_id=quote(str(server_id), safe=""), ), } @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/server/get_server_snapshot.py b/src/shellrent_sdk/client/api/server/get_server_snapshot.py index 9ad0a6f..f4b5120 100644 --- a/src/shellrent_sdk/client/api/server/get_server_snapshot.py +++ b/src/shellrent_sdk/client/api/server/get_server_snapshot.py @@ -60,6 +60,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/server/hard_stop_server.py b/src/shellrent_sdk/client/api/server/hard_stop_server.py deleted file mode 100644 index b4fe224..0000000 --- a/src/shellrent_sdk/client/api/server/hard_stop_server.py +++ /dev/null @@ -1,189 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.api_error import ApiError -from ...models.task_response import TaskResponse -from ...types import Response - - -def _get_kwargs( - server_id: int, -) -> dict[str, Any]: - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/api/v3/servers/{server_id}/hard-stop".format( - server_id=quote(str(server_id), safe=""), - ), - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | TaskResponse | None: - if response.status_code == 200: - response_200 = TaskResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 400: - response_400 = ApiError.from_dict(response.json()) - - return response_400 - - if response.status_code == 401: - response_401 = ApiError.from_dict(response.json()) - - return response_401 - - if response.status_code == 403: - response_403 = ApiError.from_dict(response.json()) - - return response_403 - - if response.status_code == 404: - response_404 = ApiError.from_dict(response.json()) - - return response_404 - - if response.status_code == 429: - response_429 = ApiError.from_dict(response.json()) - - return response_429 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | TaskResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - server_id: int, - *, - client: AuthenticatedClient, -) -> Response[ApiError | TaskResponse]: - """Hard stop server - - Hard stop a server - - Args: - server_id (int): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApiError | TaskResponse] - """ - - kwargs = _get_kwargs( - server_id=server_id, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - server_id: int, - *, - client: AuthenticatedClient, -) -> ApiError | TaskResponse | None: - """Hard stop server - - Hard stop a server - - Args: - server_id (int): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApiError | TaskResponse - """ - - return sync_detailed( - server_id=server_id, - client=client, - ).parsed - - -async def asyncio_detailed( - server_id: int, - *, - client: AuthenticatedClient, -) -> Response[ApiError | TaskResponse]: - """Hard stop server - - Hard stop a server - - Args: - server_id (int): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApiError | TaskResponse] - """ - - kwargs = _get_kwargs( - server_id=server_id, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - server_id: int, - *, - client: AuthenticatedClient, -) -> ApiError | TaskResponse | None: - """Hard stop server - - Hard stop a server - - Args: - server_id (int): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApiError | TaskResponse - """ - - return ( - await asyncio_detailed( - server_id=server_id, - client=client, - ) - ).parsed diff --git a/src/shellrent_sdk/client/api/license_/list_secure_mail_mailboxes.py b/src/shellrent_sdk/client/api/server/list_private_cloud_available_ip_addresses.py similarity index 58% rename from src/shellrent_sdk/client/api/license_/list_secure_mail_mailboxes.py rename to src/shellrent_sdk/client/api/server/list_private_cloud_available_ip_addresses.py index 24e2c34..208632a 100644 --- a/src/shellrent_sdk/client/api/license_/list_secure_mail_mailboxes.py +++ b/src/shellrent_sdk/client/api/server/list_private_cloud_available_ip_addresses.py @@ -7,17 +7,15 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.securemail_mailbox_paginated_list_response import ( - SecuremailMailboxPaginatedListResponse, -) +from ...models.ip_address_paginated_list_response import IpAddressPaginatedListResponse from ...types import UNSET, Response, Unset def _get_kwargs( - securemail_id: int, + server_id: int, *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -30,8 +28,8 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v3/securemails/{securemail_id}/mailboxes".format( - securemail_id=quote(str(securemail_id), safe=""), + "url": "/api/v3/servers/{server_id}/private-cloud/available-ip-addresses".format( + server_id=quote(str(server_id), safe=""), ), "params": params, } @@ -41,9 +39,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | SecuremailMailboxPaginatedListResponse | None: +) -> ApiError | IpAddressPaginatedListResponse | None: if response.status_code == 200: - response_200 = SecuremailMailboxPaginatedListResponse.from_dict(response.json()) + response_200 = IpAddressPaginatedListResponse.from_dict(response.json()) return response_200 @@ -72,6 +70,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -80,7 +83,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | SecuremailMailboxPaginatedListResponse]: +) -> Response[ApiError | IpAddressPaginatedListResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -90,31 +93,33 @@ def _build_response( def sync_detailed( - securemail_id: int, + server_id: int, *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, -) -> Response[ApiError | SecuremailMailboxPaginatedListResponse]: - """List SecureMail mailboxes + per_page: int | Unset = 20, +) -> Response[ApiError | IpAddressPaginatedListResponse]: + """List free IP addresses of a private cloud - Get a paginated list of primary mailboxes for a SecureMail by LibraESVA subscription + Free and available IP addresses of the pool of the private cloud, the ones to use as `ip_address_id` + to create a VM of the private cloud or a public network interface of one of its VMs. The server can + be the private cloud or one of its VMs. Args: - securemail_id (int): + server_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | SecuremailMailboxPaginatedListResponse] + Response[ApiError | IpAddressPaginatedListResponse] """ kwargs = _get_kwargs( - securemail_id=securemail_id, + server_id=server_id, page=page, per_page=per_page, ) @@ -127,31 +132,33 @@ def sync_detailed( def sync( - securemail_id: int, + server_id: int, *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, -) -> ApiError | SecuremailMailboxPaginatedListResponse | None: - """List SecureMail mailboxes + per_page: int | Unset = 20, +) -> ApiError | IpAddressPaginatedListResponse | None: + """List free IP addresses of a private cloud - Get a paginated list of primary mailboxes for a SecureMail by LibraESVA subscription + Free and available IP addresses of the pool of the private cloud, the ones to use as `ip_address_id` + to create a VM of the private cloud or a public network interface of one of its VMs. The server can + be the private cloud or one of its VMs. Args: - securemail_id (int): + server_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | SecuremailMailboxPaginatedListResponse + ApiError | IpAddressPaginatedListResponse """ return sync_detailed( - securemail_id=securemail_id, + server_id=server_id, client=client, page=page, per_page=per_page, @@ -159,31 +166,33 @@ def sync( async def asyncio_detailed( - securemail_id: int, + server_id: int, *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, -) -> Response[ApiError | SecuremailMailboxPaginatedListResponse]: - """List SecureMail mailboxes + per_page: int | Unset = 20, +) -> Response[ApiError | IpAddressPaginatedListResponse]: + """List free IP addresses of a private cloud - Get a paginated list of primary mailboxes for a SecureMail by LibraESVA subscription + Free and available IP addresses of the pool of the private cloud, the ones to use as `ip_address_id` + to create a VM of the private cloud or a public network interface of one of its VMs. The server can + be the private cloud or one of its VMs. Args: - securemail_id (int): + server_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | SecuremailMailboxPaginatedListResponse] + Response[ApiError | IpAddressPaginatedListResponse] """ kwargs = _get_kwargs( - securemail_id=securemail_id, + server_id=server_id, page=page, per_page=per_page, ) @@ -194,32 +203,34 @@ async def asyncio_detailed( async def asyncio( - securemail_id: int, + server_id: int, *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, -) -> ApiError | SecuremailMailboxPaginatedListResponse | None: - """List SecureMail mailboxes + per_page: int | Unset = 20, +) -> ApiError | IpAddressPaginatedListResponse | None: + """List free IP addresses of a private cloud - Get a paginated list of primary mailboxes for a SecureMail by LibraESVA subscription + Free and available IP addresses of the pool of the private cloud, the ones to use as `ip_address_id` + to create a VM of the private cloud or a public network interface of one of its VMs. The server can + be the private cloud or one of its VMs. Args: - securemail_id (int): + server_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | SecuremailMailboxPaginatedListResponse + ApiError | IpAddressPaginatedListResponse """ return ( await asyncio_detailed( - securemail_id=securemail_id, + server_id=server_id, client=client, page=page, per_page=per_page, diff --git a/src/shellrent_sdk/client/api/server/list_server_backups.py b/src/shellrent_sdk/client/api/server/list_server_backups.py index d050bcc..61c1203 100644 --- a/src/shellrent_sdk/client/api/server/list_server_backups.py +++ b/src/shellrent_sdk/client/api/server/list_server_backups.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/server/list_server_credentials.py b/src/shellrent_sdk/client/api/server/list_server_credentials.py index 8f1ae75..3a0400d 100644 --- a/src/shellrent_sdk/client/api/server/list_server_credentials.py +++ b/src/shellrent_sdk/client/api/server/list_server_credentials.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/server/list_server_exposed_backups.py b/src/shellrent_sdk/client/api/server/list_server_exposed_backups.py index f55b94c..dde7fda 100644 --- a/src/shellrent_sdk/client/api/server/list_server_exposed_backups.py +++ b/src/shellrent_sdk/client/api/server/list_server_exposed_backups.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -80,9 +85,11 @@ def sync_detailed( *, client: AuthenticatedClient, ) -> Response[ApiError | ServerBackupListResponse]: - """List exposed server backups + """List exposable server backups - List server backups + Lists the backups of the server that can be exposed with `POST + /api/v3/servers/{server_id}/backups/exhibitions`: the restorable backups visible to the customer, + one-off backups included. It does not tell which backup is exposed now Args: server_id (int): @@ -111,9 +118,11 @@ def sync( *, client: AuthenticatedClient, ) -> ApiError | ServerBackupListResponse | None: - """List exposed server backups + """List exposable server backups - List server backups + Lists the backups of the server that can be exposed with `POST + /api/v3/servers/{server_id}/backups/exhibitions`: the restorable backups visible to the customer, + one-off backups included. It does not tell which backup is exposed now Args: server_id (int): @@ -137,9 +146,11 @@ async def asyncio_detailed( *, client: AuthenticatedClient, ) -> Response[ApiError | ServerBackupListResponse]: - """List exposed server backups + """List exposable server backups - List server backups + Lists the backups of the server that can be exposed with `POST + /api/v3/servers/{server_id}/backups/exhibitions`: the restorable backups visible to the customer, + one-off backups included. It does not tell which backup is exposed now Args: server_id (int): @@ -166,9 +177,11 @@ async def asyncio( *, client: AuthenticatedClient, ) -> ApiError | ServerBackupListResponse | None: - """List exposed server backups + """List exposable server backups - List server backups + Lists the backups of the server that can be exposed with `POST + /api/v3/servers/{server_id}/backups/exhibitions`: the restorable backups visible to the customer, + one-off backups included. It does not tell which backup is exposed now Args: server_id (int): diff --git a/src/shellrent_sdk/client/api/server/list_server_ip_addresses.py b/src/shellrent_sdk/client/api/server/list_server_ip_addresses.py index 0e62fd9..0304ab7 100644 --- a/src/shellrent_sdk/client/api/server/list_server_ip_addresses.py +++ b/src/shellrent_sdk/client/api/server/list_server_ip_addresses.py @@ -17,7 +17,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v3/servers/{server_id}/ip_addresses".format( + "url": "/api/v3/servers/{server_id}/ip-addresses".format( server_id=quote(str(server_id), safe=""), ), } @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/server/list_server_network_interfaces.py b/src/shellrent_sdk/client/api/server/list_server_network_interfaces.py index c6db0ce..c47fd25 100644 --- a/src/shellrent_sdk/client/api/server/list_server_network_interfaces.py +++ b/src/shellrent_sdk/client/api/server/list_server_network_interfaces.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -82,7 +87,8 @@ def sync_detailed( ) -> Response[ApiError | ServerNetworkInterfaceListResponse]: """List server network interfaces - List server network interfaces + Lists the active network interfaces (VIF) of the server, on public and local networks; the deleted + interfaces are not returned Args: server_id (int): @@ -113,7 +119,8 @@ def sync( ) -> ApiError | ServerNetworkInterfaceListResponse | None: """List server network interfaces - List server network interfaces + Lists the active network interfaces (VIF) of the server, on public and local networks; the deleted + interfaces are not returned Args: server_id (int): @@ -139,7 +146,8 @@ async def asyncio_detailed( ) -> Response[ApiError | ServerNetworkInterfaceListResponse]: """List server network interfaces - List server network interfaces + Lists the active network interfaces (VIF) of the server, on public and local networks; the deleted + interfaces are not returned Args: server_id (int): @@ -168,7 +176,8 @@ async def asyncio( ) -> ApiError | ServerNetworkInterfaceListResponse | None: """List server network interfaces - List server network interfaces + Lists the active network interfaces (VIF) of the server, on public and local networks; the deleted + interfaces are not returned Args: server_id (int): diff --git a/src/shellrent_sdk/client/api/server/list_server_snapshots.py b/src/shellrent_sdk/client/api/server/list_server_snapshots.py index 39b0f63..d424299 100644 --- a/src/shellrent_sdk/client/api/server/list_server_snapshots.py +++ b/src/shellrent_sdk/client/api/server/list_server_snapshots.py @@ -15,7 +15,7 @@ def _get_kwargs( server_id: int, *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -70,6 +70,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -92,7 +97,7 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | ServerSnapshotPaginatedListResponse]: """List server snapshots @@ -101,7 +106,7 @@ def sync_detailed( Args: server_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -129,7 +134,7 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | ServerSnapshotPaginatedListResponse | None: """List server snapshots @@ -138,7 +143,7 @@ def sync( Args: server_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -161,7 +166,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | ServerSnapshotPaginatedListResponse]: """List server snapshots @@ -170,7 +175,7 @@ async def asyncio_detailed( Args: server_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -196,7 +201,7 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | ServerSnapshotPaginatedListResponse | None: """List server snapshots @@ -205,7 +210,7 @@ async def asyncio( Args: server_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/server/list_servers.py b/src/shellrent_sdk/client/api/server/list_servers.py index cc5c0b8..4be41a2 100644 --- a/src/shellrent_sdk/client/api/server/list_servers.py +++ b/src/shellrent_sdk/client/api/server/list_servers.py @@ -13,7 +13,7 @@ def _get_kwargs( *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -66,6 +66,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -87,7 +92,7 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | ServerPaginatedListResponse]: """List servers @@ -95,7 +100,7 @@ def sync_detailed( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -121,7 +126,7 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | ServerPaginatedListResponse | None: """List servers @@ -129,7 +134,7 @@ def sync( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -150,7 +155,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | ServerPaginatedListResponse]: """List servers @@ -158,7 +163,7 @@ async def asyncio_detailed( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -182,7 +187,7 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | ServerPaginatedListResponse | None: """List servers @@ -190,7 +195,7 @@ async def asyncio( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/server/reboot_server.py b/src/shellrent_sdk/client/api/server/reboot_server.py deleted file mode 100644 index 31909d9..0000000 --- a/src/shellrent_sdk/client/api/server/reboot_server.py +++ /dev/null @@ -1,189 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.api_error import ApiError -from ...models.task_response import TaskResponse -from ...types import Response - - -def _get_kwargs( - server_id: int, -) -> dict[str, Any]: - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/api/v3/servers/{server_id}/reboot".format( - server_id=quote(str(server_id), safe=""), - ), - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | TaskResponse | None: - if response.status_code == 200: - response_200 = TaskResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 400: - response_400 = ApiError.from_dict(response.json()) - - return response_400 - - if response.status_code == 401: - response_401 = ApiError.from_dict(response.json()) - - return response_401 - - if response.status_code == 403: - response_403 = ApiError.from_dict(response.json()) - - return response_403 - - if response.status_code == 404: - response_404 = ApiError.from_dict(response.json()) - - return response_404 - - if response.status_code == 429: - response_429 = ApiError.from_dict(response.json()) - - return response_429 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | TaskResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - server_id: int, - *, - client: AuthenticatedClient, -) -> Response[ApiError | TaskResponse]: - """Reboot server - - Reboot a server - - Args: - server_id (int): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApiError | TaskResponse] - """ - - kwargs = _get_kwargs( - server_id=server_id, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - server_id: int, - *, - client: AuthenticatedClient, -) -> ApiError | TaskResponse | None: - """Reboot server - - Reboot a server - - Args: - server_id (int): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApiError | TaskResponse - """ - - return sync_detailed( - server_id=server_id, - client=client, - ).parsed - - -async def asyncio_detailed( - server_id: int, - *, - client: AuthenticatedClient, -) -> Response[ApiError | TaskResponse]: - """Reboot server - - Reboot a server - - Args: - server_id (int): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApiError | TaskResponse] - """ - - kwargs = _get_kwargs( - server_id=server_id, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - server_id: int, - *, - client: AuthenticatedClient, -) -> ApiError | TaskResponse | None: - """Reboot server - - Reboot a server - - Args: - server_id (int): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApiError | TaskResponse - """ - - return ( - await asyncio_detailed( - server_id=server_id, - client=client, - ) - ).parsed diff --git a/src/shellrent_sdk/client/api/server/reinstall_server.py b/src/shellrent_sdk/client/api/server/reinstall_server.py index 4afd8f4..b4023e4 100644 --- a/src/shellrent_sdk/client/api/server/reinstall_server.py +++ b/src/shellrent_sdk/client/api/server/reinstall_server.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/api/v3/servers/{server_id}/reinstall".format( + "url": "/api/v3/servers/{server_id}/reinstallations".format( server_id=quote(str(server_id), safe=""), ), } @@ -38,10 +38,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | TaskResponse | None: - if response.status_code == 200: - response_200 = TaskResponse.from_dict(response.json()) + if response.status_code == 202: + response_202 = TaskResponse.from_dict(response.json()) - return response_200 + return response_202 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -63,11 +63,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -93,7 +103,11 @@ def sync_detailed( ) -> Response[ApiError | TaskResponse]: """Reinstall server - Reinstall server + Reinstalls the virtual machine with its current template and operating system: it deletes the + virtual machine and its snapshots and creates it again, after a safety backup unless + `safety_backup_enabled` is false. The operation goes on in the background as the returned Task. 409 + for a physical server, while the server is not ready, its service is not active or is under + maintenance, or another operation does not allow it Args: server_id (int): @@ -127,7 +141,11 @@ def sync( ) -> ApiError | TaskResponse | None: """Reinstall server - Reinstall server + Reinstalls the virtual machine with its current template and operating system: it deletes the + virtual machine and its snapshots and creates it again, after a safety backup unless + `safety_backup_enabled` is false. The operation goes on in the background as the returned Task. 409 + for a physical server, while the server is not ready, its service is not active or is under + maintenance, or another operation does not allow it Args: server_id (int): @@ -156,7 +174,11 @@ async def asyncio_detailed( ) -> Response[ApiError | TaskResponse]: """Reinstall server - Reinstall server + Reinstalls the virtual machine with its current template and operating system: it deletes the + virtual machine and its snapshots and creates it again, after a safety backup unless + `safety_backup_enabled` is false. The operation goes on in the background as the returned Task. 409 + for a physical server, while the server is not ready, its service is not active or is under + maintenance, or another operation does not allow it Args: server_id (int): @@ -188,7 +210,11 @@ async def asyncio( ) -> ApiError | TaskResponse | None: """Reinstall server - Reinstall server + Reinstalls the virtual machine with its current template and operating system: it deletes the + virtual machine and its snapshots and creates it again, after a safety backup unless + `safety_backup_enabled` is false. The operation goes on in the background as the returned Task. 409 + for a physical server, while the server is not ready, its service is not active or is under + maintenance, or another operation does not allow it Args: server_id (int): diff --git a/src/shellrent_sdk/client/api/server/restore_server_backup.py b/src/shellrent_sdk/client/api/server/restore_server_backup.py index ff8ad99..51611cd 100644 --- a/src/shellrent_sdk/client/api/server/restore_server_backup.py +++ b/src/shellrent_sdk/client/api/server/restore_server_backup.py @@ -18,7 +18,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/api/v3/servers/{server_id}/backups/{server_backup_id}/restore".format( + "url": "/api/v3/servers/{server_id}/backups/{server_backup_id}/restores".format( server_id=quote(str(server_id), safe=""), server_backup_id=quote(str(server_backup_id), safe=""), ), @@ -30,10 +30,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | TaskResponse | None: - if response.status_code == 200: - response_200 = TaskResponse.from_dict(response.json()) + if response.status_code == 202: + response_202 = TaskResponse.from_dict(response.json()) - return response_200 + return response_202 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -55,11 +55,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/server/restore_server_snapshot.py b/src/shellrent_sdk/client/api/server/restore_server_snapshot.py index e239c88..a7b522c 100644 --- a/src/shellrent_sdk/client/api/server/restore_server_snapshot.py +++ b/src/shellrent_sdk/client/api/server/restore_server_snapshot.py @@ -18,7 +18,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/api/v3/servers/{server_id}/snapshots/{snapshot_id}/restore".format( + "url": "/api/v3/servers/{server_id}/snapshots/{snapshot_id}/restores".format( server_id=quote(str(server_id), safe=""), snapshot_id=quote(str(snapshot_id), safe=""), ), @@ -30,10 +30,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | TaskResponse | None: - if response.status_code == 200: - response_200 = TaskResponse.from_dict(response.json()) + if response.status_code == 202: + response_202 = TaskResponse.from_dict(response.json()) - return response_200 + return response_202 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -55,11 +55,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/server/start_server.py b/src/shellrent_sdk/client/api/server/start_server.py deleted file mode 100644 index 08f5efd..0000000 --- a/src/shellrent_sdk/client/api/server/start_server.py +++ /dev/null @@ -1,189 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.api_error import ApiError -from ...models.task_response import TaskResponse -from ...types import Response - - -def _get_kwargs( - server_id: int, -) -> dict[str, Any]: - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/api/v3/servers/{server_id}/start".format( - server_id=quote(str(server_id), safe=""), - ), - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | TaskResponse | None: - if response.status_code == 200: - response_200 = TaskResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 400: - response_400 = ApiError.from_dict(response.json()) - - return response_400 - - if response.status_code == 401: - response_401 = ApiError.from_dict(response.json()) - - return response_401 - - if response.status_code == 403: - response_403 = ApiError.from_dict(response.json()) - - return response_403 - - if response.status_code == 404: - response_404 = ApiError.from_dict(response.json()) - - return response_404 - - if response.status_code == 429: - response_429 = ApiError.from_dict(response.json()) - - return response_429 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | TaskResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - server_id: int, - *, - client: AuthenticatedClient, -) -> Response[ApiError | TaskResponse]: - """Start server - - Start a server - - Args: - server_id (int): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApiError | TaskResponse] - """ - - kwargs = _get_kwargs( - server_id=server_id, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - server_id: int, - *, - client: AuthenticatedClient, -) -> ApiError | TaskResponse | None: - """Start server - - Start a server - - Args: - server_id (int): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApiError | TaskResponse - """ - - return sync_detailed( - server_id=server_id, - client=client, - ).parsed - - -async def asyncio_detailed( - server_id: int, - *, - client: AuthenticatedClient, -) -> Response[ApiError | TaskResponse]: - """Start server - - Start a server - - Args: - server_id (int): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApiError | TaskResponse] - """ - - kwargs = _get_kwargs( - server_id=server_id, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - server_id: int, - *, - client: AuthenticatedClient, -) -> ApiError | TaskResponse | None: - """Start server - - Start a server - - Args: - server_id (int): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApiError | TaskResponse - """ - - return ( - await asyncio_detailed( - server_id=server_id, - client=client, - ) - ).parsed diff --git a/src/shellrent_sdk/client/api/server/start_server_first_backup.py b/src/shellrent_sdk/client/api/server/start_server_first_backup.py deleted file mode 100644 index 3d5f9a1..0000000 --- a/src/shellrent_sdk/client/api/server/start_server_first_backup.py +++ /dev/null @@ -1,189 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.api_error import ApiError -from ...models.task_response import TaskResponse -from ...types import Response - - -def _get_kwargs( - server_id: int, -) -> dict[str, Any]: - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/api/v3/servers/{server_id}/backups/first-save".format( - server_id=quote(str(server_id), safe=""), - ), - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | TaskResponse | None: - if response.status_code == 200: - response_200 = TaskResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 400: - response_400 = ApiError.from_dict(response.json()) - - return response_400 - - if response.status_code == 401: - response_401 = ApiError.from_dict(response.json()) - - return response_401 - - if response.status_code == 403: - response_403 = ApiError.from_dict(response.json()) - - return response_403 - - if response.status_code == 404: - response_404 = ApiError.from_dict(response.json()) - - return response_404 - - if response.status_code == 429: - response_429 = ApiError.from_dict(response.json()) - - return response_429 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | TaskResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - server_id: int, - *, - client: AuthenticatedClient, -) -> Response[ApiError | TaskResponse]: - """Start first backup save - - Start first backup save - - Args: - server_id (int): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApiError | TaskResponse] - """ - - kwargs = _get_kwargs( - server_id=server_id, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - server_id: int, - *, - client: AuthenticatedClient, -) -> ApiError | TaskResponse | None: - """Start first backup save - - Start first backup save - - Args: - server_id (int): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApiError | TaskResponse - """ - - return sync_detailed( - server_id=server_id, - client=client, - ).parsed - - -async def asyncio_detailed( - server_id: int, - *, - client: AuthenticatedClient, -) -> Response[ApiError | TaskResponse]: - """Start first backup save - - Start first backup save - - Args: - server_id (int): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApiError | TaskResponse] - """ - - kwargs = _get_kwargs( - server_id=server_id, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - server_id: int, - *, - client: AuthenticatedClient, -) -> ApiError | TaskResponse | None: - """Start first backup save - - Start first backup save - - Args: - server_id (int): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApiError | TaskResponse - """ - - return ( - await asyncio_detailed( - server_id=server_id, - client=client, - ) - ).parsed diff --git a/src/shellrent_sdk/client/api/server/stop_server.py b/src/shellrent_sdk/client/api/server/stop_server.py deleted file mode 100644 index cfda508..0000000 --- a/src/shellrent_sdk/client/api/server/stop_server.py +++ /dev/null @@ -1,189 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.api_error import ApiError -from ...models.task_response import TaskResponse -from ...types import Response - - -def _get_kwargs( - server_id: int, -) -> dict[str, Any]: - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/api/v3/servers/{server_id}/stop".format( - server_id=quote(str(server_id), safe=""), - ), - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | TaskResponse | None: - if response.status_code == 200: - response_200 = TaskResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 400: - response_400 = ApiError.from_dict(response.json()) - - return response_400 - - if response.status_code == 401: - response_401 = ApiError.from_dict(response.json()) - - return response_401 - - if response.status_code == 403: - response_403 = ApiError.from_dict(response.json()) - - return response_403 - - if response.status_code == 404: - response_404 = ApiError.from_dict(response.json()) - - return response_404 - - if response.status_code == 429: - response_429 = ApiError.from_dict(response.json()) - - return response_429 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | TaskResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - server_id: int, - *, - client: AuthenticatedClient, -) -> Response[ApiError | TaskResponse]: - """Stop server - - Stop a server - - Args: - server_id (int): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApiError | TaskResponse] - """ - - kwargs = _get_kwargs( - server_id=server_id, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - server_id: int, - *, - client: AuthenticatedClient, -) -> ApiError | TaskResponse | None: - """Stop server - - Stop a server - - Args: - server_id (int): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApiError | TaskResponse - """ - - return sync_detailed( - server_id=server_id, - client=client, - ).parsed - - -async def asyncio_detailed( - server_id: int, - *, - client: AuthenticatedClient, -) -> Response[ApiError | TaskResponse]: - """Stop server - - Stop a server - - Args: - server_id (int): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApiError | TaskResponse] - """ - - kwargs = _get_kwargs( - server_id=server_id, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - server_id: int, - *, - client: AuthenticatedClient, -) -> ApiError | TaskResponse | None: - """Stop server - - Stop a server - - Args: - server_id (int): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApiError | TaskResponse - """ - - return ( - await asyncio_detailed( - server_id=server_id, - client=client, - ) - ).parsed diff --git a/src/shellrent_sdk/client/api/server/update_private_cloud_virtual_machine.py b/src/shellrent_sdk/client/api/server/update_private_cloud_virtual_machine.py index c1cffe9..2b241dc 100644 --- a/src/shellrent_sdk/client/api/server/update_private_cloud_virtual_machine.py +++ b/src/shellrent_sdk/client/api/server/update_private_cloud_virtual_machine.py @@ -7,6 +7,7 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError +from ...models.empty_response import EmptyResponse from ...models.private_cloud_vm_update_request import PrivateCloudVmUpdateRequest from ...models.task_response import TaskResponse from ...types import Response @@ -22,7 +23,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": "/api/v3/servers/{server_id}/private_cloud/virtual-machines/{vm_id}".format( + "url": "/api/v3/servers/{server_id}/private-cloud/virtual-machines/{vm_id}".format( server_id=quote(str(server_id), safe=""), vm_id=quote(str(vm_id), safe=""), ), @@ -38,12 +39,17 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | TaskResponse | None: +) -> ApiError | EmptyResponse | TaskResponse | None: if response.status_code == 200: - response_200 = TaskResponse.from_dict(response.json()) + response_200 = EmptyResponse.from_dict(response.json()) return response_200 + if response.status_code == 202: + response_202 = TaskResponse.from_dict(response.json()) + + return response_202 + if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -64,11 +70,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -77,7 +93,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | TaskResponse]: +) -> Response[ApiError | EmptyResponse | TaskResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -92,10 +108,12 @@ def sync_detailed( *, client: AuthenticatedClient, body: PrivateCloudVmUpdateRequest, -) -> Response[ApiError | TaskResponse]: +) -> Response[ApiError | EmptyResponse | TaskResponse]: """Update private cloud VM - Update private cloud VM + Updates the note and the resources of a private cloud VM. The change of cpu, ram or disk starts an + asynchronous operation, returned as a Task; when none of them differs from the current value no + operation starts and `data` is null. Args: server_id (int): @@ -107,7 +125,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | TaskResponse] + Response[ApiError | EmptyResponse | TaskResponse] """ kwargs = _get_kwargs( @@ -129,10 +147,12 @@ def sync( *, client: AuthenticatedClient, body: PrivateCloudVmUpdateRequest, -) -> ApiError | TaskResponse | None: +) -> ApiError | EmptyResponse | TaskResponse | None: """Update private cloud VM - Update private cloud VM + Updates the note and the resources of a private cloud VM. The change of cpu, ram or disk starts an + asynchronous operation, returned as a Task; when none of them differs from the current value no + operation starts and `data` is null. Args: server_id (int): @@ -144,7 +164,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | TaskResponse + ApiError | EmptyResponse | TaskResponse """ return sync_detailed( @@ -161,10 +181,12 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: PrivateCloudVmUpdateRequest, -) -> Response[ApiError | TaskResponse]: +) -> Response[ApiError | EmptyResponse | TaskResponse]: """Update private cloud VM - Update private cloud VM + Updates the note and the resources of a private cloud VM. The change of cpu, ram or disk starts an + asynchronous operation, returned as a Task; when none of them differs from the current value no + operation starts and `data` is null. Args: server_id (int): @@ -176,7 +198,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | TaskResponse] + Response[ApiError | EmptyResponse | TaskResponse] """ kwargs = _get_kwargs( @@ -196,10 +218,12 @@ async def asyncio( *, client: AuthenticatedClient, body: PrivateCloudVmUpdateRequest, -) -> ApiError | TaskResponse | None: +) -> ApiError | EmptyResponse | TaskResponse | None: """Update private cloud VM - Update private cloud VM + Updates the note and the resources of a private cloud VM. The change of cpu, ram or disk starts an + asynchronous operation, returned as a Task; when none of them differs from the current value no + operation starts and `data` is null. Args: server_id (int): @@ -211,7 +235,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | TaskResponse + ApiError | EmptyResponse | TaskResponse """ return ( diff --git a/src/shellrent_sdk/client/api/server/update_server_automatic_snapshot.py b/src/shellrent_sdk/client/api/server/update_server_automatic_snapshot.py index 15db4a9..3fea00f 100644 --- a/src/shellrent_sdk/client/api/server/update_server_automatic_snapshot.py +++ b/src/shellrent_sdk/client/api/server/update_server_automatic_snapshot.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": "/api/v3/servers/{server_id}/snapshots/automatic-snapshot".format( + "url": "/api/v3/servers/{server_id}/snapshot-schedule".format( server_id=quote(str(server_id), safe=""), ), } @@ -62,11 +62,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -92,11 +102,12 @@ def sync_detailed( ) -> Response[ApiError | ServerAutomaticSnapshotResponse]: """Update automatic snapshot settings - Update automatic snapshot settings + Replaces the configuration of the automatic snapshot of the server (404 if none is configured). + Automatic snapshots must be included in the service plan, otherwise the response is 403. Args: server_id (int): - body (ServerAutomaticSnapshotRequest): + body (ServerAutomaticSnapshotRequest): Schedule of the automatic snapshots of a server Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -126,11 +137,12 @@ def sync( ) -> ApiError | ServerAutomaticSnapshotResponse | None: """Update automatic snapshot settings - Update automatic snapshot settings + Replaces the configuration of the automatic snapshot of the server (404 if none is configured). + Automatic snapshots must be included in the service plan, otherwise the response is 403. Args: server_id (int): - body (ServerAutomaticSnapshotRequest): + body (ServerAutomaticSnapshotRequest): Schedule of the automatic snapshots of a server Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -155,11 +167,12 @@ async def asyncio_detailed( ) -> Response[ApiError | ServerAutomaticSnapshotResponse]: """Update automatic snapshot settings - Update automatic snapshot settings + Replaces the configuration of the automatic snapshot of the server (404 if none is configured). + Automatic snapshots must be included in the service plan, otherwise the response is 403. Args: server_id (int): - body (ServerAutomaticSnapshotRequest): + body (ServerAutomaticSnapshotRequest): Schedule of the automatic snapshots of a server Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -187,11 +200,12 @@ async def asyncio( ) -> ApiError | ServerAutomaticSnapshotResponse | None: """Update automatic snapshot settings - Update automatic snapshot settings + Replaces the configuration of the automatic snapshot of the server (404 if none is configured). + Automatic snapshots must be included in the service plan, otherwise the response is 403. Args: server_id (int): - body (ServerAutomaticSnapshotRequest): + body (ServerAutomaticSnapshotRequest): Schedule of the automatic snapshots of a server Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/server/update_server_ip_address_reverse_dns.py b/src/shellrent_sdk/client/api/server/update_server_ip_address_reverse_dns.py index 53881e4..459f3ac 100644 --- a/src/shellrent_sdk/client/api/server/update_server_ip_address_reverse_dns.py +++ b/src/shellrent_sdk/client/api/server/update_server_ip_address_reverse_dns.py @@ -22,7 +22,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": "/api/v3/servers/{server_id}/ip_addresses/{ip_address_id}/rdns".format( + "url": "/api/v3/servers/{server_id}/ip-addresses/{ip_address_id}/rdns".format( server_id=quote(str(server_id), safe=""), ip_address_id=quote(str(ip_address_id), safe=""), ), @@ -64,11 +64,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/shop/buy_active_monitoring.py b/src/shellrent_sdk/client/api/shop/buy_active_monitoring.py index dcb18e2..d64f501 100644 --- a/src/shellrent_sdk/client/api/shop/buy_active_monitoring.py +++ b/src/shellrent_sdk/client/api/shop/buy_active_monitoring.py @@ -33,10 +33,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | OrderListResponse | None: - if response.status_code == 200: - response_200 = OrderListResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = OrderListResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -58,11 +58,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -89,6 +99,8 @@ def sync_detailed( Buy a new Active Monitoring product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServiceActiveMonitoringRequest): @@ -120,6 +132,8 @@ def sync( Buy a new Active Monitoring product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServiceActiveMonitoringRequest): @@ -146,6 +160,8 @@ async def asyncio_detailed( Buy a new Active Monitoring product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServiceActiveMonitoringRequest): @@ -175,6 +191,8 @@ async def asyncio( Buy a new Active Monitoring product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServiceActiveMonitoringRequest): diff --git a/src/shellrent_sdk/client/api/shop/buy_cloud_storage.py b/src/shellrent_sdk/client/api/shop/buy_cloud_storage.py index 19a8a70..d1df0ce 100644 --- a/src/shellrent_sdk/client/api/shop/buy_cloud_storage.py +++ b/src/shellrent_sdk/client/api/shop/buy_cloud_storage.py @@ -33,10 +33,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | OrderListResponse | None: - if response.status_code == 200: - response_200 = OrderListResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = OrderListResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -58,11 +58,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -89,6 +99,8 @@ def sync_detailed( Buy a new Cloud Storage product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServiceCloudStorageRequest): @@ -120,6 +132,8 @@ def sync( Buy a new Cloud Storage product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServiceCloudStorageRequest): @@ -146,6 +160,8 @@ async def asyncio_detailed( Buy a new Cloud Storage product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServiceCloudStorageRequest): @@ -175,6 +191,8 @@ async def asyncio( Buy a new Cloud Storage product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServiceCloudStorageRequest): diff --git a/src/shellrent_sdk/client/api/shop/buy_cloud_vps.py b/src/shellrent_sdk/client/api/shop/buy_cloud_vps.py index 8614e00..7018f19 100644 --- a/src/shellrent_sdk/client/api/shop/buy_cloud_vps.py +++ b/src/shellrent_sdk/client/api/shop/buy_cloud_vps.py @@ -33,10 +33,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | OrderListResponse | None: - if response.status_code == 200: - response_200 = OrderListResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = OrderListResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -58,11 +58,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -89,6 +99,8 @@ def sync_detailed( Buy a new Cloud VPS product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServiceCloudVpsRequest): @@ -120,6 +132,8 @@ def sync( Buy a new Cloud VPS product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServiceCloudVpsRequest): @@ -146,6 +160,8 @@ async def asyncio_detailed( Buy a new Cloud VPS product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServiceCloudVpsRequest): @@ -175,6 +191,8 @@ async def asyncio( Buy a new Cloud VPS product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServiceCloudVpsRequest): diff --git a/src/shellrent_sdk/client/api/shop/buy_cpanel_license.py b/src/shellrent_sdk/client/api/shop/buy_cpanel_license.py index 1ab9e98..81bc854 100644 --- a/src/shellrent_sdk/client/api/shop/buy_cpanel_license.py +++ b/src/shellrent_sdk/client/api/shop/buy_cpanel_license.py @@ -33,10 +33,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | OrderListResponse | None: - if response.status_code == 200: - response_200 = OrderListResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = OrderListResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -58,11 +58,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -89,6 +99,8 @@ def sync_detailed( Buy a new cPanel license product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServiceCpanelLicenseRequest): @@ -120,6 +132,8 @@ def sync( Buy a new cPanel license product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServiceCpanelLicenseRequest): @@ -146,6 +160,8 @@ async def asyncio_detailed( Buy a new cPanel license product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServiceCpanelLicenseRequest): @@ -175,6 +191,8 @@ async def asyncio( Buy a new cPanel license product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServiceCpanelLicenseRequest): diff --git a/src/shellrent_sdk/client/api/shop/buy_dedicated_server.py b/src/shellrent_sdk/client/api/shop/buy_dedicated_server.py index b3412a6..05d9747 100644 --- a/src/shellrent_sdk/client/api/shop/buy_dedicated_server.py +++ b/src/shellrent_sdk/client/api/shop/buy_dedicated_server.py @@ -33,10 +33,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | OrderListResponse | None: - if response.status_code == 200: - response_200 = OrderListResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = OrderListResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -58,11 +58,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -89,6 +99,8 @@ def sync_detailed( Buy a new Dedicated Server product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServiceDedicatedServerRequest): @@ -120,6 +132,8 @@ def sync( Buy a new Dedicated Server product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServiceDedicatedServerRequest): @@ -146,6 +160,8 @@ async def asyncio_detailed( Buy a new Dedicated Server product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServiceDedicatedServerRequest): @@ -175,6 +191,8 @@ async def asyncio( Buy a new Dedicated Server product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServiceDedicatedServerRequest): diff --git a/src/shellrent_sdk/client/api/shop/buy_domain.py b/src/shellrent_sdk/client/api/shop/buy_domain.py index ad7032d..06e071f 100644 --- a/src/shellrent_sdk/client/api/shop/buy_domain.py +++ b/src/shellrent_sdk/client/api/shop/buy_domain.py @@ -33,10 +33,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | OrderListResponse | None: - if response.status_code == 200: - response_200 = OrderListResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = OrderListResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -58,11 +58,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -87,7 +97,10 @@ def sync_detailed( ) -> Response[ApiError | OrderListResponse]: """Buy Domain - Buy a new Domain + Buy a new Domain. A premium domain is ordered at the prices given by `GET + /api/v3/domains/availability`; when the registry gives no price, it cannot be bought (409) + + Not available to sub-accounts: the response is 403 (error 1601). Args: body (BuyServiceDomainRequest): @@ -118,7 +131,10 @@ def sync( ) -> ApiError | OrderListResponse | None: """Buy Domain - Buy a new Domain + Buy a new Domain. A premium domain is ordered at the prices given by `GET + /api/v3/domains/availability`; when the registry gives no price, it cannot be bought (409) + + Not available to sub-accounts: the response is 403 (error 1601). Args: body (BuyServiceDomainRequest): @@ -144,7 +160,10 @@ async def asyncio_detailed( ) -> Response[ApiError | OrderListResponse]: """Buy Domain - Buy a new Domain + Buy a new Domain. A premium domain is ordered at the prices given by `GET + /api/v3/domains/availability`; when the registry gives no price, it cannot be bought (409) + + Not available to sub-accounts: the response is 403 (error 1601). Args: body (BuyServiceDomainRequest): @@ -173,7 +192,10 @@ async def asyncio( ) -> ApiError | OrderListResponse | None: """Buy Domain - Buy a new Domain + Buy a new Domain. A premium domain is ordered at the prices given by `GET + /api/v3/domains/availability`; when the registry gives no price, it cannot be bought (409) + + Not available to sub-accounts: the response is 403 (error 1601). Args: body (BuyServiceDomainRequest): diff --git a/src/shellrent_sdk/client/api/shop/buy_microsoft_365_subscription.py b/src/shellrent_sdk/client/api/shop/buy_microsoft_365_subscription.py index 08caf2b..6dbd94d 100644 --- a/src/shellrent_sdk/client/api/shop/buy_microsoft_365_subscription.py +++ b/src/shellrent_sdk/client/api/shop/buy_microsoft_365_subscription.py @@ -33,10 +33,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | OrderListResponse | None: - if response.status_code == 200: - response_200 = OrderListResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = OrderListResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -58,11 +58,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -87,7 +97,12 @@ def sync_detailed( ) -> Response[ApiError | OrderListResponse]: """Buy Microsoft 365 subscription - Buy a new Microsoft 365 subscription + Buy a new Microsoft 365 subscription. The tenant data is checked before the order is created: a + tenant chosen with "select" that is not one of the account is 404, a choice that cannot be applied + (too many subscriptions of the service on the tenant, domain prefix of an existing tenant, domain to + transfer that does not exist or new domain already registered at Microsoft) is 409. + + Not available to sub-accounts: the response is 403 (error 1601). Args: body (BuyServiceMicrosoft365Request): @@ -118,7 +133,12 @@ def sync( ) -> ApiError | OrderListResponse | None: """Buy Microsoft 365 subscription - Buy a new Microsoft 365 subscription + Buy a new Microsoft 365 subscription. The tenant data is checked before the order is created: a + tenant chosen with "select" that is not one of the account is 404, a choice that cannot be applied + (too many subscriptions of the service on the tenant, domain prefix of an existing tenant, domain to + transfer that does not exist or new domain already registered at Microsoft) is 409. + + Not available to sub-accounts: the response is 403 (error 1601). Args: body (BuyServiceMicrosoft365Request): @@ -144,7 +164,12 @@ async def asyncio_detailed( ) -> Response[ApiError | OrderListResponse]: """Buy Microsoft 365 subscription - Buy a new Microsoft 365 subscription + Buy a new Microsoft 365 subscription. The tenant data is checked before the order is created: a + tenant chosen with "select" that is not one of the account is 404, a choice that cannot be applied + (too many subscriptions of the service on the tenant, domain prefix of an existing tenant, domain to + transfer that does not exist or new domain already registered at Microsoft) is 409. + + Not available to sub-accounts: the response is 403 (error 1601). Args: body (BuyServiceMicrosoft365Request): @@ -173,7 +198,12 @@ async def asyncio( ) -> ApiError | OrderListResponse | None: """Buy Microsoft 365 subscription - Buy a new Microsoft 365 subscription + Buy a new Microsoft 365 subscription. The tenant data is checked before the order is created: a + tenant chosen with "select" that is not one of the account is 404, a choice that cannot be applied + (too many subscriptions of the service on the tenant, domain prefix of an existing tenant, domain to + transfer that does not exist or new domain already registered at Microsoft) is 409. + + Not available to sub-accounts: the response is 403 (error 1601). Args: body (BuyServiceMicrosoft365Request): diff --git a/src/shellrent_sdk/client/api/shop/buy_object_storage.py b/src/shellrent_sdk/client/api/shop/buy_object_storage.py index 3328f0b..077b040 100644 --- a/src/shellrent_sdk/client/api/shop/buy_object_storage.py +++ b/src/shellrent_sdk/client/api/shop/buy_object_storage.py @@ -33,10 +33,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | OrderListResponse | None: - if response.status_code == 200: - response_200 = OrderListResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = OrderListResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -58,11 +58,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -89,6 +99,8 @@ def sync_detailed( Buy a new Object Storage product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServiceObjectStorageRequest): @@ -120,6 +132,8 @@ def sync( Buy a new Object Storage product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServiceObjectStorageRequest): @@ -146,6 +160,8 @@ async def asyncio_detailed( Buy a new Object Storage product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServiceObjectStorageRequest): @@ -175,6 +191,8 @@ async def asyncio( Buy a new Object Storage product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServiceObjectStorageRequest): diff --git a/src/shellrent_sdk/client/api/shop/buy_pec.py b/src/shellrent_sdk/client/api/shop/buy_pec.py index b85679d..07dfa39 100644 --- a/src/shellrent_sdk/client/api/shop/buy_pec.py +++ b/src/shellrent_sdk/client/api/shop/buy_pec.py @@ -33,10 +33,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | OrderListResponse | None: - if response.status_code == 200: - response_200 = OrderListResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = OrderListResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -58,11 +58,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -89,6 +99,8 @@ def sync_detailed( Buy a new PEC product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServicePecRequest): @@ -120,6 +132,8 @@ def sync( Buy a new PEC product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServicePecRequest): @@ -146,6 +160,8 @@ async def asyncio_detailed( Buy a new PEC product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServicePecRequest): @@ -175,6 +191,8 @@ async def asyncio( Buy a new PEC product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServicePecRequest): diff --git a/src/shellrent_sdk/client/api/shop/buy_pec_domain.py b/src/shellrent_sdk/client/api/shop/buy_pec_domain.py index 737d853..23312e5 100644 --- a/src/shellrent_sdk/client/api/shop/buy_pec_domain.py +++ b/src/shellrent_sdk/client/api/shop/buy_pec_domain.py @@ -33,10 +33,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | OrderListResponse | None: - if response.status_code == 200: - response_200 = OrderListResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = OrderListResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -58,11 +58,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -89,6 +99,8 @@ def sync_detailed( Buy a new PEC Domain product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServicePecDomainRequest): @@ -120,6 +132,8 @@ def sync( Buy a new PEC Domain product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServicePecDomainRequest): @@ -146,6 +160,8 @@ async def asyncio_detailed( Buy a new PEC Domain product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServicePecDomainRequest): @@ -175,6 +191,8 @@ async def asyncio( Buy a new PEC Domain product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServicePecDomainRequest): diff --git a/src/shellrent_sdk/client/api/shop/buy_plesk_license.py b/src/shellrent_sdk/client/api/shop/buy_plesk_license.py index f55b084..9844174 100644 --- a/src/shellrent_sdk/client/api/shop/buy_plesk_license.py +++ b/src/shellrent_sdk/client/api/shop/buy_plesk_license.py @@ -33,10 +33,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | OrderListResponse | None: - if response.status_code == 200: - response_200 = OrderListResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = OrderListResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -58,11 +58,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -89,6 +99,8 @@ def sync_detailed( Buy a new Plesk license product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServicePleskLicenseRequest): @@ -120,6 +132,8 @@ def sync( Buy a new Plesk license product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServicePleskLicenseRequest): @@ -146,6 +160,8 @@ async def asyncio_detailed( Buy a new Plesk license product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServicePleskLicenseRequest): @@ -175,6 +191,8 @@ async def asyncio( Buy a new Plesk license product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServicePleskLicenseRequest): diff --git a/src/shellrent_sdk/client/api/shop/buy_private_cloud_sv.py b/src/shellrent_sdk/client/api/shop/buy_private_cloud_sv.py index 3d6429b..c0c4429 100644 --- a/src/shellrent_sdk/client/api/shop/buy_private_cloud_sv.py +++ b/src/shellrent_sdk/client/api/shop/buy_private_cloud_sv.py @@ -33,10 +33,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | OrderListResponse | None: - if response.status_code == 200: - response_200 = OrderListResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = OrderListResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -58,11 +58,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -89,6 +99,8 @@ def sync_detailed( Buy a new Private Cloud SV product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServicePrivateCloudSvRequest): @@ -120,6 +132,8 @@ def sync( Buy a new Private Cloud SV product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServicePrivateCloudSvRequest): @@ -146,6 +160,8 @@ async def asyncio_detailed( Buy a new Private Cloud SV product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServicePrivateCloudSvRequest): @@ -175,6 +191,8 @@ async def asyncio( Buy a new Private Cloud SV product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServicePrivateCloudSvRequest): diff --git a/src/shellrent_sdk/client/api/shop/buy_secure_mail.py b/src/shellrent_sdk/client/api/shop/buy_secure_mail.py deleted file mode 100644 index 036aede..0000000 --- a/src/shellrent_sdk/client/api/shop/buy_secure_mail.py +++ /dev/null @@ -1,194 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.api_error import ApiError -from ...models.buy_service_securemail_request import BuyServiceSecuremailRequest -from ...models.order_list_response import OrderListResponse -from ...types import Response - - -def _get_kwargs( - *, - body: BuyServiceSecuremailRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/api/v3/shop/securemail-by-libraesva", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | OrderListResponse | None: - if response.status_code == 200: - response_200 = OrderListResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 400: - response_400 = ApiError.from_dict(response.json()) - - return response_400 - - if response.status_code == 401: - response_401 = ApiError.from_dict(response.json()) - - return response_401 - - if response.status_code == 403: - response_403 = ApiError.from_dict(response.json()) - - return response_403 - - if response.status_code == 404: - response_404 = ApiError.from_dict(response.json()) - - return response_404 - - if response.status_code == 429: - response_429 = ApiError.from_dict(response.json()) - - return response_429 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | OrderListResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - body: BuyServiceSecuremailRequest, -) -> Response[ApiError | OrderListResponse]: - """Buy SecureMail by LibraESVA - - Buy a new SecureMail by LibraESVA product - - Args: - body (BuyServiceSecuremailRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApiError | OrderListResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - body: BuyServiceSecuremailRequest, -) -> ApiError | OrderListResponse | None: - """Buy SecureMail by LibraESVA - - Buy a new SecureMail by LibraESVA product - - Args: - body (BuyServiceSecuremailRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApiError | OrderListResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - body: BuyServiceSecuremailRequest, -) -> Response[ApiError | OrderListResponse]: - """Buy SecureMail by LibraESVA - - Buy a new SecureMail by LibraESVA product - - Args: - body (BuyServiceSecuremailRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApiError | OrderListResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - body: BuyServiceSecuremailRequest, -) -> ApiError | OrderListResponse | None: - """Buy SecureMail by LibraESVA - - Buy a new SecureMail by LibraESVA product - - Args: - body (BuyServiceSecuremailRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApiError | OrderListResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/src/shellrent_sdk/client/api/shop/buy_secure_mail_for_google_workspace.py b/src/shellrent_sdk/client/api/shop/buy_secure_mail_for_google_workspace.py deleted file mode 100644 index 9e75dde..0000000 --- a/src/shellrent_sdk/client/api/shop/buy_secure_mail_for_google_workspace.py +++ /dev/null @@ -1,196 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.api_error import ApiError -from ...models.buy_service_securemail_for_google_workspace_request import ( - BuyServiceSecuremailForGoogleWorkspaceRequest, -) -from ...models.order_list_response import OrderListResponse -from ...types import Response - - -def _get_kwargs( - *, - body: BuyServiceSecuremailForGoogleWorkspaceRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/api/v3/shop/securemail-by-libraesva-for-google-workspace", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | OrderListResponse | None: - if response.status_code == 200: - response_200 = OrderListResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 400: - response_400 = ApiError.from_dict(response.json()) - - return response_400 - - if response.status_code == 401: - response_401 = ApiError.from_dict(response.json()) - - return response_401 - - if response.status_code == 403: - response_403 = ApiError.from_dict(response.json()) - - return response_403 - - if response.status_code == 404: - response_404 = ApiError.from_dict(response.json()) - - return response_404 - - if response.status_code == 429: - response_429 = ApiError.from_dict(response.json()) - - return response_429 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | OrderListResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - body: BuyServiceSecuremailForGoogleWorkspaceRequest, -) -> Response[ApiError | OrderListResponse]: - """Buy SecureMail by LibraESVA for Google Workspace - - Buy a new SecureMail by LibraESVA for Google Workspace product - - Args: - body (BuyServiceSecuremailForGoogleWorkspaceRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApiError | OrderListResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - body: BuyServiceSecuremailForGoogleWorkspaceRequest, -) -> ApiError | OrderListResponse | None: - """Buy SecureMail by LibraESVA for Google Workspace - - Buy a new SecureMail by LibraESVA for Google Workspace product - - Args: - body (BuyServiceSecuremailForGoogleWorkspaceRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApiError | OrderListResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - body: BuyServiceSecuremailForGoogleWorkspaceRequest, -) -> Response[ApiError | OrderListResponse]: - """Buy SecureMail by LibraESVA for Google Workspace - - Buy a new SecureMail by LibraESVA for Google Workspace product - - Args: - body (BuyServiceSecuremailForGoogleWorkspaceRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApiError | OrderListResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - body: BuyServiceSecuremailForGoogleWorkspaceRequest, -) -> ApiError | OrderListResponse | None: - """Buy SecureMail by LibraESVA for Google Workspace - - Buy a new SecureMail by LibraESVA for Google Workspace product - - Args: - body (BuyServiceSecuremailForGoogleWorkspaceRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApiError | OrderListResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/src/shellrent_sdk/client/api/shop/buy_secure_mail_for_microsoft_365.py b/src/shellrent_sdk/client/api/shop/buy_secure_mail_for_microsoft_365.py deleted file mode 100644 index b322e53..0000000 --- a/src/shellrent_sdk/client/api/shop/buy_secure_mail_for_microsoft_365.py +++ /dev/null @@ -1,196 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.api_error import ApiError -from ...models.buy_service_securemail_for_microsoft_365_request import ( - BuyServiceSecuremailForMicrosoft365Request, -) -from ...models.order_list_response import OrderListResponse -from ...types import Response - - -def _get_kwargs( - *, - body: BuyServiceSecuremailForMicrosoft365Request, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/api/v3/shop/securemail-by-libraesva-for-microsoft365", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | OrderListResponse | None: - if response.status_code == 200: - response_200 = OrderListResponse.from_dict(response.json()) - - return response_200 - - if response.status_code == 400: - response_400 = ApiError.from_dict(response.json()) - - return response_400 - - if response.status_code == 401: - response_401 = ApiError.from_dict(response.json()) - - return response_401 - - if response.status_code == 403: - response_403 = ApiError.from_dict(response.json()) - - return response_403 - - if response.status_code == 404: - response_404 = ApiError.from_dict(response.json()) - - return response_404 - - if response.status_code == 429: - response_429 = ApiError.from_dict(response.json()) - - return response_429 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | OrderListResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - body: BuyServiceSecuremailForMicrosoft365Request, -) -> Response[ApiError | OrderListResponse]: - """Buy SecureMail by LibraESVA for Microsoft 365 - - Buy a new SecureMail by LibraESVA for Microsoft 365 product - - Args: - body (BuyServiceSecuremailForMicrosoft365Request): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApiError | OrderListResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - body: BuyServiceSecuremailForMicrosoft365Request, -) -> ApiError | OrderListResponse | None: - """Buy SecureMail by LibraESVA for Microsoft 365 - - Buy a new SecureMail by LibraESVA for Microsoft 365 product - - Args: - body (BuyServiceSecuremailForMicrosoft365Request): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApiError | OrderListResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - body: BuyServiceSecuremailForMicrosoft365Request, -) -> Response[ApiError | OrderListResponse]: - """Buy SecureMail by LibraESVA for Microsoft 365 - - Buy a new SecureMail by LibraESVA for Microsoft 365 product - - Args: - body (BuyServiceSecuremailForMicrosoft365Request): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApiError | OrderListResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - body: BuyServiceSecuremailForMicrosoft365Request, -) -> ApiError | OrderListResponse | None: - """Buy SecureMail by LibraESVA for Microsoft 365 - - Buy a new SecureMail by LibraESVA for Microsoft 365 product - - Args: - body (BuyServiceSecuremailForMicrosoft365Request): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApiError | OrderListResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/src/shellrent_sdk/client/api/shop/buy_sms_topup.py b/src/shellrent_sdk/client/api/shop/buy_sms_topup.py index fbf1ad8..0ae73a9 100644 --- a/src/shellrent_sdk/client/api/shop/buy_sms_topup.py +++ b/src/shellrent_sdk/client/api/shop/buy_sms_topup.py @@ -19,7 +19,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/api/v3/shop/sms-topup", + "url": "/api/v3/shop/sms-top-up", } _kwargs["json"] = body.to_dict() @@ -33,10 +33,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | OrderListResponse | None: - if response.status_code == 200: - response_200 = OrderListResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = OrderListResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -58,11 +58,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -89,6 +99,8 @@ def sync_detailed( Buy a new SMS topup product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServiceSmsRequest): @@ -120,6 +132,8 @@ def sync( Buy a new SMS topup product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServiceSmsRequest): @@ -146,6 +160,8 @@ async def asyncio_detailed( Buy a new SMS topup product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServiceSmsRequest): @@ -175,6 +191,8 @@ async def asyncio( Buy a new SMS topup product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServiceSmsRequest): diff --git a/src/shellrent_sdk/client/api/shop/buy_ssl_certificate.py b/src/shellrent_sdk/client/api/shop/buy_ssl_certificate.py index a8a6ce1..88491d4 100644 --- a/src/shellrent_sdk/client/api/shop/buy_ssl_certificate.py +++ b/src/shellrent_sdk/client/api/shop/buy_ssl_certificate.py @@ -33,10 +33,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | OrderListResponse | None: - if response.status_code == 200: - response_200 = OrderListResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = OrderListResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -58,11 +58,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -89,6 +99,8 @@ def sync_detailed( Buy a new SSL/TLS Certificate product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServiceSslCertificateRequest): @@ -120,6 +132,8 @@ def sync( Buy a new SSL/TLS Certificate product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServiceSslCertificateRequest): @@ -146,6 +160,8 @@ async def asyncio_detailed( Buy a new SSL/TLS Certificate product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServiceSslCertificateRequest): @@ -175,6 +191,8 @@ async def asyncio( Buy a new SSL/TLS Certificate product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServiceSslCertificateRequest): diff --git a/src/shellrent_sdk/client/api/shop/buy_veeam_baas.py b/src/shellrent_sdk/client/api/shop/buy_veeam_baas.py index 432b0c7..5d9e7e9 100644 --- a/src/shellrent_sdk/client/api/shop/buy_veeam_baas.py +++ b/src/shellrent_sdk/client/api/shop/buy_veeam_baas.py @@ -33,10 +33,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | OrderListResponse | None: - if response.status_code == 200: - response_200 = OrderListResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = OrderListResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -58,11 +58,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -89,6 +99,8 @@ def sync_detailed( Buy a new Veeam Backup as a Service product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServiceVeeamBaasRequest): @@ -120,6 +132,8 @@ def sync( Buy a new Veeam Backup as a Service product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServiceVeeamBaasRequest): @@ -146,6 +160,8 @@ async def asyncio_detailed( Buy a new Veeam Backup as a Service product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServiceVeeamBaasRequest): @@ -175,6 +191,8 @@ async def asyncio( Buy a new Veeam Backup as a Service product + Not available to sub-accounts: the response is 403 (error 1601). + Args: body (BuyServiceVeeamBaasRequest): diff --git a/src/shellrent_sdk/client/api/shop/can_cancel_order.py b/src/shellrent_sdk/client/api/shop/can_cancel_order.py index d84e9be..ee496f1 100644 --- a/src/shellrent_sdk/client/api/shop/can_cancel_order.py +++ b/src/shellrent_sdk/client/api/shop/can_cancel_order.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -84,6 +89,8 @@ def sync_detailed( Know if it's possible to cancel an Order + Not available to sub-accounts: the response is 403 (error 1601). + Args: order_id (int): @@ -115,6 +122,8 @@ def sync( Know if it's possible to cancel an Order + Not available to sub-accounts: the response is 403 (error 1601). + Args: order_id (int): @@ -141,6 +150,8 @@ async def asyncio_detailed( Know if it's possible to cancel an Order + Not available to sub-accounts: the response is 403 (error 1601). + Args: order_id (int): @@ -170,6 +181,8 @@ async def asyncio( Know if it's possible to cancel an Order + Not available to sub-accounts: the response is 403 (error 1601). + Args: order_id (int): diff --git a/src/shellrent_sdk/client/api/shop/can_pay_order.py b/src/shellrent_sdk/client/api/shop/can_pay_order.py index 4dd165f..afe8504 100644 --- a/src/shellrent_sdk/client/api/shop/can_pay_order.py +++ b/src/shellrent_sdk/client/api/shop/can_pay_order.py @@ -8,18 +8,30 @@ from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError from ...models.order_can_pay_response import OrderCanPayResponse -from ...types import Response +from ...types import UNSET, Response, Unset def _get_kwargs( order_id: int, + *, + one_click_id: int | Unset = UNSET, + prepaid_credit: bool | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["one_click_id"] = one_click_id + + params["prepaid_credit"] = prepaid_credit + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + _kwargs: dict[str, Any] = { "method": "get", "url": "/api/v3/orders/{order_id}/can-pay".format( order_id=quote(str(order_id), safe=""), ), + "params": params, } return _kwargs @@ -58,6 +70,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -79,13 +96,24 @@ def sync_detailed( order_id: int, *, client: AuthenticatedClient, + one_click_id: int | Unset = UNSET, + prepaid_credit: bool | Unset = UNSET, ) -> Response[ApiError | OrderCanPayResponse]: """Can pay Order - Know if it's possible to complete the payment for an Order + Whether the order can be paid now with a payment method, with the amount to pay, commission of the + method included, and the orders paid together with it. Send either `one_click_id` or + `prepaid_credit=true` (400 otherwise). `can_pay` is false when the order cannot be paid now, when + the One-Click method is not active or has expired, or when the prepaid credit cannot be used for + these orders or is not enough. 404 when the One-Click method does not exist or belongs to another + account + + Not available to sub-accounts: the response is 403 (error 1601). Args: order_id (int): + one_click_id (int | Unset): + prepaid_credit (bool | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -97,6 +125,8 @@ def sync_detailed( kwargs = _get_kwargs( order_id=order_id, + one_click_id=one_click_id, + prepaid_credit=prepaid_credit, ) response = client.get_httpx_client().request( @@ -110,13 +140,24 @@ def sync( order_id: int, *, client: AuthenticatedClient, + one_click_id: int | Unset = UNSET, + prepaid_credit: bool | Unset = UNSET, ) -> ApiError | OrderCanPayResponse | None: """Can pay Order - Know if it's possible to complete the payment for an Order + Whether the order can be paid now with a payment method, with the amount to pay, commission of the + method included, and the orders paid together with it. Send either `one_click_id` or + `prepaid_credit=true` (400 otherwise). `can_pay` is false when the order cannot be paid now, when + the One-Click method is not active or has expired, or when the prepaid credit cannot be used for + these orders or is not enough. 404 when the One-Click method does not exist or belongs to another + account + + Not available to sub-accounts: the response is 403 (error 1601). Args: order_id (int): + one_click_id (int | Unset): + prepaid_credit (bool | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -129,6 +170,8 @@ def sync( return sync_detailed( order_id=order_id, client=client, + one_click_id=one_click_id, + prepaid_credit=prepaid_credit, ).parsed @@ -136,13 +179,24 @@ async def asyncio_detailed( order_id: int, *, client: AuthenticatedClient, + one_click_id: int | Unset = UNSET, + prepaid_credit: bool | Unset = UNSET, ) -> Response[ApiError | OrderCanPayResponse]: """Can pay Order - Know if it's possible to complete the payment for an Order + Whether the order can be paid now with a payment method, with the amount to pay, commission of the + method included, and the orders paid together with it. Send either `one_click_id` or + `prepaid_credit=true` (400 otherwise). `can_pay` is false when the order cannot be paid now, when + the One-Click method is not active or has expired, or when the prepaid credit cannot be used for + these orders or is not enough. 404 when the One-Click method does not exist or belongs to another + account + + Not available to sub-accounts: the response is 403 (error 1601). Args: order_id (int): + one_click_id (int | Unset): + prepaid_credit (bool | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -154,6 +208,8 @@ async def asyncio_detailed( kwargs = _get_kwargs( order_id=order_id, + one_click_id=one_click_id, + prepaid_credit=prepaid_credit, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -165,13 +221,24 @@ async def asyncio( order_id: int, *, client: AuthenticatedClient, + one_click_id: int | Unset = UNSET, + prepaid_credit: bool | Unset = UNSET, ) -> ApiError | OrderCanPayResponse | None: """Can pay Order - Know if it's possible to complete the payment for an Order + Whether the order can be paid now with a payment method, with the amount to pay, commission of the + method included, and the orders paid together with it. Send either `one_click_id` or + `prepaid_credit=true` (400 otherwise). `can_pay` is false when the order cannot be paid now, when + the One-Click method is not active or has expired, or when the prepaid credit cannot be used for + these orders or is not enough. 404 when the One-Click method does not exist or belongs to another + account + + Not available to sub-accounts: the response is 403 (error 1601). Args: order_id (int): + one_click_id (int | Unset): + prepaid_credit (bool | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -185,5 +252,7 @@ async def asyncio( await asyncio_detailed( order_id=order_id, client=client, + one_click_id=one_click_id, + prepaid_credit=prepaid_credit, ) ).parsed diff --git a/src/shellrent_sdk/client/api/shop/cancel_order.py b/src/shellrent_sdk/client/api/shop/cancel_order.py index 1867907..381dd82 100644 --- a/src/shellrent_sdk/client/api/shop/cancel_order.py +++ b/src/shellrent_sdk/client/api/shop/cancel_order.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, cast from urllib.parse import quote import httpx @@ -7,7 +7,6 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.empty_response import EmptyResponse from ...types import Response @@ -27,11 +26,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | EmptyResponse | None: - if response.status_code == 200: - response_200 = EmptyResponse.from_dict(response.json()) - - return response_200 +) -> Any | ApiError | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -53,11 +51,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -66,7 +74,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,11 +87,13 @@ def sync_detailed( order_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Cancel order Cancel an Order + Not available to sub-accounts: the response is 403 (error 1601). + Args: order_id (int): @@ -92,7 +102,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -110,11 +120,13 @@ def sync( order_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Cancel order Cancel an Order + Not available to sub-accounts: the response is 403 (error 1601). + Args: order_id (int): @@ -123,7 +135,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return sync_detailed( @@ -136,11 +148,13 @@ async def asyncio_detailed( order_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Cancel order Cancel an Order + Not available to sub-accounts: the response is 403 (error 1601). + Args: order_id (int): @@ -149,7 +163,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -165,11 +179,13 @@ async def asyncio( order_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Cancel order Cancel an Order + Not available to sub-accounts: the response is 403 (error 1601). + Args: order_id (int): @@ -178,7 +194,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return ( diff --git a/src/shellrent_sdk/client/api/shop/check_microsoft_365_domain_availability.py b/src/shellrent_sdk/client/api/shop/check_microsoft_365_domain_availability.py index fadd4ae..40dc372 100644 --- a/src/shellrent_sdk/client/api/shop/check_microsoft_365_domain_availability.py +++ b/src/shellrent_sdk/client/api/shop/check_microsoft_365_domain_availability.py @@ -23,7 +23,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v3/shop/microsoft-365/domain-available", + "url": "/api/v3/shop/microsoft-365/domain-availability", "params": params, } @@ -63,6 +63,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -89,8 +94,10 @@ def sync_detailed( Check if a new Microsoft 365 tenant domain is available + Not available to sub-accounts: the response is 403 (error 1601). + Args: - domain_prefix (str): Prefix to search for (for ".onmicrosoft.com" tenant domains) + domain_prefix (str): Example: mycompany. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -120,8 +127,10 @@ def sync( Check if a new Microsoft 365 tenant domain is available + Not available to sub-accounts: the response is 403 (error 1601). + Args: - domain_prefix (str): Prefix to search for (for ".onmicrosoft.com" tenant domains) + domain_prefix (str): Example: mycompany. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -146,8 +155,10 @@ async def asyncio_detailed( Check if a new Microsoft 365 tenant domain is available + Not available to sub-accounts: the response is 403 (error 1601). + Args: - domain_prefix (str): Prefix to search for (for ".onmicrosoft.com" tenant domains) + domain_prefix (str): Example: mycompany. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -175,8 +186,10 @@ async def asyncio( Check if a new Microsoft 365 tenant domain is available + Not available to sub-accounts: the response is 403 (error 1601). + Args: - domain_prefix (str): Prefix to search for (for ".onmicrosoft.com" tenant domains) + domain_prefix (str): Example: mycompany. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/shop/get_order.py b/src/shellrent_sdk/client/api/shop/get_order.py index 5d8c62b..dbcb480 100644 --- a/src/shellrent_sdk/client/api/shop/get_order.py +++ b/src/shellrent_sdk/client/api/shop/get_order.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -84,6 +89,8 @@ def sync_detailed( Get details of an order + Not available to sub-accounts: the response is 403 (error 1601). + Args: order_id (int): @@ -115,6 +122,8 @@ def sync( Get details of an order + Not available to sub-accounts: the response is 403 (error 1601). + Args: order_id (int): @@ -141,6 +150,8 @@ async def asyncio_detailed( Get details of an order + Not available to sub-accounts: the response is 403 (error 1601). + Args: order_id (int): @@ -170,6 +181,8 @@ async def asyncio( Get details of an order + Not available to sub-accounts: the response is 403 (error 1601). + Args: order_id (int): diff --git a/src/shellrent_sdk/client/api/shop/get_order_row.py b/src/shellrent_sdk/client/api/shop/get_order_row.py index 298b437..6d3b079 100644 --- a/src/shellrent_sdk/client/api/shop/get_order_row.py +++ b/src/shellrent_sdk/client/api/shop/get_order_row.py @@ -60,6 +60,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -87,6 +92,8 @@ def sync_detailed( Get details of an Order row + Not available to sub-accounts: the response is 403 (error 1601). + Args: order_id (int): row_id (int): @@ -121,6 +128,8 @@ def sync( Get details of an Order row + Not available to sub-accounts: the response is 403 (error 1601). + Args: order_id (int): row_id (int): @@ -150,6 +159,8 @@ async def asyncio_detailed( Get details of an Order row + Not available to sub-accounts: the response is 403 (error 1601). + Args: order_id (int): row_id (int): @@ -182,6 +193,8 @@ async def asyncio( Get details of an Order row + Not available to sub-accounts: the response is 403 (error 1601). + Args: order_id (int): row_id (int): diff --git a/src/shellrent_sdk/client/api/shop/get_tld.py b/src/shellrent_sdk/client/api/shop/get_tld.py index 54ace59..091c2d3 100644 --- a/src/shellrent_sdk/client/api/shop/get_tld.py +++ b/src/shellrent_sdk/client/api/shop/get_tld.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -84,6 +89,8 @@ def sync_detailed( Get details of a TLD extension + Not available to sub-accounts: the response is 403 (error 1601). + Args: tld_id (int): @@ -115,6 +122,8 @@ def sync( Get details of a TLD extension + Not available to sub-accounts: the response is 403 (error 1601). + Args: tld_id (int): @@ -141,6 +150,8 @@ async def asyncio_detailed( Get details of a TLD extension + Not available to sub-accounts: the response is 403 (error 1601). + Args: tld_id (int): @@ -170,6 +181,8 @@ async def asyncio( Get details of a TLD extension + Not available to sub-accounts: the response is 403 (error 1601). + Args: tld_id (int): diff --git a/src/shellrent_sdk/client/api/shop/list_active_monitoring_products.py b/src/shellrent_sdk/client/api/shop/list_active_monitoring_products.py index ba1987c..58783a4 100644 --- a/src/shellrent_sdk/client/api/shop/list_active_monitoring_products.py +++ b/src/shellrent_sdk/client/api/shop/list_active_monitoring_products.py @@ -13,7 +13,7 @@ def _get_kwargs( *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -66,6 +66,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -87,15 +92,17 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | ServicePaginatedListResponse]: """Active Monitoring products Get a list of all Active Monitoring products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -121,15 +128,17 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | ServicePaginatedListResponse | None: """Active Monitoring products Get a list of all Active Monitoring products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -150,15 +159,17 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | ServicePaginatedListResponse]: """Active Monitoring products Get a list of all Active Monitoring products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -182,15 +193,17 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | ServicePaginatedListResponse | None: """Active Monitoring products Get a list of all Active Monitoring products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/shop/list_cloud_storage_products.py b/src/shellrent_sdk/client/api/shop/list_cloud_storage_products.py index d7fcda6..7884a05 100644 --- a/src/shellrent_sdk/client/api/shop/list_cloud_storage_products.py +++ b/src/shellrent_sdk/client/api/shop/list_cloud_storage_products.py @@ -13,7 +13,7 @@ def _get_kwargs( *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -66,6 +66,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -87,15 +92,17 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | ServicePaginatedListResponse]: """Cloud Storage products Get a list of all Cloud Storage products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -121,15 +128,17 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | ServicePaginatedListResponse | None: """Cloud Storage products Get a list of all Cloud Storage products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -150,15 +159,17 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | ServicePaginatedListResponse]: """Cloud Storage products Get a list of all Cloud Storage products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -182,15 +193,17 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | ServicePaginatedListResponse | None: """Cloud Storage products Get a list of all Cloud Storage products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/shop/list_cloud_vps_products.py b/src/shellrent_sdk/client/api/shop/list_cloud_vps_products.py index 48ff8c5..824ea3d 100644 --- a/src/shellrent_sdk/client/api/shop/list_cloud_vps_products.py +++ b/src/shellrent_sdk/client/api/shop/list_cloud_vps_products.py @@ -13,7 +13,7 @@ def _get_kwargs( *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -66,6 +66,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -87,15 +92,17 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | ServiceServerPaginatedListResponse]: """Cloud VPS products Get a list of all Cloud VPS products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -121,15 +128,17 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | ServiceServerPaginatedListResponse | None: """Cloud VPS products Get a list of all Cloud VPS products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -150,15 +159,17 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | ServiceServerPaginatedListResponse]: """Cloud VPS products Get a list of all Cloud VPS products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -182,15 +193,17 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | ServiceServerPaginatedListResponse | None: """Cloud VPS products Get a list of all Cloud VPS products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/shop/list_cpanel_license_products.py b/src/shellrent_sdk/client/api/shop/list_cpanel_license_products.py index 88e24e6..82d1062 100644 --- a/src/shellrent_sdk/client/api/shop/list_cpanel_license_products.py +++ b/src/shellrent_sdk/client/api/shop/list_cpanel_license_products.py @@ -13,7 +13,7 @@ def _get_kwargs( *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -66,6 +66,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -87,15 +92,17 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | ServicePaginatedListResponse]: """cPanel licenses products Get a list of all cPanel license products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -121,15 +128,17 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | ServicePaginatedListResponse | None: """cPanel licenses products Get a list of all cPanel license products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -150,15 +159,17 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | ServicePaginatedListResponse]: """cPanel licenses products Get a list of all cPanel license products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -182,15 +193,17 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | ServicePaginatedListResponse | None: """cPanel licenses products Get a list of all cPanel license products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/shop/list_dedicated_server_products.py b/src/shellrent_sdk/client/api/shop/list_dedicated_server_products.py index 4275621..fa48d75 100644 --- a/src/shellrent_sdk/client/api/shop/list_dedicated_server_products.py +++ b/src/shellrent_sdk/client/api/shop/list_dedicated_server_products.py @@ -13,7 +13,7 @@ def _get_kwargs( *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -66,6 +66,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -87,15 +92,17 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | ServiceServerPaginatedListResponse]: """Dedicated Servers products Get a list of all Dedicated Server products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -121,15 +128,17 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | ServiceServerPaginatedListResponse | None: """Dedicated Servers products Get a list of all Dedicated Server products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -150,15 +159,17 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | ServiceServerPaginatedListResponse]: """Dedicated Servers products Get a list of all Dedicated Server products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -182,15 +193,17 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | ServiceServerPaginatedListResponse | None: """Dedicated Servers products Get a list of all Dedicated Server products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/shop/list_microsoft_365_products.py b/src/shellrent_sdk/client/api/shop/list_microsoft_365_products.py index 5b509b8..d61a8e0 100644 --- a/src/shellrent_sdk/client/api/shop/list_microsoft_365_products.py +++ b/src/shellrent_sdk/client/api/shop/list_microsoft_365_products.py @@ -13,7 +13,7 @@ def _get_kwargs( *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -66,6 +66,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -87,15 +92,17 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | ServicePaginatedListResponse]: """Microsoft 365 subscriptions Get a list of all Microsoft 365 subscriptions that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -121,15 +128,17 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | ServicePaginatedListResponse | None: """Microsoft 365 subscriptions Get a list of all Microsoft 365 subscriptions that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -150,15 +159,17 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | ServicePaginatedListResponse]: """Microsoft 365 subscriptions Get a list of all Microsoft 365 subscriptions that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -182,15 +193,17 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | ServicePaginatedListResponse | None: """Microsoft 365 subscriptions Get a list of all Microsoft 365 subscriptions that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/shop/list_order_rows.py b/src/shellrent_sdk/client/api/shop/list_order_rows.py index 23d9769..0c03cd3 100644 --- a/src/shellrent_sdk/client/api/shop/list_order_rows.py +++ b/src/shellrent_sdk/client/api/shop/list_order_rows.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -84,6 +89,8 @@ def sync_detailed( Get the list of all the rows of an Order + Not available to sub-accounts: the response is 403 (error 1601). + Args: order_id (int): @@ -115,6 +122,8 @@ def sync( Get the list of all the rows of an Order + Not available to sub-accounts: the response is 403 (error 1601). + Args: order_id (int): @@ -141,6 +150,8 @@ async def asyncio_detailed( Get the list of all the rows of an Order + Not available to sub-accounts: the response is 403 (error 1601). + Args: order_id (int): @@ -170,6 +181,8 @@ async def asyncio( Get the list of all the rows of an Order + Not available to sub-accounts: the response is 403 (error 1601). + Args: order_id (int): diff --git a/src/shellrent_sdk/client/api/shop/list_orders.py b/src/shellrent_sdk/client/api/shop/list_orders.py index 38ad76e..5c5a26d 100644 --- a/src/shellrent_sdk/client/api/shop/list_orders.py +++ b/src/shellrent_sdk/client/api/shop/list_orders.py @@ -22,7 +22,7 @@ def _get_kwargs( date_created_from: datetime.datetime | Unset = UNSET, date_created_to: datetime.datetime | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -99,6 +99,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -127,12 +132,14 @@ def sync_detailed( date_created_from: datetime.datetime | Unset = UNSET, date_created_to: datetime.datetime | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | OrderPaginatedListResponse]: """List all Orders Get a list of all Orders + Not available to sub-accounts: the response is 403 (error 1601). + Args: order_status (str | Unset): type_ (ListOrdersType | Unset): @@ -142,7 +149,7 @@ def sync_detailed( date_created_from (datetime.datetime | Unset): date_created_to (datetime.datetime | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -182,12 +189,14 @@ def sync( date_created_from: datetime.datetime | Unset = UNSET, date_created_to: datetime.datetime | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | OrderPaginatedListResponse | None: """List all Orders Get a list of all Orders + Not available to sub-accounts: the response is 403 (error 1601). + Args: order_status (str | Unset): type_ (ListOrdersType | Unset): @@ -197,7 +206,7 @@ def sync( date_created_from (datetime.datetime | Unset): date_created_to (datetime.datetime | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -232,12 +241,14 @@ async def asyncio_detailed( date_created_from: datetime.datetime | Unset = UNSET, date_created_to: datetime.datetime | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | OrderPaginatedListResponse]: """List all Orders Get a list of all Orders + Not available to sub-accounts: the response is 403 (error 1601). + Args: order_status (str | Unset): type_ (ListOrdersType | Unset): @@ -247,7 +258,7 @@ async def asyncio_detailed( date_created_from (datetime.datetime | Unset): date_created_to (datetime.datetime | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -285,12 +296,14 @@ async def asyncio( date_created_from: datetime.datetime | Unset = UNSET, date_created_to: datetime.datetime | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | OrderPaginatedListResponse | None: """List all Orders Get a list of all Orders + Not available to sub-accounts: the response is 403 (error 1601). + Args: order_status (str | Unset): type_ (ListOrdersType | Unset): @@ -300,7 +313,7 @@ async def asyncio( date_created_from (datetime.datetime | Unset): date_created_to (datetime.datetime | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/shop/list_pec_products.py b/src/shellrent_sdk/client/api/shop/list_pec_products.py index 12c054e..e2f5743 100644 --- a/src/shellrent_sdk/client/api/shop/list_pec_products.py +++ b/src/shellrent_sdk/client/api/shop/list_pec_products.py @@ -13,7 +13,7 @@ def _get_kwargs( *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -66,6 +66,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -87,15 +92,17 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | ServicePaginatedListResponse]: """PEC products Get a list of all PEC products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -121,15 +128,17 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | ServicePaginatedListResponse | None: """PEC products Get a list of all PEC products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -150,15 +159,17 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | ServicePaginatedListResponse]: """PEC products Get a list of all PEC products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -182,15 +193,17 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | ServicePaginatedListResponse | None: """PEC products Get a list of all PEC products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/shop/list_plesk_license_products.py b/src/shellrent_sdk/client/api/shop/list_plesk_license_products.py index f8f8dd9..e75b972 100644 --- a/src/shellrent_sdk/client/api/shop/list_plesk_license_products.py +++ b/src/shellrent_sdk/client/api/shop/list_plesk_license_products.py @@ -13,7 +13,7 @@ def _get_kwargs( *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -66,6 +66,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -87,15 +92,17 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | ServicePaginatedListResponse]: """Plesk licenses products Get a list of all Plesk license products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -121,15 +128,17 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | ServicePaginatedListResponse | None: """Plesk licenses products Get a list of all Plesk license products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -150,15 +159,17 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | ServicePaginatedListResponse]: """Plesk licenses products Get a list of all Plesk license products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -182,15 +193,17 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | ServicePaginatedListResponse | None: """Plesk licenses products Get a list of all Plesk license products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/shop/list_private_cloud_sv_products.py b/src/shellrent_sdk/client/api/shop/list_private_cloud_sv_products.py index 70323b9..8b453b6 100644 --- a/src/shellrent_sdk/client/api/shop/list_private_cloud_sv_products.py +++ b/src/shellrent_sdk/client/api/shop/list_private_cloud_sv_products.py @@ -13,7 +13,7 @@ def _get_kwargs( *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -66,6 +66,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -87,15 +92,17 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | ServicePaginatedListResponse]: """Private Cloud SV products Get a list of all Private Cloud SV products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -121,15 +128,17 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | ServicePaginatedListResponse | None: """Private Cloud SV products Get a list of all Private Cloud SV products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -150,15 +159,17 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | ServicePaginatedListResponse]: """Private Cloud SV products Get a list of all Private Cloud SV products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -182,15 +193,17 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | ServicePaginatedListResponse | None: """Private Cloud SV products Get a list of all Private Cloud SV products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/shop/list_shop_microsoft_365_tenants.py b/src/shellrent_sdk/client/api/shop/list_shop_microsoft_365_tenants.py index c337011..43446e5 100644 --- a/src/shellrent_sdk/client/api/shop/list_shop_microsoft_365_tenants.py +++ b/src/shellrent_sdk/client/api/shop/list_shop_microsoft_365_tenants.py @@ -16,7 +16,7 @@ def _get_kwargs( *, account_id: int | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -71,6 +71,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -93,17 +98,18 @@ def sync_detailed( client: AuthenticatedClient, account_id: int | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | Microsoft365TenantPaginatedListResponse]: """Microsoft 365 tenants Get a list of all Microsoft 365 already existing tenants + Not available to sub-accounts: the response is 403 (error 1601). + Args: - account_id (int | Unset): ID of the account owner of the Microsoft 365 subscription used - to search for existing tenants. Available to Resellers only. + account_id (int | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -131,17 +137,18 @@ def sync( client: AuthenticatedClient, account_id: int | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | Microsoft365TenantPaginatedListResponse | None: """Microsoft 365 tenants Get a list of all Microsoft 365 already existing tenants + Not available to sub-accounts: the response is 403 (error 1601). + Args: - account_id (int | Unset): ID of the account owner of the Microsoft 365 subscription used - to search for existing tenants. Available to Resellers only. + account_id (int | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -164,17 +171,18 @@ async def asyncio_detailed( client: AuthenticatedClient, account_id: int | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | Microsoft365TenantPaginatedListResponse]: """Microsoft 365 tenants Get a list of all Microsoft 365 already existing tenants + Not available to sub-accounts: the response is 403 (error 1601). + Args: - account_id (int | Unset): ID of the account owner of the Microsoft 365 subscription used - to search for existing tenants. Available to Resellers only. + account_id (int | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -200,17 +208,18 @@ async def asyncio( client: AuthenticatedClient, account_id: int | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | Microsoft365TenantPaginatedListResponse | None: """Microsoft 365 tenants Get a list of all Microsoft 365 already existing tenants + Not available to sub-accounts: the response is 403 (error 1601). + Args: - account_id (int | Unset): ID of the account owner of the Microsoft 365 subscription used - to search for existing tenants. Available to Resellers only. + account_id (int | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/shop/list_sms_topup_products.py b/src/shellrent_sdk/client/api/shop/list_sms_topup_products.py index bf204d8..c384ebe 100644 --- a/src/shellrent_sdk/client/api/shop/list_sms_topup_products.py +++ b/src/shellrent_sdk/client/api/shop/list_sms_topup_products.py @@ -13,7 +13,7 @@ def _get_kwargs( *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -26,7 +26,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v3/shop/sms-topup", + "url": "/api/v3/shop/sms-top-up", "params": params, } @@ -66,6 +66,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -87,15 +92,17 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | ServicePaginatedListResponse]: """SMS topups products Get a list of all SMS topup products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -121,15 +128,17 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | ServicePaginatedListResponse | None: """SMS topups products Get a list of all SMS topup products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -150,15 +159,17 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | ServicePaginatedListResponse]: """SMS topups products Get a list of all SMS topup products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -182,15 +193,17 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | ServicePaginatedListResponse | None: """SMS topups products Get a list of all SMS topup products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/shop/list_ssl_certificate_products.py b/src/shellrent_sdk/client/api/shop/list_ssl_certificate_products.py index e626024..7b4bf49 100644 --- a/src/shellrent_sdk/client/api/shop/list_ssl_certificate_products.py +++ b/src/shellrent_sdk/client/api/shop/list_ssl_certificate_products.py @@ -13,7 +13,7 @@ def _get_kwargs( *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -66,6 +66,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -87,15 +92,17 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | ServicePaginatedListResponse]: """SSL/TLS Certificates products Get a list of all SSL/TLS Certificate products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -121,15 +128,17 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | ServicePaginatedListResponse | None: """SSL/TLS Certificates products Get a list of all SSL/TLS Certificate products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -150,15 +159,17 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | ServicePaginatedListResponse]: """SSL/TLS Certificates products Get a list of all SSL/TLS Certificate products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -182,15 +193,17 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | ServicePaginatedListResponse | None: """SSL/TLS Certificates products Get a list of all SSL/TLS Certificate products that can be ordered + Not available to sub-accounts: the response is 403 (error 1601). + Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/shop/list_tlds.py b/src/shellrent_sdk/client/api/shop/list_tlds.py index 5893c6d..3686902 100644 --- a/src/shellrent_sdk/client/api/shop/list_tlds.py +++ b/src/shellrent_sdk/client/api/shop/list_tlds.py @@ -17,7 +17,7 @@ def _get_kwargs( is_it: bool | Unset = UNSET, country: str | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -78,6 +78,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -103,19 +108,21 @@ def sync_detailed( is_it: bool | Unset = UNSET, country: str | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | TldPaginatedListResponse]: """List all TLDs Get a list of all TLD extensions for domains + Not available to sub-accounts: the response is 403 (error 1601). + Args: extension (str | Unset): extension_exact (str | Unset): is_it (bool | Unset): country (str | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -149,19 +156,21 @@ def sync( is_it: bool | Unset = UNSET, country: str | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | TldPaginatedListResponse | None: """List all TLDs Get a list of all TLD extensions for domains + Not available to sub-accounts: the response is 403 (error 1601). + Args: extension (str | Unset): extension_exact (str | Unset): is_it (bool | Unset): country (str | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -190,19 +199,21 @@ async def asyncio_detailed( is_it: bool | Unset = UNSET, country: str | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | TldPaginatedListResponse]: """List all TLDs Get a list of all TLD extensions for domains + Not available to sub-accounts: the response is 403 (error 1601). + Args: extension (str | Unset): extension_exact (str | Unset): is_it (bool | Unset): country (str | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -234,19 +245,21 @@ async def asyncio( is_it: bool | Unset = UNSET, country: str | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | TldPaginatedListResponse | None: """List all TLDs Get a list of all TLD extensions for domains + Not available to sub-accounts: the response is 403 (error 1601). + Args: extension (str | Unset): extension_exact (str | Unset): is_it (bool | Unset): country (str | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/shop/pay_orders.py b/src/shellrent_sdk/client/api/shop/pay_orders.py deleted file mode 100644 index 3d4cf52..0000000 --- a/src/shellrent_sdk/client/api/shop/pay_orders.py +++ /dev/null @@ -1,222 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.api_error import ApiError -from ...models.order_pay_request import OrderPayRequest -from ...models.pay_orders_response_200 import PayOrdersResponse200 -from ...types import Response - - -def _get_kwargs( - *, - body: OrderPayRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/api/v3/orders/pay", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | PayOrdersResponse200 | None: - if response.status_code == 200: - response_200 = PayOrdersResponse200.from_dict(response.json()) - - return response_200 - - if response.status_code == 400: - response_400 = ApiError.from_dict(response.json()) - - return response_400 - - if response.status_code == 401: - response_401 = ApiError.from_dict(response.json()) - - return response_401 - - if response.status_code == 403: - response_403 = ApiError.from_dict(response.json()) - - return response_403 - - if response.status_code == 404: - response_404 = ApiError.from_dict(response.json()) - - return response_404 - - if response.status_code == 429: - response_429 = ApiError.from_dict(response.json()) - - return response_429 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | PayOrdersResponse200]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - body: OrderPayRequest, -) -> Response[ApiError | PayOrdersResponse200]: - """Pay Orders - - Pay one or more Orders. The response data is the payment, or null when there is nothing to pay - (total amount to pay = 0.00). - - Args: - body (OrderPayRequest): Pays one or more orders. The payment mode is chosen by three - fields, evaluated in this order: 1) use_prepaid_credit set to true: pays with the - available Prepaid Credit; 2) use_one_click set to true: tries the saved One-Click payment - methods in priority order until one is successfully authorized; 3) one_click_id: pays with - that specific One-Click payment method. Provide one of them: if more are provided, only - the first one in this order is used. If none is provided the request fails, unless the - amount to pay is zero: in that case no payment mode is needed. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApiError | PayOrdersResponse200] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - body: OrderPayRequest, -) -> ApiError | PayOrdersResponse200 | None: - """Pay Orders - - Pay one or more Orders. The response data is the payment, or null when there is nothing to pay - (total amount to pay = 0.00). - - Args: - body (OrderPayRequest): Pays one or more orders. The payment mode is chosen by three - fields, evaluated in this order: 1) use_prepaid_credit set to true: pays with the - available Prepaid Credit; 2) use_one_click set to true: tries the saved One-Click payment - methods in priority order until one is successfully authorized; 3) one_click_id: pays with - that specific One-Click payment method. Provide one of them: if more are provided, only - the first one in this order is used. If none is provided the request fails, unless the - amount to pay is zero: in that case no payment mode is needed. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApiError | PayOrdersResponse200 - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - body: OrderPayRequest, -) -> Response[ApiError | PayOrdersResponse200]: - """Pay Orders - - Pay one or more Orders. The response data is the payment, or null when there is nothing to pay - (total amount to pay = 0.00). - - Args: - body (OrderPayRequest): Pays one or more orders. The payment mode is chosen by three - fields, evaluated in this order: 1) use_prepaid_credit set to true: pays with the - available Prepaid Credit; 2) use_one_click set to true: tries the saved One-Click payment - methods in priority order until one is successfully authorized; 3) one_click_id: pays with - that specific One-Click payment method. Provide one of them: if more are provided, only - the first one in this order is used. If none is provided the request fails, unless the - amount to pay is zero: in that case no payment mode is needed. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApiError | PayOrdersResponse200] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - body: OrderPayRequest, -) -> ApiError | PayOrdersResponse200 | None: - """Pay Orders - - Pay one or more Orders. The response data is the payment, or null when there is nothing to pay - (total amount to pay = 0.00). - - Args: - body (OrderPayRequest): Pays one or more orders. The payment mode is chosen by three - fields, evaluated in this order: 1) use_prepaid_credit set to true: pays with the - available Prepaid Credit; 2) use_one_click set to true: tries the saved One-Click payment - methods in priority order until one is successfully authorized; 3) one_click_id: pays with - that specific One-Click payment method. Provide one of them: if more are provided, only - the first one in this order is used. If none is provided the request fails, unless the - amount to pay is zero: in that case no payment mode is needed. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApiError | PayOrdersResponse200 - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/src/shellrent_sdk/client/api/sms/add_sms_phonebook_contacts.py b/src/shellrent_sdk/client/api/sms/add_sms_phonebook_contacts.py index bab6f97..a83f46f 100644 --- a/src/shellrent_sdk/client/api/sms/add_sms_phonebook_contacts.py +++ b/src/shellrent_sdk/client/api/sms/add_sms_phonebook_contacts.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/api/v3/sms/phonebooks/{phonebook_id}/contacts".format( + "url": "/api/v3/sms-phonebooks/{phonebook_id}/contacts".format( phonebook_id=quote(str(phonebook_id), safe=""), ), } @@ -67,6 +67,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/sms/can_cancel_sms.py b/src/shellrent_sdk/client/api/sms/can_cancel_sms.py index 0782fed..0cd59df 100644 --- a/src/shellrent_sdk/client/api/sms/can_cancel_sms.py +++ b/src/shellrent_sdk/client/api/sms/can_cancel_sms.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/sms/can_delete_sms.py b/src/shellrent_sdk/client/api/sms/can_delete_sms.py index 0b4cabe..73bd520 100644 --- a/src/shellrent_sdk/client/api/sms/can_delete_sms.py +++ b/src/shellrent_sdk/client/api/sms/can_delete_sms.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/sms/cancel_sms.py b/src/shellrent_sdk/client/api/sms/cancel_sms.py index fd32ae1..6263ba0 100644 --- a/src/shellrent_sdk/client/api/sms/cancel_sms.py +++ b/src/shellrent_sdk/client/api/sms/cancel_sms.py @@ -16,8 +16,8 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { - "method": "patch", - "url": "/api/v3/sms/{sms_id}/cancel".format( + "method": "post", + "url": "/api/v3/sms/{sms_id}/cancellation".format( sms_id=quote(str(sms_id), safe=""), ), } @@ -53,11 +53,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/sms/create_sms_phonebook.py b/src/shellrent_sdk/client/api/sms/create_sms_phonebook.py index 11f3e40..b25bae8 100644 --- a/src/shellrent_sdk/client/api/sms/create_sms_phonebook.py +++ b/src/shellrent_sdk/client/api/sms/create_sms_phonebook.py @@ -19,7 +19,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/api/v3/sms/phonebooks", + "url": "/api/v3/sms-phonebooks", } _kwargs["json"] = body.to_dict() @@ -33,10 +33,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | SmsPhonebookResponse | None: - if response.status_code == 200: - response_200 = SmsPhonebookResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = SmsPhonebookResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -63,6 +63,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/sms/delete_all_sms_phonebook_contacts.py b/src/shellrent_sdk/client/api/sms/delete_all_sms_phonebook_contacts.py index f319166..4aeee9f 100644 --- a/src/shellrent_sdk/client/api/sms/delete_all_sms_phonebook_contacts.py +++ b/src/shellrent_sdk/client/api/sms/delete_all_sms_phonebook_contacts.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, cast from urllib.parse import quote import httpx @@ -7,7 +7,6 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.empty_response import EmptyResponse from ...types import Response @@ -17,7 +16,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "delete", - "url": "/api/v3/sms/phonebooks/{phonebook_id}/contacts".format( + "url": "/api/v3/sms-phonebooks/{phonebook_id}/contacts".format( phonebook_id=quote(str(phonebook_id), safe=""), ), } @@ -27,11 +26,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | EmptyResponse | None: - if response.status_code == 200: - response_200 = EmptyResponse.from_dict(response.json()) - - return response_200 +) -> Any | ApiError | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -58,6 +56,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -66,7 +69,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +82,7 @@ def sync_detailed( phonebook_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Remove all Contacts from Phonebook Removes all the Contacts from an existing Phonebook @@ -92,7 +95,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -110,7 +113,7 @@ def sync( phonebook_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Remove all Contacts from Phonebook Removes all the Contacts from an existing Phonebook @@ -123,7 +126,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return sync_detailed( @@ -136,7 +139,7 @@ async def asyncio_detailed( phonebook_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Remove all Contacts from Phonebook Removes all the Contacts from an existing Phonebook @@ -149,7 +152,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -165,7 +168,7 @@ async def asyncio( phonebook_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Remove all Contacts from Phonebook Removes all the Contacts from an existing Phonebook @@ -178,7 +181,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return ( diff --git a/src/shellrent_sdk/client/api/sms/delete_sms.py b/src/shellrent_sdk/client/api/sms/delete_sms.py index 18ad456..5af1549 100644 --- a/src/shellrent_sdk/client/api/sms/delete_sms.py +++ b/src/shellrent_sdk/client/api/sms/delete_sms.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, cast from urllib.parse import quote import httpx @@ -7,7 +7,6 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.empty_response import EmptyResponse from ...types import Response @@ -27,11 +26,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | EmptyResponse | None: - if response.status_code == 200: - response_200 = EmptyResponse.from_dict(response.json()) - - return response_200 +) -> Any | ApiError | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -53,11 +51,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -66,7 +74,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,7 +87,7 @@ def sync_detailed( sms_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Delete SMS Permanently delete an SMS @@ -92,7 +100,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -110,7 +118,7 @@ def sync( sms_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Delete SMS Permanently delete an SMS @@ -123,7 +131,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return sync_detailed( @@ -136,7 +144,7 @@ async def asyncio_detailed( sms_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Delete SMS Permanently delete an SMS @@ -149,7 +157,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -165,7 +173,7 @@ async def asyncio( sms_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Delete SMS Permanently delete an SMS @@ -178,7 +186,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return ( diff --git a/src/shellrent_sdk/client/api/sms/delete_sms_phonebook.py b/src/shellrent_sdk/client/api/sms/delete_sms_phonebook.py index 9f7a0e2..a59eed0 100644 --- a/src/shellrent_sdk/client/api/sms/delete_sms_phonebook.py +++ b/src/shellrent_sdk/client/api/sms/delete_sms_phonebook.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, cast from urllib.parse import quote import httpx @@ -7,7 +7,6 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.empty_response import EmptyResponse from ...types import Response @@ -17,7 +16,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "delete", - "url": "/api/v3/sms/phonebooks/{phonebook_id}".format( + "url": "/api/v3/sms-phonebooks/{phonebook_id}".format( phonebook_id=quote(str(phonebook_id), safe=""), ), } @@ -27,11 +26,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | EmptyResponse | None: - if response.status_code == 200: - response_200 = EmptyResponse.from_dict(response.json()) - - return response_200 +) -> Any | ApiError | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -58,6 +56,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -66,7 +69,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,10 +82,11 @@ def sync_detailed( phonebook_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Delete a Phonebook - Delete a Phonebook + Deletes the phonebook, which can no longer be used as recipients of an SMS. Its contacts are not + deleted and stay in the other phonebooks that contain them Args: phonebook_id (int): @@ -92,7 +96,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -110,10 +114,11 @@ def sync( phonebook_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Delete a Phonebook - Delete a Phonebook + Deletes the phonebook, which can no longer be used as recipients of an SMS. Its contacts are not + deleted and stay in the other phonebooks that contain them Args: phonebook_id (int): @@ -123,7 +128,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return sync_detailed( @@ -136,10 +141,11 @@ async def asyncio_detailed( phonebook_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Delete a Phonebook - Delete a Phonebook + Deletes the phonebook, which can no longer be used as recipients of an SMS. Its contacts are not + deleted and stay in the other phonebooks that contain them Args: phonebook_id (int): @@ -149,7 +155,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -165,10 +171,11 @@ async def asyncio( phonebook_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Delete a Phonebook - Delete a Phonebook + Deletes the phonebook, which can no longer be used as recipients of an SMS. Its contacts are not + deleted and stay in the other phonebooks that contain them Args: phonebook_id (int): @@ -178,7 +185,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return ( diff --git a/src/shellrent_sdk/client/api/sms/delete_sms_phonebook_contact.py b/src/shellrent_sdk/client/api/sms/delete_sms_phonebook_contact.py index 9d65f20..24eba1e 100644 --- a/src/shellrent_sdk/client/api/sms/delete_sms_phonebook_contact.py +++ b/src/shellrent_sdk/client/api/sms/delete_sms_phonebook_contact.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, cast from urllib.parse import quote import httpx @@ -7,7 +7,6 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.empty_response import EmptyResponse from ...types import Response @@ -18,7 +17,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "delete", - "url": "/api/v3/sms/phonebooks/{phonebook_id}/contacts/{contact_id}".format( + "url": "/api/v3/sms-phonebooks/{phonebook_id}/contacts/{contact_id}".format( phonebook_id=quote(str(phonebook_id), safe=""), contact_id=quote(str(contact_id), safe=""), ), @@ -29,11 +28,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | EmptyResponse | None: - if response.status_code == 200: - response_200 = EmptyResponse.from_dict(response.json()) - - return response_200 +) -> Any | ApiError | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -60,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -68,7 +71,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -82,10 +85,11 @@ def sync_detailed( contact_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Remove a Contact from a Phonebook - Remove a Contact from a Phonebook + Removes the contact from the phonebook (404 if the phonebook does not contain it). The contact is + not deleted and stays in the other phonebooks that contain it Args: phonebook_id (int): @@ -96,7 +100,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -116,10 +120,11 @@ def sync( contact_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Remove a Contact from a Phonebook - Remove a Contact from a Phonebook + Removes the contact from the phonebook (404 if the phonebook does not contain it). The contact is + not deleted and stays in the other phonebooks that contain it Args: phonebook_id (int): @@ -130,7 +135,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return sync_detailed( @@ -145,10 +150,11 @@ async def asyncio_detailed( contact_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Remove a Contact from a Phonebook - Remove a Contact from a Phonebook + Removes the contact from the phonebook (404 if the phonebook does not contain it). The contact is + not deleted and stays in the other phonebooks that contain it Args: phonebook_id (int): @@ -159,7 +165,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -177,10 +183,11 @@ async def asyncio( contact_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Remove a Contact from a Phonebook - Remove a Contact from a Phonebook + Removes the contact from the phonebook (404 if the phonebook does not contain it). The contact is + not deleted and stays in the other phonebooks that contain it Args: phonebook_id (int): @@ -191,7 +198,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return ( diff --git a/src/shellrent_sdk/client/api/sms/get_sms.py b/src/shellrent_sdk/client/api/sms/get_sms.py index 93545f0..15db241 100644 --- a/src/shellrent_sdk/client/api/sms/get_sms.py +++ b/src/shellrent_sdk/client/api/sms/get_sms.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/sms/get_sms_credit.py b/src/shellrent_sdk/client/api/sms/get_sms_credit.py index 65cdb50..5d74777 100644 --- a/src/shellrent_sdk/client/api/sms/get_sms_credit.py +++ b/src/shellrent_sdk/client/api/sms/get_sms_credit.py @@ -14,7 +14,7 @@ def _get_kwargs() -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v3/sms/account", + "url": "/api/v3/sms-account", } return _kwargs @@ -53,6 +53,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/sms/get_sms_message.py b/src/shellrent_sdk/client/api/sms/get_sms_message.py index c48e47e..47fae4d 100644 --- a/src/shellrent_sdk/client/api/sms/get_sms_message.py +++ b/src/shellrent_sdk/client/api/sms/get_sms_message.py @@ -60,6 +60,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/sms/get_sms_phonebook.py b/src/shellrent_sdk/client/api/sms/get_sms_phonebook.py index 16bdbd0..8ca0e0d 100644 --- a/src/shellrent_sdk/client/api/sms/get_sms_phonebook.py +++ b/src/shellrent_sdk/client/api/sms/get_sms_phonebook.py @@ -17,7 +17,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v3/sms/phonebooks/{phonebook_id}".format( + "url": "/api/v3/sms-phonebooks/{phonebook_id}".format( phonebook_id=quote(str(phonebook_id), safe=""), ), } @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/sms/get_sms_price.py b/src/shellrent_sdk/client/api/sms/get_sms_price.py index 1d4d2b0..15976aa 100644 --- a/src/shellrent_sdk/client/api/sms/get_sms_price.py +++ b/src/shellrent_sdk/client/api/sms/get_sms_price.py @@ -17,7 +17,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v3/sms/countries/{country_code}".format( + "url": "/api/v3/sms-prices/{country_code}".format( country_code=quote(str(country_code), safe=""), ), } @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -84,6 +89,8 @@ def sync_detailed( Get the SMS price for a specific Country + Not available to sub-accounts: the response is 403 (error 1601). + Args: country_code (str): @@ -115,6 +122,8 @@ def sync( Get the SMS price for a specific Country + Not available to sub-accounts: the response is 403 (error 1601). + Args: country_code (str): @@ -141,6 +150,8 @@ async def asyncio_detailed( Get the SMS price for a specific Country + Not available to sub-accounts: the response is 403 (error 1601). + Args: country_code (str): @@ -170,6 +181,8 @@ async def asyncio( Get the SMS price for a specific Country + Not available to sub-accounts: the response is 403 (error 1601). + Args: country_code (str): diff --git a/src/shellrent_sdk/client/api/sms/list_sms.py b/src/shellrent_sdk/client/api/sms/list_sms.py index 06448d5..0b490a5 100644 --- a/src/shellrent_sdk/client/api/sms/list_sms.py +++ b/src/shellrent_sdk/client/api/sms/list_sms.py @@ -18,7 +18,7 @@ def _get_kwargs( date_created_from: datetime.datetime | Unset = UNSET, date_created_to: datetime.datetime | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -87,6 +87,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -111,7 +116,7 @@ def sync_detailed( date_created_from: datetime.datetime | Unset = UNSET, date_created_to: datetime.datetime | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | SmsPaginatedListResponse]: """List all SMS @@ -122,7 +127,7 @@ def sync_detailed( date_created_from (datetime.datetime | Unset): date_created_to (datetime.datetime | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -154,7 +159,7 @@ def sync( date_created_from: datetime.datetime | Unset = UNSET, date_created_to: datetime.datetime | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | SmsPaginatedListResponse | None: """List all SMS @@ -165,7 +170,7 @@ def sync( date_created_from (datetime.datetime | Unset): date_created_to (datetime.datetime | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -192,7 +197,7 @@ async def asyncio_detailed( date_created_from: datetime.datetime | Unset = UNSET, date_created_to: datetime.datetime | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | SmsPaginatedListResponse]: """List all SMS @@ -203,7 +208,7 @@ async def asyncio_detailed( date_created_from (datetime.datetime | Unset): date_created_to (datetime.datetime | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -233,7 +238,7 @@ async def asyncio( date_created_from: datetime.datetime | Unset = UNSET, date_created_to: datetime.datetime | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | SmsPaginatedListResponse | None: """List all SMS @@ -244,7 +249,7 @@ async def asyncio( date_created_from (datetime.datetime | Unset): date_created_to (datetime.datetime | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/sms/list_sms_messages.py b/src/shellrent_sdk/client/api/sms/list_sms_messages.py index dc0f027..7aa9994 100644 --- a/src/shellrent_sdk/client/api/sms/list_sms_messages.py +++ b/src/shellrent_sdk/client/api/sms/list_sms_messages.py @@ -8,18 +8,30 @@ from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError from ...models.sms_message_paginated_list_response import SmsMessagePaginatedListResponse -from ...types import Response +from ...types import UNSET, Response, Unset def _get_kwargs( sms_id: int, + *, + page: int | Unset = 1, + per_page: int | Unset = 20, ) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["page"] = page + + params["per_page"] = per_page + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + _kwargs: dict[str, Any] = { "method": "get", "url": "/api/v3/sms/{sms_id}/messages".format( sms_id=quote(str(sms_id), safe=""), ), + "params": params, } return _kwargs @@ -58,6 +70,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -79,6 +96,8 @@ def sync_detailed( sms_id: int, *, client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, ) -> Response[ApiError | SmsMessagePaginatedListResponse]: """List all messages of an SMS @@ -86,6 +105,8 @@ def sync_detailed( Args: sms_id (int): + page (int | Unset): Default: 1. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -97,6 +118,8 @@ def sync_detailed( kwargs = _get_kwargs( sms_id=sms_id, + page=page, + per_page=per_page, ) response = client.get_httpx_client().request( @@ -110,6 +133,8 @@ def sync( sms_id: int, *, client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, ) -> ApiError | SmsMessagePaginatedListResponse | None: """List all messages of an SMS @@ -117,6 +142,8 @@ def sync( Args: sms_id (int): + page (int | Unset): Default: 1. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -129,6 +156,8 @@ def sync( return sync_detailed( sms_id=sms_id, client=client, + page=page, + per_page=per_page, ).parsed @@ -136,6 +165,8 @@ async def asyncio_detailed( sms_id: int, *, client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, ) -> Response[ApiError | SmsMessagePaginatedListResponse]: """List all messages of an SMS @@ -143,6 +174,8 @@ async def asyncio_detailed( Args: sms_id (int): + page (int | Unset): Default: 1. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -154,6 +187,8 @@ async def asyncio_detailed( kwargs = _get_kwargs( sms_id=sms_id, + page=page, + per_page=per_page, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -165,6 +200,8 @@ async def asyncio( sms_id: int, *, client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, ) -> ApiError | SmsMessagePaginatedListResponse | None: """List all messages of an SMS @@ -172,6 +209,8 @@ async def asyncio( Args: sms_id (int): + page (int | Unset): Default: 1. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -185,5 +224,7 @@ async def asyncio( await asyncio_detailed( sms_id=sms_id, client=client, + page=page, + per_page=per_page, ) ).parsed diff --git a/src/shellrent_sdk/client/api/sms/list_sms_phonebook_contacts.py b/src/shellrent_sdk/client/api/sms/list_sms_phonebook_contacts.py index f6a94ce..7594b3e 100644 --- a/src/shellrent_sdk/client/api/sms/list_sms_phonebook_contacts.py +++ b/src/shellrent_sdk/client/api/sms/list_sms_phonebook_contacts.py @@ -17,7 +17,7 @@ def _get_kwargs( phonebook_id: int, *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -30,7 +30,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v3/sms/phonebooks/{phonebook_id}/contacts".format( + "url": "/api/v3/sms-phonebooks/{phonebook_id}/contacts".format( phonebook_id=quote(str(phonebook_id), safe=""), ), "params": params, @@ -72,6 +72,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -94,7 +99,7 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | SmsPhonebookContactPaginatedListResponse]: """Phonebook Contacts @@ -103,7 +108,7 @@ def sync_detailed( Args: phonebook_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -131,7 +136,7 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | SmsPhonebookContactPaginatedListResponse | None: """Phonebook Contacts @@ -140,7 +145,7 @@ def sync( Args: phonebook_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -163,7 +168,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | SmsPhonebookContactPaginatedListResponse]: """Phonebook Contacts @@ -172,7 +177,7 @@ async def asyncio_detailed( Args: phonebook_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -198,7 +203,7 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | SmsPhonebookContactPaginatedListResponse | None: """Phonebook Contacts @@ -207,7 +212,7 @@ async def asyncio( Args: phonebook_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/sms/list_sms_phonebooks.py b/src/shellrent_sdk/client/api/sms/list_sms_phonebooks.py index 3b7e9a9..bbe6a4a 100644 --- a/src/shellrent_sdk/client/api/sms/list_sms_phonebooks.py +++ b/src/shellrent_sdk/client/api/sms/list_sms_phonebooks.py @@ -13,7 +13,7 @@ def _get_kwargs( *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -26,7 +26,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v3/sms/phonebooks", + "url": "/api/v3/sms-phonebooks", "params": params, } @@ -66,6 +66,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -87,7 +92,7 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | SmsPhonebookPaginatedListResponse]: """List all Phonebooks @@ -95,7 +100,7 @@ def sync_detailed( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -121,7 +126,7 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | SmsPhonebookPaginatedListResponse | None: """List all Phonebooks @@ -129,7 +134,7 @@ def sync( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -150,7 +155,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | SmsPhonebookPaginatedListResponse]: """List all Phonebooks @@ -158,7 +163,7 @@ async def asyncio_detailed( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -182,7 +187,7 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | SmsPhonebookPaginatedListResponse | None: """List all Phonebooks @@ -190,7 +195,7 @@ async def asyncio( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/sms/list_sms_prices.py b/src/shellrent_sdk/client/api/sms/list_sms_prices.py index fc99d15..95a7f59 100644 --- a/src/shellrent_sdk/client/api/sms/list_sms_prices.py +++ b/src/shellrent_sdk/client/api/sms/list_sms_prices.py @@ -7,14 +7,27 @@ from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError from ...models.sms_price_paginated_list_response import SmsPricePaginatedListResponse -from ...types import Response +from ...types import UNSET, Response, Unset -def _get_kwargs() -> dict[str, Any]: +def _get_kwargs( + *, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["page"] = page + + params["per_page"] = per_page + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v3/sms/countries", + "url": "/api/v3/sms-prices", + "params": params, } return _kwargs @@ -53,6 +66,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -73,11 +91,19 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, ) -> Response[ApiError | SmsPricePaginatedListResponse]: """List SMS prices Get a list of all SMS prices for all supported Countries + Not available to sub-accounts: the response is 403 (error 1601). + + Args: + page (int | Unset): Default: 1. + per_page (int | Unset): Default: 20. + Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. @@ -86,7 +112,10 @@ def sync_detailed( Response[ApiError | SmsPricePaginatedListResponse] """ - kwargs = _get_kwargs() + kwargs = _get_kwargs( + page=page, + per_page=per_page, + ) response = client.get_httpx_client().request( **kwargs, @@ -98,11 +127,19 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, ) -> ApiError | SmsPricePaginatedListResponse | None: """List SMS prices Get a list of all SMS prices for all supported Countries + Not available to sub-accounts: the response is 403 (error 1601). + + Args: + page (int | Unset): Default: 1. + per_page (int | Unset): Default: 20. + Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. @@ -113,17 +150,27 @@ def sync( return sync_detailed( client=client, + page=page, + per_page=per_page, ).parsed async def asyncio_detailed( *, client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, ) -> Response[ApiError | SmsPricePaginatedListResponse]: """List SMS prices Get a list of all SMS prices for all supported Countries + Not available to sub-accounts: the response is 403 (error 1601). + + Args: + page (int | Unset): Default: 1. + per_page (int | Unset): Default: 20. + Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. @@ -132,7 +179,10 @@ async def asyncio_detailed( Response[ApiError | SmsPricePaginatedListResponse] """ - kwargs = _get_kwargs() + kwargs = _get_kwargs( + page=page, + per_page=per_page, + ) response = await client.get_async_httpx_client().request(**kwargs) @@ -142,11 +192,19 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, ) -> ApiError | SmsPricePaginatedListResponse | None: """List SMS prices Get a list of all SMS prices for all supported Countries + Not available to sub-accounts: the response is 403 (error 1601). + + Args: + page (int | Unset): Default: 1. + per_page (int | Unset): Default: 20. + Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. @@ -158,5 +216,7 @@ async def asyncio( return ( await asyncio_detailed( client=client, + page=page, + per_page=per_page, ) ).parsed diff --git a/src/shellrent_sdk/client/api/sms/replace_sms_phonebook_contacts.py b/src/shellrent_sdk/client/api/sms/replace_sms_phonebook_contacts.py index be405a5..1b1068d 100644 --- a/src/shellrent_sdk/client/api/sms/replace_sms_phonebook_contacts.py +++ b/src/shellrent_sdk/client/api/sms/replace_sms_phonebook_contacts.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/api/v3/sms/phonebooks/{phonebook_id}/contacts".format( + "url": "/api/v3/sms-phonebooks/{phonebook_id}/contacts".format( phonebook_id=quote(str(phonebook_id), safe=""), ), } @@ -67,6 +67,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/sms/send_sms.py b/src/shellrent_sdk/client/api/sms/send_sms.py index 2a14f9b..d510b25 100644 --- a/src/shellrent_sdk/client/api/sms/send_sms.py +++ b/src/shellrent_sdk/client/api/sms/send_sms.py @@ -33,10 +33,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | SmsResponse | None: - if response.status_code == 200: - response_200 = SmsResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = SmsResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -58,11 +58,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/sms/update_sms_phonebook.py b/src/shellrent_sdk/client/api/sms/update_sms_phonebook.py index 0f94d4a..56752d7 100644 --- a/src/shellrent_sdk/client/api/sms/update_sms_phonebook.py +++ b/src/shellrent_sdk/client/api/sms/update_sms_phonebook.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": "/api/v3/sms/phonebooks/{phonebook_id}".format( + "url": "/api/v3/sms-phonebooks/{phonebook_id}".format( phonebook_id=quote(str(phonebook_id), safe=""), ), } @@ -67,6 +67,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/ssl/can_reemit_ssl_certificate.py b/src/shellrent_sdk/client/api/ssl/can_reissue_ssl_certificate.py similarity index 76% rename from src/shellrent_sdk/client/api/ssl/can_reemit_ssl_certificate.py rename to src/shellrent_sdk/client/api/ssl/can_reissue_ssl_certificate.py index 4fafdf7..9168f72 100644 --- a/src/shellrent_sdk/client/api/ssl/can_reemit_ssl_certificate.py +++ b/src/shellrent_sdk/client/api/ssl/can_reissue_ssl_certificate.py @@ -7,7 +7,7 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.ssl_certificate_can_reemit_response import SslCertificateCanReemitResponse +from ...models.ssl_certificate_can_reissue_response import SslCertificateCanReissueResponse from ...types import Response @@ -17,7 +17,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v3/ssl-certificates/{ssl_certificate_id}/can-reemit".format( + "url": "/api/v3/ssl-certificates/{ssl_certificate_id}/can-reissue".format( ssl_certificate_id=quote(str(ssl_certificate_id), safe=""), ), } @@ -27,9 +27,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | SslCertificateCanReemitResponse | None: +) -> ApiError | SslCertificateCanReissueResponse | None: if response.status_code == 200: - response_200 = SslCertificateCanReemitResponse.from_dict(response.json()) + response_200 = SslCertificateCanReissueResponse.from_dict(response.json()) return response_200 @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -66,7 +71,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | SslCertificateCanReemitResponse]: +) -> Response[ApiError | SslCertificateCanReissueResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,10 +84,10 @@ def sync_detailed( ssl_certificate_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | SslCertificateCanReemitResponse]: - """Can re-emit certificate +) -> Response[ApiError | SslCertificateCanReissueResponse]: + """Can reissue certificate - Know if it's possible to re-emit the SSL Certificate + Know if it's possible to reissue the SSL Certificate Args: ssl_certificate_id (int): @@ -92,7 +97,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | SslCertificateCanReemitResponse] + Response[ApiError | SslCertificateCanReissueResponse] """ kwargs = _get_kwargs( @@ -110,10 +115,10 @@ def sync( ssl_certificate_id: int, *, client: AuthenticatedClient, -) -> ApiError | SslCertificateCanReemitResponse | None: - """Can re-emit certificate +) -> ApiError | SslCertificateCanReissueResponse | None: + """Can reissue certificate - Know if it's possible to re-emit the SSL Certificate + Know if it's possible to reissue the SSL Certificate Args: ssl_certificate_id (int): @@ -123,7 +128,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | SslCertificateCanReemitResponse + ApiError | SslCertificateCanReissueResponse """ return sync_detailed( @@ -136,10 +141,10 @@ async def asyncio_detailed( ssl_certificate_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | SslCertificateCanReemitResponse]: - """Can re-emit certificate +) -> Response[ApiError | SslCertificateCanReissueResponse]: + """Can reissue certificate - Know if it's possible to re-emit the SSL Certificate + Know if it's possible to reissue the SSL Certificate Args: ssl_certificate_id (int): @@ -149,7 +154,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | SslCertificateCanReemitResponse] + Response[ApiError | SslCertificateCanReissueResponse] """ kwargs = _get_kwargs( @@ -165,10 +170,10 @@ async def asyncio( ssl_certificate_id: int, *, client: AuthenticatedClient, -) -> ApiError | SslCertificateCanReemitResponse | None: - """Can re-emit certificate +) -> ApiError | SslCertificateCanReissueResponse | None: + """Can reissue certificate - Know if it's possible to re-emit the SSL Certificate + Know if it's possible to reissue the SSL Certificate Args: ssl_certificate_id (int): @@ -178,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | SslCertificateCanReemitResponse + ApiError | SslCertificateCanReissueResponse """ return ( diff --git a/src/shellrent_sdk/client/api/ssl/export_ssl_certificate.py b/src/shellrent_sdk/client/api/ssl/export_ssl_certificate.py index 84a8302..5ae9a93 100644 --- a/src/shellrent_sdk/client/api/ssl/export_ssl_certificate.py +++ b/src/shellrent_sdk/client/api/ssl/export_ssl_certificate.py @@ -7,23 +7,30 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError +from ...models.ssl_certificate_export_request import SslCertificateExportRequest from ...models.ssl_certificate_export_response import SslCertificateExportResponse from ...types import Response def _get_kwargs( ssl_certificate_id: int, - format_: str, + *, + body: SslCertificateExportRequest, ) -> dict[str, Any]: + headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { - "method": "get", - "url": "/api/v3/ssl-certificates/{ssl_certificate_id}/export_format/{format_}".format( + "method": "post", + "url": "/api/v3/ssl-certificates/{ssl_certificate_id}/exports".format( ssl_certificate_id=quote(str(ssl_certificate_id), safe=""), - format_=quote(str(format_), safe=""), ), } + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers return _kwargs @@ -55,11 +62,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -79,17 +96,19 @@ def _build_response( def sync_detailed( ssl_certificate_id: int, - format_: str, *, client: AuthenticatedClient, + body: SslCertificateExportRequest, ) -> Response[ApiError | SslCertificateExportResponse]: """Export SSL certificate keys - Export SSL certificate keys + Exports the certificate and its keys in the requested format, as a base64 encoded file. The format + and, when needed, the passphrases travel in the request body. The formats that include the private + key (PK, PK_CERT_CA, MULTI_ZIP) also require the ssl:secrets scope, otherwise the response is 403. Args: ssl_certificate_id (int): - format_ (str): + body (SslCertificateExportRequest): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -101,7 +120,7 @@ def sync_detailed( kwargs = _get_kwargs( ssl_certificate_id=ssl_certificate_id, - format_=format_, + body=body, ) response = client.get_httpx_client().request( @@ -113,17 +132,19 @@ def sync_detailed( def sync( ssl_certificate_id: int, - format_: str, *, client: AuthenticatedClient, + body: SslCertificateExportRequest, ) -> ApiError | SslCertificateExportResponse | None: """Export SSL certificate keys - Export SSL certificate keys + Exports the certificate and its keys in the requested format, as a base64 encoded file. The format + and, when needed, the passphrases travel in the request body. The formats that include the private + key (PK, PK_CERT_CA, MULTI_ZIP) also require the ssl:secrets scope, otherwise the response is 403. Args: ssl_certificate_id (int): - format_ (str): + body (SslCertificateExportRequest): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -135,24 +156,26 @@ def sync( return sync_detailed( ssl_certificate_id=ssl_certificate_id, - format_=format_, client=client, + body=body, ).parsed async def asyncio_detailed( ssl_certificate_id: int, - format_: str, *, client: AuthenticatedClient, + body: SslCertificateExportRequest, ) -> Response[ApiError | SslCertificateExportResponse]: """Export SSL certificate keys - Export SSL certificate keys + Exports the certificate and its keys in the requested format, as a base64 encoded file. The format + and, when needed, the passphrases travel in the request body. The formats that include the private + key (PK, PK_CERT_CA, MULTI_ZIP) also require the ssl:secrets scope, otherwise the response is 403. Args: ssl_certificate_id (int): - format_ (str): + body (SslCertificateExportRequest): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -164,7 +187,7 @@ async def asyncio_detailed( kwargs = _get_kwargs( ssl_certificate_id=ssl_certificate_id, - format_=format_, + body=body, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -174,17 +197,19 @@ async def asyncio_detailed( async def asyncio( ssl_certificate_id: int, - format_: str, *, client: AuthenticatedClient, + body: SslCertificateExportRequest, ) -> ApiError | SslCertificateExportResponse | None: """Export SSL certificate keys - Export SSL certificate keys + Exports the certificate and its keys in the requested format, as a base64 encoded file. The format + and, when needed, the passphrases travel in the request body. The formats that include the private + key (PK, PK_CERT_CA, MULTI_ZIP) also require the ssl:secrets scope, otherwise the response is 403. Args: ssl_certificate_id (int): - format_ (str): + body (SslCertificateExportRequest): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -197,7 +222,7 @@ async def asyncio( return ( await asyncio_detailed( ssl_certificate_id=ssl_certificate_id, - format_=format_, client=client, + body=body, ) ).parsed diff --git a/src/shellrent_sdk/client/api/ssl/get_ssl_certificate.py b/src/shellrent_sdk/client/api/ssl/get_ssl_certificate.py index ec5f294..b0881ab 100644 --- a/src/shellrent_sdk/client/api/ssl/get_ssl_certificate.py +++ b/src/shellrent_sdk/client/api/ssl/get_ssl_certificate.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/ssl/get_ssl_certificate_keys.py b/src/shellrent_sdk/client/api/ssl/get_ssl_certificate_keys.py index ced4c34..6beb20b 100644 --- a/src/shellrent_sdk/client/api/ssl/get_ssl_certificate_keys.py +++ b/src/shellrent_sdk/client/api/ssl/get_ssl_certificate_keys.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/ssl/list_ssl_approver_emails.py b/src/shellrent_sdk/client/api/ssl/list_ssl_approver_emails.py index 7925189..1bd7af9 100644 --- a/src/shellrent_sdk/client/api/ssl/list_ssl_approver_emails.py +++ b/src/shellrent_sdk/client/api/ssl/list_ssl_approver_emails.py @@ -1,6 +1,5 @@ from http import HTTPStatus from typing import Any -from urllib.parse import quote import httpx @@ -8,18 +7,24 @@ from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError from ...models.ssl_certificate_approver_emails_response import SslCertificateApproverEmailsResponse -from ...types import Response +from ...types import UNSET, Response def _get_kwargs( + *, domain_name: str, ) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["domain_name"] = domain_name + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v3/ssl-certificates/approver-emails/{domain_name}".format( - domain_name=quote(str(domain_name), safe=""), - ), + "url": "/api/v3/ssl-certificates/approver-emails", + "params": params, } return _kwargs @@ -58,6 +63,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -76,9 +86,9 @@ def _build_response( def sync_detailed( - domain_name: str, *, client: AuthenticatedClient, + domain_name: str, ) -> Response[ApiError | SslCertificateApproverEmailsResponse]: """Get approver emails list @@ -107,9 +117,9 @@ def sync_detailed( def sync( - domain_name: str, *, client: AuthenticatedClient, + domain_name: str, ) -> ApiError | SslCertificateApproverEmailsResponse | None: """Get approver emails list @@ -127,15 +137,15 @@ def sync( """ return sync_detailed( - domain_name=domain_name, client=client, + domain_name=domain_name, ).parsed async def asyncio_detailed( - domain_name: str, *, client: AuthenticatedClient, + domain_name: str, ) -> Response[ApiError | SslCertificateApproverEmailsResponse]: """Get approver emails list @@ -162,9 +172,9 @@ async def asyncio_detailed( async def asyncio( - domain_name: str, *, client: AuthenticatedClient, + domain_name: str, ) -> ApiError | SslCertificateApproverEmailsResponse | None: """Get approver emails list @@ -183,7 +193,7 @@ async def asyncio( return ( await asyncio_detailed( - domain_name=domain_name, client=client, + domain_name=domain_name, ) ).parsed diff --git a/src/shellrent_sdk/client/api/ssl/list_ssl_certificate_export_formats.py b/src/shellrent_sdk/client/api/ssl/list_ssl_certificate_export_formats.py index 764cd90..3d84db3 100644 --- a/src/shellrent_sdk/client/api/ssl/list_ssl_certificate_export_formats.py +++ b/src/shellrent_sdk/client/api/ssl/list_ssl_certificate_export_formats.py @@ -19,7 +19,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v3/ssl-certificates/{ssl_certificate_id}/export_formats".format( + "url": "/api/v3/ssl-certificates/{ssl_certificate_id}/export-formats".format( ssl_certificate_id=quote(str(ssl_certificate_id), safe=""), ), } @@ -60,6 +60,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/ssl/list_ssl_certificates.py b/src/shellrent_sdk/client/api/ssl/list_ssl_certificates.py index cdfa06a..f655372 100644 --- a/src/shellrent_sdk/client/api/ssl/list_ssl_certificates.py +++ b/src/shellrent_sdk/client/api/ssl/list_ssl_certificates.py @@ -15,7 +15,7 @@ def _get_kwargs( domain_name: str | Unset = UNSET, san_domain_name: str | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -72,6 +72,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -95,7 +100,7 @@ def sync_detailed( domain_name: str | Unset = UNSET, san_domain_name: str | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | SslCertificatePaginatedListResponse]: """List all SSL Certificates @@ -105,7 +110,7 @@ def sync_detailed( domain_name (str | Unset): san_domain_name (str | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -135,7 +140,7 @@ def sync( domain_name: str | Unset = UNSET, san_domain_name: str | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | SslCertificatePaginatedListResponse | None: """List all SSL Certificates @@ -145,7 +150,7 @@ def sync( domain_name (str | Unset): san_domain_name (str | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -170,7 +175,7 @@ async def asyncio_detailed( domain_name: str | Unset = UNSET, san_domain_name: str | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | SslCertificatePaginatedListResponse]: """List all SSL Certificates @@ -180,7 +185,7 @@ async def asyncio_detailed( domain_name (str | Unset): san_domain_name (str | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -208,7 +213,7 @@ async def asyncio( domain_name: str | Unset = UNSET, san_domain_name: str | Unset = UNSET, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | SslCertificatePaginatedListResponse | None: """List all SSL Certificates @@ -218,7 +223,7 @@ async def asyncio( domain_name (str | Unset): san_domain_name (str | Unset): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/ssl/reemit_ssl_certificate.py b/src/shellrent_sdk/client/api/ssl/reissue_ssl_certificate.py similarity index 75% rename from src/shellrent_sdk/client/api/ssl/reemit_ssl_certificate.py rename to src/shellrent_sdk/client/api/ssl/reissue_ssl_certificate.py index 25693ef..3c74042 100644 --- a/src/shellrent_sdk/client/api/ssl/reemit_ssl_certificate.py +++ b/src/shellrent_sdk/client/api/ssl/reissue_ssl_certificate.py @@ -21,7 +21,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/api/v3/ssl-certificates/{ssl_certificate_id}/reemit".format( + "url": "/api/v3/ssl-certificates/{ssl_certificate_id}/reissues".format( ssl_certificate_id=quote(str(ssl_certificate_id), safe=""), ), } @@ -37,10 +37,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | TaskResponse | None: - if response.status_code == 200: - response_200 = TaskResponse.from_dict(response.json()) + if response.status_code == 202: + response_202 = TaskResponse.from_dict(response.json()) - return response_200 + return response_202 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -62,11 +62,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -90,9 +100,11 @@ def sync_detailed( client: AuthenticatedClient, body: SslCertificateReemitRequest, ) -> Response[ApiError | TaskResponse]: - """Re-emit certificate + """Reissue certificate - Ask for the SSL Certificate to be re-emitted + Asks for the SSL certificate to be reissued, optionally with a custom CSR or private key. The + reissue must be allowed (see `GET /api/v3/ssl-certificates/{ssl_certificate_id}/can-reissue`), + otherwise the response is 409; the operation is asynchronous and is returned as a Task. Args: ssl_certificate_id (int): @@ -124,9 +136,11 @@ def sync( client: AuthenticatedClient, body: SslCertificateReemitRequest, ) -> ApiError | TaskResponse | None: - """Re-emit certificate + """Reissue certificate - Ask for the SSL Certificate to be re-emitted + Asks for the SSL certificate to be reissued, optionally with a custom CSR or private key. The + reissue must be allowed (see `GET /api/v3/ssl-certificates/{ssl_certificate_id}/can-reissue`), + otherwise the response is 409; the operation is asynchronous and is returned as a Task. Args: ssl_certificate_id (int): @@ -153,9 +167,11 @@ async def asyncio_detailed( client: AuthenticatedClient, body: SslCertificateReemitRequest, ) -> Response[ApiError | TaskResponse]: - """Re-emit certificate + """Reissue certificate - Ask for the SSL Certificate to be re-emitted + Asks for the SSL certificate to be reissued, optionally with a custom CSR or private key. The + reissue must be allowed (see `GET /api/v3/ssl-certificates/{ssl_certificate_id}/can-reissue`), + otherwise the response is 409; the operation is asynchronous and is returned as a Task. Args: ssl_certificate_id (int): @@ -185,9 +201,11 @@ async def asyncio( client: AuthenticatedClient, body: SslCertificateReemitRequest, ) -> ApiError | TaskResponse | None: - """Re-emit certificate + """Reissue certificate - Ask for the SSL Certificate to be re-emitted + Asks for the SSL certificate to be reissued, optionally with a custom CSR or private key. The + reissue must be allowed (see `GET /api/v3/ssl-certificates/{ssl_certificate_id}/can-reissue`), + otherwise the response is 409; the operation is asynchronous and is returned as a Task. Args: ssl_certificate_id (int): diff --git a/src/shellrent_sdk/client/api/ssl/update_ssl_certificate_csr.py b/src/shellrent_sdk/client/api/ssl/update_ssl_certificate_csr.py index 0f9fdab..8f23c3a 100644 --- a/src/shellrent_sdk/client/api/ssl/update_ssl_certificate_csr.py +++ b/src/shellrent_sdk/client/api/ssl/update_ssl_certificate_csr.py @@ -67,6 +67,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -92,7 +97,9 @@ def sync_detailed( ) -> Response[ApiError | SslCertificateKeyResponse]: """Change SSL certificate CSR - Change SSL certificate CSR + Sets a custom CSR for the certificate, after verifying it with the certificate supplier, and returns + the CSR of the certificate; sending the current CSR changes nothing. The certificate is not + reissued: see `POST /api/v3/ssl-certificates/{ssl_certificate_id}/reissues` Args: ssl_certificate_id (int): @@ -126,7 +133,9 @@ def sync( ) -> ApiError | SslCertificateKeyResponse | None: """Change SSL certificate CSR - Change SSL certificate CSR + Sets a custom CSR for the certificate, after verifying it with the certificate supplier, and returns + the CSR of the certificate; sending the current CSR changes nothing. The certificate is not + reissued: see `POST /api/v3/ssl-certificates/{ssl_certificate_id}/reissues` Args: ssl_certificate_id (int): @@ -155,7 +164,9 @@ async def asyncio_detailed( ) -> Response[ApiError | SslCertificateKeyResponse]: """Change SSL certificate CSR - Change SSL certificate CSR + Sets a custom CSR for the certificate, after verifying it with the certificate supplier, and returns + the CSR of the certificate; sending the current CSR changes nothing. The certificate is not + reissued: see `POST /api/v3/ssl-certificates/{ssl_certificate_id}/reissues` Args: ssl_certificate_id (int): @@ -187,7 +198,9 @@ async def asyncio( ) -> ApiError | SslCertificateKeyResponse | None: """Change SSL certificate CSR - Change SSL certificate CSR + Sets a custom CSR for the certificate, after verifying it with the certificate supplier, and returns + the CSR of the certificate; sending the current CSR changes nothing. The certificate is not + reissued: see `POST /api/v3/ssl-certificates/{ssl_certificate_id}/reissues` Args: ssl_certificate_id (int): diff --git a/src/shellrent_sdk/client/api/ssl/update_ssl_certificate_owner.py b/src/shellrent_sdk/client/api/ssl/update_ssl_certificate_owner.py index 6f4662f..0362e98 100644 --- a/src/shellrent_sdk/client/api/ssl/update_ssl_certificate_owner.py +++ b/src/shellrent_sdk/client/api/ssl/update_ssl_certificate_owner.py @@ -67,6 +67,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -92,7 +97,9 @@ def sync_detailed( ) -> Response[ApiError | SslCertificateResponse]: """Edit SSL certificate owner - Edit SSL certificate owner + Changes the administrative contact of the certificate (the `admin_*` fields) and returns the + certificate; only the fields sent change. The certificate already issued does not change: the CSRs + we generate afterwards take the organization, city, state and country of the contact Args: ssl_certificate_id (int): @@ -126,7 +133,9 @@ def sync( ) -> ApiError | SslCertificateResponse | None: """Edit SSL certificate owner - Edit SSL certificate owner + Changes the administrative contact of the certificate (the `admin_*` fields) and returns the + certificate; only the fields sent change. The certificate already issued does not change: the CSRs + we generate afterwards take the organization, city, state and country of the contact Args: ssl_certificate_id (int): @@ -155,7 +164,9 @@ async def asyncio_detailed( ) -> Response[ApiError | SslCertificateResponse]: """Edit SSL certificate owner - Edit SSL certificate owner + Changes the administrative contact of the certificate (the `admin_*` fields) and returns the + certificate; only the fields sent change. The certificate already issued does not change: the CSRs + we generate afterwards take the organization, city, state and country of the contact Args: ssl_certificate_id (int): @@ -187,7 +198,9 @@ async def asyncio( ) -> ApiError | SslCertificateResponse | None: """Edit SSL certificate owner - Edit SSL certificate owner + Changes the administrative contact of the certificate (the `admin_*` fields) and returns the + certificate; only the fields sent change. The certificate already issued does not change: the CSRs + we generate afterwards take the organization, city, state and country of the contact Args: ssl_certificate_id (int): diff --git a/src/shellrent_sdk/client/api/storage/create_cloud_storage_access.py b/src/shellrent_sdk/client/api/storage/create_cloud_storage_access.py index f435aed..4cc4b28 100644 --- a/src/shellrent_sdk/client/api/storage/create_cloud_storage_access.py +++ b/src/shellrent_sdk/client/api/storage/create_cloud_storage_access.py @@ -37,10 +37,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | CloudStorageAccessResponse | None: - if response.status_code == 200: - response_200 = CloudStorageAccessResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = CloudStorageAccessResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -62,11 +62,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -96,7 +106,8 @@ def sync_detailed( Args: cloud_storage_id (int): - body (CloudStorageAccessCreateRequest): + body (CloudStorageAccessCreateRequest): NFS access to create: an IPv4 address allowed to + mount the storage of a user Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -130,7 +141,8 @@ def sync( Args: cloud_storage_id (int): - body (CloudStorageAccessCreateRequest): + body (CloudStorageAccessCreateRequest): NFS access to create: an IPv4 address allowed to + mount the storage of a user Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -159,7 +171,8 @@ async def asyncio_detailed( Args: cloud_storage_id (int): - body (CloudStorageAccessCreateRequest): + body (CloudStorageAccessCreateRequest): NFS access to create: an IPv4 address allowed to + mount the storage of a user Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -191,7 +204,8 @@ async def asyncio( Args: cloud_storage_id (int): - body (CloudStorageAccessCreateRequest): + body (CloudStorageAccessCreateRequest): NFS access to create: an IPv4 address allowed to + mount the storage of a user Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/storage/create_object_storage_bucket_firewall_entry.py b/src/shellrent_sdk/client/api/storage/create_object_storage_bucket_firewall_entry.py index 73d7814..6a31f8f 100644 --- a/src/shellrent_sdk/client/api/storage/create_object_storage_bucket_firewall_entry.py +++ b/src/shellrent_sdk/client/api/storage/create_object_storage_bucket_firewall_entry.py @@ -10,9 +10,7 @@ from ...models.object_storage_bucket_firewall_entry_create_request import ( ObjectStorageBucketFirewallEntryCreateRequest, ) -from ...models.object_storage_bucket_firewall_entry_response import ( - ObjectStorageBucketFirewallEntryResponse, -) +from ...models.task_response import TaskResponse from ...types import Response @@ -42,11 +40,11 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | ObjectStorageBucketFirewallEntryResponse | None: - if response.status_code == 200: - response_200 = ObjectStorageBucketFirewallEntryResponse.from_dict(response.json()) +) -> ApiError | TaskResponse | None: + if response.status_code == 202: + response_202 = TaskResponse.from_dict(response.json()) - return response_200 + return response_202 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -68,11 +66,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -81,7 +89,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | ObjectStorageBucketFirewallEntryResponse]: +) -> Response[ApiError | TaskResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -96,22 +104,26 @@ def sync_detailed( *, client: AuthenticatedClient, body: ObjectStorageBucketFirewallEntryCreateRequest, -) -> Response[ApiError | ObjectStorageBucketFirewallEntryResponse]: +) -> Response[ApiError | TaskResponse]: """Create object storage bucket firewall entry - Create object storage bucket firewall entry + Starts adding an IP address or a subnet (CIDR) to the firewall of the bucket, returned as a Task: + the entry appears among the firewall entries when the operation is completed. Firewall operations on + the buckets of an object storage run one at a time: while one is running, the request is rejected + with 409. Args: object_storage_id (int): bucket_id (int): - body (ObjectStorageBucketFirewallEntryCreateRequest): + body (ObjectStorageBucketFirewallEntryCreateRequest): Address or subnet to allow in the + firewall of a bucket Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | ObjectStorageBucketFirewallEntryResponse] + Response[ApiError | TaskResponse] """ kwargs = _get_kwargs( @@ -133,22 +145,26 @@ def sync( *, client: AuthenticatedClient, body: ObjectStorageBucketFirewallEntryCreateRequest, -) -> ApiError | ObjectStorageBucketFirewallEntryResponse | None: +) -> ApiError | TaskResponse | None: """Create object storage bucket firewall entry - Create object storage bucket firewall entry + Starts adding an IP address or a subnet (CIDR) to the firewall of the bucket, returned as a Task: + the entry appears among the firewall entries when the operation is completed. Firewall operations on + the buckets of an object storage run one at a time: while one is running, the request is rejected + with 409. Args: object_storage_id (int): bucket_id (int): - body (ObjectStorageBucketFirewallEntryCreateRequest): + body (ObjectStorageBucketFirewallEntryCreateRequest): Address or subnet to allow in the + firewall of a bucket Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | ObjectStorageBucketFirewallEntryResponse + ApiError | TaskResponse """ return sync_detailed( @@ -165,22 +181,26 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: ObjectStorageBucketFirewallEntryCreateRequest, -) -> Response[ApiError | ObjectStorageBucketFirewallEntryResponse]: +) -> Response[ApiError | TaskResponse]: """Create object storage bucket firewall entry - Create object storage bucket firewall entry + Starts adding an IP address or a subnet (CIDR) to the firewall of the bucket, returned as a Task: + the entry appears among the firewall entries when the operation is completed. Firewall operations on + the buckets of an object storage run one at a time: while one is running, the request is rejected + with 409. Args: object_storage_id (int): bucket_id (int): - body (ObjectStorageBucketFirewallEntryCreateRequest): + body (ObjectStorageBucketFirewallEntryCreateRequest): Address or subnet to allow in the + firewall of a bucket Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | ObjectStorageBucketFirewallEntryResponse] + Response[ApiError | TaskResponse] """ kwargs = _get_kwargs( @@ -200,22 +220,26 @@ async def asyncio( *, client: AuthenticatedClient, body: ObjectStorageBucketFirewallEntryCreateRequest, -) -> ApiError | ObjectStorageBucketFirewallEntryResponse | None: +) -> ApiError | TaskResponse | None: """Create object storage bucket firewall entry - Create object storage bucket firewall entry + Starts adding an IP address or a subnet (CIDR) to the firewall of the bucket, returned as a Task: + the entry appears among the firewall entries when the operation is completed. Firewall operations on + the buckets of an object storage run one at a time: while one is running, the request is rejected + with 409. Args: object_storage_id (int): bucket_id (int): - body (ObjectStorageBucketFirewallEntryCreateRequest): + body (ObjectStorageBucketFirewallEntryCreateRequest): Address or subnet to allow in the + firewall of a bucket Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | ObjectStorageBucketFirewallEntryResponse + ApiError | TaskResponse """ return ( diff --git a/src/shellrent_sdk/client/api/storage/create_object_storage_iam_user.py b/src/shellrent_sdk/client/api/storage/create_object_storage_iam_user.py index 891d3dc..43de5ed 100644 --- a/src/shellrent_sdk/client/api/storage/create_object_storage_iam_user.py +++ b/src/shellrent_sdk/client/api/storage/create_object_storage_iam_user.py @@ -28,10 +28,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | ObjectStorageIamUserResponse | None: - if response.status_code == 200: - response_200 = ObjectStorageIamUserResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = ObjectStorageIamUserResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -53,11 +53,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/storage/create_object_storage_iam_user_s3_key.py b/src/shellrent_sdk/client/api/storage/create_object_storage_iam_user_s3_key.py index 3283ebc..4c5c73e 100644 --- a/src/shellrent_sdk/client/api/storage/create_object_storage_iam_user_s3_key.py +++ b/src/shellrent_sdk/client/api/storage/create_object_storage_iam_user_s3_key.py @@ -30,10 +30,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | ObjectStorageIamUserS3KeyResponse | None: - if response.status_code == 200: - response_200 = ObjectStorageIamUserS3KeyResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = ObjectStorageIamUserS3KeyResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -55,11 +55,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -85,7 +95,9 @@ def sync_detailed( ) -> Response[ApiError | ObjectStorageIamUserS3KeyResponse]: """Create object storage IAM user S3 key - Create object storage IAM user S3 key + Creates a new S3 key for the IAM user and returns it with its secret, which afterwards is returned + only with the objectstorage:secrets scope. An IAM user has at most 2 keys: with 2 keys the request + is rejected with 409, as when the object storage is not active or is under maintenance. Args: object_storage_id (int): @@ -119,7 +131,9 @@ def sync( ) -> ApiError | ObjectStorageIamUserS3KeyResponse | None: """Create object storage IAM user S3 key - Create object storage IAM user S3 key + Creates a new S3 key for the IAM user and returns it with its secret, which afterwards is returned + only with the objectstorage:secrets scope. An IAM user has at most 2 keys: with 2 keys the request + is rejected with 409, as when the object storage is not active or is under maintenance. Args: object_storage_id (int): @@ -148,7 +162,9 @@ async def asyncio_detailed( ) -> Response[ApiError | ObjectStorageIamUserS3KeyResponse]: """Create object storage IAM user S3 key - Create object storage IAM user S3 key + Creates a new S3 key for the IAM user and returns it with its secret, which afterwards is returned + only with the objectstorage:secrets scope. An IAM user has at most 2 keys: with 2 keys the request + is rejected with 409, as when the object storage is not active or is under maintenance. Args: object_storage_id (int): @@ -180,7 +196,9 @@ async def asyncio( ) -> ApiError | ObjectStorageIamUserS3KeyResponse | None: """Create object storage IAM user S3 key - Create object storage IAM user S3 key + Creates a new S3 key for the IAM user and returns it with its secret, which afterwards is returned + only with the objectstorage:secrets scope. An IAM user has at most 2 keys: with 2 keys the request + is rejected with 409, as when the object storage is not active or is under maintenance. Args: object_storage_id (int): diff --git a/src/shellrent_sdk/client/api/storage/delete_cloud_storage_access.py b/src/shellrent_sdk/client/api/storage/delete_cloud_storage_access.py index def34bd..69b269b 100644 --- a/src/shellrent_sdk/client/api/storage/delete_cloud_storage_access.py +++ b/src/shellrent_sdk/client/api/storage/delete_cloud_storage_access.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, cast from urllib.parse import quote import httpx @@ -7,7 +7,6 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.empty_response import EmptyResponse from ...types import Response @@ -29,11 +28,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | EmptyResponse | None: - if response.status_code == 200: - response_200 = EmptyResponse.from_dict(response.json()) - - return response_200 +) -> Any | ApiError | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -55,11 +53,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -68,7 +76,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -82,7 +90,7 @@ def sync_detailed( access_id: str, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Delete cloud storage access Delete a cloud storage NFS access @@ -96,7 +104,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -116,7 +124,7 @@ def sync( access_id: str, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Delete cloud storage access Delete a cloud storage NFS access @@ -130,7 +138,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return sync_detailed( @@ -145,7 +153,7 @@ async def asyncio_detailed( access_id: str, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Delete cloud storage access Delete a cloud storage NFS access @@ -159,7 +167,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -177,7 +185,7 @@ async def asyncio( access_id: str, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Delete cloud storage access Delete a cloud storage NFS access @@ -191,7 +199,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return ( diff --git a/src/shellrent_sdk/client/api/storage/delete_cloud_storage_user.py b/src/shellrent_sdk/client/api/storage/delete_cloud_storage_user.py index c21dd55..60c3dc7 100644 --- a/src/shellrent_sdk/client/api/storage/delete_cloud_storage_user.py +++ b/src/shellrent_sdk/client/api/storage/delete_cloud_storage_user.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, cast from urllib.parse import quote import httpx @@ -7,7 +7,6 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.empty_response import EmptyResponse from ...types import Response @@ -29,11 +28,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | EmptyResponse | None: - if response.status_code == 200: - response_200 = EmptyResponse.from_dict(response.json()) - - return response_200 +) -> Any | ApiError | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -55,11 +53,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -68,7 +76,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -82,7 +90,7 @@ def sync_detailed( cloud_storage_user_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Delete cloud storage user Suspend a cloud storage user @@ -96,7 +104,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -116,7 +124,7 @@ def sync( cloud_storage_user_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Delete cloud storage user Suspend a cloud storage user @@ -130,7 +138,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return sync_detailed( @@ -145,7 +153,7 @@ async def asyncio_detailed( cloud_storage_user_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Delete cloud storage user Suspend a cloud storage user @@ -159,7 +167,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -177,7 +185,7 @@ async def asyncio( cloud_storage_user_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Delete cloud storage user Suspend a cloud storage user @@ -191,7 +199,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return ( diff --git a/src/shellrent_sdk/client/api/storage/delete_object_storage_bucket_firewall_entry.py b/src/shellrent_sdk/client/api/storage/delete_object_storage_bucket_firewall_entry.py index 44442a9..3be7fc8 100644 --- a/src/shellrent_sdk/client/api/storage/delete_object_storage_bucket_firewall_entry.py +++ b/src/shellrent_sdk/client/api/storage/delete_object_storage_bucket_firewall_entry.py @@ -7,9 +7,7 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.object_storage_bucket_firewall_entry_response import ( - ObjectStorageBucketFirewallEntryResponse, -) +from ...models.task_response import TaskResponse from ...types import Response @@ -33,11 +31,11 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | ObjectStorageBucketFirewallEntryResponse | None: - if response.status_code == 200: - response_200 = ObjectStorageBucketFirewallEntryResponse.from_dict(response.json()) +) -> ApiError | TaskResponse | None: + if response.status_code == 202: + response_202 = TaskResponse.from_dict(response.json()) - return response_200 + return response_202 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -59,11 +57,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -72,7 +80,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | ObjectStorageBucketFirewallEntryResponse]: +) -> Response[ApiError | TaskResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -87,10 +95,12 @@ def sync_detailed( entry_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | ObjectStorageBucketFirewallEntryResponse]: +) -> Response[ApiError | TaskResponse]: """Delete object storage bucket firewall entry - Delete object storage bucket firewall entry + Starts removing the entry from the firewall of the bucket, returned as a Task: the entry disappears + when the operation is completed. Firewall operations on the buckets of an object storage run one at + a time: while one is running, the request is rejected with 409. Args: object_storage_id (int): @@ -102,7 +112,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | ObjectStorageBucketFirewallEntryResponse] + Response[ApiError | TaskResponse] """ kwargs = _get_kwargs( @@ -124,10 +134,12 @@ def sync( entry_id: int, *, client: AuthenticatedClient, -) -> ApiError | ObjectStorageBucketFirewallEntryResponse | None: +) -> ApiError | TaskResponse | None: """Delete object storage bucket firewall entry - Delete object storage bucket firewall entry + Starts removing the entry from the firewall of the bucket, returned as a Task: the entry disappears + when the operation is completed. Firewall operations on the buckets of an object storage run one at + a time: while one is running, the request is rejected with 409. Args: object_storage_id (int): @@ -139,7 +151,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | ObjectStorageBucketFirewallEntryResponse + ApiError | TaskResponse """ return sync_detailed( @@ -156,10 +168,12 @@ async def asyncio_detailed( entry_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | ObjectStorageBucketFirewallEntryResponse]: +) -> Response[ApiError | TaskResponse]: """Delete object storage bucket firewall entry - Delete object storage bucket firewall entry + Starts removing the entry from the firewall of the bucket, returned as a Task: the entry disappears + when the operation is completed. Firewall operations on the buckets of an object storage run one at + a time: while one is running, the request is rejected with 409. Args: object_storage_id (int): @@ -171,7 +185,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | ObjectStorageBucketFirewallEntryResponse] + Response[ApiError | TaskResponse] """ kwargs = _get_kwargs( @@ -191,10 +205,12 @@ async def asyncio( entry_id: int, *, client: AuthenticatedClient, -) -> ApiError | ObjectStorageBucketFirewallEntryResponse | None: +) -> ApiError | TaskResponse | None: """Delete object storage bucket firewall entry - Delete object storage bucket firewall entry + Starts removing the entry from the firewall of the bucket, returned as a Task: the entry disappears + when the operation is completed. Firewall operations on the buckets of an object storage run one at + a time: while one is running, the request is rejected with 409. Args: object_storage_id (int): @@ -206,7 +222,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | ObjectStorageBucketFirewallEntryResponse + ApiError | TaskResponse """ return ( diff --git a/src/shellrent_sdk/client/api/storage/delete_object_storage_iam_user.py b/src/shellrent_sdk/client/api/storage/delete_object_storage_iam_user.py index 8a0ff2b..2f5c43b 100644 --- a/src/shellrent_sdk/client/api/storage/delete_object_storage_iam_user.py +++ b/src/shellrent_sdk/client/api/storage/delete_object_storage_iam_user.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, cast from urllib.parse import quote import httpx @@ -7,7 +7,6 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.empty_response import EmptyResponse from ...types import Response @@ -29,11 +28,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | EmptyResponse | None: - if response.status_code == 200: - response_200 = EmptyResponse.from_dict(response.json()) - - return response_200 +) -> Any | ApiError | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -55,11 +53,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -68,7 +76,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -82,7 +90,7 @@ def sync_detailed( iam_user_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Delete object storage IAM user Delete an object storage IAM user @@ -96,7 +104,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -116,7 +124,7 @@ def sync( iam_user_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Delete object storage IAM user Delete an object storage IAM user @@ -130,7 +138,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return sync_detailed( @@ -145,7 +153,7 @@ async def asyncio_detailed( iam_user_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Delete object storage IAM user Delete an object storage IAM user @@ -159,7 +167,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -177,7 +185,7 @@ async def asyncio( iam_user_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Delete object storage IAM user Delete an object storage IAM user @@ -191,7 +199,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return ( diff --git a/src/shellrent_sdk/client/api/storage/delete_object_storage_iam_user_s3_key.py b/src/shellrent_sdk/client/api/storage/delete_object_storage_iam_user_s3_key.py index a9099b5..f80e1a1 100644 --- a/src/shellrent_sdk/client/api/storage/delete_object_storage_iam_user_s3_key.py +++ b/src/shellrent_sdk/client/api/storage/delete_object_storage_iam_user_s3_key.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any +from typing import Any, cast from urllib.parse import quote import httpx @@ -7,7 +7,6 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.api_error import ApiError -from ...models.empty_response import EmptyResponse from ...types import Response @@ -31,11 +30,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ApiError | EmptyResponse | None: - if response.status_code == 200: - response_200 = EmptyResponse.from_dict(response.json()) - - return response_200 +) -> Any | ApiError | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -57,11 +55,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -70,7 +78,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -85,10 +93,12 @@ def sync_detailed( s3_key_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Delete object storage IAM user S3 key - Delete object storage IAM user S3 key + Deletes the S3 key of the IAM user on the storage, so it can no longer be used. A key already + deleted is not found (404); the request is rejected with 409 when the object storage is not active + or is under maintenance. Args: object_storage_id (int): @@ -100,7 +110,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -122,10 +132,12 @@ def sync( s3_key_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Delete object storage IAM user S3 key - Delete object storage IAM user S3 key + Deletes the S3 key of the IAM user on the storage, so it can no longer be used. A key already + deleted is not found (404); the request is rejected with 409 when the object storage is not active + or is under maintenance. Args: object_storage_id (int): @@ -137,7 +149,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return sync_detailed( @@ -154,10 +166,12 @@ async def asyncio_detailed( s3_key_id: int, *, client: AuthenticatedClient, -) -> Response[ApiError | EmptyResponse]: +) -> Response[Any | ApiError]: """Delete object storage IAM user S3 key - Delete object storage IAM user S3 key + Deletes the S3 key of the IAM user on the storage, so it can no longer be used. A key already + deleted is not found (404); the request is rejected with 409 when the object storage is not active + or is under maintenance. Args: object_storage_id (int): @@ -169,7 +183,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ApiError | EmptyResponse] + Response[Any | ApiError] """ kwargs = _get_kwargs( @@ -189,10 +203,12 @@ async def asyncio( s3_key_id: int, *, client: AuthenticatedClient, -) -> ApiError | EmptyResponse | None: +) -> Any | ApiError | None: """Delete object storage IAM user S3 key - Delete object storage IAM user S3 key + Deletes the S3 key of the IAM user on the storage, so it can no longer be used. A key already + deleted is not found (404); the request is rejected with 409 when the object storage is not active + or is under maintenance. Args: object_storage_id (int): @@ -204,7 +220,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ApiError | EmptyResponse + Any | ApiError """ return ( diff --git a/src/shellrent_sdk/client/api/storage/downgrade_cloud_storage_size.py b/src/shellrent_sdk/client/api/storage/downgrade_cloud_storage_size.py index 18e7cc5..f9717cb 100644 --- a/src/shellrent_sdk/client/api/storage/downgrade_cloud_storage_size.py +++ b/src/shellrent_sdk/client/api/storage/downgrade_cloud_storage_size.py @@ -16,8 +16,8 @@ def _get_kwargs( ) -> dict[str, Any]: _kwargs: dict[str, Any] = { - "method": "patch", - "url": "/api/v3/cloud-storages/{cloud_storage_id}/size-downgrade".format( + "method": "post", + "url": "/api/v3/cloud-storages/{cloud_storage_id}/size-downgrades".format( cloud_storage_id=quote(str(cloud_storage_id), safe=""), ), } @@ -28,10 +28,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | TaskResponse | None: - if response.status_code == 200: - response_200 = TaskResponse.from_dict(response.json()) + if response.status_code == 202: + response_202 = TaskResponse.from_dict(response.json()) - return response_200 + return response_202 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -53,11 +53,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -84,6 +94,8 @@ def sync_detailed( Downgrade the cloud storage size. Returns the background Task created for the downgrade. + Not available to sub-accounts: the response is 403 (error 1601). + Args: cloud_storage_id (int): @@ -115,6 +127,8 @@ def sync( Downgrade the cloud storage size. Returns the background Task created for the downgrade. + Not available to sub-accounts: the response is 403 (error 1601). + Args: cloud_storage_id (int): @@ -141,6 +155,8 @@ async def asyncio_detailed( Downgrade the cloud storage size. Returns the background Task created for the downgrade. + Not available to sub-accounts: the response is 403 (error 1601). + Args: cloud_storage_id (int): @@ -170,6 +186,8 @@ async def asyncio( Downgrade the cloud storage size. Returns the background Task created for the downgrade. + Not available to sub-accounts: the response is 403 (error 1601). + Args: cloud_storage_id (int): diff --git a/src/shellrent_sdk/client/api/storage/get_cloud_storage.py b/src/shellrent_sdk/client/api/storage/get_cloud_storage.py index f6b359b..9bdcdaa 100644 --- a/src/shellrent_sdk/client/api/storage/get_cloud_storage.py +++ b/src/shellrent_sdk/client/api/storage/get_cloud_storage.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/storage/get_cloud_storage_access.py b/src/shellrent_sdk/client/api/storage/get_cloud_storage_access.py index bf179e5..4b65735 100644 --- a/src/shellrent_sdk/client/api/storage/get_cloud_storage_access.py +++ b/src/shellrent_sdk/client/api/storage/get_cloud_storage_access.py @@ -60,6 +60,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/storage/get_cloud_storage_user.py b/src/shellrent_sdk/client/api/storage/get_cloud_storage_user.py index a0775a0..6e8cf1d 100644 --- a/src/shellrent_sdk/client/api/storage/get_cloud_storage_user.py +++ b/src/shellrent_sdk/client/api/storage/get_cloud_storage_user.py @@ -60,6 +60,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/storage/get_object_storage.py b/src/shellrent_sdk/client/api/storage/get_object_storage.py index c800101..3cab81c 100644 --- a/src/shellrent_sdk/client/api/storage/get_object_storage.py +++ b/src/shellrent_sdk/client/api/storage/get_object_storage.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/storage/get_object_storage_bucket.py b/src/shellrent_sdk/client/api/storage/get_object_storage_bucket.py index 79eb484..7b62466 100644 --- a/src/shellrent_sdk/client/api/storage/get_object_storage_bucket.py +++ b/src/shellrent_sdk/client/api/storage/get_object_storage_bucket.py @@ -60,6 +60,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/storage/get_object_storage_bucket_chart.py b/src/shellrent_sdk/client/api/storage/get_object_storage_bucket_chart.py index 0e81e14..374f02e 100644 --- a/src/shellrent_sdk/client/api/storage/get_object_storage_bucket_chart.py +++ b/src/shellrent_sdk/client/api/storage/get_object_storage_bucket_chart.py @@ -60,6 +60,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/storage/get_object_storage_bucket_firewall_entry.py b/src/shellrent_sdk/client/api/storage/get_object_storage_bucket_firewall_entry.py index 7ba50b6..25d1017 100644 --- a/src/shellrent_sdk/client/api/storage/get_object_storage_bucket_firewall_entry.py +++ b/src/shellrent_sdk/client/api/storage/get_object_storage_bucket_firewall_entry.py @@ -64,6 +64,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/storage/get_object_storage_iam_user.py b/src/shellrent_sdk/client/api/storage/get_object_storage_iam_user.py index 4bb9ddf..6006484 100644 --- a/src/shellrent_sdk/client/api/storage/get_object_storage_iam_user.py +++ b/src/shellrent_sdk/client/api/storage/get_object_storage_iam_user.py @@ -60,6 +60,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/storage/get_object_storage_iam_user_s3_key.py b/src/shellrent_sdk/client/api/storage/get_object_storage_iam_user_s3_key.py index 69fdaaa..cb8d44b 100644 --- a/src/shellrent_sdk/client/api/storage/get_object_storage_iam_user_s3_key.py +++ b/src/shellrent_sdk/client/api/storage/get_object_storage_iam_user_s3_key.py @@ -62,6 +62,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/storage/get_object_storage_s3_key.py b/src/shellrent_sdk/client/api/storage/get_object_storage_s3_key.py index 1822284..9821c75 100644 --- a/src/shellrent_sdk/client/api/storage/get_object_storage_s3_key.py +++ b/src/shellrent_sdk/client/api/storage/get_object_storage_s3_key.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/storage/list_cloud_storage_accesses.py b/src/shellrent_sdk/client/api/storage/list_cloud_storage_accesses.py index 07ef775..2c22ba4 100644 --- a/src/shellrent_sdk/client/api/storage/list_cloud_storage_accesses.py +++ b/src/shellrent_sdk/client/api/storage/list_cloud_storage_accesses.py @@ -17,7 +17,7 @@ def _get_kwargs( cloud_storage_id: int, *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -72,6 +72,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -94,7 +99,7 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | CloudStorageAccessPaginatedListResponse]: """List cloud storage accesses @@ -103,7 +108,7 @@ def sync_detailed( Args: cloud_storage_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -131,7 +136,7 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | CloudStorageAccessPaginatedListResponse | None: """List cloud storage accesses @@ -140,7 +145,7 @@ def sync( Args: cloud_storage_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -163,7 +168,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | CloudStorageAccessPaginatedListResponse]: """List cloud storage accesses @@ -172,7 +177,7 @@ async def asyncio_detailed( Args: cloud_storage_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -198,7 +203,7 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | CloudStorageAccessPaginatedListResponse | None: """List cloud storage accesses @@ -207,7 +212,7 @@ async def asyncio( Args: cloud_storage_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/storage/list_cloud_storage_users.py b/src/shellrent_sdk/client/api/storage/list_cloud_storage_users.py index 49a3e8f..e738f74 100644 --- a/src/shellrent_sdk/client/api/storage/list_cloud_storage_users.py +++ b/src/shellrent_sdk/client/api/storage/list_cloud_storage_users.py @@ -58,6 +58,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/storage/list_cloud_storages.py b/src/shellrent_sdk/client/api/storage/list_cloud_storages.py index 5b42dd9..06604f9 100644 --- a/src/shellrent_sdk/client/api/storage/list_cloud_storages.py +++ b/src/shellrent_sdk/client/api/storage/list_cloud_storages.py @@ -13,7 +13,7 @@ def _get_kwargs( *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -66,6 +66,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -87,7 +92,7 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | CloudStoragePaginatedListResponse]: """List cloud storages @@ -95,7 +100,7 @@ def sync_detailed( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -121,7 +126,7 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | CloudStoragePaginatedListResponse | None: """List cloud storages @@ -129,7 +134,7 @@ def sync( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -150,7 +155,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | CloudStoragePaginatedListResponse]: """List cloud storages @@ -158,7 +163,7 @@ async def asyncio_detailed( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -182,7 +187,7 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | CloudStoragePaginatedListResponse | None: """List cloud storages @@ -190,7 +195,7 @@ async def asyncio( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/storage/list_object_storage_bucket_firewall_entries.py b/src/shellrent_sdk/client/api/storage/list_object_storage_bucket_firewall_entries.py index b16f810..bca09ac 100644 --- a/src/shellrent_sdk/client/api/storage/list_object_storage_bucket_firewall_entries.py +++ b/src/shellrent_sdk/client/api/storage/list_object_storage_bucket_firewall_entries.py @@ -18,7 +18,7 @@ def _get_kwargs( bucket_id: int, *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -76,6 +76,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -99,7 +104,7 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | ObjectStorageBucketFirewallEntryPaginatedListResponse]: """List object storage bucket firewall entries @@ -109,7 +114,7 @@ def sync_detailed( object_storage_id (int): bucket_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -139,7 +144,7 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | ObjectStorageBucketFirewallEntryPaginatedListResponse | None: """List object storage bucket firewall entries @@ -149,7 +154,7 @@ def sync( object_storage_id (int): bucket_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -174,7 +179,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | ObjectStorageBucketFirewallEntryPaginatedListResponse]: """List object storage bucket firewall entries @@ -184,7 +189,7 @@ async def asyncio_detailed( object_storage_id (int): bucket_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -212,7 +217,7 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | ObjectStorageBucketFirewallEntryPaginatedListResponse | None: """List object storage bucket firewall entries @@ -222,7 +227,7 @@ async def asyncio( object_storage_id (int): bucket_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/storage/list_object_storage_buckets.py b/src/shellrent_sdk/client/api/storage/list_object_storage_buckets.py index 015de1b..8d0a1aa 100644 --- a/src/shellrent_sdk/client/api/storage/list_object_storage_buckets.py +++ b/src/shellrent_sdk/client/api/storage/list_object_storage_buckets.py @@ -17,7 +17,7 @@ def _get_kwargs( object_storage_id: int, *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -72,6 +72,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -94,7 +99,7 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | ObjectStorageBucketPaginatedListResponse]: """List object storage buckets @@ -103,7 +108,7 @@ def sync_detailed( Args: object_storage_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -131,7 +136,7 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | ObjectStorageBucketPaginatedListResponse | None: """List object storage buckets @@ -140,7 +145,7 @@ def sync( Args: object_storage_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -163,7 +168,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | ObjectStorageBucketPaginatedListResponse]: """List object storage buckets @@ -172,7 +177,7 @@ async def asyncio_detailed( Args: object_storage_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -198,7 +203,7 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | ObjectStorageBucketPaginatedListResponse | None: """List object storage buckets @@ -207,7 +212,7 @@ async def asyncio( Args: object_storage_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/storage/list_object_storage_iam_user_s3_keys.py b/src/shellrent_sdk/client/api/storage/list_object_storage_iam_user_s3_keys.py index 1ff0e77..3515682 100644 --- a/src/shellrent_sdk/client/api/storage/list_object_storage_iam_user_s3_keys.py +++ b/src/shellrent_sdk/client/api/storage/list_object_storage_iam_user_s3_keys.py @@ -62,6 +62,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/shellrent_sdk/client/api/storage/list_object_storage_iam_users.py b/src/shellrent_sdk/client/api/storage/list_object_storage_iam_users.py index 7f87f95..548eec2 100644 --- a/src/shellrent_sdk/client/api/storage/list_object_storage_iam_users.py +++ b/src/shellrent_sdk/client/api/storage/list_object_storage_iam_users.py @@ -17,7 +17,7 @@ def _get_kwargs( object_storage_id: int, *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -72,6 +72,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -94,7 +99,7 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | ObjectStorageIamUserPaginatedListResponse]: """List object storage IAM users @@ -103,7 +108,7 @@ def sync_detailed( Args: object_storage_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -131,7 +136,7 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | ObjectStorageIamUserPaginatedListResponse | None: """List object storage IAM users @@ -140,7 +145,7 @@ def sync( Args: object_storage_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -163,7 +168,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | ObjectStorageIamUserPaginatedListResponse]: """List object storage IAM users @@ -172,7 +177,7 @@ async def asyncio_detailed( Args: object_storage_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -198,7 +203,7 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | ObjectStorageIamUserPaginatedListResponse | None: """List object storage IAM users @@ -207,7 +212,7 @@ async def asyncio( Args: object_storage_id (int): page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/storage/list_object_storages.py b/src/shellrent_sdk/client/api/storage/list_object_storages.py index 10ef816..73b6b49 100644 --- a/src/shellrent_sdk/client/api/storage/list_object_storages.py +++ b/src/shellrent_sdk/client/api/storage/list_object_storages.py @@ -13,7 +13,7 @@ def _get_kwargs( *, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -66,6 +66,11 @@ def _parse_response( return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -87,7 +92,7 @@ def sync_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | ObjectStoragePaginatedListResponse]: """List object storages @@ -95,7 +100,7 @@ def sync_detailed( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -121,7 +126,7 @@ def sync( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | ObjectStoragePaginatedListResponse | None: """List object storages @@ -129,7 +134,7 @@ def sync( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -150,7 +155,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> Response[ApiError | ObjectStoragePaginatedListResponse]: """List object storages @@ -158,7 +163,7 @@ async def asyncio_detailed( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -182,7 +187,7 @@ async def asyncio( *, client: AuthenticatedClient, page: int | Unset = 1, - per_page: int | Unset = 15, + per_page: int | Unset = 20, ) -> ApiError | ObjectStoragePaginatedListResponse | None: """List object storages @@ -190,7 +195,7 @@ async def asyncio( Args: page (int | Unset): Default: 1. - per_page (int | Unset): Default: 15. + per_page (int | Unset): Default: 20. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/storage/update_cloud_storage_user_size.py b/src/shellrent_sdk/client/api/storage/update_cloud_storage_user_size.py index 5565d2a..92a337f 100644 --- a/src/shellrent_sdk/client/api/storage/update_cloud_storage_user_size.py +++ b/src/shellrent_sdk/client/api/storage/update_cloud_storage_user_size.py @@ -22,7 +22,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": "/api/v3/cloud-storages/{cloud_storage_id}/users/{cloud_storage_user_id}/size".format( + "url": "/api/v3/cloud-storages/{cloud_storage_id}/users/{cloud_storage_user_id}".format( cloud_storage_id=quote(str(cloud_storage_id), safe=""), cloud_storage_user_id=quote(str(cloud_storage_user_id), safe=""), ), @@ -64,11 +64,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -100,7 +110,8 @@ def sync_detailed( Args: cloud_storage_id (int): cloud_storage_user_id (int): - body (CloudStorageUserSizeUpdateRequest): + body (CloudStorageUserSizeUpdateRequest): New quota of an additional user of the cloud + storage Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -137,7 +148,8 @@ def sync( Args: cloud_storage_id (int): cloud_storage_user_id (int): - body (CloudStorageUserSizeUpdateRequest): + body (CloudStorageUserSizeUpdateRequest): New quota of an additional user of the cloud + storage Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -169,7 +181,8 @@ async def asyncio_detailed( Args: cloud_storage_id (int): cloud_storage_user_id (int): - body (CloudStorageUserSizeUpdateRequest): + body (CloudStorageUserSizeUpdateRequest): New quota of an additional user of the cloud + storage Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -204,7 +217,8 @@ async def asyncio( Args: cloud_storage_id (int): cloud_storage_user_id (int): - body (CloudStorageUserSizeUpdateRequest): + body (CloudStorageUserSizeUpdateRequest): New quota of an additional user of the cloud + storage Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/shellrent_sdk/client/api/storage/upgrade_cloud_storage_size.py b/src/shellrent_sdk/client/api/storage/upgrade_cloud_storage_size.py index 3a79f0d..8de3047 100644 --- a/src/shellrent_sdk/client/api/storage/upgrade_cloud_storage_size.py +++ b/src/shellrent_sdk/client/api/storage/upgrade_cloud_storage_size.py @@ -17,7 +17,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/api/v3/cloud-storages/{cloud_storage_id}/size-upgrade".format( + "url": "/api/v3/cloud-storages/{cloud_storage_id}/size-upgrades".format( cloud_storage_id=quote(str(cloud_storage_id), safe=""), ), } @@ -28,10 +28,10 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ApiError | OrderResponse | None: - if response.status_code == 200: - response_200 = OrderResponse.from_dict(response.json()) + if response.status_code == 201: + response_201 = OrderResponse.from_dict(response.json()) - return response_200 + return response_201 if response.status_code == 400: response_400 = ApiError.from_dict(response.json()) @@ -53,11 +53,21 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ApiError.from_dict(response.json()) + + return response_409 + if response.status_code == 429: response_429 = ApiError.from_dict(response.json()) return response_429 + if response.status_code == 500: + response_500 = ApiError.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -84,6 +94,8 @@ def sync_detailed( Upgrade the cloud storage size. Returns the generated Order to pay the additional size. + Not available to sub-accounts: the response is 403 (error 1601). + Args: cloud_storage_id (int): @@ -115,6 +127,8 @@ def sync( Upgrade the cloud storage size. Returns the generated Order to pay the additional size. + Not available to sub-accounts: the response is 403 (error 1601). + Args: cloud_storage_id (int): @@ -141,6 +155,8 @@ async def asyncio_detailed( Upgrade the cloud storage size. Returns the generated Order to pay the additional size. + Not available to sub-accounts: the response is 403 (error 1601). + Args: cloud_storage_id (int): @@ -170,6 +186,8 @@ async def asyncio( Upgrade the cloud storage size. Returns the generated Order to pay the additional size. + Not available to sub-accounts: the response is 403 (error 1601). + Args: cloud_storage_id (int): diff --git a/src/shellrent_sdk/client/models/__init__.py b/src/shellrent_sdk/client/models/__init__.py index c70c8c5..344deb2 100644 --- a/src/shellrent_sdk/client/models/__init__.py +++ b/src/shellrent_sdk/client/models/__init__.py @@ -4,15 +4,13 @@ from .account_billing import AccountBilling from .account_paginated_list_response import AccountPaginatedListResponse from .account_response import AccountResponse -from .account_response_meta_type_0 import AccountResponseMetaType0 from .amount import Amount from .amount_simple import AmountSimple from .api_error import ApiError -from .api_error_data_type_0 import ApiErrorDataType0 from .api_error_meta_type_0 import ApiErrorMetaType0 +from .api_error_meta_type_0_errors import ApiErrorMetaType0Errors from .api_upload import ApiUpload from .api_upload_response import ApiUploadResponse -from .api_upload_response_meta_type_0 import ApiUploadResponseMetaType0 from .billing_data import BillingData from .buy_prepaid_credit_topup_request import BuyPrepaidCreditTopupRequest from .buy_prepaid_credit_topup_request_amount import BuyPrepaidCreditTopupRequestAmount @@ -45,9 +43,6 @@ from .buy_service_object_storage_request_configuration import ( BuyServiceObjectStorageRequestConfiguration, ) -from .buy_service_object_storage_request_configuration_tb_size import ( - BuyServiceObjectStorageRequestConfigurationTbSize, -) from .buy_service_pec_domain_request import BuyServicePecDomainRequest from .buy_service_pec_domain_request_data import BuyServicePecDomainRequestData from .buy_service_pec_domain_request_data_legal_entity import ( @@ -66,26 +61,6 @@ from .buy_service_private_cloud_sv_request_data_additionalbackupdiskservicequantity import ( BuyServicePrivateCloudSvRequestDataADDITIONALBACKUPDISKSERVICEQUANTITY, ) -from .buy_service_securemail_for_google_workspace_request import ( - BuyServiceSecuremailForGoogleWorkspaceRequest, -) -from .buy_service_securemail_for_google_workspace_request_configuration import ( - BuyServiceSecuremailForGoogleWorkspaceRequestConfiguration, -) -from .buy_service_securemail_for_google_workspace_request_data import ( - BuyServiceSecuremailForGoogleWorkspaceRequestData, -) -from .buy_service_securemail_for_microsoft_365_request import ( - BuyServiceSecuremailForMicrosoft365Request, -) -from .buy_service_securemail_for_microsoft_365_request_configuration import ( - BuyServiceSecuremailForMicrosoft365RequestConfiguration, -) -from .buy_service_securemail_for_microsoft_365_request_data import ( - BuyServiceSecuremailForMicrosoft365RequestData, -) -from .buy_service_securemail_request import BuyServiceSecuremailRequest -from .buy_service_securemail_request_configuration import BuyServiceSecuremailRequestConfiguration from .buy_service_sms_request import BuyServiceSmsRequest from .buy_service_ssl_certificate_request import BuyServiceSslCertificateRequest from .buy_service_ssl_certificate_request_data import BuyServiceSslCertificateRequestData @@ -102,62 +77,45 @@ from .cloud_storage_access_create_request import CloudStorageAccessCreateRequest from .cloud_storage_access_paginated_list_response import CloudStorageAccessPaginatedListResponse from .cloud_storage_access_response import CloudStorageAccessResponse -from .cloud_storage_access_response_meta_type_0 import CloudStorageAccessResponseMetaType0 from .cloud_storage_paginated_list_response import CloudStoragePaginatedListResponse from .cloud_storage_response import CloudStorageResponse -from .cloud_storage_response_meta_type_0 import CloudStorageResponseMetaType0 from .cloud_storage_user import CloudStorageUser from .cloud_storage_user_list_response import CloudStorageUserListResponse -from .cloud_storage_user_list_response_meta_type_0 import CloudStorageUserListResponseMetaType0 from .cloud_storage_user_response import CloudStorageUserResponse -from .cloud_storage_user_response_meta_type_0 import CloudStorageUserResponseMetaType0 from .cloud_storage_user_size_update_request import CloudStorageUserSizeUpdateRequest from .complete_task_data_body import CompleteTaskDataBody from .complete_task_data_body_data import CompleteTaskDataBodyData from .country import Country -from .cpanel_license import CpanelLicense -from .cpanel_license_paginated_list_response import CpanelLicensePaginatedListResponse -from .cpanel_license_response import CpanelLicenseResponse -from .cpanel_license_response_meta_type_0 import CpanelLicenseResponseMetaType0 from .creditnote import Creditnote from .creditnote_paginated_list_response import CreditnotePaginatedListResponse from .creditnote_response import CreditnoteResponse -from .creditnote_response_meta_type_0 import CreditnoteResponseMetaType0 from .creditnote_row import CreditnoteRow from .creditnote_row_list_response import CreditnoteRowListResponse -from .creditnote_row_list_response_meta_type_0 import CreditnoteRowListResponseMetaType0 from .creditnote_row_response import CreditnoteRowResponse -from .creditnote_row_response_meta_type_0 import CreditnoteRowResponseMetaType0 from .dns_record import DnsRecord from .dns_record_caa_data import DnsRecordCaaData from .dns_record_paginated_list_response import DnsRecordPaginatedListResponse from .dns_record_response import DnsRecordResponse -from .dns_record_response_meta_type_0 import DnsRecordResponseMetaType0 from .dns_record_tlsa_data import DnsRecordTlsaData from .dns_type import DnsType from .dns_zone import DnsZone from .dns_zone_response import DnsZoneResponse -from .dns_zone_response_meta_type_0 import DnsZoneResponseMetaType0 from .dnssec_ds_data import DnssecDsData from .dnssec_key_data import DnssecKeyData from .domain import Domain from .domain_availability import DomainAvailability from .domain_availability_response import DomainAvailabilityResponse -from .domain_availability_response_meta_type_0 import DomainAvailabilityResponseMetaType0 from .domain_can_change_nameservers import DomainCanChangeNameservers from .domain_can_change_nameservers_response import DomainCanChangeNameserversResponse -from .domain_can_change_nameservers_response_meta_type_0 import ( - DomainCanChangeNameserversResponseMetaType0, -) from .domain_contact import DomainContact from .domain_contact_data import DomainContactData from .domain_contact_list_response import DomainContactListResponse -from .domain_contact_list_response_meta_type_0 import DomainContactListResponseMetaType0 from .domain_contact_request import DomainContactRequest from .domain_contact_request_contact_data_item import DomainContactRequestContactDataItem from .domain_contact_response import DomainContactResponse -from .domain_contact_response_meta_type_0 import DomainContactResponseMetaType0 from .domain_data import DomainData +from .domain_detail import DomainDetail +from .domain_detail_response import DomainDetailResponse from .domain_dns_nameservers_change_request import DomainDnsNameserversChangeRequest from .domain_dns_nameservers_cloudflare_request import DomainDnsNameserversCloudflareRequest from .domain_dns_record_change_request import DomainDnsRecordChangeRequest @@ -166,18 +124,14 @@ from .domain_dns_record_request import DomainDnsRecordRequest from .domain_dns_record_request_caa_data import DomainDnsRecordRequestCaaData from .domain_dns_record_request_tlsa_data import DomainDnsRecordRequestTlsaData +from .domain_dns_record_request_type import DomainDnsRecordRequestType from .domain_dns_zone_request import DomainDnsZoneRequest +from .domain_dns_zone_request_zone_ttl import DomainDnsZoneRequestZoneTtl from .domain_dnssec import DomainDnssec from .domain_dnssec_can_activate import DomainDnssecCanActivate from .domain_dnssec_can_activate_response import DomainDnssecCanActivateResponse -from .domain_dnssec_can_activate_response_meta_type_0 import ( - DomainDnssecCanActivateResponseMetaType0, -) from .domain_dnssec_can_deactivate import DomainDnssecCanDeactivate from .domain_dnssec_can_deactivate_response import DomainDnssecCanDeactivateResponse -from .domain_dnssec_can_deactivate_response_meta_type_0 import ( - DomainDnssecCanDeactivateResponseMetaType0, -) from .domain_dnssec_request import DomainDnssecRequest from .domain_dnssec_request_ds_data_1 import DomainDnssecRequestDsData1 from .domain_dnssec_request_ds_data_1_digest_type import DomainDnssecRequestDsData1DigestType @@ -192,158 +146,131 @@ DomainDnssecRequestKeyData257ItemAlgorithm, ) from .domain_dnssec_response import DomainDnssecResponse -from .domain_dnssec_response_meta_type_0 import DomainDnssecResponseMetaType0 from .domain_name import DomainName +from .domain_nameserver import DomainNameserver from .domain_paginated_list_response import DomainPaginatedListResponse -from .domain_response import DomainResponse -from .domain_response_meta_type_0 import DomainResponseMetaType0 +from .domain_premium_prices import DomainPremiumPrices from .empty_response import EmptyResponse -from .empty_response_data_type_0 import EmptyResponseDataType0 -from .empty_response_meta_type_0 import EmptyResponseMetaType0 -from .get_hosting_antivirus_response_200 import GetHostingAntivirusResponse200 -from .get_hosting_antivirus_response_200_meta_type_0 import GetHostingAntivirusResponse200MetaType0 from .health_status import HealthStatus from .health_status_response import HealthStatusResponse -from .health_status_response_meta_type_0 import HealthStatusResponseMetaType0 from .hosting import Hosting from .hosting_antivirus import HostingAntivirus +from .hosting_antivirus_nullable_response import HostingAntivirusNullableResponse from .hosting_antivirus_removal_scan import HostingAntivirusRemovalScan from .hosting_antivirus_removal_scan_paginated_list_response import ( HostingAntivirusRemovalScanPaginatedListResponse, ) from .hosting_antivirus_removal_scan_response import HostingAntivirusRemovalScanResponse -from .hosting_antivirus_removal_scan_response_meta_type_0 import ( - HostingAntivirusRemovalScanResponseMetaType0, -) from .hosting_antivirus_scan import HostingAntivirusScan from .hosting_antivirus_scan_paginated_list_response import ( HostingAntivirusScanPaginatedListResponse, ) from .hosting_antivirus_scan_response import HostingAntivirusScanResponse -from .hosting_antivirus_scan_response_meta_type_0 import HostingAntivirusScanResponseMetaType0 from .hosting_backup import HostingBackup from .hosting_backup_expose_request import HostingBackupExposeRequest from .hosting_backup_list_response import HostingBackupListResponse -from .hosting_backup_list_response_meta_type_0 import HostingBackupListResponseMetaType0 from .hosting_backup_response import HostingBackupResponse -from .hosting_backup_response_meta_type_0 import HostingBackupResponseMetaType0 from .hosting_credential import HostingCredential from .hosting_credential_list_response import HostingCredentialListResponse -from .hosting_credential_list_response_meta_type_0 import HostingCredentialListResponseMetaType0 from .hosting_cronjob import HostingCronjob from .hosting_cronjob_create_request import HostingCronjobCreateRequest +from .hosting_cronjob_create_request_http_request_method import ( + HostingCronjobCreateRequestHttpRequestMethod, +) +from .hosting_cronjob_create_request_request_protocol import ( + HostingCronjobCreateRequestRequestProtocol, +) from .hosting_cronjob_paginated_list_response import HostingCronjobPaginatedListResponse from .hosting_cronjob_response import HostingCronjobResponse -from .hosting_cronjob_response_meta_type_0 import HostingCronjobResponseMetaType0 from .hosting_database import HostingDatabase -from .hosting_database_create_request import HostingDatabaseCreateRequest from .hosting_database_list_response import HostingDatabaseListResponse -from .hosting_database_list_response_meta_type_0 import HostingDatabaseListResponseMetaType0 from .hosting_database_response import HostingDatabaseResponse -from .hosting_database_response_meta_type_0 import HostingDatabaseResponseMetaType0 from .hosting_dns_record import HostingDnsRecord from .hosting_dns_record_list_response import HostingDnsRecordListResponse -from .hosting_dns_record_list_response_meta_type_0 import HostingDnsRecordListResponseMetaType0 from .hosting_email_alias import HostingEmailAlias from .hosting_email_alias_create_request import HostingEmailAliasCreateRequest from .hosting_email_alias_list_response import HostingEmailAliasListResponse -from .hosting_email_alias_list_response_meta_type_0 import HostingEmailAliasListResponseMetaType0 from .hosting_email_alias_response import HostingEmailAliasResponse -from .hosting_email_alias_response_meta_type_0 import HostingEmailAliasResponseMetaType0 from .hosting_email_allow_list import HostingEmailAllowList from .hosting_email_allow_list_paginated_list_response import ( HostingEmailAllowListPaginatedListResponse, ) from .hosting_email_allow_list_response import HostingEmailAllowListResponse -from .hosting_email_allow_list_response_meta_type_0 import HostingEmailAllowListResponseMetaType0 -from .hosting_email_bloc_list import HostingEmailBlocList -from .hosting_email_bloc_list_paginated_list_response import ( - HostingEmailBlocListPaginatedListResponse, +from .hosting_email_block_list import HostingEmailBlockList +from .hosting_email_block_list_paginated_list_response import ( + HostingEmailBlockListPaginatedListResponse, ) -from .hosting_email_bloc_list_response import HostingEmailBlocListResponse -from .hosting_email_bloc_list_response_meta_type_0 import HostingEmailBlocListResponseMetaType0 +from .hosting_email_block_list_response import HostingEmailBlockListResponse from .hosting_email_catch_all import HostingEmailCatchAll from .hosting_email_catch_all_request import HostingEmailCatchAllRequest from .hosting_email_catch_all_response import HostingEmailCatchAllResponse -from .hosting_email_catch_all_response_meta_type_0 import HostingEmailCatchAllResponseMetaType0 from .hosting_email_wblist_request import HostingEmailWblistRequest from .hosting_file_protection_update_request import HostingFileProtectionUpdateRequest from .hosting_http_version_update_request import HostingHttpVersionUpdateRequest +from .hosting_http_version_update_request_version import HostingHttpVersionUpdateRequestVersion from .hosting_mod_security import HostingModSecurity from .hosting_mod_security_response import HostingModSecurityResponse -from .hosting_mod_security_response_meta_type_0 import HostingModSecurityResponseMetaType0 from .hosting_mod_security_rule import HostingModSecurityRule from .hosting_mod_security_rule_bulk_request import HostingModSecurityRuleBulkRequest from .hosting_mod_security_rule_create_request import HostingModSecurityRuleCreateRequest from .hosting_mod_security_rule_list_response import HostingModSecurityRuleListResponse -from .hosting_mod_security_rule_list_response_meta_type_0 import ( - HostingModSecurityRuleListResponseMetaType0, -) from .hosting_mod_security_rule_response import HostingModSecurityRuleResponse -from .hosting_mod_security_rule_response_meta_type_0 import HostingModSecurityRuleResponseMetaType0 from .hosting_mod_security_scan import HostingModSecurityScan from .hosting_mod_security_scan_paginated_list_response import ( HostingModSecurityScanPaginatedListResponse, ) from .hosting_mod_security_scan_response import HostingModSecurityScanResponse -from .hosting_mod_security_scan_response_meta_type_0 import HostingModSecurityScanResponseMetaType0 from .hosting_mod_security_update_request import HostingModSecurityUpdateRequest from .hosting_paginated_list_response import HostingPaginatedListResponse +from .hosting_php_setting import HostingPhpSetting +from .hosting_php_setting_setting import HostingPhpSettingSetting from .hosting_php_settings_update_request import HostingPhpSettingsUpdateRequest +from .hosting_php_settings_update_request_setting import HostingPhpSettingsUpdateRequestSetting from .hosting_php_version import HostingPhpVersion from .hosting_php_version_list_response import HostingPhpVersionListResponse -from .hosting_php_version_list_response_meta_type_0 import HostingPhpVersionListResponseMetaType0 from .hosting_php_version_update_request import HostingPhpVersionUpdateRequest from .hosting_response import HostingResponse -from .hosting_response_meta_type_0 import HostingResponseMetaType0 from .hosting_ssl_certificate import HostingSslCertificate from .hosting_ssl_certificate_install_request import HostingSslCertificateInstallRequest -from .hosting_ssl_certificate_list_response import HostingSslCertificateListResponse -from .hosting_ssl_certificate_list_response_meta_type_0 import ( - HostingSslCertificateListResponseMetaType0, +from .hosting_ssl_certificate_install_request_cn_type import ( + HostingSslCertificateInstallRequestCnType, +) +from .hosting_ssl_certificate_install_request_destination_type import ( + HostingSslCertificateInstallRequestDestinationType, ) +from .hosting_ssl_certificate_list_response import HostingSslCertificateListResponse from .hosting_ssl_certificate_response import HostingSslCertificateResponse -from .hosting_ssl_certificate_response_meta_type_0 import HostingSslCertificateResponseMetaType0 from .hosting_subdomain_create_request import HostingSubdomainCreateRequest from .invoice import Invoice from .invoice_paginated_list_response import InvoicePaginatedListResponse from .invoice_response import InvoiceResponse -from .invoice_response_meta_type_0 import InvoiceResponseMetaType0 from .invoice_row import InvoiceRow from .invoice_row_list_response import InvoiceRowListResponse -from .invoice_row_list_response_meta_type_0 import InvoiceRowListResponseMetaType0 from .invoice_row_response import InvoiceRowResponse -from .invoice_row_response_meta_type_0 import InvoiceRowResponseMetaType0 from .ip_address import IpAddress from .ip_address_list_response import IpAddressListResponse -from .ip_address_list_response_meta_type_0 import IpAddressListResponseMetaType0 +from .ip_address_paginated_list_response import IpAddressPaginatedListResponse from .ip_address_response import IpAddressResponse -from .ip_address_response_meta_type_0 import IpAddressResponseMetaType0 from .jwk_key import JwkKey from .jwks_response import JwksResponse from .legal_entity import LegalEntity from .legal_entity_group import LegalEntityGroup +from .license_ import License +from .license_paginated_list_response import LicensePaginatedListResponse +from .license_response import LicenseResponse from .list_orders_type import ListOrdersType from .list_sms_sms_status import ListSmsSmsStatus from .microsoft_365 import Microsoft365 from .microsoft_365_domain_available import Microsoft365DomainAvailable from .microsoft_365_domain_available_response import Microsoft365DomainAvailableResponse -from .microsoft_365_domain_available_response_meta_type_0 import ( - Microsoft365DomainAvailableResponseMetaType0, -) from .microsoft_365_paginated_list_response import Microsoft365PaginatedListResponse from .microsoft_365_partner_link import Microsoft365PartnerLink from .microsoft_365_partner_link_response import Microsoft365PartnerLinkResponse -from .microsoft_365_partner_link_response_meta_type_0 import ( - Microsoft365PartnerLinkResponseMetaType0, -) from .microsoft_365_response import Microsoft365Response -from .microsoft_365_response_meta_type_0 import Microsoft365ResponseMetaType0 from .microsoft_365_subscription_quantity_request import Microsoft365SubscriptionQuantityRequest from .microsoft_365_tenant import Microsoft365Tenant from .microsoft_365_tenant_paginated_list_response import Microsoft365TenantPaginatedListResponse from .microsoft_365_tenant_response import Microsoft365TenantResponse -from .microsoft_365_tenant_response_meta_type_0 import Microsoft365TenantResponseMetaType0 from .o_auth_audience import OAuthAudience from .o_auth_error import OAuthError from .o_auth_token_response import OAuthTokenResponse @@ -352,9 +279,6 @@ from .object_storage_bucket_chart import ObjectStorageBucketChart from .object_storage_bucket_chart_points_item import ObjectStorageBucketChartPointsItem from .object_storage_bucket_chart_response import ObjectStorageBucketChartResponse -from .object_storage_bucket_chart_response_meta_type_0 import ( - ObjectStorageBucketChartResponseMetaType0, -) from .object_storage_bucket_firewall_entry import ObjectStorageBucketFirewallEntry from .object_storage_bucket_firewall_entry_create_request import ( ObjectStorageBucketFirewallEntryCreateRequest, @@ -363,105 +287,71 @@ ObjectStorageBucketFirewallEntryPaginatedListResponse, ) from .object_storage_bucket_firewall_entry_response import ObjectStorageBucketFirewallEntryResponse -from .object_storage_bucket_firewall_entry_response_meta_type_0 import ( - ObjectStorageBucketFirewallEntryResponseMetaType0, -) from .object_storage_bucket_paginated_list_response import ObjectStorageBucketPaginatedListResponse from .object_storage_bucket_response import ObjectStorageBucketResponse -from .object_storage_bucket_response_meta_type_0 import ObjectStorageBucketResponseMetaType0 from .object_storage_iam_user import ObjectStorageIamUser from .object_storage_iam_user_paginated_list_response import ( ObjectStorageIamUserPaginatedListResponse, ) from .object_storage_iam_user_response import ObjectStorageIamUserResponse -from .object_storage_iam_user_response_meta_type_0 import ObjectStorageIamUserResponseMetaType0 from .object_storage_iam_user_s3_key import ObjectStorageIamUserS3Key from .object_storage_iam_user_s3_key_list_response import ObjectStorageIamUserS3KeyListResponse -from .object_storage_iam_user_s3_key_list_response_meta_type_0 import ( - ObjectStorageIamUserS3KeyListResponseMetaType0, -) from .object_storage_iam_user_s3_key_response import ObjectStorageIamUserS3KeyResponse -from .object_storage_iam_user_s3_key_response_meta_type_0 import ( - ObjectStorageIamUserS3KeyResponseMetaType0, -) from .object_storage_paginated_list_response import ObjectStoragePaginatedListResponse from .object_storage_response import ObjectStorageResponse -from .object_storage_response_meta_type_0 import ObjectStorageResponseMetaType0 from .object_storage_s3_key import ObjectStorageS3Key from .object_storage_s3_key_response import ObjectStorageS3KeyResponse -from .object_storage_s3_key_response_meta_type_0 import ObjectStorageS3KeyResponseMetaType0 from .one_click import OneClick from .one_click_autorenew import OneClickAutorenew from .one_click_autorenew_response import OneClickAutorenewResponse -from .one_click_autorenew_response_meta_type_0 import OneClickAutorenewResponseMetaType0 from .one_click_paginated_list_response import OneClickPaginatedListResponse +from .one_click_payment_create_request import OneClickPaymentCreateRequest from .one_click_response import OneClickResponse -from .one_click_response_meta_type_0 import OneClickResponseMetaType0 from .order import Order from .order_can_cancel import OrderCanCancel from .order_can_cancel_response import OrderCanCancelResponse -from .order_can_cancel_response_meta_type_0 import OrderCanCancelResponseMetaType0 from .order_can_pay import OrderCanPay from .order_can_pay_response import OrderCanPayResponse -from .order_can_pay_response_meta_type_0 import OrderCanPayResponseMetaType0 from .order_invoice_status import OrderInvoiceStatus from .order_list_response import OrderListResponse -from .order_list_response_meta_type_0 import OrderListResponseMetaType0 from .order_paginated_list_response import OrderPaginatedListResponse -from .order_pay_request import OrderPayRequest from .order_payment_status import OrderPaymentStatus from .order_response import OrderResponse -from .order_response_meta_type_0 import OrderResponseMetaType0 from .order_row import OrderRow from .order_row_list_response import OrderRowListResponse -from .order_row_list_response_meta_type_0 import OrderRowListResponseMetaType0 from .order_row_response import OrderRowResponse -from .order_row_response_meta_type_0 import OrderRowResponseMetaType0 from .order_status import OrderStatus from .pagination_meta import PaginationMeta -from .pay_orders_response_200 import PayOrdersResponse200 -from .pay_orders_response_200_meta_type_0 import PayOrdersResponse200MetaType0 from .payment import Payment from .payment_paginated_list_response import PaymentPaginatedListResponse -from .payment_provider_data_type_0 import PaymentProviderDataType0 +from .payment_provider_data import PaymentProviderData from .payment_response import PaymentResponse -from .payment_response_meta_type_0 import PaymentResponseMetaType0 from .pec import Pec from .pec_domain import PecDomain from .pec_domain_paginated_list_response import PecDomainPaginatedListResponse from .pec_domain_response import PecDomainResponse -from .pec_domain_response_meta_type_0 import PecDomainResponseMetaType0 from .pec_mailbox_owner_change_create_request import PecMailboxOwnerChangeCreateRequest from .pec_mailbox_update_request import PecMailboxUpdateRequest from .pec_owner_change import PecOwnerChange from .pec_owner_change_paginated_list_response import PecOwnerChangePaginatedListResponse from .pec_owner_change_response import PecOwnerChangeResponse -from .pec_owner_change_response_meta_type_0 import PecOwnerChangeResponseMetaType0 from .pec_owner_summary import PecOwnerSummary from .pec_paginated_list_response import PecPaginatedListResponse from .pec_response import PecResponse -from .pec_response_meta_type_0 import PecResponseMetaType0 -from .plesk_license import PleskLicense -from .plesk_license_paginated_list_response import PleskLicensePaginatedListResponse -from .plesk_license_response import PleskLicenseResponse -from .plesk_license_response_meta_type_0 import PleskLicenseResponseMetaType0 from .prepaid_credit import PrepaidCredit from .prepaid_credit_operation import PrepaidCreditOperation from .prepaid_credit_operation_paginated_list_response import ( PrepaidCreditOperationPaginatedListResponse, ) from .prepaid_credit_operation_response import PrepaidCreditOperationResponse -from .prepaid_credit_operation_response_meta_type_0 import PrepaidCreditOperationResponseMetaType0 from .prepaid_credit_operation_type import PrepaidCreditOperationType +from .prepaid_credit_payment_create_request import PrepaidCreditPaymentCreateRequest from .prepaid_credit_response import PrepaidCreditResponse -from .prepaid_credit_response_meta_type_0 import PrepaidCreditResponseMetaType0 from .prepaid_credit_topup import PrepaidCreditTopup from .prepaid_credit_topup_paginated_list_response import PrepaidCreditTopupPaginatedListResponse from .prepaid_credit_topup_response import PrepaidCreditTopupResponse -from .prepaid_credit_topup_response_meta_type_0 import PrepaidCreditTopupResponseMetaType0 from .private_cloud import PrivateCloud from .private_cloud_response import PrivateCloudResponse -from .private_cloud_response_meta_type_0 import PrivateCloudResponseMetaType0 from .private_cloud_vm_create_request import PrivateCloudVmCreateRequest from .private_cloud_vm_update_request import PrivateCloudVmUpdateRequest from .promotion import Promotion @@ -469,30 +359,16 @@ from .purchase_billing_info_change_request import PurchaseBillingInfoChangeRequest from .purchase_can_add_additional import PurchaseCanAddAdditional from .purchase_can_add_additional_response import PurchaseCanAddAdditionalResponse -from .purchase_can_add_additional_response_meta_type_0 import ( - PurchaseCanAddAdditionalResponseMetaType0, -) from .purchase_can_cancel import PurchaseCanCancel from .purchase_can_cancel_response import PurchaseCanCancelResponse -from .purchase_can_cancel_response_meta_type_0 import PurchaseCanCancelResponseMetaType0 from .purchase_can_change_recurrence import PurchaseCanChangeRecurrence from .purchase_can_change_recurrence_response import PurchaseCanChangeRecurrenceResponse -from .purchase_can_change_recurrence_response_meta_type_0 import ( - PurchaseCanChangeRecurrenceResponseMetaType0, -) from .purchase_can_change_renew_status import PurchaseCanChangeRenewStatus from .purchase_can_change_renew_status_response import PurchaseCanChangeRenewStatusResponse -from .purchase_can_change_renew_status_response_meta_type_0 import ( - PurchaseCanChangeRenewStatusResponseMetaType0, -) from .purchase_can_change_service import PurchaseCanChangeService from .purchase_can_change_service_response import PurchaseCanChangeServiceResponse -from .purchase_can_change_service_response_meta_type_0 import ( - PurchaseCanChangeServiceResponseMetaType0, -) from .purchase_can_renew import PurchaseCanRenew from .purchase_can_renew_response import PurchaseCanRenewResponse -from .purchase_can_renew_response_meta_type_0 import PurchaseCanRenewResponseMetaType0 from .purchase_comment_change_request import PurchaseCommentChangeRequest from .purchase_name import PurchaseName from .purchase_paginated_list_response import PurchasePaginatedListResponse @@ -500,7 +376,6 @@ from .purchase_recurrence_change_request import PurchaseRecurrenceChangeRequest from .purchase_renew_status_change_request import PurchaseRenewStatusChangeRequest from .purchase_response import PurchaseResponse -from .purchase_response_meta_type_0 import PurchaseResponseMetaType0 from .purchase_status import PurchaseStatus from .recurrence import Recurrence from .recurrence_frequency import RecurrenceFrequency @@ -508,33 +383,18 @@ from .request_access_token_body_grant_type import RequestAccessTokenBodyGrantType from .sdi_document_status import SdiDocumentStatus from .sdi_document_type import SdiDocumentType -from .securemail import Securemail -from .securemail_mailbox import SecuremailMailbox -from .securemail_mailbox_paginated_list_response import SecuremailMailboxPaginatedListResponse -from .securemail_paginated_list_response import SecuremailPaginatedListResponse -from .securemail_quantity_request import SecuremailQuantityRequest -from .securemail_response import SecuremailResponse -from .securemail_response_meta_type_0 import SecuremailResponseMetaType0 -from .securemail_statistics import SecuremailStatistics -from .securemail_statistics_response import SecuremailStatisticsResponse -from .securemail_statistics_response_meta_type_0 import SecuremailStatisticsResponseMetaType0 from .server import Server from .server_automatic_snapshot import ServerAutomaticSnapshot from .server_automatic_snapshot_request import ServerAutomaticSnapshotRequest from .server_automatic_snapshot_response import ServerAutomaticSnapshotResponse -from .server_automatic_snapshot_response_meta_type_0 import ServerAutomaticSnapshotResponseMetaType0 from .server_backup import ServerBackup from .server_backup_exhibit_request import ServerBackupExhibitRequest from .server_backup_list_response import ServerBackupListResponse -from .server_backup_list_response_meta_type_0 import ServerBackupListResponseMetaType0 from .server_backup_response import ServerBackupResponse -from .server_backup_response_meta_type_0 import ServerBackupResponseMetaType0 from .server_can_action import ServerCanAction from .server_can_action_response import ServerCanActionResponse -from .server_can_action_response_meta_type_0 import ServerCanActionResponseMetaType0 from .server_credential import ServerCredential from .server_credential_response import ServerCredentialResponse -from .server_credential_response_meta_type_0 import ServerCredentialResponseMetaType0 from .server_ip_address_reverse_update_request import ServerIpAddressReverseUpdateRequest from .server_monitoring import ServerMonitoring from .server_monitoring_paginated_list_response import ServerMonitoringPaginatedListResponse @@ -542,39 +402,27 @@ from .server_monitoring_probe_chart import ServerMonitoringProbeChart from .server_monitoring_probe_chart_points_item import ServerMonitoringProbeChartPointsItem from .server_monitoring_probe_chart_response import ServerMonitoringProbeChartResponse -from .server_monitoring_probe_chart_response_meta_type_0 import ( - ServerMonitoringProbeChartResponseMetaType0, -) from .server_monitoring_probe_create_request import ServerMonitoringProbeCreateRequest from .server_monitoring_probe_create_request_parameters import ( ServerMonitoringProbeCreateRequestParameters, ) from .server_monitoring_probe_list_response import ServerMonitoringProbeListResponse -from .server_monitoring_probe_list_response_meta_type_0 import ( - ServerMonitoringProbeListResponseMetaType0, -) from .server_monitoring_probe_response import ServerMonitoringProbeResponse -from .server_monitoring_probe_response_meta_type_0 import ServerMonitoringProbeResponseMetaType0 from .server_monitoring_probe_update_request import ServerMonitoringProbeUpdateRequest from .server_monitoring_response import ServerMonitoringResponse -from .server_monitoring_response_meta_type_0 import ServerMonitoringResponseMetaType0 from .server_network_interface import ServerNetworkInterface from .server_network_interface_create_request import ServerNetworkInterfaceCreateRequest from .server_network_interface_list_response import ServerNetworkInterfaceListResponse -from .server_network_interface_list_response_meta_type_0 import ( - ServerNetworkInterfaceListResponseMetaType0, -) from .server_network_interface_response import ServerNetworkInterfaceResponse -from .server_network_interface_response_meta_type_0 import ServerNetworkInterfaceResponseMetaType0 from .server_os import ServerOs from .server_paginated_list_response import ServerPaginatedListResponse +from .server_power_action_request import ServerPowerActionRequest +from .server_power_action_request_action import ServerPowerActionRequestAction from .server_reinstall_request import ServerReinstallRequest from .server_response import ServerResponse -from .server_response_meta_type_0 import ServerResponseMetaType0 from .server_snapshot import ServerSnapshot from .server_snapshot_paginated_list_response import ServerSnapshotPaginatedListResponse from .server_snapshot_response import ServerSnapshotResponse -from .server_snapshot_response_meta_type_0 import ServerSnapshotResponseMetaType0 from .server_template import ServerTemplate from .service import Service from .service_category import ServiceCategory @@ -586,19 +434,15 @@ from .sms import Sms from .sms_account import SmsAccount from .sms_account_response import SmsAccountResponse -from .sms_account_response_meta_type_0 import SmsAccountResponseMetaType0 from .sms_can_cancel import SmsCanCancel from .sms_can_cancel_response import SmsCanCancelResponse -from .sms_can_cancel_response_meta_type_0 import SmsCanCancelResponseMetaType0 from .sms_can_delete import SmsCanDelete from .sms_can_delete_response import SmsCanDeleteResponse -from .sms_can_delete_response_meta_type_0 import SmsCanDeleteResponseMetaType0 from .sms_create_request import SmsCreateRequest from .sms_create_request_quality import SmsCreateRequestQuality from .sms_message import SmsMessage from .sms_message_paginated_list_response import SmsMessagePaginatedListResponse from .sms_message_response import SmsMessageResponse -from .sms_message_response_meta_type_0 import SmsMessageResponseMetaType0 from .sms_paginated_list_response import SmsPaginatedListResponse from .sms_phonebook import SmsPhonebook from .sms_phonebook_add_contacts_request import SmsPhonebookAddContactsRequest @@ -614,102 +458,73 @@ from .sms_phonebook_edit_request import SmsPhonebookEditRequest from .sms_phonebook_paginated_list_response import SmsPhonebookPaginatedListResponse from .sms_phonebook_response import SmsPhonebookResponse -from .sms_phonebook_response_meta_type_0 import SmsPhonebookResponseMetaType0 from .sms_price import SmsPrice from .sms_price_paginated_list_response import SmsPricePaginatedListResponse from .sms_price_response import SmsPriceResponse -from .sms_price_response_meta_type_0 import SmsPriceResponseMetaType0 from .sms_response import SmsResponse -from .sms_response_meta_type_0 import SmsResponseMetaType0 from .ssl_certificate import SslCertificate from .ssl_certificate_approver_emails import SslCertificateApproverEmails from .ssl_certificate_approver_emails_response import SslCertificateApproverEmailsResponse -from .ssl_certificate_approver_emails_response_meta_type_0 import ( - SslCertificateApproverEmailsResponseMetaType0, -) -from .ssl_certificate_can_reemit import SslCertificateCanReemit -from .ssl_certificate_can_reemit_response import SslCertificateCanReemitResponse -from .ssl_certificate_can_reemit_response_meta_type_0 import ( - SslCertificateCanReemitResponseMetaType0, -) +from .ssl_certificate_can_reissue import SslCertificateCanReissue +from .ssl_certificate_can_reissue_response import SslCertificateCanReissueResponse from .ssl_certificate_change_csr_request import SslCertificateChangeCsrRequest from .ssl_certificate_export import SslCertificateExport from .ssl_certificate_export_format import SslCertificateExportFormat from .ssl_certificate_export_format_list_response import SslCertificateExportFormatListResponse -from .ssl_certificate_export_format_list_response_meta_type_0 import ( - SslCertificateExportFormatListResponseMetaType0, -) +from .ssl_certificate_export_request import SslCertificateExportRequest +from .ssl_certificate_export_request_format import SslCertificateExportRequestFormat from .ssl_certificate_export_response import SslCertificateExportResponse -from .ssl_certificate_export_response_meta_type_0 import SslCertificateExportResponseMetaType0 from .ssl_certificate_key import SslCertificateKey from .ssl_certificate_key_response import SslCertificateKeyResponse -from .ssl_certificate_key_response_meta_type_0 import SslCertificateKeyResponseMetaType0 from .ssl_certificate_keys import SslCertificateKeys from .ssl_certificate_keys_response import SslCertificateKeysResponse -from .ssl_certificate_keys_response_meta_type_0 import SslCertificateKeysResponseMetaType0 from .ssl_certificate_owner_request import SslCertificateOwnerRequest from .ssl_certificate_paginated_list_response import SslCertificatePaginatedListResponse from .ssl_certificate_reemit_request import SslCertificateReemitRequest from .ssl_certificate_response import SslCertificateResponse -from .ssl_certificate_response_meta_type_0 import SslCertificateResponseMetaType0 from .sub_account_create_request import SubAccountCreateRequest from .sub_account_update_request import SubAccountUpdateRequest from .task import Task from .task_paginated_list_response import TaskPaginatedListResponse from .task_response import TaskResponse -from .task_response_meta_type_0 import TaskResponseMetaType0 from .task_status import TaskStatus from .tax_regime import TaxRegime from .tld import Tld from .tld_contact_specification import TldContactSpecification from .tld_paginated_list_response import TldPaginatedListResponse from .tld_response import TldResponse -from .tld_response_meta_type_0 import TldResponseMetaType0 from .upload_file_body import UploadFileBody from .web_monitoring import WebMonitoring from .web_monitoring_availability_chart import WebMonitoringAvailabilityChart from .web_monitoring_availability_chart_legend import WebMonitoringAvailabilityChartLegend from .web_monitoring_availability_chart_points_item import WebMonitoringAvailabilityChartPointsItem from .web_monitoring_availability_chart_response import WebMonitoringAvailabilityChartResponse -from .web_monitoring_availability_chart_response_meta_type_0 import ( - WebMonitoringAvailabilityChartResponseMetaType0, -) from .web_monitoring_download_speed_chart import WebMonitoringDownloadSpeedChart from .web_monitoring_download_speed_chart_points_item import ( WebMonitoringDownloadSpeedChartPointsItem, ) from .web_monitoring_download_speed_chart_response import WebMonitoringDownloadSpeedChartResponse -from .web_monitoring_download_speed_chart_response_meta_type_0 import ( - WebMonitoringDownloadSpeedChartResponseMetaType0, -) from .web_monitoring_notices import WebMonitoringNotices from .web_monitoring_notices_response import WebMonitoringNoticesResponse -from .web_monitoring_notices_response_meta_type_0 import WebMonitoringNoticesResponseMetaType0 from .web_monitoring_notices_update_request import WebMonitoringNoticesUpdateRequest from .web_monitoring_paginated_list_response import WebMonitoringPaginatedListResponse from .web_monitoring_response import WebMonitoringResponse -from .web_monitoring_response_meta_type_0 import WebMonitoringResponseMetaType0 from .web_monitoring_response_time_chart import WebMonitoringResponseTimeChart from .web_monitoring_response_time_chart_points_item import WebMonitoringResponseTimeChartPointsItem from .web_monitoring_response_time_chart_response import WebMonitoringResponseTimeChartResponse -from .web_monitoring_response_time_chart_response_meta_type_0 import ( - WebMonitoringResponseTimeChartResponseMetaType0, -) __all__ = ( "Account", "AccountBilling", "AccountPaginatedListResponse", "AccountResponse", - "AccountResponseMetaType0", "Amount", "AmountSimple", "ApiError", - "ApiErrorDataType0", "ApiErrorMetaType0", + "ApiErrorMetaType0Errors", "ApiUpload", "ApiUploadResponse", - "ApiUploadResponseMetaType0", "BillingData", "BuyPrepaidCreditTopupRequest", "BuyPrepaidCreditTopupRequestAmount", @@ -734,7 +549,6 @@ "BuyServiceMicrosoft365RequestDataTenantChoice", "BuyServiceObjectStorageRequest", "BuyServiceObjectStorageRequestConfiguration", - "BuyServiceObjectStorageRequestConfigurationTbSize", "BuyServicePecDomainRequest", "BuyServicePecDomainRequestData", "BuyServicePecDomainRequestDataLegalEntity", @@ -747,14 +561,6 @@ "BuyServicePrivateCloudSvRequest", "BuyServicePrivateCloudSvRequestData", "BuyServicePrivateCloudSvRequestDataADDITIONALBACKUPDISKSERVICEQUANTITY", - "BuyServiceSecuremailForGoogleWorkspaceRequest", - "BuyServiceSecuremailForGoogleWorkspaceRequestConfiguration", - "BuyServiceSecuremailForGoogleWorkspaceRequestData", - "BuyServiceSecuremailForMicrosoft365Request", - "BuyServiceSecuremailForMicrosoft365RequestConfiguration", - "BuyServiceSecuremailForMicrosoft365RequestData", - "BuyServiceSecuremailRequest", - "BuyServiceSecuremailRequestConfiguration", "BuyServiceSmsRequest", "BuyServiceSslCertificateRequest", "BuyServiceSslCertificateRequestData", @@ -767,60 +573,45 @@ "CloudStorageAccessCreateRequest", "CloudStorageAccessPaginatedListResponse", "CloudStorageAccessResponse", - "CloudStorageAccessResponseMetaType0", "CloudStoragePaginatedListResponse", "CloudStorageResponse", - "CloudStorageResponseMetaType0", "CloudStorageUser", "CloudStorageUserListResponse", - "CloudStorageUserListResponseMetaType0", "CloudStorageUserResponse", - "CloudStorageUserResponseMetaType0", "CloudStorageUserSizeUpdateRequest", "CompleteTaskDataBody", "CompleteTaskDataBodyData", "Country", - "CpanelLicense", - "CpanelLicensePaginatedListResponse", - "CpanelLicenseResponse", - "CpanelLicenseResponseMetaType0", "Creditnote", "CreditnotePaginatedListResponse", "CreditnoteResponse", - "CreditnoteResponseMetaType0", "CreditnoteRow", "CreditnoteRowListResponse", - "CreditnoteRowListResponseMetaType0", "CreditnoteRowResponse", - "CreditnoteRowResponseMetaType0", "DnsRecord", "DnsRecordCaaData", "DnsRecordPaginatedListResponse", "DnsRecordResponse", - "DnsRecordResponseMetaType0", "DnsRecordTlsaData", "DnsType", "DnsZone", "DnsZoneResponse", - "DnsZoneResponseMetaType0", "DnssecDsData", "DnssecKeyData", "Domain", "DomainAvailability", "DomainAvailabilityResponse", - "DomainAvailabilityResponseMetaType0", "DomainCanChangeNameservers", "DomainCanChangeNameserversResponse", - "DomainCanChangeNameserversResponseMetaType0", "DomainContact", "DomainContactData", "DomainContactListResponse", - "DomainContactListResponseMetaType0", "DomainContactRequest", "DomainContactRequestContactDataItem", "DomainContactResponse", - "DomainContactResponseMetaType0", "DomainData", + "DomainDetail", + "DomainDetailResponse", "DomainDnsNameserversChangeRequest", "DomainDnsNameserversCloudflareRequest", "DomainDnsRecordChangeRequest", @@ -829,14 +620,14 @@ "DomainDnsRecordRequest", "DomainDnsRecordRequestCaaData", "DomainDnsRecordRequestTlsaData", + "DomainDnsRecordRequestType", "DomainDnsZoneRequest", + "DomainDnsZoneRequestZoneTtl", "DomainDnssec", "DomainDnssecCanActivate", "DomainDnssecCanActivateResponse", - "DomainDnssecCanActivateResponseMetaType0", "DomainDnssecCanDeactivate", "DomainDnssecCanDeactivateResponse", - "DomainDnssecCanDeactivateResponseMetaType0", "DomainDnssecRequest", "DomainDnssecRequestDsData1", "DomainDnssecRequestDsData1DigestType", @@ -847,138 +638,113 @@ "DomainDnssecRequestKeyData257Item", "DomainDnssecRequestKeyData257ItemAlgorithm", "DomainDnssecResponse", - "DomainDnssecResponseMetaType0", "DomainName", + "DomainNameserver", "DomainPaginatedListResponse", - "DomainResponse", - "DomainResponseMetaType0", + "DomainPremiumPrices", "EmptyResponse", - "EmptyResponseDataType0", - "EmptyResponseMetaType0", - "GetHostingAntivirusResponse200", - "GetHostingAntivirusResponse200MetaType0", "HealthStatus", "HealthStatusResponse", - "HealthStatusResponseMetaType0", "Hosting", "HostingAntivirus", + "HostingAntivirusNullableResponse", "HostingAntivirusRemovalScan", "HostingAntivirusRemovalScanPaginatedListResponse", "HostingAntivirusRemovalScanResponse", - "HostingAntivirusRemovalScanResponseMetaType0", "HostingAntivirusScan", "HostingAntivirusScanPaginatedListResponse", "HostingAntivirusScanResponse", - "HostingAntivirusScanResponseMetaType0", "HostingBackup", "HostingBackupExposeRequest", "HostingBackupListResponse", - "HostingBackupListResponseMetaType0", "HostingBackupResponse", - "HostingBackupResponseMetaType0", "HostingCredential", "HostingCredentialListResponse", - "HostingCredentialListResponseMetaType0", "HostingCronjob", "HostingCronjobCreateRequest", + "HostingCronjobCreateRequestHttpRequestMethod", + "HostingCronjobCreateRequestRequestProtocol", "HostingCronjobPaginatedListResponse", "HostingCronjobResponse", - "HostingCronjobResponseMetaType0", "HostingDatabase", - "HostingDatabaseCreateRequest", "HostingDatabaseListResponse", - "HostingDatabaseListResponseMetaType0", "HostingDatabaseResponse", - "HostingDatabaseResponseMetaType0", "HostingDnsRecord", "HostingDnsRecordListResponse", - "HostingDnsRecordListResponseMetaType0", "HostingEmailAlias", "HostingEmailAliasCreateRequest", "HostingEmailAliasListResponse", - "HostingEmailAliasListResponseMetaType0", "HostingEmailAliasResponse", - "HostingEmailAliasResponseMetaType0", "HostingEmailAllowList", "HostingEmailAllowListPaginatedListResponse", "HostingEmailAllowListResponse", - "HostingEmailAllowListResponseMetaType0", - "HostingEmailBlocList", - "HostingEmailBlocListPaginatedListResponse", - "HostingEmailBlocListResponse", - "HostingEmailBlocListResponseMetaType0", + "HostingEmailBlockList", + "HostingEmailBlockListPaginatedListResponse", + "HostingEmailBlockListResponse", "HostingEmailCatchAll", "HostingEmailCatchAllRequest", "HostingEmailCatchAllResponse", - "HostingEmailCatchAllResponseMetaType0", "HostingEmailWblistRequest", "HostingFileProtectionUpdateRequest", "HostingHttpVersionUpdateRequest", + "HostingHttpVersionUpdateRequestVersion", "HostingModSecurity", "HostingModSecurityResponse", - "HostingModSecurityResponseMetaType0", "HostingModSecurityRule", "HostingModSecurityRuleBulkRequest", "HostingModSecurityRuleCreateRequest", "HostingModSecurityRuleListResponse", - "HostingModSecurityRuleListResponseMetaType0", "HostingModSecurityRuleResponse", - "HostingModSecurityRuleResponseMetaType0", "HostingModSecurityScan", "HostingModSecurityScanPaginatedListResponse", "HostingModSecurityScanResponse", - "HostingModSecurityScanResponseMetaType0", "HostingModSecurityUpdateRequest", "HostingPaginatedListResponse", + "HostingPhpSetting", + "HostingPhpSettingSetting", "HostingPhpSettingsUpdateRequest", + "HostingPhpSettingsUpdateRequestSetting", "HostingPhpVersion", "HostingPhpVersionListResponse", - "HostingPhpVersionListResponseMetaType0", "HostingPhpVersionUpdateRequest", "HostingResponse", - "HostingResponseMetaType0", "HostingSslCertificate", "HostingSslCertificateInstallRequest", + "HostingSslCertificateInstallRequestCnType", + "HostingSslCertificateInstallRequestDestinationType", "HostingSslCertificateListResponse", - "HostingSslCertificateListResponseMetaType0", "HostingSslCertificateResponse", - "HostingSslCertificateResponseMetaType0", "HostingSubdomainCreateRequest", "Invoice", "InvoicePaginatedListResponse", "InvoiceResponse", - "InvoiceResponseMetaType0", "InvoiceRow", "InvoiceRowListResponse", - "InvoiceRowListResponseMetaType0", "InvoiceRowResponse", - "InvoiceRowResponseMetaType0", "IpAddress", "IpAddressListResponse", - "IpAddressListResponseMetaType0", + "IpAddressPaginatedListResponse", "IpAddressResponse", - "IpAddressResponseMetaType0", "JwkKey", "JwksResponse", "LegalEntity", "LegalEntityGroup", + "License", + "LicensePaginatedListResponse", + "LicenseResponse", "ListOrdersType", "ListSmsSmsStatus", "Microsoft365", "Microsoft365DomainAvailable", "Microsoft365DomainAvailableResponse", - "Microsoft365DomainAvailableResponseMetaType0", "Microsoft365PaginatedListResponse", "Microsoft365PartnerLink", "Microsoft365PartnerLinkResponse", - "Microsoft365PartnerLinkResponseMetaType0", "Microsoft365Response", - "Microsoft365ResponseMetaType0", "Microsoft365SubscriptionQuantityRequest", "Microsoft365Tenant", "Microsoft365TenantPaginatedListResponse", "Microsoft365TenantResponse", - "Microsoft365TenantResponseMetaType0", "OAuthAudience", "OAuthError", "OAuthTokenResponse", @@ -987,100 +753,71 @@ "ObjectStorageBucketChart", "ObjectStorageBucketChartPointsItem", "ObjectStorageBucketChartResponse", - "ObjectStorageBucketChartResponseMetaType0", "ObjectStorageBucketFirewallEntry", "ObjectStorageBucketFirewallEntryCreateRequest", "ObjectStorageBucketFirewallEntryPaginatedListResponse", "ObjectStorageBucketFirewallEntryResponse", - "ObjectStorageBucketFirewallEntryResponseMetaType0", "ObjectStorageBucketPaginatedListResponse", "ObjectStorageBucketResponse", - "ObjectStorageBucketResponseMetaType0", "ObjectStorageIamUser", "ObjectStorageIamUserPaginatedListResponse", "ObjectStorageIamUserResponse", - "ObjectStorageIamUserResponseMetaType0", "ObjectStorageIamUserS3Key", "ObjectStorageIamUserS3KeyListResponse", - "ObjectStorageIamUserS3KeyListResponseMetaType0", "ObjectStorageIamUserS3KeyResponse", - "ObjectStorageIamUserS3KeyResponseMetaType0", "ObjectStoragePaginatedListResponse", "ObjectStorageResponse", - "ObjectStorageResponseMetaType0", "ObjectStorageS3Key", "ObjectStorageS3KeyResponse", - "ObjectStorageS3KeyResponseMetaType0", "OneClick", "OneClickAutorenew", "OneClickAutorenewResponse", - "OneClickAutorenewResponseMetaType0", "OneClickPaginatedListResponse", + "OneClickPaymentCreateRequest", "OneClickResponse", - "OneClickResponseMetaType0", "Order", "OrderCanCancel", "OrderCanCancelResponse", - "OrderCanCancelResponseMetaType0", "OrderCanPay", "OrderCanPayResponse", - "OrderCanPayResponseMetaType0", "OrderInvoiceStatus", "OrderListResponse", - "OrderListResponseMetaType0", "OrderPaginatedListResponse", - "OrderPayRequest", "OrderPaymentStatus", "OrderResponse", - "OrderResponseMetaType0", "OrderRow", "OrderRowListResponse", - "OrderRowListResponseMetaType0", "OrderRowResponse", - "OrderRowResponseMetaType0", "OrderStatus", "PaginationMeta", - "PayOrdersResponse200", - "PayOrdersResponse200MetaType0", "Payment", "PaymentPaginatedListResponse", - "PaymentProviderDataType0", + "PaymentProviderData", "PaymentResponse", - "PaymentResponseMetaType0", "Pec", "PecDomain", "PecDomainPaginatedListResponse", "PecDomainResponse", - "PecDomainResponseMetaType0", "PecMailboxOwnerChangeCreateRequest", "PecMailboxUpdateRequest", "PecOwnerChange", "PecOwnerChangePaginatedListResponse", "PecOwnerChangeResponse", - "PecOwnerChangeResponseMetaType0", "PecOwnerSummary", "PecPaginatedListResponse", "PecResponse", - "PecResponseMetaType0", - "PleskLicense", - "PleskLicensePaginatedListResponse", - "PleskLicenseResponse", - "PleskLicenseResponseMetaType0", "PrepaidCredit", "PrepaidCreditOperation", "PrepaidCreditOperationPaginatedListResponse", "PrepaidCreditOperationResponse", - "PrepaidCreditOperationResponseMetaType0", "PrepaidCreditOperationType", + "PrepaidCreditPaymentCreateRequest", "PrepaidCreditResponse", - "PrepaidCreditResponseMetaType0", "PrepaidCreditTopup", "PrepaidCreditTopupPaginatedListResponse", "PrepaidCreditTopupResponse", - "PrepaidCreditTopupResponseMetaType0", "PrivateCloud", "PrivateCloudResponse", - "PrivateCloudResponseMetaType0", "PrivateCloudVmCreateRequest", "PrivateCloudVmUpdateRequest", "Promotion", @@ -1088,22 +825,16 @@ "PurchaseBillingInfoChangeRequest", "PurchaseCanAddAdditional", "PurchaseCanAddAdditionalResponse", - "PurchaseCanAddAdditionalResponseMetaType0", "PurchaseCanCancel", "PurchaseCanCancelResponse", - "PurchaseCanCancelResponseMetaType0", "PurchaseCanChangeRecurrence", "PurchaseCanChangeRecurrenceResponse", - "PurchaseCanChangeRecurrenceResponseMetaType0", "PurchaseCanChangeRenewStatus", "PurchaseCanChangeRenewStatusResponse", - "PurchaseCanChangeRenewStatusResponseMetaType0", "PurchaseCanChangeService", "PurchaseCanChangeServiceResponse", - "PurchaseCanChangeServiceResponseMetaType0", "PurchaseCanRenew", "PurchaseCanRenewResponse", - "PurchaseCanRenewResponseMetaType0", "PurchaseCommentChangeRequest", "PurchaseName", "PurchasePaginatedListResponse", @@ -1111,7 +842,6 @@ "PurchaseRecurrenceChangeRequest", "PurchaseRenewStatusChangeRequest", "PurchaseResponse", - "PurchaseResponseMetaType0", "PurchaseStatus", "Recurrence", "RecurrenceFrequency", @@ -1119,33 +849,18 @@ "RequestAccessTokenBodyGrantType", "SdiDocumentStatus", "SdiDocumentType", - "Securemail", - "SecuremailMailbox", - "SecuremailMailboxPaginatedListResponse", - "SecuremailPaginatedListResponse", - "SecuremailQuantityRequest", - "SecuremailResponse", - "SecuremailResponseMetaType0", - "SecuremailStatistics", - "SecuremailStatisticsResponse", - "SecuremailStatisticsResponseMetaType0", "Server", "ServerAutomaticSnapshot", "ServerAutomaticSnapshotRequest", "ServerAutomaticSnapshotResponse", - "ServerAutomaticSnapshotResponseMetaType0", "ServerBackup", "ServerBackupExhibitRequest", "ServerBackupListResponse", - "ServerBackupListResponseMetaType0", "ServerBackupResponse", - "ServerBackupResponseMetaType0", "ServerCanAction", "ServerCanActionResponse", - "ServerCanActionResponseMetaType0", "ServerCredential", "ServerCredentialResponse", - "ServerCredentialResponseMetaType0", "ServerIpAddressReverseUpdateRequest", "ServerMonitoring", "ServerMonitoringPaginatedListResponse", @@ -1153,31 +868,25 @@ "ServerMonitoringProbeChart", "ServerMonitoringProbeChartPointsItem", "ServerMonitoringProbeChartResponse", - "ServerMonitoringProbeChartResponseMetaType0", "ServerMonitoringProbeCreateRequest", "ServerMonitoringProbeCreateRequestParameters", "ServerMonitoringProbeListResponse", - "ServerMonitoringProbeListResponseMetaType0", "ServerMonitoringProbeResponse", - "ServerMonitoringProbeResponseMetaType0", "ServerMonitoringProbeUpdateRequest", "ServerMonitoringResponse", - "ServerMonitoringResponseMetaType0", "ServerNetworkInterface", "ServerNetworkInterfaceCreateRequest", "ServerNetworkInterfaceListResponse", - "ServerNetworkInterfaceListResponseMetaType0", "ServerNetworkInterfaceResponse", - "ServerNetworkInterfaceResponseMetaType0", "ServerOs", "ServerPaginatedListResponse", + "ServerPowerActionRequest", + "ServerPowerActionRequestAction", "ServerReinstallRequest", "ServerResponse", - "ServerResponseMetaType0", "ServerSnapshot", "ServerSnapshotPaginatedListResponse", "ServerSnapshotResponse", - "ServerSnapshotResponseMetaType0", "ServerTemplate", "Service", "ServiceCategory", @@ -1189,19 +898,15 @@ "Sms", "SmsAccount", "SmsAccountResponse", - "SmsAccountResponseMetaType0", "SmsCanCancel", "SmsCanCancelResponse", - "SmsCanCancelResponseMetaType0", "SmsCanDelete", "SmsCanDeleteResponse", - "SmsCanDeleteResponseMetaType0", "SmsCreateRequest", "SmsCreateRequestQuality", "SmsMessage", "SmsMessagePaginatedListResponse", "SmsMessageResponse", - "SmsMessageResponseMetaType0", "SmsPaginatedListResponse", "SmsPhonebook", "SmsPhonebookAddContactsRequest", @@ -1213,71 +918,56 @@ "SmsPhonebookEditRequest", "SmsPhonebookPaginatedListResponse", "SmsPhonebookResponse", - "SmsPhonebookResponseMetaType0", "SmsPrice", "SmsPricePaginatedListResponse", "SmsPriceResponse", - "SmsPriceResponseMetaType0", "SmsResponse", - "SmsResponseMetaType0", "SslCertificate", "SslCertificateApproverEmails", "SslCertificateApproverEmailsResponse", - "SslCertificateApproverEmailsResponseMetaType0", - "SslCertificateCanReemit", - "SslCertificateCanReemitResponse", - "SslCertificateCanReemitResponseMetaType0", + "SslCertificateCanReissue", + "SslCertificateCanReissueResponse", "SslCertificateChangeCsrRequest", "SslCertificateExport", "SslCertificateExportFormat", "SslCertificateExportFormatListResponse", - "SslCertificateExportFormatListResponseMetaType0", + "SslCertificateExportRequest", + "SslCertificateExportRequestFormat", "SslCertificateExportResponse", - "SslCertificateExportResponseMetaType0", "SslCertificateKey", "SslCertificateKeyResponse", - "SslCertificateKeyResponseMetaType0", "SslCertificateKeys", "SslCertificateKeysResponse", - "SslCertificateKeysResponseMetaType0", "SslCertificateOwnerRequest", "SslCertificatePaginatedListResponse", "SslCertificateReemitRequest", "SslCertificateResponse", - "SslCertificateResponseMetaType0", "SubAccountCreateRequest", "SubAccountUpdateRequest", "Task", "TaskPaginatedListResponse", "TaskResponse", - "TaskResponseMetaType0", "TaskStatus", "TaxRegime", "Tld", "TldContactSpecification", "TldPaginatedListResponse", "TldResponse", - "TldResponseMetaType0", "UploadFileBody", "WebMonitoring", "WebMonitoringAvailabilityChart", "WebMonitoringAvailabilityChartLegend", "WebMonitoringAvailabilityChartPointsItem", "WebMonitoringAvailabilityChartResponse", - "WebMonitoringAvailabilityChartResponseMetaType0", "WebMonitoringDownloadSpeedChart", "WebMonitoringDownloadSpeedChartPointsItem", "WebMonitoringDownloadSpeedChartResponse", - "WebMonitoringDownloadSpeedChartResponseMetaType0", "WebMonitoringNotices", "WebMonitoringNoticesResponse", - "WebMonitoringNoticesResponseMetaType0", "WebMonitoringNoticesUpdateRequest", "WebMonitoringPaginatedListResponse", "WebMonitoringResponse", - "WebMonitoringResponseMetaType0", "WebMonitoringResponseTimeChart", "WebMonitoringResponseTimeChartPointsItem", "WebMonitoringResponseTimeChartResponse", - "WebMonitoringResponseTimeChartResponseMetaType0", ) diff --git a/src/shellrent_sdk/client/models/account.py b/src/shellrent_sdk/client/models/account.py index 9f9dc3d..6a20a25 100644 --- a/src/shellrent_sdk/client/models/account.py +++ b/src/shellrent_sdk/client/models/account.py @@ -16,17 +16,29 @@ @_attrs_define class Account: + """User account, with the data of its administrative contact: without one, these data are null and the country is Italy""" + account_id: int - username: str + username: None | str + """ Username assigned to the account when it is created, used to log in """ username_alias: None | str - account_name: str + """ Alternative username chosen for the account, also valid to log in; null when not set """ + account_name: None | str + """ Display name of the account: first name and surname of the administrative contact, or its organization, or + the username; empty when the account has no administrative contact """ name: None | str + """ First name of the administrative contact """ surname: None | str + """ Surname of the administrative contact """ email: None | str phone: None | str + """ Phone of the administrative contact, usually in the form `0039.0123456789`: `00` and the international + prefix, a dot, the number """ address: None | str city: None | str state: None | str + """ Province of the administrative contact: the acronym of the Italian province, for example `VI`, or `EE` + outside Italy """ postal_code: None | str country: Country date_created: datetime.datetime @@ -35,11 +47,13 @@ class Account: def to_dict(self) -> dict[str, Any]: account_id = self.account_id + username: None | str username = self.username username_alias: None | str username_alias = self.username_alias + account_name: None | str account_name = self.account_name name: None | str @@ -100,7 +114,12 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) account_id = d.pop("account_id") - username = d.pop("username") + def _parse_username(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + username = _parse_username(d.pop("username")) def _parse_username_alias(data: object) -> None | str: if data is None: @@ -109,7 +128,12 @@ def _parse_username_alias(data: object) -> None | str: username_alias = _parse_username_alias(d.pop("username_alias")) - account_name = d.pop("account_name") + def _parse_account_name(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + account_name = _parse_account_name(d.pop("account_name")) def _parse_name(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/account_billing.py b/src/shellrent_sdk/client/models/account_billing.py index d4ab105..0884173 100644 --- a/src/shellrent_sdk/client/models/account_billing.py +++ b/src/shellrent_sdk/client/models/account_billing.py @@ -18,30 +18,56 @@ @_attrs_define class AccountBilling: + """Billing profile: the holder the documents are made out to, with its tax and electronic invoicing data""" + account_billing_id: int legal_entity: LegalEntity + """ Legal form of the holder of a billing profile, with its group """ tax_regime: TaxRegime + """ Tax regime: how VAT applies to the documents """ organization: None | str name: None | str surname: None | str address: str city: str state: str + """ Province: the acronym of the Italian province, for example `VI`, or `EE` outside Italy """ postal_code: str country: Country gender: None | str + """ Gender of the holder: `M` or `F`; null when not given """ birth_date: datetime.date | None + """ Date of birth of the holder; null when not given """ birth_place: None | str - phone: str + """ Place of birth of the holder; null when not given """ + phone: None | str + """ Phone, usually in the form `0039.0123456789`: `00` and the international prefix, a dot, the number; null + when not given """ vat_number: None | str + """ VAT number of the holder (`partita IVA` in Italy); null when it has none """ is_vat_group: bool + """ Whether the holder belongs to an Italian VAT group (`Gruppo IVA`), whose members share the VAT number and + have each their own tax code """ fiscal_code: str + """ Tax code of the holder (`codice fiscale` in Italy) """ edocument_pec: None | str + """ PEC address (certified email, `Posta Elettronica Certificata`) to which SDI, the Italian e-invoicing + exchange system, delivers the electronic invoices when there is no recipient code; null when not given """ edocument_code: None | str + """ Recipient code (`Codice Destinatario`) with which SDI, the Italian e-invoicing exchange system, delivers the + electronic invoices: 7 characters, 6 for the public administration; null when not given """ exporter_expiry: datetime.date | None + """ Expiry date of the declaration of intent (`dichiarazione d'intento`) of a habitual exporter, whose invoices + are without VAT; null when not given """ exporter_number: None | str + """ Protocol number of the declaration of intent of a habitual exporter, written on the electronic invoices; + null when not given """ exporter_date: datetime.date | None + """ Date of the electronic receipt of the declaration of intent, issued by the Italian Revenue Agency (`Agenzia + delle Entrate`); null when not given """ is_split_payment: bool + """ Whether split payment (`scissione dei pagamenti`) applies: the tax regime is `SPLIT_PAYMENT`, and the + customer pays the VAT of the invoices directly to the Italian State """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -82,6 +108,7 @@ def to_dict(self) -> dict[str, Any]: birth_place: None | str birth_place = self.birth_place + phone: None | str phone = self.phone vat_number: None | str @@ -220,7 +247,12 @@ def _parse_birth_place(data: object) -> None | str: birth_place = _parse_birth_place(d.pop("birth_place")) - phone = d.pop("phone") + def _parse_phone(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + phone = _parse_phone(d.pop("phone")) def _parse_vat_number(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/account_paginated_list_response.py b/src/shellrent_sdk/client/models/account_paginated_list_response.py index 381ed46..79855e3 100644 --- a/src/shellrent_sdk/client/models/account_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/account_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class AccountPaginatedListResponse: - error: int + """Successful response with a page of `Account`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[Account] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.pagination_meta import PaginationMeta d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/account_response.py b/src/shellrent_sdk/client/models/account_response.py index 1349e31..95cae81 100644 --- a/src/shellrent_sdk/client/models/account_response.py +++ b/src/shellrent_sdk/client/models/account_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.account import Account - from ..models.account_response_meta_type_0 import AccountResponseMetaType0 T = TypeVar("T", bound="AccountResponse") @@ -16,15 +15,20 @@ @_attrs_define class AccountResponse: - error: int + """Successful response with one `Account`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: Account - meta: AccountResponseMetaType0 | None + """ User account, with the data of its administrative contact: without one, these data are null and the country + is Italy """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.account_response_meta_type_0 import AccountResponseMetaType0 - error = self.error message: None | str @@ -32,11 +36,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, AccountResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,10 +54,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.account import Account - from ..models.account_response_meta_type_0 import AccountResponseMetaType0 d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -68,20 +69,7 @@ def _parse_message(data: object) -> None | str: data = Account.from_dict(d.pop("data")) - def _parse_meta(data: object) -> AccountResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = AccountResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(AccountResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") account_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/account_response_meta_type_0.py b/src/shellrent_sdk/client/models/account_response_meta_type_0.py deleted file mode 100644 index bc26c3f..0000000 --- a/src/shellrent_sdk/client/models/account_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="AccountResponseMetaType0") - - -@_attrs_define -class AccountResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - account_response_meta_type_0 = cls() - - account_response_meta_type_0.additional_properties = d - return account_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/amount.py b/src/shellrent_sdk/client/models/amount.py index 5c2f05d..23d3021 100644 --- a/src/shellrent_sdk/client/models/amount.py +++ b/src/shellrent_sdk/client/models/amount.py @@ -11,12 +11,17 @@ @_attrs_define class Amount: + """Amount in euros: the taxable amount and, when computed with a tax regime, the VAT rate, the VAT and the total, which + are null otherwise + + """ + amount: float | None """ Taxable amount """ currency: str - """ Currency (EUR, USD, GBP, ...) """ + """ Currency code: always `EUR` """ tax_rate: float | None - """ VAT rate in cents (iva/vat) """ + """ VAT rate as a fraction, for example `0.22` for 22% """ tax: float | None """ VAT (tax) amount """ total: float | None diff --git a/src/shellrent_sdk/client/models/amount_simple.py b/src/shellrent_sdk/client/models/amount_simple.py index 1903a1c..af7767b 100644 --- a/src/shellrent_sdk/client/models/amount_simple.py +++ b/src/shellrent_sdk/client/models/amount_simple.py @@ -11,8 +11,12 @@ @_attrs_define class AmountSimple: + """Amount in euros, without the VAT details of `Amount`""" + amount: float + """ Amount, in euros """ currency: str + """ Currency code: always `EUR` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/api_error.py b/src/shellrent_sdk/client/models/api_error.py index 0127bbb..fa78ef1 100644 --- a/src/shellrent_sdk/client/models/api_error.py +++ b/src/shellrent_sdk/client/models/api_error.py @@ -7,7 +7,6 @@ from attrs import field as _attrs_field if TYPE_CHECKING: - from ..models.api_error_data_type_0 import ApiErrorDataType0 from ..models.api_error_meta_type_0 import ApiErrorMetaType0 @@ -16,28 +15,37 @@ @_attrs_define class ApiError: + """Error response: the code in `error`, the description in `message`, the errors for each field in `meta` for + validation errors + + """ + error: int - """ Codice d'errore maggiore di zero """ + """ Error code: 1000 validation failed (details in `meta.errors`), 1001 bad request, 1100 access token missing, + invalid, expired or revoked (HTTP 401: request a new token and retry once), 1101 insufficient scope (HTTP 403: + the token lacks a scope listed in the `WWW-Authenticate` header), 1102 the access token audience is not valid + for this API (HTTP 403), 1200 not found, 1201 not implemented, 1202 method not allowed, 1300 rate limited, 1400 + conflict with a business rule or with the state of the resource, 1500 server error, 1601 forbidden (for example + a feature not included in the plan, an operation not available to sub-accounts, the internal API without + administrator privileges, or a request from an IP address not allowed for the account), 1700 payment declined by + the payment provider (HTTP 402: the orders are still to be paid), 1 other errors. Do not retry 403 responses + with a new token: the result does not change. """ message: str - data: ApiErrorDataType0 | None - """ Null nelle risposte d'errore """ + """ Description of the error, for the developers of the client """ + data: Any + """ Always null in error responses """ meta: ApiErrorMetaType0 | None - """ Null nelle risposte d'errore """ + """ Null, except in validation errors (HTTP 400 with error 1000), where it contains `errors` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.api_error_data_type_0 import ApiErrorDataType0 from ..models.api_error_meta_type_0 import ApiErrorMetaType0 error = self.error message = self.message - data: dict[str, Any] | None - if isinstance(self.data, ApiErrorDataType0): - data = self.data.to_dict() - else: - data = self.data + data = self.data meta: dict[str, Any] | None if isinstance(self.meta, ApiErrorMetaType0): @@ -60,7 +68,6 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.api_error_data_type_0 import ApiErrorDataType0 from ..models.api_error_meta_type_0 import ApiErrorMetaType0 d = dict(src_dict) @@ -68,20 +75,7 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: message = d.pop("message") - def _parse_data(data: object) -> ApiErrorDataType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - data_type_0 = ApiErrorDataType0.from_dict(data) - - return data_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(ApiErrorDataType0 | None, data) - - data = _parse_data(d.pop("data")) + data = d.pop("data") def _parse_meta(data: object) -> ApiErrorMetaType0 | None: if data is None: diff --git a/src/shellrent_sdk/client/models/api_error_data_type_0.py b/src/shellrent_sdk/client/models/api_error_data_type_0.py deleted file mode 100644 index 1eea53e..0000000 --- a/src/shellrent_sdk/client/models/api_error_data_type_0.py +++ /dev/null @@ -1,47 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ApiErrorDataType0") - - -@_attrs_define -class ApiErrorDataType0: - """Null nelle risposte d'errore""" - - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - api_error_data_type_0 = cls() - - api_error_data_type_0.additional_properties = d - return api_error_data_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/api_error_meta_type_0.py b/src/shellrent_sdk/client/models/api_error_meta_type_0.py index 8a68d8b..761aadd 100644 --- a/src/shellrent_sdk/client/models/api_error_meta_type_0.py +++ b/src/shellrent_sdk/client/models/api_error_meta_type_0.py @@ -1,31 +1,56 @@ from __future__ import annotations from collections.abc import Mapping -from typing import Any, Self, TypeVar +from typing import TYPE_CHECKING, Any, Self, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.api_error_meta_type_0_errors import ApiErrorMetaType0Errors + + T = TypeVar("T", bound="ApiErrorMetaType0") @_attrs_define class ApiErrorMetaType0: - """Null nelle risposte d'errore""" + """Null, except in validation errors (HTTP 400 with error 1000), where it contains `errors`""" + errors: ApiErrorMetaType0Errors | Unset = UNSET + """ Errors for each field: path of the field (e.g. cpu, configuration.ram, ids[3]) => messages """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + errors: dict[str, Any] | Unset = UNSET + if not isinstance(self.errors, Unset): + errors = self.errors.to_dict() field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) + field_dict.update({}) + if errors is not UNSET: + field_dict["errors"] = errors return field_dict @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.api_error_meta_type_0_errors import ApiErrorMetaType0Errors + d = dict(src_dict) - api_error_meta_type_0 = cls() + _errors = d.pop("errors", UNSET) + errors: ApiErrorMetaType0Errors | Unset + if isinstance(_errors, Unset): + errors = UNSET + else: + errors = ApiErrorMetaType0Errors.from_dict(_errors) + + api_error_meta_type_0 = cls( + errors=errors, + ) api_error_meta_type_0.additional_properties = d return api_error_meta_type_0 diff --git a/src/shellrent_sdk/client/models/api_error_meta_type_0_errors.py b/src/shellrent_sdk/client/models/api_error_meta_type_0_errors.py new file mode 100644 index 0000000..06c440e --- /dev/null +++ b/src/shellrent_sdk/client/models/api_error_meta_type_0_errors.py @@ -0,0 +1,54 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Self, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ApiErrorMetaType0Errors") + + +@_attrs_define +class ApiErrorMetaType0Errors: + """Errors for each field: path of the field (e.g. cpu, configuration.ram, ids[3]) => messages""" + + additional_properties: dict[str, list[str]] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + api_error_meta_type_0_errors = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + additional_property = cast(list[str], prop_dict) + + additional_properties[prop_name] = additional_property + + api_error_meta_type_0_errors.additional_properties = additional_properties + return api_error_meta_type_0_errors + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> list[str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: list[str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/api_upload.py b/src/shellrent_sdk/client/models/api_upload.py index ed4641f..8259be3 100644 --- a/src/shellrent_sdk/client/models/api_upload.py +++ b/src/shellrent_sdk/client/models/api_upload.py @@ -7,24 +7,35 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset - T = TypeVar("T", bound="ApiUpload") @_attrs_define class ApiUpload: + """File uploaded with `POST /api/v3/uploads`, to reference by its `upload_id` in the calls that take a document, such + as the PEC transfer documents + + """ + upload_id: int + mimetype: None | str + """ MIME type associated with the extension of the file, for example `application/pdf` """ filename: str + """ Name given to the file by the service when storing it """ original_filename: None | str + """ Name of the file as uploaded by the client """ file_extension: None | str - upload_date: datetime.date - mimetype: str | Unset = UNSET + """ Extension of the file name, in lowercase, for example `pdf` """ + upload_date: datetime.datetime + """ Date and time of the upload """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: upload_id = self.upload_id + mimetype: None | str + mimetype = self.mimetype + filename = self.filename original_filename: None | str @@ -35,21 +46,18 @@ def to_dict(self) -> dict[str, Any]: upload_date = self.upload_date.isoformat() - mimetype = self.mimetype - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( { "upload_id": upload_id, + "mimetype": mimetype, "filename": filename, "original_filename": original_filename, "file_extension": file_extension, "upload_date": upload_date, } ) - if mimetype is not UNSET: - field_dict["mimetype"] = mimetype return field_dict @@ -58,6 +66,13 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) upload_id = d.pop("upload_id") + def _parse_mimetype(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + mimetype = _parse_mimetype(d.pop("mimetype")) + filename = d.pop("filename") def _parse_original_filename(data: object) -> None | str: @@ -74,17 +89,15 @@ def _parse_file_extension(data: object) -> None | str: file_extension = _parse_file_extension(d.pop("file_extension")) - upload_date = datetime.date.fromisoformat(d.pop("upload_date")) - - mimetype = d.pop("mimetype", UNSET) + upload_date = datetime.datetime.fromisoformat(d.pop("upload_date")) api_upload = cls( upload_id=upload_id, + mimetype=mimetype, filename=filename, original_filename=original_filename, file_extension=file_extension, upload_date=upload_date, - mimetype=mimetype, ) api_upload.additional_properties = d diff --git a/src/shellrent_sdk/client/models/api_upload_response.py b/src/shellrent_sdk/client/models/api_upload_response.py index 97a4988..fbde2c4 100644 --- a/src/shellrent_sdk/client/models/api_upload_response.py +++ b/src/shellrent_sdk/client/models/api_upload_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.api_upload import ApiUpload - from ..models.api_upload_response_meta_type_0 import ApiUploadResponseMetaType0 T = TypeVar("T", bound="ApiUploadResponse") @@ -16,15 +15,20 @@ @_attrs_define class ApiUploadResponse: - error: int + """Successful response with one `ApiUpload`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: ApiUpload - meta: ApiUploadResponseMetaType0 | None + """ File uploaded with `POST /api/v3/uploads`, to reference by its `upload_id` in the calls that take a + document, such as the PEC transfer documents """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.api_upload_response_meta_type_0 import ApiUploadResponseMetaType0 - error = self.error message: None | str @@ -32,11 +36,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, ApiUploadResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,12 +54,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.api_upload import ApiUpload - from ..models.api_upload_response_meta_type_0 import ( - ApiUploadResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -70,20 +69,7 @@ def _parse_message(data: object) -> None | str: data = ApiUpload.from_dict(d.pop("data")) - def _parse_meta(data: object) -> ApiUploadResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = ApiUploadResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(ApiUploadResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") api_upload_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/api_upload_response_meta_type_0.py b/src/shellrent_sdk/client/models/api_upload_response_meta_type_0.py deleted file mode 100644 index e1bd083..0000000 --- a/src/shellrent_sdk/client/models/api_upload_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ApiUploadResponseMetaType0") - - -@_attrs_define -class ApiUploadResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - api_upload_response_meta_type_0 = cls() - - api_upload_response_meta_type_0.additional_properties = d - return api_upload_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/billing_data.py b/src/shellrent_sdk/client/models/billing_data.py index 9a76c4e..de4a16f 100644 --- a/src/shellrent_sdk/client/models/billing_data.py +++ b/src/shellrent_sdk/client/models/billing_data.py @@ -11,9 +11,14 @@ @_attrs_define class BillingData: + """Italian public administration codes of a document row: CIG, CUP and ODA""" + cig_value: None | str + """ CIG (`Codice Identificativo Gara`), the Italian code of the public tender; null when not given """ cup_value: None | str + """ CUP (`Codice Unico di Progetto`), the Italian code of the public investment project; null when not given """ oda_value: None | str + """ ODA (`Ordine di Acquisto`), the code of the purchase order; null when not given """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/buy_prepaid_credit_topup_request.py b/src/shellrent_sdk/client/models/buy_prepaid_credit_topup_request.py index 9316ff8..a0694f6 100644 --- a/src/shellrent_sdk/client/models/buy_prepaid_credit_topup_request.py +++ b/src/shellrent_sdk/client/models/buy_prepaid_credit_topup_request.py @@ -4,7 +4,6 @@ from typing import Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..models.buy_prepaid_credit_topup_request_amount import BuyPrepaidCreditTopupRequestAmount @@ -14,14 +13,14 @@ @_attrs_define class BuyPrepaidCreditTopupRequest: amount: BuyPrepaidCreditTopupRequestAmount - """ Topup amount. """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + """ Amount of the top-up in euros, before VAT: the order adds the VAT, and the credit loaded is the total with + VAT """ def to_dict(self) -> dict[str, Any]: amount = self.amount.value field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "amount": amount, @@ -39,21 +38,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: amount=amount, ) - buy_prepaid_credit_topup_request.additional_properties = d return buy_prepaid_credit_topup_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/buy_service_active_monitoring_request.py b/src/shellrent_sdk/client/models/buy_service_active_monitoring_request.py index 6bbf05c..4224a44 100644 --- a/src/shellrent_sdk/client/models/buy_service_active_monitoring_request.py +++ b/src/shellrent_sdk/client/models/buy_service_active_monitoring_request.py @@ -4,7 +4,6 @@ from typing import TYPE_CHECKING, Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -25,7 +24,6 @@ class BuyServiceActiveMonitoringRequest: """ ID of the account of the user that will be the owner of the purchase (available to Resellers only) """ data: BuyServiceActiveMonitoringRequestData | Unset = UNSET """ Target to monitor with the Active Monitoring service """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: service_id = self.service_id @@ -37,7 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "service_id": service_id, @@ -74,21 +72,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: data=data, ) - buy_service_active_monitoring_request.additional_properties = d return buy_service_active_monitoring_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/buy_service_cloud_storage_request.py b/src/shellrent_sdk/client/models/buy_service_cloud_storage_request.py index e6409a1..0a521df 100644 --- a/src/shellrent_sdk/client/models/buy_service_cloud_storage_request.py +++ b/src/shellrent_sdk/client/models/buy_service_cloud_storage_request.py @@ -4,7 +4,6 @@ from typing import Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -16,10 +15,11 @@ class BuyServiceCloudStorageRequest: service_id: int """ ID of the Service to buy """ recurrence_id: int | Unset = UNSET - """ ID of the Recurrence to assign to the purchased service """ + """ ID of the billing recurrence of the purchased service: one of the `recurrences_available` of the chosen + service, as listed by `GET /api/v3/shop/cloud-storage`. If omitted, the default recurrence of the service + (`recurrence`) is used. """ account_id: int | Unset = UNSET """ ID of the account of the user that will be the owner of the purchase (available to Resellers only) """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: service_id = self.service_id @@ -29,7 +29,7 @@ def to_dict(self) -> dict[str, Any]: account_id = self.account_id field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "service_id": service_id, @@ -57,21 +57,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: account_id=account_id, ) - buy_service_cloud_storage_request.additional_properties = d return buy_service_cloud_storage_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/buy_service_cloud_vps_request.py b/src/shellrent_sdk/client/models/buy_service_cloud_vps_request.py index 1153a66..16c3994 100644 --- a/src/shellrent_sdk/client/models/buy_service_cloud_vps_request.py +++ b/src/shellrent_sdk/client/models/buy_service_cloud_vps_request.py @@ -4,14 +4,11 @@ from typing import TYPE_CHECKING, Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset if TYPE_CHECKING: - from ..models.buy_service_dedicated_server_request_data import ( - BuyServiceDedicatedServerRequestData, - ) + from ..models.buy_service_cloud_vps_request_data import BuyServiceCloudVpsRequestData T = TypeVar("T", bound="BuyServiceCloudVpsRequest") @@ -21,13 +18,14 @@ class BuyServiceCloudVpsRequest: service_id: int """ ID of the Service to buy """ - data: BuyServiceDedicatedServerRequestData + data: BuyServiceCloudVpsRequestData """ Cloud VPS configuration details """ recurrence_id: int | Unset = UNSET - """ ID of the Recurrence to assign to the purchased service """ + """ ID of the billing recurrence of the purchased service: one of the `recurrences_available` of the chosen + service, as listed by `GET /api/v3/shop/cloud-vps`. If omitted, the default recurrence of the service + (`recurrence`) is used. """ account_id: int | Unset = UNSET """ ID of the account of the user that will be the owner of the purchase (available to Resellers only) """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: service_id = self.service_id @@ -39,7 +37,7 @@ def to_dict(self) -> dict[str, Any]: account_id = self.account_id field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "service_id": service_id, @@ -55,14 +53,14 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.buy_service_dedicated_server_request_data import ( - BuyServiceDedicatedServerRequestData, + from ..models.buy_service_cloud_vps_request_data import ( + BuyServiceCloudVpsRequestData, ) d = dict(src_dict) service_id = d.pop("service_id") - data = BuyServiceDedicatedServerRequestData.from_dict(d.pop("data")) + data = BuyServiceCloudVpsRequestData.from_dict(d.pop("data")) recurrence_id = d.pop("recurrence_id", UNSET) @@ -75,21 +73,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: account_id=account_id, ) - buy_service_cloud_vps_request.additional_properties = d return buy_service_cloud_vps_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/buy_service_cpanel_license_request.py b/src/shellrent_sdk/client/models/buy_service_cpanel_license_request.py index f0d5da9..eb6fc18 100644 --- a/src/shellrent_sdk/client/models/buy_service_cpanel_license_request.py +++ b/src/shellrent_sdk/client/models/buy_service_cpanel_license_request.py @@ -4,12 +4,11 @@ from typing import TYPE_CHECKING, Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset if TYPE_CHECKING: - from ..models.buy_service_plesk_license_request_data import BuyServicePleskLicenseRequestData + from ..models.buy_service_cpanel_license_request_data import BuyServiceCpanelLicenseRequestData T = TypeVar("T", bound="BuyServiceCpanelLicenseRequest") @@ -19,11 +18,10 @@ class BuyServiceCpanelLicenseRequest: service_id: int """ ID of the Service to buy """ - data: BuyServicePleskLicenseRequestData + data: BuyServiceCpanelLicenseRequestData """ Details about where to install the license """ account_id: int | Unset = UNSET """ ID of the account of the user that will be the owner of the purchase (available to Resellers only) """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: service_id = self.service_id @@ -33,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: account_id = self.account_id field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "service_id": service_id, @@ -47,14 +45,14 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.buy_service_plesk_license_request_data import ( - BuyServicePleskLicenseRequestData, + from ..models.buy_service_cpanel_license_request_data import ( + BuyServiceCpanelLicenseRequestData, ) d = dict(src_dict) service_id = d.pop("service_id") - data = BuyServicePleskLicenseRequestData.from_dict(d.pop("data")) + data = BuyServiceCpanelLicenseRequestData.from_dict(d.pop("data")) account_id = d.pop("account_id", UNSET) @@ -64,21 +62,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: account_id=account_id, ) - buy_service_cpanel_license_request.additional_properties = d return buy_service_cpanel_license_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/buy_service_cpanel_license_request_data.py b/src/shellrent_sdk/client/models/buy_service_cpanel_license_request_data.py index 9585496..fed4d71 100644 --- a/src/shellrent_sdk/client/models/buy_service_cpanel_license_request_data.py +++ b/src/shellrent_sdk/client/models/buy_service_cpanel_license_request_data.py @@ -17,19 +17,18 @@ class BuyServiceCpanelLicenseRequestData: """Details about where to install the license""" - installation_type: BuyServiceCpanelLicenseRequestDataInstallationType | Unset = UNSET + installation_type: BuyServiceCpanelLicenseRequestDataInstallationType """ Choose to install the license on an active server or on external IP address """ purchase_server: int | Unset = UNSET - """ ID of the server where the license will be installed to. Required only if "installation_type" has value + """ Id of the purchase of the server where the license will be installed (`purchase_id` of `GET + /api/v3/servers/{server_id}`), not the id of the server. Required only if "installation_type" has value "internal_installation_type" """ ip_address: str | Unset = UNSET """ IP address of the external host where the license will be installed to. Required only if "installation_type" has value "external_installation_type" """ def to_dict(self) -> dict[str, Any]: - installation_type: str | Unset = UNSET - if not isinstance(self.installation_type, Unset): - installation_type = self.installation_type.value + installation_type = self.installation_type.value purchase_server = self.purchase_server @@ -37,9 +36,11 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - field_dict.update({}) - if installation_type is not UNSET: - field_dict["installation_type"] = installation_type + field_dict.update( + { + "installation_type": installation_type, + } + ) if purchase_server is not UNSET: field_dict["purchase_server"] = purchase_server if ip_address is not UNSET: @@ -50,14 +51,9 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) - _installation_type = d.pop("installation_type", UNSET) - installation_type: BuyServiceCpanelLicenseRequestDataInstallationType | Unset - if isinstance(_installation_type, Unset): - installation_type = UNSET - else: - installation_type = BuyServiceCpanelLicenseRequestDataInstallationType( - _installation_type - ) + installation_type = BuyServiceCpanelLicenseRequestDataInstallationType( + d.pop("installation_type") + ) purchase_server = d.pop("purchase_server", UNSET) diff --git a/src/shellrent_sdk/client/models/buy_service_dedicated_server_request.py b/src/shellrent_sdk/client/models/buy_service_dedicated_server_request.py index 99f4f28..405e839 100644 --- a/src/shellrent_sdk/client/models/buy_service_dedicated_server_request.py +++ b/src/shellrent_sdk/client/models/buy_service_dedicated_server_request.py @@ -4,7 +4,6 @@ from typing import TYPE_CHECKING, Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -24,10 +23,11 @@ class BuyServiceDedicatedServerRequest: data: BuyServiceDedicatedServerRequestData """ Dedicated Server configuration and template selection """ recurrence_id: int | Unset = UNSET - """ ID of the Recurrence to assign to the purchased service """ + """ ID of the billing recurrence of the purchased service: one of the `recurrences_available` of the chosen + service, as listed by `GET /api/v3/shop/dedicated-server`. If omitted, the default recurrence of the service + (`recurrence`) is used. """ account_id: int | Unset = UNSET """ ID of the account of the user that will be the owner of the purchase (available to Resellers only) """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: service_id = self.service_id @@ -39,7 +39,7 @@ def to_dict(self) -> dict[str, Any]: account_id = self.account_id field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "service_id": service_id, @@ -75,21 +75,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: account_id=account_id, ) - buy_service_dedicated_server_request.additional_properties = d return buy_service_dedicated_server_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/buy_service_domain_request.py b/src/shellrent_sdk/client/models/buy_service_domain_request.py index 799adce..4df075a 100644 --- a/src/shellrent_sdk/client/models/buy_service_domain_request.py +++ b/src/shellrent_sdk/client/models/buy_service_domain_request.py @@ -4,7 +4,6 @@ from typing import TYPE_CHECKING, Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -23,9 +22,9 @@ class BuyServiceDomainRequest: configuration: BuyServiceDomainRequestConfiguration """ Domain purchase configuration options """ data: BuyServiceDomainRequestData + """ Registration data of the domain: the contacts that its TLD requires and, for a transfer, the authcode """ account_id: int | Unset = UNSET """ ID of the account of the user that will be the owner of the purchase (available to Resellers only) """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: configuration = self.configuration.to_dict() @@ -35,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: account_id = self.account_id field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "configuration": configuration, @@ -69,21 +68,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: account_id=account_id, ) - buy_service_domain_request.additional_properties = d return buy_service_domain_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/buy_service_domain_request_configuration.py b/src/shellrent_sdk/client/models/buy_service_domain_request_configuration.py index f52791e..b2becfa 100644 --- a/src/shellrent_sdk/client/models/buy_service_domain_request_configuration.py +++ b/src/shellrent_sdk/client/models/buy_service_domain_request_configuration.py @@ -5,8 +5,6 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset - T = TypeVar("T", bound="BuyServiceDomainRequestConfiguration") @@ -14,9 +12,9 @@ class BuyServiceDomainRequestConfiguration: """Domain purchase configuration options""" - domain_name: str | Unset = UNSET + domain_name: str """ Domain complete name (with TLD extension), for example: "example.com" or "example.co.uk" """ - extension: str | Unset = UNSET + extension: str """ TLD extension of the domain, for example: "com" or "co.uk" """ def to_dict(self) -> dict[str, Any]: @@ -26,20 +24,21 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - field_dict.update({}) - if domain_name is not UNSET: - field_dict["domain_name"] = domain_name - if extension is not UNSET: - field_dict["extension"] = extension + field_dict.update( + { + "domain_name": domain_name, + "extension": extension, + } + ) return field_dict @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) - domain_name = d.pop("domain_name", UNSET) + domain_name = d.pop("domain_name") - extension = d.pop("extension", UNSET) + extension = d.pop("extension") buy_service_domain_request_configuration = cls( domain_name=domain_name, diff --git a/src/shellrent_sdk/client/models/buy_service_domain_request_data.py b/src/shellrent_sdk/client/models/buy_service_domain_request_data.py index 9132843..08d57c4 100644 --- a/src/shellrent_sdk/client/models/buy_service_domain_request_data.py +++ b/src/shellrent_sdk/client/models/buy_service_domain_request_data.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Self, TypeVar from attrs import define as _attrs_define @@ -18,19 +18,17 @@ @_attrs_define class BuyServiceDomainRequestData: + """Registration data of the domain: the contacts that its TLD requires and, for a transfer, the authcode""" + contact_data: BuyServiceDomainRequestDataContactData """ Domain contact data. Values depend on the TLD requirements. """ - domain_authcode: None | str | Unset = UNSET + domain_authcode: str | Unset = UNSET """ Domain auth-info code (authcode). Required if the domain must be transferred. """ def to_dict(self) -> dict[str, Any]: contact_data = self.contact_data.to_dict() - domain_authcode: None | str | Unset - if isinstance(self.domain_authcode, Unset): - domain_authcode = UNSET - else: - domain_authcode = self.domain_authcode + domain_authcode = self.domain_authcode field_dict: dict[str, Any] = {} @@ -53,14 +51,7 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) contact_data = BuyServiceDomainRequestDataContactData.from_dict(d.pop("contact_data")) - def _parse_domain_authcode(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - domain_authcode = _parse_domain_authcode(d.pop("domain_authcode", UNSET)) + domain_authcode = d.pop("domain_authcode", UNSET) buy_service_domain_request_data = cls( contact_data=contact_data, diff --git a/src/shellrent_sdk/client/models/buy_service_microsoft_365_request.py b/src/shellrent_sdk/client/models/buy_service_microsoft_365_request.py index 17b4259..461fbad 100644 --- a/src/shellrent_sdk/client/models/buy_service_microsoft_365_request.py +++ b/src/shellrent_sdk/client/models/buy_service_microsoft_365_request.py @@ -4,7 +4,6 @@ from typing import TYPE_CHECKING, Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -20,12 +19,17 @@ class BuyServiceMicrosoft365Request: service_id: int """ ID of the Service to buy """ data: BuyServiceMicrosoft365RequestData - """ Information about the Microsoft 365 tenant to associate to the subscription """ - quantity: int | Unset = 1 - """ Number of seats """ + """ Microsoft 365 tenant of the subscription. All the data is checked before the order is created: with "select" + the tenant must be one of the account (409 if it already has 2 active subscriptions of the same service); with + "transfer" and "new" no tenant can have the domain prefix already, and at Microsoft the ".onmicrosoft.com" + domain must exist ("transfer") or be available ("new"), otherwise 409. Send only the fields of the chosen + option. """ + quantity: int | Unset = UNSET + """ Number of seats (user licenses) to purchase. It must be between `quantity_min` and `quantity_max` of the + chosen service, as listed by `GET /api/v3/shop/microsoft-365/services`. If omitted, `quantity_min` is used. + Ignored for the services without `quantity_max`. """ account_id: int | Unset = UNSET """ ID of the account of the user that will be the owner of the purchase (available to Resellers only) """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: service_id = self.service_id @@ -37,7 +41,7 @@ def to_dict(self) -> dict[str, Any]: account_id = self.account_id field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "service_id": service_id, @@ -73,21 +77,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: account_id=account_id, ) - buy_service_microsoft_365_request.additional_properties = d return buy_service_microsoft_365_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/buy_service_microsoft_365_request_data.py b/src/shellrent_sdk/client/models/buy_service_microsoft_365_request_data.py index 14a5774..d7de878 100644 --- a/src/shellrent_sdk/client/models/buy_service_microsoft_365_request_data.py +++ b/src/shellrent_sdk/client/models/buy_service_microsoft_365_request_data.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import Any, Self, TypeVar, cast +from typing import Any, Self, TypeVar from attrs import define as _attrs_define @@ -18,120 +18,84 @@ @_attrs_define class BuyServiceMicrosoft365RequestData: - """Information about the Microsoft 365 tenant to associate to the subscription""" + """Microsoft 365 tenant of the subscription. All the data is checked before the order is created: with "select" the + tenant must be one of the account (409 if it already has 2 active subscriptions of the same service); with + "transfer" and "new" no tenant can have the domain prefix already, and at Microsoft the ".onmicrosoft.com" domain + must exist ("transfer") or be available ("new"), otherwise 409. Send only the fields of the chosen option. + + """ tenant_choice: BuyServiceMicrosoft365RequestDataTenantChoice """ Select whether to choose an existing tenant ("select"), transfer one ("transfer") or create a new tenant ("new"). When transferring a tenant, approve the Microsoft Partner Relationship before sending API requests """ - tenant_select: int | None | Unset = UNSET - """ Tenant ID to which to assign the subscription when selecting an existing tenant """ - domain_prefix: None | str | Unset = UNSET - """ Prefix of the ".onmicrosoft.com" tenant domain when creating or transferring a tenant """ - first_name: None | str | Unset = UNSET - """ Contact first name for the tenant when not selecting an existing tenant """ - last_name: None | str | Unset = UNSET - """ Contact last name for the tenant when not selecting an existing tenant """ - company_name: None | str | Unset = UNSET - """ Company name for the tenant when not selecting an existing tenant """ - address: None | str | Unset = UNSET - """ Address for the tenant when not selecting an existing tenant """ - city: None | str | Unset = UNSET - """ City for the tenant when not selecting an existing tenant """ - state: None | str | Unset = UNSET - """ State/Province for the tenant address when not selecting an existing tenant """ - postal_code: None | str | Unset = UNSET - """ Postal code for the tenant address when not selecting an existing tenant """ - country: None | str | Unset = UNSET - """ ISO country code with 2 letters (e.g. "IT" or "ES") when not selecting an existing tenant """ - email_address: None | str | Unset = UNSET - """ Administrative email address for the tenant when not selecting an existing tenant """ - phone_prefix: None | str | Unset = UNSET - """ Country code phone prefix with leading "+" sign when not selecting an existing tenant """ - phone_number: None | str | Unset = UNSET - """ Phone number for the tenant contact when not selecting an existing tenant """ + tenant_select: int | Unset = UNSET + """ ID of the tenant to which to assign the subscription, as listed by `GET /api/v3/shop/microsoft-365/tenants`. + Required with "select", not allowed otherwise """ + domain_prefix: str | Unset = UNSET + """ Prefix of the ".onmicrosoft.com" tenant domain: lowercase letters and digits, at most 27 characters. + Required with "transfer" and "new", not allowed otherwise """ + first_name: str | Unset = UNSET + """ Contact first name for the tenant: letters, spaces and hyphens. Required with "transfer" and "new", not + allowed otherwise """ + last_name: str | Unset = UNSET + """ Contact last name for the tenant: letters, spaces and hyphens. Required with "transfer" and "new", not + allowed otherwise """ + company_name: str | Unset = UNSET + """ Company name for the tenant: letters, digits and spaces. Required with "transfer" and "new", not allowed + otherwise """ + address: str | Unset = UNSET + """ Address for the tenant. Required with "transfer" and "new", not allowed otherwise """ + city: str | Unset = UNSET + """ City for the tenant address: letters, spaces and hyphens. Required with "transfer" and "new", not allowed + otherwise """ + state: str | Unset = UNSET + """ State/Province for the tenant address: letters, spaces and hyphens. Required with "transfer" and "new", not + allowed otherwise """ + postal_code: str | Unset = UNSET + """ Postal code for the tenant address: letters, digits and spaces. Required with "transfer" and "new", not + allowed otherwise """ + country: str | Unset = UNSET + """ ISO country code with 2 letters (e.g. "IT" or "ES"). Required with "transfer" and "new", not allowed + otherwise """ + email_address: str | Unset = UNSET + """ Administrative email address for the tenant. Required with "transfer" and "new", not allowed otherwise """ + phone_prefix: str | Unset = UNSET + """ International phone prefix of a country, with the leading "+" sign (e.g. "+44" for UK or "+39" for Italy). + Required with "transfer" and "new", not allowed otherwise """ + phone_number: str | Unset = UNSET + """ Phone number for the tenant contact: from 3 to 25 digits, spaces, dots, hyphens and parentheses. Required + with "transfer" and "new", not allowed otherwise """ locale: BuyServiceMicrosoft365RequestDataLocale | Unset = UNSET - """ Locale to use for the tenant when not selecting an existing tenant """ + """ Locale to use for the tenant. Required with "transfer" and "new", not allowed otherwise """ def to_dict(self) -> dict[str, Any]: tenant_choice = self.tenant_choice.value - tenant_select: int | None | Unset - if isinstance(self.tenant_select, Unset): - tenant_select = UNSET - else: - tenant_select = self.tenant_select + tenant_select = self.tenant_select - domain_prefix: None | str | Unset - if isinstance(self.domain_prefix, Unset): - domain_prefix = UNSET - else: - domain_prefix = self.domain_prefix + domain_prefix = self.domain_prefix - first_name: None | str | Unset - if isinstance(self.first_name, Unset): - first_name = UNSET - else: - first_name = self.first_name + first_name = self.first_name - last_name: None | str | Unset - if isinstance(self.last_name, Unset): - last_name = UNSET - else: - last_name = self.last_name + last_name = self.last_name - company_name: None | str | Unset - if isinstance(self.company_name, Unset): - company_name = UNSET - else: - company_name = self.company_name + company_name = self.company_name - address: None | str | Unset - if isinstance(self.address, Unset): - address = UNSET - else: - address = self.address + address = self.address - city: None | str | Unset - if isinstance(self.city, Unset): - city = UNSET - else: - city = self.city + city = self.city - state: None | str | Unset - if isinstance(self.state, Unset): - state = UNSET - else: - state = self.state + state = self.state - postal_code: None | str | Unset - if isinstance(self.postal_code, Unset): - postal_code = UNSET - else: - postal_code = self.postal_code + postal_code = self.postal_code - country: None | str | Unset - if isinstance(self.country, Unset): - country = UNSET - else: - country = self.country + country = self.country - email_address: None | str | Unset - if isinstance(self.email_address, Unset): - email_address = UNSET - else: - email_address = self.email_address + email_address = self.email_address - phone_prefix: None | str | Unset - if isinstance(self.phone_prefix, Unset): - phone_prefix = UNSET - else: - phone_prefix = self.phone_prefix + phone_prefix = self.phone_prefix - phone_number: None | str | Unset - if isinstance(self.phone_number, Unset): - phone_number = UNSET - else: - phone_number = self.phone_number + phone_number = self.phone_number locale: str | Unset = UNSET if not isinstance(self.locale, Unset): @@ -180,122 +144,31 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) tenant_choice = BuyServiceMicrosoft365RequestDataTenantChoice(d.pop("tenant_choice")) - def _parse_tenant_select(data: object) -> int | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(int | None | Unset, data) - - tenant_select = _parse_tenant_select(d.pop("tenant_select", UNSET)) - - def _parse_domain_prefix(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - domain_prefix = _parse_domain_prefix(d.pop("domain_prefix", UNSET)) - - def _parse_first_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - first_name = _parse_first_name(d.pop("first_name", UNSET)) - - def _parse_last_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - last_name = _parse_last_name(d.pop("last_name", UNSET)) - - def _parse_company_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - company_name = _parse_company_name(d.pop("company_name", UNSET)) - - def _parse_address(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - address = _parse_address(d.pop("address", UNSET)) - - def _parse_city(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - city = _parse_city(d.pop("city", UNSET)) - - def _parse_state(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - state = _parse_state(d.pop("state", UNSET)) - - def _parse_postal_code(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - postal_code = _parse_postal_code(d.pop("postal_code", UNSET)) - - def _parse_country(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - country = _parse_country(d.pop("country", UNSET)) - - def _parse_email_address(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - email_address = _parse_email_address(d.pop("email_address", UNSET)) - - def _parse_phone_prefix(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - phone_prefix = _parse_phone_prefix(d.pop("phone_prefix", UNSET)) - - def _parse_phone_number(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - phone_number = _parse_phone_number(d.pop("phone_number", UNSET)) + tenant_select = d.pop("tenant_select", UNSET) + + domain_prefix = d.pop("domain_prefix", UNSET) + + first_name = d.pop("first_name", UNSET) + + last_name = d.pop("last_name", UNSET) + + company_name = d.pop("company_name", UNSET) + + address = d.pop("address", UNSET) + + city = d.pop("city", UNSET) + + state = d.pop("state", UNSET) + + postal_code = d.pop("postal_code", UNSET) + + country = d.pop("country", UNSET) + + email_address = d.pop("email_address", UNSET) + + phone_prefix = d.pop("phone_prefix", UNSET) + + phone_number = d.pop("phone_number", UNSET) _locale = d.pop("locale", UNSET) locale: BuyServiceMicrosoft365RequestDataLocale | Unset diff --git a/src/shellrent_sdk/client/models/buy_service_object_storage_request.py b/src/shellrent_sdk/client/models/buy_service_object_storage_request.py index 620e533..73512b3 100644 --- a/src/shellrent_sdk/client/models/buy_service_object_storage_request.py +++ b/src/shellrent_sdk/client/models/buy_service_object_storage_request.py @@ -4,7 +4,6 @@ from typing import TYPE_CHECKING, Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -19,24 +18,23 @@ @_attrs_define class BuyServiceObjectStorageRequest: - configuration: BuyServiceObjectStorageRequestConfiguration - """ Object Storage configuration options """ + configuration: BuyServiceObjectStorageRequestConfiguration | Unset = UNSET + """ Object Storage configuration. If omitted, the smallest size allowed by the service is used. """ account_id: int | Unset = UNSET """ ID of the account of the user that will be the owner of the purchase (available to Resellers only) """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - configuration = self.configuration.to_dict() + configuration: dict[str, Any] | Unset = UNSET + if not isinstance(self.configuration, Unset): + configuration = self.configuration.to_dict() account_id = self.account_id field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "configuration": configuration, - } - ) + + field_dict.update({}) + if configuration is not UNSET: + field_dict["configuration"] = configuration if account_id is not UNSET: field_dict["account_id"] = account_id @@ -49,9 +47,12 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: ) d = dict(src_dict) - configuration = BuyServiceObjectStorageRequestConfiguration.from_dict( - d.pop("configuration") - ) + _configuration = d.pop("configuration", UNSET) + configuration: BuyServiceObjectStorageRequestConfiguration | Unset + if isinstance(_configuration, Unset): + configuration = UNSET + else: + configuration = BuyServiceObjectStorageRequestConfiguration.from_dict(_configuration) account_id = d.pop("account_id", UNSET) @@ -60,21 +61,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: account_id=account_id, ) - buy_service_object_storage_request.additional_properties = d return buy_service_object_storage_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/buy_service_object_storage_request_configuration.py b/src/shellrent_sdk/client/models/buy_service_object_storage_request_configuration.py index 249f3c8..239f395 100644 --- a/src/shellrent_sdk/client/models/buy_service_object_storage_request_configuration.py +++ b/src/shellrent_sdk/client/models/buy_service_object_storage_request_configuration.py @@ -5,9 +5,6 @@ from attrs import define as _attrs_define -from ..models.buy_service_object_storage_request_configuration_tb_size import ( - BuyServiceObjectStorageRequestConfigurationTbSize, -) from ..types import UNSET, Unset T = TypeVar("T", bound="BuyServiceObjectStorageRequestConfiguration") @@ -15,17 +12,16 @@ @_attrs_define class BuyServiceObjectStorageRequestConfiguration: - """Object Storage configuration options""" + """Object Storage configuration. If omitted, the smallest size allowed by the service is used.""" - tb_size: BuyServiceObjectStorageRequestConfigurationTbSize | Unset = ( - BuyServiceObjectStorageRequestConfigurationTbSize.VALUE_1 - ) - """ Number of TB to allocate """ + tb_size: int | Unset = UNSET + """ Storage size, in TB. The allowed sizes depend on the Object Storage service: from its minimum to its maximum + quantity, in steps of 1 TB up to 5 TB and of 5 TB above (for example 1, 2, 3, 4, 5, 10, 15, 20). Any other value + is rejected with a validation error that lists the allowed sizes. If omitted, the smallest allowed size is used. + """ def to_dict(self) -> dict[str, Any]: - tb_size: int | Unset = UNSET - if not isinstance(self.tb_size, Unset): - tb_size = self.tb_size.value + tb_size = self.tb_size field_dict: dict[str, Any] = {} @@ -38,12 +34,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) - _tb_size = d.pop("tb_size", UNSET) - tb_size: BuyServiceObjectStorageRequestConfigurationTbSize | Unset - if isinstance(_tb_size, Unset): - tb_size = UNSET - else: - tb_size = BuyServiceObjectStorageRequestConfigurationTbSize(_tb_size) + tb_size = d.pop("tb_size", UNSET) buy_service_object_storage_request_configuration = cls( tb_size=tb_size, diff --git a/src/shellrent_sdk/client/models/buy_service_object_storage_request_configuration_tb_size.py b/src/shellrent_sdk/client/models/buy_service_object_storage_request_configuration_tb_size.py deleted file mode 100644 index 34b474f..0000000 --- a/src/shellrent_sdk/client/models/buy_service_object_storage_request_configuration_tb_size.py +++ /dev/null @@ -1,21 +0,0 @@ -from enum import IntEnum - - -class BuyServiceObjectStorageRequestConfigurationTbSize(IntEnum): - VALUE_1 = 1 - VALUE_2 = 2 - VALUE_3 = 3 - VALUE_4 = 4 - VALUE_5 = 5 - VALUE_10 = 10 - VALUE_15 = 15 - VALUE_20 = 20 - VALUE_25 = 25 - VALUE_30 = 30 - VALUE_35 = 35 - VALUE_40 = 40 - VALUE_45 = 45 - VALUE_50 = 50 - - def __str__(self) -> str: - return str(self.value) diff --git a/src/shellrent_sdk/client/models/buy_service_pec_domain_request.py b/src/shellrent_sdk/client/models/buy_service_pec_domain_request.py index 501b42c..e09a270 100644 --- a/src/shellrent_sdk/client/models/buy_service_pec_domain_request.py +++ b/src/shellrent_sdk/client/models/buy_service_pec_domain_request.py @@ -4,7 +4,6 @@ from typing import TYPE_CHECKING, Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -18,9 +17,10 @@ @_attrs_define class BuyServicePecDomainRequest: data: BuyServicePecDomainRequestData + """ Domain to activate for PEC (certified email, "Posta Elettronica Certificata") and data of its owner; the + `transferin_*` documents only for a transfer """ account_id: int | Unset = UNSET """ ID of the account of the user that will be the owner of the purchase (available to Resellers only) """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() @@ -28,7 +28,7 @@ def to_dict(self) -> dict[str, Any]: account_id = self.account_id field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "data": data, @@ -55,21 +55,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: account_id=account_id, ) - buy_service_pec_domain_request.additional_properties = d return buy_service_pec_domain_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/buy_service_pec_domain_request_data.py b/src/shellrent_sdk/client/models/buy_service_pec_domain_request_data.py index e216166..048bce4 100644 --- a/src/shellrent_sdk/client/models/buy_service_pec_domain_request_data.py +++ b/src/shellrent_sdk/client/models/buy_service_pec_domain_request_data.py @@ -15,7 +15,12 @@ @_attrs_define class BuyServicePecDomainRequestData: - domain_name: str | Unset = UNSET + """Domain to activate for PEC (certified email, "Posta Elettronica Certificata") and data of its owner; the + `transferin_*` documents only for a transfer + + """ + + domain_name: str """ Domain complete name (with TLD extension), for example: "example.com" or "example.co.uk" """ legal_entity: BuyServicePecDomainRequestDataLegalEntity | Unset = UNSET """ Legal entity of the PEC owner """ @@ -129,9 +134,11 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - field_dict.update({}) - if domain_name is not UNSET: - field_dict["domain_name"] = domain_name + field_dict.update( + { + "domain_name": domain_name, + } + ) if legal_entity is not UNSET: field_dict["legal_entity"] = legal_entity if owner is not UNSET: @@ -190,7 +197,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) - domain_name = d.pop("domain_name", UNSET) + domain_name = d.pop("domain_name") _legal_entity = d.pop("legal_entity", UNSET) legal_entity: BuyServicePecDomainRequestDataLegalEntity | Unset diff --git a/src/shellrent_sdk/client/models/buy_service_pec_request.py b/src/shellrent_sdk/client/models/buy_service_pec_request.py index 18a67ed..5467e80 100644 --- a/src/shellrent_sdk/client/models/buy_service_pec_request.py +++ b/src/shellrent_sdk/client/models/buy_service_pec_request.py @@ -4,7 +4,6 @@ from typing import TYPE_CHECKING, Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -20,9 +19,10 @@ class BuyServicePecRequest: service_id: int """ ID of the Service to buy """ data: BuyServicePecRequestData + """ PEC (certified email, "Posta Elettronica Certificata") mailbox to create and data of its owner; the + `transferin_*` documents only for a transfer """ account_id: int | Unset = UNSET """ ID of the account of the user that will be the owner of the purchase (available to Resellers only) """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: service_id = self.service_id @@ -32,7 +32,7 @@ def to_dict(self) -> dict[str, Any]: account_id = self.account_id field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "service_id": service_id, @@ -61,21 +61,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: account_id=account_id, ) - buy_service_pec_request.additional_properties = d return buy_service_pec_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/buy_service_pec_request_data.py b/src/shellrent_sdk/client/models/buy_service_pec_request_data.py index e8b7a27..63e80b2 100644 --- a/src/shellrent_sdk/client/models/buy_service_pec_request_data.py +++ b/src/shellrent_sdk/client/models/buy_service_pec_request_data.py @@ -13,6 +13,11 @@ @_attrs_define class BuyServicePecRequestData: + """PEC (certified email, "Posta Elettronica Certificata") mailbox to create and data of its owner; the `transferin_*` + documents only for a transfer + + """ + box_name: str """ PEC mailbox local part, before the @ symbol """ domain_select: int diff --git a/src/shellrent_sdk/client/models/buy_service_plesk_license_request.py b/src/shellrent_sdk/client/models/buy_service_plesk_license_request.py index 1ac073d..e2a7d52 100644 --- a/src/shellrent_sdk/client/models/buy_service_plesk_license_request.py +++ b/src/shellrent_sdk/client/models/buy_service_plesk_license_request.py @@ -4,7 +4,6 @@ from typing import TYPE_CHECKING, Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -23,7 +22,6 @@ class BuyServicePleskLicenseRequest: """ Details about where to install the license """ account_id: int | Unset = UNSET """ ID of the account of the user that will be the owner of the purchase (available to Resellers only) """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: service_id = self.service_id @@ -33,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: account_id = self.account_id field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "service_id": service_id, @@ -64,21 +62,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: account_id=account_id, ) - buy_service_plesk_license_request.additional_properties = d return buy_service_plesk_license_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/buy_service_plesk_license_request_data.py b/src/shellrent_sdk/client/models/buy_service_plesk_license_request_data.py index 9351dbf..0016ab7 100644 --- a/src/shellrent_sdk/client/models/buy_service_plesk_license_request_data.py +++ b/src/shellrent_sdk/client/models/buy_service_plesk_license_request_data.py @@ -17,19 +17,18 @@ class BuyServicePleskLicenseRequestData: """Details about where to install the license""" - installation_type: BuyServicePleskLicenseRequestDataInstallationType | Unset = UNSET + installation_type: BuyServicePleskLicenseRequestDataInstallationType """ Choose to install the license on an active server or on external IP address """ purchase_server: int | Unset = UNSET - """ ID of the server where the license will be installed to. Required only if "installation_type" has value + """ Id of the purchase of the server where the license will be installed (`purchase_id` of `GET + /api/v3/servers/{server_id}`), not the id of the server. Required only if "installation_type" has value "internal_installation_type" """ ip_address: str | Unset = UNSET """ IP address of the external host where the license will be installed to. Required only if "installation_type" has value "external_installation_type" """ def to_dict(self) -> dict[str, Any]: - installation_type: str | Unset = UNSET - if not isinstance(self.installation_type, Unset): - installation_type = self.installation_type.value + installation_type = self.installation_type.value purchase_server = self.purchase_server @@ -37,9 +36,11 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - field_dict.update({}) - if installation_type is not UNSET: - field_dict["installation_type"] = installation_type + field_dict.update( + { + "installation_type": installation_type, + } + ) if purchase_server is not UNSET: field_dict["purchase_server"] = purchase_server if ip_address is not UNSET: @@ -50,14 +51,9 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) - _installation_type = d.pop("installation_type", UNSET) - installation_type: BuyServicePleskLicenseRequestDataInstallationType | Unset - if isinstance(_installation_type, Unset): - installation_type = UNSET - else: - installation_type = BuyServicePleskLicenseRequestDataInstallationType( - _installation_type - ) + installation_type = BuyServicePleskLicenseRequestDataInstallationType( + d.pop("installation_type") + ) purchase_server = d.pop("purchase_server", UNSET) diff --git a/src/shellrent_sdk/client/models/buy_service_private_cloud_sv_request.py b/src/shellrent_sdk/client/models/buy_service_private_cloud_sv_request.py index a3d8727..7ec040d 100644 --- a/src/shellrent_sdk/client/models/buy_service_private_cloud_sv_request.py +++ b/src/shellrent_sdk/client/models/buy_service_private_cloud_sv_request.py @@ -4,7 +4,6 @@ from typing import TYPE_CHECKING, Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -25,7 +24,6 @@ class BuyServicePrivateCloudSvRequest: """ ID of the account of the user that will be the owner of the purchase (available to Resellers only) """ data: BuyServicePrivateCloudSvRequestData | Unset = UNSET """ Private Cloud SV configuration options """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: service_id = self.service_id @@ -37,7 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "service_id": service_id, @@ -74,21 +72,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: data=data, ) - buy_service_private_cloud_sv_request.additional_properties = d return buy_service_private_cloud_sv_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/buy_service_private_cloud_sv_request_data.py b/src/shellrent_sdk/client/models/buy_service_private_cloud_sv_request_data.py index 41d8299..513b693 100644 --- a/src/shellrent_sdk/client/models/buy_service_private_cloud_sv_request_data.py +++ b/src/shellrent_sdk/client/models/buy_service_private_cloud_sv_request_data.py @@ -19,8 +19,8 @@ class BuyServicePrivateCloudSvRequestData: additional_backup_disk_service_quantity: ( BuyServicePrivateCloudSvRequestDataADDITIONALBACKUPDISKSERVICEQUANTITY | Unset - ) = BuyServicePrivateCloudSvRequestDataADDITIONALBACKUPDISKSERVICEQUANTITY.VALUE_1 - """ Choose to configure the Private Cloud with or without additional backup disk """ + ) = UNSET + """ Choose to configure the Private Cloud with (1) or without (0) additional backup disk. Default: 1 """ def to_dict(self) -> dict[str, Any]: additional_backup_disk_service_quantity: int | Unset = UNSET diff --git a/src/shellrent_sdk/client/models/buy_service_securemail_for_google_workspace_request.py b/src/shellrent_sdk/client/models/buy_service_securemail_for_google_workspace_request.py deleted file mode 100644 index 2afdb51..0000000 --- a/src/shellrent_sdk/client/models/buy_service_securemail_for_google_workspace_request.py +++ /dev/null @@ -1,93 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.buy_service_securemail_for_microsoft_365_request_configuration import ( - BuyServiceSecuremailForMicrosoft365RequestConfiguration, - ) - from ..models.buy_service_securemail_for_microsoft_365_request_data import ( - BuyServiceSecuremailForMicrosoft365RequestData, - ) - - -T = TypeVar("T", bound="BuyServiceSecuremailForGoogleWorkspaceRequest") - - -@_attrs_define -class BuyServiceSecuremailForGoogleWorkspaceRequest: - configuration: BuyServiceSecuremailForMicrosoft365RequestConfiguration - """ SecureMail for Google Workspace configuration options """ - data: BuyServiceSecuremailForMicrosoft365RequestData - account_id: int | Unset = UNSET - """ ID of the account of the user that will be the owner of the purchase (available to Resellers only) """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - configuration = self.configuration.to_dict() - - data = self.data.to_dict() - - account_id = self.account_id - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "configuration": configuration, - "data": data, - } - ) - if account_id is not UNSET: - field_dict["account_id"] = account_id - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.buy_service_securemail_for_microsoft_365_request_configuration import ( - BuyServiceSecuremailForMicrosoft365RequestConfiguration, - ) - from ..models.buy_service_securemail_for_microsoft_365_request_data import ( - BuyServiceSecuremailForMicrosoft365RequestData, - ) - - d = dict(src_dict) - configuration = BuyServiceSecuremailForMicrosoft365RequestConfiguration.from_dict( - d.pop("configuration") - ) - - data = BuyServiceSecuremailForMicrosoft365RequestData.from_dict(d.pop("data")) - - account_id = d.pop("account_id", UNSET) - - buy_service_securemail_for_google_workspace_request = cls( - configuration=configuration, - data=data, - account_id=account_id, - ) - - buy_service_securemail_for_google_workspace_request.additional_properties = d - return buy_service_securemail_for_google_workspace_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/buy_service_securemail_for_google_workspace_request_configuration.py b/src/shellrent_sdk/client/models/buy_service_securemail_for_google_workspace_request_configuration.py deleted file mode 100644 index 696f792..0000000 --- a/src/shellrent_sdk/client/models/buy_service_securemail_for_google_workspace_request_configuration.py +++ /dev/null @@ -1,40 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="BuyServiceSecuremailForGoogleWorkspaceRequestConfiguration") - - -@_attrs_define -class BuyServiceSecuremailForGoogleWorkspaceRequestConfiguration: - """SecureMail for Google Workspace configuration options""" - - service_quantity: int | Unset = UNSET - """ Number of mailboxes to protect. """ - - def to_dict(self) -> dict[str, Any]: - service_quantity = self.service_quantity - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if service_quantity is not UNSET: - field_dict["SERVICE_QUANTITY"] = service_quantity - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - service_quantity = d.pop("SERVICE_QUANTITY", UNSET) - - buy_service_securemail_for_google_workspace_request_configuration = cls( - service_quantity=service_quantity, - ) - - return buy_service_securemail_for_google_workspace_request_configuration diff --git a/src/shellrent_sdk/client/models/buy_service_securemail_for_google_workspace_request_data.py b/src/shellrent_sdk/client/models/buy_service_securemail_for_google_workspace_request_data.py deleted file mode 100644 index 2b49c99..0000000 --- a/src/shellrent_sdk/client/models/buy_service_securemail_for_google_workspace_request_data.py +++ /dev/null @@ -1,62 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define - -T = TypeVar("T", bound="BuyServiceSecuremailForGoogleWorkspaceRequestData") - - -@_attrs_define -class BuyServiceSecuremailForGoogleWorkspaceRequestData: - email_domain: str - """ Domain name for the emails to be protected """ - super_admin_email: str - """ Email address of the Google Workspace superadmin """ - oauth2_json_file: int - """ ID of the uploaded file (first file, extension: "json") """ - key_json_file: int - """ ID of the uploaded file (second file, extension: "json") """ - - def to_dict(self) -> dict[str, Any]: - email_domain = self.email_domain - - super_admin_email = self.super_admin_email - - oauth2_json_file = self.oauth2_json_file - - key_json_file = self.key_json_file - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "email_domain": email_domain, - "super_admin_email": super_admin_email, - "oauth2_json_file": oauth2_json_file, - "key_json_file": key_json_file, - } - ) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - email_domain = d.pop("email_domain") - - super_admin_email = d.pop("super_admin_email") - - oauth2_json_file = d.pop("oauth2_json_file") - - key_json_file = d.pop("key_json_file") - - buy_service_securemail_for_google_workspace_request_data = cls( - email_domain=email_domain, - super_admin_email=super_admin_email, - oauth2_json_file=oauth2_json_file, - key_json_file=key_json_file, - ) - - return buy_service_securemail_for_google_workspace_request_data diff --git a/src/shellrent_sdk/client/models/buy_service_securemail_for_microsoft_365_request.py b/src/shellrent_sdk/client/models/buy_service_securemail_for_microsoft_365_request.py deleted file mode 100644 index 32ceae5..0000000 --- a/src/shellrent_sdk/client/models/buy_service_securemail_for_microsoft_365_request.py +++ /dev/null @@ -1,93 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.buy_service_securemail_for_microsoft_365_request_configuration import ( - BuyServiceSecuremailForMicrosoft365RequestConfiguration, - ) - from ..models.buy_service_securemail_for_microsoft_365_request_data import ( - BuyServiceSecuremailForMicrosoft365RequestData, - ) - - -T = TypeVar("T", bound="BuyServiceSecuremailForMicrosoft365Request") - - -@_attrs_define -class BuyServiceSecuremailForMicrosoft365Request: - configuration: BuyServiceSecuremailForMicrosoft365RequestConfiguration - """ SecureMail for Microsoft 365 configuration options """ - data: BuyServiceSecuremailForMicrosoft365RequestData - account_id: int | Unset = UNSET - """ ID of the account of the user that will be the owner of the purchase (available to Resellers only) """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - configuration = self.configuration.to_dict() - - data = self.data.to_dict() - - account_id = self.account_id - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "configuration": configuration, - "data": data, - } - ) - if account_id is not UNSET: - field_dict["account_id"] = account_id - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.buy_service_securemail_for_microsoft_365_request_configuration import ( - BuyServiceSecuremailForMicrosoft365RequestConfiguration, - ) - from ..models.buy_service_securemail_for_microsoft_365_request_data import ( - BuyServiceSecuremailForMicrosoft365RequestData, - ) - - d = dict(src_dict) - configuration = BuyServiceSecuremailForMicrosoft365RequestConfiguration.from_dict( - d.pop("configuration") - ) - - data = BuyServiceSecuremailForMicrosoft365RequestData.from_dict(d.pop("data")) - - account_id = d.pop("account_id", UNSET) - - buy_service_securemail_for_microsoft_365_request = cls( - configuration=configuration, - data=data, - account_id=account_id, - ) - - buy_service_securemail_for_microsoft_365_request.additional_properties = d - return buy_service_securemail_for_microsoft_365_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/buy_service_securemail_for_microsoft_365_request_configuration.py b/src/shellrent_sdk/client/models/buy_service_securemail_for_microsoft_365_request_configuration.py deleted file mode 100644 index c196a3b..0000000 --- a/src/shellrent_sdk/client/models/buy_service_securemail_for_microsoft_365_request_configuration.py +++ /dev/null @@ -1,40 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="BuyServiceSecuremailForMicrosoft365RequestConfiguration") - - -@_attrs_define -class BuyServiceSecuremailForMicrosoft365RequestConfiguration: - """SecureMail for Microsoft 365 configuration options""" - - service_quantity: int | Unset = UNSET - """ Number of mailboxes to protect. """ - - def to_dict(self) -> dict[str, Any]: - service_quantity = self.service_quantity - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if service_quantity is not UNSET: - field_dict["SERVICE_QUANTITY"] = service_quantity - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - service_quantity = d.pop("SERVICE_QUANTITY", UNSET) - - buy_service_securemail_for_microsoft_365_request_configuration = cls( - service_quantity=service_quantity, - ) - - return buy_service_securemail_for_microsoft_365_request_configuration diff --git a/src/shellrent_sdk/client/models/buy_service_securemail_for_microsoft_365_request_data.py b/src/shellrent_sdk/client/models/buy_service_securemail_for_microsoft_365_request_data.py deleted file mode 100644 index c93f21d..0000000 --- a/src/shellrent_sdk/client/models/buy_service_securemail_for_microsoft_365_request_data.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define - -T = TypeVar("T", bound="BuyServiceSecuremailForMicrosoft365RequestData") - - -@_attrs_define -class BuyServiceSecuremailForMicrosoft365RequestData: - tenant: str - """ Prefix of the ".onmicrosoft.com" tenant domain """ - email_domain: str - """ Domain name for the emails to be protected """ - domain_fqn: str - """ FQDN of the Microsoft destination domain for emails """ - client_id: str - """ Client ID for the connector generated on admin.microsoft.com """ - client_secret: str - """ Client secret for the connector generated on admin.microsoft.com """ - - def to_dict(self) -> dict[str, Any]: - tenant = self.tenant - - email_domain = self.email_domain - - domain_fqn = self.domain_fqn - - client_id = self.client_id - - client_secret = self.client_secret - - field_dict: dict[str, Any] = {} - - field_dict.update( - { - "tenant": tenant, - "email_domain": email_domain, - "domain_fqn": domain_fqn, - "client_id": client_id, - "client_secret": client_secret, - } - ) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - tenant = d.pop("tenant") - - email_domain = d.pop("email_domain") - - domain_fqn = d.pop("domain_fqn") - - client_id = d.pop("client_id") - - client_secret = d.pop("client_secret") - - buy_service_securemail_for_microsoft_365_request_data = cls( - tenant=tenant, - email_domain=email_domain, - domain_fqn=domain_fqn, - client_id=client_id, - client_secret=client_secret, - ) - - return buy_service_securemail_for_microsoft_365_request_data diff --git a/src/shellrent_sdk/client/models/buy_service_securemail_request.py b/src/shellrent_sdk/client/models/buy_service_securemail_request.py deleted file mode 100644 index 9dc92b7..0000000 --- a/src/shellrent_sdk/client/models/buy_service_securemail_request.py +++ /dev/null @@ -1,78 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.buy_service_securemail_request_configuration import ( - BuyServiceSecuremailRequestConfiguration, - ) - - -T = TypeVar("T", bound="BuyServiceSecuremailRequest") - - -@_attrs_define -class BuyServiceSecuremailRequest: - configuration: BuyServiceSecuremailRequestConfiguration - """ SecureMail configuration options """ - account_id: int | Unset = UNSET - """ ID of the account of the user that will be the owner of the purchase (available to Resellers only) """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - configuration = self.configuration.to_dict() - - account_id = self.account_id - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "configuration": configuration, - } - ) - if account_id is not UNSET: - field_dict["account_id"] = account_id - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.buy_service_securemail_request_configuration import ( - BuyServiceSecuremailRequestConfiguration, - ) - - d = dict(src_dict) - configuration = BuyServiceSecuremailRequestConfiguration.from_dict(d.pop("configuration")) - - account_id = d.pop("account_id", UNSET) - - buy_service_securemail_request = cls( - configuration=configuration, - account_id=account_id, - ) - - buy_service_securemail_request.additional_properties = d - return buy_service_securemail_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/buy_service_securemail_request_configuration.py b/src/shellrent_sdk/client/models/buy_service_securemail_request_configuration.py deleted file mode 100644 index 6bfa17d..0000000 --- a/src/shellrent_sdk/client/models/buy_service_securemail_request_configuration.py +++ /dev/null @@ -1,40 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="BuyServiceSecuremailRequestConfiguration") - - -@_attrs_define -class BuyServiceSecuremailRequestConfiguration: - """SecureMail configuration options""" - - secure_mail_hosting: int | Unset = UNSET - """ Active Hosting purchase ID for which you are requesting to secure the email service. """ - - def to_dict(self) -> dict[str, Any]: - secure_mail_hosting = self.secure_mail_hosting - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if secure_mail_hosting is not UNSET: - field_dict["SECURE_MAIL_HOSTING"] = secure_mail_hosting - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - secure_mail_hosting = d.pop("SECURE_MAIL_HOSTING", UNSET) - - buy_service_securemail_request_configuration = cls( - secure_mail_hosting=secure_mail_hosting, - ) - - return buy_service_securemail_request_configuration diff --git a/src/shellrent_sdk/client/models/buy_service_sms_request.py b/src/shellrent_sdk/client/models/buy_service_sms_request.py index 7c4e1df..0cedebc 100644 --- a/src/shellrent_sdk/client/models/buy_service_sms_request.py +++ b/src/shellrent_sdk/client/models/buy_service_sms_request.py @@ -4,7 +4,6 @@ from typing import Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -17,7 +16,6 @@ class BuyServiceSmsRequest: """ ID of the Service to buy """ account_id: int | Unset = UNSET """ ID of the account of the user that will be the owner of the purchase (available to Resellers only) """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: service_id = self.service_id @@ -25,7 +23,7 @@ def to_dict(self) -> dict[str, Any]: account_id = self.account_id field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "service_id": service_id, @@ -48,21 +46,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: account_id=account_id, ) - buy_service_sms_request.additional_properties = d return buy_service_sms_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/buy_service_ssl_certificate_request.py b/src/shellrent_sdk/client/models/buy_service_ssl_certificate_request.py index 817db9e..ac592d8 100644 --- a/src/shellrent_sdk/client/models/buy_service_ssl_certificate_request.py +++ b/src/shellrent_sdk/client/models/buy_service_ssl_certificate_request.py @@ -4,7 +4,6 @@ from typing import TYPE_CHECKING, Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -25,7 +24,6 @@ class BuyServiceSslCertificateRequest: """ Details required to issue the SSL/TLS Certificate """ account_id: int | Unset = UNSET """ ID of the account of the user that will be the owner of the purchase (available to Resellers only) """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: service_id = self.service_id @@ -35,7 +33,7 @@ def to_dict(self) -> dict[str, Any]: account_id = self.account_id field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "service_id": service_id, @@ -66,21 +64,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: account_id=account_id, ) - buy_service_ssl_certificate_request.additional_properties = d return buy_service_ssl_certificate_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/buy_service_ssl_certificate_request_data.py b/src/shellrent_sdk/client/models/buy_service_ssl_certificate_request_data.py index 58bb213..83ed0e3 100644 --- a/src/shellrent_sdk/client/models/buy_service_ssl_certificate_request_data.py +++ b/src/shellrent_sdk/client/models/buy_service_ssl_certificate_request_data.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import Any, Self, TypeVar, cast +from typing import Any, Self, TypeVar from attrs import define as _attrs_define @@ -25,11 +25,14 @@ class BuyServiceSslCertificateRequestData: approver_email: str """ One of the email addresses accepted as "approver" email for the SSL Certificate validation """ admin_role: BuyServiceSslCertificateRequestDataAdminRole + """ Role of the administrative contact of the certificate """ admin_title: BuyServiceSslCertificateRequestDataAdminTitle + """ Title of the administrative contact """ admin_first_name: str admin_last_name: str admin_email: str admin_organization: str + """ Organization of the administrative contact """ admin_phone_cc: str """ Country code phone prefix without leading "0" and without leading "+" sign; ie. "44" for UK or "39" for Italy """ @@ -42,10 +45,10 @@ class BuyServiceSslCertificateRequestData: admin_postcode: str admin_country: str """ ISO country code with 2 letters; ie. "IT" for Italy, "ES" for Spain """ - csr: None | str | Unset = UNSET + csr: str | Unset = UNSET """ Use this only if you wish to provide your custom-generated CSR. If you specify your own generated CSR, you must provide the Private Key as well. """ - private_key: None | str | Unset = UNSET + private_key: str | Unset = UNSET """ Use this only if you wish to provide your custom-generated Private Key. If you specify your own generated Private Key, you must provide the CSR as well. """ @@ -80,17 +83,9 @@ def to_dict(self) -> dict[str, Any]: admin_country = self.admin_country - csr: None | str | Unset - if isinstance(self.csr, Unset): - csr = UNSET - else: - csr = self.csr + csr = self.csr - private_key: None | str | Unset - if isinstance(self.private_key, Unset): - private_key = UNSET - else: - private_key = self.private_key + private_key = self.private_key field_dict: dict[str, Any] = {} @@ -153,23 +148,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: admin_country = d.pop("admin_country") - def _parse_csr(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) + csr = d.pop("csr", UNSET) - csr = _parse_csr(d.pop("csr", UNSET)) - - def _parse_private_key(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - private_key = _parse_private_key(d.pop("private_key", UNSET)) + private_key = d.pop("private_key", UNSET) buy_service_ssl_certificate_request_data = cls( domain=domain, diff --git a/src/shellrent_sdk/client/models/buy_service_veeam_baas_request.py b/src/shellrent_sdk/client/models/buy_service_veeam_baas_request.py index a256080..906216d 100644 --- a/src/shellrent_sdk/client/models/buy_service_veeam_baas_request.py +++ b/src/shellrent_sdk/client/models/buy_service_veeam_baas_request.py @@ -4,7 +4,6 @@ from typing import TYPE_CHECKING, Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -19,24 +18,26 @@ @_attrs_define class BuyServiceVeeamBaasRequest: - configuration: BuyServiceVeeamBaasRequestConfiguration - """ Veeam BaaS configuration options """ + configuration: BuyServiceVeeamBaasRequestConfiguration | Unset = UNSET + """ Veeam BaaS configuration. Every field is optional: an omitted workload quantity counts as 0, and an omitted + configuration is the same as an empty object. The limits of each workload quantity depend on the corresponding + workload service: a value outside them is rejected with a validation error (code 1000) that states the limit in + `meta.errors`. """ account_id: int | Unset = UNSET """ ID of the account of the user that will be the owner of the purchase (available to Resellers only) """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - configuration = self.configuration.to_dict() + configuration: dict[str, Any] | Unset = UNSET + if not isinstance(self.configuration, Unset): + configuration = self.configuration.to_dict() account_id = self.account_id field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "configuration": configuration, - } - ) + + field_dict.update({}) + if configuration is not UNSET: + field_dict["configuration"] = configuration if account_id is not UNSET: field_dict["account_id"] = account_id @@ -49,7 +50,12 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: ) d = dict(src_dict) - configuration = BuyServiceVeeamBaasRequestConfiguration.from_dict(d.pop("configuration")) + _configuration = d.pop("configuration", UNSET) + configuration: BuyServiceVeeamBaasRequestConfiguration | Unset + if isinstance(_configuration, Unset): + configuration = UNSET + else: + configuration = BuyServiceVeeamBaasRequestConfiguration.from_dict(_configuration) account_id = d.pop("account_id", UNSET) @@ -58,21 +64,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: account_id=account_id, ) - buy_service_veeam_baas_request.additional_properties = d return buy_service_veeam_baas_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/buy_service_veeam_baas_request_configuration.py b/src/shellrent_sdk/client/models/buy_service_veeam_baas_request_configuration.py index 9b5fbc1..56dc85f 100644 --- a/src/shellrent_sdk/client/models/buy_service_veeam_baas_request_configuration.py +++ b/src/shellrent_sdk/client/models/buy_service_veeam_baas_request_configuration.py @@ -12,10 +12,17 @@ @_attrs_define class BuyServiceVeeamBaasRequestConfiguration: - """Veeam BaaS configuration options""" + """Veeam BaaS configuration. Every field is optional: an omitted workload quantity counts as 0, and an omitted + configuration is the same as an empty object. The limits of each workload quantity depend on the corresponding + workload service: a value outside them is rejected with a validation error (code 1000) that states the limit in + `meta.errors`. + + """ cloud_connect_gb: int | Unset = UNSET - """ Veeam Cloud Connect storage: quantity (in GB) of storage. """ + """ Veeam Cloud Connect: size of the backup storage, in GB. It must be one of the storage sizes offered for the + service: any other value is rejected with a validation error that lists the allowed sizes. If omitted, the + default storage option of the service is used. """ agent_server: int | Unset = UNSET """ Veeam Agent: number of "Server" workloads. """ agent_workstation: int | Unset = UNSET @@ -27,8 +34,9 @@ class BuyServiceVeeamBaasRequestConfiguration: vbr_entplus_workstation: int | Unset = UNSET """ Veeam Backup & Replication (VBR) Enterprise Plus: number of "Workstation" workloads. """ vbr_entplus_gb: int | Unset = UNSET - """ Veeam Backup & Replication (VBR) Enterprise Plus: number of slots for "NAS" workloads. Each slot represents - 250 GB of storage. """ + """ Veeam Backup & Replication (VBR) Enterprise Plus: NAS backup storage, as a number of slots of 250 GB each. + Despite the name, the value is a number of slots, not of GB: 1 = 250 GB, 2 = 500 GB, up to 9 = 2,250 GB. Use 0 + or omit the field for no NAS storage. """ vbr_standard_vm: int | Unset = UNSET """ Veeam Backup & Replication (VBR) Standard: number of "VM in VMware/Hyper-V" workloads. """ vbr_standard_server: int | Unset = UNSET @@ -36,7 +44,7 @@ class BuyServiceVeeamBaasRequestConfiguration: vbr_standard_workstation: int | Unset = UNSET """ Veeam Backup & Replication (VBR) Standard: number of "Workstation" workloads. """ vb365_users: int | Unset = UNSET - """ Veeam Backup for Microsoft 365: number of Users. """ + """ Veeam Backup for Microsoft 365: number of users. """ cc_license_vm: int | Unset = UNSET """ Veeam Cloud Connect license: number of "VM in VMware/Hyper-V" workloads. """ cc_license_server: int | Unset = UNSET diff --git a/src/shellrent_sdk/client/models/cloud_storage.py b/src/shellrent_sdk/client/models/cloud_storage.py index 6a2c9c1..c1399af 100644 --- a/src/shellrent_sdk/client/models/cloud_storage.py +++ b/src/shellrent_sdk/client/models/cloud_storage.py @@ -12,14 +12,28 @@ @_attrs_define class CloudStorage: + """Cloud storage of the account, with its hosts and the space used""" + cloud_storage_id: int purchase_id: int | None + """ Id of the purchase of the cloud storage (`GET /api/v3/purchases/{purchase_id}`) """ name: None | str + """ Code of the cloud storage (7 hexadecimal characters), used in its hosts and in the username of its main user + """ read_write_host: None | str + """ Host for the read-write access to the storage, without the domain: the full name is + `.serverlet.com` """ read_only_host: None | str + """ Host for the read-only access to the storage, served by its replica, without the domain: the full name is + `.serverlet.com` """ app_host: None | str + """ Host of the web file manager (Nextcloud), without the domain: it is reachable at + `https://.serverlet.com` """ group_disk_used_bytes: int | None + """ Space used by the cloud storage with all its users, those of the services included, in bytes, at the last + sync (`date_sync`) """ date_sync: datetime.datetime | None + """ Date of the last sync of the used space with the storage server """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/cloud_storage_access.py b/src/shellrent_sdk/client/models/cloud_storage_access.py index 8ad0390..367a4db 100644 --- a/src/shellrent_sdk/client/models/cloud_storage_access.py +++ b/src/shellrent_sdk/client/models/cloud_storage_access.py @@ -11,13 +11,21 @@ @_attrs_define class CloudStorageAccess: - access_id: str + """NFS access to a cloud storage: an IPv4 address allowed to mount the storage of a user""" + + access_id: None | str + """ Id of the access, used in its path: the IPv4 address in `hostname` """ cloud_storage_id: int + """ Id of the cloud storage (`GET /api/v3/cloud-storages/{cloud_storage_id}`) """ hostname: None | str + """ IPv4 address allowed to mount the storage via NFS """ username: None | str + """ Username of the cloud storage user whose storage the address can mount (`GET /api/v3/cloud- + storages/{cloud_storage_id}/users`) """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + access_id: None | str access_id = self.access_id cloud_storage_id = self.cloud_storage_id @@ -44,7 +52,13 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) - access_id = d.pop("access_id") + + def _parse_access_id(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + access_id = _parse_access_id(d.pop("access_id")) cloud_storage_id = d.pop("cloud_storage_id") diff --git a/src/shellrent_sdk/client/models/cloud_storage_access_create_request.py b/src/shellrent_sdk/client/models/cloud_storage_access_create_request.py index b876c75..923f8a1 100644 --- a/src/shellrent_sdk/client/models/cloud_storage_access_create_request.py +++ b/src/shellrent_sdk/client/models/cloud_storage_access_create_request.py @@ -4,18 +4,19 @@ from typing import Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset T = TypeVar("T", bound="CloudStorageAccessCreateRequest") @_attrs_define class CloudStorageAccessCreateRequest: - hostname: str | Unset = UNSET - username: str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + """NFS access to create: an IPv4 address allowed to mount the storage of a user""" + + hostname: str + """ IPv4 address to allow to mount the storage via NFS """ + username: str + """ Username of the user whose storage the address can mount: the `PRIMARY` user or an `ADDITIONAL` user of the + cloud storage (`GET /api/v3/cloud-storages/{cloud_storage_id}/users`) """ def to_dict(self) -> dict[str, Any]: hostname = self.hostname @@ -23,42 +24,26 @@ def to_dict(self) -> dict[str, Any]: username = self.username field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if hostname is not UNSET: - field_dict["hostname"] = hostname - if username is not UNSET: - field_dict["username"] = username + + field_dict.update( + { + "hostname": hostname, + "username": username, + } + ) return field_dict @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) - hostname = d.pop("hostname", UNSET) + hostname = d.pop("hostname") - username = d.pop("username", UNSET) + username = d.pop("username") cloud_storage_access_create_request = cls( hostname=hostname, username=username, ) - cloud_storage_access_create_request.additional_properties = d return cloud_storage_access_create_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/cloud_storage_access_paginated_list_response.py b/src/shellrent_sdk/client/models/cloud_storage_access_paginated_list_response.py index 67383d0..11f84da 100644 --- a/src/shellrent_sdk/client/models/cloud_storage_access_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/cloud_storage_access_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class CloudStorageAccessPaginatedListResponse: - error: int + """Successful response with a page of `CloudStorageAccess`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[CloudStorageAccess] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.pagination_meta import PaginationMeta d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/cloud_storage_access_response.py b/src/shellrent_sdk/client/models/cloud_storage_access_response.py index da2eae6..6c6e599 100644 --- a/src/shellrent_sdk/client/models/cloud_storage_access_response.py +++ b/src/shellrent_sdk/client/models/cloud_storage_access_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.cloud_storage_access import CloudStorageAccess - from ..models.cloud_storage_access_response_meta_type_0 import ( - CloudStorageAccessResponseMetaType0, - ) T = TypeVar("T", bound="CloudStorageAccessResponse") @@ -18,17 +15,19 @@ @_attrs_define class CloudStorageAccessResponse: - error: int + """Successful response with one `CloudStorageAccess`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: CloudStorageAccess - meta: CloudStorageAccessResponseMetaType0 | None + """ NFS access to a cloud storage: an IPv4 address allowed to mount the storage of a user """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.cloud_storage_access_response_meta_type_0 import ( - CloudStorageAccessResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, CloudStorageAccessResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -58,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.cloud_storage_access import CloudStorageAccess - from ..models.cloud_storage_access_response_meta_type_0 import ( - CloudStorageAccessResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -74,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = CloudStorageAccess.from_dict(d.pop("data")) - def _parse_meta(data: object) -> CloudStorageAccessResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = CloudStorageAccessResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(CloudStorageAccessResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") cloud_storage_access_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/cloud_storage_access_response_meta_type_0.py b/src/shellrent_sdk/client/models/cloud_storage_access_response_meta_type_0.py deleted file mode 100644 index 0fb2d25..0000000 --- a/src/shellrent_sdk/client/models/cloud_storage_access_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="CloudStorageAccessResponseMetaType0") - - -@_attrs_define -class CloudStorageAccessResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - cloud_storage_access_response_meta_type_0 = cls() - - cloud_storage_access_response_meta_type_0.additional_properties = d - return cloud_storage_access_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/cloud_storage_paginated_list_response.py b/src/shellrent_sdk/client/models/cloud_storage_paginated_list_response.py index b4bdbc1..ddb1b4f 100644 --- a/src/shellrent_sdk/client/models/cloud_storage_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/cloud_storage_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class CloudStoragePaginatedListResponse: - error: int + """Successful response with a page of `CloudStorage`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[CloudStorage] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.pagination_meta import PaginationMeta d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/cloud_storage_response.py b/src/shellrent_sdk/client/models/cloud_storage_response.py index f365298..ec23c61 100644 --- a/src/shellrent_sdk/client/models/cloud_storage_response.py +++ b/src/shellrent_sdk/client/models/cloud_storage_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.cloud_storage import CloudStorage - from ..models.cloud_storage_response_meta_type_0 import CloudStorageResponseMetaType0 T = TypeVar("T", bound="CloudStorageResponse") @@ -16,15 +15,19 @@ @_attrs_define class CloudStorageResponse: - error: int + """Successful response with one `CloudStorage`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: CloudStorage - meta: CloudStorageResponseMetaType0 | None + """ Cloud storage of the account, with its hosts and the space used """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.cloud_storage_response_meta_type_0 import CloudStorageResponseMetaType0 - error = self.error message: None | str @@ -32,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, CloudStorageResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.cloud_storage import CloudStorage - from ..models.cloud_storage_response_meta_type_0 import ( - CloudStorageResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -70,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = CloudStorage.from_dict(d.pop("data")) - def _parse_meta(data: object) -> CloudStorageResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = CloudStorageResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(CloudStorageResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") cloud_storage_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/cloud_storage_response_meta_type_0.py b/src/shellrent_sdk/client/models/cloud_storage_response_meta_type_0.py deleted file mode 100644 index 073c24f..0000000 --- a/src/shellrent_sdk/client/models/cloud_storage_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="CloudStorageResponseMetaType0") - - -@_attrs_define -class CloudStorageResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - cloud_storage_response_meta_type_0 = cls() - - cloud_storage_response_meta_type_0.additional_properties = d - return cloud_storage_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/cloud_storage_user.py b/src/shellrent_sdk/client/models/cloud_storage_user.py index cd259c2..897c9cf 100644 --- a/src/shellrent_sdk/client/models/cloud_storage_user.py +++ b/src/shellrent_sdk/client/models/cloud_storage_user.py @@ -12,20 +12,41 @@ @_attrs_define class CloudStorageUser: + """User of a cloud storage, with its quotas and the space used""" + cloud_storage_user_id: int cloud_storage_id: int + """ Id of the cloud storage (`GET /api/v3/cloud-storages/{cloud_storage_id}`) """ purchase_id: int | None + """ Id of the purchase of the user (`GET /api/v3/purchases/{purchase_id}`): the cloud storage purchase, or the + own purchase of an `ADDITIONAL` user """ type_: None | str + """ Type of the user: `PRIMARY` (main user), `ADDITIONAL` (additional user, with its own purchase), or + `DISASTER_RECOVERY`, `TEMPLATE_VM` and `SELF_CLOUD` for the users managed by those services """ username: None | str password: None | str + """ Password of the user; null without the cloudstorage:secrets scope """ path: None | str + """ Home path of the user on the storage """ soft_quota_gb: float | None + """ Soft quota of the user, in GB (1 GB = 1024 MB): it can be exceeded, up to the hard quota, for a grace period + """ hard_quota_gb: float | None + """ Hard quota of the user, in GB (1 GB = 1024 MB): the limit that the used space cannot exceed """ used_space_bytes: int | None + """ Space used by the user at the last sync of the cloud storage, in bytes; null before the first sync """ allocated_space_bytes: int | None + """ Space allocated to the user, that is its hard quota at the last sync of the cloud storage, in bytes; null + before the first sync """ grace_period_seconds: int | None + """ Grace period left to go back under the soft quota, in seconds, saved the last time the user was found over + quota; `0` if never. Only `PRIMARY` users are checked: `0` for the `ADDITIONAL` ones, null for the users of the + services """ last_alert: datetime.datetime | None + """ Date of the last email that warned the customer that the user is over its soft quota, sent at most once a + week and only for `PRIMARY` users; null if it was not over quota at the last check """ active: bool | None + """ Whether the user is active: deleted users are not returned """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/cloud_storage_user_list_response.py b/src/shellrent_sdk/client/models/cloud_storage_user_list_response.py index 907f762..7b51e7d 100644 --- a/src/shellrent_sdk/client/models/cloud_storage_user_list_response.py +++ b/src/shellrent_sdk/client/models/cloud_storage_user_list_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.cloud_storage_user import CloudStorageUser - from ..models.cloud_storage_user_list_response_meta_type_0 import ( - CloudStorageUserListResponseMetaType0, - ) T = TypeVar("T", bound="CloudStorageUserListResponse") @@ -18,17 +15,19 @@ @_attrs_define class CloudStorageUserListResponse: - error: int + """Successful response with a list of `CloudStorageUser`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[CloudStorageUser] - meta: CloudStorageUserListResponseMetaType0 | None + """ Items returned by the operation """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.cloud_storage_user_list_response_meta_type_0 import ( - CloudStorageUserListResponseMetaType0, - ) - error = self.error message: None | str @@ -39,11 +38,7 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - meta: dict[str, Any] | None - if isinstance(self.meta, CloudStorageUserListResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -61,12 +56,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.cloud_storage_user import CloudStorageUser - from ..models.cloud_storage_user_list_response_meta_type_0 import ( - CloudStorageUserListResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -82,20 +76,7 @@ def _parse_message(data: object) -> None | str: data.append(data_item) - def _parse_meta(data: object) -> CloudStorageUserListResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = CloudStorageUserListResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(CloudStorageUserListResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") cloud_storage_user_list_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/cloud_storage_user_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/cloud_storage_user_list_response_meta_type_0.py deleted file mode 100644 index 70bc396..0000000 --- a/src/shellrent_sdk/client/models/cloud_storage_user_list_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="CloudStorageUserListResponseMetaType0") - - -@_attrs_define -class CloudStorageUserListResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - cloud_storage_user_list_response_meta_type_0 = cls() - - cloud_storage_user_list_response_meta_type_0.additional_properties = d - return cloud_storage_user_list_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/cloud_storage_user_response.py b/src/shellrent_sdk/client/models/cloud_storage_user_response.py index 7c2d679..7dfe458 100644 --- a/src/shellrent_sdk/client/models/cloud_storage_user_response.py +++ b/src/shellrent_sdk/client/models/cloud_storage_user_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.cloud_storage_user import CloudStorageUser - from ..models.cloud_storage_user_response_meta_type_0 import CloudStorageUserResponseMetaType0 T = TypeVar("T", bound="CloudStorageUserResponse") @@ -16,17 +15,19 @@ @_attrs_define class CloudStorageUserResponse: - error: int + """Successful response with one `CloudStorageUser`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: CloudStorageUser - meta: CloudStorageUserResponseMetaType0 | None + """ User of a cloud storage, with its quotas and the space used """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.cloud_storage_user_response_meta_type_0 import ( - CloudStorageUserResponseMetaType0, - ) - error = self.error message: None | str @@ -34,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, CloudStorageUserResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -56,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.cloud_storage_user import CloudStorageUser - from ..models.cloud_storage_user_response_meta_type_0 import ( - CloudStorageUserResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -72,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = CloudStorageUser.from_dict(d.pop("data")) - def _parse_meta(data: object) -> CloudStorageUserResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = CloudStorageUserResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(CloudStorageUserResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") cloud_storage_user_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/cloud_storage_user_response_meta_type_0.py b/src/shellrent_sdk/client/models/cloud_storage_user_response_meta_type_0.py deleted file mode 100644 index 375e872..0000000 --- a/src/shellrent_sdk/client/models/cloud_storage_user_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="CloudStorageUserResponseMetaType0") - - -@_attrs_define -class CloudStorageUserResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - cloud_storage_user_response_meta_type_0 = cls() - - cloud_storage_user_response_meta_type_0.additional_properties = d - return cloud_storage_user_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/cloud_storage_user_size_update_request.py b/src/shellrent_sdk/client/models/cloud_storage_user_size_update_request.py index 5595e68..3f6dbe6 100644 --- a/src/shellrent_sdk/client/models/cloud_storage_user_size_update_request.py +++ b/src/shellrent_sdk/client/models/cloud_storage_user_size_update_request.py @@ -4,53 +4,38 @@ from typing import Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset T = TypeVar("T", bound="CloudStorageUserSizeUpdateRequest") @_attrs_define class CloudStorageUserSizeUpdateRequest: - quota_gb: float | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + """New quota of an additional user of the cloud storage""" + + quota_gb: float + """ New quota of the user, in GB (1 GB = 1024 MB), set as both its soft and hard quota: from 0 to the soft quota + of the `PRIMARY` user. Only `ADDITIONAL` users can be changed """ def to_dict(self) -> dict[str, Any]: quota_gb = self.quota_gb field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if quota_gb is not UNSET: - field_dict["quota_gb"] = quota_gb + + field_dict.update( + { + "quota_gb": quota_gb, + } + ) return field_dict @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) - quota_gb = d.pop("quota_gb", UNSET) + quota_gb = d.pop("quota_gb") cloud_storage_user_size_update_request = cls( quota_gb=quota_gb, ) - cloud_storage_user_size_update_request.additional_properties = d return cloud_storage_user_size_update_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/country.py b/src/shellrent_sdk/client/models/country.py index eefd8fa..702033b 100644 --- a/src/shellrent_sdk/client/models/country.py +++ b/src/shellrent_sdk/client/models/country.py @@ -16,13 +16,15 @@ class Country: iso_code_3: str """ ie. ITA """ country_name: str + """ Name of the country in Italian; the local name when there is no translation """ local_name: str + """ Name of the country in its own language, for example `Deutschland` """ phone_code: str - """ +39, +44, ... """ + """ International calling code, without `+`, for example `39` """ continent: str - """ Europe, America, ... """ + """ Continent, in English, for example `Europe` or `North America` """ region: str - """ Macro region """ + """ Area of the country: `EU` (European Union) or `EXTRAEU` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/cpanel_license_response.py b/src/shellrent_sdk/client/models/cpanel_license_response.py deleted file mode 100644 index 00d5722..0000000 --- a/src/shellrent_sdk/client/models/cpanel_license_response.py +++ /dev/null @@ -1,112 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.cpanel_license import CpanelLicense - from ..models.cpanel_license_response_meta_type_0 import CpanelLicenseResponseMetaType0 - - -T = TypeVar("T", bound="CpanelLicenseResponse") - - -@_attrs_define -class CpanelLicenseResponse: - error: int - message: None | str - data: CpanelLicense - meta: CpanelLicenseResponseMetaType0 | None - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.cpanel_license_response_meta_type_0 import CpanelLicenseResponseMetaType0 - - error = self.error - - message: None | str - message = self.message - - data = self.data.to_dict() - - meta: dict[str, Any] | None - if isinstance(self.meta, CpanelLicenseResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "error": error, - "message": message, - "data": data, - "meta": meta, - } - ) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.cpanel_license import CpanelLicense - from ..models.cpanel_license_response_meta_type_0 import ( - CpanelLicenseResponseMetaType0, - ) - - d = dict(src_dict) - error = d.pop("error") - - def _parse_message(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - message = _parse_message(d.pop("message")) - - data = CpanelLicense.from_dict(d.pop("data")) - - def _parse_meta(data: object) -> CpanelLicenseResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = CpanelLicenseResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(CpanelLicenseResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) - - cpanel_license_response = cls( - error=error, - message=message, - data=data, - meta=meta, - ) - - cpanel_license_response.additional_properties = d - return cpanel_license_response - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/cpanel_license_response_meta_type_0.py b/src/shellrent_sdk/client/models/cpanel_license_response_meta_type_0.py deleted file mode 100644 index b08dd30..0000000 --- a/src/shellrent_sdk/client/models/cpanel_license_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="CpanelLicenseResponseMetaType0") - - -@_attrs_define -class CpanelLicenseResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - cpanel_license_response_meta_type_0 = cls() - - cpanel_license_response_meta_type_0.additional_properties = d - return cpanel_license_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/creditnote.py b/src/shellrent_sdk/client/models/creditnote.py index 201a82d..3f23beb 100644 --- a/src/shellrent_sdk/client/models/creditnote.py +++ b/src/shellrent_sdk/client/models/creditnote.py @@ -20,20 +20,41 @@ @_attrs_define class Creditnote: + """Credit note of the account, with its total and electronic invoicing data""" + creditnote_id: int - invoice_id: int + invoice_id: int | None + """ Id of the invoice the credit note refers to (`GET /api/v3/invoices/{invoice_id}`); null when it refers to + none """ billing: AccountBilling + """ Billing profile: the holder the documents are made out to, with its tax and electronic invoicing data """ sdi_document_status: None | SdiDocumentStatus + """ Status of the credit note on SDI, the Italian e-invoicing exchange system; null for the credit notes not + sent through SDI, issued before electronic invoicing """ sdi_document_type: SdiDocumentType + """ Type of an electronic document on SDI, the Italian e-invoicing exchange system (`TipoDocumento`) """ tax_regime: None | TaxRegime + """ Tax regime set on the credit note; null when it uses the one of the billing profile (`billing.tax_regime`) + """ date_emitted: datetime.date - creditnote_year: str + """ Date of issue of the credit note """ + creditnote_year: int | None + """ Year of the numbering of the credit note """ creditnote_number: str + """ Complete number of the credit note: the year followed by the number on 6 digits, for example `2025000123` + """ creditnote_caption: None | str - sdi_identifier: str - sdi_filename: str + """ Legal note of the tax regime printed on the credit note, in Italian, such as the law under which VAT is not + applied; null when the regime has none """ + sdi_identifier: None | str + """ Identifier assigned by SDI to the credit note; null when it has not been sent to SDI """ + sdi_filename: None | str + """ Name of the file sent to SDI; null when not sent, and for the credit notes issued before November 2024 """ total_amount: Amount + """ Amount in euros: the taxable amount and, when computed with a tax regime, the VAT rate, the VAT and the + total, which are null otherwise """ rows_count: int + """ Number of rows of the credit note (`GET /api/v3/credit-notes/{credit_note_id}/rows`) """ date_created: datetime.datetime additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -43,6 +64,7 @@ def to_dict(self) -> dict[str, Any]: creditnote_id = self.creditnote_id + invoice_id: int | None invoice_id = self.invoice_id billing = self.billing.to_dict() @@ -63,6 +85,7 @@ def to_dict(self) -> dict[str, Any]: date_emitted = self.date_emitted.isoformat() + creditnote_year: int | None creditnote_year = self.creditnote_year creditnote_number = self.creditnote_number @@ -70,8 +93,10 @@ def to_dict(self) -> dict[str, Any]: creditnote_caption: None | str creditnote_caption = self.creditnote_caption + sdi_identifier: None | str sdi_identifier = self.sdi_identifier + sdi_filename: None | str sdi_filename = self.sdi_filename total_amount = self.total_amount.to_dict() @@ -115,7 +140,12 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) creditnote_id = d.pop("creditnote_id") - invoice_id = d.pop("invoice_id") + def _parse_invoice_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + invoice_id = _parse_invoice_id(d.pop("invoice_id")) billing = AccountBilling.from_dict(d.pop("billing")) @@ -153,7 +183,12 @@ def _parse_tax_regime(data: object) -> None | TaxRegime: date_emitted = datetime.date.fromisoformat(d.pop("date_emitted")) - creditnote_year = d.pop("creditnote_year") + def _parse_creditnote_year(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + creditnote_year = _parse_creditnote_year(d.pop("creditnote_year")) creditnote_number = d.pop("creditnote_number") @@ -164,9 +199,19 @@ def _parse_creditnote_caption(data: object) -> None | str: creditnote_caption = _parse_creditnote_caption(d.pop("creditnote_caption")) - sdi_identifier = d.pop("sdi_identifier") + def _parse_sdi_identifier(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + sdi_identifier = _parse_sdi_identifier(d.pop("sdi_identifier")) + + def _parse_sdi_filename(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) - sdi_filename = d.pop("sdi_filename") + sdi_filename = _parse_sdi_filename(d.pop("sdi_filename")) total_amount = Amount.from_dict(d.pop("total_amount")) diff --git a/src/shellrent_sdk/client/models/creditnote_paginated_list_response.py b/src/shellrent_sdk/client/models/creditnote_paginated_list_response.py index ed717ac..bd5e85b 100644 --- a/src/shellrent_sdk/client/models/creditnote_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/creditnote_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class CreditnotePaginatedListResponse: - error: int + """Successful response with a page of `Creditnote`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[Creditnote] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.pagination_meta import PaginationMeta d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/creditnote_response.py b/src/shellrent_sdk/client/models/creditnote_response.py index 8525299..949c3e1 100644 --- a/src/shellrent_sdk/client/models/creditnote_response.py +++ b/src/shellrent_sdk/client/models/creditnote_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.creditnote import Creditnote - from ..models.creditnote_response_meta_type_0 import CreditnoteResponseMetaType0 T = TypeVar("T", bound="CreditnoteResponse") @@ -16,15 +15,19 @@ @_attrs_define class CreditnoteResponse: - error: int + """Successful response with one `Creditnote`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: Creditnote - meta: CreditnoteResponseMetaType0 | None + """ Credit note of the account, with its total and electronic invoicing data """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.creditnote_response_meta_type_0 import CreditnoteResponseMetaType0 - error = self.error message: None | str @@ -32,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, CreditnoteResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.creditnote import Creditnote - from ..models.creditnote_response_meta_type_0 import ( - CreditnoteResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -70,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = Creditnote.from_dict(d.pop("data")) - def _parse_meta(data: object) -> CreditnoteResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = CreditnoteResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(CreditnoteResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") creditnote_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/creditnote_response_meta_type_0.py b/src/shellrent_sdk/client/models/creditnote_response_meta_type_0.py deleted file mode 100644 index fd17590..0000000 --- a/src/shellrent_sdk/client/models/creditnote_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="CreditnoteResponseMetaType0") - - -@_attrs_define -class CreditnoteResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - creditnote_response_meta_type_0 = cls() - - creditnote_response_meta_type_0.additional_properties = d - return creditnote_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/creditnote_row.py b/src/shellrent_sdk/client/models/creditnote_row.py index 79364c7..e45c78e 100644 --- a/src/shellrent_sdk/client/models/creditnote_row.py +++ b/src/shellrent_sdk/client/models/creditnote_row.py @@ -17,15 +17,27 @@ @_attrs_define class CreditnoteRow: + """Row of a credit note""" + creditnote_row_id: int creditnote_id: int - invoice_row_id: int + """ Id of the credit note (`GET /api/v3/credit-notes/{credit_note_id}`) """ + invoice_row_id: int | None + """ Id of the invoice row that the credit note row refers to (`GET + /api/v3/invoices/{invoice_id}/rows/{row_id}`); null when it refers to none """ reason: None | str + """ Reason of the row, in Italian, for example `Errato Addebito` (wrong charge) or `Servizio non Erogato` + (service not provided) """ description: str amount: Amount + """ Amount in euros: the taxable amount and, when computed with a tax regime, the VAT rate, the VAT and the + total, which are null otherwise """ billing_data: BillingData + """ Italian public administration codes of a document row: CIG, CUP and ODA """ date_start: datetime.date | None + """ Start of the period the row refers to; null when the row has no period """ date_end: datetime.date | None + """ End of the period the row refers to; null when the row has no period """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -33,6 +45,7 @@ def to_dict(self) -> dict[str, Any]: creditnote_id = self.creditnote_id + invoice_row_id: int | None invoice_row_id = self.invoice_row_id reason: None | str @@ -84,7 +97,12 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: creditnote_id = d.pop("creditnote_id") - invoice_row_id = d.pop("invoice_row_id") + def _parse_invoice_row_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + invoice_row_id = _parse_invoice_row_id(d.pop("invoice_row_id")) def _parse_reason(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/creditnote_row_list_response.py b/src/shellrent_sdk/client/models/creditnote_row_list_response.py index 5c93f4e..23a6fa5 100644 --- a/src/shellrent_sdk/client/models/creditnote_row_list_response.py +++ b/src/shellrent_sdk/client/models/creditnote_row_list_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.creditnote_row import CreditnoteRow - from ..models.creditnote_row_list_response_meta_type_0 import CreditnoteRowListResponseMetaType0 T = TypeVar("T", bound="CreditnoteRowListResponse") @@ -16,17 +15,19 @@ @_attrs_define class CreditnoteRowListResponse: - error: int + """Successful response with a list of `CreditnoteRow`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[CreditnoteRow] - meta: CreditnoteRowListResponseMetaType0 | None + """ Items returned by the operation """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.creditnote_row_list_response_meta_type_0 import ( - CreditnoteRowListResponseMetaType0, - ) - error = self.error message: None | str @@ -37,11 +38,7 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - meta: dict[str, Any] | None - if isinstance(self.meta, CreditnoteRowListResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -59,12 +56,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.creditnote_row import CreditnoteRow - from ..models.creditnote_row_list_response_meta_type_0 import ( - CreditnoteRowListResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -80,20 +76,7 @@ def _parse_message(data: object) -> None | str: data.append(data_item) - def _parse_meta(data: object) -> CreditnoteRowListResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = CreditnoteRowListResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(CreditnoteRowListResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") creditnote_row_list_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/creditnote_row_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/creditnote_row_list_response_meta_type_0.py deleted file mode 100644 index e156cf5..0000000 --- a/src/shellrent_sdk/client/models/creditnote_row_list_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="CreditnoteRowListResponseMetaType0") - - -@_attrs_define -class CreditnoteRowListResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - creditnote_row_list_response_meta_type_0 = cls() - - creditnote_row_list_response_meta_type_0.additional_properties = d - return creditnote_row_list_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/creditnote_row_response.py b/src/shellrent_sdk/client/models/creditnote_row_response.py index 60e0775..60b34f1 100644 --- a/src/shellrent_sdk/client/models/creditnote_row_response.py +++ b/src/shellrent_sdk/client/models/creditnote_row_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.creditnote_row import CreditnoteRow - from ..models.creditnote_row_response_meta_type_0 import CreditnoteRowResponseMetaType0 T = TypeVar("T", bound="CreditnoteRowResponse") @@ -16,15 +15,19 @@ @_attrs_define class CreditnoteRowResponse: - error: int + """Successful response with one `CreditnoteRow`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: CreditnoteRow - meta: CreditnoteRowResponseMetaType0 | None + """ Row of a credit note """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.creditnote_row_response_meta_type_0 import CreditnoteRowResponseMetaType0 - error = self.error message: None | str @@ -32,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, CreditnoteRowResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.creditnote_row import CreditnoteRow - from ..models.creditnote_row_response_meta_type_0 import ( - CreditnoteRowResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -70,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = CreditnoteRow.from_dict(d.pop("data")) - def _parse_meta(data: object) -> CreditnoteRowResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = CreditnoteRowResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(CreditnoteRowResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") creditnote_row_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/creditnote_row_response_meta_type_0.py b/src/shellrent_sdk/client/models/creditnote_row_response_meta_type_0.py deleted file mode 100644 index fb55c93..0000000 --- a/src/shellrent_sdk/client/models/creditnote_row_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="CreditnoteRowResponseMetaType0") - - -@_attrs_define -class CreditnoteRowResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - creditnote_row_response_meta_type_0 = cls() - - creditnote_row_response_meta_type_0.additional_properties = d - return creditnote_row_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/dns_record.py b/src/shellrent_sdk/client/models/dns_record.py index d739c8e..a0f47a4 100644 --- a/src/shellrent_sdk/client/models/dns_record.py +++ b/src/shellrent_sdk/client/models/dns_record.py @@ -16,19 +16,40 @@ @_attrs_define class DnsRecord: + """Record of the DNS zone of a domain""" + record_id: str type_: str + """ Type of the record, for example `A`, `CNAME`, `MX` or `TXT` """ host: str + """ Name of the record relative to the zone, `@` for the domain itself; for SRV and TLSA records, without the + service and the protocol """ service: None | str + """ Service of SRV records (for example `_sip`) and port of TLSA records (for example `_443`), with the + underscore; null for the other types """ protocol: None | str + """ Protocol of SRV and TLSA records: `_tcp`, `_udp` or `_tls`; null for the other types """ destination: str - port: str + """ Value of the record: the IPv4 address for A, the IPv6 address for AAAA, the target hostname for CNAME, MX, + NS, PTR and SRV, the text for TXT and SPF, the value of the tag for CAA, the certificate association data for + TLSA """ + port: None | str + """ Port of the service, for SRV records; null for the other types """ weight: int | None + """ Weight of SRV records; `0` for the other types """ priority: int | None + """ Priority of MX and SRV records; null for the other types and, with the standard and external nameservers, + when it is `0` """ ttl: int | None + """ TTL of the record, in seconds: with Cloudflare null means automatic, with the standard and external + nameservers it is the TTL of the zone (`PATCH /api/v3/domains/{domain_id}/dns`) """ proxied: bool + """ Whether the traffic of the record goes through the Cloudflare proxy; always false with the other nameserver + types """ caa_data: DnsRecordCaaData | None + """ Data of CAA records; null for the other types """ tlsa_data: DnsRecordTlsaData | None + """ Data of TLSA records; null for the other types """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -49,6 +70,7 @@ def to_dict(self) -> dict[str, Any]: destination = self.destination + port: None | str port = self.port weight: int | None @@ -124,7 +146,12 @@ def _parse_protocol(data: object) -> None | str: destination = d.pop("destination") - port = d.pop("port") + def _parse_port(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + port = _parse_port(d.pop("port")) def _parse_weight(data: object) -> int | None: if data is None: diff --git a/src/shellrent_sdk/client/models/dns_record_caa_data.py b/src/shellrent_sdk/client/models/dns_record_caa_data.py index a766054..6f04393 100644 --- a/src/shellrent_sdk/client/models/dns_record_caa_data.py +++ b/src/shellrent_sdk/client/models/dns_record_caa_data.py @@ -11,9 +11,15 @@ @_attrs_define class DnsRecordCaaData: + """Flags and tag of a CAA record; the value of the tag is in `destination` of the record""" + flag: int | None + """ Flags of the CAA record; the API writes only `0` """ tag_value: None | str + """ Tag of the CAA record, for example `issue` or `issuewild` """ can_sign_http_exchanges: bool | None + """ Whether the value of the tag has the parameter `cansignhttpexchanges=yes`; null when the parameter is + missing """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/dns_record_paginated_list_response.py b/src/shellrent_sdk/client/models/dns_record_paginated_list_response.py index 13b6aa9..ab40bc2 100644 --- a/src/shellrent_sdk/client/models/dns_record_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/dns_record_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class DnsRecordPaginatedListResponse: - error: int + """Successful response with a page of `DnsRecord`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[DnsRecord] + """ Items of the page: an empty list beyond the last page """ meta: SimplePaginationMeta + """ Pagination of a list without the totals: `next` says whether there is another page """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.simple_pagination_meta import SimplePaginationMeta d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/dns_record_response.py b/src/shellrent_sdk/client/models/dns_record_response.py index b81b79c..7d74f6b 100644 --- a/src/shellrent_sdk/client/models/dns_record_response.py +++ b/src/shellrent_sdk/client/models/dns_record_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.dns_record import DnsRecord - from ..models.dns_record_response_meta_type_0 import DnsRecordResponseMetaType0 T = TypeVar("T", bound="DnsRecordResponse") @@ -16,15 +15,19 @@ @_attrs_define class DnsRecordResponse: - error: int + """Successful response with one `DnsRecord`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: DnsRecord - meta: DnsRecordResponseMetaType0 | None + """ Record of the DNS zone of a domain """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.dns_record_response_meta_type_0 import DnsRecordResponseMetaType0 - error = self.error message: None | str @@ -32,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, DnsRecordResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.dns_record import DnsRecord - from ..models.dns_record_response_meta_type_0 import ( - DnsRecordResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -70,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = DnsRecord.from_dict(d.pop("data")) - def _parse_meta(data: object) -> DnsRecordResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = DnsRecordResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(DnsRecordResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") dns_record_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/dns_record_response_meta_type_0.py b/src/shellrent_sdk/client/models/dns_record_response_meta_type_0.py deleted file mode 100644 index 041f650..0000000 --- a/src/shellrent_sdk/client/models/dns_record_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="DnsRecordResponseMetaType0") - - -@_attrs_define -class DnsRecordResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - dns_record_response_meta_type_0 = cls() - - dns_record_response_meta_type_0.additional_properties = d - return dns_record_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/dns_record_tlsa_data.py b/src/shellrent_sdk/client/models/dns_record_tlsa_data.py index f41c21f..bdd8ef6 100644 --- a/src/shellrent_sdk/client/models/dns_record_tlsa_data.py +++ b/src/shellrent_sdk/client/models/dns_record_tlsa_data.py @@ -11,9 +11,14 @@ @_attrs_define class DnsRecordTlsaData: + """Parameters of a TLSA record; the certificate association data is in `destination` of the record""" + usage: None | str + """ Certificate usage: `0` (PKIX-TA), `1` (PKIX-EE), `2` (DANE-TA) or `3` (DANE-EE) """ selector: None | str + """ Selector: `0` for the full certificate, `1` for its public key (SubjectPublicKeyInfo) """ matching_type: None | str + """ Matching type: `0` for the data without hashing, `1` for SHA-256, `2` for SHA-512 """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/dns_type.py b/src/shellrent_sdk/client/models/dns_type.py index b16f7c8..2303540 100644 --- a/src/shellrent_sdk/client/models/dns_type.py +++ b/src/shellrent_sdk/client/models/dns_type.py @@ -11,8 +11,13 @@ @_attrs_define class DnsType: + """Nameserver type of a domain, which decides where its DNS zone is managed""" + type_code: str + """ Code of the nameserver type: `INTERNAL` (our "standard" nameservers), `EXTERNAL` (nameservers of a third + party) or `CLOUDFLARE` (Cloudflare nameservers, with a Cloudflare account) """ type_name: str + """ Name of the nameserver type, in Italian: `Standard`, `Esterna` or `Cloudflare` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/dns_zone.py b/src/shellrent_sdk/client/models/dns_zone.py index c5e2490..55e224c 100644 --- a/src/shellrent_sdk/client/models/dns_zone.py +++ b/src/shellrent_sdk/client/models/dns_zone.py @@ -11,10 +11,17 @@ @_attrs_define class DnsZone: + """DNS zone of a domain, on our nameservers or at Cloudflare""" + zone_id: str + """ Id of the zone on our nameservers or at Cloudflare """ zone_name: str + """ Name of the zone: the domain name in punycode """ nameservers: list[str] - ttl: int + """ Hostnames of the nameservers of the zone; with Cloudflare, the ones that Cloudflare assigned to it """ + ttl: int | None + """ TTL of the zone, in seconds, which with the standard and external nameservers is also the TTL of every + record; null with Cloudflare, whose zones have no TTL """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -24,6 +31,7 @@ def to_dict(self) -> dict[str, Any]: nameservers = self.nameservers + ttl: int | None ttl = self.ttl field_dict: dict[str, Any] = {} @@ -48,7 +56,12 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: nameservers = cast(list[str], d.pop("nameservers")) - ttl = d.pop("ttl") + def _parse_ttl(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + ttl = _parse_ttl(d.pop("ttl")) dns_zone = cls( zone_id=zone_id, diff --git a/src/shellrent_sdk/client/models/dns_zone_response.py b/src/shellrent_sdk/client/models/dns_zone_response.py index ff4dcd2..9007da9 100644 --- a/src/shellrent_sdk/client/models/dns_zone_response.py +++ b/src/shellrent_sdk/client/models/dns_zone_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.dns_zone import DnsZone - from ..models.dns_zone_response_meta_type_0 import DnsZoneResponseMetaType0 T = TypeVar("T", bound="DnsZoneResponse") @@ -16,15 +15,19 @@ @_attrs_define class DnsZoneResponse: - error: int + """Successful response with one `DnsZone`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: DnsZone - meta: DnsZoneResponseMetaType0 | None + """ DNS zone of a domain, on our nameservers or at Cloudflare """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.dns_zone_response_meta_type_0 import DnsZoneResponseMetaType0 - error = self.error message: None | str @@ -32,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, DnsZoneResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,10 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.dns_zone import DnsZone - from ..models.dns_zone_response_meta_type_0 import DnsZoneResponseMetaType0 d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -68,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = DnsZone.from_dict(d.pop("data")) - def _parse_meta(data: object) -> DnsZoneResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = DnsZoneResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(DnsZoneResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") dns_zone_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/dns_zone_response_meta_type_0.py b/src/shellrent_sdk/client/models/dns_zone_response_meta_type_0.py deleted file mode 100644 index 3ad891a..0000000 --- a/src/shellrent_sdk/client/models/dns_zone_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="DnsZoneResponseMetaType0") - - -@_attrs_define -class DnsZoneResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - dns_zone_response_meta_type_0 = cls() - - dns_zone_response_meta_type_0.additional_properties = d - return dns_zone_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/dnssec_ds_data.py b/src/shellrent_sdk/client/models/dnssec_ds_data.py index 2e2a14c..2339a75 100644 --- a/src/shellrent_sdk/client/models/dnssec_ds_data.py +++ b/src/shellrent_sdk/client/models/dnssec_ds_data.py @@ -11,11 +11,18 @@ @_attrs_define class DnssecDsData: + """DS (delegation signer) record of the domain""" + zone_ttl: int + """ TTL of the zone, in seconds """ key_tag: int + """ Key tag of the DNSKEY the record refers to """ key_algorithm: int + """ DNSSEC algorithm of the key, for example `8` (RSA/SHA-256) or `13` (ECDSAP256SHA256) """ digest_type: int + """ Algorithm of the digest, for example `1` (SHA-1), `2` (SHA-256) or `4` (SHA-384) """ digest_value: str + """ Digest of the DNSKEY, in hexadecimal """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/dnssec_key_data.py b/src/shellrent_sdk/client/models/dnssec_key_data.py index 1fbee76..24c78b2 100644 --- a/src/shellrent_sdk/client/models/dnssec_key_data.py +++ b/src/shellrent_sdk/client/models/dnssec_key_data.py @@ -11,11 +11,18 @@ @_attrs_define class DnssecKeyData: + """DNSKEY record of the domain""" + zone_ttl: int + """ TTL of the zone, in seconds """ flags: int + """ Flags of the key: `256` for a zone signing key (ZSK), `257` for a key signing key (KSK) """ key_protocol: int + """ Protocol of the key, `3` for DNSSEC """ key_algorithm: int + """ DNSSEC algorithm of the key, for example `8` (RSA/SHA-256) or `13` (ECDSAP256SHA256) """ public_key: str + """ Public key, in base64 """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/domain.py b/src/shellrent_sdk/client/models/domain.py index 52379e4..d1fb678 100644 --- a/src/shellrent_sdk/client/models/domain.py +++ b/src/shellrent_sdk/client/models/domain.py @@ -11,6 +11,7 @@ from ..models.dns_type import DnsType from ..models.domain_data import DomainData from ..models.domain_name import DomainName + from ..models.domain_nameserver import DomainNameserver T = TypeVar("T", bound="Domain") @@ -18,18 +19,31 @@ @_attrs_define class Domain: + """Domain of the account, with its nameservers and its data at the registry""" + domain_id: int tld_id: int + """ Id of the TLD of the domain (`GET /api/v3/tlds/{tld_id}`) """ domain_name: DomainName + """ Name of a domain, whole and split into name and extension, in Unicode and in punycode """ dns_type: DnsType + """ Nameserver type of a domain, which decides where its DNS zone is managed """ dns_account: None | str - nameservers: list[str] + """ Email of the Cloudflare account that manages the DNS zone, with the Cloudflare nameservers; null with the + other nameserver types, and when the zone is on our own Cloudflare account """ + nameservers: list[DomainNameserver] + """ Nameservers of the domain; `sort` gives their order """ domain_data: DomainData | None + """ Data of the domain at the registry; null when there are none """ contacts_count: int - dnssec_enabled: bool + """ Number of active contacts of the domain """ date_info_last: datetime.datetime | None + """ When the data of the domain were last requested from the registry """ date_dns_check: datetime.datetime | None + """ When the DNS zone and the DNSSEC of the domain were last checked """ vanity_nameserver_enabled: bool + """ Whether the domain uses vanity nameservers: our nameservers with hostnames of the domain itself (for example + `ns1.example.com`) """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -46,7 +60,10 @@ def to_dict(self) -> dict[str, Any]: dns_account: None | str dns_account = self.dns_account - nameservers = self.nameservers + nameservers = [] + for nameservers_item_data in self.nameservers: + nameservers_item = nameservers_item_data.to_dict() + nameservers.append(nameservers_item) domain_data: dict[str, Any] | None if isinstance(self.domain_data, DomainData): @@ -56,8 +73,6 @@ def to_dict(self) -> dict[str, Any]: contacts_count = self.contacts_count - dnssec_enabled = self.dnssec_enabled - date_info_last: None | str if isinstance(self.date_info_last, datetime.datetime): date_info_last = self.date_info_last.isoformat() @@ -84,7 +99,6 @@ def to_dict(self) -> dict[str, Any]: "nameservers": nameservers, "domain_data": domain_data, "contacts_count": contacts_count, - "dnssec_enabled": dnssec_enabled, "date_info_last": date_info_last, "date_dns_check": date_dns_check, "vanity_nameserver_enabled": vanity_nameserver_enabled, @@ -98,6 +112,7 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.dns_type import DnsType from ..models.domain_data import DomainData from ..models.domain_name import DomainName + from ..models.domain_nameserver import DomainNameserver d = dict(src_dict) domain_id = d.pop("domain_id") @@ -115,7 +130,12 @@ def _parse_dns_account(data: object) -> None | str: dns_account = _parse_dns_account(d.pop("dns_account")) - nameservers = cast(list[str], d.pop("nameservers")) + nameservers = [] + _nameservers = d.pop("nameservers") + for nameservers_item_data in _nameservers: + nameservers_item = DomainNameserver.from_dict(nameservers_item_data) + + nameservers.append(nameservers_item) def _parse_domain_data(data: object) -> DomainData | None: if data is None: @@ -134,8 +154,6 @@ def _parse_domain_data(data: object) -> DomainData | None: contacts_count = d.pop("contacts_count") - dnssec_enabled = d.pop("dnssec_enabled") - def _parse_date_info_last(data: object) -> datetime.datetime | None: if data is None: return data @@ -177,7 +195,6 @@ def _parse_date_dns_check(data: object) -> datetime.datetime | None: nameservers=nameservers, domain_data=domain_data, contacts_count=contacts_count, - dnssec_enabled=dnssec_enabled, date_info_last=date_info_last, date_dns_check=date_dns_check, vanity_nameserver_enabled=vanity_nameserver_enabled, diff --git a/src/shellrent_sdk/client/models/domain_availability.py b/src/shellrent_sdk/client/models/domain_availability.py index 1a67a7a..b30e1c5 100644 --- a/src/shellrent_sdk/client/models/domain_availability.py +++ b/src/shellrent_sdk/client/models/domain_availability.py @@ -1,13 +1,14 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar +from typing import TYPE_CHECKING, Any, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.domain_name import DomainName + from ..models.domain_premium_prices import DomainPremiumPrices T = TypeVar("T", bound="DomainAvailability") @@ -15,21 +16,43 @@ @_attrs_define class DomainAvailability: + """Availability of a domain name (whois): how it can be bought and, for premium domains, our prices""" + domain_name: DomainName + """ Name of a domain, whole and split into name and extension, in Unicode and in punycode """ availability: str + """ How the domain can be bought: `A` (available: it can be registered), `T` (already registered: it can be + transferred) or `R` (expired with us: it can be restored) """ + premium: bool + """ Whether the registry sells the domain at a premium price, which it sets itself """ + premium_prices: DomainPremiumPrices | None + """ Our prices for the premium domain; null when the domain is not premium, when the registry gave no price (the + domain cannot be bought) and for sub-accounts """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + from ..models.domain_premium_prices import DomainPremiumPrices + domain_name = self.domain_name.to_dict() availability = self.availability + premium = self.premium + + premium_prices: dict[str, Any] | None + if isinstance(self.premium_prices, DomainPremiumPrices): + premium_prices = self.premium_prices.to_dict() + else: + premium_prices = self.premium_prices + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( { "domain_name": domain_name, "availability": availability, + "premium": premium, + "premium_prices": premium_prices, } ) @@ -38,15 +61,35 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.domain_name import DomainName + from ..models.domain_premium_prices import DomainPremiumPrices d = dict(src_dict) domain_name = DomainName.from_dict(d.pop("domain_name")) availability = d.pop("availability") + premium = d.pop("premium") + + def _parse_premium_prices(data: object) -> DomainPremiumPrices | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + premium_prices_type_0 = DomainPremiumPrices.from_dict(data) + + return premium_prices_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(DomainPremiumPrices | None, data) + + premium_prices = _parse_premium_prices(d.pop("premium_prices")) + domain_availability = cls( domain_name=domain_name, availability=availability, + premium=premium, + premium_prices=premium_prices, ) domain_availability.additional_properties = d diff --git a/src/shellrent_sdk/client/models/domain_availability_response.py b/src/shellrent_sdk/client/models/domain_availability_response.py index e2d3224..711c6ea 100644 --- a/src/shellrent_sdk/client/models/domain_availability_response.py +++ b/src/shellrent_sdk/client/models/domain_availability_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.domain_availability import DomainAvailability - from ..models.domain_availability_response_meta_type_0 import ( - DomainAvailabilityResponseMetaType0, - ) T = TypeVar("T", bound="DomainAvailabilityResponse") @@ -18,17 +15,19 @@ @_attrs_define class DomainAvailabilityResponse: - error: int + """Successful response with one `DomainAvailability`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: DomainAvailability - meta: DomainAvailabilityResponseMetaType0 | None + """ Availability of a domain name (whois): how it can be bought and, for premium domains, our prices """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.domain_availability_response_meta_type_0 import ( - DomainAvailabilityResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, DomainAvailabilityResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -58,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.domain_availability import DomainAvailability - from ..models.domain_availability_response_meta_type_0 import ( - DomainAvailabilityResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -74,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = DomainAvailability.from_dict(d.pop("data")) - def _parse_meta(data: object) -> DomainAvailabilityResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = DomainAvailabilityResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(DomainAvailabilityResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") domain_availability_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/domain_availability_response_meta_type_0.py b/src/shellrent_sdk/client/models/domain_availability_response_meta_type_0.py deleted file mode 100644 index 7fd6843..0000000 --- a/src/shellrent_sdk/client/models/domain_availability_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="DomainAvailabilityResponseMetaType0") - - -@_attrs_define -class DomainAvailabilityResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - domain_availability_response_meta_type_0 = cls() - - domain_availability_response_meta_type_0.additional_properties = d - return domain_availability_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/domain_can_change_nameservers.py b/src/shellrent_sdk/client/models/domain_can_change_nameservers.py index c6a40f7..a9aa7db 100644 --- a/src/shellrent_sdk/client/models/domain_can_change_nameservers.py +++ b/src/shellrent_sdk/client/models/domain_can_change_nameservers.py @@ -11,10 +11,21 @@ @_attrs_define class DomainCanChangeNameservers: + """Nameserver types that can be activated on the domain now: none while the purchase of the domain is not active or has + an operation running, or while the nameservers are being changed + + """ + domain_id: int can_activate_standard: bool + """ Whether the standard nameservers can be activated (`PUT /api/v3/domains/{domain_id}/dns/standard`); false + when they are the current ones """ can_activate_cloudflare: bool + """ Whether the Cloudflare nameservers can be activated (`PUT /api/v3/domains/{domain_id}/dns/cloudflare`); + false when they are the current ones """ can_activate_external: bool + """ Whether the external nameservers can be activated (`PUT /api/v3/domains/{domain_id}/dns/external`); false + when they are the current ones """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/domain_can_change_nameservers_response.py b/src/shellrent_sdk/client/models/domain_can_change_nameservers_response.py index 3f355b8..7043b5a 100644 --- a/src/shellrent_sdk/client/models/domain_can_change_nameservers_response.py +++ b/src/shellrent_sdk/client/models/domain_can_change_nameservers_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.domain_can_change_nameservers import DomainCanChangeNameservers - from ..models.domain_can_change_nameservers_response_meta_type_0 import ( - DomainCanChangeNameserversResponseMetaType0, - ) T = TypeVar("T", bound="DomainCanChangeNameserversResponse") @@ -18,17 +15,20 @@ @_attrs_define class DomainCanChangeNameserversResponse: - error: int + """Successful response with one `DomainCanChangeNameservers`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: DomainCanChangeNameservers - meta: DomainCanChangeNameserversResponseMetaType0 | None + """ Nameserver types that can be activated on the domain now: none while the purchase of the domain is not + active or has an operation running, or while the nameservers are being changed """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.domain_can_change_nameservers_response_meta_type_0 import ( - DomainCanChangeNameserversResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +36,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, DomainCanChangeNameserversResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -60,12 +56,11 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.domain_can_change_nameservers import ( DomainCanChangeNameservers, ) - from ..models.domain_can_change_nameservers_response_meta_type_0 import ( - DomainCanChangeNameserversResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -76,20 +71,7 @@ def _parse_message(data: object) -> None | str: data = DomainCanChangeNameservers.from_dict(d.pop("data")) - def _parse_meta(data: object) -> DomainCanChangeNameserversResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = DomainCanChangeNameserversResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(DomainCanChangeNameserversResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") domain_can_change_nameservers_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/domain_can_change_nameservers_response_meta_type_0.py b/src/shellrent_sdk/client/models/domain_can_change_nameservers_response_meta_type_0.py deleted file mode 100644 index 4874ebf..0000000 --- a/src/shellrent_sdk/client/models/domain_can_change_nameservers_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="DomainCanChangeNameserversResponseMetaType0") - - -@_attrs_define -class DomainCanChangeNameserversResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - domain_can_change_nameservers_response_meta_type_0 = cls() - - domain_can_change_nameservers_response_meta_type_0.additional_properties = d - return domain_can_change_nameservers_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/domain_contact.py b/src/shellrent_sdk/client/models/domain_contact.py index 2684229..4f5419a 100644 --- a/src/shellrent_sdk/client/models/domain_contact.py +++ b/src/shellrent_sdk/client/models/domain_contact.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar +from typing import TYPE_CHECKING, Any, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,11 +15,18 @@ @_attrs_define class DomainContact: + """Contact of a domain at the registry, with its data""" + domain_contact_id: int domain_id: int + """ Id of the domain (`GET /api/v3/domains/{domain_id}`) """ type_: str - to_sync: bool + """ Role of the contact: `R` (registrant), `A` (administrative), `T` (technical) or `O` (organization) """ + to_sync: bool | None + """ Whether the contact has changes not yet sent to the registry (`POST + /api/v3/domains/{domain_id}/contacts/synchronizations`) """ contact_data: list[DomainContactData] + """ Data of the contact, one item per field """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -29,6 +36,7 @@ def to_dict(self) -> dict[str, Any]: type_ = self.type_ + to_sync: bool | None to_sync = self.to_sync contact_data = [] @@ -61,7 +69,12 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: type_ = d.pop("type") - to_sync = d.pop("to_sync") + def _parse_to_sync(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) + + to_sync = _parse_to_sync(d.pop("to_sync")) contact_data = [] _contact_data = d.pop("contact_data") diff --git a/src/shellrent_sdk/client/models/domain_contact_data.py b/src/shellrent_sdk/client/models/domain_contact_data.py index a2b173c..0a85ecc 100644 --- a/src/shellrent_sdk/client/models/domain_contact_data.py +++ b/src/shellrent_sdk/client/models/domain_contact_data.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import Any, Self, TypeVar +from typing import Any, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -11,13 +11,20 @@ @_attrs_define class DomainContactData: + """Field of the data of a domain contact""" + data_field: str - data_value: str + """ Code of the field, for example `FIRST_NAME`, `EMAIL` or `DOT_IT_ENTITY_TYPE` (see `contact_data` of `GET + /api/v3/tlds/{tld_id}`) """ + data_value: None | str + """ Value of the field; for `PHONE_PREFIX` and `FAX_PREFIX`, the id of the country of the prefix; for + `BIRTHDAY`, a date `YYYY-MM-DD` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data_field = self.data_field + data_value: None | str data_value = self.data_value field_dict: dict[str, Any] = {} @@ -36,7 +43,12 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) data_field = d.pop("data_field") - data_value = d.pop("data_value") + def _parse_data_value(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + data_value = _parse_data_value(d.pop("data_value")) domain_contact_data = cls( data_field=data_field, diff --git a/src/shellrent_sdk/client/models/domain_contact_list_response.py b/src/shellrent_sdk/client/models/domain_contact_list_response.py index c6e9038..cda4af1 100644 --- a/src/shellrent_sdk/client/models/domain_contact_list_response.py +++ b/src/shellrent_sdk/client/models/domain_contact_list_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.domain_contact import DomainContact - from ..models.domain_contact_list_response_meta_type_0 import DomainContactListResponseMetaType0 T = TypeVar("T", bound="DomainContactListResponse") @@ -16,17 +15,19 @@ @_attrs_define class DomainContactListResponse: - error: int + """Successful response with a list of `DomainContact`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[DomainContact] - meta: DomainContactListResponseMetaType0 | None + """ Items returned by the operation """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.domain_contact_list_response_meta_type_0 import ( - DomainContactListResponseMetaType0, - ) - error = self.error message: None | str @@ -37,11 +38,7 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - meta: dict[str, Any] | None - if isinstance(self.meta, DomainContactListResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -59,12 +56,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.domain_contact import DomainContact - from ..models.domain_contact_list_response_meta_type_0 import ( - DomainContactListResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -80,20 +76,7 @@ def _parse_message(data: object) -> None | str: data.append(data_item) - def _parse_meta(data: object) -> DomainContactListResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = DomainContactListResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(DomainContactListResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") domain_contact_list_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/domain_contact_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/domain_contact_list_response_meta_type_0.py deleted file mode 100644 index ecfba79..0000000 --- a/src/shellrent_sdk/client/models/domain_contact_list_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="DomainContactListResponseMetaType0") - - -@_attrs_define -class DomainContactListResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - domain_contact_list_response_meta_type_0 = cls() - - domain_contact_list_response_meta_type_0.additional_properties = d - return domain_contact_list_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/domain_contact_request.py b/src/shellrent_sdk/client/models/domain_contact_request.py index 669a4d1..1de2327 100644 --- a/src/shellrent_sdk/client/models/domain_contact_request.py +++ b/src/shellrent_sdk/client/models/domain_contact_request.py @@ -4,7 +4,6 @@ from typing import TYPE_CHECKING, Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.domain_contact_request_contact_data_item import ( @@ -18,7 +17,7 @@ @_attrs_define class DomainContactRequest: contact_data: list[DomainContactRequestContactDataItem] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + """ Fields to change, one item per field; the fields not sent keep their value """ def to_dict(self) -> dict[str, Any]: contact_data = [] @@ -27,7 +26,7 @@ def to_dict(self) -> dict[str, Any]: contact_data.append(contact_data_item) field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "contact_data": contact_data, @@ -56,21 +55,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: contact_data=contact_data, ) - domain_contact_request.additional_properties = d return domain_contact_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/domain_contact_request_contact_data_item.py b/src/shellrent_sdk/client/models/domain_contact_request_contact_data_item.py index 58b9a92..daa8d2c 100644 --- a/src/shellrent_sdk/client/models/domain_contact_request_contact_data_item.py +++ b/src/shellrent_sdk/client/models/domain_contact_request_contact_data_item.py @@ -12,7 +12,10 @@ @_attrs_define class DomainContactRequestContactDataItem: data_field: str + """ Code of the field, as in `contact_data` of the contact (for example `EMAIL`) """ data_value: str + """ New value of the field; for `PHONE_PREFIX` and `FAX_PREFIX`, the id of the country of the prefix, one of the + `enum` of the field in `contact_data` of `GET /api/v3/tlds/{tld_id}`; for `BIRTHDAY`, a date `YYYY-MM-DD` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/domain_contact_response.py b/src/shellrent_sdk/client/models/domain_contact_response.py index 3c2ac37..7318f8c 100644 --- a/src/shellrent_sdk/client/models/domain_contact_response.py +++ b/src/shellrent_sdk/client/models/domain_contact_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.domain_contact import DomainContact - from ..models.domain_contact_response_meta_type_0 import DomainContactResponseMetaType0 T = TypeVar("T", bound="DomainContactResponse") @@ -16,15 +15,19 @@ @_attrs_define class DomainContactResponse: - error: int + """Successful response with one `DomainContact`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: DomainContact - meta: DomainContactResponseMetaType0 | None + """ Contact of a domain at the registry, with its data """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.domain_contact_response_meta_type_0 import DomainContactResponseMetaType0 - error = self.error message: None | str @@ -32,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, DomainContactResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.domain_contact import DomainContact - from ..models.domain_contact_response_meta_type_0 import ( - DomainContactResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -70,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = DomainContact.from_dict(d.pop("data")) - def _parse_meta(data: object) -> DomainContactResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = DomainContactResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(DomainContactResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") domain_contact_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/domain_contact_response_meta_type_0.py b/src/shellrent_sdk/client/models/domain_contact_response_meta_type_0.py deleted file mode 100644 index 78fdc19..0000000 --- a/src/shellrent_sdk/client/models/domain_contact_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="DomainContactResponseMetaType0") - - -@_attrs_define -class DomainContactResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - domain_contact_response_meta_type_0 = cls() - - domain_contact_response_meta_type_0.additional_properties = d - return domain_contact_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/domain_data.py b/src/shellrent_sdk/client/models/domain_data.py index 9e1b153..1e17f8f 100644 --- a/src/shellrent_sdk/client/models/domain_data.py +++ b/src/shellrent_sdk/client/models/domain_data.py @@ -12,20 +12,41 @@ @_attrs_define class DomainData: + """Data of the domain at the registry""" + registry_status: None | str + """ Status of the domain as the registry reports it, for example `ok`, `clientTransferProhibited` or + `pendingDelete` """ incoming_authcode: None | str + """ Authcode given for the incoming transfer of the domain; null without the `domains:secrets` scope """ outgoing_authcode: None | str + """ Authcode to transfer the domain to another registrar; null without the `domains:secrets` scope """ registry_nameservers: None | str + """ Nameservers of the domain at the registry, as a text in the format of the registry (usually hostnames + separated by commas) """ registry_expiry: datetime.datetime | None + """ Expiry of the domain at the registry """ registry_created: datetime.datetime | None + """ Registration of the domain at the registry """ registry_updated: datetime.datetime | None + """ Last update of the domain at the registry """ registry_deletion: datetime.datetime | None + """ Deletion of the domain at the registry, when the registry reports one """ date_deactivation: datetime.datetime | None + """ When these data were deactivated because the registrar no longer has the domain (for example after an + outgoing transfer); null while they are active """ identity_validation_status: None | str + """ Status of the validation of the identity of the registrant: `VERIFIED`, `NOT_VERIFIED`, `PENDING` or + `FAILED` """ is_on_hold: bool - transfer_wrong_authcode: bool - transfer_locked: bool + """ Whether the domain is on hold at the registry (status `clientHold`) """ + transfer_wrong_authcode: bool | None + """ Whether the incoming transfer failed because of a wrong authcode; null when not known """ + transfer_locked: bool | None + """ Whether the incoming transfer failed because the domain is locked at the current registrar; null when not + known """ date_created: datetime.datetime + """ When these data were recorded: a new version is recorded each time the data at the registry change """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -76,8 +97,10 @@ def to_dict(self) -> dict[str, Any]: is_on_hold = self.is_on_hold + transfer_wrong_authcode: bool | None transfer_wrong_authcode = self.transfer_wrong_authcode + transfer_locked: bool | None transfer_locked = self.transfer_locked date_created = self.date_created.isoformat() @@ -223,9 +246,19 @@ def _parse_identity_validation_status(data: object) -> None | str: is_on_hold = d.pop("is_on_hold") - transfer_wrong_authcode = d.pop("transfer_wrong_authcode") + def _parse_transfer_wrong_authcode(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) + + transfer_wrong_authcode = _parse_transfer_wrong_authcode(d.pop("transfer_wrong_authcode")) + + def _parse_transfer_locked(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) - transfer_locked = d.pop("transfer_locked") + transfer_locked = _parse_transfer_locked(d.pop("transfer_locked")) date_created = datetime.datetime.fromisoformat(d.pop("date_created")) diff --git a/src/shellrent_sdk/client/models/domain_detail.py b/src/shellrent_sdk/client/models/domain_detail.py new file mode 100644 index 0000000..7329fb1 --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_detail.py @@ -0,0 +1,229 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Self, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.dns_type import DnsType + from ..models.domain_data import DomainData + from ..models.domain_name import DomainName + from ..models.domain_nameserver import DomainNameserver + + +T = TypeVar("T", bound="DomainDetail") + + +@_attrs_define +class DomainDetail: + """Domain of the account, with its nameservers, its data at the registry and the status of DNSSEC""" + + domain_id: int + tld_id: int + """ Id of the TLD of the domain (`GET /api/v3/tlds/{tld_id}`) """ + domain_name: DomainName + """ Name of a domain, whole and split into name and extension, in Unicode and in punycode """ + dns_type: DnsType + """ Nameserver type of a domain, which decides where its DNS zone is managed """ + dns_account: None | str + """ Email of the Cloudflare account that manages the DNS zone, with the Cloudflare nameservers; null with the + other nameserver types, and when the zone is on our own Cloudflare account """ + nameservers: list[DomainNameserver] + """ Nameservers of the domain; `sort` gives their order """ + domain_data: DomainData | None + """ Data of the domain at the registry; null when there are none """ + contacts_count: int + """ Number of active contacts of the domain """ + dnssec_enabled: bool + """ DNSSEC is enabled on the DNS zone of the domain, or the domain has active external DNSSEC keys. Always false + for DNS types other than internal and external """ + date_info_last: datetime.datetime | None + """ When the data of the domain were last requested from the registry """ + date_dns_check: datetime.datetime | None + """ When the DNS zone and the DNSSEC of the domain were last checked """ + vanity_nameserver_enabled: bool + """ Whether the domain uses vanity nameservers: our nameservers with hostnames of the domain itself (for example + `ns1.example.com`) """ + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.domain_data import DomainData + + domain_id = self.domain_id + + tld_id = self.tld_id + + domain_name = self.domain_name.to_dict() + + dns_type = self.dns_type.to_dict() + + dns_account: None | str + dns_account = self.dns_account + + nameservers = [] + for nameservers_item_data in self.nameservers: + nameservers_item = nameservers_item_data.to_dict() + nameservers.append(nameservers_item) + + domain_data: dict[str, Any] | None + if isinstance(self.domain_data, DomainData): + domain_data = self.domain_data.to_dict() + else: + domain_data = self.domain_data + + contacts_count = self.contacts_count + + dnssec_enabled = self.dnssec_enabled + + date_info_last: None | str + if isinstance(self.date_info_last, datetime.datetime): + date_info_last = self.date_info_last.isoformat() + else: + date_info_last = self.date_info_last + + date_dns_check: None | str + if isinstance(self.date_dns_check, datetime.datetime): + date_dns_check = self.date_dns_check.isoformat() + else: + date_dns_check = self.date_dns_check + + vanity_nameserver_enabled = self.vanity_nameserver_enabled + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "domain_id": domain_id, + "tld_id": tld_id, + "domain_name": domain_name, + "dns_type": dns_type, + "dns_account": dns_account, + "nameservers": nameservers, + "domain_data": domain_data, + "contacts_count": contacts_count, + "dnssec_enabled": dnssec_enabled, + "date_info_last": date_info_last, + "date_dns_check": date_dns_check, + "vanity_nameserver_enabled": vanity_nameserver_enabled, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.dns_type import DnsType + from ..models.domain_data import DomainData + from ..models.domain_name import DomainName + from ..models.domain_nameserver import DomainNameserver + + d = dict(src_dict) + domain_id = d.pop("domain_id") + + tld_id = d.pop("tld_id") + + domain_name = DomainName.from_dict(d.pop("domain_name")) + + dns_type = DnsType.from_dict(d.pop("dns_type")) + + def _parse_dns_account(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + dns_account = _parse_dns_account(d.pop("dns_account")) + + nameservers = [] + _nameservers = d.pop("nameservers") + for nameservers_item_data in _nameservers: + nameservers_item = DomainNameserver.from_dict(nameservers_item_data) + + nameservers.append(nameservers_item) + + def _parse_domain_data(data: object) -> DomainData | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + domain_data_type_0 = DomainData.from_dict(data) + + return domain_data_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(DomainData | None, data) + + domain_data = _parse_domain_data(d.pop("domain_data")) + + contacts_count = d.pop("contacts_count") + + dnssec_enabled = d.pop("dnssec_enabled") + + def _parse_date_info_last(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + date_info_last_type_0 = datetime.datetime.fromisoformat(data) + + return date_info_last_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + date_info_last = _parse_date_info_last(d.pop("date_info_last")) + + def _parse_date_dns_check(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + date_dns_check_type_0 = datetime.datetime.fromisoformat(data) + + return date_dns_check_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + date_dns_check = _parse_date_dns_check(d.pop("date_dns_check")) + + vanity_nameserver_enabled = d.pop("vanity_nameserver_enabled") + + domain_detail = cls( + domain_id=domain_id, + tld_id=tld_id, + domain_name=domain_name, + dns_type=dns_type, + dns_account=dns_account, + nameservers=nameservers, + domain_data=domain_data, + contacts_count=contacts_count, + dnssec_enabled=dnssec_enabled, + date_info_last=date_info_last, + date_dns_check=date_dns_check, + vanity_nameserver_enabled=vanity_nameserver_enabled, + ) + + domain_detail.additional_properties = d + return domain_detail + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/plesk_license_paginated_list_response.py b/src/shellrent_sdk/client/models/domain_detail_response.py similarity index 60% rename from src/shellrent_sdk/client/models/plesk_license_paginated_list_response.py rename to src/shellrent_sdk/client/models/domain_detail_response.py index 7b2d23a..b5d6dbb 100644 --- a/src/shellrent_sdk/client/models/plesk_license_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/domain_detail_response.py @@ -1,25 +1,30 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: - from ..models.pagination_meta import PaginationMeta - from ..models.plesk_license import PleskLicense + from ..models.domain_detail import DomainDetail -T = TypeVar("T", bound="PleskLicensePaginatedListResponse") +T = TypeVar("T", bound="DomainDetailResponse") @_attrs_define -class PleskLicensePaginatedListResponse: - error: int +class DomainDetailResponse: + """Successful response with one `DomainDetail`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str - data: list[PleskLicense] - meta: PaginationMeta + """ Always null in a successful response """ + data: DomainDetail + """ Domain of the account, with its nameservers, its data at the registry and the status of DNSSEC """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -28,12 +33,9 @@ def to_dict(self) -> dict[str, Any]: message: None | str message = self.message - data = [] - for data_item_data in self.data: - data_item = data_item_data.to_dict() - data.append(data_item) + data = self.data.to_dict() - meta = self.meta.to_dict() + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -50,11 +52,12 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.pagination_meta import PaginationMeta - from ..models.plesk_license import PleskLicense + from ..models.domain_detail import DomainDetail d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -63,24 +66,19 @@ def _parse_message(data: object) -> None | str: message = _parse_message(d.pop("message")) - data = [] - _data = d.pop("data") - for data_item_data in _data: - data_item = PleskLicense.from_dict(data_item_data) - - data.append(data_item) + data = DomainDetail.from_dict(d.pop("data")) - meta = PaginationMeta.from_dict(d.pop("meta")) + meta = d.pop("meta") - plesk_license_paginated_list_response = cls( + domain_detail_response = cls( error=error, message=message, data=data, meta=meta, ) - plesk_license_paginated_list_response.additional_properties = d - return plesk_license_paginated_list_response + domain_detail_response.additional_properties = d + return domain_detail_response @property def additional_keys(self) -> list[str]: diff --git a/src/shellrent_sdk/client/models/domain_dns_nameservers_change_request.py b/src/shellrent_sdk/client/models/domain_dns_nameservers_change_request.py index ec346a3..f78e630 100644 --- a/src/shellrent_sdk/client/models/domain_dns_nameservers_change_request.py +++ b/src/shellrent_sdk/client/models/domain_dns_nameservers_change_request.py @@ -4,7 +4,6 @@ from typing import Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -14,60 +13,37 @@ @_attrs_define class DomainDnsNameserversChangeRequest: ns_1_hostname: str - """ Hostname of first nameserver """ + """ Hostname of the first nameserver. It cannot be a Shellrent nameserver nor a host of the domain itself """ ns_2_hostname: str - """ Hostname of second nameserver """ - ns_1_ip: str | Unset = UNSET - """ IP address of first nameserver """ - ns_2_ip: str | Unset = UNSET - """ IP address of second nameserver """ + """ Hostname of the second nameserver. It cannot be a Shellrent nameserver nor a host of the domain itself """ ns_3_hostname: str | Unset = UNSET - """ Hostname of third nameserver """ - ns_3_ip: str | Unset = UNSET - """ IP address of third nameserver """ + """ Hostname of the third nameserver (optional). It cannot be a Shellrent nameserver nor a host of the domain + itself """ ns_4_hostname: str | Unset = UNSET - """ Hostname of fourth nameserver """ - ns_4_ip: str | Unset = UNSET - """ IP address of fourth nameserver """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + """ Hostname of the fourth nameserver (optional). It cannot be a Shellrent nameserver nor a host of the domain + itself """ def to_dict(self) -> dict[str, Any]: ns_1_hostname = self.ns_1_hostname ns_2_hostname = self.ns_2_hostname - ns_1_ip = self.ns_1_ip - - ns_2_ip = self.ns_2_ip - ns_3_hostname = self.ns_3_hostname - ns_3_ip = self.ns_3_ip - ns_4_hostname = self.ns_4_hostname - ns_4_ip = self.ns_4_ip - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "ns_1_hostname": ns_1_hostname, "ns_2_hostname": ns_2_hostname, } ) - if ns_1_ip is not UNSET: - field_dict["ns_1_ip"] = ns_1_ip - if ns_2_ip is not UNSET: - field_dict["ns_2_ip"] = ns_2_ip if ns_3_hostname is not UNSET: field_dict["ns_3_hostname"] = ns_3_hostname - if ns_3_ip is not UNSET: - field_dict["ns_3_ip"] = ns_3_ip if ns_4_hostname is not UNSET: field_dict["ns_4_hostname"] = ns_4_hostname - if ns_4_ip is not UNSET: - field_dict["ns_4_ip"] = ns_4_ip return field_dict @@ -78,44 +54,15 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: ns_2_hostname = d.pop("ns_2_hostname") - ns_1_ip = d.pop("ns_1_ip", UNSET) - - ns_2_ip = d.pop("ns_2_ip", UNSET) - ns_3_hostname = d.pop("ns_3_hostname", UNSET) - ns_3_ip = d.pop("ns_3_ip", UNSET) - ns_4_hostname = d.pop("ns_4_hostname", UNSET) - ns_4_ip = d.pop("ns_4_ip", UNSET) - domain_dns_nameservers_change_request = cls( ns_1_hostname=ns_1_hostname, ns_2_hostname=ns_2_hostname, - ns_1_ip=ns_1_ip, - ns_2_ip=ns_2_ip, ns_3_hostname=ns_3_hostname, - ns_3_ip=ns_3_ip, ns_4_hostname=ns_4_hostname, - ns_4_ip=ns_4_ip, ) - domain_dns_nameservers_change_request.additional_properties = d return domain_dns_nameservers_change_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/domain_dns_nameservers_cloudflare_request.py b/src/shellrent_sdk/client/models/domain_dns_nameservers_cloudflare_request.py index d85e995..03e8493 100644 --- a/src/shellrent_sdk/client/models/domain_dns_nameservers_cloudflare_request.py +++ b/src/shellrent_sdk/client/models/domain_dns_nameservers_cloudflare_request.py @@ -4,7 +4,6 @@ from typing import Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="DomainDnsNameserversCloudflareRequest") @@ -12,8 +11,9 @@ @_attrs_define class DomainDnsNameserversCloudflareRequest: account_email: str + """ Email of the Cloudflare account that will manage the DNS zone """ api_token: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + """ Global API key of the Cloudflare account (not an API token), used together with `account_email` """ def to_dict(self) -> dict[str, Any]: account_email = self.account_email @@ -21,7 +21,7 @@ def to_dict(self) -> dict[str, Any]: api_token = self.api_token field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "account_email": account_email, @@ -43,21 +43,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: api_token=api_token, ) - domain_dns_nameservers_cloudflare_request.additional_properties = d return domain_dns_nameservers_cloudflare_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/domain_dns_record_change_request.py b/src/shellrent_sdk/client/models/domain_dns_record_change_request.py index 985f1b3..2d65ae9 100644 --- a/src/shellrent_sdk/client/models/domain_dns_record_change_request.py +++ b/src/shellrent_sdk/client/models/domain_dns_record_change_request.py @@ -4,7 +4,6 @@ from typing import TYPE_CHECKING, Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -23,19 +22,32 @@ @_attrs_define class DomainDnsRecordChangeRequest: host: str + """ Name of the record relative to the zone, `@` for the domain itself; for SRV and TLSA records, without the + service and the protocol """ destination: str + """ Value of the record: the IPv4 address for A, the IPv6 address for AAAA, the target hostname for CNAME, MX, + NS, PTR and SRV, the text for TXT and SPF, the value of the tag for CAA, the certificate association data for + TLSA """ service: str | Unset = UNSET + """ Service of SRV records (e.g. `_sip`) and port of TLSA records """ protocol: str | Unset = UNSET + """ Protocol of SRV and TLSA records: `_tcp`, `_udp` or `_tls` """ port: str | Unset = UNSET + """ Port of the service, required for SRV records """ weight: str | Unset = UNSET + """ Weight of SRV records """ priority: str | Unset = UNSET + """ Priority of MX and SRV records """ ttl: int | Unset = UNSET + """ TTL of the record, in seconds, for the Cloudflare records that are not proxied (`0` or `1` for the automatic + TTL); ignored with the standard and external nameservers, where the records have the TTL of the zone """ proxied: bool | Unset = UNSET + """ Whether the traffic of the record goes through the Cloudflare proxy; only for the Cloudflare records that + can be proxied """ caa_data: DomainDnsRecordChangeRequestCaaData | Unset = UNSET """ Use this for CAA type record only """ tlsa_data: DomainDnsRecordChangeRequestTlsaData | Unset = UNSET """ Use this for TLSA type record only """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: host = self.host @@ -65,7 +77,7 @@ def to_dict(self) -> dict[str, Any]: tlsa_data = self.tlsa_data.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "host": host, @@ -149,21 +161,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: tlsa_data=tlsa_data, ) - domain_dns_record_change_request.additional_properties = d return domain_dns_record_change_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/domain_dns_record_change_request_caa_data.py b/src/shellrent_sdk/client/models/domain_dns_record_change_request_caa_data.py index c0f0951..9ab9ecb 100644 --- a/src/shellrent_sdk/client/models/domain_dns_record_change_request_caa_data.py +++ b/src/shellrent_sdk/client/models/domain_dns_record_change_request_caa_data.py @@ -14,8 +14,11 @@ class DomainDnsRecordChangeRequestCaaData: """Use this for CAA type record only""" flag: int + """ Flags of the CAA record: only `0` is accepted """ tag_value: str + """ Tag of the CAA record, for example `issue` or `issuewild`; its value goes in `destination` """ can_sign_http_exchanges: bool + """ Whether to add the parameter `cansignhttpexchanges=yes` to the value of the tag """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/domain_dns_record_change_request_tlsa_data.py b/src/shellrent_sdk/client/models/domain_dns_record_change_request_tlsa_data.py index cb49a36..17e3378 100644 --- a/src/shellrent_sdk/client/models/domain_dns_record_change_request_tlsa_data.py +++ b/src/shellrent_sdk/client/models/domain_dns_record_change_request_tlsa_data.py @@ -14,8 +14,11 @@ class DomainDnsRecordChangeRequestTlsaData: """Use this for TLSA type record only""" usage: str + """ Certificate usage: `0` (PKIX-TA), `1` (PKIX-EE), `2` (DANE-TA) or `3` (DANE-EE) """ selector: str + """ Selector: `0` for the full certificate, `1` for its public key (SubjectPublicKeyInfo) """ matching_type: str + """ Matching type: `0` for the data without hashing, `1` for SHA-256, `2` for SHA-512 """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/domain_dns_record_request.py b/src/shellrent_sdk/client/models/domain_dns_record_request.py index 14965d3..ec52be4 100644 --- a/src/shellrent_sdk/client/models/domain_dns_record_request.py +++ b/src/shellrent_sdk/client/models/domain_dns_record_request.py @@ -4,8 +4,8 @@ from typing import TYPE_CHECKING, Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field +from ..models.domain_dns_record_request_type import DomainDnsRecordRequestType from ..types import UNSET, Unset if TYPE_CHECKING: @@ -18,24 +18,38 @@ @_attrs_define class DomainDnsRecordRequest: - type_: str + type_: DomainDnsRecordRequestType + """ Type of the record. `NS` and `PTR` records cannot be created, as in the control panel """ host: str + """ Name of the record relative to the zone, `@` for the domain itself; for SRV and TLSA records, without the + service and the protocol """ destination: str + """ Value of the record: the IPv4 address for A, the IPv6 address for AAAA, the target hostname for CNAME, MX, + NS, PTR and SRV, the text for TXT and SPF, the value of the tag for CAA, the certificate association data for + TLSA """ service: str | Unset = UNSET + """ Service of SRV records (e.g. `_sip`) and port of TLSA records """ protocol: str | Unset = UNSET + """ Protocol of SRV and TLSA records: `_tcp`, `_udp` or `_tls` """ port: str | Unset = UNSET + """ Port of the service, required for SRV records """ weight: str | Unset = UNSET + """ Weight of SRV records """ priority: str | Unset = UNSET + """ Priority of MX and SRV records """ ttl: int | Unset = UNSET + """ Ignored: a new record has the TTL of the zone with the standard and external nameservers, and the automatic + TTL with Cloudflare, which `PATCH /api/v3/domains/{domain_id}/dns/records/{record_id}` can change """ proxied: bool | Unset = UNSET + """ Whether the traffic of the record goes through the Cloudflare proxy; only with the Cloudflare nameservers + """ caa_data: DomainDnsRecordRequestCaaData | Unset = UNSET """ Use this for CAA type record only """ tlsa_data: DomainDnsRecordRequestTlsaData | Unset = UNSET """ Use this for TLSA type record only """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_ = self.type_ + type_ = self.type_.value host = self.host @@ -64,7 +78,7 @@ def to_dict(self) -> dict[str, Any]: tlsa_data = self.tlsa_data.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -103,7 +117,7 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: ) d = dict(src_dict) - type_ = d.pop("type") + type_ = DomainDnsRecordRequestType(d.pop("type")) host = d.pop("host") @@ -152,21 +166,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: tlsa_data=tlsa_data, ) - domain_dns_record_request.additional_properties = d return domain_dns_record_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/domain_dns_record_request_caa_data.py b/src/shellrent_sdk/client/models/domain_dns_record_request_caa_data.py index 01dc94d..70fa778 100644 --- a/src/shellrent_sdk/client/models/domain_dns_record_request_caa_data.py +++ b/src/shellrent_sdk/client/models/domain_dns_record_request_caa_data.py @@ -14,8 +14,11 @@ class DomainDnsRecordRequestCaaData: """Use this for CAA type record only""" flag: int + """ Flags of the CAA record: only `0` is accepted """ tag_value: str + """ Tag of the CAA record, for example `issue` or `issuewild`; its value goes in `destination` """ can_sign_http_exchanges: bool + """ Whether to add the parameter `cansignhttpexchanges=yes` to the value of the tag """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/domain_dns_record_request_tlsa_data.py b/src/shellrent_sdk/client/models/domain_dns_record_request_tlsa_data.py index 28ae20d..dddc8b0 100644 --- a/src/shellrent_sdk/client/models/domain_dns_record_request_tlsa_data.py +++ b/src/shellrent_sdk/client/models/domain_dns_record_request_tlsa_data.py @@ -14,8 +14,11 @@ class DomainDnsRecordRequestTlsaData: """Use this for TLSA type record only""" usage: str + """ Certificate usage: `0` (PKIX-TA), `1` (PKIX-EE), `2` (DANE-TA) or `3` (DANE-EE) """ selector: str + """ Selector: `0` for the full certificate, `1` for its public key (SubjectPublicKeyInfo) """ matching_type: str + """ Matching type: `0` for the data without hashing, `1` for SHA-256, `2` for SHA-512 """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/domain_dns_record_request_type.py b/src/shellrent_sdk/client/models/domain_dns_record_request_type.py new file mode 100644 index 0000000..02d6968 --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_dns_record_request_type.py @@ -0,0 +1,16 @@ +from enum import StrEnum + + +class DomainDnsRecordRequestType(StrEnum): + A = "A" + AAAA = "AAAA" + CAA = "CAA" + CNAME = "CNAME" + MX = "MX" + SPF = "SPF" + SRV = "SRV" + TLSA = "TLSA" + TXT = "TXT" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/shellrent_sdk/client/models/domain_dns_zone_request.py b/src/shellrent_sdk/client/models/domain_dns_zone_request.py index 42f348a..27030c2 100644 --- a/src/shellrent_sdk/client/models/domain_dns_zone_request.py +++ b/src/shellrent_sdk/client/models/domain_dns_zone_request.py @@ -4,21 +4,24 @@ from typing import Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field + +from ..models.domain_dns_zone_request_zone_ttl import DomainDnsZoneRequestZoneTtl T = TypeVar("T", bound="DomainDnsZoneRequest") @_attrs_define class DomainDnsZoneRequest: - zone_ttl: int - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + zone_ttl: DomainDnsZoneRequestZoneTtl + """ TTL of the zone, in seconds, which is also the TTL of every record: one of the values of the control panel, + from 1 to 24 hours. Only the zones on our nameservers (standard and external types) have one: with Cloudflare + the response is 409 """ def to_dict(self) -> dict[str, Any]: - zone_ttl = self.zone_ttl + zone_ttl = self.zone_ttl.value field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "zone_ttl": zone_ttl, @@ -30,27 +33,10 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) - zone_ttl = d.pop("zone_ttl") + zone_ttl = DomainDnsZoneRequestZoneTtl(d.pop("zone_ttl")) domain_dns_zone_request = cls( zone_ttl=zone_ttl, ) - domain_dns_zone_request.additional_properties = d return domain_dns_zone_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/domain_dns_zone_request_zone_ttl.py b/src/shellrent_sdk/client/models/domain_dns_zone_request_zone_ttl.py new file mode 100644 index 0000000..e6b15d3 --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_dns_zone_request_zone_ttl.py @@ -0,0 +1,12 @@ +from enum import IntEnum + + +class DomainDnsZoneRequestZoneTtl(IntEnum): + VALUE_3600 = 3600 + VALUE_14400 = 14400 + VALUE_28800 = 28800 + VALUE_57600 = 57600 + VALUE_86400 = 86400 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/shellrent_sdk/client/models/domain_dnssec.py b/src/shellrent_sdk/client/models/domain_dnssec.py index 6ddae78..aa41b2f 100644 --- a/src/shellrent_sdk/client/models/domain_dnssec.py +++ b/src/shellrent_sdk/client/models/domain_dnssec.py @@ -16,8 +16,15 @@ @_attrs_define class DomainDnssec: + """Active DNSSEC records of the domain: the ones of our zone with the standard nameservers, the ones set with `PATCH + /api/v3/domains/{domain_id}/dnssec` with the external nameservers + + """ + ds_data: list[DnssecDsData] + """ DS records """ key_data: list[DnssecKeyData] + """ DNSKEY records """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/domain_dnssec_can_activate.py b/src/shellrent_sdk/client/models/domain_dnssec_can_activate.py index f589ea7..87502c2 100644 --- a/src/shellrent_sdk/client/models/domain_dnssec_can_activate.py +++ b/src/shellrent_sdk/client/models/domain_dnssec_can_activate.py @@ -11,8 +11,12 @@ @_attrs_define class DomainDnssecCanActivate: + """Whether DNSSEC can be activated on the domain, or its data changed""" + domain_id: int can_active: bool + """ Whether DNSSEC can be activated now (`POST /api/v3/domains/{domain_id}/dnssec`, standard nameservers) or its + data changed (`PATCH /api/v3/domains/{domain_id}/dnssec`, external nameservers) """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/domain_dnssec_can_activate_response.py b/src/shellrent_sdk/client/models/domain_dnssec_can_activate_response.py index 1f85f85..9c93149 100644 --- a/src/shellrent_sdk/client/models/domain_dnssec_can_activate_response.py +++ b/src/shellrent_sdk/client/models/domain_dnssec_can_activate_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.domain_dnssec_can_activate import DomainDnssecCanActivate - from ..models.domain_dnssec_can_activate_response_meta_type_0 import ( - DomainDnssecCanActivateResponseMetaType0, - ) T = TypeVar("T", bound="DomainDnssecCanActivateResponse") @@ -18,17 +15,19 @@ @_attrs_define class DomainDnssecCanActivateResponse: - error: int + """Successful response with one `DomainDnssecCanActivate`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: DomainDnssecCanActivate - meta: DomainDnssecCanActivateResponseMetaType0 | None + """ Whether DNSSEC can be activated on the domain, or its data changed """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.domain_dnssec_can_activate_response_meta_type_0 import ( - DomainDnssecCanActivateResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, DomainDnssecCanActivateResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -58,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.domain_dnssec_can_activate import DomainDnssecCanActivate - from ..models.domain_dnssec_can_activate_response_meta_type_0 import ( - DomainDnssecCanActivateResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -74,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = DomainDnssecCanActivate.from_dict(d.pop("data")) - def _parse_meta(data: object) -> DomainDnssecCanActivateResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = DomainDnssecCanActivateResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(DomainDnssecCanActivateResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") domain_dnssec_can_activate_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/domain_dnssec_can_activate_response_meta_type_0.py b/src/shellrent_sdk/client/models/domain_dnssec_can_activate_response_meta_type_0.py deleted file mode 100644 index 8d9f292..0000000 --- a/src/shellrent_sdk/client/models/domain_dnssec_can_activate_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="DomainDnssecCanActivateResponseMetaType0") - - -@_attrs_define -class DomainDnssecCanActivateResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - domain_dnssec_can_activate_response_meta_type_0 = cls() - - domain_dnssec_can_activate_response_meta_type_0.additional_properties = d - return domain_dnssec_can_activate_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/domain_dnssec_can_deactivate.py b/src/shellrent_sdk/client/models/domain_dnssec_can_deactivate.py index bb65b79..f3dcf5a 100644 --- a/src/shellrent_sdk/client/models/domain_dnssec_can_deactivate.py +++ b/src/shellrent_sdk/client/models/domain_dnssec_can_deactivate.py @@ -11,8 +11,12 @@ @_attrs_define class DomainDnssecCanDeactivate: + """Whether DNSSEC can be deactivated on the domain, or its data removed""" + domain_id: int can_deactivate: bool + """ Whether DNSSEC can be deactivated now (standard nameservers) or its data removed (external nameservers) with + `DELETE /api/v3/domains/{domain_id}/dnssec` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/domain_dnssec_can_deactivate_response.py b/src/shellrent_sdk/client/models/domain_dnssec_can_deactivate_response.py index e8c7cd3..9fcf53d 100644 --- a/src/shellrent_sdk/client/models/domain_dnssec_can_deactivate_response.py +++ b/src/shellrent_sdk/client/models/domain_dnssec_can_deactivate_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.domain_dnssec_can_deactivate import DomainDnssecCanDeactivate - from ..models.domain_dnssec_can_deactivate_response_meta_type_0 import ( - DomainDnssecCanDeactivateResponseMetaType0, - ) T = TypeVar("T", bound="DomainDnssecCanDeactivateResponse") @@ -18,17 +15,19 @@ @_attrs_define class DomainDnssecCanDeactivateResponse: - error: int + """Successful response with one `DomainDnssecCanDeactivate`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: DomainDnssecCanDeactivate - meta: DomainDnssecCanDeactivateResponseMetaType0 | None + """ Whether DNSSEC can be deactivated on the domain, or its data removed """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.domain_dnssec_can_deactivate_response_meta_type_0 import ( - DomainDnssecCanDeactivateResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, DomainDnssecCanDeactivateResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -58,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.domain_dnssec_can_deactivate import DomainDnssecCanDeactivate - from ..models.domain_dnssec_can_deactivate_response_meta_type_0 import ( - DomainDnssecCanDeactivateResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -74,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = DomainDnssecCanDeactivate.from_dict(d.pop("data")) - def _parse_meta(data: object) -> DomainDnssecCanDeactivateResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = DomainDnssecCanDeactivateResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(DomainDnssecCanDeactivateResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") domain_dnssec_can_deactivate_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/domain_dnssec_can_deactivate_response_meta_type_0.py b/src/shellrent_sdk/client/models/domain_dnssec_can_deactivate_response_meta_type_0.py deleted file mode 100644 index 16c6f2b..0000000 --- a/src/shellrent_sdk/client/models/domain_dnssec_can_deactivate_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="DomainDnssecCanDeactivateResponseMetaType0") - - -@_attrs_define -class DomainDnssecCanDeactivateResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - domain_dnssec_can_deactivate_response_meta_type_0 = cls() - - domain_dnssec_can_deactivate_response_meta_type_0.additional_properties = d - return domain_dnssec_can_deactivate_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/domain_dnssec_request.py b/src/shellrent_sdk/client/models/domain_dnssec_request.py index 53ad9e4..b51688e 100644 --- a/src/shellrent_sdk/client/models/domain_dnssec_request.py +++ b/src/shellrent_sdk/client/models/domain_dnssec_request.py @@ -4,7 +4,6 @@ from typing import TYPE_CHECKING, Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -21,6 +20,7 @@ @_attrs_define class DomainDnssecRequest: zone_ttl: int + """ TTL of the zone, in seconds """ ds_data_1: DomainDnssecRequestDsData1 """ DS DATA first record """ ds_data_2: DomainDnssecRequestDsData2 @@ -29,7 +29,6 @@ class DomainDnssecRequest: """ KEY DATA 256 records """ key_data_257: list[DomainDnssecRequestKeyData257Item] | Unset = UNSET """ KEY DATA 257 records """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: zone_ttl = self.zone_ttl @@ -53,7 +52,7 @@ def to_dict(self) -> dict[str, Any]: key_data_257.append(key_data_257_item) field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "zone_ttl": zone_ttl, @@ -120,21 +119,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: key_data_257=key_data_257, ) - domain_dnssec_request.additional_properties = d return domain_dnssec_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/domain_dnssec_request_ds_data_1.py b/src/shellrent_sdk/client/models/domain_dnssec_request_ds_data_1.py index 3a69429..d212ba2 100644 --- a/src/shellrent_sdk/client/models/domain_dnssec_request_ds_data_1.py +++ b/src/shellrent_sdk/client/models/domain_dnssec_request_ds_data_1.py @@ -18,9 +18,13 @@ class DomainDnssecRequestDsData1: """DS DATA first record""" key_tag: int + """ Key tag of the DNSKEY the record refers to """ algorithm: int + """ DNSSEC algorithm of the key, for example `8` (RSA/SHA-256) or `13` (ECDSAP256SHA256) """ digest_type: DomainDnssecRequestDsData1DigestType + """ Algorithm of the digest: `1` (SHA-1), `2` (SHA-256) or `4` (SHA-384) """ digest: str + """ Digest of the DNSKEY, in hexadecimal """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/domain_dnssec_request_ds_data_2.py b/src/shellrent_sdk/client/models/domain_dnssec_request_ds_data_2.py index 09ffd5b..c52c155 100644 --- a/src/shellrent_sdk/client/models/domain_dnssec_request_ds_data_2.py +++ b/src/shellrent_sdk/client/models/domain_dnssec_request_ds_data_2.py @@ -18,9 +18,13 @@ class DomainDnssecRequestDsData2: """DS DATA second record""" key_tag: int + """ Key tag of the DNSKEY the record refers to """ algorithm: int + """ DNSSEC algorithm of the key, for example `8` (RSA/SHA-256) or `13` (ECDSAP256SHA256) """ digest_type: DomainDnssecRequestDsData2DigestType + """ Algorithm of the digest: `1` (SHA-1), `2` (SHA-256) or `4` (SHA-384) """ digest: str + """ Digest of the DNSKEY, in hexadecimal """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/domain_dnssec_request_key_data_256_item.py b/src/shellrent_sdk/client/models/domain_dnssec_request_key_data_256_item.py index 681ba4f..de77640 100644 --- a/src/shellrent_sdk/client/models/domain_dnssec_request_key_data_256_item.py +++ b/src/shellrent_sdk/client/models/domain_dnssec_request_key_data_256_item.py @@ -16,8 +16,11 @@ @_attrs_define class DomainDnssecRequestKeyData256Item: protocol: int + """ Protocol of the key, `3` for DNSSEC """ algorithm: DomainDnssecRequestKeyData256ItemAlgorithm + """ DNSSEC algorithm of the key: `8` (RSA/SHA-256) or `13` (ECDSAP256SHA256) """ public_key: str + """ Public key, in base64 """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/domain_dnssec_request_key_data_257_item.py b/src/shellrent_sdk/client/models/domain_dnssec_request_key_data_257_item.py index c1d88d2..86b5d8f 100644 --- a/src/shellrent_sdk/client/models/domain_dnssec_request_key_data_257_item.py +++ b/src/shellrent_sdk/client/models/domain_dnssec_request_key_data_257_item.py @@ -16,8 +16,11 @@ @_attrs_define class DomainDnssecRequestKeyData257Item: protocol: int + """ Protocol of the key, `3` for DNSSEC """ algorithm: DomainDnssecRequestKeyData257ItemAlgorithm + """ DNSSEC algorithm of the key: `8` (RSA/SHA-256) or `13` (ECDSAP256SHA256) """ public_key: str + """ Public key, in base64 """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/domain_dnssec_response.py b/src/shellrent_sdk/client/models/domain_dnssec_response.py index 0189769..c0e301d 100644 --- a/src/shellrent_sdk/client/models/domain_dnssec_response.py +++ b/src/shellrent_sdk/client/models/domain_dnssec_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.domain_dnssec import DomainDnssec - from ..models.domain_dnssec_response_meta_type_0 import DomainDnssecResponseMetaType0 T = TypeVar("T", bound="DomainDnssecResponse") @@ -16,15 +15,20 @@ @_attrs_define class DomainDnssecResponse: - error: int + """Successful response with one `DomainDnssec`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: DomainDnssec - meta: DomainDnssecResponseMetaType0 | None + """ Active DNSSEC records of the domain: the ones of our zone with the standard nameservers, the ones set with + `PATCH /api/v3/domains/{domain_id}/dnssec` with the external nameservers """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.domain_dnssec_response_meta_type_0 import DomainDnssecResponseMetaType0 - error = self.error message: None | str @@ -32,11 +36,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, DomainDnssecResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,12 +54,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.domain_dnssec import DomainDnssec - from ..models.domain_dnssec_response_meta_type_0 import ( - DomainDnssecResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -70,20 +69,7 @@ def _parse_message(data: object) -> None | str: data = DomainDnssec.from_dict(d.pop("data")) - def _parse_meta(data: object) -> DomainDnssecResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = DomainDnssecResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(DomainDnssecResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") domain_dnssec_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/domain_dnssec_response_meta_type_0.py b/src/shellrent_sdk/client/models/domain_dnssec_response_meta_type_0.py deleted file mode 100644 index 056c52c..0000000 --- a/src/shellrent_sdk/client/models/domain_dnssec_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="DomainDnssecResponseMetaType0") - - -@_attrs_define -class DomainDnssecResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - domain_dnssec_response_meta_type_0 = cls() - - domain_dnssec_response_meta_type_0.additional_properties = d - return domain_dnssec_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/domain_name.py b/src/shellrent_sdk/client/models/domain_name.py index 7785d09..9255e4a 100644 --- a/src/shellrent_sdk/client/models/domain_name.py +++ b/src/shellrent_sdk/client/models/domain_name.py @@ -11,12 +11,20 @@ @_attrs_define class DomainName: + """Name of a domain, whole and split into name and extension, in Unicode and in punycode""" + unicode: None | str + """ Full domain name in Unicode, for example `farò.it` """ punycode: None | str + """ Full domain name in punycode, for example `xn--far-ena.it` """ unicode_name: None | str + """ Name without the extension, in Unicode """ punycode_name: None | str + """ Name without the extension, in punycode """ unicode_tld: None | str + """ Extension (TLD) without the leading dot, in Unicode """ punycode_tld: None | str + """ Extension (TLD) without the leading dot, in punycode """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/domain_nameserver.py b/src/shellrent_sdk/client/models/domain_nameserver.py new file mode 100644 index 0000000..07bb621 --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_nameserver.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Self, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="DomainNameserver") + + +@_attrs_define +class DomainNameserver: + hostname: str + address_ipv4: None | str + """ IPv4 address of the nameserver, saved when the nameservers were set; null when not known """ + address_ipv6: None | str + """ IPv6 address of the nameserver; not filled in for now, always null """ + sort: int + """ Position of the nameserver, from `1` """ + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + hostname = self.hostname + + address_ipv4: None | str + address_ipv4 = self.address_ipv4 + + address_ipv6: None | str + address_ipv6 = self.address_ipv6 + + sort = self.sort + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "hostname": hostname, + "address_ipv4": address_ipv4, + "address_ipv6": address_ipv6, + "sort": sort, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + hostname = d.pop("hostname") + + def _parse_address_ipv4(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + address_ipv4 = _parse_address_ipv4(d.pop("address_ipv4")) + + def _parse_address_ipv6(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + address_ipv6 = _parse_address_ipv6(d.pop("address_ipv6")) + + sort = d.pop("sort") + + domain_nameserver = cls( + hostname=hostname, + address_ipv4=address_ipv4, + address_ipv6=address_ipv6, + sort=sort, + ) + + domain_nameserver.additional_properties = d + return domain_nameserver + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/domain_paginated_list_response.py b/src/shellrent_sdk/client/models/domain_paginated_list_response.py index aa6d1f5..f199317 100644 --- a/src/shellrent_sdk/client/models/domain_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/domain_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class DomainPaginatedListResponse: - error: int + """Successful response with a page of `Domain`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[Domain] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.pagination_meta import PaginationMeta d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/domain_premium_prices.py b/src/shellrent_sdk/client/models/domain_premium_prices.py new file mode 100644 index 0000000..5f7fdbd --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_premium_prices.py @@ -0,0 +1,130 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Self, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.amount import Amount + + +T = TypeVar("T", bound="DomainPremiumPrices") + + +@_attrs_define +class DomainPremiumPrices: + """Our prices for a premium domain, without VAT: the cost asked by the registry plus our markup. The order of a premium + domain uses these prices + + """ + + activation_price: Amount + """ Amount in euros: the taxable amount and, when computed with a tax regime, the VAT rate, the VAT and the + total, which are null otherwise """ + renew_price: Amount + """ Amount in euros: the taxable amount and, when computed with a tax regime, the VAT rate, the VAT and the + total, which are null otherwise """ + restore_price: Amount | None + """ Restore price; null when the registry gave none """ + transfer_price: Amount | None + """ Transfer price; null when the registry gave none """ + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.amount import Amount + + activation_price = self.activation_price.to_dict() + + renew_price = self.renew_price.to_dict() + + restore_price: dict[str, Any] | None + if isinstance(self.restore_price, Amount): + restore_price = self.restore_price.to_dict() + else: + restore_price = self.restore_price + + transfer_price: dict[str, Any] | None + if isinstance(self.transfer_price, Amount): + transfer_price = self.transfer_price.to_dict() + else: + transfer_price = self.transfer_price + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "activation_price": activation_price, + "renew_price": renew_price, + "restore_price": restore_price, + "transfer_price": transfer_price, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.amount import Amount + + d = dict(src_dict) + activation_price = Amount.from_dict(d.pop("activation_price")) + + renew_price = Amount.from_dict(d.pop("renew_price")) + + def _parse_restore_price(data: object) -> Amount | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + restore_price_type_0 = Amount.from_dict(data) + + return restore_price_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(Amount | None, data) + + restore_price = _parse_restore_price(d.pop("restore_price")) + + def _parse_transfer_price(data: object) -> Amount | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + transfer_price_type_0 = Amount.from_dict(data) + + return transfer_price_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(Amount | None, data) + + transfer_price = _parse_transfer_price(d.pop("transfer_price")) + + domain_premium_prices = cls( + activation_price=activation_price, + renew_price=renew_price, + restore_price=restore_price, + transfer_price=transfer_price, + ) + + domain_premium_prices.additional_properties = d + return domain_premium_prices + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/domain_response.py b/src/shellrent_sdk/client/models/domain_response.py deleted file mode 100644 index e8b36ab..0000000 --- a/src/shellrent_sdk/client/models/domain_response.py +++ /dev/null @@ -1,110 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.domain import Domain - from ..models.domain_response_meta_type_0 import DomainResponseMetaType0 - - -T = TypeVar("T", bound="DomainResponse") - - -@_attrs_define -class DomainResponse: - error: int - message: None | str - data: Domain - meta: DomainResponseMetaType0 | None - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.domain_response_meta_type_0 import DomainResponseMetaType0 - - error = self.error - - message: None | str - message = self.message - - data = self.data.to_dict() - - meta: dict[str, Any] | None - if isinstance(self.meta, DomainResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "error": error, - "message": message, - "data": data, - "meta": meta, - } - ) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.domain import Domain - from ..models.domain_response_meta_type_0 import DomainResponseMetaType0 - - d = dict(src_dict) - error = d.pop("error") - - def _parse_message(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - message = _parse_message(d.pop("message")) - - data = Domain.from_dict(d.pop("data")) - - def _parse_meta(data: object) -> DomainResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = DomainResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(DomainResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) - - domain_response = cls( - error=error, - message=message, - data=data, - meta=meta, - ) - - domain_response.additional_properties = d - return domain_response - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/domain_response_meta_type_0.py b/src/shellrent_sdk/client/models/domain_response_meta_type_0.py deleted file mode 100644 index 5cb7b2c..0000000 --- a/src/shellrent_sdk/client/models/domain_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="DomainResponseMetaType0") - - -@_attrs_define -class DomainResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - domain_response_meta_type_0 = cls() - - domain_response_meta_type_0.additional_properties = d - return domain_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/empty_response.py b/src/shellrent_sdk/client/models/empty_response.py index 6585adb..758e25d 100644 --- a/src/shellrent_sdk/client/models/empty_response.py +++ b/src/shellrent_sdk/client/models/empty_response.py @@ -1,47 +1,37 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field -if TYPE_CHECKING: - from ..models.empty_response_data_type_0 import EmptyResponseDataType0 - from ..models.empty_response_meta_type_0 import EmptyResponseMetaType0 - - T = TypeVar("T", bound="EmptyResponse") @_attrs_define class EmptyResponse: - error: int + """Successful response without data""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str - data: EmptyResponseDataType0 | None - meta: EmptyResponseMetaType0 | None + """ Always null in a successful response """ + data: Any + """ Always null: the operation returns no data """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.empty_response_data_type_0 import EmptyResponseDataType0 - from ..models.empty_response_meta_type_0 import EmptyResponseMetaType0 - error = self.error message: None | str message = self.message - data: dict[str, Any] | None - if isinstance(self.data, EmptyResponseDataType0): - data = self.data.to_dict() - else: - data = self.data + data = self.data - meta: dict[str, Any] | None - if isinstance(self.meta, EmptyResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -58,11 +48,10 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.empty_response_data_type_0 import EmptyResponseDataType0 - from ..models.empty_response_meta_type_0 import EmptyResponseMetaType0 - d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -71,35 +60,9 @@ def _parse_message(data: object) -> None | str: message = _parse_message(d.pop("message")) - def _parse_data(data: object) -> EmptyResponseDataType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - data_type_0 = EmptyResponseDataType0.from_dict(data) - - return data_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(EmptyResponseDataType0 | None, data) - - data = _parse_data(d.pop("data")) - - def _parse_meta(data: object) -> EmptyResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = EmptyResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(EmptyResponseMetaType0 | None, data) + data = d.pop("data") - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") empty_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/empty_response_data_type_0.py b/src/shellrent_sdk/client/models/empty_response_data_type_0.py deleted file mode 100644 index 9916089..0000000 --- a/src/shellrent_sdk/client/models/empty_response_data_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="EmptyResponseDataType0") - - -@_attrs_define -class EmptyResponseDataType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - empty_response_data_type_0 = cls() - - empty_response_data_type_0.additional_properties = d - return empty_response_data_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/empty_response_meta_type_0.py b/src/shellrent_sdk/client/models/empty_response_meta_type_0.py deleted file mode 100644 index 66e3065..0000000 --- a/src/shellrent_sdk/client/models/empty_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="EmptyResponseMetaType0") - - -@_attrs_define -class EmptyResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - empty_response_meta_type_0 = cls() - - empty_response_meta_type_0.additional_properties = d - return empty_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/get_hosting_antivirus_response_200_meta_type_0.py b/src/shellrent_sdk/client/models/get_hosting_antivirus_response_200_meta_type_0.py deleted file mode 100644 index 4e1e993..0000000 --- a/src/shellrent_sdk/client/models/get_hosting_antivirus_response_200_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="GetHostingAntivirusResponse200MetaType0") - - -@_attrs_define -class GetHostingAntivirusResponse200MetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - get_hosting_antivirus_response_200_meta_type_0 = cls() - - get_hosting_antivirus_response_200_meta_type_0.additional_properties = d - return get_hosting_antivirus_response_200_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/health_status.py b/src/shellrent_sdk/client/models/health_status.py index 6348e7d..2d2a262 100644 --- a/src/shellrent_sdk/client/models/health_status.py +++ b/src/shellrent_sdk/client/models/health_status.py @@ -11,7 +11,10 @@ @_attrs_define class HealthStatus: + """Status of the API""" + status: str + """ `ok` when the API is up """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/health_status_response.py b/src/shellrent_sdk/client/models/health_status_response.py index d738a7d..959e7cc 100644 --- a/src/shellrent_sdk/client/models/health_status_response.py +++ b/src/shellrent_sdk/client/models/health_status_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.health_status import HealthStatus - from ..models.health_status_response_meta_type_0 import HealthStatusResponseMetaType0 T = TypeVar("T", bound="HealthStatusResponse") @@ -16,15 +15,19 @@ @_attrs_define class HealthStatusResponse: - error: int + """Successful response with one `HealthStatus`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: HealthStatus - meta: HealthStatusResponseMetaType0 | None + """ Status of the API """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.health_status_response_meta_type_0 import HealthStatusResponseMetaType0 - error = self.error message: None | str @@ -32,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, HealthStatusResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.health_status import HealthStatus - from ..models.health_status_response_meta_type_0 import ( - HealthStatusResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -70,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = HealthStatus.from_dict(d.pop("data")) - def _parse_meta(data: object) -> HealthStatusResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = HealthStatusResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(HealthStatusResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") health_status_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/health_status_response_meta_type_0.py b/src/shellrent_sdk/client/models/health_status_response_meta_type_0.py deleted file mode 100644 index f3d8965..0000000 --- a/src/shellrent_sdk/client/models/health_status_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="HealthStatusResponseMetaType0") - - -@_attrs_define -class HealthStatusResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - health_status_response_meta_type_0 = cls() - - health_status_response_meta_type_0.additional_properties = d - return health_status_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/hosting.py b/src/shellrent_sdk/client/models/hosting.py index 7528181..2e4dae1 100644 --- a/src/shellrent_sdk/client/models/hosting.py +++ b/src/shellrent_sdk/client/models/hosting.py @@ -1,28 +1,57 @@ from __future__ import annotations from collections.abc import Mapping -from typing import Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field +if TYPE_CHECKING: + from ..models.hosting_php_setting import HostingPhpSetting + + T = TypeVar("T", bound="Hosting") @_attrs_define class Hosting: + """Hosting of the account: a main hosting, bought with a purchase, or one of its subdomains""" + hosting_id: int purchase_id: int | None + """ Id of the purchase of the hosting (`GET /api/v3/purchases/{purchase_id}`); null for a subdomain, which + belongs to the purchase of its main hosting """ parent_hosting_id: int | None + """ Id of the main hosting of a subdomain (`GET /api/v3/hostings/{hosting_id}`); null for a main hosting """ is_primary: bool + """ Whether it is a main hosting; false for a subdomain (`POST /api/v3/hostings/{hosting_id}/subdomains`) """ host_name: None | str + """ Host name, in Unicode: the hostname of a main hosting (usually its domain), the level name of a subdomain + (for example `blog`) """ host_name_idna: None | str + """ `host_name` in punycode """ full_name: None | str + """ Full hostname, in Unicode: for a subdomain, the level name followed by the hostname of the main hosting """ full_name_idna: None | str + """ `full_name` in punycode """ domain_full_name: None | str + """ Hostname on the domain of the purchase, in Unicode: the domain for a main hosting, the subdomain of the + domain for a subdomain """ domain_full_name_idna: None | str + """ `domain_full_name` in punycode """ php_version: None | str + """ PHP version of the hosting, for example `8.3` (`PATCH /api/v3/hostings/{hosting_id}/php-version`); null or + empty when not set """ + http_version: str + """ HTTP version of the hosting: 1 for HTTP/1.1, 2 for HTTP/2 (`PATCH /api/v3/hostings/{hosting_id}/http- + version`) """ + file_protection_enabled: bool + """ Whether the file protection is enabled (`PATCH /api/v3/hostings/{hosting_id}/file-protection`) """ + php_settings: list[HostingPhpSetting] + """ PHP directives changed on the hosting (`PATCH /api/v3/hostings/{hosting_id}/php-settings`): the others have + the default value of the web server """ is_active: bool + """ Whether the hosting is active: always true, since deleted subdomains are not returned """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -57,6 +86,15 @@ def to_dict(self) -> dict[str, Any]: php_version: None | str php_version = self.php_version + http_version = self.http_version + + file_protection_enabled = self.file_protection_enabled + + php_settings = [] + for php_settings_item_data in self.php_settings: + php_settings_item = php_settings_item_data.to_dict() + php_settings.append(php_settings_item) + is_active = self.is_active field_dict: dict[str, Any] = {} @@ -74,6 +112,9 @@ def to_dict(self) -> dict[str, Any]: "domain_full_name": domain_full_name, "domain_full_name_idna": domain_full_name_idna, "php_version": php_version, + "http_version": http_version, + "file_protection_enabled": file_protection_enabled, + "php_settings": php_settings, "is_active": is_active, } ) @@ -82,6 +123,8 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.hosting_php_setting import HostingPhpSetting + d = dict(src_dict) hosting_id = d.pop("hosting_id") @@ -150,6 +193,17 @@ def _parse_php_version(data: object) -> None | str: php_version = _parse_php_version(d.pop("php_version")) + http_version = d.pop("http_version") + + file_protection_enabled = d.pop("file_protection_enabled") + + php_settings = [] + _php_settings = d.pop("php_settings") + for php_settings_item_data in _php_settings: + php_settings_item = HostingPhpSetting.from_dict(php_settings_item_data) + + php_settings.append(php_settings_item) + is_active = d.pop("is_active") hosting = cls( @@ -164,6 +218,9 @@ def _parse_php_version(data: object) -> None | str: domain_full_name=domain_full_name, domain_full_name_idna=domain_full_name_idna, php_version=php_version, + http_version=http_version, + file_protection_enabled=file_protection_enabled, + php_settings=php_settings, is_active=is_active, ) diff --git a/src/shellrent_sdk/client/models/hosting_antivirus.py b/src/shellrent_sdk/client/models/hosting_antivirus.py index 268e66f..56e7e4e 100644 --- a/src/shellrent_sdk/client/models/hosting_antivirus.py +++ b/src/shellrent_sdk/client/models/hosting_antivirus.py @@ -12,23 +12,39 @@ @_attrs_define class HostingAntivirus: + """Antivirus scan running on the hosting, or the latest one""" + antivirus_id: int - hosting_id: int + """ Id of the scan (`GET /api/v3/hostings/{hosting_id}/antivirus/scans/{antivirus_id}`) """ + hosting_id: int | None + """ Id of the main hosting (`GET /api/v3/hostings/{hosting_id}`): the scan covers its whole space, subdomains + included """ status_code: None | str + """ Status of the scan: `RUNNING`, `FAILED`, `SUCCESS` (no infection found) or `PROBLEM` (infections found) """ status_name: None | str + """ Translated name of the status, for display """ status_color: None | str + """ Color of the status, in hexadecimal, for display """ antivirus_type: str + """ Type of the scan: `M` manual, `A` automatic """ date_started: datetime.datetime | None + """ Start of the scan, as sent by the antivirus; null until the scan completes, and for a failed scan """ date_completed: datetime.datetime | None + """ End of the scan, as sent by the antivirus; null until the scan completes, and for a failed scan """ date_timeout: datetime.datetime | None + """ When the scan was marked as failed because it ran too long; null otherwise """ total_files: int | None + """ Files scanned; null when zero, and until the scan completes """ total_infected: int | None + """ Infected files found; null when zero, and until the scan completes """ total_cleaned: int | None + """ Infected files cleaned by the antivirus; null when zero, and until the scan completes """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: antivirus_id = self.antivirus_id + hosting_id: int | None hosting_id = self.hosting_id status_code: None | str @@ -95,7 +111,12 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) antivirus_id = d.pop("antivirus_id") - hosting_id = d.pop("hosting_id") + def _parse_hosting_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + hosting_id = _parse_hosting_id(d.pop("hosting_id")) def _parse_status_code(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/get_hosting_antivirus_response_200.py b/src/shellrent_sdk/client/models/hosting_antivirus_nullable_response.py similarity index 61% rename from src/shellrent_sdk/client/models/get_hosting_antivirus_response_200.py rename to src/shellrent_sdk/client/models/hosting_antivirus_nullable_response.py index fd08f0e..11a8731 100644 --- a/src/shellrent_sdk/client/models/get_hosting_antivirus_response_200.py +++ b/src/shellrent_sdk/client/models/hosting_antivirus_nullable_response.py @@ -1,33 +1,33 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: - from ..models.get_hosting_antivirus_response_200_meta_type_0 import ( - GetHostingAntivirusResponse200MetaType0, - ) from ..models.hosting_antivirus import HostingAntivirus -T = TypeVar("T", bound="GetHostingAntivirusResponse200") +T = TypeVar("T", bound="HostingAntivirusNullableResponse") @_attrs_define -class GetHostingAntivirusResponse200: - error: int +class HostingAntivirusNullableResponse: + """Successful response with one `HostingAntivirus`, or null""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: HostingAntivirus | None - meta: GetHostingAntivirusResponse200MetaType0 | None + """ Resource returned by the operation, or null: the description of the response says when """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.get_hosting_antivirus_response_200_meta_type_0 import ( - GetHostingAntivirusResponse200MetaType0, - ) from ..models.hosting_antivirus import HostingAntivirus error = self.error @@ -41,11 +41,7 @@ def to_dict(self) -> dict[str, Any]: else: data = self.data - meta: dict[str, Any] | None - if isinstance(self.meta, GetHostingAntivirusResponse200MetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -62,13 +58,12 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.get_hosting_antivirus_response_200_meta_type_0 import ( - GetHostingAntivirusResponse200MetaType0, - ) from ..models.hosting_antivirus import HostingAntivirus d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -92,30 +87,17 @@ def _parse_data(data: object) -> HostingAntivirus | None: data = _parse_data(d.pop("data")) - def _parse_meta(data: object) -> GetHostingAntivirusResponse200MetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = GetHostingAntivirusResponse200MetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(GetHostingAntivirusResponse200MetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") - get_hosting_antivirus_response_200 = cls( + hosting_antivirus_nullable_response = cls( error=error, message=message, data=data, meta=meta, ) - get_hosting_antivirus_response_200.additional_properties = d - return get_hosting_antivirus_response_200 + hosting_antivirus_nullable_response.additional_properties = d + return hosting_antivirus_nullable_response @property def additional_keys(self) -> list[str]: diff --git a/src/shellrent_sdk/client/models/hosting_antivirus_removal_scan.py b/src/shellrent_sdk/client/models/hosting_antivirus_removal_scan.py index 2661e45..f463a06 100644 --- a/src/shellrent_sdk/client/models/hosting_antivirus_removal_scan.py +++ b/src/shellrent_sdk/client/models/hosting_antivirus_removal_scan.py @@ -12,11 +12,17 @@ @_attrs_define class HostingAntivirusRemovalScan: + """Antivirus cleaning of the hosting, which removes or cleans the infected files and database contents""" + removal_scan_id: int hosting_id: int + """ Id of the hosting (`GET /api/v3/hostings/{hosting_id}`) """ task_id: int | None + """ Id of the task of the cleaning (`GET /api/v3/tasks/{task_id}`); null when the task is not available """ status: bool | None + """ Whether the cleaning succeeded; null until the antivirus sends the result """ error: None | str + """ Error message of a failed cleaning; null otherwise """ date_created: datetime.datetime additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) diff --git a/src/shellrent_sdk/client/models/hosting_antivirus_removal_scan_paginated_list_response.py b/src/shellrent_sdk/client/models/hosting_antivirus_removal_scan_paginated_list_response.py index 9615b89..cdab541 100644 --- a/src/shellrent_sdk/client/models/hosting_antivirus_removal_scan_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/hosting_antivirus_removal_scan_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class HostingAntivirusRemovalScanPaginatedListResponse: - error: int + """Successful response with a page of `HostingAntivirusRemovalScan`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[HostingAntivirusRemovalScan] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -56,7 +62,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.pagination_meta import PaginationMeta d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/hosting_antivirus_removal_scan_response.py b/src/shellrent_sdk/client/models/hosting_antivirus_removal_scan_response.py index 23ff9b5..885d507 100644 --- a/src/shellrent_sdk/client/models/hosting_antivirus_removal_scan_response.py +++ b/src/shellrent_sdk/client/models/hosting_antivirus_removal_scan_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.hosting_antivirus_removal_scan import HostingAntivirusRemovalScan - from ..models.hosting_antivirus_removal_scan_response_meta_type_0 import ( - HostingAntivirusRemovalScanResponseMetaType0, - ) T = TypeVar("T", bound="HostingAntivirusRemovalScanResponse") @@ -18,17 +15,19 @@ @_attrs_define class HostingAntivirusRemovalScanResponse: - error: int + """Successful response with one `HostingAntivirusRemovalScan`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: HostingAntivirusRemovalScan - meta: HostingAntivirusRemovalScanResponseMetaType0 | None + """ Antivirus cleaning of the hosting, which removes or cleans the infected files and database contents """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.hosting_antivirus_removal_scan_response_meta_type_0 import ( - HostingAntivirusRemovalScanResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, HostingAntivirusRemovalScanResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -60,12 +55,11 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.hosting_antivirus_removal_scan import ( HostingAntivirusRemovalScan, ) - from ..models.hosting_antivirus_removal_scan_response_meta_type_0 import ( - HostingAntivirusRemovalScanResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -76,20 +70,7 @@ def _parse_message(data: object) -> None | str: data = HostingAntivirusRemovalScan.from_dict(d.pop("data")) - def _parse_meta(data: object) -> HostingAntivirusRemovalScanResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = HostingAntivirusRemovalScanResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(HostingAntivirusRemovalScanResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") hosting_antivirus_removal_scan_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/hosting_antivirus_removal_scan_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_antivirus_removal_scan_response_meta_type_0.py deleted file mode 100644 index 3618b37..0000000 --- a/src/shellrent_sdk/client/models/hosting_antivirus_removal_scan_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="HostingAntivirusRemovalScanResponseMetaType0") - - -@_attrs_define -class HostingAntivirusRemovalScanResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - hosting_antivirus_removal_scan_response_meta_type_0 = cls() - - hosting_antivirus_removal_scan_response_meta_type_0.additional_properties = d - return hosting_antivirus_removal_scan_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/hosting_antivirus_scan.py b/src/shellrent_sdk/client/models/hosting_antivirus_scan.py index da79233..c01bfb1 100644 --- a/src/shellrent_sdk/client/models/hosting_antivirus_scan.py +++ b/src/shellrent_sdk/client/models/hosting_antivirus_scan.py @@ -12,25 +12,41 @@ @_attrs_define class HostingAntivirusScan: + """Antivirus scan of the hosting""" + antivirus_id: int - hosting_id: int + hosting_id: int | None + """ Id of the main hosting (`GET /api/v3/hostings/{hosting_id}`): the scan covers its whole space, subdomains + included """ status_code: None | str + """ Status of the scan: `RUNNING`, `FAILED`, `SUCCESS` (no infection found) or `PROBLEM` (infections found) """ status_name: None | str + """ Translated name of the status, for display """ status_color: None | str + """ Color of the status, in hexadecimal, for display """ antivirus_type: str + """ Type of the scan: `M` manual, `A` automatic """ scan_id: None | str + """ Id of the scan on the web server; null until the scan completes """ date_started: datetime.datetime | None + """ Start of the scan, as sent by the antivirus; null until the scan completes, and for a failed scan """ date_completed: datetime.datetime | None + """ End of the scan, as sent by the antivirus; null until the scan completes, and for a failed scan """ date_timeout: datetime.datetime | None + """ When the scan was marked as failed because it ran too long; null otherwise """ date_created: datetime.datetime total_files: int | None + """ Files scanned; null when zero, and until the scan completes """ total_infected: int | None + """ Infected files found; null when zero, and until the scan completes """ total_cleaned: int | None + """ Infected files cleaned by the antivirus; null when zero, and until the scan completes """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: antivirus_id = self.antivirus_id + hosting_id: int | None hosting_id = self.hosting_id status_code: None | str @@ -104,7 +120,12 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) antivirus_id = d.pop("antivirus_id") - hosting_id = d.pop("hosting_id") + def _parse_hosting_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + hosting_id = _parse_hosting_id(d.pop("hosting_id")) def _parse_status_code(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/hosting_antivirus_scan_paginated_list_response.py b/src/shellrent_sdk/client/models/hosting_antivirus_scan_paginated_list_response.py index 78e4aa4..6397879 100644 --- a/src/shellrent_sdk/client/models/hosting_antivirus_scan_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/hosting_antivirus_scan_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class HostingAntivirusScanPaginatedListResponse: - error: int + """Successful response with a page of `HostingAntivirusScan`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[HostingAntivirusScan] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.pagination_meta import PaginationMeta d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/hosting_antivirus_scan_response.py b/src/shellrent_sdk/client/models/hosting_antivirus_scan_response.py index dffd410..7e4460d 100644 --- a/src/shellrent_sdk/client/models/hosting_antivirus_scan_response.py +++ b/src/shellrent_sdk/client/models/hosting_antivirus_scan_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.hosting_antivirus_scan import HostingAntivirusScan - from ..models.hosting_antivirus_scan_response_meta_type_0 import ( - HostingAntivirusScanResponseMetaType0, - ) T = TypeVar("T", bound="HostingAntivirusScanResponse") @@ -18,17 +15,19 @@ @_attrs_define class HostingAntivirusScanResponse: - error: int + """Successful response with one `HostingAntivirusScan`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: HostingAntivirusScan - meta: HostingAntivirusScanResponseMetaType0 | None + """ Antivirus scan of the hosting """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.hosting_antivirus_scan_response_meta_type_0 import ( - HostingAntivirusScanResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, HostingAntivirusScanResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -58,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.hosting_antivirus_scan import HostingAntivirusScan - from ..models.hosting_antivirus_scan_response_meta_type_0 import ( - HostingAntivirusScanResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -74,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = HostingAntivirusScan.from_dict(d.pop("data")) - def _parse_meta(data: object) -> HostingAntivirusScanResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = HostingAntivirusScanResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(HostingAntivirusScanResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") hosting_antivirus_scan_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/hosting_antivirus_scan_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_antivirus_scan_response_meta_type_0.py deleted file mode 100644 index 4fa73f2..0000000 --- a/src/shellrent_sdk/client/models/hosting_antivirus_scan_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="HostingAntivirusScanResponseMetaType0") - - -@_attrs_define -class HostingAntivirusScanResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - hosting_antivirus_scan_response_meta_type_0 = cls() - - hosting_antivirus_scan_response_meta_type_0.additional_properties = d - return hosting_antivirus_scan_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/hosting_backup.py b/src/shellrent_sdk/client/models/hosting_backup.py index fca4354..6be43fc 100644 --- a/src/shellrent_sdk/client/models/hosting_backup.py +++ b/src/shellrent_sdk/client/models/hosting_backup.py @@ -12,19 +12,39 @@ @_attrs_define class HostingBackup: + """Backup that contains the hosting: a backup of a web, database or mail server, with the database or the mailbox of + the hosting that it saved + + """ + hosting_backup_id: int + """ Id of the backup in the hosting (`GET /api/v3/hostings/{hosting_id}/backups/{hosting_backup_id}`) """ hosting_id: int + """ Id of the hosting (`GET /api/v3/hostings/{hosting_id}`) """ backup_id: int + """ Id of the server backup, which can include other hostings: send it to `POST + /api/v3/hostings/{hosting_id}/backups/exhibitions` """ category: None | str + """ Category of the backed up server: `web` (web contents), `database` or `mail` """ backup_type_code: None | str + """ Type of the backup, for example `HOSTING_DAILY`, `HOSTING_WEEKLY`, `HOSTING_MONTHLY` or `HOSTING_UNA_TANTUM` + (one-off backup) """ backup_frequency_code: None | str + """ Frequency of the backup: `D` daily, `W` weekly, `M` monthly, `C` one-off """ backup_date: datetime.datetime | None + """ When the server backup was taken """ backup_size: int | None + """ Size of the server backup, in MB: it can include other hostings """ backup_duration: None | str + """ Duration of the server backup, as `HH:MM:SS` """ exit_status: int | None + """ Exit code of the server backup: 0 when it succeeded """ error_type: None | str + """ Outcome message of the server backup, in Italian, for example `Tutto ok` (all fine) """ mailbox_name: None | str + """ Mailbox saved, for a backup of category `mail`; null for the other categories """ database_name: None | str + """ Database saved, for a backup of category `database`; null for the other categories """ date_created: datetime.datetime | None additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) diff --git a/src/shellrent_sdk/client/models/hosting_backup_expose_request.py b/src/shellrent_sdk/client/models/hosting_backup_expose_request.py index bac3b1b..ca1c8f3 100644 --- a/src/shellrent_sdk/client/models/hosting_backup_expose_request.py +++ b/src/shellrent_sdk/client/models/hosting_backup_expose_request.py @@ -4,7 +4,6 @@ from typing import Any, Self, TypeVar, cast from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -13,9 +12,14 @@ @_attrs_define class HostingBackupExposeRequest: + """Backups to expose: they are copied, without restoring them, into the FTP space of the hosting""" + web_backup_id: int | None | Unset = UNSET + """ The `backup_id` of a backup with category `web` returned by `GET /api/v3/hostings/{hosting_id}/backups`. + Send at least one of web_backup_id and db_backup_id """ db_backup_id: int | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + """ The `backup_id` of a backup with category `database` returned by `GET + /api/v3/hostings/{hosting_id}/backups`. Send at least one of web_backup_id and db_backup_id """ def to_dict(self) -> dict[str, Any]: web_backup_id: int | None | Unset @@ -31,7 +35,7 @@ def to_dict(self) -> dict[str, Any]: db_backup_id = self.db_backup_id field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if web_backup_id is not UNSET: field_dict["web_backup_id"] = web_backup_id @@ -67,21 +71,4 @@ def _parse_db_backup_id(data: object) -> int | None | Unset: db_backup_id=db_backup_id, ) - hosting_backup_expose_request.additional_properties = d return hosting_backup_expose_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/hosting_backup_list_response.py b/src/shellrent_sdk/client/models/hosting_backup_list_response.py index 62cb949..3dfc52e 100644 --- a/src/shellrent_sdk/client/models/hosting_backup_list_response.py +++ b/src/shellrent_sdk/client/models/hosting_backup_list_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.hosting_backup import HostingBackup - from ..models.hosting_backup_list_response_meta_type_0 import HostingBackupListResponseMetaType0 T = TypeVar("T", bound="HostingBackupListResponse") @@ -16,17 +15,19 @@ @_attrs_define class HostingBackupListResponse: - error: int + """Successful response with a list of `HostingBackup`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[HostingBackup] - meta: HostingBackupListResponseMetaType0 | None + """ Items returned by the operation """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.hosting_backup_list_response_meta_type_0 import ( - HostingBackupListResponseMetaType0, - ) - error = self.error message: None | str @@ -37,11 +38,7 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - meta: dict[str, Any] | None - if isinstance(self.meta, HostingBackupListResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -59,12 +56,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.hosting_backup import HostingBackup - from ..models.hosting_backup_list_response_meta_type_0 import ( - HostingBackupListResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -80,20 +76,7 @@ def _parse_message(data: object) -> None | str: data.append(data_item) - def _parse_meta(data: object) -> HostingBackupListResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = HostingBackupListResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(HostingBackupListResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") hosting_backup_list_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/hosting_backup_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_backup_list_response_meta_type_0.py deleted file mode 100644 index 0331f33..0000000 --- a/src/shellrent_sdk/client/models/hosting_backup_list_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="HostingBackupListResponseMetaType0") - - -@_attrs_define -class HostingBackupListResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - hosting_backup_list_response_meta_type_0 = cls() - - hosting_backup_list_response_meta_type_0.additional_properties = d - return hosting_backup_list_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/hosting_backup_response.py b/src/shellrent_sdk/client/models/hosting_backup_response.py index 1d02ed1..ad18480 100644 --- a/src/shellrent_sdk/client/models/hosting_backup_response.py +++ b/src/shellrent_sdk/client/models/hosting_backup_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.hosting_backup import HostingBackup - from ..models.hosting_backup_response_meta_type_0 import HostingBackupResponseMetaType0 T = TypeVar("T", bound="HostingBackupResponse") @@ -16,15 +15,20 @@ @_attrs_define class HostingBackupResponse: - error: int + """Successful response with one `HostingBackup`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: HostingBackup - meta: HostingBackupResponseMetaType0 | None + """ Backup that contains the hosting: a backup of a web, database or mail server, with the database or the + mailbox of the hosting that it saved """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.hosting_backup_response_meta_type_0 import HostingBackupResponseMetaType0 - error = self.error message: None | str @@ -32,11 +36,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, HostingBackupResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,12 +54,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.hosting_backup import HostingBackup - from ..models.hosting_backup_response_meta_type_0 import ( - HostingBackupResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -70,20 +69,7 @@ def _parse_message(data: object) -> None | str: data = HostingBackup.from_dict(d.pop("data")) - def _parse_meta(data: object) -> HostingBackupResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = HostingBackupResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(HostingBackupResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") hosting_backup_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/hosting_backup_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_backup_response_meta_type_0.py deleted file mode 100644 index 229c3c3..0000000 --- a/src/shellrent_sdk/client/models/hosting_backup_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="HostingBackupResponseMetaType0") - - -@_attrs_define -class HostingBackupResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - hosting_backup_response_meta_type_0 = cls() - - hosting_backup_response_meta_type_0.additional_properties = d - return hosting_backup_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/hosting_credential.py b/src/shellrent_sdk/client/models/hosting_credential.py index 0ab9cd5..5da2202 100644 --- a/src/shellrent_sdk/client/models/hosting_credential.py +++ b/src/shellrent_sdk/client/models/hosting_credential.py @@ -11,12 +11,20 @@ @_attrs_define class HostingCredential: + """Active FTP or database account of the hosting, with its password""" + credential_id: int type_: str + """ Type of the account: `FTP` (main FTP account), `FTP_SECONDARY` (additional FTP account), `DATABASE_MYSQL` or + `DATABASE_MSSQL` (database account) """ username: str password: str + """ Password of the account, in clear text, as in the control panel: a temporary random one while the account is + suspended """ root_path: None | str + """ Root directory of an `FTP_SECONDARY` account; null for the other accounts """ is_active: bool + """ Whether the account is active """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/hosting_credential_list_response.py b/src/shellrent_sdk/client/models/hosting_credential_list_response.py index b4c7add..f5dcd19 100644 --- a/src/shellrent_sdk/client/models/hosting_credential_list_response.py +++ b/src/shellrent_sdk/client/models/hosting_credential_list_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.hosting_credential import HostingCredential - from ..models.hosting_credential_list_response_meta_type_0 import ( - HostingCredentialListResponseMetaType0, - ) T = TypeVar("T", bound="HostingCredentialListResponse") @@ -18,17 +15,19 @@ @_attrs_define class HostingCredentialListResponse: - error: int + """Successful response with a list of `HostingCredential`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[HostingCredential] - meta: HostingCredentialListResponseMetaType0 | None + """ Items returned by the operation """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.hosting_credential_list_response_meta_type_0 import ( - HostingCredentialListResponseMetaType0, - ) - error = self.error message: None | str @@ -39,11 +38,7 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - meta: dict[str, Any] | None - if isinstance(self.meta, HostingCredentialListResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -61,12 +56,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.hosting_credential import HostingCredential - from ..models.hosting_credential_list_response_meta_type_0 import ( - HostingCredentialListResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -82,20 +76,7 @@ def _parse_message(data: object) -> None | str: data.append(data_item) - def _parse_meta(data: object) -> HostingCredentialListResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = HostingCredentialListResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(HostingCredentialListResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") hosting_credential_list_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/hosting_credential_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_credential_list_response_meta_type_0.py deleted file mode 100644 index e5c53a4..0000000 --- a/src/shellrent_sdk/client/models/hosting_credential_list_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="HostingCredentialListResponseMetaType0") - - -@_attrs_define -class HostingCredentialListResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - hosting_credential_list_response_meta_type_0 = cls() - - hosting_credential_list_response_meta_type_0.additional_properties = d - return hosting_credential_list_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/hosting_cronjob.py b/src/shellrent_sdk/client/models/hosting_cronjob.py index 1f2db5b..d45d27e 100644 --- a/src/shellrent_sdk/client/models/hosting_cronjob.py +++ b/src/shellrent_sdk/client/models/hosting_cronjob.py @@ -12,19 +12,39 @@ @_attrs_define class HostingCronjob: + """Cron job of the hosting: a URL called on a schedule""" + cronjob_id: int hosting_id: int + """ Id of the hosting of the request: cron jobs belong to the purchase, so a subdomain lists those of its main + hosting """ purchase_id: int + """ Id of the purchase of the hosting (`GET /api/v3/purchases/{purchase_id}`) """ request_url: str + """ URL called by the cron job, with the protocol """ http_request_method: None | str + """ HTTP method of the call: `GET` or `POST` """ plan_month: None | str + """ Months, from 1 (January) to 12 (December), as a comma-separated list like in the creation (for example + `1,6`); null for every month """ plan_monthday: None | str + """ Days of the month, from 1 to 31, as a comma-separated list like in the creation (for example `1,15`); null + for every day """ plan_weekday: None | str + """ Days of the week, from 1 (Monday) to 7 (Sunday), as a comma-separated list like in the creation (for example + `1,5`); null for every day of the week """ plan_hour: None | str + """ Hours, from 0 to 23, as a comma-separated list like in the creation (for example `0,12`); null for every + hour """ plan_minute: None | str + """ Minutes, from 0 to 59, as a comma-separated list like in the creation (for example `0,30`); null for every + minute """ active: bool + """ Whether the cron job is active: deleted cron jobs, and the old versions of changed ones, stay in the list as + inactive """ date_created: datetime.datetime | None date_disabled: datetime.datetime | None + """ When the cron job was deleted or replaced by a new version; null while it is active """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/hosting_cronjob_create_request.py b/src/shellrent_sdk/client/models/hosting_cronjob_create_request.py index 26c9d85..23b2036 100644 --- a/src/shellrent_sdk/client/models/hosting_cronjob_create_request.py +++ b/src/shellrent_sdk/client/models/hosting_cronjob_create_request.py @@ -4,8 +4,13 @@ from typing import Any, Self, TypeVar, cast from attrs import define as _attrs_define -from attrs import field as _attrs_field +from ..models.hosting_cronjob_create_request_http_request_method import ( + HostingCronjobCreateRequestHttpRequestMethod, +) +from ..models.hosting_cronjob_create_request_request_protocol import ( + HostingCronjobCreateRequestRequestProtocol, +) from ..types import UNSET, Unset T = TypeVar("T", bound="HostingCronjobCreateRequest") @@ -13,24 +18,39 @@ @_attrs_define class HostingCronjobCreateRequest: - request_protocol: str | Unset = UNSET + request_protocol: HostingCronjobCreateRequestRequestProtocol """ http or https """ - request_url: str | Unset = UNSET - """ URL without protocol """ - http_request_method: str | Unset = "GET" + request_url: str + """ URL to call, without protocol (e.g. `www.example.com/cron.php`): a leading http:// or https:// is removed + and request_protocol is used """ + http_request_method: HostingCronjobCreateRequestHttpRequestMethod | Unset = ( + HostingCronjobCreateRequestHttpRequestMethod.GET + ) + """ HTTP method of the call """ plan_month: None | str | Unset = UNSET + """ Month in which the cronjob runs, from 1 (January) to 12 (December). Omit it, or send null or an empty + string, to run it every month """ plan_monthday: None | str | Unset = UNSET + """ Days of the month, as a comma-separated list of values from 1 to 31 (e.g. `1,15`). Omit it, or send null or + an empty string, to run it every day """ plan_weekday: None | str | Unset = UNSET + """ Day of the week, from 1 (Monday) to 7 (Sunday). Omit it, or send null or an empty string, to run it every + day of the week """ plan_hour: None | str | Unset = UNSET + """ Hours, as a comma-separated list of values from 0 to 23 (e.g. `0,12`). Omit it, or send null or an empty + string, to run it every hour """ plan_minute: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + """ Minutes, as a comma-separated list of values from 0 to 59 (e.g. `0,30`). Omit it, or send null or an empty + string, to run it every minute """ def to_dict(self) -> dict[str, Any]: - request_protocol = self.request_protocol + request_protocol = self.request_protocol.value request_url = self.request_url - http_request_method = self.http_request_method + http_request_method: str | Unset = UNSET + if not isinstance(self.http_request_method, Unset): + http_request_method = self.http_request_method.value plan_month: None | str | Unset if isinstance(self.plan_month, Unset): @@ -63,12 +83,13 @@ def to_dict(self) -> dict[str, Any]: plan_minute = self.plan_minute field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if request_protocol is not UNSET: - field_dict["request_protocol"] = request_protocol - if request_url is not UNSET: - field_dict["request_url"] = request_url + + field_dict.update( + { + "request_protocol": request_protocol, + "request_url": request_url, + } + ) if http_request_method is not UNSET: field_dict["http_request_method"] = http_request_method if plan_month is not UNSET: @@ -87,11 +108,16 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) - request_protocol = d.pop("request_protocol", UNSET) + request_protocol = HostingCronjobCreateRequestRequestProtocol(d.pop("request_protocol")) - request_url = d.pop("request_url", UNSET) + request_url = d.pop("request_url") - http_request_method = d.pop("http_request_method", UNSET) + _http_request_method = d.pop("http_request_method", UNSET) + http_request_method: HostingCronjobCreateRequestHttpRequestMethod | Unset + if isinstance(_http_request_method, Unset): + http_request_method = UNSET + else: + http_request_method = HostingCronjobCreateRequestHttpRequestMethod(_http_request_method) def _parse_plan_month(data: object) -> None | str | Unset: if data is None: @@ -149,21 +175,4 @@ def _parse_plan_minute(data: object) -> None | str | Unset: plan_minute=plan_minute, ) - hosting_cronjob_create_request.additional_properties = d return hosting_cronjob_create_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/hosting_cronjob_create_request_http_request_method.py b/src/shellrent_sdk/client/models/hosting_cronjob_create_request_http_request_method.py new file mode 100644 index 0000000..de420f5 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_cronjob_create_request_http_request_method.py @@ -0,0 +1,9 @@ +from enum import StrEnum + + +class HostingCronjobCreateRequestHttpRequestMethod(StrEnum): + GET = "GET" + POST = "POST" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/shellrent_sdk/client/models/hosting_cronjob_create_request_request_protocol.py b/src/shellrent_sdk/client/models/hosting_cronjob_create_request_request_protocol.py new file mode 100644 index 0000000..9574990 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_cronjob_create_request_request_protocol.py @@ -0,0 +1,9 @@ +from enum import StrEnum + + +class HostingCronjobCreateRequestRequestProtocol(StrEnum): + HTTP = "http" + HTTPS = "https" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/shellrent_sdk/client/models/hosting_cronjob_paginated_list_response.py b/src/shellrent_sdk/client/models/hosting_cronjob_paginated_list_response.py index ed257b3..252d62f 100644 --- a/src/shellrent_sdk/client/models/hosting_cronjob_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/hosting_cronjob_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class HostingCronjobPaginatedListResponse: - error: int + """Successful response with a page of `HostingCronjob`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[HostingCronjob] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.pagination_meta import PaginationMeta d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/hosting_cronjob_response.py b/src/shellrent_sdk/client/models/hosting_cronjob_response.py index 844af4e..09ba160 100644 --- a/src/shellrent_sdk/client/models/hosting_cronjob_response.py +++ b/src/shellrent_sdk/client/models/hosting_cronjob_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.hosting_cronjob import HostingCronjob - from ..models.hosting_cronjob_response_meta_type_0 import HostingCronjobResponseMetaType0 T = TypeVar("T", bound="HostingCronjobResponse") @@ -16,15 +15,19 @@ @_attrs_define class HostingCronjobResponse: - error: int + """Successful response with one `HostingCronjob`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: HostingCronjob - meta: HostingCronjobResponseMetaType0 | None + """ Cron job of the hosting: a URL called on a schedule """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.hosting_cronjob_response_meta_type_0 import HostingCronjobResponseMetaType0 - error = self.error message: None | str @@ -32,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, HostingCronjobResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.hosting_cronjob import HostingCronjob - from ..models.hosting_cronjob_response_meta_type_0 import ( - HostingCronjobResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -70,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = HostingCronjob.from_dict(d.pop("data")) - def _parse_meta(data: object) -> HostingCronjobResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = HostingCronjobResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(HostingCronjobResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") hosting_cronjob_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/hosting_cronjob_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_cronjob_response_meta_type_0.py deleted file mode 100644 index 42b18a4..0000000 --- a/src/shellrent_sdk/client/models/hosting_cronjob_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="HostingCronjobResponseMetaType0") - - -@_attrs_define -class HostingCronjobResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - hosting_cronjob_response_meta_type_0 = cls() - - hosting_cronjob_response_meta_type_0.additional_properties = d - return hosting_cronjob_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/hosting_database.py b/src/shellrent_sdk/client/models/hosting_database.py index 67c2c83..39a9218 100644 --- a/src/shellrent_sdk/client/models/hosting_database.py +++ b/src/shellrent_sdk/client/models/hosting_database.py @@ -11,13 +11,21 @@ @_attrs_define class HostingDatabase: + """Database of the hosting, with the account that owns it""" + database_id: str + """ Id of the database: its name """ name: str type_: str + """ Type of the database: `MYSQL` or `MSSQL` (Microsoft SQL Server) """ credential_id: int | None + """ Id of the database account that owns the database, as in `GET /api/v3/hostings/{hosting_id}/credentials` """ username: None | str + """ Username of the database account """ supplier_code: None | str + """ Id of the database on Plesk, for the hostings managed with Plesk; null for the others """ table_count: int | None + """ Number of tables in the database; null for the databases on Plesk """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/hosting_database_create_request.py b/src/shellrent_sdk/client/models/hosting_database_create_request.py deleted file mode 100644 index 554d40f..0000000 --- a/src/shellrent_sdk/client/models/hosting_database_create_request.py +++ /dev/null @@ -1,89 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="HostingDatabaseCreateRequest") - - -@_attrs_define -class HostingDatabaseCreateRequest: - database_name: None | str | Unset = UNSET - """ Optional database name. """ - name: None | str | Unset = UNSET - """ Alias of database_name. """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - database_name: None | str | Unset - if isinstance(self.database_name, Unset): - database_name = UNSET - else: - database_name = self.database_name - - name: None | str | Unset - if isinstance(self.name, Unset): - name = UNSET - else: - name = self.name - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if database_name is not UNSET: - field_dict["database_name"] = database_name - if name is not UNSET: - field_dict["name"] = name - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - - def _parse_database_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - database_name = _parse_database_name(d.pop("database_name", UNSET)) - - def _parse_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - name = _parse_name(d.pop("name", UNSET)) - - hosting_database_create_request = cls( - database_name=database_name, - name=name, - ) - - hosting_database_create_request.additional_properties = d - return hosting_database_create_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/hosting_database_list_response.py b/src/shellrent_sdk/client/models/hosting_database_list_response.py index 79feee4..4e4b0e7 100644 --- a/src/shellrent_sdk/client/models/hosting_database_list_response.py +++ b/src/shellrent_sdk/client/models/hosting_database_list_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.hosting_database import HostingDatabase - from ..models.hosting_database_list_response_meta_type_0 import ( - HostingDatabaseListResponseMetaType0, - ) T = TypeVar("T", bound="HostingDatabaseListResponse") @@ -18,17 +15,19 @@ @_attrs_define class HostingDatabaseListResponse: - error: int + """Successful response with a list of `HostingDatabase`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[HostingDatabase] - meta: HostingDatabaseListResponseMetaType0 | None + """ Items returned by the operation """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.hosting_database_list_response_meta_type_0 import ( - HostingDatabaseListResponseMetaType0, - ) - error = self.error message: None | str @@ -39,11 +38,7 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - meta: dict[str, Any] | None - if isinstance(self.meta, HostingDatabaseListResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -61,12 +56,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.hosting_database import HostingDatabase - from ..models.hosting_database_list_response_meta_type_0 import ( - HostingDatabaseListResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -82,20 +76,7 @@ def _parse_message(data: object) -> None | str: data.append(data_item) - def _parse_meta(data: object) -> HostingDatabaseListResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = HostingDatabaseListResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(HostingDatabaseListResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") hosting_database_list_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/hosting_database_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_database_list_response_meta_type_0.py deleted file mode 100644 index 502a38a..0000000 --- a/src/shellrent_sdk/client/models/hosting_database_list_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="HostingDatabaseListResponseMetaType0") - - -@_attrs_define -class HostingDatabaseListResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - hosting_database_list_response_meta_type_0 = cls() - - hosting_database_list_response_meta_type_0.additional_properties = d - return hosting_database_list_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/hosting_database_response.py b/src/shellrent_sdk/client/models/hosting_database_response.py index 0d93fd9..ca60463 100644 --- a/src/shellrent_sdk/client/models/hosting_database_response.py +++ b/src/shellrent_sdk/client/models/hosting_database_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.hosting_database import HostingDatabase - from ..models.hosting_database_response_meta_type_0 import HostingDatabaseResponseMetaType0 T = TypeVar("T", bound="HostingDatabaseResponse") @@ -16,15 +15,19 @@ @_attrs_define class HostingDatabaseResponse: - error: int + """Successful response with one `HostingDatabase`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: HostingDatabase - meta: HostingDatabaseResponseMetaType0 | None + """ Database of the hosting, with the account that owns it """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.hosting_database_response_meta_type_0 import HostingDatabaseResponseMetaType0 - error = self.error message: None | str @@ -32,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, HostingDatabaseResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.hosting_database import HostingDatabase - from ..models.hosting_database_response_meta_type_0 import ( - HostingDatabaseResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -70,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = HostingDatabase.from_dict(d.pop("data")) - def _parse_meta(data: object) -> HostingDatabaseResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = HostingDatabaseResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(HostingDatabaseResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") hosting_database_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/hosting_database_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_database_response_meta_type_0.py deleted file mode 100644 index 174a57a..0000000 --- a/src/shellrent_sdk/client/models/hosting_database_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="HostingDatabaseResponseMetaType0") - - -@_attrs_define -class HostingDatabaseResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - hosting_database_response_meta_type_0 = cls() - - hosting_database_response_meta_type_0.additional_properties = d - return hosting_database_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/hosting_dns_record.py b/src/shellrent_sdk/client/models/hosting_dns_record.py index 5888911..49f326f 100644 --- a/src/shellrent_sdk/client/models/hosting_dns_record.py +++ b/src/shellrent_sdk/client/models/hosting_dns_record.py @@ -11,21 +11,39 @@ @_attrs_define class HostingDnsRecord: + """Default DNS record of the hosting, from its web server or its mail server""" + dns_record_id: int type_: str + """ Type of the record, for example `A`, `CNAME`, `MX`, `TXT` or `SRV` """ host: str + """ Name of the record relative to the domain: `@` for the domain itself, otherwise for example `www` or `mail` + """ destination: str + """ Value of the record: the IP address of `A` records, the target host of `CNAME`, `MX` and `SRV` records, the + text of `TXT` records """ priority: int | None + """ Priority of `MX` and `SRV` records """ weight: int | None + """ Weight of `SRV` records """ port: int | None + """ Port of `SRV` records """ service: None | str + """ Service of `SRV` records (for example `_autodiscover`) and port of `TLSA` records """ protocol: None | str + """ Protocol of `SRV` and `TLSA` records: `_tcp`, `_udp` or `_tls` """ caa_flag: int | None + """ Flag of `CAA` records """ caa_tag: None | str + """ Tag of `CAA` records: `issue`, `issuewild`, `iodef-http` or `iodef-mail` """ caa_can_sign_http_exchanges: bool | None - tlsa_usage: None | str - tlsa_selector: None | str - tlsa_matching_type: None | str + """ Whether the `CAA` record allows certificates for signed HTTP exchanges (`cansignhttpexchanges=yes`) """ + tlsa_usage: int | None + """ Certificate usage of `TLSA` records: 0 PKIX-TA, 1 PKIX-EE, 2 DANE-TA, 3 DANE-EE """ + tlsa_selector: int | None + """ Selector of `TLSA` records: 0 for the full certificate, 1 for the public key """ + tlsa_matching_type: int | None + """ Matching type of `TLSA` records: 0 for the exact data, 1 for SHA-256, 2 for SHA-512 """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -61,13 +79,13 @@ def to_dict(self) -> dict[str, Any]: caa_can_sign_http_exchanges: bool | None caa_can_sign_http_exchanges = self.caa_can_sign_http_exchanges - tlsa_usage: None | str + tlsa_usage: int | None tlsa_usage = self.tlsa_usage - tlsa_selector: None | str + tlsa_selector: int | None tlsa_selector = self.tlsa_selector - tlsa_matching_type: None | str + tlsa_matching_type: int | None tlsa_matching_type = self.tlsa_matching_type field_dict: dict[str, Any] = {} @@ -163,24 +181,24 @@ def _parse_caa_can_sign_http_exchanges(data: object) -> bool | None: d.pop("caa_can_sign_http_exchanges") ) - def _parse_tlsa_usage(data: object) -> None | str: + def _parse_tlsa_usage(data: object) -> int | None: if data is None: return data - return cast(None | str, data) + return cast(int | None, data) tlsa_usage = _parse_tlsa_usage(d.pop("tlsa_usage")) - def _parse_tlsa_selector(data: object) -> None | str: + def _parse_tlsa_selector(data: object) -> int | None: if data is None: return data - return cast(None | str, data) + return cast(int | None, data) tlsa_selector = _parse_tlsa_selector(d.pop("tlsa_selector")) - def _parse_tlsa_matching_type(data: object) -> None | str: + def _parse_tlsa_matching_type(data: object) -> int | None: if data is None: return data - return cast(None | str, data) + return cast(int | None, data) tlsa_matching_type = _parse_tlsa_matching_type(d.pop("tlsa_matching_type")) diff --git a/src/shellrent_sdk/client/models/hosting_dns_record_list_response.py b/src/shellrent_sdk/client/models/hosting_dns_record_list_response.py index 2c13b0f..0ce4e6f 100644 --- a/src/shellrent_sdk/client/models/hosting_dns_record_list_response.py +++ b/src/shellrent_sdk/client/models/hosting_dns_record_list_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.hosting_dns_record import HostingDnsRecord - from ..models.hosting_dns_record_list_response_meta_type_0 import ( - HostingDnsRecordListResponseMetaType0, - ) T = TypeVar("T", bound="HostingDnsRecordListResponse") @@ -18,17 +15,19 @@ @_attrs_define class HostingDnsRecordListResponse: - error: int + """Successful response with a list of `HostingDnsRecord`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[HostingDnsRecord] - meta: HostingDnsRecordListResponseMetaType0 | None + """ Items returned by the operation """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.hosting_dns_record_list_response_meta_type_0 import ( - HostingDnsRecordListResponseMetaType0, - ) - error = self.error message: None | str @@ -39,11 +38,7 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - meta: dict[str, Any] | None - if isinstance(self.meta, HostingDnsRecordListResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -61,12 +56,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.hosting_dns_record import HostingDnsRecord - from ..models.hosting_dns_record_list_response_meta_type_0 import ( - HostingDnsRecordListResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -82,20 +76,7 @@ def _parse_message(data: object) -> None | str: data.append(data_item) - def _parse_meta(data: object) -> HostingDnsRecordListResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = HostingDnsRecordListResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(HostingDnsRecordListResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") hosting_dns_record_list_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/hosting_dns_record_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_dns_record_list_response_meta_type_0.py deleted file mode 100644 index 6fb9f7f..0000000 --- a/src/shellrent_sdk/client/models/hosting_dns_record_list_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="HostingDnsRecordListResponseMetaType0") - - -@_attrs_define -class HostingDnsRecordListResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - hosting_dns_record_list_response_meta_type_0 = cls() - - hosting_dns_record_list_response_meta_type_0.additional_properties = d - return hosting_dns_record_list_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/hosting_email_alias.py b/src/shellrent_sdk/client/models/hosting_email_alias.py index 160a183..a9b1a65 100644 --- a/src/shellrent_sdk/client/models/hosting_email_alias.py +++ b/src/shellrent_sdk/client/models/hosting_email_alias.py @@ -11,14 +11,24 @@ @_attrs_define class HostingEmailAlias: + """Email alias of the mail domain of the hosting, with its destinations""" + alias_id: str + """ Id of the alias: its address, as in `address` """ address: str + """ Address of the alias, with the domain in punycode """ address_idna: str + """ Address of the alias, with the domain in Unicode """ goto: None | str + """ Destination addresses, separated by commas """ goto_idna: None | str + """ Destination addresses, separated by commas, with the domains in Unicode """ domain: str + """ Mail domain of the alias, in punycode """ domain_idna: str + """ Mail domain of the alias, in Unicode """ is_active: bool + """ Whether the alias is active """ does_exist: bool additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) diff --git a/src/shellrent_sdk/client/models/hosting_email_alias_create_request.py b/src/shellrent_sdk/client/models/hosting_email_alias_create_request.py index 6dce7a7..8a0cc39 100644 --- a/src/shellrent_sdk/client/models/hosting_email_alias_create_request.py +++ b/src/shellrent_sdk/client/models/hosting_email_alias_create_request.py @@ -4,64 +4,43 @@ from typing import Any, Self, TypeVar, cast from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset T = TypeVar("T", bound="HostingEmailAliasCreateRequest") @_attrs_define class HostingEmailAliasCreateRequest: - alias_name: str | Unset = UNSET + alias_name: str """ Alias local-part without domain. """ - goto: list[str] | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + goto: list[str] + """ Destination addresses of the alias, at least one """ def to_dict(self) -> dict[str, Any]: alias_name = self.alias_name - goto: list[str] | Unset = UNSET - if not isinstance(self.goto, Unset): - goto = self.goto + goto = self.goto field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if alias_name is not UNSET: - field_dict["alias_name"] = alias_name - if goto is not UNSET: - field_dict["goto"] = goto + + field_dict.update( + { + "alias_name": alias_name, + "goto": goto, + } + ) return field_dict @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) - alias_name = d.pop("alias_name", UNSET) + alias_name = d.pop("alias_name") - goto = cast(list[str], d.pop("goto", UNSET)) + goto = cast(list[str], d.pop("goto")) hosting_email_alias_create_request = cls( alias_name=alias_name, goto=goto, ) - hosting_email_alias_create_request.additional_properties = d return hosting_email_alias_create_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/hosting_email_alias_list_response.py b/src/shellrent_sdk/client/models/hosting_email_alias_list_response.py index 66e980d..bcaee76 100644 --- a/src/shellrent_sdk/client/models/hosting_email_alias_list_response.py +++ b/src/shellrent_sdk/client/models/hosting_email_alias_list_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.hosting_email_alias import HostingEmailAlias - from ..models.hosting_email_alias_list_response_meta_type_0 import ( - HostingEmailAliasListResponseMetaType0, - ) T = TypeVar("T", bound="HostingEmailAliasListResponse") @@ -18,17 +15,19 @@ @_attrs_define class HostingEmailAliasListResponse: - error: int + """Successful response with a list of `HostingEmailAlias`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[HostingEmailAlias] - meta: HostingEmailAliasListResponseMetaType0 | None + """ Items returned by the operation """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.hosting_email_alias_list_response_meta_type_0 import ( - HostingEmailAliasListResponseMetaType0, - ) - error = self.error message: None | str @@ -39,11 +38,7 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - meta: dict[str, Any] | None - if isinstance(self.meta, HostingEmailAliasListResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -61,12 +56,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.hosting_email_alias import HostingEmailAlias - from ..models.hosting_email_alias_list_response_meta_type_0 import ( - HostingEmailAliasListResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -82,20 +76,7 @@ def _parse_message(data: object) -> None | str: data.append(data_item) - def _parse_meta(data: object) -> HostingEmailAliasListResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = HostingEmailAliasListResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(HostingEmailAliasListResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") hosting_email_alias_list_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/hosting_email_alias_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_email_alias_list_response_meta_type_0.py deleted file mode 100644 index bccb398..0000000 --- a/src/shellrent_sdk/client/models/hosting_email_alias_list_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="HostingEmailAliasListResponseMetaType0") - - -@_attrs_define -class HostingEmailAliasListResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - hosting_email_alias_list_response_meta_type_0 = cls() - - hosting_email_alias_list_response_meta_type_0.additional_properties = d - return hosting_email_alias_list_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/hosting_email_alias_response.py b/src/shellrent_sdk/client/models/hosting_email_alias_response.py index 672fa4b..0aa9545 100644 --- a/src/shellrent_sdk/client/models/hosting_email_alias_response.py +++ b/src/shellrent_sdk/client/models/hosting_email_alias_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.hosting_email_alias import HostingEmailAlias - from ..models.hosting_email_alias_response_meta_type_0 import HostingEmailAliasResponseMetaType0 T = TypeVar("T", bound="HostingEmailAliasResponse") @@ -16,17 +15,19 @@ @_attrs_define class HostingEmailAliasResponse: - error: int + """Successful response with one `HostingEmailAlias`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: HostingEmailAlias - meta: HostingEmailAliasResponseMetaType0 | None + """ Email alias of the mail domain of the hosting, with its destinations """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.hosting_email_alias_response_meta_type_0 import ( - HostingEmailAliasResponseMetaType0, - ) - error = self.error message: None | str @@ -34,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, HostingEmailAliasResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -56,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.hosting_email_alias import HostingEmailAlias - from ..models.hosting_email_alias_response_meta_type_0 import ( - HostingEmailAliasResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -72,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = HostingEmailAlias.from_dict(d.pop("data")) - def _parse_meta(data: object) -> HostingEmailAliasResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = HostingEmailAliasResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(HostingEmailAliasResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") hosting_email_alias_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/hosting_email_alias_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_email_alias_response_meta_type_0.py deleted file mode 100644 index 5ad8563..0000000 --- a/src/shellrent_sdk/client/models/hosting_email_alias_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="HostingEmailAliasResponseMetaType0") - - -@_attrs_define -class HostingEmailAliasResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - hosting_email_alias_response_meta_type_0 = cls() - - hosting_email_alias_response_meta_type_0.additional_properties = d - return hosting_email_alias_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/hosting_email_allow_list.py b/src/shellrent_sdk/client/models/hosting_email_allow_list.py index ece973c..182ac83 100644 --- a/src/shellrent_sdk/client/models/hosting_email_allow_list.py +++ b/src/shellrent_sdk/client/models/hosting_email_allow_list.py @@ -11,11 +11,17 @@ @_attrs_define class HostingEmailAllowList: + """Sender in the allow list of the antispam of the mail domain of the hosting: a whole domain or an address""" + allow_list_id: int hosting_id: int - sender: str + """ Id of the hosting (`GET /api/v3/hostings/{hosting_id}`) """ + sender: None | str + """ Sender of the entry: the domain or the address """ domain: None | str + """ Sender domain; null when the entry is for an address """ mailbox: None | str + """ Sender address; null when the entry is for a whole domain """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -23,6 +29,7 @@ def to_dict(self) -> dict[str, Any]: hosting_id = self.hosting_id + sender: None | str sender = self.sender domain: None | str @@ -52,7 +59,12 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: hosting_id = d.pop("hosting_id") - sender = d.pop("sender") + def _parse_sender(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + sender = _parse_sender(d.pop("sender")) def _parse_domain(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/hosting_email_allow_list_paginated_list_response.py b/src/shellrent_sdk/client/models/hosting_email_allow_list_paginated_list_response.py index 1a4f320..1affb20 100644 --- a/src/shellrent_sdk/client/models/hosting_email_allow_list_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/hosting_email_allow_list_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class HostingEmailAllowListPaginatedListResponse: - error: int + """Successful response with a page of `HostingEmailAllowList`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[HostingEmailAllowList] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.pagination_meta import PaginationMeta d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/hosting_email_allow_list_response.py b/src/shellrent_sdk/client/models/hosting_email_allow_list_response.py index 86e5e9d..c2d4a10 100644 --- a/src/shellrent_sdk/client/models/hosting_email_allow_list_response.py +++ b/src/shellrent_sdk/client/models/hosting_email_allow_list_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.hosting_email_allow_list import HostingEmailAllowList - from ..models.hosting_email_allow_list_response_meta_type_0 import ( - HostingEmailAllowListResponseMetaType0, - ) T = TypeVar("T", bound="HostingEmailAllowListResponse") @@ -18,17 +15,19 @@ @_attrs_define class HostingEmailAllowListResponse: - error: int + """Successful response with one `HostingEmailAllowList`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: HostingEmailAllowList - meta: HostingEmailAllowListResponseMetaType0 | None + """ Sender in the allow list of the antispam of the mail domain of the hosting: a whole domain or an address """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.hosting_email_allow_list_response_meta_type_0 import ( - HostingEmailAllowListResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, HostingEmailAllowListResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -58,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.hosting_email_allow_list import HostingEmailAllowList - from ..models.hosting_email_allow_list_response_meta_type_0 import ( - HostingEmailAllowListResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -74,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = HostingEmailAllowList.from_dict(d.pop("data")) - def _parse_meta(data: object) -> HostingEmailAllowListResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = HostingEmailAllowListResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(HostingEmailAllowListResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") hosting_email_allow_list_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/hosting_email_allow_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_email_allow_list_response_meta_type_0.py deleted file mode 100644 index 182d18d..0000000 --- a/src/shellrent_sdk/client/models/hosting_email_allow_list_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="HostingEmailAllowListResponseMetaType0") - - -@_attrs_define -class HostingEmailAllowListResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - hosting_email_allow_list_response_meta_type_0 = cls() - - hosting_email_allow_list_response_meta_type_0.additional_properties = d - return hosting_email_allow_list_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/hosting_email_bloc_list_response.py b/src/shellrent_sdk/client/models/hosting_email_bloc_list_response.py deleted file mode 100644 index 220fe82..0000000 --- a/src/shellrent_sdk/client/models/hosting_email_bloc_list_response.py +++ /dev/null @@ -1,116 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.hosting_email_bloc_list import HostingEmailBlocList - from ..models.hosting_email_bloc_list_response_meta_type_0 import ( - HostingEmailBlocListResponseMetaType0, - ) - - -T = TypeVar("T", bound="HostingEmailBlocListResponse") - - -@_attrs_define -class HostingEmailBlocListResponse: - error: int - message: None | str - data: HostingEmailBlocList - meta: HostingEmailBlocListResponseMetaType0 | None - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.hosting_email_bloc_list_response_meta_type_0 import ( - HostingEmailBlocListResponseMetaType0, - ) - - error = self.error - - message: None | str - message = self.message - - data = self.data.to_dict() - - meta: dict[str, Any] | None - if isinstance(self.meta, HostingEmailBlocListResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "error": error, - "message": message, - "data": data, - "meta": meta, - } - ) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.hosting_email_bloc_list import HostingEmailBlocList - from ..models.hosting_email_bloc_list_response_meta_type_0 import ( - HostingEmailBlocListResponseMetaType0, - ) - - d = dict(src_dict) - error = d.pop("error") - - def _parse_message(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - message = _parse_message(d.pop("message")) - - data = HostingEmailBlocList.from_dict(d.pop("data")) - - def _parse_meta(data: object) -> HostingEmailBlocListResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = HostingEmailBlocListResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(HostingEmailBlocListResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) - - hosting_email_bloc_list_response = cls( - error=error, - message=message, - data=data, - meta=meta, - ) - - hosting_email_bloc_list_response.additional_properties = d - return hosting_email_bloc_list_response - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/hosting_email_bloc_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_email_bloc_list_response_meta_type_0.py deleted file mode 100644 index eb39241..0000000 --- a/src/shellrent_sdk/client/models/hosting_email_bloc_list_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="HostingEmailBlocListResponseMetaType0") - - -@_attrs_define -class HostingEmailBlocListResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - hosting_email_bloc_list_response_meta_type_0 = cls() - - hosting_email_bloc_list_response_meta_type_0.additional_properties = d - return hosting_email_bloc_list_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/hosting_email_bloc_list.py b/src/shellrent_sdk/client/models/hosting_email_block_list.py similarity index 73% rename from src/shellrent_sdk/client/models/hosting_email_bloc_list.py rename to src/shellrent_sdk/client/models/hosting_email_block_list.py index b1b312f..f660c41 100644 --- a/src/shellrent_sdk/client/models/hosting_email_bloc_list.py +++ b/src/shellrent_sdk/client/models/hosting_email_block_list.py @@ -6,16 +6,22 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -T = TypeVar("T", bound="HostingEmailBlocList") +T = TypeVar("T", bound="HostingEmailBlockList") @_attrs_define -class HostingEmailBlocList: +class HostingEmailBlockList: + """Sender in the block list of the antispam of the mail domain of the hosting: a whole domain or an address""" + block_list_id: int hosting_id: int - sender: str + """ Id of the hosting (`GET /api/v3/hostings/{hosting_id}`) """ + sender: None | str + """ Sender of the entry: the domain or the address """ domain: None | str + """ Sender domain; null when the entry is for an address """ mailbox: None | str + """ Sender address; null when the entry is for a whole domain """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -23,6 +29,7 @@ def to_dict(self) -> dict[str, Any]: hosting_id = self.hosting_id + sender: None | str sender = self.sender domain: None | str @@ -52,7 +59,12 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: hosting_id = d.pop("hosting_id") - sender = d.pop("sender") + def _parse_sender(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + sender = _parse_sender(d.pop("sender")) def _parse_domain(data: object) -> None | str: if data is None: @@ -68,7 +80,7 @@ def _parse_mailbox(data: object) -> None | str: mailbox = _parse_mailbox(d.pop("mailbox")) - hosting_email_bloc_list = cls( + hosting_email_block_list = cls( block_list_id=block_list_id, hosting_id=hosting_id, sender=sender, @@ -76,8 +88,8 @@ def _parse_mailbox(data: object) -> None | str: mailbox=mailbox, ) - hosting_email_bloc_list.additional_properties = d - return hosting_email_bloc_list + hosting_email_block_list.additional_properties = d + return hosting_email_block_list @property def additional_keys(self) -> list[str]: diff --git a/src/shellrent_sdk/client/models/cpanel_license_paginated_list_response.py b/src/shellrent_sdk/client/models/hosting_email_block_list_paginated_list_response.py similarity index 66% rename from src/shellrent_sdk/client/models/cpanel_license_paginated_list_response.py rename to src/shellrent_sdk/client/models/hosting_email_block_list_paginated_list_response.py index a9ff21c..0e3b692 100644 --- a/src/shellrent_sdk/client/models/cpanel_license_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/hosting_email_block_list_paginated_list_response.py @@ -1,25 +1,31 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: - from ..models.cpanel_license import CpanelLicense + from ..models.hosting_email_block_list import HostingEmailBlockList from ..models.pagination_meta import PaginationMeta -T = TypeVar("T", bound="CpanelLicensePaginatedListResponse") +T = TypeVar("T", bound="HostingEmailBlockListPaginatedListResponse") @_attrs_define -class CpanelLicensePaginatedListResponse: - error: int +class HostingEmailBlockListPaginatedListResponse: + """Successful response with a page of `HostingEmailBlockList`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str - data: list[CpanelLicense] + """ Always null in a successful response """ + data: list[HostingEmailBlockList] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -50,11 +56,13 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.cpanel_license import CpanelLicense + from ..models.hosting_email_block_list import HostingEmailBlockList from ..models.pagination_meta import PaginationMeta d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -66,21 +74,21 @@ def _parse_message(data: object) -> None | str: data = [] _data = d.pop("data") for data_item_data in _data: - data_item = CpanelLicense.from_dict(data_item_data) + data_item = HostingEmailBlockList.from_dict(data_item_data) data.append(data_item) meta = PaginationMeta.from_dict(d.pop("meta")) - cpanel_license_paginated_list_response = cls( + hosting_email_block_list_paginated_list_response = cls( error=error, message=message, data=data, meta=meta, ) - cpanel_license_paginated_list_response.additional_properties = d - return cpanel_license_paginated_list_response + hosting_email_block_list_paginated_list_response.additional_properties = d + return hosting_email_block_list_paginated_list_response @property def additional_keys(self) -> list[str]: diff --git a/src/shellrent_sdk/client/models/hosting_email_bloc_list_paginated_list_response.py b/src/shellrent_sdk/client/models/hosting_email_block_list_response.py similarity index 58% rename from src/shellrent_sdk/client/models/hosting_email_bloc_list_paginated_list_response.py rename to src/shellrent_sdk/client/models/hosting_email_block_list_response.py index 79af455..dc481aa 100644 --- a/src/shellrent_sdk/client/models/hosting_email_bloc_list_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/hosting_email_block_list_response.py @@ -1,25 +1,30 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: - from ..models.hosting_email_bloc_list import HostingEmailBlocList - from ..models.pagination_meta import PaginationMeta + from ..models.hosting_email_block_list import HostingEmailBlockList -T = TypeVar("T", bound="HostingEmailBlocListPaginatedListResponse") +T = TypeVar("T", bound="HostingEmailBlockListResponse") @_attrs_define -class HostingEmailBlocListPaginatedListResponse: - error: int +class HostingEmailBlockListResponse: + """Successful response with one `HostingEmailBlockList`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str - data: list[HostingEmailBlocList] - meta: PaginationMeta + """ Always null in a successful response """ + data: HostingEmailBlockList + """ Sender in the block list of the antispam of the mail domain of the hosting: a whole domain or an address """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -28,12 +33,9 @@ def to_dict(self) -> dict[str, Any]: message: None | str message = self.message - data = [] - for data_item_data in self.data: - data_item = data_item_data.to_dict() - data.append(data_item) + data = self.data.to_dict() - meta = self.meta.to_dict() + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -50,11 +52,12 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.hosting_email_bloc_list import HostingEmailBlocList - from ..models.pagination_meta import PaginationMeta + from ..models.hosting_email_block_list import HostingEmailBlockList d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -63,24 +66,19 @@ def _parse_message(data: object) -> None | str: message = _parse_message(d.pop("message")) - data = [] - _data = d.pop("data") - for data_item_data in _data: - data_item = HostingEmailBlocList.from_dict(data_item_data) - - data.append(data_item) + data = HostingEmailBlockList.from_dict(d.pop("data")) - meta = PaginationMeta.from_dict(d.pop("meta")) + meta = d.pop("meta") - hosting_email_bloc_list_paginated_list_response = cls( + hosting_email_block_list_response = cls( error=error, message=message, data=data, meta=meta, ) - hosting_email_bloc_list_paginated_list_response.additional_properties = d - return hosting_email_bloc_list_paginated_list_response + hosting_email_block_list_response.additional_properties = d + return hosting_email_block_list_response @property def additional_keys(self) -> list[str]: diff --git a/src/shellrent_sdk/client/models/hosting_email_catch_all.py b/src/shellrent_sdk/client/models/hosting_email_catch_all.py index 2d1f1bb..39d7fe3 100644 --- a/src/shellrent_sdk/client/models/hosting_email_catch_all.py +++ b/src/shellrent_sdk/client/models/hosting_email_catch_all.py @@ -11,10 +11,17 @@ @_attrs_define class HostingEmailCatchAll: + """Catch-all of the mail domain of the hosting""" + is_active: bool + """ Whether the catch-all is set: mail sent to addresses of the domain that do not exist goes to `destinations` + """ address: str + """ Address of the catch-all: `@` and the mail domain, in punycode """ address_idna: str + """ Address of the catch-all, with the domain in Unicode """ destinations: list[str] + """ Destination addresses of the catch-all, with the domains in Unicode; empty when it is not set """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/hosting_email_catch_all_request.py b/src/shellrent_sdk/client/models/hosting_email_catch_all_request.py index b2c753b..f42eedf 100644 --- a/src/shellrent_sdk/client/models/hosting_email_catch_all_request.py +++ b/src/shellrent_sdk/client/models/hosting_email_catch_all_request.py @@ -4,55 +4,35 @@ from typing import Any, Self, TypeVar, cast from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset T = TypeVar("T", bound="HostingEmailCatchAllRequest") @_attrs_define class HostingEmailCatchAllRequest: - goto: list[str] | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + goto: list[str] + """ Destination addresses of the catch-all, at least one: they replace the current ones """ def to_dict(self) -> dict[str, Any]: - goto: list[str] | Unset = UNSET - if not isinstance(self.goto, Unset): - goto = self.goto + goto = self.goto field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if goto is not UNSET: - field_dict["goto"] = goto + + field_dict.update( + { + "goto": goto, + } + ) return field_dict @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) - goto = cast(list[str], d.pop("goto", UNSET)) + goto = cast(list[str], d.pop("goto")) hosting_email_catch_all_request = cls( goto=goto, ) - hosting_email_catch_all_request.additional_properties = d return hosting_email_catch_all_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/hosting_email_catch_all_response.py b/src/shellrent_sdk/client/models/hosting_email_catch_all_response.py index 42158d7..7769601 100644 --- a/src/shellrent_sdk/client/models/hosting_email_catch_all_response.py +++ b/src/shellrent_sdk/client/models/hosting_email_catch_all_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.hosting_email_catch_all import HostingEmailCatchAll - from ..models.hosting_email_catch_all_response_meta_type_0 import ( - HostingEmailCatchAllResponseMetaType0, - ) T = TypeVar("T", bound="HostingEmailCatchAllResponse") @@ -18,17 +15,19 @@ @_attrs_define class HostingEmailCatchAllResponse: - error: int + """Successful response with one `HostingEmailCatchAll`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: HostingEmailCatchAll - meta: HostingEmailCatchAllResponseMetaType0 | None + """ Catch-all of the mail domain of the hosting """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.hosting_email_catch_all_response_meta_type_0 import ( - HostingEmailCatchAllResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, HostingEmailCatchAllResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -58,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.hosting_email_catch_all import HostingEmailCatchAll - from ..models.hosting_email_catch_all_response_meta_type_0 import ( - HostingEmailCatchAllResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -74,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = HostingEmailCatchAll.from_dict(d.pop("data")) - def _parse_meta(data: object) -> HostingEmailCatchAllResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = HostingEmailCatchAllResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(HostingEmailCatchAllResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") hosting_email_catch_all_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/hosting_email_catch_all_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_email_catch_all_response_meta_type_0.py deleted file mode 100644 index 88d4d51..0000000 --- a/src/shellrent_sdk/client/models/hosting_email_catch_all_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="HostingEmailCatchAllResponseMetaType0") - - -@_attrs_define -class HostingEmailCatchAllResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - hosting_email_catch_all_response_meta_type_0 = cls() - - hosting_email_catch_all_response_meta_type_0.additional_properties = d - return hosting_email_catch_all_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/hosting_email_wblist_request.py b/src/shellrent_sdk/client/models/hosting_email_wblist_request.py index c5ba644..c6b3510 100644 --- a/src/shellrent_sdk/client/models/hosting_email_wblist_request.py +++ b/src/shellrent_sdk/client/models/hosting_email_wblist_request.py @@ -4,7 +4,6 @@ from typing import Any, Self, TypeVar, cast from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -13,9 +12,12 @@ @_attrs_define class HostingEmailWblistRequest: + """Sender to add to the allow list or the block list of the antispam: a whole domain or an address""" + domain: None | str | Unset = UNSET + """ Sender domain; send either `domain` or `mailbox` """ mailbox: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + """ Sender address; send either `domain` or `mailbox` """ def to_dict(self) -> dict[str, Any]: domain: None | str | Unset @@ -31,7 +33,7 @@ def to_dict(self) -> dict[str, Any]: mailbox = self.mailbox field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if domain is not UNSET: field_dict["domain"] = domain @@ -67,21 +69,4 @@ def _parse_mailbox(data: object) -> None | str | Unset: mailbox=mailbox, ) - hosting_email_wblist_request.additional_properties = d return hosting_email_wblist_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/hosting_file_protection_update_request.py b/src/shellrent_sdk/client/models/hosting_file_protection_update_request.py index c673bf2..c8a9b37 100644 --- a/src/shellrent_sdk/client/models/hosting_file_protection_update_request.py +++ b/src/shellrent_sdk/client/models/hosting_file_protection_update_request.py @@ -4,53 +4,35 @@ from typing import Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset T = TypeVar("T", bound="HostingFileProtectionUpdateRequest") @_attrs_define class HostingFileProtectionUpdateRequest: - enable: bool | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + enable: bool + """ Whether to enable (true) or disable (false) the file protection """ def to_dict(self) -> dict[str, Any]: enable = self.enable field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if enable is not UNSET: - field_dict["enable"] = enable + + field_dict.update( + { + "enable": enable, + } + ) return field_dict @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) - enable = d.pop("enable", UNSET) + enable = d.pop("enable") hosting_file_protection_update_request = cls( enable=enable, ) - hosting_file_protection_update_request.additional_properties = d return hosting_file_protection_update_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/hosting_http_version_update_request.py b/src/shellrent_sdk/client/models/hosting_http_version_update_request.py index 59a9993..7a5dad9 100644 --- a/src/shellrent_sdk/client/models/hosting_http_version_update_request.py +++ b/src/shellrent_sdk/client/models/hosting_http_version_update_request.py @@ -4,54 +4,39 @@ from typing import Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field -from ..types import UNSET, Unset +from ..models.hosting_http_version_update_request_version import ( + HostingHttpVersionUpdateRequestVersion, +) T = TypeVar("T", bound="HostingHttpVersionUpdateRequest") @_attrs_define class HostingHttpVersionUpdateRequest: - version: str | Unset = UNSET - """ HTTP version identifier. """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + version: HostingHttpVersionUpdateRequestVersion + """ HTTP version: 1 for HTTP/1.1, 2 for HTTP/2 """ def to_dict(self) -> dict[str, Any]: - version = self.version + version = self.version.value field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if version is not UNSET: - field_dict["version"] = version + + field_dict.update( + { + "version": version, + } + ) return field_dict @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) - version = d.pop("version", UNSET) + version = HostingHttpVersionUpdateRequestVersion(d.pop("version")) hosting_http_version_update_request = cls( version=version, ) - hosting_http_version_update_request.additional_properties = d return hosting_http_version_update_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/hosting_http_version_update_request_version.py b/src/shellrent_sdk/client/models/hosting_http_version_update_request_version.py new file mode 100644 index 0000000..7b921cc --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_http_version_update_request_version.py @@ -0,0 +1,9 @@ +from enum import StrEnum + + +class HostingHttpVersionUpdateRequestVersion(StrEnum): + VALUE_0 = "1" + VALUE_1 = "2" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/shellrent_sdk/client/models/hosting_mod_security.py b/src/shellrent_sdk/client/models/hosting_mod_security.py index fccdc79..b31f401 100644 --- a/src/shellrent_sdk/client/models/hosting_mod_security.py +++ b/src/shellrent_sdk/client/models/hosting_mod_security.py @@ -11,13 +11,27 @@ @_attrs_define class HostingModSecurity: + """Status of ModSecurity, the web application firewall, on the hosting""" + hosting_id: int + """ Id of the hosting (`GET /api/v3/hostings/{hosting_id}`) """ is_available: bool + """ Whether ModSecurity can be managed: only on Linux hostings, and not while the purchase is suspended or in + maintenance """ is_active: bool + """ Whether ModSecurity is enabled (`PATCH /api/v3/hostings/{hosting_id}/modsecurity`) """ firewall_compatible: bool + """ Whether the rules of ModSecurity can be managed on the web server of the hosting: false on dedicated web + servers and when ModSecurity is not available """ full_strict: bool | None + """ Whether ModSecurity filters all the traffic, with no disabled rule; null when `firewall_compatible` is false + """ custom_rules: list[str] | None + """ Numbers of the rules disabled on the hosting, as read from the web server; null when the hosting has no + custom configuration """ custom_set: list[str] | None + """ Rule sets of the custom configuration of the hosting, as read from the web server; null when the hosting has + no custom configuration """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/hosting_mod_security_response.py b/src/shellrent_sdk/client/models/hosting_mod_security_response.py index 6591eb3..64972d2 100644 --- a/src/shellrent_sdk/client/models/hosting_mod_security_response.py +++ b/src/shellrent_sdk/client/models/hosting_mod_security_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.hosting_mod_security import HostingModSecurity - from ..models.hosting_mod_security_response_meta_type_0 import ( - HostingModSecurityResponseMetaType0, - ) T = TypeVar("T", bound="HostingModSecurityResponse") @@ -18,17 +15,19 @@ @_attrs_define class HostingModSecurityResponse: - error: int + """Successful response with one `HostingModSecurity`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: HostingModSecurity - meta: HostingModSecurityResponseMetaType0 | None + """ Status of ModSecurity, the web application firewall, on the hosting """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.hosting_mod_security_response_meta_type_0 import ( - HostingModSecurityResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, HostingModSecurityResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -58,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.hosting_mod_security import HostingModSecurity - from ..models.hosting_mod_security_response_meta_type_0 import ( - HostingModSecurityResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -74,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = HostingModSecurity.from_dict(d.pop("data")) - def _parse_meta(data: object) -> HostingModSecurityResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = HostingModSecurityResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(HostingModSecurityResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") hosting_mod_security_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/hosting_mod_security_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_mod_security_response_meta_type_0.py deleted file mode 100644 index ac2cb5d..0000000 --- a/src/shellrent_sdk/client/models/hosting_mod_security_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="HostingModSecurityResponseMetaType0") - - -@_attrs_define -class HostingModSecurityResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - hosting_mod_security_response_meta_type_0 = cls() - - hosting_mod_security_response_meta_type_0.additional_properties = d - return hosting_mod_security_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/hosting_mod_security_rule.py b/src/shellrent_sdk/client/models/hosting_mod_security_rule.py index 433c83f..4c0e764 100644 --- a/src/shellrent_sdk/client/models/hosting_mod_security_rule.py +++ b/src/shellrent_sdk/client/models/hosting_mod_security_rule.py @@ -11,11 +11,17 @@ @_attrs_define class HostingModSecurityRule: + """ModSecurity rule of the hosting, found by a scan or added by hand, and whether it is disabled""" + rule_id: int hosting_id: int + """ Id of the hosting (`GET /api/v3/hostings/{hosting_id}`) """ rule_number: str + """ Number of the rule in ModSecurity """ description: None | str + """ Message of the rule found by the scan, or the description given when it was added """ included: bool + """ Whether the rule is disabled on the hosting: it is in the list of rules that ModSecurity does not apply """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/hosting_mod_security_rule_bulk_request.py b/src/shellrent_sdk/client/models/hosting_mod_security_rule_bulk_request.py index e8a2046..ade9957 100644 --- a/src/shellrent_sdk/client/models/hosting_mod_security_rule_bulk_request.py +++ b/src/shellrent_sdk/client/models/hosting_mod_security_rule_bulk_request.py @@ -4,55 +4,37 @@ from typing import Any, Self, TypeVar, cast from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset T = TypeVar("T", bound="HostingModSecurityRuleBulkRequest") @_attrs_define class HostingModSecurityRuleBulkRequest: - rule_ids: list[int] | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + """Rules of the hosting to disable""" + + rule_ids: list[int] + """ Ids of the rules (`rule_id`) to add to the disabled rules of the hosting """ def to_dict(self) -> dict[str, Any]: - rule_ids: list[int] | Unset = UNSET - if not isinstance(self.rule_ids, Unset): - rule_ids = self.rule_ids + rule_ids = self.rule_ids field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if rule_ids is not UNSET: - field_dict["rule_ids"] = rule_ids + + field_dict.update( + { + "rule_ids": rule_ids, + } + ) return field_dict @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) - rule_ids = cast(list[int], d.pop("rule_ids", UNSET)) + rule_ids = cast(list[int], d.pop("rule_ids")) hosting_mod_security_rule_bulk_request = cls( rule_ids=rule_ids, ) - hosting_mod_security_rule_bulk_request.additional_properties = d return hosting_mod_security_rule_bulk_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/hosting_mod_security_rule_create_request.py b/src/shellrent_sdk/client/models/hosting_mod_security_rule_create_request.py index e4aede7..724053d 100644 --- a/src/shellrent_sdk/client/models/hosting_mod_security_rule_create_request.py +++ b/src/shellrent_sdk/client/models/hosting_mod_security_rule_create_request.py @@ -1,10 +1,9 @@ from __future__ import annotations from collections.abc import Mapping -from typing import Any, Self, TypeVar, cast +from typing import Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -13,24 +12,25 @@ @_attrs_define class HostingModSecurityRuleCreateRequest: - rule_number: int | Unset = UNSET - description: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + """ModSecurity rule to disable on the hosting""" + + rule_number: int + """ Number of the ModSecurity rule to disable on the hosting """ + description: str | Unset = UNSET + """ Description of the rule; used only when the hosting does not have the rule yet """ def to_dict(self) -> dict[str, Any]: rule_number = self.rule_number - description: None | str | Unset - if isinstance(self.description, Unset): - description = UNSET - else: - description = self.description + description = self.description field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if rule_number is not UNSET: - field_dict["rule_number"] = rule_number + + field_dict.update( + { + "rule_number": rule_number, + } + ) if description is not UNSET: field_dict["description"] = description @@ -39,37 +39,13 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) - rule_number = d.pop("rule_number", UNSET) + rule_number = d.pop("rule_number") - def _parse_description(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - description = _parse_description(d.pop("description", UNSET)) + description = d.pop("description", UNSET) hosting_mod_security_rule_create_request = cls( rule_number=rule_number, description=description, ) - hosting_mod_security_rule_create_request.additional_properties = d return hosting_mod_security_rule_create_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/hosting_mod_security_rule_list_response.py b/src/shellrent_sdk/client/models/hosting_mod_security_rule_list_response.py index d7774fd..6825f8c 100644 --- a/src/shellrent_sdk/client/models/hosting_mod_security_rule_list_response.py +++ b/src/shellrent_sdk/client/models/hosting_mod_security_rule_list_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.hosting_mod_security_rule import HostingModSecurityRule - from ..models.hosting_mod_security_rule_list_response_meta_type_0 import ( - HostingModSecurityRuleListResponseMetaType0, - ) T = TypeVar("T", bound="HostingModSecurityRuleListResponse") @@ -18,17 +15,19 @@ @_attrs_define class HostingModSecurityRuleListResponse: - error: int + """Successful response with a list of `HostingModSecurityRule`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[HostingModSecurityRule] - meta: HostingModSecurityRuleListResponseMetaType0 | None + """ Items returned by the operation """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.hosting_mod_security_rule_list_response_meta_type_0 import ( - HostingModSecurityRuleListResponseMetaType0, - ) - error = self.error message: None | str @@ -39,11 +38,7 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - meta: dict[str, Any] | None - if isinstance(self.meta, HostingModSecurityRuleListResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -61,12 +56,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.hosting_mod_security_rule import HostingModSecurityRule - from ..models.hosting_mod_security_rule_list_response_meta_type_0 import ( - HostingModSecurityRuleListResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -82,20 +76,7 @@ def _parse_message(data: object) -> None | str: data.append(data_item) - def _parse_meta(data: object) -> HostingModSecurityRuleListResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = HostingModSecurityRuleListResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(HostingModSecurityRuleListResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") hosting_mod_security_rule_list_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/hosting_mod_security_rule_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_mod_security_rule_list_response_meta_type_0.py deleted file mode 100644 index 9d5ba0e..0000000 --- a/src/shellrent_sdk/client/models/hosting_mod_security_rule_list_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="HostingModSecurityRuleListResponseMetaType0") - - -@_attrs_define -class HostingModSecurityRuleListResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - hosting_mod_security_rule_list_response_meta_type_0 = cls() - - hosting_mod_security_rule_list_response_meta_type_0.additional_properties = d - return hosting_mod_security_rule_list_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/hosting_mod_security_rule_response.py b/src/shellrent_sdk/client/models/hosting_mod_security_rule_response.py index 694891e..ef36c71 100644 --- a/src/shellrent_sdk/client/models/hosting_mod_security_rule_response.py +++ b/src/shellrent_sdk/client/models/hosting_mod_security_rule_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.hosting_mod_security_rule import HostingModSecurityRule - from ..models.hosting_mod_security_rule_response_meta_type_0 import ( - HostingModSecurityRuleResponseMetaType0, - ) T = TypeVar("T", bound="HostingModSecurityRuleResponse") @@ -18,17 +15,19 @@ @_attrs_define class HostingModSecurityRuleResponse: - error: int + """Successful response with one `HostingModSecurityRule`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: HostingModSecurityRule - meta: HostingModSecurityRuleResponseMetaType0 | None + """ ModSecurity rule of the hosting, found by a scan or added by hand, and whether it is disabled """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.hosting_mod_security_rule_response_meta_type_0 import ( - HostingModSecurityRuleResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, HostingModSecurityRuleResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -58,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.hosting_mod_security_rule import HostingModSecurityRule - from ..models.hosting_mod_security_rule_response_meta_type_0 import ( - HostingModSecurityRuleResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -74,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = HostingModSecurityRule.from_dict(d.pop("data")) - def _parse_meta(data: object) -> HostingModSecurityRuleResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = HostingModSecurityRuleResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(HostingModSecurityRuleResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") hosting_mod_security_rule_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/hosting_mod_security_rule_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_mod_security_rule_response_meta_type_0.py deleted file mode 100644 index af914ba..0000000 --- a/src/shellrent_sdk/client/models/hosting_mod_security_rule_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="HostingModSecurityRuleResponseMetaType0") - - -@_attrs_define -class HostingModSecurityRuleResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - hosting_mod_security_rule_response_meta_type_0 = cls() - - hosting_mod_security_rule_response_meta_type_0.additional_properties = d - return hosting_mod_security_rule_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/hosting_mod_security_scan.py b/src/shellrent_sdk/client/models/hosting_mod_security_scan.py index 74d6198..9b53f84 100644 --- a/src/shellrent_sdk/client/models/hosting_mod_security_scan.py +++ b/src/shellrent_sdk/client/models/hosting_mod_security_scan.py @@ -12,17 +12,25 @@ @_attrs_define class HostingModSecurityScan: + """Scan of the ModSecurity rules that generated errors or blocks on the hosting""" + scan_id: int - hosting_id: int + hosting_id: int | None + """ Id of the hosting (`GET /api/v3/hostings/{hosting_id}`) """ date_created: datetime.datetime error: None | str + """ Error of the scan; null when it succeeded """ rules_found: int + """ Number of rules found by the scan: those that generated errors or blocks on the day of the scan """ rules_excluded: int + """ Number of rules found by the scan that are disabled on the hosting now (`included` true in `GET + /api/v3/hostings/{hosting_id}/modsecurity/rules`) """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: scan_id = self.scan_id + hosting_id: int | None hosting_id = self.hosting_id date_created = self.date_created.isoformat() @@ -54,7 +62,12 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) scan_id = d.pop("scan_id") - hosting_id = d.pop("hosting_id") + def _parse_hosting_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + hosting_id = _parse_hosting_id(d.pop("hosting_id")) date_created = datetime.datetime.fromisoformat(d.pop("date_created")) diff --git a/src/shellrent_sdk/client/models/hosting_mod_security_scan_paginated_list_response.py b/src/shellrent_sdk/client/models/hosting_mod_security_scan_paginated_list_response.py index 31d0840..395b758 100644 --- a/src/shellrent_sdk/client/models/hosting_mod_security_scan_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/hosting_mod_security_scan_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class HostingModSecurityScanPaginatedListResponse: - error: int + """Successful response with a page of `HostingModSecurityScan`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[HostingModSecurityScan] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.pagination_meta import PaginationMeta d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/hosting_mod_security_scan_response.py b/src/shellrent_sdk/client/models/hosting_mod_security_scan_response.py index 832771c..638acea 100644 --- a/src/shellrent_sdk/client/models/hosting_mod_security_scan_response.py +++ b/src/shellrent_sdk/client/models/hosting_mod_security_scan_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.hosting_mod_security_scan import HostingModSecurityScan - from ..models.hosting_mod_security_scan_response_meta_type_0 import ( - HostingModSecurityScanResponseMetaType0, - ) T = TypeVar("T", bound="HostingModSecurityScanResponse") @@ -18,17 +15,19 @@ @_attrs_define class HostingModSecurityScanResponse: - error: int + """Successful response with one `HostingModSecurityScan`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: HostingModSecurityScan - meta: HostingModSecurityScanResponseMetaType0 | None + """ Scan of the ModSecurity rules that generated errors or blocks on the hosting """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.hosting_mod_security_scan_response_meta_type_0 import ( - HostingModSecurityScanResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, HostingModSecurityScanResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -58,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.hosting_mod_security_scan import HostingModSecurityScan - from ..models.hosting_mod_security_scan_response_meta_type_0 import ( - HostingModSecurityScanResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -74,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = HostingModSecurityScan.from_dict(d.pop("data")) - def _parse_meta(data: object) -> HostingModSecurityScanResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = HostingModSecurityScanResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(HostingModSecurityScanResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") hosting_mod_security_scan_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/hosting_mod_security_scan_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_mod_security_scan_response_meta_type_0.py deleted file mode 100644 index 06edfa6..0000000 --- a/src/shellrent_sdk/client/models/hosting_mod_security_scan_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="HostingModSecurityScanResponseMetaType0") - - -@_attrs_define -class HostingModSecurityScanResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - hosting_mod_security_scan_response_meta_type_0 = cls() - - hosting_mod_security_scan_response_meta_type_0.additional_properties = d - return hosting_mod_security_scan_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/hosting_mod_security_update_request.py b/src/shellrent_sdk/client/models/hosting_mod_security_update_request.py index 4e7fb6d..8df602e 100644 --- a/src/shellrent_sdk/client/models/hosting_mod_security_update_request.py +++ b/src/shellrent_sdk/client/models/hosting_mod_security_update_request.py @@ -4,53 +4,35 @@ from typing import Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset T = TypeVar("T", bound="HostingModSecurityUpdateRequest") @_attrs_define class HostingModSecurityUpdateRequest: - enable: bool | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + enable: bool + """ Whether to enable (true) or disable (false) ModSecurity """ def to_dict(self) -> dict[str, Any]: enable = self.enable field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if enable is not UNSET: - field_dict["enable"] = enable + + field_dict.update( + { + "enable": enable, + } + ) return field_dict @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) - enable = d.pop("enable", UNSET) + enable = d.pop("enable") hosting_mod_security_update_request = cls( enable=enable, ) - hosting_mod_security_update_request.additional_properties = d return hosting_mod_security_update_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/hosting_paginated_list_response.py b/src/shellrent_sdk/client/models/hosting_paginated_list_response.py index 3c84af8..1dd266e 100644 --- a/src/shellrent_sdk/client/models/hosting_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/hosting_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class HostingPaginatedListResponse: - error: int + """Successful response with a page of `Hosting`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[Hosting] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.pagination_meta import PaginationMeta d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/securemail_quantity_request.py b/src/shellrent_sdk/client/models/hosting_php_setting.py similarity index 59% rename from src/shellrent_sdk/client/models/securemail_quantity_request.py rename to src/shellrent_sdk/client/models/hosting_php_setting.py index bd01023..e413b5d 100644 --- a/src/shellrent_sdk/client/models/securemail_quantity_request.py +++ b/src/shellrent_sdk/client/models/hosting_php_setting.py @@ -6,23 +6,32 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -T = TypeVar("T", bound="SecuremailQuantityRequest") +from ..models.hosting_php_setting_setting import HostingPhpSettingSetting + +T = TypeVar("T", bound="HostingPhpSetting") @_attrs_define -class SecuremailQuantityRequest: - quantity: int - """ Final number of protected mailboxes for the SecureMail subscription """ +class HostingPhpSetting: + """PHP directive changed on the hosting, with its value""" + + setting: HostingPhpSettingSetting + """ PHP directive, as in `PATCH /api/v3/hostings/{hosting_id}/php-settings` """ + value: str + """ Value set on the hosting """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - quantity = self.quantity + setting = self.setting.value + + value = self.value field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( { - "quantity": quantity, + "setting": setting, + "value": value, } ) @@ -31,14 +40,17 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) - quantity = d.pop("quantity") + setting = HostingPhpSettingSetting(d.pop("setting")) + + value = d.pop("value") - securemail_quantity_request = cls( - quantity=quantity, + hosting_php_setting = cls( + setting=setting, + value=value, ) - securemail_quantity_request.additional_properties = d - return securemail_quantity_request + hosting_php_setting.additional_properties = d + return hosting_php_setting @property def additional_keys(self) -> list[str]: diff --git a/src/shellrent_sdk/client/models/hosting_php_setting_setting.py b/src/shellrent_sdk/client/models/hosting_php_setting_setting.py new file mode 100644 index 0000000..335cb24 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_php_setting_setting.py @@ -0,0 +1,14 @@ +from enum import StrEnum + + +class HostingPhpSettingSetting(StrEnum): + DISPLAY_ERRORS = "display_errors" + MAX_EXECUTION_TIME = "max_execution_time" + MAX_INPUT_TIME = "max_input_time" + MEMORY_LIMIT = "memory_limit" + OPCACHE_ENABLE = "opcache.enable" + POST_MAX_SIZE = "post_max_size" + UPLOAD_MAX_FILESIZE = "upload_max_filesize" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/shellrent_sdk/client/models/hosting_php_settings_update_request.py b/src/shellrent_sdk/client/models/hosting_php_settings_update_request.py index 065163e..525e107 100644 --- a/src/shellrent_sdk/client/models/hosting_php_settings_update_request.py +++ b/src/shellrent_sdk/client/models/hosting_php_settings_update_request.py @@ -4,63 +4,51 @@ from typing import Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field -from ..types import UNSET, Unset +from ..models.hosting_php_settings_update_request_setting import ( + HostingPhpSettingsUpdateRequestSetting, +) T = TypeVar("T", bound="HostingPhpSettingsUpdateRequest") @_attrs_define class HostingPhpSettingsUpdateRequest: - setting: str | Unset = UNSET - """ PHP setting key. """ - value: str | Unset = UNSET - """ PHP setting value. """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + setting: HostingPhpSettingsUpdateRequestSetting + """ PHP directive to change """ + value: str + """ New value of the directive. Suggested values: opcache.enable 1 or 0; display_errors On or Off; memory_limit + from 64M to 512M (64M, 96M, 128M, 160M, 192M, 224M, 256M, 288M, 320M, 384M, 448M, 512M); post_max_size and + upload_max_filesize from 1M to 512M (1M, 2M, 4M, 8M, 16M, 24M, 32M, 40M, 48M, 64M, 80M, 96M, 112M, 128M, 160M, + 192M, 224M, 256M, 512M); max_execution_time and max_input_time in seconds, from 10 to 600. Other values are + accepted if they are numbers, optionally followed by M, between the smallest and the largest suggested value """ def to_dict(self) -> dict[str, Any]: - setting = self.setting + setting = self.setting.value value = self.value field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if setting is not UNSET: - field_dict["setting"] = setting - if value is not UNSET: - field_dict["value"] = value + + field_dict.update( + { + "setting": setting, + "value": value, + } + ) return field_dict @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) - setting = d.pop("setting", UNSET) + setting = HostingPhpSettingsUpdateRequestSetting(d.pop("setting")) - value = d.pop("value", UNSET) + value = d.pop("value") hosting_php_settings_update_request = cls( setting=setting, value=value, ) - hosting_php_settings_update_request.additional_properties = d return hosting_php_settings_update_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/hosting_php_settings_update_request_setting.py b/src/shellrent_sdk/client/models/hosting_php_settings_update_request_setting.py new file mode 100644 index 0000000..6018220 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_php_settings_update_request_setting.py @@ -0,0 +1,14 @@ +from enum import StrEnum + + +class HostingPhpSettingsUpdateRequestSetting(StrEnum): + DISPLAY_ERRORS = "display_errors" + MAX_EXECUTION_TIME = "max_execution_time" + MAX_INPUT_TIME = "max_input_time" + MEMORY_LIMIT = "memory_limit" + OPCACHE_ENABLE = "opcache.enable" + POST_MAX_SIZE = "post_max_size" + UPLOAD_MAX_FILESIZE = "upload_max_filesize" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/shellrent_sdk/client/models/hosting_php_version.py b/src/shellrent_sdk/client/models/hosting_php_version.py index c257bda..7de34ef 100644 --- a/src/shellrent_sdk/client/models/hosting_php_version.py +++ b/src/shellrent_sdk/client/models/hosting_php_version.py @@ -11,9 +11,14 @@ @_attrs_define class HostingPhpVersion: + """PHP version available for the hosting""" + version: str + """ PHP version, for example `8.3`: send it to `PATCH /api/v3/hostings/{hosting_id}/php-version` """ is_current: bool + """ Whether the hosting uses this version """ is_default: bool + """ Whether it is the default version of the web server """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/hosting_php_version_list_response.py b/src/shellrent_sdk/client/models/hosting_php_version_list_response.py index 9b3dd7a..cd35f1e 100644 --- a/src/shellrent_sdk/client/models/hosting_php_version_list_response.py +++ b/src/shellrent_sdk/client/models/hosting_php_version_list_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.hosting_php_version import HostingPhpVersion - from ..models.hosting_php_version_list_response_meta_type_0 import ( - HostingPhpVersionListResponseMetaType0, - ) T = TypeVar("T", bound="HostingPhpVersionListResponse") @@ -18,17 +15,19 @@ @_attrs_define class HostingPhpVersionListResponse: - error: int + """Successful response with a list of `HostingPhpVersion`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[HostingPhpVersion] - meta: HostingPhpVersionListResponseMetaType0 | None + """ Items returned by the operation """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.hosting_php_version_list_response_meta_type_0 import ( - HostingPhpVersionListResponseMetaType0, - ) - error = self.error message: None | str @@ -39,11 +38,7 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - meta: dict[str, Any] | None - if isinstance(self.meta, HostingPhpVersionListResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -61,12 +56,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.hosting_php_version import HostingPhpVersion - from ..models.hosting_php_version_list_response_meta_type_0 import ( - HostingPhpVersionListResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -82,20 +76,7 @@ def _parse_message(data: object) -> None | str: data.append(data_item) - def _parse_meta(data: object) -> HostingPhpVersionListResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = HostingPhpVersionListResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(HostingPhpVersionListResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") hosting_php_version_list_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/hosting_php_version_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_php_version_list_response_meta_type_0.py deleted file mode 100644 index bc69cf2..0000000 --- a/src/shellrent_sdk/client/models/hosting_php_version_list_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="HostingPhpVersionListResponseMetaType0") - - -@_attrs_define -class HostingPhpVersionListResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - hosting_php_version_list_response_meta_type_0 = cls() - - hosting_php_version_list_response_meta_type_0.additional_properties = d - return hosting_php_version_list_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/hosting_php_version_update_request.py b/src/shellrent_sdk/client/models/hosting_php_version_update_request.py index 772159b..88ac5d5 100644 --- a/src/shellrent_sdk/client/models/hosting_php_version_update_request.py +++ b/src/shellrent_sdk/client/models/hosting_php_version_update_request.py @@ -4,54 +4,35 @@ from typing import Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset T = TypeVar("T", bound="HostingPhpVersionUpdateRequest") @_attrs_define class HostingPhpVersionUpdateRequest: - version: str | Unset = UNSET - """ PHP version identifier. """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + version: str + """ PHP version, one of those returned by `GET /api/v3/hostings/{hosting_id}/php-versions` (e.g. `8.3`) """ def to_dict(self) -> dict[str, Any]: version = self.version field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if version is not UNSET: - field_dict["version"] = version + + field_dict.update( + { + "version": version, + } + ) return field_dict @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) - version = d.pop("version", UNSET) + version = d.pop("version") hosting_php_version_update_request = cls( version=version, ) - hosting_php_version_update_request.additional_properties = d return hosting_php_version_update_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/hosting_response.py b/src/shellrent_sdk/client/models/hosting_response.py index 82e3370..bc14d1b 100644 --- a/src/shellrent_sdk/client/models/hosting_response.py +++ b/src/shellrent_sdk/client/models/hosting_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.hosting import Hosting - from ..models.hosting_response_meta_type_0 import HostingResponseMetaType0 T = TypeVar("T", bound="HostingResponse") @@ -16,15 +15,19 @@ @_attrs_define class HostingResponse: - error: int + """Successful response with one `Hosting`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: Hosting - meta: HostingResponseMetaType0 | None + """ Hosting of the account: a main hosting, bought with a purchase, or one of its subdomains """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.hosting_response_meta_type_0 import HostingResponseMetaType0 - error = self.error message: None | str @@ -32,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, HostingResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,10 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.hosting import Hosting - from ..models.hosting_response_meta_type_0 import HostingResponseMetaType0 d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -68,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = Hosting.from_dict(d.pop("data")) - def _parse_meta(data: object) -> HostingResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = HostingResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(HostingResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") hosting_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/hosting_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_response_meta_type_0.py deleted file mode 100644 index 60725de..0000000 --- a/src/shellrent_sdk/client/models/hosting_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="HostingResponseMetaType0") - - -@_attrs_define -class HostingResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - hosting_response_meta_type_0 = cls() - - hosting_response_meta_type_0.additional_properties = d - return hosting_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/hosting_ssl_certificate.py b/src/shellrent_sdk/client/models/hosting_ssl_certificate.py index 6f832ec..b47b0af 100644 --- a/src/shellrent_sdk/client/models/hosting_ssl_certificate.py +++ b/src/shellrent_sdk/client/models/hosting_ssl_certificate.py @@ -12,15 +12,27 @@ @_attrs_define class HostingSslCertificate: + """SSL certificate installed on the website or on the mail of the hosting""" + hosting_ssl_certificate_id: int hosting_id: int + """ Id of the hosting (`GET /api/v3/hostings/{hosting_id}`) """ ssl_certificate_id: int | None + """ Id of the purchased SSL certificate (`GET /api/v3/ssl-certificates/{ssl_certificate_id}`); null for the + other certificates """ lets_encrypt_id: int | None + """ Id of the Let's Encrypt certificate; null for the other certificates """ external_certificate_id: int | None + """ Id of the external certificate, whose keys were uploaded by the customer; null for the other certificates + """ cn_type: None | str + """ Type of the certificate: `NORMAL`, or `WILDCARD` for a wildcard certificate """ installation_date: datetime.datetime | None + """ When the certificate was installed; null until the installation completes """ https_rewrite: bool | None + """ Whether the visits over HTTP are redirected to HTTPS (301) """ destination_type: None | str + """ Where the certificate is installed: `web` for the website, `mail` for the mail servers """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/hosting_ssl_certificate_install_request.py b/src/shellrent_sdk/client/models/hosting_ssl_certificate_install_request.py index f61e88f..76deb66 100644 --- a/src/shellrent_sdk/client/models/hosting_ssl_certificate_install_request.py +++ b/src/shellrent_sdk/client/models/hosting_ssl_certificate_install_request.py @@ -4,8 +4,13 @@ from typing import Any, Self, TypeVar, cast from attrs import define as _attrs_define -from attrs import field as _attrs_field +from ..models.hosting_ssl_certificate_install_request_cn_type import ( + HostingSslCertificateInstallRequestCnType, +) +from ..models.hosting_ssl_certificate_install_request_destination_type import ( + HostingSslCertificateInstallRequestDestinationType, +) from ..types import UNSET, Unset T = TypeVar("T", bound="HostingSslCertificateInstallRequest") @@ -13,10 +18,21 @@ @_attrs_define class HostingSslCertificateInstallRequest: + """SSL certificate to install on the hosting; with no body, a Let's Encrypt certificate for the website""" + ssl_certificate_id: int | None | Unset = UNSET - destination_type: str | Unset = "web" - cn_type: str | Unset = "NORMAL" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + """ Id of a purchased SSL certificate to install (`GET /api/v3/ssl-certificates/{ssl_certificate_id}`); omit it, + or send null, to install a Let's Encrypt certificate, issued if the hosting has none """ + destination_type: HostingSslCertificateInstallRequestDestinationType | Unset = ( + HostingSslCertificateInstallRequestDestinationType.WEB + ) + """ Where to install the certificate: `web` for the website, `mail` for the mail servers, `all` for both. `mail` + and `all` require `cn_type` `WILDCARD`; on a subdomain only `web` is allowed """ + cn_type: HostingSslCertificateInstallRequestCnType | Unset = ( + HostingSslCertificateInstallRequestCnType.NORMAL + ) + """ Type of the certificate: `NORMAL`, or `WILDCARD` for a wildcard certificate. Without `ssl_certificate_id` it + chooses the Let's Encrypt certificate to install """ def to_dict(self) -> dict[str, Any]: ssl_certificate_id: int | None | Unset @@ -25,12 +41,16 @@ def to_dict(self) -> dict[str, Any]: else: ssl_certificate_id = self.ssl_certificate_id - destination_type = self.destination_type + destination_type: str | Unset = UNSET + if not isinstance(self.destination_type, Unset): + destination_type = self.destination_type.value - cn_type = self.cn_type + cn_type: str | Unset = UNSET + if not isinstance(self.cn_type, Unset): + cn_type = self.cn_type.value field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if ssl_certificate_id is not UNSET: field_dict["ssl_certificate_id"] = ssl_certificate_id @@ -54,9 +74,19 @@ def _parse_ssl_certificate_id(data: object) -> int | None | Unset: ssl_certificate_id = _parse_ssl_certificate_id(d.pop("ssl_certificate_id", UNSET)) - destination_type = d.pop("destination_type", UNSET) + _destination_type = d.pop("destination_type", UNSET) + destination_type: HostingSslCertificateInstallRequestDestinationType | Unset + if isinstance(_destination_type, Unset): + destination_type = UNSET + else: + destination_type = HostingSslCertificateInstallRequestDestinationType(_destination_type) - cn_type = d.pop("cn_type", UNSET) + _cn_type = d.pop("cn_type", UNSET) + cn_type: HostingSslCertificateInstallRequestCnType | Unset + if isinstance(_cn_type, Unset): + cn_type = UNSET + else: + cn_type = HostingSslCertificateInstallRequestCnType(_cn_type) hosting_ssl_certificate_install_request = cls( ssl_certificate_id=ssl_certificate_id, @@ -64,21 +94,4 @@ def _parse_ssl_certificate_id(data: object) -> int | None | Unset: cn_type=cn_type, ) - hosting_ssl_certificate_install_request.additional_properties = d return hosting_ssl_certificate_install_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/hosting_ssl_certificate_install_request_cn_type.py b/src/shellrent_sdk/client/models/hosting_ssl_certificate_install_request_cn_type.py new file mode 100644 index 0000000..4093ccb --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_ssl_certificate_install_request_cn_type.py @@ -0,0 +1,9 @@ +from enum import StrEnum + + +class HostingSslCertificateInstallRequestCnType(StrEnum): + NORMAL = "NORMAL" + WILDCARD = "WILDCARD" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/shellrent_sdk/client/models/hosting_ssl_certificate_install_request_destination_type.py b/src/shellrent_sdk/client/models/hosting_ssl_certificate_install_request_destination_type.py new file mode 100644 index 0000000..2559ecb --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_ssl_certificate_install_request_destination_type.py @@ -0,0 +1,10 @@ +from enum import StrEnum + + +class HostingSslCertificateInstallRequestDestinationType(StrEnum): + ALL = "all" + MAIL = "mail" + WEB = "web" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/shellrent_sdk/client/models/hosting_ssl_certificate_list_response.py b/src/shellrent_sdk/client/models/hosting_ssl_certificate_list_response.py index 9e163e5..3ad8bea 100644 --- a/src/shellrent_sdk/client/models/hosting_ssl_certificate_list_response.py +++ b/src/shellrent_sdk/client/models/hosting_ssl_certificate_list_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.hosting_ssl_certificate import HostingSslCertificate - from ..models.hosting_ssl_certificate_list_response_meta_type_0 import ( - HostingSslCertificateListResponseMetaType0, - ) T = TypeVar("T", bound="HostingSslCertificateListResponse") @@ -18,17 +15,19 @@ @_attrs_define class HostingSslCertificateListResponse: - error: int + """Successful response with a list of `HostingSslCertificate`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[HostingSslCertificate] - meta: HostingSslCertificateListResponseMetaType0 | None + """ Items returned by the operation """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.hosting_ssl_certificate_list_response_meta_type_0 import ( - HostingSslCertificateListResponseMetaType0, - ) - error = self.error message: None | str @@ -39,11 +38,7 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - meta: dict[str, Any] | None - if isinstance(self.meta, HostingSslCertificateListResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -61,12 +56,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.hosting_ssl_certificate import HostingSslCertificate - from ..models.hosting_ssl_certificate_list_response_meta_type_0 import ( - HostingSslCertificateListResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -82,20 +76,7 @@ def _parse_message(data: object) -> None | str: data.append(data_item) - def _parse_meta(data: object) -> HostingSslCertificateListResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = HostingSslCertificateListResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(HostingSslCertificateListResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") hosting_ssl_certificate_list_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/hosting_ssl_certificate_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_ssl_certificate_list_response_meta_type_0.py deleted file mode 100644 index d945c47..0000000 --- a/src/shellrent_sdk/client/models/hosting_ssl_certificate_list_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="HostingSslCertificateListResponseMetaType0") - - -@_attrs_define -class HostingSslCertificateListResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - hosting_ssl_certificate_list_response_meta_type_0 = cls() - - hosting_ssl_certificate_list_response_meta_type_0.additional_properties = d - return hosting_ssl_certificate_list_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/hosting_ssl_certificate_response.py b/src/shellrent_sdk/client/models/hosting_ssl_certificate_response.py index 65c41e9..4cde09a 100644 --- a/src/shellrent_sdk/client/models/hosting_ssl_certificate_response.py +++ b/src/shellrent_sdk/client/models/hosting_ssl_certificate_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.hosting_ssl_certificate import HostingSslCertificate - from ..models.hosting_ssl_certificate_response_meta_type_0 import ( - HostingSslCertificateResponseMetaType0, - ) T = TypeVar("T", bound="HostingSslCertificateResponse") @@ -18,17 +15,19 @@ @_attrs_define class HostingSslCertificateResponse: - error: int + """Successful response with one `HostingSslCertificate`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: HostingSslCertificate - meta: HostingSslCertificateResponseMetaType0 | None + """ SSL certificate installed on the website or on the mail of the hosting """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.hosting_ssl_certificate_response_meta_type_0 import ( - HostingSslCertificateResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, HostingSslCertificateResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -58,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.hosting_ssl_certificate import HostingSslCertificate - from ..models.hosting_ssl_certificate_response_meta_type_0 import ( - HostingSslCertificateResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -74,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = HostingSslCertificate.from_dict(d.pop("data")) - def _parse_meta(data: object) -> HostingSslCertificateResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = HostingSslCertificateResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(HostingSslCertificateResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") hosting_ssl_certificate_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/hosting_ssl_certificate_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_ssl_certificate_response_meta_type_0.py deleted file mode 100644 index 10712e0..0000000 --- a/src/shellrent_sdk/client/models/hosting_ssl_certificate_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="HostingSslCertificateResponseMetaType0") - - -@_attrs_define -class HostingSslCertificateResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - hosting_ssl_certificate_response_meta_type_0 = cls() - - hosting_ssl_certificate_response_meta_type_0.additional_properties = d - return hosting_ssl_certificate_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/hosting_subdomain_create_request.py b/src/shellrent_sdk/client/models/hosting_subdomain_create_request.py index b409856..cd7ac29 100644 --- a/src/shellrent_sdk/client/models/hosting_subdomain_create_request.py +++ b/src/shellrent_sdk/client/models/hosting_subdomain_create_request.py @@ -4,9 +4,6 @@ from typing import Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset T = TypeVar("T", bound="HostingSubdomainCreateRequest") @@ -15,24 +12,17 @@ class HostingSubdomainCreateRequest: level_name: str """ Third-level subdomain name (without the main domain). """ - subdomain: str | Unset = UNSET - """ Alias of level_name. """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: level_name = self.level_name - subdomain = self.subdomain - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "level_name": level_name, } ) - if subdomain is not UNSET: - field_dict["subdomain"] = subdomain return field_dict @@ -41,28 +31,8 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) level_name = d.pop("level_name") - subdomain = d.pop("subdomain", UNSET) - hosting_subdomain_create_request = cls( level_name=level_name, - subdomain=subdomain, ) - hosting_subdomain_create_request.additional_properties = d return hosting_subdomain_create_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/invoice.py b/src/shellrent_sdk/client/models/invoice.py index e056b7e..a14bd7c 100644 --- a/src/shellrent_sdk/client/models/invoice.py +++ b/src/shellrent_sdk/client/models/invoice.py @@ -19,24 +19,49 @@ @_attrs_define class Invoice: + """Invoice of the account, with its totals and electronic invoicing data""" + invoice_id: int billing: AccountBilling + """ Billing profile: the holder the documents are made out to, with its tax and electronic invoicing data """ type_: None | str + """ Type of the invoice: `NORMAL`, `DEPOSIT` (top-up of the prepaid credit) or `BALANCE` (paid with the prepaid + credit: some rows deduct the deposit invoices) """ sdi_document_status: None | SdiDocumentStatus + """ Status of the invoice on SDI, the Italian e-invoicing exchange system; null for the invoices not sent + through SDI, issued before electronic invoicing """ sdi_document_type: None | SdiDocumentType + """ Type of the electronic document on SDI; `TD01` (invoice) when the invoice has none """ date_emitted: datetime.date - invoice_year: int + """ Date of issue of the invoice """ + invoice_year: int | None + """ Year of the numbering of the invoice """ invoice_number: str + """ Complete number of the invoice: the year followed by the number on 6 digits, for example `2025000123` """ invoice_caption: None | str + """ Legal note of the tax regime printed on the invoice, in Italian, such as the law under which VAT is not + applied; null when the regime has none """ invoice_caption_additional: None | str + """ Additional reason (`Causale`) of the electronic invoice; null when there is none """ payed: bool + """ Whether the invoice is paid """ sdi_identifier: None | str + """ Identifier assigned by SDI to the invoice; null when it has not been sent to SDI """ sdi_filename: None | str + """ Name of the file sent to SDI; null when not sent, and for most invoices issued before November 2024 """ total_amount: Amount + """ Amount in euros: the taxable amount and, when computed with a tax regime, the VAT rate, the VAT and the + total, which are null otherwise """ amount_no_balance: Amount + """ Amount in euros: the taxable amount and, when computed with a tax regime, the VAT rate, the VAT and the + total, which are null otherwise """ payment_amount: Amount + """ Amount in euros: the taxable amount and, when computed with a tax regime, the VAT rate, the VAT and the + total, which are null otherwise """ orders: list[int] + """ Ids of the orders of the invoice (`GET /api/v3/orders/{order_id}`) """ rows_count: int + """ Number of rows of the invoice (`GET /api/v3/invoices/{invoice_id}/rows`) """ date_created: datetime.datetime additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -65,6 +90,7 @@ def to_dict(self) -> dict[str, Any]: date_emitted = self.date_emitted.isoformat() + invoice_year: int | None invoice_year = self.invoice_year invoice_number = self.invoice_number @@ -174,7 +200,12 @@ def _parse_sdi_document_type(data: object) -> None | SdiDocumentType: date_emitted = datetime.date.fromisoformat(d.pop("date_emitted")) - invoice_year = d.pop("invoice_year") + def _parse_invoice_year(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + invoice_year = _parse_invoice_year(d.pop("invoice_year")) invoice_number = d.pop("invoice_number") diff --git a/src/shellrent_sdk/client/models/invoice_paginated_list_response.py b/src/shellrent_sdk/client/models/invoice_paginated_list_response.py index 0a27b47..90ff385 100644 --- a/src/shellrent_sdk/client/models/invoice_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/invoice_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class InvoicePaginatedListResponse: - error: int + """Successful response with a page of `Invoice`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[Invoice] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.pagination_meta import PaginationMeta d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/invoice_response.py b/src/shellrent_sdk/client/models/invoice_response.py index 4bcdecd..aa9a2e8 100644 --- a/src/shellrent_sdk/client/models/invoice_response.py +++ b/src/shellrent_sdk/client/models/invoice_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.invoice import Invoice - from ..models.invoice_response_meta_type_0 import InvoiceResponseMetaType0 T = TypeVar("T", bound="InvoiceResponse") @@ -16,15 +15,19 @@ @_attrs_define class InvoiceResponse: - error: int + """Successful response with one `Invoice`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: Invoice - meta: InvoiceResponseMetaType0 | None + """ Invoice of the account, with its totals and electronic invoicing data """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.invoice_response_meta_type_0 import InvoiceResponseMetaType0 - error = self.error message: None | str @@ -32,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, InvoiceResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,10 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.invoice import Invoice - from ..models.invoice_response_meta_type_0 import InvoiceResponseMetaType0 d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -68,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = Invoice.from_dict(d.pop("data")) - def _parse_meta(data: object) -> InvoiceResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = InvoiceResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(InvoiceResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") invoice_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/invoice_response_meta_type_0.py b/src/shellrent_sdk/client/models/invoice_response_meta_type_0.py deleted file mode 100644 index f98649c..0000000 --- a/src/shellrent_sdk/client/models/invoice_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="InvoiceResponseMetaType0") - - -@_attrs_define -class InvoiceResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - invoice_response_meta_type_0 = cls() - - invoice_response_meta_type_0.additional_properties = d - return invoice_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/invoice_row.py b/src/shellrent_sdk/client/models/invoice_row.py index cd20f15..44df1d2 100644 --- a/src/shellrent_sdk/client/models/invoice_row.py +++ b/src/shellrent_sdk/client/models/invoice_row.py @@ -19,20 +19,38 @@ @_attrs_define class InvoiceRow: + """Row of an invoice""" + invoice_row_id: int invoice_id: int + """ Id of the invoice (`GET /api/v3/invoices/{invoice_id}`) """ invoice_id_deposit: int | None + """ Id of the deposit invoice that the row deducts, in a balance invoice (`GET /api/v3/invoices/{invoice_id}`); + null for the other rows """ service: None | Service + """ Service of the row; null when the row is not for a service """ purchase: None | Purchase + """ Purchase of the row; null when the row is not for a purchase """ description: str unit_description: None | str + """ Unit of `unit_quantity`: `h` (hours) or `m` (minutes); null when the row is not priced by unit """ unit_quantity: float | None + """ Quantity, in the unit of `unit_description`; null when the row is not priced by unit """ unit_amount: Amount + """ Amount in euros: the taxable amount and, when computed with a tax regime, the VAT rate, the VAT and the + total, which are null otherwise """ amount: Amount + """ Amount in euros: the taxable amount and, when computed with a tax regime, the VAT rate, the VAT and the + total, which are null otherwise """ billing_data: BillingData + """ Italian public administration codes of a document row: CIG, CUP and ODA """ is_recurring: bool + """ Whether the row is for a recurring charge, such as a service renewed periodically, and not a one-time one + """ date_start: datetime.date | None + """ Start of the period the row refers to; null when the row has no period """ date_end: datetime.date | None + """ End of the period the row refers to; null when the row has no period """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/invoice_row_list_response.py b/src/shellrent_sdk/client/models/invoice_row_list_response.py index 5d22799..fb5d597 100644 --- a/src/shellrent_sdk/client/models/invoice_row_list_response.py +++ b/src/shellrent_sdk/client/models/invoice_row_list_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.invoice_row import InvoiceRow - from ..models.invoice_row_list_response_meta_type_0 import InvoiceRowListResponseMetaType0 T = TypeVar("T", bound="InvoiceRowListResponse") @@ -16,15 +15,19 @@ @_attrs_define class InvoiceRowListResponse: - error: int + """Successful response with a list of `InvoiceRow`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[InvoiceRow] - meta: InvoiceRowListResponseMetaType0 | None + """ Items returned by the operation """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.invoice_row_list_response_meta_type_0 import InvoiceRowListResponseMetaType0 - error = self.error message: None | str @@ -35,11 +38,7 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - meta: dict[str, Any] | None - if isinstance(self.meta, InvoiceRowListResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -57,12 +56,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.invoice_row import InvoiceRow - from ..models.invoice_row_list_response_meta_type_0 import ( - InvoiceRowListResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -78,20 +76,7 @@ def _parse_message(data: object) -> None | str: data.append(data_item) - def _parse_meta(data: object) -> InvoiceRowListResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = InvoiceRowListResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(InvoiceRowListResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") invoice_row_list_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/invoice_row_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/invoice_row_list_response_meta_type_0.py deleted file mode 100644 index 183e92d..0000000 --- a/src/shellrent_sdk/client/models/invoice_row_list_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="InvoiceRowListResponseMetaType0") - - -@_attrs_define -class InvoiceRowListResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - invoice_row_list_response_meta_type_0 = cls() - - invoice_row_list_response_meta_type_0.additional_properties = d - return invoice_row_list_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/invoice_row_response.py b/src/shellrent_sdk/client/models/invoice_row_response.py index d284822..03904d6 100644 --- a/src/shellrent_sdk/client/models/invoice_row_response.py +++ b/src/shellrent_sdk/client/models/invoice_row_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.invoice_row import InvoiceRow - from ..models.invoice_row_response_meta_type_0 import InvoiceRowResponseMetaType0 T = TypeVar("T", bound="InvoiceRowResponse") @@ -16,15 +15,19 @@ @_attrs_define class InvoiceRowResponse: - error: int + """Successful response with one `InvoiceRow`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: InvoiceRow - meta: InvoiceRowResponseMetaType0 | None + """ Row of an invoice """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.invoice_row_response_meta_type_0 import InvoiceRowResponseMetaType0 - error = self.error message: None | str @@ -32,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, InvoiceRowResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.invoice_row import InvoiceRow - from ..models.invoice_row_response_meta_type_0 import ( - InvoiceRowResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -70,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = InvoiceRow.from_dict(d.pop("data")) - def _parse_meta(data: object) -> InvoiceRowResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = InvoiceRowResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(InvoiceRowResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") invoice_row_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/invoice_row_response_meta_type_0.py b/src/shellrent_sdk/client/models/invoice_row_response_meta_type_0.py deleted file mode 100644 index 6435f93..0000000 --- a/src/shellrent_sdk/client/models/invoice_row_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="InvoiceRowResponseMetaType0") - - -@_attrs_define -class InvoiceRowResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - invoice_row_response_meta_type_0 = cls() - - invoice_row_response_meta_type_0.additional_properties = d - return invoice_row_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/ip_address.py b/src/shellrent_sdk/client/models/ip_address.py index 408553f..39a34e8 100644 --- a/src/shellrent_sdk/client/models/ip_address.py +++ b/src/shellrent_sdk/client/models/ip_address.py @@ -12,15 +12,28 @@ @_attrs_define class IpAddress: + """IP address of a server, with its reverse DNS and its state""" + ip_address_id: int server_id: int | None + """ Id of the server the IP address is assigned to (`GET /api/v3/servers/{server_id}`); null for the free IP + addresses of a private cloud (`GET /api/v3/servers/{server_id}/private-cloud/available-ip-addresses`) """ ip_address: str reverse_dns: None | str + """ Reverse DNS set on the IP address, changed with `PATCH /api/v3/servers/{server_id}/ip- + addresses/{ip_address_id}/rdns`; null when it is not set """ reverse_dns_external: None | str + """ Reverse DNS of the IP address as last read from its supplier; null when the supplier has none """ mac_address: None | str + """ MAC address associated with the IP address, such as the virtual MAC of the supplier or the one of its + network interface; null when there is none """ blocked_for_spam: bool + """ Whether the supplier blocked the IP address for spam """ active: bool + """ Whether the IP address is active: false once it has been revoked or cancelled at the supplier """ available: bool + """ Whether the IP address can be used: an address that is not available, such as the gateway of its block, + cannot be assigned to a network interface or to a virtual machine """ date_created: datetime.datetime | None additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) diff --git a/src/shellrent_sdk/client/models/ip_address_list_response.py b/src/shellrent_sdk/client/models/ip_address_list_response.py index edbe5d3..2332955 100644 --- a/src/shellrent_sdk/client/models/ip_address_list_response.py +++ b/src/shellrent_sdk/client/models/ip_address_list_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.ip_address import IpAddress - from ..models.ip_address_list_response_meta_type_0 import IpAddressListResponseMetaType0 T = TypeVar("T", bound="IpAddressListResponse") @@ -16,15 +15,19 @@ @_attrs_define class IpAddressListResponse: - error: int + """Successful response with a list of `IpAddress`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[IpAddress] - meta: IpAddressListResponseMetaType0 | None + """ Items returned by the operation """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.ip_address_list_response_meta_type_0 import IpAddressListResponseMetaType0 - error = self.error message: None | str @@ -35,11 +38,7 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - meta: dict[str, Any] | None - if isinstance(self.meta, IpAddressListResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -57,12 +56,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.ip_address import IpAddress - from ..models.ip_address_list_response_meta_type_0 import ( - IpAddressListResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -78,20 +76,7 @@ def _parse_message(data: object) -> None | str: data.append(data_item) - def _parse_meta(data: object) -> IpAddressListResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = IpAddressListResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(IpAddressListResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") ip_address_list_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/ip_address_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/ip_address_list_response_meta_type_0.py deleted file mode 100644 index 9753de9..0000000 --- a/src/shellrent_sdk/client/models/ip_address_list_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="IpAddressListResponseMetaType0") - - -@_attrs_define -class IpAddressListResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - ip_address_list_response_meta_type_0 = cls() - - ip_address_list_response_meta_type_0.additional_properties = d - return ip_address_list_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/securemail_paginated_list_response.py b/src/shellrent_sdk/client/models/ip_address_paginated_list_response.py similarity index 69% rename from src/shellrent_sdk/client/models/securemail_paginated_list_response.py rename to src/shellrent_sdk/client/models/ip_address_paginated_list_response.py index b0f7a8e..172a2d2 100644 --- a/src/shellrent_sdk/client/models/securemail_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/ip_address_paginated_list_response.py @@ -1,25 +1,31 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: + from ..models.ip_address import IpAddress from ..models.pagination_meta import PaginationMeta - from ..models.securemail import Securemail -T = TypeVar("T", bound="SecuremailPaginatedListResponse") +T = TypeVar("T", bound="IpAddressPaginatedListResponse") @_attrs_define -class SecuremailPaginatedListResponse: - error: int +class IpAddressPaginatedListResponse: + """Successful response with a page of `IpAddress`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str - data: list[Securemail] + """ Always null in a successful response """ + data: list[IpAddress] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -50,11 +56,13 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.ip_address import IpAddress from ..models.pagination_meta import PaginationMeta - from ..models.securemail import Securemail d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -66,21 +74,21 @@ def _parse_message(data: object) -> None | str: data = [] _data = d.pop("data") for data_item_data in _data: - data_item = Securemail.from_dict(data_item_data) + data_item = IpAddress.from_dict(data_item_data) data.append(data_item) meta = PaginationMeta.from_dict(d.pop("meta")) - securemail_paginated_list_response = cls( + ip_address_paginated_list_response = cls( error=error, message=message, data=data, meta=meta, ) - securemail_paginated_list_response.additional_properties = d - return securemail_paginated_list_response + ip_address_paginated_list_response.additional_properties = d + return ip_address_paginated_list_response @property def additional_keys(self) -> list[str]: diff --git a/src/shellrent_sdk/client/models/ip_address_response.py b/src/shellrent_sdk/client/models/ip_address_response.py index e271de4..6375bf6 100644 --- a/src/shellrent_sdk/client/models/ip_address_response.py +++ b/src/shellrent_sdk/client/models/ip_address_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.ip_address import IpAddress - from ..models.ip_address_response_meta_type_0 import IpAddressResponseMetaType0 T = TypeVar("T", bound="IpAddressResponse") @@ -16,15 +15,19 @@ @_attrs_define class IpAddressResponse: - error: int + """Successful response with one `IpAddress`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: IpAddress - meta: IpAddressResponseMetaType0 | None + """ IP address of a server, with its reverse DNS and its state """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.ip_address_response_meta_type_0 import IpAddressResponseMetaType0 - error = self.error message: None | str @@ -32,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, IpAddressResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.ip_address import IpAddress - from ..models.ip_address_response_meta_type_0 import ( - IpAddressResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -70,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = IpAddress.from_dict(d.pop("data")) - def _parse_meta(data: object) -> IpAddressResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = IpAddressResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(IpAddressResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") ip_address_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/ip_address_response_meta_type_0.py b/src/shellrent_sdk/client/models/ip_address_response_meta_type_0.py deleted file mode 100644 index 7e3386a..0000000 --- a/src/shellrent_sdk/client/models/ip_address_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="IpAddressResponseMetaType0") - - -@_attrs_define -class IpAddressResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - ip_address_response_meta_type_0 = cls() - - ip_address_response_meta_type_0.additional_properties = d - return ip_address_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/jwk_key.py b/src/shellrent_sdk/client/models/jwk_key.py index 77574b9..541cac5 100644 --- a/src/shellrent_sdk/client/models/jwk_key.py +++ b/src/shellrent_sdk/client/models/jwk_key.py @@ -13,15 +13,23 @@ @_attrs_define class JwkKey: + """Public key that verifies the signature of the access tokens (JSON Web Key, RFC 7517)""" + kid: str + """ Id of the key: the `kid` in the header of the tokens it signs """ kty: str + """ Key type: `RSA` """ alg: str + """ Signature algorithm: `RS256` """ use: str + """ Use of the key: `sig`, signature """ n: str - """ Modulo base64url """ + """ RSA modulus, base64url-encoded """ e: str - """ Esponente base64url """ + """ RSA public exponent, base64url-encoded """ status: None | str | Unset = UNSET + """ `active`: signs the new tokens; `trusted`: no longer signs, but verifies the tokens already issued; + `retired`: verifies the tokens already issued until they expire, then leaves the set """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/jwks_response.py b/src/shellrent_sdk/client/models/jwks_response.py index 88db55a..0336278 100644 --- a/src/shellrent_sdk/client/models/jwks_response.py +++ b/src/shellrent_sdk/client/models/jwks_response.py @@ -15,7 +15,10 @@ @_attrs_define class JwksResponse: + """Public keys of the API (JSON Web Key Set)""" + keys: list[JwkKey] + """ Keys that verify the tokens, each with its status """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/legal_entity.py b/src/shellrent_sdk/client/models/legal_entity.py index aa712dc..f00b803 100644 --- a/src/shellrent_sdk/client/models/legal_entity.py +++ b/src/shellrent_sdk/client/models/legal_entity.py @@ -16,10 +16,18 @@ @_attrs_define class LegalEntity: + """Legal form of the holder of a billing profile, with its group""" + legal_entity_group: LegalEntityGroup + """ Group of legal forms, such as private individuals or Italian companies """ tax_regime: TaxRegime + """ Tax regime: how VAT applies to the documents """ entity_code: str + """ Code of the legal form: `ITA_PVT`, `NOITA_PVT`, `ITA_INDIVIDUALE`, `ITA_CAPITALI`, `ITA_PERSONE`, + `ITA_ASSNOCOMM`, `ITA_ASSCOMM`, `ITA_ALTRO`, `ITA_PA`, `EU_ALTRO`, `NOEU_ALTRO`, `VATICAN_NOPVT`, + `SANMARINO_NOPVT` or `FORBIDDEN_NOITA_NOPVT` """ entity_name: str + """ Name of the legal form, in Italian """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/legal_entity_group.py b/src/shellrent_sdk/client/models/legal_entity_group.py index 3c56e5a..f25cc35 100644 --- a/src/shellrent_sdk/client/models/legal_entity_group.py +++ b/src/shellrent_sdk/client/models/legal_entity_group.py @@ -11,8 +11,13 @@ @_attrs_define class LegalEntityGroup: + """Group of legal forms, such as private individuals or Italian companies""" + group_code: str + """ Code of the group, currently `PRIVATE`, `ITALIAN_INDIVIDUAL_COMPANY`, `ITALIAN_LIMITED_COMPANY`, + `ITALIAN_COOPERATIVE_COMPANY`, `ITALIAN_PUBLIC_ADMINISTRATION`, `FOREIGN_COMPANY` or `OTHER` """ group_name: str + """ Name of the group, in Italian """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/cpanel_license.py b/src/shellrent_sdk/client/models/license_.py similarity index 82% rename from src/shellrent_sdk/client/models/cpanel_license.py rename to src/shellrent_sdk/client/models/license_.py index 538795a..6c235f2 100644 --- a/src/shellrent_sdk/client/models/cpanel_license.py +++ b/src/shellrent_sdk/client/models/license_.py @@ -7,24 +7,39 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -T = TypeVar("T", bound="CpanelLicense") +T = TypeVar("T", bound="License") @_attrs_define -class CpanelLicense: +class License: + """cPanel or Plesk license of the account, with the server or the IP address where it is installed""" + license_id: int purchase_id: int + """ Id of the purchase of the license (`GET /api/v3/purchases/{purchase_id}`) """ purchase_server_id: int | None + """ Id of the purchase of the server where the license is installed (`GET /api/v3/purchases/{purchase_id}`); + null for a license on an external host (`ip_address`) or without a server """ service_name: None | str + """ Name of the service of the purchase, in Italian """ purchase_name: None | str - license_ref: None | str + """ Object name of the purchase, as `purchase_name.object_name` of the purchase """ key_number: None | str + """ Key number of a Plesk license; null for cPanel licenses """ ip_address: None | str + """ IP address of the external host where the license is installed, instead of a server (`purchase_server_id`) + """ is_els: bool + """ Whether the server runs an obsolete operating system, covered by the Extended Lifecycle Support (ELS) of the + supplier and charged as an additional fee """ operative_system: None | str + """ Operating system of the server, as reported by the license supplier; null until reported """ purchase_status_code: None | str + """ Status code of the purchase (`status_code` of `PurchaseStatus`): `NEW_V2`, `ACTIVE_V2` or `DELIVERED_V2` """ date_activation: datetime.date | None + """ Activation date of the purchase (`date_activation` of the purchase) """ date_expiry: datetime.date | None + """ Expiry date of the purchase (`date_expiry` of the purchase) """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -41,9 +56,6 @@ def to_dict(self) -> dict[str, Any]: purchase_name: None | str purchase_name = self.purchase_name - license_ref: None | str - license_ref = self.license_ref - key_number: None | str key_number = self.key_number @@ -79,7 +91,6 @@ def to_dict(self) -> dict[str, Any]: "purchase_server_id": purchase_server_id, "service_name": service_name, "purchase_name": purchase_name, - "license_ref": license_ref, "key_number": key_number, "ip_address": ip_address, "is_els": is_els, @@ -120,13 +131,6 @@ def _parse_purchase_name(data: object) -> None | str: purchase_name = _parse_purchase_name(d.pop("purchase_name")) - def _parse_license_ref(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - license_ref = _parse_license_ref(d.pop("license_ref")) - def _parse_key_number(data: object) -> None | str: if data is None: return data @@ -187,13 +191,12 @@ def _parse_date_expiry(data: object) -> datetime.date | None: date_expiry = _parse_date_expiry(d.pop("date_expiry")) - cpanel_license = cls( + license_ = cls( license_id=license_id, purchase_id=purchase_id, purchase_server_id=purchase_server_id, service_name=service_name, purchase_name=purchase_name, - license_ref=license_ref, key_number=key_number, ip_address=ip_address, is_els=is_els, @@ -203,8 +206,8 @@ def _parse_date_expiry(data: object) -> datetime.date | None: date_expiry=date_expiry, ) - cpanel_license.additional_properties = d - return cpanel_license + license_.additional_properties = d + return license_ @property def additional_keys(self) -> list[str]: diff --git a/src/shellrent_sdk/client/models/securemail_mailbox_paginated_list_response.py b/src/shellrent_sdk/client/models/license_paginated_list_response.py similarity index 70% rename from src/shellrent_sdk/client/models/securemail_mailbox_paginated_list_response.py rename to src/shellrent_sdk/client/models/license_paginated_list_response.py index 8864a04..ab90b65 100644 --- a/src/shellrent_sdk/client/models/securemail_mailbox_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/license_paginated_list_response.py @@ -1,25 +1,31 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: + from ..models.license_ import License from ..models.pagination_meta import PaginationMeta - from ..models.securemail_mailbox import SecuremailMailbox -T = TypeVar("T", bound="SecuremailMailboxPaginatedListResponse") +T = TypeVar("T", bound="LicensePaginatedListResponse") @_attrs_define -class SecuremailMailboxPaginatedListResponse: - error: int +class LicensePaginatedListResponse: + """Successful response with a page of `License`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str - data: list[SecuremailMailbox] + """ Always null in a successful response """ + data: list[License] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -50,11 +56,13 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.license_ import License from ..models.pagination_meta import PaginationMeta - from ..models.securemail_mailbox import SecuremailMailbox d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -66,21 +74,21 @@ def _parse_message(data: object) -> None | str: data = [] _data = d.pop("data") for data_item_data in _data: - data_item = SecuremailMailbox.from_dict(data_item_data) + data_item = License.from_dict(data_item_data) data.append(data_item) meta = PaginationMeta.from_dict(d.pop("meta")) - securemail_mailbox_paginated_list_response = cls( + license_paginated_list_response = cls( error=error, message=message, data=data, meta=meta, ) - securemail_mailbox_paginated_list_response.additional_properties = d - return securemail_mailbox_paginated_list_response + license_paginated_list_response.additional_properties = d + return license_paginated_list_response @property def additional_keys(self) -> list[str]: diff --git a/src/shellrent_sdk/client/models/license_response.py b/src/shellrent_sdk/client/models/license_response.py new file mode 100644 index 0000000..84eda1e --- /dev/null +++ b/src/shellrent_sdk/client/models/license_response.py @@ -0,0 +1,97 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.license_ import License + + +T = TypeVar("T", bound="LicenseResponse") + + +@_attrs_define +class LicenseResponse: + """Successful response with one `License`""" + + error: Literal[0] + """ Always 0 in a successful response """ + message: None | str + """ Always null in a successful response """ + data: License + """ cPanel or Plesk license of the account, with the server or the IP address where it is installed """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + error = self.error + + message: None | str + message = self.message + + data = self.data.to_dict() + + meta = self.meta + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "error": error, + "message": message, + "data": data, + "meta": meta, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.license_ import License + + d = dict(src_dict) + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") + + def _parse_message(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + message = _parse_message(d.pop("message")) + + data = License.from_dict(d.pop("data")) + + meta = d.pop("meta") + + license_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + license_response.additional_properties = d + return license_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/microsoft_365.py b/src/shellrent_sdk/client/models/microsoft_365.py index b988002..853bb38 100644 --- a/src/shellrent_sdk/client/models/microsoft_365.py +++ b/src/shellrent_sdk/client/models/microsoft_365.py @@ -16,22 +16,42 @@ @_attrs_define class Microsoft365: + """Microsoft 365 subscription of the account, with its status at the supplier and its tenant""" + microsoft365_id: int purchase_id: int + """ Id of the purchase of the subscription (`GET /api/v3/purchases/{purchase_id}`) """ tenant_id: int | None + """ Id of the tenant of the subscription (`GET /api/v3/microsoft-365-tenants/{microsoft_365_tenant_id}`) """ service_name: None | str + """ Name of the service of the purchase, in Italian """ purchase_name: None | str + """ Object name of the purchase (`purchase_name.object_name` of the purchase): the prefix of the tenant domain, + null until it is set """ supplier_code: None | str + """ Reference of the subscription at the supplier; null until the supplier provisions it """ supplier_status: None | str + """ Status of the subscription as the supplier reports it, for example `active`, `suspended` or `canceled`; null + until known """ order_code: None | str + """ Code of the order placed at the supplier for the subscription; null until it is placed """ order_reference: None | str + """ Reference of the order at the supplier; null until the supplier assigns it """ order_status: None | str + """ Status of the order at the supplier, for example `Order queued`, `Fulfilled` or `Archived`; null until the + order is placed """ order_need_submit: bool + """ Whether the order at the supplier ended with a warning and must be submitted again """ autorenew_enabled: bool + """ Whether the subscription renews automatically at the supplier """ is_trial: bool + """ Whether the subscription is a trial """ subscription_activation_date: datetime.date | None + """ Activation date of the subscription at the supplier; null until known """ subscription_expiry_date: datetime.date | None + """ Expiry date of the subscription at the supplier; null until known """ tenant: Microsoft365Tenant | None + """ Tenant of the subscription """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/microsoft_365_domain_available.py b/src/shellrent_sdk/client/models/microsoft_365_domain_available.py index e6bd9d6..2591d6b 100644 --- a/src/shellrent_sdk/client/models/microsoft_365_domain_available.py +++ b/src/shellrent_sdk/client/models/microsoft_365_domain_available.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import Any, Self, TypeVar, cast +from typing import Any, Self, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -11,14 +11,14 @@ @_attrs_define class Microsoft365DomainAvailable: + """Availability of a `.onmicrosoft.com` domain for a new Microsoft 365 tenant""" + domain_prefix: str """ Requested tenant domain prefix """ microsoft_domain: str """ Full ".onmicrosoft.com" domain """ available: bool - """ Whether the domain is available """ - microsoft_uuid: None | str - """ Microsoft tenant UUID if available """ + """ Whether the domain is available for a new tenant: false if a tenant already has it at Microsoft """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -28,9 +28,6 @@ def to_dict(self) -> dict[str, Any]: available = self.available - microsoft_uuid: None | str - microsoft_uuid = self.microsoft_uuid - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -38,7 +35,6 @@ def to_dict(self) -> dict[str, Any]: "domain_prefix": domain_prefix, "microsoft_domain": microsoft_domain, "available": available, - "microsoft_uuid": microsoft_uuid, } ) @@ -53,18 +49,10 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: available = d.pop("available") - def _parse_microsoft_uuid(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - microsoft_uuid = _parse_microsoft_uuid(d.pop("microsoft_uuid")) - microsoft_365_domain_available = cls( domain_prefix=domain_prefix, microsoft_domain=microsoft_domain, available=available, - microsoft_uuid=microsoft_uuid, ) microsoft_365_domain_available.additional_properties = d diff --git a/src/shellrent_sdk/client/models/microsoft_365_domain_available_response.py b/src/shellrent_sdk/client/models/microsoft_365_domain_available_response.py index 006fb40..eef9f02 100644 --- a/src/shellrent_sdk/client/models/microsoft_365_domain_available_response.py +++ b/src/shellrent_sdk/client/models/microsoft_365_domain_available_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.microsoft_365_domain_available import Microsoft365DomainAvailable - from ..models.microsoft_365_domain_available_response_meta_type_0 import ( - Microsoft365DomainAvailableResponseMetaType0, - ) T = TypeVar("T", bound="Microsoft365DomainAvailableResponse") @@ -18,17 +15,19 @@ @_attrs_define class Microsoft365DomainAvailableResponse: - error: int + """Successful response with one `Microsoft365DomainAvailable`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: Microsoft365DomainAvailable - meta: Microsoft365DomainAvailableResponseMetaType0 | None + """ Availability of a `.onmicrosoft.com` domain for a new Microsoft 365 tenant """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.microsoft_365_domain_available_response_meta_type_0 import ( - Microsoft365DomainAvailableResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, Microsoft365DomainAvailableResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -60,12 +55,11 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.microsoft_365_domain_available import ( Microsoft365DomainAvailable, ) - from ..models.microsoft_365_domain_available_response_meta_type_0 import ( - Microsoft365DomainAvailableResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -76,20 +70,7 @@ def _parse_message(data: object) -> None | str: data = Microsoft365DomainAvailable.from_dict(d.pop("data")) - def _parse_meta(data: object) -> Microsoft365DomainAvailableResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = Microsoft365DomainAvailableResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(Microsoft365DomainAvailableResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") microsoft_365_domain_available_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/microsoft_365_domain_available_response_meta_type_0.py b/src/shellrent_sdk/client/models/microsoft_365_domain_available_response_meta_type_0.py deleted file mode 100644 index 9e48c20..0000000 --- a/src/shellrent_sdk/client/models/microsoft_365_domain_available_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="Microsoft365DomainAvailableResponseMetaType0") - - -@_attrs_define -class Microsoft365DomainAvailableResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - microsoft_365_domain_available_response_meta_type_0 = cls() - - microsoft_365_domain_available_response_meta_type_0.additional_properties = d - return microsoft_365_domain_available_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/microsoft_365_paginated_list_response.py b/src/shellrent_sdk/client/models/microsoft_365_paginated_list_response.py index c1fd44c..097ecbb 100644 --- a/src/shellrent_sdk/client/models/microsoft_365_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/microsoft_365_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class Microsoft365PaginatedListResponse: - error: int + """Successful response with a page of `Microsoft365`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[Microsoft365] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.pagination_meta import PaginationMeta d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/microsoft_365_partner_link.py b/src/shellrent_sdk/client/models/microsoft_365_partner_link.py index e3ce8b0..047c39d 100644 --- a/src/shellrent_sdk/client/models/microsoft_365_partner_link.py +++ b/src/shellrent_sdk/client/models/microsoft_365_partner_link.py @@ -11,7 +11,11 @@ @_attrs_define class Microsoft365PartnerLink: + """Link to approve the Microsoft partner relationship, needed to transfer a tenant""" + partner_link: str + """ URL where the partner relationship of the tenant is approved at Microsoft, before buying a subscription with + `tenant_choice` `transfer` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/microsoft_365_partner_link_response.py b/src/shellrent_sdk/client/models/microsoft_365_partner_link_response.py index 129d3b2..22e2bf0 100644 --- a/src/shellrent_sdk/client/models/microsoft_365_partner_link_response.py +++ b/src/shellrent_sdk/client/models/microsoft_365_partner_link_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.microsoft_365_partner_link import Microsoft365PartnerLink - from ..models.microsoft_365_partner_link_response_meta_type_0 import ( - Microsoft365PartnerLinkResponseMetaType0, - ) T = TypeVar("T", bound="Microsoft365PartnerLinkResponse") @@ -18,17 +15,19 @@ @_attrs_define class Microsoft365PartnerLinkResponse: - error: int + """Successful response with one `Microsoft365PartnerLink`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: Microsoft365PartnerLink - meta: Microsoft365PartnerLinkResponseMetaType0 | None + """ Link to approve the Microsoft partner relationship, needed to transfer a tenant """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.microsoft_365_partner_link_response_meta_type_0 import ( - Microsoft365PartnerLinkResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, Microsoft365PartnerLinkResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -58,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.microsoft_365_partner_link import Microsoft365PartnerLink - from ..models.microsoft_365_partner_link_response_meta_type_0 import ( - Microsoft365PartnerLinkResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -74,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = Microsoft365PartnerLink.from_dict(d.pop("data")) - def _parse_meta(data: object) -> Microsoft365PartnerLinkResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = Microsoft365PartnerLinkResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(Microsoft365PartnerLinkResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") microsoft_365_partner_link_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/microsoft_365_partner_link_response_meta_type_0.py b/src/shellrent_sdk/client/models/microsoft_365_partner_link_response_meta_type_0.py deleted file mode 100644 index 643fbc0..0000000 --- a/src/shellrent_sdk/client/models/microsoft_365_partner_link_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="Microsoft365PartnerLinkResponseMetaType0") - - -@_attrs_define -class Microsoft365PartnerLinkResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - microsoft_365_partner_link_response_meta_type_0 = cls() - - microsoft_365_partner_link_response_meta_type_0.additional_properties = d - return microsoft_365_partner_link_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/microsoft_365_response.py b/src/shellrent_sdk/client/models/microsoft_365_response.py index d15c927..553a030 100644 --- a/src/shellrent_sdk/client/models/microsoft_365_response.py +++ b/src/shellrent_sdk/client/models/microsoft_365_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.microsoft_365 import Microsoft365 - from ..models.microsoft_365_response_meta_type_0 import Microsoft365ResponseMetaType0 T = TypeVar("T", bound="Microsoft365Response") @@ -16,15 +15,19 @@ @_attrs_define class Microsoft365Response: - error: int + """Successful response with one `Microsoft365`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: Microsoft365 - meta: Microsoft365ResponseMetaType0 | None + """ Microsoft 365 subscription of the account, with its status at the supplier and its tenant """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.microsoft_365_response_meta_type_0 import Microsoft365ResponseMetaType0 - error = self.error message: None | str @@ -32,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, Microsoft365ResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.microsoft_365 import Microsoft365 - from ..models.microsoft_365_response_meta_type_0 import ( - Microsoft365ResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -70,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = Microsoft365.from_dict(d.pop("data")) - def _parse_meta(data: object) -> Microsoft365ResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = Microsoft365ResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(Microsoft365ResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") microsoft_365_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/microsoft_365_response_meta_type_0.py b/src/shellrent_sdk/client/models/microsoft_365_response_meta_type_0.py deleted file mode 100644 index cc279bc..0000000 --- a/src/shellrent_sdk/client/models/microsoft_365_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="Microsoft365ResponseMetaType0") - - -@_attrs_define -class Microsoft365ResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - microsoft_365_response_meta_type_0 = cls() - - microsoft_365_response_meta_type_0.additional_properties = d - return microsoft_365_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/microsoft_365_subscription_quantity_request.py b/src/shellrent_sdk/client/models/microsoft_365_subscription_quantity_request.py index fb615d0..431b0a8 100644 --- a/src/shellrent_sdk/client/models/microsoft_365_subscription_quantity_request.py +++ b/src/shellrent_sdk/client/models/microsoft_365_subscription_quantity_request.py @@ -4,7 +4,6 @@ from typing import Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="Microsoft365SubscriptionQuantityRequest") @@ -13,13 +12,12 @@ class Microsoft365SubscriptionQuantityRequest: quantity: int """ Final number of seats for the Microsoft 365 subscription """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: quantity = self.quantity field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "quantity": quantity, @@ -37,21 +35,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: quantity=quantity, ) - microsoft_365_subscription_quantity_request.additional_properties = d return microsoft_365_subscription_quantity_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/microsoft_365_tenant.py b/src/shellrent_sdk/client/models/microsoft_365_tenant.py index 9ef529e..da3c152 100644 --- a/src/shellrent_sdk/client/models/microsoft_365_tenant.py +++ b/src/shellrent_sdk/client/models/microsoft_365_tenant.py @@ -12,28 +12,47 @@ @_attrs_define class Microsoft365Tenant: + """Microsoft 365 tenant of the account, with its contact data and the state of the Microsoft Customer Agreement""" + tenant_id: int microsoft_uuid: None | str + """ Id of the tenant at Microsoft (tenant UUID); null until detected """ domain_prefix: None | str + """ Prefix of the `.onmicrosoft.com` domain of the tenant """ microsoft_domain: None | str + """ Full `.onmicrosoft.com` domain of the tenant """ imported: bool + """ Whether the tenant was transferred from another partner (`tenant_choice` `transfer`) instead of created new + (`new`) """ first_name: None | str last_name: None | str country: None | str + """ Country of the tenant, as an ISO 3166-1 alpha-2 code, for example `IT` """ company_name: None | str address: None | str city: None | str state: None | str + """ State or province of the tenant address """ postal_code: None | str email_address: None | str phone_prefix: None | str + """ International phone prefix with the leading `+`, for example `+39` """ phone_number: None | str locale: None | str + """ Locale of the tenant, for example `it_IT` or `en_US` """ account_login: None | str - mca_compliant: bool + """ Username of the administrator account of the tenant, whose password is sent by email; null when not + available """ + mca_compliant: bool | None + """ Whether the Microsoft Customer Agreement (MCA) has been accepted for the tenant; null until checked """ mca_sign_date: datetime.datetime | None + """ Date and time the Microsoft Customer Agreement was accepted; null when not known """ mca_template_id: None | str + """ Template of the accepted Microsoft Customer Agreement, as an id or as the URL of the agreement; null when + not accepted """ mca_error: None | str + """ Message of the supplier on the check of the Microsoft Customer Agreement, for example `customer is not + provisioned yet`; null when there is none """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -89,6 +108,7 @@ def to_dict(self) -> dict[str, Any]: account_login: None | str account_login = self.account_login + mca_compliant: bool | None mca_compliant = self.mca_compliant mca_sign_date: None | str @@ -253,7 +273,12 @@ def _parse_account_login(data: object) -> None | str: account_login = _parse_account_login(d.pop("account_login")) - mca_compliant = d.pop("mca_compliant") + def _parse_mca_compliant(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) + + mca_compliant = _parse_mca_compliant(d.pop("mca_compliant")) def _parse_mca_sign_date(data: object) -> datetime.datetime | None: if data is None: diff --git a/src/shellrent_sdk/client/models/microsoft_365_tenant_paginated_list_response.py b/src/shellrent_sdk/client/models/microsoft_365_tenant_paginated_list_response.py index b408360..6c1b552 100644 --- a/src/shellrent_sdk/client/models/microsoft_365_tenant_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/microsoft_365_tenant_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class Microsoft365TenantPaginatedListResponse: - error: int + """Successful response with a page of `Microsoft365Tenant`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[Microsoft365Tenant] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.pagination_meta import PaginationMeta d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/microsoft_365_tenant_response.py b/src/shellrent_sdk/client/models/microsoft_365_tenant_response.py index 29e5ecf..c323b34 100644 --- a/src/shellrent_sdk/client/models/microsoft_365_tenant_response.py +++ b/src/shellrent_sdk/client/models/microsoft_365_tenant_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.microsoft_365_tenant import Microsoft365Tenant - from ..models.microsoft_365_tenant_response_meta_type_0 import ( - Microsoft365TenantResponseMetaType0, - ) T = TypeVar("T", bound="Microsoft365TenantResponse") @@ -18,17 +15,20 @@ @_attrs_define class Microsoft365TenantResponse: - error: int + """Successful response with one `Microsoft365Tenant`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: Microsoft365Tenant - meta: Microsoft365TenantResponseMetaType0 | None + """ Microsoft 365 tenant of the account, with its contact data and the state of the Microsoft Customer Agreement + """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.microsoft_365_tenant_response_meta_type_0 import ( - Microsoft365TenantResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +36,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, Microsoft365TenantResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -58,12 +54,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.microsoft_365_tenant import Microsoft365Tenant - from ..models.microsoft_365_tenant_response_meta_type_0 import ( - Microsoft365TenantResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -74,20 +69,7 @@ def _parse_message(data: object) -> None | str: data = Microsoft365Tenant.from_dict(d.pop("data")) - def _parse_meta(data: object) -> Microsoft365TenantResponseMetaType0 | None: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = Microsoft365TenantResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(Microsoft365TenantResponseMetaType0 | None, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") microsoft_365_tenant_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/microsoft_365_tenant_response_meta_type_0.py b/src/shellrent_sdk/client/models/microsoft_365_tenant_response_meta_type_0.py deleted file mode 100644 index 4298344..0000000 --- a/src/shellrent_sdk/client/models/microsoft_365_tenant_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="Microsoft365TenantResponseMetaType0") - - -@_attrs_define -class Microsoft365TenantResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - microsoft_365_tenant_response_meta_type_0 = cls() - - microsoft_365_tenant_response_meta_type_0.additional_properties = d - return microsoft_365_tenant_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/o_auth_error.py b/src/shellrent_sdk/client/models/o_auth_error.py index 88d14d5..7a890f4 100644 --- a/src/shellrent_sdk/client/models/o_auth_error.py +++ b/src/shellrent_sdk/client/models/o_auth_error.py @@ -13,9 +13,14 @@ @_attrs_define class OAuthError: + """Error of the token endpoint, in the OAuth2 format (RFC 6749, section 5.2)""" + error: str + """ OAuth2 error code, for example `invalid_client`, `invalid_scope` or `rate_limited` """ error_description: None | str | Unset = UNSET + """ Description of the error, for the developers of the client """ error_uri: None | str | Unset = UNSET + """ Page that describes the error, when there is one """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/o_auth_token_response.py b/src/shellrent_sdk/client/models/o_auth_token_response.py index 319d407..6b54396 100644 --- a/src/shellrent_sdk/client/models/o_auth_token_response.py +++ b/src/shellrent_sdk/client/models/o_auth_token_response.py @@ -11,13 +11,19 @@ @_attrs_define class OAuthTokenResponse: + """Access token issued by the token endpoint""" + token_type: str + """ Type of the token: always `Bearer` """ expires_in: int + """ Lifetime of the token, in seconds """ access_token: str + """ Access token, a JWT signed with the keys of `GET /.well-known/jwks.json`: send it in the `Authorization: + Bearer` header """ scope: str - """ Elenco degli scope concessi separati da spazio """ + """ Space-separated list of the granted scopes """ audience: str - """ Audience associata al token """ + """ Audience of the token: `api-public` for the public API, `api-internal` for the internal one """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/object_storage.py b/src/shellrent_sdk/client/models/object_storage.py index bfe3fcb..6614a60 100644 --- a/src/shellrent_sdk/client/models/object_storage.py +++ b/src/shellrent_sdk/client/models/object_storage.py @@ -12,23 +12,44 @@ @_attrs_define class ObjectStorage: + """S3-compatible object storage of the account, with the usage of all its buckets from the latest daily usage data of + the storage: a null figure means zero or not available yet + + """ + object_storage_id: int purchase_id: int | None + """ Id of the purchase of the object storage (`GET /api/v3/purchases/{purchase_id}`) """ name: None | str + """ Name of the object storage account at the storage, the same as `code_full` """ email: None | str - code: None | str + """ Contact email of the object storage account at the storage, generated by the service + (`@serverlet.it`) """ + code: int | None code_full: None | str + """ Code of the object storage account at the storage, used as its name """ active: bool | None + """ Whether the object storage account is active at the storage: false after its deletion """ active_storage_bytes: int | None + """ Space used by the active objects, in bytes """ deleted_storage_bytes: int | None + """ Space of the deleted objects that still counts toward the purchased space, in bytes """ active_objects: int | None + """ Number of active objects """ deleted_objects: int | None + """ Number of deleted objects still counted in `deleted_storage_bytes` """ api_calls_count: int | None + """ Number of API calls in the day of the latest usage data """ storage_wrote_bytes: int | None + """ Data written in the day of the latest usage data, in bytes """ storage_read_bytes: int | None + """ Data read in the day of the latest usage data, in bytes """ egress_traffic_bytes: int | None + """ Outgoing traffic in the day of the latest usage data, in bytes """ ingress_traffic_bytes: int | None + """ Incoming traffic in the day of the latest usage data, in bytes """ reference_date: datetime.date | None + """ Date the object storage account was created at the storage: it is not the date of the usage figures """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -43,7 +64,7 @@ def to_dict(self) -> dict[str, Any]: email: None | str email = self.email - code: None | str + code: int | None code = self.code code_full: None | str @@ -137,10 +158,10 @@ def _parse_email(data: object) -> None | str: email = _parse_email(d.pop("email")) - def _parse_code(data: object) -> None | str: + def _parse_code(data: object) -> int | None: if data is None: return data - return cast(None | str, data) + return cast(int | None, data) code = _parse_code(d.pop("code")) diff --git a/src/shellrent_sdk/client/models/object_storage_bucket.py b/src/shellrent_sdk/client/models/object_storage_bucket.py index 3e50a91..18f2666 100644 --- a/src/shellrent_sdk/client/models/object_storage_bucket.py +++ b/src/shellrent_sdk/client/models/object_storage_bucket.py @@ -12,28 +12,53 @@ @_attrs_define class ObjectStorageBucket: + """Bucket of an object storage, with its usage from the latest daily usage data of the storage: a null figure means + zero or not available yet + + """ + bucket_id: int object_storage_id: int + """ Id of the object storage (`GET /api/v3/object-storages/{object_storage_id}`) """ sub_account_id: int | None + """ Id of the sub-account of the object storage, the account at the storage that holds its buckets and IAM users + (not the account id of the storage) """ region_id: int | None + """ Id of the storage region of the bucket """ bucket_remote_id: int | None - code: None | str + code: int | None + """ Progressive number of the bucket in the object storage """ code_full: None | str + """ Same value as `name` """ bucket_number: None | str name: None | str versioning: None | str - creation_date: datetime.datetime | None + """ Versioning status of the bucket: `ENABLED`, `SUSPENDED`, or `DISABLED` if it has never been enabled """ + creation_date: datetime.date | None + """ Date the bucket was created on the storage """ arn: None | str + """ ARN (Amazon Resource Name) of the bucket, used in the policies (`arn:aws:s3:::`) """ policy_json: None | str + """ Policy of the bucket on the storage, as a JSON string, with the firewall entries; null if the bucket has + none """ active_storage_bytes: int | None + """ Space used by the active objects, in bytes """ deleted_storage_bytes: int | None + """ Space of the deleted objects that still counts toward the purchased space, in bytes """ active_objects: int | None + """ Number of active objects """ deleted_objects: int | None + """ Number of deleted objects still counted in `deleted_storage_bytes` """ api_calls_count: int | None + """ Number of API calls in the day of the latest usage data """ storage_wrote_bytes: int | None + """ Data written in the day of the latest usage data, in bytes """ storage_read_bytes: int | None + """ Data read in the day of the latest usage data, in bytes """ egress_traffic_bytes: int | None + """ Outgoing traffic in the day of the latest usage data, in bytes """ ingress_traffic_bytes: int | None + """ Incoming traffic in the day of the latest usage data, in bytes """ reference_date: datetime.date | None additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -51,7 +76,7 @@ def to_dict(self) -> dict[str, Any]: bucket_remote_id: int | None bucket_remote_id = self.bucket_remote_id - code: None | str + code: int | None code = self.code code_full: None | str @@ -67,7 +92,7 @@ def to_dict(self) -> dict[str, Any]: versioning = self.versioning creation_date: None | str - if isinstance(self.creation_date, datetime.datetime): + if isinstance(self.creation_date, datetime.date): creation_date = self.creation_date.isoformat() else: creation_date = self.creation_date @@ -171,10 +196,10 @@ def _parse_bucket_remote_id(data: object) -> int | None: bucket_remote_id = _parse_bucket_remote_id(d.pop("bucket_remote_id")) - def _parse_code(data: object) -> None | str: + def _parse_code(data: object) -> int | None: if data is None: return data - return cast(None | str, data) + return cast(int | None, data) code = _parse_code(d.pop("code")) @@ -206,18 +231,18 @@ def _parse_versioning(data: object) -> None | str: versioning = _parse_versioning(d.pop("versioning")) - def _parse_creation_date(data: object) -> datetime.datetime | None: + def _parse_creation_date(data: object) -> datetime.date | None: if data is None: return data try: if not isinstance(data, str): raise TypeError() - creation_date_type_0 = datetime.datetime.fromisoformat(data) + creation_date_type_0 = datetime.date.fromisoformat(data) return creation_date_type_0 except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(datetime.datetime | None, data) + return cast(datetime.date | None, data) creation_date = _parse_creation_date(d.pop("creation_date")) diff --git a/src/shellrent_sdk/client/models/object_storage_bucket_chart.py b/src/shellrent_sdk/client/models/object_storage_bucket_chart.py index bb6c0c5..2c24cc5 100644 --- a/src/shellrent_sdk/client/models/object_storage_bucket_chart.py +++ b/src/shellrent_sdk/client/models/object_storage_bucket_chart.py @@ -15,10 +15,16 @@ @_attrs_define class ObjectStorageBucketChart: + """Daily usage history of a bucket, for a chart""" + object_storage_id: int + """ Id of the object storage (`GET /api/v3/object-storages/{object_storage_id}`) """ bucket_id: int + """ Id of the bucket (`GET /api/v3/object-storages/{object_storage_id}/buckets/{bucket_id}`) """ interval: str + """ Interval between two points, as an ISO 8601 duration: always `P1D`, one point per day """ points: list[ObjectStorageBucketChartPointsItem] + """ Usage of the bucket day by day, oldest first """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/object_storage_bucket_chart_points_item.py b/src/shellrent_sdk/client/models/object_storage_bucket_chart_points_item.py index f9457d9..cb3de11 100644 --- a/src/shellrent_sdk/client/models/object_storage_bucket_chart_points_item.py +++ b/src/shellrent_sdk/client/models/object_storage_bucket_chart_points_item.py @@ -6,24 +6,27 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset - T = TypeVar("T", bound="ObjectStorageBucketChartPointsItem") @_attrs_define class ObjectStorageBucketChartPointsItem: - x: float | Unset = UNSET + x: float """ UNIX timestamp in milliseconds """ - active_storage_bytes: int | Unset = UNSET - deleted_storage_bytes: int | Unset = UNSET - active_objects: int | Unset = UNSET - deleted_objects: int | Unset = UNSET - api_calls_count: int | Unset = UNSET - storage_wrote_bytes: int | Unset = UNSET - storage_read_bytes: int | Unset = UNSET - ingress_traffic_bytes: int | Unset = UNSET - egress_traffic_bytes: int | Unset = UNSET + active_storage_bytes: int + """ Space used by the active objects on the day, in bytes """ + deleted_storage_bytes: int + """ Space of the deleted objects still counted on the day, in bytes """ + active_objects: int + """ Number of active objects on the day """ + deleted_objects: int + """ Number of deleted objects still counted on the day """ + api_calls_count: int + """ Number of API calls on the day """ + storage_wrote_bytes: int + storage_read_bytes: int + ingress_traffic_bytes: int + egress_traffic_bytes: int additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -49,52 +52,45 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - field_dict.update({}) - if x is not UNSET: - field_dict["x"] = x - if active_storage_bytes is not UNSET: - field_dict["active_storage_bytes"] = active_storage_bytes - if deleted_storage_bytes is not UNSET: - field_dict["deleted_storage_bytes"] = deleted_storage_bytes - if active_objects is not UNSET: - field_dict["active_objects"] = active_objects - if deleted_objects is not UNSET: - field_dict["deleted_objects"] = deleted_objects - if api_calls_count is not UNSET: - field_dict["api_calls_count"] = api_calls_count - if storage_wrote_bytes is not UNSET: - field_dict["storage_wrote_bytes"] = storage_wrote_bytes - if storage_read_bytes is not UNSET: - field_dict["storage_read_bytes"] = storage_read_bytes - if ingress_traffic_bytes is not UNSET: - field_dict["ingress_traffic_bytes"] = ingress_traffic_bytes - if egress_traffic_bytes is not UNSET: - field_dict["egress_traffic_bytes"] = egress_traffic_bytes + field_dict.update( + { + "x": x, + "active_storage_bytes": active_storage_bytes, + "deleted_storage_bytes": deleted_storage_bytes, + "active_objects": active_objects, + "deleted_objects": deleted_objects, + "api_calls_count": api_calls_count, + "storage_wrote_bytes": storage_wrote_bytes, + "storage_read_bytes": storage_read_bytes, + "ingress_traffic_bytes": ingress_traffic_bytes, + "egress_traffic_bytes": egress_traffic_bytes, + } + ) return field_dict @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) - x = d.pop("x", UNSET) + x = d.pop("x") - active_storage_bytes = d.pop("active_storage_bytes", UNSET) + active_storage_bytes = d.pop("active_storage_bytes") - deleted_storage_bytes = d.pop("deleted_storage_bytes", UNSET) + deleted_storage_bytes = d.pop("deleted_storage_bytes") - active_objects = d.pop("active_objects", UNSET) + active_objects = d.pop("active_objects") - deleted_objects = d.pop("deleted_objects", UNSET) + deleted_objects = d.pop("deleted_objects") - api_calls_count = d.pop("api_calls_count", UNSET) + api_calls_count = d.pop("api_calls_count") - storage_wrote_bytes = d.pop("storage_wrote_bytes", UNSET) + storage_wrote_bytes = d.pop("storage_wrote_bytes") - storage_read_bytes = d.pop("storage_read_bytes", UNSET) + storage_read_bytes = d.pop("storage_read_bytes") - ingress_traffic_bytes = d.pop("ingress_traffic_bytes", UNSET) + ingress_traffic_bytes = d.pop("ingress_traffic_bytes") - egress_traffic_bytes = d.pop("egress_traffic_bytes", UNSET) + egress_traffic_bytes = d.pop("egress_traffic_bytes") object_storage_bucket_chart_points_item = cls( x=x, diff --git a/src/shellrent_sdk/client/models/object_storage_bucket_chart_response.py b/src/shellrent_sdk/client/models/object_storage_bucket_chart_response.py index 583c818..2a0829d 100644 --- a/src/shellrent_sdk/client/models/object_storage_bucket_chart_response.py +++ b/src/shellrent_sdk/client/models/object_storage_bucket_chart_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.object_storage_bucket_chart import ObjectStorageBucketChart - from ..models.object_storage_bucket_chart_response_meta_type_0 import ( - ObjectStorageBucketChartResponseMetaType0, - ) T = TypeVar("T", bound="ObjectStorageBucketChartResponse") @@ -18,17 +15,19 @@ @_attrs_define class ObjectStorageBucketChartResponse: - error: int + """Successful response with one `ObjectStorageBucketChart`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: ObjectStorageBucketChart - meta: None | ObjectStorageBucketChartResponseMetaType0 + """ Daily usage history of a bucket, for a chart """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.object_storage_bucket_chart_response_meta_type_0 import ( - ObjectStorageBucketChartResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, ObjectStorageBucketChartResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -58,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.object_storage_bucket_chart import ObjectStorageBucketChart - from ..models.object_storage_bucket_chart_response_meta_type_0 import ( - ObjectStorageBucketChartResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -74,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = ObjectStorageBucketChart.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | ObjectStorageBucketChartResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = ObjectStorageBucketChartResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | ObjectStorageBucketChartResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") object_storage_bucket_chart_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/object_storage_bucket_chart_response_meta_type_0.py b/src/shellrent_sdk/client/models/object_storage_bucket_chart_response_meta_type_0.py deleted file mode 100644 index d2bc8a8..0000000 --- a/src/shellrent_sdk/client/models/object_storage_bucket_chart_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ObjectStorageBucketChartResponseMetaType0") - - -@_attrs_define -class ObjectStorageBucketChartResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - object_storage_bucket_chart_response_meta_type_0 = cls() - - object_storage_bucket_chart_response_meta_type_0.additional_properties = d - return object_storage_bucket_chart_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/object_storage_bucket_firewall_entry.py b/src/shellrent_sdk/client/models/object_storage_bucket_firewall_entry.py index 9f75bfb..a3cff3d 100644 --- a/src/shellrent_sdk/client/models/object_storage_bucket_firewall_entry.py +++ b/src/shellrent_sdk/client/models/object_storage_bucket_firewall_entry.py @@ -12,11 +12,17 @@ @_attrs_define class ObjectStorageBucketFirewallEntry: + """Entry of the firewall of a bucket: when the bucket has entries, the requests from other addresses are denied""" + entry_id: int object_storage_id: int + """ Id of the object storage (`GET /api/v3/object-storages/{object_storage_id}`) """ bucket_id: int + """ Id of the bucket (`GET /api/v3/object-storages/{object_storage_id}/buckets/{bucket_id}`) """ ip: None | str + """ IPv4 or IPv6 address, or subnet in CIDR notation, allowed to access the bucket """ active: bool | None + """ Whether the entry is active: removed entries are not returned """ date_created: datetime.datetime | None additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) diff --git a/src/shellrent_sdk/client/models/object_storage_bucket_firewall_entry_create_request.py b/src/shellrent_sdk/client/models/object_storage_bucket_firewall_entry_create_request.py index a633045..2dc762e 100644 --- a/src/shellrent_sdk/client/models/object_storage_bucket_firewall_entry_create_request.py +++ b/src/shellrent_sdk/client/models/object_storage_bucket_firewall_entry_create_request.py @@ -4,53 +4,37 @@ from typing import Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset T = TypeVar("T", bound="ObjectStorageBucketFirewallEntryCreateRequest") @_attrs_define class ObjectStorageBucketFirewallEntryCreateRequest: - ip: str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + """Address or subnet to allow in the firewall of a bucket""" + + ip: str + """ IPv4 or IPv6 address, or a subnet in CIDR notation """ def to_dict(self) -> dict[str, Any]: ip = self.ip field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if ip is not UNSET: - field_dict["ip"] = ip + + field_dict.update( + { + "ip": ip, + } + ) return field_dict @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) - ip = d.pop("ip", UNSET) + ip = d.pop("ip") object_storage_bucket_firewall_entry_create_request = cls( ip=ip, ) - object_storage_bucket_firewall_entry_create_request.additional_properties = d return object_storage_bucket_firewall_entry_create_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/object_storage_bucket_firewall_entry_paginated_list_response.py b/src/shellrent_sdk/client/models/object_storage_bucket_firewall_entry_paginated_list_response.py index f8c777c..53cbf11 100644 --- a/src/shellrent_sdk/client/models/object_storage_bucket_firewall_entry_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/object_storage_bucket_firewall_entry_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class ObjectStorageBucketFirewallEntryPaginatedListResponse: - error: int + """Successful response with a page of `ObjectStorageBucketFirewallEntry`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[ObjectStorageBucketFirewallEntry] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -56,7 +62,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.pagination_meta import PaginationMeta d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/object_storage_bucket_firewall_entry_response.py b/src/shellrent_sdk/client/models/object_storage_bucket_firewall_entry_response.py index d7ef2f8..7a8ee11 100644 --- a/src/shellrent_sdk/client/models/object_storage_bucket_firewall_entry_response.py +++ b/src/shellrent_sdk/client/models/object_storage_bucket_firewall_entry_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.object_storage_bucket_firewall_entry import ObjectStorageBucketFirewallEntry - from ..models.object_storage_bucket_firewall_entry_response_meta_type_0 import ( - ObjectStorageBucketFirewallEntryResponseMetaType0, - ) T = TypeVar("T", bound="ObjectStorageBucketFirewallEntryResponse") @@ -18,17 +15,20 @@ @_attrs_define class ObjectStorageBucketFirewallEntryResponse: - error: int + """Successful response with one `ObjectStorageBucketFirewallEntry`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: ObjectStorageBucketFirewallEntry - meta: None | ObjectStorageBucketFirewallEntryResponseMetaType0 + """ Entry of the firewall of a bucket: when the bucket has entries, the requests from other addresses are denied + """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.object_storage_bucket_firewall_entry_response_meta_type_0 import ( - ObjectStorageBucketFirewallEntryResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +36,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, ObjectStorageBucketFirewallEntryResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -60,12 +56,11 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.object_storage_bucket_firewall_entry import ( ObjectStorageBucketFirewallEntry, ) - from ..models.object_storage_bucket_firewall_entry_response_meta_type_0 import ( - ObjectStorageBucketFirewallEntryResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -76,20 +71,7 @@ def _parse_message(data: object) -> None | str: data = ObjectStorageBucketFirewallEntry.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | ObjectStorageBucketFirewallEntryResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = ObjectStorageBucketFirewallEntryResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | ObjectStorageBucketFirewallEntryResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") object_storage_bucket_firewall_entry_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/object_storage_bucket_firewall_entry_response_meta_type_0.py b/src/shellrent_sdk/client/models/object_storage_bucket_firewall_entry_response_meta_type_0.py deleted file mode 100644 index 4c13212..0000000 --- a/src/shellrent_sdk/client/models/object_storage_bucket_firewall_entry_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ObjectStorageBucketFirewallEntryResponseMetaType0") - - -@_attrs_define -class ObjectStorageBucketFirewallEntryResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - object_storage_bucket_firewall_entry_response_meta_type_0 = cls() - - object_storage_bucket_firewall_entry_response_meta_type_0.additional_properties = d - return object_storage_bucket_firewall_entry_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/object_storage_bucket_paginated_list_response.py b/src/shellrent_sdk/client/models/object_storage_bucket_paginated_list_response.py index 0078d4e..bf54ac3 100644 --- a/src/shellrent_sdk/client/models/object_storage_bucket_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/object_storage_bucket_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class ObjectStorageBucketPaginatedListResponse: - error: int + """Successful response with a page of `ObjectStorageBucket`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[ObjectStorageBucket] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.pagination_meta import PaginationMeta d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/object_storage_bucket_response.py b/src/shellrent_sdk/client/models/object_storage_bucket_response.py index 940ea7b..8422e6c 100644 --- a/src/shellrent_sdk/client/models/object_storage_bucket_response.py +++ b/src/shellrent_sdk/client/models/object_storage_bucket_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.object_storage_bucket import ObjectStorageBucket - from ..models.object_storage_bucket_response_meta_type_0 import ( - ObjectStorageBucketResponseMetaType0, - ) T = TypeVar("T", bound="ObjectStorageBucketResponse") @@ -18,17 +15,20 @@ @_attrs_define class ObjectStorageBucketResponse: - error: int + """Successful response with one `ObjectStorageBucket`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: ObjectStorageBucket - meta: None | ObjectStorageBucketResponseMetaType0 + """ Bucket of an object storage, with its usage from the latest daily usage data of the storage: a null figure + means zero or not available yet """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.object_storage_bucket_response_meta_type_0 import ( - ObjectStorageBucketResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +36,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, ObjectStorageBucketResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -58,12 +54,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.object_storage_bucket import ObjectStorageBucket - from ..models.object_storage_bucket_response_meta_type_0 import ( - ObjectStorageBucketResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -74,20 +69,7 @@ def _parse_message(data: object) -> None | str: data = ObjectStorageBucket.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | ObjectStorageBucketResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = ObjectStorageBucketResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | ObjectStorageBucketResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") object_storage_bucket_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/object_storage_bucket_response_meta_type_0.py b/src/shellrent_sdk/client/models/object_storage_bucket_response_meta_type_0.py deleted file mode 100644 index 4723861..0000000 --- a/src/shellrent_sdk/client/models/object_storage_bucket_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ObjectStorageBucketResponseMetaType0") - - -@_attrs_define -class ObjectStorageBucketResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - object_storage_bucket_response_meta_type_0 = cls() - - object_storage_bucket_response_meta_type_0.additional_properties = d - return object_storage_bucket_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/object_storage_iam_user.py b/src/shellrent_sdk/client/models/object_storage_iam_user.py index 9cfe054..8548d47 100644 --- a/src/shellrent_sdk/client/models/object_storage_iam_user.py +++ b/src/shellrent_sdk/client/models/object_storage_iam_user.py @@ -12,15 +12,25 @@ @_attrs_define class ObjectStorageIamUser: + """IAM user of an object storage: a user of the storage with its own S3 keys""" + iam_user_id: int object_storage_id: int + """ Id of the object storage (`GET /api/v3/object-storages/{object_storage_id}`) """ sub_account_id: int - code: None | str + """ Id of the sub-account of the object storage, the account at the storage that holds its buckets and IAM users + (not the account id of the storage) """ + code: int | None + """ Progressive number of the IAM user in the object storage """ code_full: None | str + """ Username of the IAM user on the storage """ iam_id: None | str + """ Id of the user in the IAM service of the storage """ arn: None | str + """ ARN (Amazon Resource Name) of the IAM user, used in the policies (`arn:aws:iam:::user/`) + """ active: bool | None - firewall_policy: None | str + """ Whether the IAM user is active: deleted users are not returned """ date_created: datetime.datetime | None additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -31,7 +41,7 @@ def to_dict(self) -> dict[str, Any]: sub_account_id = self.sub_account_id - code: None | str + code: int | None code = self.code code_full: None | str @@ -46,9 +56,6 @@ def to_dict(self) -> dict[str, Any]: active: bool | None active = self.active - firewall_policy: None | str - firewall_policy = self.firewall_policy - date_created: None | str if isinstance(self.date_created, datetime.datetime): date_created = self.date_created.isoformat() @@ -67,7 +74,6 @@ def to_dict(self) -> dict[str, Any]: "iam_id": iam_id, "arn": arn, "active": active, - "firewall_policy": firewall_policy, "date_created": date_created, } ) @@ -83,10 +89,10 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: sub_account_id = d.pop("sub_account_id") - def _parse_code(data: object) -> None | str: + def _parse_code(data: object) -> int | None: if data is None: return data - return cast(None | str, data) + return cast(int | None, data) code = _parse_code(d.pop("code")) @@ -118,13 +124,6 @@ def _parse_active(data: object) -> bool | None: active = _parse_active(d.pop("active")) - def _parse_firewall_policy(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - firewall_policy = _parse_firewall_policy(d.pop("firewall_policy")) - def _parse_date_created(data: object) -> datetime.datetime | None: if data is None: return data @@ -149,7 +148,6 @@ def _parse_date_created(data: object) -> datetime.datetime | None: iam_id=iam_id, arn=arn, active=active, - firewall_policy=firewall_policy, date_created=date_created, ) diff --git a/src/shellrent_sdk/client/models/object_storage_iam_user_paginated_list_response.py b/src/shellrent_sdk/client/models/object_storage_iam_user_paginated_list_response.py index 66eedf8..ee20188 100644 --- a/src/shellrent_sdk/client/models/object_storage_iam_user_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/object_storage_iam_user_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class ObjectStorageIamUserPaginatedListResponse: - error: int + """Successful response with a page of `ObjectStorageIamUser`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[ObjectStorageIamUser] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.pagination_meta import PaginationMeta d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/object_storage_iam_user_response.py b/src/shellrent_sdk/client/models/object_storage_iam_user_response.py index 8f59501..b375d4b 100644 --- a/src/shellrent_sdk/client/models/object_storage_iam_user_response.py +++ b/src/shellrent_sdk/client/models/object_storage_iam_user_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.object_storage_iam_user import ObjectStorageIamUser - from ..models.object_storage_iam_user_response_meta_type_0 import ( - ObjectStorageIamUserResponseMetaType0, - ) T = TypeVar("T", bound="ObjectStorageIamUserResponse") @@ -18,17 +15,19 @@ @_attrs_define class ObjectStorageIamUserResponse: - error: int + """Successful response with one `ObjectStorageIamUser`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: ObjectStorageIamUser - meta: None | ObjectStorageIamUserResponseMetaType0 + """ IAM user of an object storage: a user of the storage with its own S3 keys """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.object_storage_iam_user_response_meta_type_0 import ( - ObjectStorageIamUserResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, ObjectStorageIamUserResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -58,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.object_storage_iam_user import ObjectStorageIamUser - from ..models.object_storage_iam_user_response_meta_type_0 import ( - ObjectStorageIamUserResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -74,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = ObjectStorageIamUser.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | ObjectStorageIamUserResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = ObjectStorageIamUserResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | ObjectStorageIamUserResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") object_storage_iam_user_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/object_storage_iam_user_response_meta_type_0.py b/src/shellrent_sdk/client/models/object_storage_iam_user_response_meta_type_0.py deleted file mode 100644 index 992dd95..0000000 --- a/src/shellrent_sdk/client/models/object_storage_iam_user_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ObjectStorageIamUserResponseMetaType0") - - -@_attrs_define -class ObjectStorageIamUserResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - object_storage_iam_user_response_meta_type_0 = cls() - - object_storage_iam_user_response_meta_type_0.additional_properties = d - return object_storage_iam_user_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/object_storage_iam_user_s3_key.py b/src/shellrent_sdk/client/models/object_storage_iam_user_s3_key.py index 7f4959c..522b2e9 100644 --- a/src/shellrent_sdk/client/models/object_storage_iam_user_s3_key.py +++ b/src/shellrent_sdk/client/models/object_storage_iam_user_s3_key.py @@ -12,13 +12,22 @@ @_attrs_define class ObjectStorageIamUserS3Key: + """S3 key of an IAM user of an object storage""" + s3_key_id: int object_storage_id: int + """ Id of the object storage (`GET /api/v3/object-storages/{object_storage_id}`) """ iam_user_id: int + """ Id of the IAM user (`GET /api/v3/object-storages/{object_storage_id}/iam-users/{iam_user_id}`) """ access_key: None | str + """ Access key ID, to use with `secret_key` in the S3 clients """ secret_key: None | str + """ Secret of the S3 key; returned when the key is created and, afterwards, only with the objectstorage:secrets + scope (null otherwise) """ status: None | str + """ Status of the key in the IAM service of the storage, for example `Active` """ active: bool | None + """ Whether the key is active: deleted keys are not returned; its state on the storage is in `status` """ date_created: datetime.datetime | None additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) diff --git a/src/shellrent_sdk/client/models/object_storage_iam_user_s3_key_list_response.py b/src/shellrent_sdk/client/models/object_storage_iam_user_s3_key_list_response.py index e93276b..68ea271 100644 --- a/src/shellrent_sdk/client/models/object_storage_iam_user_s3_key_list_response.py +++ b/src/shellrent_sdk/client/models/object_storage_iam_user_s3_key_list_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.object_storage_iam_user_s3_key import ObjectStorageIamUserS3Key - from ..models.object_storage_iam_user_s3_key_list_response_meta_type_0 import ( - ObjectStorageIamUserS3KeyListResponseMetaType0, - ) T = TypeVar("T", bound="ObjectStorageIamUserS3KeyListResponse") @@ -18,17 +15,19 @@ @_attrs_define class ObjectStorageIamUserS3KeyListResponse: - error: int + """Successful response with a list of `ObjectStorageIamUserS3Key`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[ObjectStorageIamUserS3Key] - meta: None | ObjectStorageIamUserS3KeyListResponseMetaType0 + """ Items returned by the operation """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.object_storage_iam_user_s3_key_list_response_meta_type_0 import ( - ObjectStorageIamUserS3KeyListResponseMetaType0, - ) - error = self.error message: None | str @@ -39,11 +38,7 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - meta: dict[str, Any] | None - if isinstance(self.meta, ObjectStorageIamUserS3KeyListResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -63,12 +58,11 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.object_storage_iam_user_s3_key import ( ObjectStorageIamUserS3Key, ) - from ..models.object_storage_iam_user_s3_key_list_response_meta_type_0 import ( - ObjectStorageIamUserS3KeyListResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -84,20 +78,7 @@ def _parse_message(data: object) -> None | str: data.append(data_item) - def _parse_meta(data: object) -> None | ObjectStorageIamUserS3KeyListResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = ObjectStorageIamUserS3KeyListResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | ObjectStorageIamUserS3KeyListResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") object_storage_iam_user_s3_key_list_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/object_storage_iam_user_s3_key_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/object_storage_iam_user_s3_key_list_response_meta_type_0.py deleted file mode 100644 index 2922e3e..0000000 --- a/src/shellrent_sdk/client/models/object_storage_iam_user_s3_key_list_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ObjectStorageIamUserS3KeyListResponseMetaType0") - - -@_attrs_define -class ObjectStorageIamUserS3KeyListResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - object_storage_iam_user_s3_key_list_response_meta_type_0 = cls() - - object_storage_iam_user_s3_key_list_response_meta_type_0.additional_properties = d - return object_storage_iam_user_s3_key_list_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/object_storage_iam_user_s3_key_response.py b/src/shellrent_sdk/client/models/object_storage_iam_user_s3_key_response.py index 15485bd..4564412 100644 --- a/src/shellrent_sdk/client/models/object_storage_iam_user_s3_key_response.py +++ b/src/shellrent_sdk/client/models/object_storage_iam_user_s3_key_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.object_storage_iam_user_s3_key import ObjectStorageIamUserS3Key - from ..models.object_storage_iam_user_s3_key_response_meta_type_0 import ( - ObjectStorageIamUserS3KeyResponseMetaType0, - ) T = TypeVar("T", bound="ObjectStorageIamUserS3KeyResponse") @@ -18,17 +15,19 @@ @_attrs_define class ObjectStorageIamUserS3KeyResponse: - error: int + """Successful response with one `ObjectStorageIamUserS3Key`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: ObjectStorageIamUserS3Key - meta: None | ObjectStorageIamUserS3KeyResponseMetaType0 + """ S3 key of an IAM user of an object storage """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.object_storage_iam_user_s3_key_response_meta_type_0 import ( - ObjectStorageIamUserS3KeyResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, ObjectStorageIamUserS3KeyResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -60,12 +55,11 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.object_storage_iam_user_s3_key import ( ObjectStorageIamUserS3Key, ) - from ..models.object_storage_iam_user_s3_key_response_meta_type_0 import ( - ObjectStorageIamUserS3KeyResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -76,20 +70,7 @@ def _parse_message(data: object) -> None | str: data = ObjectStorageIamUserS3Key.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | ObjectStorageIamUserS3KeyResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = ObjectStorageIamUserS3KeyResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | ObjectStorageIamUserS3KeyResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") object_storage_iam_user_s3_key_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/object_storage_iam_user_s3_key_response_meta_type_0.py b/src/shellrent_sdk/client/models/object_storage_iam_user_s3_key_response_meta_type_0.py deleted file mode 100644 index fb8a26d..0000000 --- a/src/shellrent_sdk/client/models/object_storage_iam_user_s3_key_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ObjectStorageIamUserS3KeyResponseMetaType0") - - -@_attrs_define -class ObjectStorageIamUserS3KeyResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - object_storage_iam_user_s3_key_response_meta_type_0 = cls() - - object_storage_iam_user_s3_key_response_meta_type_0.additional_properties = d - return object_storage_iam_user_s3_key_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/object_storage_paginated_list_response.py b/src/shellrent_sdk/client/models/object_storage_paginated_list_response.py index 5a3bef5..dcb8cab 100644 --- a/src/shellrent_sdk/client/models/object_storage_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/object_storage_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class ObjectStoragePaginatedListResponse: - error: int + """Successful response with a page of `ObjectStorage`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[ObjectStorage] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.pagination_meta import PaginationMeta d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/object_storage_response.py b/src/shellrent_sdk/client/models/object_storage_response.py index 975ebac..ed53e49 100644 --- a/src/shellrent_sdk/client/models/object_storage_response.py +++ b/src/shellrent_sdk/client/models/object_storage_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.object_storage import ObjectStorage - from ..models.object_storage_response_meta_type_0 import ObjectStorageResponseMetaType0 T = TypeVar("T", bound="ObjectStorageResponse") @@ -16,15 +15,20 @@ @_attrs_define class ObjectStorageResponse: - error: int + """Successful response with one `ObjectStorage`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: ObjectStorage - meta: None | ObjectStorageResponseMetaType0 + """ S3-compatible object storage of the account, with the usage of all its buckets from the latest daily usage + data of the storage: a null figure means zero or not available yet """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.object_storage_response_meta_type_0 import ObjectStorageResponseMetaType0 - error = self.error message: None | str @@ -32,11 +36,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, ObjectStorageResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,12 +54,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.object_storage import ObjectStorage - from ..models.object_storage_response_meta_type_0 import ( - ObjectStorageResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -70,20 +69,7 @@ def _parse_message(data: object) -> None | str: data = ObjectStorage.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | ObjectStorageResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = ObjectStorageResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | ObjectStorageResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") object_storage_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/object_storage_response_meta_type_0.py b/src/shellrent_sdk/client/models/object_storage_response_meta_type_0.py deleted file mode 100644 index 158adb5..0000000 --- a/src/shellrent_sdk/client/models/object_storage_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ObjectStorageResponseMetaType0") - - -@_attrs_define -class ObjectStorageResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - object_storage_response_meta_type_0 = cls() - - object_storage_response_meta_type_0.additional_properties = d - return object_storage_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/object_storage_s3_key.py b/src/shellrent_sdk/client/models/object_storage_s3_key.py index ee22eb4..2437799 100644 --- a/src/shellrent_sdk/client/models/object_storage_s3_key.py +++ b/src/shellrent_sdk/client/models/object_storage_s3_key.py @@ -11,13 +11,24 @@ @_attrs_define class ObjectStorageS3Key: + """Main S3 key of an object storage: the key of the root user of its account at the storage, with the secret""" + object_storage_id: int + """ Id of the object storage (`GET /api/v3/object-storages/{object_storage_id}`) """ sub_account_id: int + """ Id of the sub-account of the object storage, the account at the storage that holds its buckets and IAM users + (not the account id of the storage) """ username: None | str + """ Name of the sub-account at the storage """ user_id: None | str + """ Id of the root user of the sub-account in the IAM service of the storage """ arn: None | str + """ ARN (Amazon Resource Name) of the root user of the sub-account, used in the policies + (`arn:aws:iam:::root`) """ access_key: None | str + """ Access key ID, to use with `secret_key` in the S3 clients; null if the sub-account has no key saved """ secret_key: None | str + """ Secret of the key; null if the sub-account has no key saved """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/object_storage_s3_key_response.py b/src/shellrent_sdk/client/models/object_storage_s3_key_response.py index 3e4f804..579e7f2 100644 --- a/src/shellrent_sdk/client/models/object_storage_s3_key_response.py +++ b/src/shellrent_sdk/client/models/object_storage_s3_key_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.object_storage_s3_key import ObjectStorageS3Key - from ..models.object_storage_s3_key_response_meta_type_0 import ( - ObjectStorageS3KeyResponseMetaType0, - ) T = TypeVar("T", bound="ObjectStorageS3KeyResponse") @@ -18,17 +15,20 @@ @_attrs_define class ObjectStorageS3KeyResponse: - error: int + """Successful response with one `ObjectStorageS3Key`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: ObjectStorageS3Key - meta: None | ObjectStorageS3KeyResponseMetaType0 + """ Main S3 key of an object storage: the key of the root user of its account at the storage, with the secret + """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.object_storage_s3_key_response_meta_type_0 import ( - ObjectStorageS3KeyResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +36,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, ObjectStorageS3KeyResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -58,12 +54,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.object_storage_s3_key import ObjectStorageS3Key - from ..models.object_storage_s3_key_response_meta_type_0 import ( - ObjectStorageS3KeyResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -74,20 +69,7 @@ def _parse_message(data: object) -> None | str: data = ObjectStorageS3Key.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | ObjectStorageS3KeyResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = ObjectStorageS3KeyResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | ObjectStorageS3KeyResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") object_storage_s3_key_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/object_storage_s3_key_response_meta_type_0.py b/src/shellrent_sdk/client/models/object_storage_s3_key_response_meta_type_0.py deleted file mode 100644 index d123335..0000000 --- a/src/shellrent_sdk/client/models/object_storage_s3_key_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ObjectStorageS3KeyResponseMetaType0") - - -@_attrs_define -class ObjectStorageS3KeyResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - object_storage_s3_key_response_meta_type_0 = cls() - - object_storage_s3_key_response_meta_type_0.additional_properties = d - return object_storage_s3_key_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/one_click.py b/src/shellrent_sdk/client/models/one_click.py index 10c4f08..6463e8e 100644 --- a/src/shellrent_sdk/client/models/one_click.py +++ b/src/shellrent_sdk/client/models/one_click.py @@ -7,21 +7,30 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset - T = TypeVar("T", bound="OneClick") @_attrs_define class OneClick: + """One-Click payment method: a card or an account saved by the customer, used for One-Click payments and automatic + renewals + + """ + one_click_id: int payment_method: str - description: str + """ Name of the payment method, in Italian, for example `Carta di credito` or `PayPal` """ + description: None | str + """ Description of the method: the name of the payment method followed by the card (brand, last digits and + expiry) or the email of the account """ method_type: None | str + """ Type of the method: `VISA`, `MASTERCARD`, `MAESTRO`, `AMERICAN_EXPRESS`, `PAYPAL`, `APPLEPAY`, `GOOGLEPAY`, + `AMAZONPAY` or `SATISPAY`; null when unknown """ creditcard_pan: None | str + """ Number of the card, masked or reduced to the last digits; null for the methods without a card """ date_expiry: datetime.date | None + """ Expiry of the method: the expiry of the card or, without a card, four years after the activation """ date_created: datetime.datetime - one_click_preference: list[OneClick] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -29,6 +38,7 @@ def to_dict(self) -> dict[str, Any]: payment_method = self.payment_method + description: None | str description = self.description method_type: None | str @@ -45,13 +55,6 @@ def to_dict(self) -> dict[str, Any]: date_created = self.date_created.isoformat() - one_click_preference: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.one_click_preference, Unset): - one_click_preference = [] - for one_click_preference_item_data in self.one_click_preference: - one_click_preference_item = one_click_preference_item_data.to_dict() - one_click_preference.append(one_click_preference_item) - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -65,8 +68,6 @@ def to_dict(self) -> dict[str, Any]: "date_created": date_created, } ) - if one_click_preference is not UNSET: - field_dict["one_click_preference"] = one_click_preference return field_dict @@ -77,7 +78,12 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: payment_method = d.pop("payment_method") - description = d.pop("description") + def _parse_description(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + description = _parse_description(d.pop("description")) def _parse_method_type(data: object) -> None | str: if data is None: @@ -110,15 +116,6 @@ def _parse_date_expiry(data: object) -> datetime.date | None: date_created = datetime.datetime.fromisoformat(d.pop("date_created")) - _one_click_preference = d.pop("one_click_preference", UNSET) - one_click_preference: list[OneClick] | Unset = UNSET - if _one_click_preference is not UNSET: - one_click_preference = [] - for one_click_preference_item_data in _one_click_preference: - one_click_preference_item = OneClick.from_dict(one_click_preference_item_data) - - one_click_preference.append(one_click_preference_item) - one_click = cls( one_click_id=one_click_id, payment_method=payment_method, @@ -127,7 +124,6 @@ def _parse_date_expiry(data: object) -> datetime.date | None: creditcard_pan=creditcard_pan, date_expiry=date_expiry, date_created=date_created, - one_click_preference=one_click_preference, ) one_click.additional_properties = d diff --git a/src/shellrent_sdk/client/models/one_click_autorenew.py b/src/shellrent_sdk/client/models/one_click_autorenew.py index 59b877a..6f5f907 100644 --- a/src/shellrent_sdk/client/models/one_click_autorenew.py +++ b/src/shellrent_sdk/client/models/one_click_autorenew.py @@ -15,7 +15,10 @@ @_attrs_define class OneClickAutorenew: + """Automatic renewal with One-Click payment, with the methods it uses""" + one_click_preference: list[OneClick] + """ Active One-Click methods, in the order in which the automatic payments try them until one is authorized """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/one_click_autorenew_response.py b/src/shellrent_sdk/client/models/one_click_autorenew_response.py index a3db0cf..1059fa4 100644 --- a/src/shellrent_sdk/client/models/one_click_autorenew_response.py +++ b/src/shellrent_sdk/client/models/one_click_autorenew_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.one_click_autorenew import OneClickAutorenew - from ..models.one_click_autorenew_response_meta_type_0 import OneClickAutorenewResponseMetaType0 T = TypeVar("T", bound="OneClickAutorenewResponse") @@ -16,17 +15,19 @@ @_attrs_define class OneClickAutorenewResponse: - error: int + """Successful response with one `OneClickAutorenew`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: OneClickAutorenew - meta: None | OneClickAutorenewResponseMetaType0 + """ Automatic renewal with One-Click payment, with the methods it uses """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.one_click_autorenew_response_meta_type_0 import ( - OneClickAutorenewResponseMetaType0, - ) - error = self.error message: None | str @@ -34,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, OneClickAutorenewResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -56,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.one_click_autorenew import OneClickAutorenew - from ..models.one_click_autorenew_response_meta_type_0 import ( - OneClickAutorenewResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -72,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = OneClickAutorenew.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | OneClickAutorenewResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = OneClickAutorenewResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | OneClickAutorenewResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") one_click_autorenew_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/one_click_autorenew_response_meta_type_0.py b/src/shellrent_sdk/client/models/one_click_autorenew_response_meta_type_0.py deleted file mode 100644 index e9c9f77..0000000 --- a/src/shellrent_sdk/client/models/one_click_autorenew_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="OneClickAutorenewResponseMetaType0") - - -@_attrs_define -class OneClickAutorenewResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - one_click_autorenew_response_meta_type_0 = cls() - - one_click_autorenew_response_meta_type_0.additional_properties = d - return one_click_autorenew_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/one_click_paginated_list_response.py b/src/shellrent_sdk/client/models/one_click_paginated_list_response.py index c948292..5295a02 100644 --- a/src/shellrent_sdk/client/models/one_click_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/one_click_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class OneClickPaginatedListResponse: - error: int + """Successful response with a page of `OneClick`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[OneClick] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.pagination_meta import PaginationMeta d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/one_click_payment_create_request.py b/src/shellrent_sdk/client/models/one_click_payment_create_request.py new file mode 100644 index 0000000..f4b6fee --- /dev/null +++ b/src/shellrent_sdk/client/models/one_click_payment_create_request.py @@ -0,0 +1,52 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Self, TypeVar, cast + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="OneClickPaymentCreateRequest") + + +@_attrs_define +class OneClickPaymentCreateRequest: + """Pays one or more orders together with a One-Click payment method, in a single attempt""" + + order_ids: list[int] + """ IDs of the orders to pay together """ + one_click_id: int | Unset = UNSET + """ The One-Click payment method to use. Without it, the default one: the first active method, in the order + chosen by the customer. Only that method is tried """ + + def to_dict(self) -> dict[str, Any]: + order_ids = self.order_ids + + one_click_id = self.one_click_id + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "order_ids": order_ids, + } + ) + if one_click_id is not UNSET: + field_dict["one_click_id"] = one_click_id + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + order_ids = cast(list[int], d.pop("order_ids")) + + one_click_id = d.pop("one_click_id", UNSET) + + one_click_payment_create_request = cls( + order_ids=order_ids, + one_click_id=one_click_id, + ) + + return one_click_payment_create_request diff --git a/src/shellrent_sdk/client/models/one_click_response.py b/src/shellrent_sdk/client/models/one_click_response.py index 2e8ddef..f442a67 100644 --- a/src/shellrent_sdk/client/models/one_click_response.py +++ b/src/shellrent_sdk/client/models/one_click_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.one_click import OneClick - from ..models.one_click_response_meta_type_0 import OneClickResponseMetaType0 T = TypeVar("T", bound="OneClickResponse") @@ -16,15 +15,20 @@ @_attrs_define class OneClickResponse: - error: int + """Successful response with one `OneClick`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: OneClick - meta: None | OneClickResponseMetaType0 + """ One-Click payment method: a card or an account saved by the customer, used for One-Click payments and + automatic renewals """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.one_click_response_meta_type_0 import OneClickResponseMetaType0 - error = self.error message: None | str @@ -32,11 +36,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, OneClickResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,12 +54,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.one_click import OneClick - from ..models.one_click_response_meta_type_0 import ( - OneClickResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -70,20 +69,7 @@ def _parse_message(data: object) -> None | str: data = OneClick.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | OneClickResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = OneClickResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | OneClickResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") one_click_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/one_click_response_meta_type_0.py b/src/shellrent_sdk/client/models/one_click_response_meta_type_0.py deleted file mode 100644 index db8a1e4..0000000 --- a/src/shellrent_sdk/client/models/one_click_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="OneClickResponseMetaType0") - - -@_attrs_define -class OneClickResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - one_click_response_meta_type_0 = cls() - - one_click_response_meta_type_0.additional_properties = d - return one_click_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/order.py b/src/shellrent_sdk/client/models/order.py index 5364f91..22d746e 100644 --- a/src/shellrent_sdk/client/models/order.py +++ b/src/shellrent_sdk/client/models/order.py @@ -22,22 +22,44 @@ @_attrs_define class Order: + """Order of the account, with its statuses, amounts and invoice""" + order_id: int type_: str + """ Type of the order: `P` (purchase), `R` (renewal) or `U` (update) """ status: OrderStatus + """ Processing status of an order """ payment_status: OrderPaymentStatus + """ Payment status of an order """ invoice_status: OrderInvoiceStatus + """ Invoicing status of an order """ invoice: Invoice | None + """ Invoice of the order; null while the order is not invoiced """ billing: AccountBilling + """ Billing profile: the holder the documents are made out to, with its tax and electronic invoicing data """ intent_type: str + """ Intent of the order: `DEFAULT`, `DEPOSIT` (top-up of the prepaid credit) or `BALANCE` (paid with the prepaid + credit) """ date_payed: datetime.date | None + """ Date on which the order was fully paid; null while it is not """ date_confirmed: datetime.datetime | None + """ When the order was confirmed with deferred payment, to be paid later; null otherwise """ payed: bool + """ Whether the order is fully paid """ total_amount: Amount + """ Amount in euros: the taxable amount and, when computed with a tax regime, the VAT rate, the VAT and the + total, which are null otherwise """ payment_amount: Amount + """ Amount in euros: the taxable amount and, when computed with a tax regime, the VAT rate, the VAT and the + total, which are null otherwise """ origin: str + """ Where the order was created: `web` (control panel or cart), `api` (this API), `api2` (API v2) or `cli` + (automatic procedures, such as the renewals) """ promotions: list[Promotion] + """ Promotions applied to the rows of the order; those that increase the price are shown only to administrators + """ rows_count: int + """ Number of rows of the order (`GET /api/v3/orders/{order_id}/rows`) """ date_created: datetime.datetime additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) diff --git a/src/shellrent_sdk/client/models/order_can_cancel.py b/src/shellrent_sdk/client/models/order_can_cancel.py index 8f47354..380aeee 100644 --- a/src/shellrent_sdk/client/models/order_can_cancel.py +++ b/src/shellrent_sdk/client/models/order_can_cancel.py @@ -11,8 +11,13 @@ @_attrs_define class OrderCanCancel: + """Whether an order can be cancelled""" + order_id: int + """ Id of the order (`GET /api/v3/orders/{order_id}`) """ can_cancel: bool + """ Whether the order can be cancelled with `DELETE /api/v3/orders/{order_id}`: not when it is completed, closed + or cancelled, or when one of its purchases does not allow it """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/order_can_cancel_response.py b/src/shellrent_sdk/client/models/order_can_cancel_response.py index 91e6bee..69ab3a6 100644 --- a/src/shellrent_sdk/client/models/order_can_cancel_response.py +++ b/src/shellrent_sdk/client/models/order_can_cancel_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.order_can_cancel import OrderCanCancel - from ..models.order_can_cancel_response_meta_type_0 import OrderCanCancelResponseMetaType0 T = TypeVar("T", bound="OrderCanCancelResponse") @@ -16,15 +15,19 @@ @_attrs_define class OrderCanCancelResponse: - error: int + """Successful response with one `OrderCanCancel`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: OrderCanCancel - meta: None | OrderCanCancelResponseMetaType0 + """ Whether an order can be cancelled """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.order_can_cancel_response_meta_type_0 import OrderCanCancelResponseMetaType0 - error = self.error message: None | str @@ -32,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, OrderCanCancelResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.order_can_cancel import OrderCanCancel - from ..models.order_can_cancel_response_meta_type_0 import ( - OrderCanCancelResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -70,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = OrderCanCancel.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | OrderCanCancelResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = OrderCanCancelResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | OrderCanCancelResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") order_can_cancel_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/order_can_cancel_response_meta_type_0.py b/src/shellrent_sdk/client/models/order_can_cancel_response_meta_type_0.py deleted file mode 100644 index af87371..0000000 --- a/src/shellrent_sdk/client/models/order_can_cancel_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="OrderCanCancelResponseMetaType0") - - -@_attrs_define -class OrderCanCancelResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - order_can_cancel_response_meta_type_0 = cls() - - order_can_cancel_response_meta_type_0.additional_properties = d - return order_can_cancel_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/order_can_pay.py b/src/shellrent_sdk/client/models/order_can_pay.py index a72978d..864dd1b 100644 --- a/src/shellrent_sdk/client/models/order_can_pay.py +++ b/src/shellrent_sdk/client/models/order_can_pay.py @@ -1,13 +1,11 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar +from typing import TYPE_CHECKING, Any, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset - if TYPE_CHECKING: from ..models.amount_simple import AmountSimple from ..models.order import Order @@ -18,40 +16,49 @@ @_attrs_define class OrderCanPay: + """Whether an order can be paid, with the orders to pay together with it""" + order_id: int + """ Id of the order (`GET /api/v3/orders/{order_id}`) """ + amount: AmountSimple | None + """ Amount to pay with the payment method of the request, the commission of the method included; null when the + order cannot be paid with it """ + orders: list[Order] + """ Orders paid together with this one; empty when the order cannot be paid """ can_pay: bool - amount: AmountSimple | Unset = UNSET - orders: list[Order] | Unset = UNSET + """ Whether the order can be paid now with the payment method of the request, together with the orders in + `orders`: the One-Click method is active and not expired, the prepaid credit can be used for these orders and is + enough """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - order_id = self.order_id + from ..models.amount_simple import AmountSimple - can_pay = self.can_pay + order_id = self.order_id - amount: dict[str, Any] | Unset = UNSET - if not isinstance(self.amount, Unset): + amount: dict[str, Any] | None + if isinstance(self.amount, AmountSimple): amount = self.amount.to_dict() + else: + amount = self.amount + + orders = [] + for orders_item_data in self.orders: + orders_item = orders_item_data.to_dict() + orders.append(orders_item) - orders: list[dict[str, Any]] | Unset = UNSET - if not isinstance(self.orders, Unset): - orders = [] - for orders_item_data in self.orders: - orders_item = orders_item_data.to_dict() - orders.append(orders_item) + can_pay = self.can_pay field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( { "order_id": order_id, + "amount": amount, + "orders": orders, "can_pay": can_pay, } ) - if amount is not UNSET: - field_dict["amount"] = amount - if orders is not UNSET: - field_dict["orders"] = orders return field_dict @@ -63,29 +70,35 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) order_id = d.pop("order_id") - can_pay = d.pop("can_pay") + def _parse_amount(data: object) -> AmountSimple | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + amount_type_0 = AmountSimple.from_dict(data) - _amount = d.pop("amount", UNSET) - amount: AmountSimple | Unset - if isinstance(_amount, Unset): - amount = UNSET - else: - amount = AmountSimple.from_dict(_amount) + return amount_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(AmountSimple | None, data) + + amount = _parse_amount(d.pop("amount")) - _orders = d.pop("orders", UNSET) - orders: list[Order] | Unset = UNSET - if _orders is not UNSET: - orders = [] - for orders_item_data in _orders: - orders_item = Order.from_dict(orders_item_data) + orders = [] + _orders = d.pop("orders") + for orders_item_data in _orders: + orders_item = Order.from_dict(orders_item_data) - orders.append(orders_item) + orders.append(orders_item) + + can_pay = d.pop("can_pay") order_can_pay = cls( order_id=order_id, - can_pay=can_pay, amount=amount, orders=orders, + can_pay=can_pay, ) order_can_pay.additional_properties = d diff --git a/src/shellrent_sdk/client/models/order_can_pay_response.py b/src/shellrent_sdk/client/models/order_can_pay_response.py index b6c46cc..2999332 100644 --- a/src/shellrent_sdk/client/models/order_can_pay_response.py +++ b/src/shellrent_sdk/client/models/order_can_pay_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.order_can_pay import OrderCanPay - from ..models.order_can_pay_response_meta_type_0 import OrderCanPayResponseMetaType0 T = TypeVar("T", bound="OrderCanPayResponse") @@ -16,15 +15,19 @@ @_attrs_define class OrderCanPayResponse: - error: int + """Successful response with one `OrderCanPay`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: OrderCanPay - meta: None | OrderCanPayResponseMetaType0 + """ Whether an order can be paid, with the orders to pay together with it """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.order_can_pay_response_meta_type_0 import OrderCanPayResponseMetaType0 - error = self.error message: None | str @@ -32,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, OrderCanPayResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.order_can_pay import OrderCanPay - from ..models.order_can_pay_response_meta_type_0 import ( - OrderCanPayResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -70,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = OrderCanPay.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | OrderCanPayResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = OrderCanPayResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | OrderCanPayResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") order_can_pay_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/order_can_pay_response_meta_type_0.py b/src/shellrent_sdk/client/models/order_can_pay_response_meta_type_0.py deleted file mode 100644 index 5cdbf66..0000000 --- a/src/shellrent_sdk/client/models/order_can_pay_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="OrderCanPayResponseMetaType0") - - -@_attrs_define -class OrderCanPayResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - order_can_pay_response_meta_type_0 = cls() - - order_can_pay_response_meta_type_0.additional_properties = d - return order_can_pay_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/order_invoice_status.py b/src/shellrent_sdk/client/models/order_invoice_status.py index 9cc53af..e562e0c 100644 --- a/src/shellrent_sdk/client/models/order_invoice_status.py +++ b/src/shellrent_sdk/client/models/order_invoice_status.py @@ -11,8 +11,13 @@ @_attrs_define class OrderInvoiceStatus: + """Invoicing status of an order""" + status_code: str + """ One of `UNKNOWN`, `EVALUATION`, `NO_INVOICE` (not to be invoiced), `READY`, `PROCESSING`, `TO_INVOICE`, + `INVOICING` or `INVOICED` """ status_name: str + """ Name of the status, in Italian """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/order_list_response.py b/src/shellrent_sdk/client/models/order_list_response.py index 01a0c0a..18352f7 100644 --- a/src/shellrent_sdk/client/models/order_list_response.py +++ b/src/shellrent_sdk/client/models/order_list_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.order import Order - from ..models.order_list_response_meta_type_0 import OrderListResponseMetaType0 T = TypeVar("T", bound="OrderListResponse") @@ -16,15 +15,19 @@ @_attrs_define class OrderListResponse: - error: int + """Successful response with a list of `Order`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[Order] - meta: None | OrderListResponseMetaType0 + """ Items returned by the operation """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.order_list_response_meta_type_0 import OrderListResponseMetaType0 - error = self.error message: None | str @@ -35,11 +38,7 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - meta: dict[str, Any] | None - if isinstance(self.meta, OrderListResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -57,12 +56,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.order import Order - from ..models.order_list_response_meta_type_0 import ( - OrderListResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -78,20 +76,7 @@ def _parse_message(data: object) -> None | str: data.append(data_item) - def _parse_meta(data: object) -> None | OrderListResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = OrderListResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | OrderListResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") order_list_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/order_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/order_list_response_meta_type_0.py deleted file mode 100644 index e4649c1..0000000 --- a/src/shellrent_sdk/client/models/order_list_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="OrderListResponseMetaType0") - - -@_attrs_define -class OrderListResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - order_list_response_meta_type_0 = cls() - - order_list_response_meta_type_0.additional_properties = d - return order_list_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/order_paginated_list_response.py b/src/shellrent_sdk/client/models/order_paginated_list_response.py index 5baa4f1..1a5a9bf 100644 --- a/src/shellrent_sdk/client/models/order_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/order_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class OrderPaginatedListResponse: - error: int + """Successful response with a page of `Order`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[Order] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.pagination_meta import PaginationMeta d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/order_pay_request.py b/src/shellrent_sdk/client/models/order_pay_request.py deleted file mode 100644 index 3301f8c..0000000 --- a/src/shellrent_sdk/client/models/order_pay_request.py +++ /dev/null @@ -1,98 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="OrderPayRequest") - - -@_attrs_define -class OrderPayRequest: - """Pays one or more orders. The payment mode is chosen by three fields, evaluated in this order: 1) use_prepaid_credit - set to true: pays with the available Prepaid Credit; 2) use_one_click set to true: tries the saved One-Click payment - methods in priority order until one is successfully authorized; 3) one_click_id: pays with that specific One-Click - payment method. Provide one of them: if more are provided, only the first one in this order is used. If none is - provided the request fails, unless the amount to pay is zero: in that case no payment mode is needed. - - """ - - order_ids: list[int] - """ IDs of the orders to be paid (1 ID or more order IDs to pay together) """ - use_prepaid_credit: bool | Unset = UNSET - """ Payment mode 1: set to true to pay with the available Prepaid Credit. Takes precedence over use_one_click - and one_click_id. """ - use_one_click: bool | Unset = UNSET - """ Payment mode 2: set to true to use the saved One-Click payment methods. Payment will be attempted using - saved methods in priority order until one is successfully authorized. Ignored if use_prepaid_credit is true; - takes precedence over one_click_id. """ - one_click_id: int | Unset = UNSET - """ Payment mode 3: identifier of the One-Click payment method to use, to pay only with that specific method. - Ignored if use_prepaid_credit or use_one_click is true. """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - order_ids = self.order_ids - - use_prepaid_credit = self.use_prepaid_credit - - use_one_click = self.use_one_click - - one_click_id = self.one_click_id - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "order_ids": order_ids, - } - ) - if use_prepaid_credit is not UNSET: - field_dict["use_prepaid_credit"] = use_prepaid_credit - if use_one_click is not UNSET: - field_dict["use_one_click"] = use_one_click - if one_click_id is not UNSET: - field_dict["one_click_id"] = one_click_id - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - order_ids = cast(list[int], d.pop("order_ids")) - - use_prepaid_credit = d.pop("use_prepaid_credit", UNSET) - - use_one_click = d.pop("use_one_click", UNSET) - - one_click_id = d.pop("one_click_id", UNSET) - - order_pay_request = cls( - order_ids=order_ids, - use_prepaid_credit=use_prepaid_credit, - use_one_click=use_one_click, - one_click_id=one_click_id, - ) - - order_pay_request.additional_properties = d - return order_pay_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/order_payment_status.py b/src/shellrent_sdk/client/models/order_payment_status.py index 18deb8b..7ac2cac 100644 --- a/src/shellrent_sdk/client/models/order_payment_status.py +++ b/src/shellrent_sdk/client/models/order_payment_status.py @@ -11,8 +11,12 @@ @_attrs_define class OrderPaymentStatus: + """Payment status of an order""" + status_code: str + """ One of `NOT_PAYED`, `PARTIALLY_PAYED` or `PAYED` """ status_name: str + """ Name of the status, in Italian """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/order_response.py b/src/shellrent_sdk/client/models/order_response.py index dab83ba..2060e0c 100644 --- a/src/shellrent_sdk/client/models/order_response.py +++ b/src/shellrent_sdk/client/models/order_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.order import Order - from ..models.order_response_meta_type_0 import OrderResponseMetaType0 T = TypeVar("T", bound="OrderResponse") @@ -16,15 +15,19 @@ @_attrs_define class OrderResponse: - error: int + """Successful response with one `Order`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: Order - meta: None | OrderResponseMetaType0 + """ Order of the account, with its statuses, amounts and invoice """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.order_response_meta_type_0 import OrderResponseMetaType0 - error = self.error message: None | str @@ -32,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, OrderResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,10 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.order import Order - from ..models.order_response_meta_type_0 import OrderResponseMetaType0 d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -68,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = Order.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | OrderResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = OrderResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | OrderResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") order_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/order_response_meta_type_0.py b/src/shellrent_sdk/client/models/order_response_meta_type_0.py deleted file mode 100644 index 4844c0d..0000000 --- a/src/shellrent_sdk/client/models/order_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="OrderResponseMetaType0") - - -@_attrs_define -class OrderResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - order_response_meta_type_0 = cls() - - order_response_meta_type_0.additional_properties = d - return order_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/order_row.py b/src/shellrent_sdk/client/models/order_row.py index afb1b1d..f773673 100644 --- a/src/shellrent_sdk/client/models/order_row.py +++ b/src/shellrent_sdk/client/models/order_row.py @@ -15,13 +15,23 @@ @_attrs_define class OrderRow: + """Row of an order: a service of a purchase, with its price""" + order_row_id: int order_id: int + """ Id of the order (`GET /api/v3/orders/{order_id}`) """ service: int | None + """ Id of the service ordered (`service_id` of `Service`) """ purchase: int | None + """ Id of the purchase (`GET /api/v3/purchases/{purchase_id}`) """ recurrence: int | None + """ Id of the recurrence, the billing period of the row (`recurrence_id` of `Recurrence`) """ price: Amount + """ Amount in euros: the taxable amount and, when computed with a tax regime, the VAT rate, the VAT and the + total, which are null otherwise """ base_price: Amount + """ Amount in euros: the taxable amount and, when computed with a tax regime, the VAT rate, the VAT and the + total, which are null otherwise """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/order_row_list_response.py b/src/shellrent_sdk/client/models/order_row_list_response.py index 26fd864..cd04d2b 100644 --- a/src/shellrent_sdk/client/models/order_row_list_response.py +++ b/src/shellrent_sdk/client/models/order_row_list_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.order_row import OrderRow - from ..models.order_row_list_response_meta_type_0 import OrderRowListResponseMetaType0 T = TypeVar("T", bound="OrderRowListResponse") @@ -16,15 +15,19 @@ @_attrs_define class OrderRowListResponse: - error: int + """Successful response with a list of `OrderRow`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[OrderRow] - meta: None | OrderRowListResponseMetaType0 + """ Items returned by the operation """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.order_row_list_response_meta_type_0 import OrderRowListResponseMetaType0 - error = self.error message: None | str @@ -35,11 +38,7 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - meta: dict[str, Any] | None - if isinstance(self.meta, OrderRowListResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -57,12 +56,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.order_row import OrderRow - from ..models.order_row_list_response_meta_type_0 import ( - OrderRowListResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -78,20 +76,7 @@ def _parse_message(data: object) -> None | str: data.append(data_item) - def _parse_meta(data: object) -> None | OrderRowListResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = OrderRowListResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | OrderRowListResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") order_row_list_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/order_row_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/order_row_list_response_meta_type_0.py deleted file mode 100644 index fe8575f..0000000 --- a/src/shellrent_sdk/client/models/order_row_list_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="OrderRowListResponseMetaType0") - - -@_attrs_define -class OrderRowListResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - order_row_list_response_meta_type_0 = cls() - - order_row_list_response_meta_type_0.additional_properties = d - return order_row_list_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/order_row_response.py b/src/shellrent_sdk/client/models/order_row_response.py index f677a9b..5845f4f 100644 --- a/src/shellrent_sdk/client/models/order_row_response.py +++ b/src/shellrent_sdk/client/models/order_row_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.order_row import OrderRow - from ..models.order_row_response_meta_type_0 import OrderRowResponseMetaType0 T = TypeVar("T", bound="OrderRowResponse") @@ -16,15 +15,19 @@ @_attrs_define class OrderRowResponse: - error: int + """Successful response with one `OrderRow`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: OrderRow - meta: None | OrderRowResponseMetaType0 + """ Row of an order: a service of a purchase, with its price """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.order_row_response_meta_type_0 import OrderRowResponseMetaType0 - error = self.error message: None | str @@ -32,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, OrderRowResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.order_row import OrderRow - from ..models.order_row_response_meta_type_0 import ( - OrderRowResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -70,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = OrderRow.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | OrderRowResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = OrderRowResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | OrderRowResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") order_row_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/order_row_response_meta_type_0.py b/src/shellrent_sdk/client/models/order_row_response_meta_type_0.py deleted file mode 100644 index 591809a..0000000 --- a/src/shellrent_sdk/client/models/order_row_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="OrderRowResponseMetaType0") - - -@_attrs_define -class OrderRowResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - order_row_response_meta_type_0 = cls() - - order_row_response_meta_type_0.additional_properties = d - return order_row_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/order_status.py b/src/shellrent_sdk/client/models/order_status.py index 8b22f80..7568785 100644 --- a/src/shellrent_sdk/client/models/order_status.py +++ b/src/shellrent_sdk/client/models/order_status.py @@ -11,8 +11,12 @@ @_attrs_define class OrderStatus: + """Processing status of an order""" + status_code: str + """ One of `NEW`, `TO_MANAGE` (to be processed), `EMITTED` (completed), `CANCELED` or `CLOSED` """ status_name: str + """ Name of the status shown to the customer, in Italian """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/pagination_meta.py b/src/shellrent_sdk/client/models/pagination_meta.py index 8bd57f4..1c4181a 100644 --- a/src/shellrent_sdk/client/models/pagination_meta.py +++ b/src/shellrent_sdk/client/models/pagination_meta.py @@ -11,11 +11,18 @@ @_attrs_define class PaginationMeta: + """Pagination of a list, with the totals""" + total: int + """ Number of items in the whole list """ count: int + """ Number of items in this page: 0 beyond the last page """ pages: int + """ Number of pages of the list """ page: int + """ Number of this page, starting from 1 """ per_page: int + """ Maximum number of items in a page """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/pay_orders_response_200.py b/src/shellrent_sdk/client/models/pay_orders_response_200.py deleted file mode 100644 index 355df4a..0000000 --- a/src/shellrent_sdk/client/models/pay_orders_response_200.py +++ /dev/null @@ -1,133 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.pay_orders_response_200_meta_type_0 import PayOrdersResponse200MetaType0 - from ..models.payment import Payment - - -T = TypeVar("T", bound="PayOrdersResponse200") - - -@_attrs_define -class PayOrdersResponse200: - error: int - message: None | str - data: None | Payment - """ Payment data, null when there is nothing to pay (total amount to pay = 0.00) """ - meta: None | PayOrdersResponse200MetaType0 - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.pay_orders_response_200_meta_type_0 import ( - PayOrdersResponse200MetaType0, - ) - from ..models.payment import Payment - - error = self.error - - message: None | str - message = self.message - - data: dict[str, Any] | None - if isinstance(self.data, Payment): - data = self.data.to_dict() - else: - data = self.data - - meta: dict[str, Any] | None - if isinstance(self.meta, PayOrdersResponse200MetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "error": error, - "message": message, - "data": data, - "meta": meta, - } - ) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.pay_orders_response_200_meta_type_0 import ( - PayOrdersResponse200MetaType0, - ) - from ..models.payment import Payment - - d = dict(src_dict) - error = d.pop("error") - - def _parse_message(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - message = _parse_message(d.pop("message")) - - def _parse_data(data: object) -> None | Payment: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - data_type_0 = Payment.from_dict(data) - - return data_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | Payment, data) - - data = _parse_data(d.pop("data")) - - def _parse_meta(data: object) -> None | PayOrdersResponse200MetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = PayOrdersResponse200MetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | PayOrdersResponse200MetaType0, data) - - meta = _parse_meta(d.pop("meta")) - - pay_orders_response_200 = cls( - error=error, - message=message, - data=data, - meta=meta, - ) - - pay_orders_response_200.additional_properties = d - return pay_orders_response_200 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/pay_orders_response_200_meta_type_0.py b/src/shellrent_sdk/client/models/pay_orders_response_200_meta_type_0.py deleted file mode 100644 index ebfbcc4..0000000 --- a/src/shellrent_sdk/client/models/pay_orders_response_200_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="PayOrdersResponse200MetaType0") - - -@_attrs_define -class PayOrdersResponse200MetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - pay_orders_response_200_meta_type_0 = cls() - - pay_orders_response_200_meta_type_0.additional_properties = d - return pay_orders_response_200_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/payment.py b/src/shellrent_sdk/client/models/payment.py index c190565..806a1c1 100644 --- a/src/shellrent_sdk/client/models/payment.py +++ b/src/shellrent_sdk/client/models/payment.py @@ -9,7 +9,7 @@ if TYPE_CHECKING: from ..models.amount_simple import AmountSimple - from ..models.payment_provider_data_type_0 import PaymentProviderDataType0 + from ..models.payment_provider_data import PaymentProviderData from ..models.prepaid_credit_operation import PrepaidCreditOperation @@ -18,19 +18,31 @@ @_attrs_define class Payment: + """Payment of one or more orders, with the data of the payment provider""" + payment_id: int payment_method: str + """ Name of the payment method, in Italian, for example `Carta di credito` or `Bonifico Bancario` """ payment_code: str + """ Unique code of the payment: `SR` followed by letters and digits, to write in the reason of a bank transfer + """ amount_total: AmountSimple + """ Amount in euros, without the VAT details of `Amount` """ amount_payed: AmountSimple + """ Amount in euros, without the VAT details of `Amount` """ date_payment: datetime.datetime | None + """ When the payment was made (the latest paid attempt); null when nothing has been paid """ payed: bool + """ Whether the payment is complete: `amount_payed` reaches `amount_total` """ prepaid_credit_operations: list[PrepaidCreditOperation] - provider_data: None | PaymentProviderDataType0 + """ Uses of the prepaid credit made by the payment; empty unless the payment is with the prepaid credit """ + provider_data: None | PaymentProviderData + """ Data of the payment provider, from the paid attempt or the latest one; null when the payment has no attempts + """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.payment_provider_data_type_0 import PaymentProviderDataType0 + from ..models.payment_provider_data import PaymentProviderData payment_id = self.payment_id @@ -56,7 +68,7 @@ def to_dict(self) -> dict[str, Any]: prepaid_credit_operations.append(prepaid_credit_operations_item) provider_data: dict[str, Any] | None - if isinstance(self.provider_data, PaymentProviderDataType0): + if isinstance(self.provider_data, PaymentProviderData): provider_data = self.provider_data.to_dict() else: provider_data = self.provider_data @@ -82,7 +94,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.amount_simple import AmountSimple - from ..models.payment_provider_data_type_0 import PaymentProviderDataType0 + from ..models.payment_provider_data import PaymentProviderData from ..models.prepaid_credit_operation import PrepaidCreditOperation d = dict(src_dict) @@ -122,18 +134,18 @@ def _parse_date_payment(data: object) -> datetime.datetime | None: prepaid_credit_operations.append(prepaid_credit_operations_item) - def _parse_provider_data(data: object) -> None | PaymentProviderDataType0: + def _parse_provider_data(data: object) -> None | PaymentProviderData: if data is None: return data try: if not isinstance(data, dict): raise TypeError() - provider_data_type_0 = PaymentProviderDataType0.from_dict(data) + provider_data_type_0 = PaymentProviderData.from_dict(data) return provider_data_type_0 except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | PaymentProviderDataType0, data) + return cast(None | PaymentProviderData, data) provider_data = _parse_provider_data(d.pop("provider_data")) diff --git a/src/shellrent_sdk/client/models/payment_paginated_list_response.py b/src/shellrent_sdk/client/models/payment_paginated_list_response.py index bdb3047..b883b7f 100644 --- a/src/shellrent_sdk/client/models/payment_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/payment_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class PaymentPaginatedListResponse: - error: int + """Successful response with a page of `Payment`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[Payment] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.payment import Payment d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/payment_provider_data.py b/src/shellrent_sdk/client/models/payment_provider_data.py new file mode 100644 index 0000000..36ddaa6 --- /dev/null +++ b/src/shellrent_sdk/client/models/payment_provider_data.py @@ -0,0 +1,336 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import Any, Self, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="PaymentProviderData") + + +@_attrs_define +class PaymentProviderData: + """Data of an attempt of the payment, as given by the payment provider: which fields are set, and their format, depend + on the provider + + """ + + payed: bool | None + """ Whether the attempt was paid """ + authorization_token: None | str + """ Id of the authorization or of the order at the provider """ + authorization_code: None | str + """ Authorization code of the transaction at the provider """ + status: None | str + """ Status of the attempt at the provider, for example `OK` or `COMPLETED` """ + status_code: None | str + """ Result code of the provider, for example `0` or `DECLINED`; `THRESHOLD_EXCEEDED` when the attempt was + refused for the payment limits """ + message: None | str + """ Message of the provider about the result """ + payer_name: None | str + """ First name of the payer, as given by the provider """ + payer_surname: None | str + """ Surname of the payer, as given by the provider """ + payer_email: None | str + """ Email address of the payer, as given by the provider """ + bank_issuer: None | str + """ Bank of the payer: the issuer of the card or the bank of the transfer """ + creditcard_pan: None | str + """ Number of the card, masked or reduced to the last digits """ + creditcard_issuer: None | str + """ Brand of the card, for example `VISA`, `MASTERCARD` or `AMEX` """ + creditcard_expiration: None | str + """ Expiry of the card as `YYYY-MM-DD`, the last day of its month; for the methods without a card, the expiry + set for the authorization """ + region: None | str + """ Area of the card or of the payment, for example `EUROPE` or `SEPA` """ + transaction_type: None | str + """ Type of the transaction at the provider, for example `NO_3DSECURE`, `DEBIT` or `TRF` (transfer) """ + payment_type: None | str + """ Type of the payment at the provider, for example `PAYMENT_METHOD_TOKEN` or `CARD`; `Storno` for a payment + created by the cancellation of another one """ + payment_date: datetime.datetime | None + """ When the transaction took place at the provider """ + product_type: None | str + """ Product of the card as given by the provider, for example `VISA` """ + nationality: None | str + """ Country of the card or of the payer, as an ISO 3166-1 alpha-2 or alpha-3 code depending on the provider """ + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + payed: bool | None + payed = self.payed + + authorization_token: None | str + authorization_token = self.authorization_token + + authorization_code: None | str + authorization_code = self.authorization_code + + status: None | str + status = self.status + + status_code: None | str + status_code = self.status_code + + message: None | str + message = self.message + + payer_name: None | str + payer_name = self.payer_name + + payer_surname: None | str + payer_surname = self.payer_surname + + payer_email: None | str + payer_email = self.payer_email + + bank_issuer: None | str + bank_issuer = self.bank_issuer + + creditcard_pan: None | str + creditcard_pan = self.creditcard_pan + + creditcard_issuer: None | str + creditcard_issuer = self.creditcard_issuer + + creditcard_expiration: None | str + creditcard_expiration = self.creditcard_expiration + + region: None | str + region = self.region + + transaction_type: None | str + transaction_type = self.transaction_type + + payment_type: None | str + payment_type = self.payment_type + + payment_date: None | str + if isinstance(self.payment_date, datetime.datetime): + payment_date = self.payment_date.isoformat() + else: + payment_date = self.payment_date + + product_type: None | str + product_type = self.product_type + + nationality: None | str + nationality = self.nationality + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "payed": payed, + "authorization_token": authorization_token, + "authorization_code": authorization_code, + "status": status, + "status_code": status_code, + "message": message, + "payer_name": payer_name, + "payer_surname": payer_surname, + "payer_email": payer_email, + "bank_issuer": bank_issuer, + "creditcard_pan": creditcard_pan, + "creditcard_issuer": creditcard_issuer, + "creditcard_expiration": creditcard_expiration, + "region": region, + "transaction_type": transaction_type, + "payment_type": payment_type, + "payment_date": payment_date, + "product_type": product_type, + "nationality": nationality, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + + def _parse_payed(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) + + payed = _parse_payed(d.pop("payed")) + + def _parse_authorization_token(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + authorization_token = _parse_authorization_token(d.pop("authorization_token")) + + def _parse_authorization_code(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + authorization_code = _parse_authorization_code(d.pop("authorization_code")) + + def _parse_status(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + status = _parse_status(d.pop("status")) + + def _parse_status_code(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + status_code = _parse_status_code(d.pop("status_code")) + + def _parse_message(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + message = _parse_message(d.pop("message")) + + def _parse_payer_name(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + payer_name = _parse_payer_name(d.pop("payer_name")) + + def _parse_payer_surname(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + payer_surname = _parse_payer_surname(d.pop("payer_surname")) + + def _parse_payer_email(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + payer_email = _parse_payer_email(d.pop("payer_email")) + + def _parse_bank_issuer(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + bank_issuer = _parse_bank_issuer(d.pop("bank_issuer")) + + def _parse_creditcard_pan(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + creditcard_pan = _parse_creditcard_pan(d.pop("creditcard_pan")) + + def _parse_creditcard_issuer(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + creditcard_issuer = _parse_creditcard_issuer(d.pop("creditcard_issuer")) + + def _parse_creditcard_expiration(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + creditcard_expiration = _parse_creditcard_expiration(d.pop("creditcard_expiration")) + + def _parse_region(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + region = _parse_region(d.pop("region")) + + def _parse_transaction_type(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + transaction_type = _parse_transaction_type(d.pop("transaction_type")) + + def _parse_payment_type(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + payment_type = _parse_payment_type(d.pop("payment_type")) + + def _parse_payment_date(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + payment_date_type_0 = datetime.datetime.fromisoformat(data) + + return payment_date_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + payment_date = _parse_payment_date(d.pop("payment_date")) + + def _parse_product_type(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + product_type = _parse_product_type(d.pop("product_type")) + + def _parse_nationality(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + nationality = _parse_nationality(d.pop("nationality")) + + payment_provider_data = cls( + payed=payed, + authorization_token=authorization_token, + authorization_code=authorization_code, + status=status, + status_code=status_code, + message=message, + payer_name=payer_name, + payer_surname=payer_surname, + payer_email=payer_email, + bank_issuer=bank_issuer, + creditcard_pan=creditcard_pan, + creditcard_issuer=creditcard_issuer, + creditcard_expiration=creditcard_expiration, + region=region, + transaction_type=transaction_type, + payment_type=payment_type, + payment_date=payment_date, + product_type=product_type, + nationality=nationality, + ) + + payment_provider_data.additional_properties = d + return payment_provider_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/payment_provider_data_type_0.py b/src/shellrent_sdk/client/models/payment_provider_data_type_0.py deleted file mode 100644 index 4dd9a7a..0000000 --- a/src/shellrent_sdk/client/models/payment_provider_data_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="PaymentProviderDataType0") - - -@_attrs_define -class PaymentProviderDataType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - payment_provider_data_type_0 = cls() - - payment_provider_data_type_0.additional_properties = d - return payment_provider_data_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/payment_response.py b/src/shellrent_sdk/client/models/payment_response.py index 7038170..ca2f7a8 100644 --- a/src/shellrent_sdk/client/models/payment_response.py +++ b/src/shellrent_sdk/client/models/payment_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.payment import Payment - from ..models.payment_response_meta_type_0 import PaymentResponseMetaType0 T = TypeVar("T", bound="PaymentResponse") @@ -16,15 +15,19 @@ @_attrs_define class PaymentResponse: - error: int + """Successful response with one `Payment`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: Payment - meta: None | PaymentResponseMetaType0 + """ Payment of one or more orders, with the data of the payment provider """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.payment_response_meta_type_0 import PaymentResponseMetaType0 - error = self.error message: None | str @@ -32,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, PaymentResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,10 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.payment import Payment - from ..models.payment_response_meta_type_0 import PaymentResponseMetaType0 d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -68,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = Payment.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | PaymentResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = PaymentResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | PaymentResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") payment_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/payment_response_meta_type_0.py b/src/shellrent_sdk/client/models/payment_response_meta_type_0.py deleted file mode 100644 index 1e2ce11..0000000 --- a/src/shellrent_sdk/client/models/payment_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="PaymentResponseMetaType0") - - -@_attrs_define -class PaymentResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - payment_response_meta_type_0 = cls() - - payment_response_meta_type_0.additional_properties = d - return payment_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/pec.py b/src/shellrent_sdk/client/models/pec.py index b68aeed..0d123b8 100644 --- a/src/shellrent_sdk/client/models/pec.py +++ b/src/shellrent_sdk/client/models/pec.py @@ -11,23 +11,41 @@ @_attrs_define class Pec: + """PEC (certified email, Posta Elettronica Certificata) mailbox of the account""" + pec_id: int purchase_id: int | None + """ Id of the purchase of the mailbox (`GET /api/v3/purchases/{purchase_id}`) """ purchase_name: None | str + """ Name of the purchase object, as `purchase_name.object_name` of the purchase """ purchase_status_code: None | str + """ Status code of the purchase, for example `ACTIVE_V2` or `NEW_V2` (not active yet) """ box_name: None | str + """ Name of the mailbox, the part of the address before `@`; null until it is chosen """ full_box_name: None | str + """ Address of the mailbox (`box_name@domain`); empty until the name is chosen """ domain: None | str report_email: None | str + """ Notification email for the PEC reports of the mailbox """ report_sms: None | str + """ Phone number that receives the SMS notifications of the mailbox; null when the SMS service is not active """ password_recovery_email: None | str + """ Email used to recover the password of the mailbox """ inbox_usage: float | None + """ Space used in the inbox, in MB """ archive_usage: float | None + """ Space used in the archive, in MB """ extra_inbox: int | None + """ Additional inbox space bought, in GB """ extra_archive: int | None + """ Additional archive space bought, in GB """ transfer_in: bool + """ Whether the mailbox already existed and was transferred to us (incoming transfer) """ owner_not_assignable: bool + """ Whether Aruba, the PEC provider, refused to assign the chosen owner to the mailbox during the activation """ password_wrong: bool + """ Whether the password of the mailbox saved for the backups turned out wrong; the backups need the right one + """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/pec_domain.py b/src/shellrent_sdk/client/models/pec_domain.py index ac8a475..4931766 100644 --- a/src/shellrent_sdk/client/models/pec_domain.py +++ b/src/shellrent_sdk/client/models/pec_domain.py @@ -11,18 +11,36 @@ @_attrs_define class PecDomain: + """Domain certified for PEC (certified email, Posta Elettronica Certificata), whose mailboxes have its name after the + `@` + + """ + pec_domain_id: int purchase_id: int | None + """ Id of the purchase of the PEC domain (`GET /api/v3/purchases/{purchase_id}`) """ purchase_name: None | str + """ Name of the purchase object, as `purchase_name.object_name` of the purchase """ purchase_status_code: None | str + """ Status code of the purchase, for example `DELIVERED_V2` or `NEW_V2` (not active yet) """ purchase_pec_owner_id: int | None + """ Id of the current owner of the PEC domain, as `pec_owner_id` in the owner changes """ domain: None | str provider_domain_id: None | str - transfer_in: bool + """ Id of the domain at Aruba, the PEC provider; null until the domain is certified there """ + transfer_in: bool | None + """ Whether the PEC domain already existed at the provider and was transferred to us (incoming transfer) """ force_decertify_domain: bool + """ Whether the activation is stopped because the provider refused to certify the domain: the domain must be + decertified first """ aruba_public: bool + """ Whether it is a public PEC domain of Aruba, shared by many customers (for example `pec.it`) """ shellrent_public: bool + """ Whether it is one of our public PEC domains, shared by many customers (for example `postacert.eu`) """ can_require_owner_change: bool + """ Whether an owner change can be requested now (`POST /api/v3/pec-domains/{pec_domain_id}/owner-changes`): + false when the purchase is not active, when another request was not approved or when the domain is not at the + provider yet """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -46,6 +64,7 @@ def to_dict(self) -> dict[str, Any]: provider_domain_id: None | str provider_domain_id = self.provider_domain_id + transfer_in: bool | None transfer_in = self.transfer_in force_decertify_domain = self.force_decertify_domain @@ -124,7 +143,12 @@ def _parse_provider_domain_id(data: object) -> None | str: provider_domain_id = _parse_provider_domain_id(d.pop("provider_domain_id")) - transfer_in = d.pop("transfer_in") + def _parse_transfer_in(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) + + transfer_in = _parse_transfer_in(d.pop("transfer_in")) force_decertify_domain = d.pop("force_decertify_domain") diff --git a/src/shellrent_sdk/client/models/pec_domain_paginated_list_response.py b/src/shellrent_sdk/client/models/pec_domain_paginated_list_response.py index d195c82..d66be84 100644 --- a/src/shellrent_sdk/client/models/pec_domain_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/pec_domain_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class PecDomainPaginatedListResponse: - error: int + """Successful response with a page of `PecDomain`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[PecDomain] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.pec_domain import PecDomain d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/pec_domain_response.py b/src/shellrent_sdk/client/models/pec_domain_response.py index 8fe37d3..904b5f3 100644 --- a/src/shellrent_sdk/client/models/pec_domain_response.py +++ b/src/shellrent_sdk/client/models/pec_domain_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.pec_domain import PecDomain - from ..models.pec_domain_response_meta_type_0 import PecDomainResponseMetaType0 T = TypeVar("T", bound="PecDomainResponse") @@ -16,15 +15,20 @@ @_attrs_define class PecDomainResponse: - error: int + """Successful response with one `PecDomain`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: PecDomain - meta: None | PecDomainResponseMetaType0 + """ Domain certified for PEC (certified email, Posta Elettronica Certificata), whose mailboxes have its name + after the `@` """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.pec_domain_response_meta_type_0 import PecDomainResponseMetaType0 - error = self.error message: None | str @@ -32,11 +36,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, PecDomainResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,12 +54,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.pec_domain import PecDomain - from ..models.pec_domain_response_meta_type_0 import ( - PecDomainResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -70,20 +69,7 @@ def _parse_message(data: object) -> None | str: data = PecDomain.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | PecDomainResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = PecDomainResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | PecDomainResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") pec_domain_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/pec_domain_response_meta_type_0.py b/src/shellrent_sdk/client/models/pec_domain_response_meta_type_0.py deleted file mode 100644 index fe723af..0000000 --- a/src/shellrent_sdk/client/models/pec_domain_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="PecDomainResponseMetaType0") - - -@_attrs_define -class PecDomainResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - pec_domain_response_meta_type_0 = cls() - - pec_domain_response_meta_type_0.additional_properties = d - return pec_domain_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/pec_mailbox_owner_change_create_request.py b/src/shellrent_sdk/client/models/pec_mailbox_owner_change_create_request.py index fa4c494..e56706e 100644 --- a/src/shellrent_sdk/client/models/pec_mailbox_owner_change_create_request.py +++ b/src/shellrent_sdk/client/models/pec_mailbox_owner_change_create_request.py @@ -4,7 +4,6 @@ from typing import Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="PecMailboxOwnerChangeCreateRequest") @@ -14,12 +13,11 @@ class PecMailboxOwnerChangeCreateRequest: owner_id: int """ ID of an existing PEC owner profile to assign to the mailbox """ contract_upload_id: int - """ ID of contract document uploaded with /api/v3/upload """ + """ ID of contract document uploaded with `POST /api/v3/uploads` """ identity_document_upload_id: int - """ ID of identity document uploaded with /api/v3/upload """ + """ ID of identity document uploaded with `POST /api/v3/uploads` """ order_module_upload_id: int - """ ID of order module document uploaded with /api/v3/upload """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + """ ID of order module document uploaded with `POST /api/v3/uploads` """ def to_dict(self) -> dict[str, Any]: owner_id = self.owner_id @@ -31,7 +29,7 @@ def to_dict(self) -> dict[str, Any]: order_module_upload_id = self.order_module_upload_id field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "owner_id": owner_id, @@ -61,21 +59,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: order_module_upload_id=order_module_upload_id, ) - pec_mailbox_owner_change_create_request.additional_properties = d return pec_mailbox_owner_change_create_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/pec_mailbox_update_request.py b/src/shellrent_sdk/client/models/pec_mailbox_update_request.py index 615262c..54e7533 100644 --- a/src/shellrent_sdk/client/models/pec_mailbox_update_request.py +++ b/src/shellrent_sdk/client/models/pec_mailbox_update_request.py @@ -4,7 +4,6 @@ from typing import Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -19,7 +18,6 @@ class PecMailboxUpdateRequest: """ Notification phone number for PEC reports. Use empty string to clear. """ password_recovery_email: str | Unset = UNSET """ Email used for PEC password recovery. """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: report_email = self.report_email @@ -29,7 +27,7 @@ def to_dict(self) -> dict[str, Any]: password_recovery_email = self.password_recovery_email field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if report_email is not UNSET: field_dict["report_email"] = report_email @@ -55,21 +53,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: password_recovery_email=password_recovery_email, ) - pec_mailbox_update_request.additional_properties = d return pec_mailbox_update_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/pec_owner_change.py b/src/shellrent_sdk/client/models/pec_owner_change.py index de7b56f..1a2d1e9 100644 --- a/src/shellrent_sdk/client/models/pec_owner_change.py +++ b/src/shellrent_sdk/client/models/pec_owner_change.py @@ -16,21 +16,38 @@ @_attrs_define class PecOwnerChange: + """Request to change the owner of a PEC mailbox or of a PEC domain, with its documents and its status""" + owner_change_id: int | None pec_id: int | None + """ Id of the PEC mailbox of the request (`GET /api/v3/pec-mailboxes/{pec_id}`); null for the requests of a PEC + domain """ pec_domain_id: int | None + """ Id of the PEC domain of the request (`GET /api/v3/pec-domains/{pec_domain_id}`); null for the requests of a + mailbox """ status_code: None | str + """ Status of the request: `PENDENT` (documents not sent yet), `PENDENT_APPROVAL` (waiting for our approval), + `APPROVED` or `REJECTED` """ rejection_reason: None | str + """ Reason of the rejection; null unless the request was rejected """ submission_date: datetime.datetime | None + """ When the documents were sent; null until they are """ acceptance_date: datetime.datetime | None + """ When the request was approved """ rejection_date: datetime.datetime | None + """ When the request was rejected """ has_identity_document: bool + """ Whether the request has the identity document """ has_contract_document: bool + """ Whether the request has the contract """ has_order_module_document: bool - person_id_accept: int | None - person_id_reject: int | None + """ Whether the request has the order form """ owner_old: PecOwnerSummary + """ Owner (titolare) of a PEC mailbox or domain: the person and, for organizations, the data of the + organization; all the fields are null when there is no owner """ owner_new: PecOwnerSummary + """ Owner (titolare) of a PEC mailbox or domain: the person and, for organizations, the data of the + organization; all the fields are null when there is no owner """ date_created: datetime.datetime | None additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -74,12 +91,6 @@ def to_dict(self) -> dict[str, Any]: has_order_module_document = self.has_order_module_document - person_id_accept: int | None - person_id_accept = self.person_id_accept - - person_id_reject: int | None - person_id_reject = self.person_id_reject - owner_old = self.owner_old.to_dict() owner_new = self.owner_new.to_dict() @@ -105,8 +116,6 @@ def to_dict(self) -> dict[str, Any]: "has_identity_document": has_identity_document, "has_contract_document": has_contract_document, "has_order_module_document": has_order_module_document, - "person_id_accept": person_id_accept, - "person_id_reject": person_id_reject, "owner_old": owner_old, "owner_new": owner_new, "date_created": date_created, @@ -207,20 +216,6 @@ def _parse_rejection_date(data: object) -> datetime.datetime | None: has_order_module_document = d.pop("has_order_module_document") - def _parse_person_id_accept(data: object) -> int | None: - if data is None: - return data - return cast(int | None, data) - - person_id_accept = _parse_person_id_accept(d.pop("person_id_accept")) - - def _parse_person_id_reject(data: object) -> int | None: - if data is None: - return data - return cast(int | None, data) - - person_id_reject = _parse_person_id_reject(d.pop("person_id_reject")) - owner_old = PecOwnerSummary.from_dict(d.pop("owner_old")) owner_new = PecOwnerSummary.from_dict(d.pop("owner_new")) @@ -252,8 +247,6 @@ def _parse_date_created(data: object) -> datetime.datetime | None: has_identity_document=has_identity_document, has_contract_document=has_contract_document, has_order_module_document=has_order_module_document, - person_id_accept=person_id_accept, - person_id_reject=person_id_reject, owner_old=owner_old, owner_new=owner_new, date_created=date_created, diff --git a/src/shellrent_sdk/client/models/pec_owner_change_paginated_list_response.py b/src/shellrent_sdk/client/models/pec_owner_change_paginated_list_response.py index 7073fb5..313878e 100644 --- a/src/shellrent_sdk/client/models/pec_owner_change_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/pec_owner_change_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class PecOwnerChangePaginatedListResponse: - error: int + """Successful response with a page of `PecOwnerChange`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[PecOwnerChange] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.pec_owner_change import PecOwnerChange d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/pec_owner_change_response.py b/src/shellrent_sdk/client/models/pec_owner_change_response.py index f18bb66..8c7b4e3 100644 --- a/src/shellrent_sdk/client/models/pec_owner_change_response.py +++ b/src/shellrent_sdk/client/models/pec_owner_change_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.pec_owner_change import PecOwnerChange - from ..models.pec_owner_change_response_meta_type_0 import PecOwnerChangeResponseMetaType0 T = TypeVar("T", bound="PecOwnerChangeResponse") @@ -16,15 +15,19 @@ @_attrs_define class PecOwnerChangeResponse: - error: int + """Successful response with one `PecOwnerChange`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: PecOwnerChange - meta: None | PecOwnerChangeResponseMetaType0 + """ Request to change the owner of a PEC mailbox or of a PEC domain, with its documents and its status """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.pec_owner_change_response_meta_type_0 import PecOwnerChangeResponseMetaType0 - error = self.error message: None | str @@ -32,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, PecOwnerChangeResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.pec_owner_change import PecOwnerChange - from ..models.pec_owner_change_response_meta_type_0 import ( - PecOwnerChangeResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -70,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = PecOwnerChange.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | PecOwnerChangeResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = PecOwnerChangeResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | PecOwnerChangeResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") pec_owner_change_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/pec_owner_change_response_meta_type_0.py b/src/shellrent_sdk/client/models/pec_owner_change_response_meta_type_0.py deleted file mode 100644 index eaf3856..0000000 --- a/src/shellrent_sdk/client/models/pec_owner_change_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="PecOwnerChangeResponseMetaType0") - - -@_attrs_define -class PecOwnerChangeResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - pec_owner_change_response_meta_type_0 = cls() - - pec_owner_change_response_meta_type_0.additional_properties = d - return pec_owner_change_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/pec_owner_summary.py b/src/shellrent_sdk/client/models/pec_owner_summary.py index f71215e..a77dffc 100644 --- a/src/shellrent_sdk/client/models/pec_owner_summary.py +++ b/src/shellrent_sdk/client/models/pec_owner_summary.py @@ -11,16 +11,35 @@ @_attrs_define class PecOwnerSummary: + """Owner (titolare) of a PEC mailbox or domain: the person and, for organizations, the data of the organization; all + the fields are null when there is no owner + + """ + pec_owner_id: int | None + """ Id of the owner, as `owner_id` of the owner change requests """ owner_legal_entity_type: None | str + """ Legal form of the owner: `PRIVATO` (private individual), `LIBERO_PROFESSIONISTA` (self-employed + professional), `DITTA_INDIVIDUALE` or the old `AZIENDA_DITTA_INDIVIDUALE` (sole proprietorship), `AZIENDA` + (company), `PUBBLICA_AMMINISTRAZIONE` (public administration) or `NO_PROFIT` (non-profit organization) """ admin_first_name: None | str + """ First name of the owner or, for organizations, of the person who acts for them """ admin_last_name: None | str + """ Last name of the owner or, for organizations, of the person who acts for them """ admin_email: None | str + """ Email of the owner or, for organizations, of the person who acts for them """ admin_fiscal_code: None | str + """ Codice fiscale (Italian tax code) of the owner or, for organizations, of the person who acts for them """ admin_vat_number: None | str + """ VAT number (partita IVA) of the owner; not used for `PRIVATO` """ company_name: None | str + """ Business name of the organization, for `DITTA_INDIVIDUALE`, `AZIENDA`, `PUBBLICA_AMMINISTRAZIONE` and + `NO_PROFIT` """ company_email: None | str + """ Email of the organization, for `AZIENDA`, `PUBBLICA_AMMINISTRAZIONE` and `NO_PROFIT` """ company_fiscal_code: None | str + """ Codice fiscale (Italian tax code) of the organization, for `AZIENDA`, `PUBBLICA_AMMINISTRAZIONE` and + `NO_PROFIT` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/pec_paginated_list_response.py b/src/shellrent_sdk/client/models/pec_paginated_list_response.py index f8a2885..8021592 100644 --- a/src/shellrent_sdk/client/models/pec_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/pec_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class PecPaginatedListResponse: - error: int + """Successful response with a page of `Pec`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[Pec] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.pec import Pec d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/pec_response.py b/src/shellrent_sdk/client/models/pec_response.py index 1047a67..522f953 100644 --- a/src/shellrent_sdk/client/models/pec_response.py +++ b/src/shellrent_sdk/client/models/pec_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.pec import Pec - from ..models.pec_response_meta_type_0 import PecResponseMetaType0 T = TypeVar("T", bound="PecResponse") @@ -16,15 +15,19 @@ @_attrs_define class PecResponse: - error: int + """Successful response with one `Pec`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: Pec - meta: None | PecResponseMetaType0 + """ PEC (certified email, Posta Elettronica Certificata) mailbox of the account """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.pec_response_meta_type_0 import PecResponseMetaType0 - error = self.error message: None | str @@ -32,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, PecResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,10 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.pec import Pec - from ..models.pec_response_meta_type_0 import PecResponseMetaType0 d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -68,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = Pec.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | PecResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = PecResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | PecResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") pec_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/pec_response_meta_type_0.py b/src/shellrent_sdk/client/models/pec_response_meta_type_0.py deleted file mode 100644 index 991c215..0000000 --- a/src/shellrent_sdk/client/models/pec_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="PecResponseMetaType0") - - -@_attrs_define -class PecResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - pec_response_meta_type_0 = cls() - - pec_response_meta_type_0.additional_properties = d - return pec_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/plesk_license.py b/src/shellrent_sdk/client/models/plesk_license.py deleted file mode 100644 index fd972db..0000000 --- a/src/shellrent_sdk/client/models/plesk_license.py +++ /dev/null @@ -1,223 +0,0 @@ -from __future__ import annotations - -import datetime -from collections.abc import Mapping -from typing import Any, Self, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="PleskLicense") - - -@_attrs_define -class PleskLicense: - license_id: int - purchase_id: int - purchase_server_id: int | None - service_name: None | str - purchase_name: None | str - license_ref: None | str - key_number: None | str - ip_address: None | str - is_els: bool - operative_system: None | str - purchase_status_code: None | str - date_activation: datetime.date | None - date_expiry: datetime.date | None - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - license_id = self.license_id - - purchase_id = self.purchase_id - - purchase_server_id: int | None - purchase_server_id = self.purchase_server_id - - service_name: None | str - service_name = self.service_name - - purchase_name: None | str - purchase_name = self.purchase_name - - license_ref: None | str - license_ref = self.license_ref - - key_number: None | str - key_number = self.key_number - - ip_address: None | str - ip_address = self.ip_address - - is_els = self.is_els - - operative_system: None | str - operative_system = self.operative_system - - purchase_status_code: None | str - purchase_status_code = self.purchase_status_code - - date_activation: None | str - if isinstance(self.date_activation, datetime.date): - date_activation = self.date_activation.isoformat() - else: - date_activation = self.date_activation - - date_expiry: None | str - if isinstance(self.date_expiry, datetime.date): - date_expiry = self.date_expiry.isoformat() - else: - date_expiry = self.date_expiry - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "license_id": license_id, - "purchase_id": purchase_id, - "purchase_server_id": purchase_server_id, - "service_name": service_name, - "purchase_name": purchase_name, - "license_ref": license_ref, - "key_number": key_number, - "ip_address": ip_address, - "is_els": is_els, - "operative_system": operative_system, - "purchase_status_code": purchase_status_code, - "date_activation": date_activation, - "date_expiry": date_expiry, - } - ) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - license_id = d.pop("license_id") - - purchase_id = d.pop("purchase_id") - - def _parse_purchase_server_id(data: object) -> int | None: - if data is None: - return data - return cast(int | None, data) - - purchase_server_id = _parse_purchase_server_id(d.pop("purchase_server_id")) - - def _parse_service_name(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - service_name = _parse_service_name(d.pop("service_name")) - - def _parse_purchase_name(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - purchase_name = _parse_purchase_name(d.pop("purchase_name")) - - def _parse_license_ref(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - license_ref = _parse_license_ref(d.pop("license_ref")) - - def _parse_key_number(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - key_number = _parse_key_number(d.pop("key_number")) - - def _parse_ip_address(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - ip_address = _parse_ip_address(d.pop("ip_address")) - - is_els = d.pop("is_els") - - def _parse_operative_system(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - operative_system = _parse_operative_system(d.pop("operative_system")) - - def _parse_purchase_status_code(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - purchase_status_code = _parse_purchase_status_code(d.pop("purchase_status_code")) - - def _parse_date_activation(data: object) -> datetime.date | None: - if data is None: - return data - try: - if not isinstance(data, str): - raise TypeError() - date_activation_type_0 = datetime.date.fromisoformat(data) - - return date_activation_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(datetime.date | None, data) - - date_activation = _parse_date_activation(d.pop("date_activation")) - - def _parse_date_expiry(data: object) -> datetime.date | None: - if data is None: - return data - try: - if not isinstance(data, str): - raise TypeError() - date_expiry_type_0 = datetime.date.fromisoformat(data) - - return date_expiry_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(datetime.date | None, data) - - date_expiry = _parse_date_expiry(d.pop("date_expiry")) - - plesk_license = cls( - license_id=license_id, - purchase_id=purchase_id, - purchase_server_id=purchase_server_id, - service_name=service_name, - purchase_name=purchase_name, - license_ref=license_ref, - key_number=key_number, - ip_address=ip_address, - is_els=is_els, - operative_system=operative_system, - purchase_status_code=purchase_status_code, - date_activation=date_activation, - date_expiry=date_expiry, - ) - - plesk_license.additional_properties = d - return plesk_license - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/plesk_license_response.py b/src/shellrent_sdk/client/models/plesk_license_response.py deleted file mode 100644 index d2c2442..0000000 --- a/src/shellrent_sdk/client/models/plesk_license_response.py +++ /dev/null @@ -1,112 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.plesk_license import PleskLicense - from ..models.plesk_license_response_meta_type_0 import PleskLicenseResponseMetaType0 - - -T = TypeVar("T", bound="PleskLicenseResponse") - - -@_attrs_define -class PleskLicenseResponse: - error: int - message: None | str - data: PleskLicense - meta: None | PleskLicenseResponseMetaType0 - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.plesk_license_response_meta_type_0 import PleskLicenseResponseMetaType0 - - error = self.error - - message: None | str - message = self.message - - data = self.data.to_dict() - - meta: dict[str, Any] | None - if isinstance(self.meta, PleskLicenseResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "error": error, - "message": message, - "data": data, - "meta": meta, - } - ) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.plesk_license import PleskLicense - from ..models.plesk_license_response_meta_type_0 import ( - PleskLicenseResponseMetaType0, - ) - - d = dict(src_dict) - error = d.pop("error") - - def _parse_message(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - message = _parse_message(d.pop("message")) - - data = PleskLicense.from_dict(d.pop("data")) - - def _parse_meta(data: object) -> None | PleskLicenseResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = PleskLicenseResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | PleskLicenseResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) - - plesk_license_response = cls( - error=error, - message=message, - data=data, - meta=meta, - ) - - plesk_license_response.additional_properties = d - return plesk_license_response - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/plesk_license_response_meta_type_0.py b/src/shellrent_sdk/client/models/plesk_license_response_meta_type_0.py deleted file mode 100644 index d1f59c6..0000000 --- a/src/shellrent_sdk/client/models/plesk_license_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="PleskLicenseResponseMetaType0") - - -@_attrs_define -class PleskLicenseResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - plesk_license_response_meta_type_0 = cls() - - plesk_license_response_meta_type_0.additional_properties = d - return plesk_license_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/prepaid_credit.py b/src/shellrent_sdk/client/models/prepaid_credit.py index 2fe8b3d..b584734 100644 --- a/src/shellrent_sdk/client/models/prepaid_credit.py +++ b/src/shellrent_sdk/client/models/prepaid_credit.py @@ -15,9 +15,15 @@ @_attrs_define class PrepaidCredit: + """Prepaid credit of the account, with its alert threshold""" + credit_amount: AmountSimple + """ Amount in euros, without the VAT details of `Amount` """ credit_threshold: AmountSimple | None + """ Alert threshold: when the credit falls below it, the customer receives an email; null without a threshold + """ threshold_exceeded: bool | None + """ Whether the credit is below the threshold; null without a threshold """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/prepaid_credit_operation.py b/src/shellrent_sdk/client/models/prepaid_credit_operation.py index f101f2f..a147ea9 100644 --- a/src/shellrent_sdk/client/models/prepaid_credit_operation.py +++ b/src/shellrent_sdk/client/models/prepaid_credit_operation.py @@ -7,8 +7,6 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset - if TYPE_CHECKING: from ..models.amount_simple import AmountSimple from ..models.creditnote import Creditnote @@ -21,16 +19,26 @@ @_attrs_define class PrepaidCreditOperation: + """Operation on the prepaid credit, such as a top-up or a payment with the credit""" + operation_id: int operation_id_related: int | None + """ Id of the payment with the credit (`REDEMPTION`) that the operation cancels, for `REDEMPTION_CANCELLATION` + (`GET /api/v3/prepaid-credit/operations/{operation_id}`); null for the other types """ prepaid_credit_topup: PrepaidCreditTopup + """ Top-up of the prepaid credit, with its deposit invoice and the credit left """ operation_type: PrepaidCreditOperationType + """ Type of an operation on the prepaid credit """ + creditnote: Creditnote | None + """ Credit note issued for the operation, for `REFUND` and `CREDIT_CANCELLATION`; null for the other types """ amount: AmountSimple + """ Amount in euros, without the VAT details of `Amount` """ date_created: datetime.datetime - creditnote: Creditnote | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + from ..models.creditnote import Creditnote + operation_id = self.operation_id operation_id_related: int | None @@ -40,14 +48,16 @@ def to_dict(self) -> dict[str, Any]: operation_type = self.operation_type.to_dict() + creditnote: dict[str, Any] | None + if isinstance(self.creditnote, Creditnote): + creditnote = self.creditnote.to_dict() + else: + creditnote = self.creditnote + amount = self.amount.to_dict() date_created = self.date_created.isoformat() - creditnote: dict[str, Any] | Unset = UNSET - if not isinstance(self.creditnote, Unset): - creditnote = self.creditnote.to_dict() - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -56,12 +66,11 @@ def to_dict(self) -> dict[str, Any]: "operation_id_related": operation_id_related, "prepaid_credit_topup": prepaid_credit_topup, "operation_type": operation_type, + "creditnote": creditnote, "amount": amount, "date_created": date_created, } ) - if creditnote is not UNSET: - field_dict["creditnote"] = creditnote return field_dict @@ -88,25 +97,33 @@ def _parse_operation_id_related(data: object) -> int | None: operation_type = PrepaidCreditOperationType.from_dict(d.pop("operation_type")) + def _parse_creditnote(data: object) -> Creditnote | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + creditnote_type_0 = Creditnote.from_dict(data) + + return creditnote_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(Creditnote | None, data) + + creditnote = _parse_creditnote(d.pop("creditnote")) + amount = AmountSimple.from_dict(d.pop("amount")) date_created = datetime.datetime.fromisoformat(d.pop("date_created")) - _creditnote = d.pop("creditnote", UNSET) - creditnote: Creditnote | Unset - if isinstance(_creditnote, Unset): - creditnote = UNSET - else: - creditnote = Creditnote.from_dict(_creditnote) - prepaid_credit_operation = cls( operation_id=operation_id, operation_id_related=operation_id_related, prepaid_credit_topup=prepaid_credit_topup, operation_type=operation_type, + creditnote=creditnote, amount=amount, date_created=date_created, - creditnote=creditnote, ) prepaid_credit_operation.additional_properties = d diff --git a/src/shellrent_sdk/client/models/prepaid_credit_operation_paginated_list_response.py b/src/shellrent_sdk/client/models/prepaid_credit_operation_paginated_list_response.py index cd8d60a..1aa8f04 100644 --- a/src/shellrent_sdk/client/models/prepaid_credit_operation_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/prepaid_credit_operation_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class PrepaidCreditOperationPaginatedListResponse: - error: int + """Successful response with a page of `PrepaidCreditOperation`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[PrepaidCreditOperation] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.prepaid_credit_operation import PrepaidCreditOperation d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/prepaid_credit_operation_response.py b/src/shellrent_sdk/client/models/prepaid_credit_operation_response.py index 16dc7cd..f30e218 100644 --- a/src/shellrent_sdk/client/models/prepaid_credit_operation_response.py +++ b/src/shellrent_sdk/client/models/prepaid_credit_operation_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.prepaid_credit_operation import PrepaidCreditOperation - from ..models.prepaid_credit_operation_response_meta_type_0 import ( - PrepaidCreditOperationResponseMetaType0, - ) T = TypeVar("T", bound="PrepaidCreditOperationResponse") @@ -18,17 +15,19 @@ @_attrs_define class PrepaidCreditOperationResponse: - error: int + """Successful response with one `PrepaidCreditOperation`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: PrepaidCreditOperation - meta: None | PrepaidCreditOperationResponseMetaType0 + """ Operation on the prepaid credit, such as a top-up or a payment with the credit """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.prepaid_credit_operation_response_meta_type_0 import ( - PrepaidCreditOperationResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, PrepaidCreditOperationResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -58,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.prepaid_credit_operation import PrepaidCreditOperation - from ..models.prepaid_credit_operation_response_meta_type_0 import ( - PrepaidCreditOperationResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -74,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = PrepaidCreditOperation.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | PrepaidCreditOperationResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = PrepaidCreditOperationResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | PrepaidCreditOperationResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") prepaid_credit_operation_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/prepaid_credit_operation_response_meta_type_0.py b/src/shellrent_sdk/client/models/prepaid_credit_operation_response_meta_type_0.py deleted file mode 100644 index 7d8858a..0000000 --- a/src/shellrent_sdk/client/models/prepaid_credit_operation_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="PrepaidCreditOperationResponseMetaType0") - - -@_attrs_define -class PrepaidCreditOperationResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - prepaid_credit_operation_response_meta_type_0 = cls() - - prepaid_credit_operation_response_meta_type_0.additional_properties = d - return prepaid_credit_operation_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/prepaid_credit_operation_type.py b/src/shellrent_sdk/client/models/prepaid_credit_operation_type.py index bfb0677..80e0f35 100644 --- a/src/shellrent_sdk/client/models/prepaid_credit_operation_type.py +++ b/src/shellrent_sdk/client/models/prepaid_credit_operation_type.py @@ -11,8 +11,13 @@ @_attrs_define class PrepaidCreditOperationType: + """Type of an operation on the prepaid credit""" + type_code: str + """ One of `TOP_UP`, `REDEMPTION` (payment with the credit), `REDEMPTION_CANCELLATION`, `PAYMENT_CANCELLATION`, + `REFUND`, `CREDIT_CANCELLATION`, `RESET_CREDIT` or `RESELLER_SHOP_REFUND` """ type_description: str + """ Name of the type, in Italian """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/prepaid_credit_payment_create_request.py b/src/shellrent_sdk/client/models/prepaid_credit_payment_create_request.py new file mode 100644 index 0000000..58ef13b --- /dev/null +++ b/src/shellrent_sdk/client/models/prepaid_credit_payment_create_request.py @@ -0,0 +1,40 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Self, TypeVar, cast + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="PrepaidCreditPaymentCreateRequest") + + +@_attrs_define +class PrepaidCreditPaymentCreateRequest: + """Pays one or more orders together with the prepaid credit""" + + order_ids: list[int] + """ IDs of the orders to pay together """ + + def to_dict(self) -> dict[str, Any]: + order_ids = self.order_ids + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "order_ids": order_ids, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + order_ids = cast(list[int], d.pop("order_ids")) + + prepaid_credit_payment_create_request = cls( + order_ids=order_ids, + ) + + return prepaid_credit_payment_create_request diff --git a/src/shellrent_sdk/client/models/prepaid_credit_response.py b/src/shellrent_sdk/client/models/prepaid_credit_response.py index 4a815f5..be81654 100644 --- a/src/shellrent_sdk/client/models/prepaid_credit_response.py +++ b/src/shellrent_sdk/client/models/prepaid_credit_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.prepaid_credit import PrepaidCredit - from ..models.prepaid_credit_response_meta_type_0 import PrepaidCreditResponseMetaType0 T = TypeVar("T", bound="PrepaidCreditResponse") @@ -16,15 +15,19 @@ @_attrs_define class PrepaidCreditResponse: - error: int + """Successful response with one `PrepaidCredit`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: PrepaidCredit - meta: None | PrepaidCreditResponseMetaType0 + """ Prepaid credit of the account, with its alert threshold """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.prepaid_credit_response_meta_type_0 import PrepaidCreditResponseMetaType0 - error = self.error message: None | str @@ -32,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, PrepaidCreditResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.prepaid_credit import PrepaidCredit - from ..models.prepaid_credit_response_meta_type_0 import ( - PrepaidCreditResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -70,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = PrepaidCredit.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | PrepaidCreditResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = PrepaidCreditResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | PrepaidCreditResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") prepaid_credit_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/prepaid_credit_response_meta_type_0.py b/src/shellrent_sdk/client/models/prepaid_credit_response_meta_type_0.py deleted file mode 100644 index cd5672a..0000000 --- a/src/shellrent_sdk/client/models/prepaid_credit_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="PrepaidCreditResponseMetaType0") - - -@_attrs_define -class PrepaidCreditResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - prepaid_credit_response_meta_type_0 = cls() - - prepaid_credit_response_meta_type_0.additional_properties = d - return prepaid_credit_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/prepaid_credit_topup.py b/src/shellrent_sdk/client/models/prepaid_credit_topup.py index 4bf8acb..e746d33 100644 --- a/src/shellrent_sdk/client/models/prepaid_credit_topup.py +++ b/src/shellrent_sdk/client/models/prepaid_credit_topup.py @@ -17,12 +17,19 @@ @_attrs_define class PrepaidCreditTopup: + """Top-up of the prepaid credit, with its deposit invoice and the credit left""" + topup_id: int invoice: Invoice | None + """ Deposit invoice of the top-up; null until it is issued """ initial_credit: AmountSimple + """ Amount in euros, without the VAT details of `Amount` """ current_credit: AmountSimple + """ Amount in euros, without the VAT details of `Amount` """ refund_expiry: datetime.date | None + """ Last day on which the credit left can be refunded; null when there is no limit """ credit_expiry: datetime.date | None + """ Expiry date of the credit of the top-up; null when it does not expire """ date_created: datetime.datetime additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) diff --git a/src/shellrent_sdk/client/models/prepaid_credit_topup_paginated_list_response.py b/src/shellrent_sdk/client/models/prepaid_credit_topup_paginated_list_response.py index a0652eb..649394c 100644 --- a/src/shellrent_sdk/client/models/prepaid_credit_topup_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/prepaid_credit_topup_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class PrepaidCreditTopupPaginatedListResponse: - error: int + """Successful response with a page of `PrepaidCreditTopup`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[PrepaidCreditTopup] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.prepaid_credit_topup import PrepaidCreditTopup d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/prepaid_credit_topup_response.py b/src/shellrent_sdk/client/models/prepaid_credit_topup_response.py index ef98137..0c7c0f2 100644 --- a/src/shellrent_sdk/client/models/prepaid_credit_topup_response.py +++ b/src/shellrent_sdk/client/models/prepaid_credit_topup_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.prepaid_credit_topup import PrepaidCreditTopup - from ..models.prepaid_credit_topup_response_meta_type_0 import ( - PrepaidCreditTopupResponseMetaType0, - ) T = TypeVar("T", bound="PrepaidCreditTopupResponse") @@ -18,17 +15,19 @@ @_attrs_define class PrepaidCreditTopupResponse: - error: int + """Successful response with one `PrepaidCreditTopup`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: PrepaidCreditTopup - meta: None | PrepaidCreditTopupResponseMetaType0 + """ Top-up of the prepaid credit, with its deposit invoice and the credit left """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.prepaid_credit_topup_response_meta_type_0 import ( - PrepaidCreditTopupResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, PrepaidCreditTopupResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -58,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.prepaid_credit_topup import PrepaidCreditTopup - from ..models.prepaid_credit_topup_response_meta_type_0 import ( - PrepaidCreditTopupResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -74,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = PrepaidCreditTopup.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | PrepaidCreditTopupResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = PrepaidCreditTopupResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | PrepaidCreditTopupResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") prepaid_credit_topup_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/prepaid_credit_topup_response_meta_type_0.py b/src/shellrent_sdk/client/models/prepaid_credit_topup_response_meta_type_0.py deleted file mode 100644 index 7289fbc..0000000 --- a/src/shellrent_sdk/client/models/prepaid_credit_topup_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="PrepaidCreditTopupResponseMetaType0") - - -@_attrs_define -class PrepaidCreditTopupResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - prepaid_credit_topup_response_meta_type_0 = cls() - - prepaid_credit_topup_response_meta_type_0.additional_properties = d - return prepaid_credit_topup_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/private_cloud.py b/src/shellrent_sdk/client/models/private_cloud.py index c8c9a01..6739606 100644 --- a/src/shellrent_sdk/client/models/private_cloud.py +++ b/src/shellrent_sdk/client/models/private_cloud.py @@ -11,22 +11,41 @@ @_attrs_define class PrivateCloud: + """Private cloud, with the resources of its plan and the limits of its virtual machines""" + purchase_id: int + """ Id of the purchase of the private cloud (`GET /api/v3/purchases/{purchase_id}`) """ server_id: int | None + """ Id of the server of the private cloud (`GET /api/v3/servers/{server_id}`) """ max_vm: int | None + """ Maximum number of virtual machines of the private cloud """ available_vm: int | None + """ Number of virtual machines that can still be created: `max_vm` minus the current ones """ max_cpu: int | None + """ Total vCPUs of the private cloud, `cpu_overallocation` included """ cpu_overallocation: int | None + """ vCPUs of `max_cpu` that come from overallocation (extra cores); null when the private cloud has none """ min_vm_cpu: int | None + """ Minimum vCPUs of a virtual machine """ max_vm_cpu: int | None + """ Maximum vCPUs of a virtual machine """ max_ram: int | None + """ Total RAM of the private cloud, in MB """ min_vm_ram: int | None + """ Minimum RAM of a virtual machine, in MB """ max_vm_ram: int | None + """ Maximum RAM of a virtual machine, in MB """ max_disk: int | None + """ Total disk space of the private cloud, in GB """ min_vm_disk: int | None + """ Minimum disk space of a virtual machine, in GB """ max_vm_disk: int | None + """ Maximum disk space of a virtual machine, in GB """ max_backup: int | None + """ Total backup space of the private cloud, in GB """ max_disk_backup: int | None + """ Daily backup space of the private cloud, in GB: the disk space of its virtual machines with the daily backup + cannot go beyond it """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/private_cloud_response.py b/src/shellrent_sdk/client/models/private_cloud_response.py index 1de9eaa..ed5489b 100644 --- a/src/shellrent_sdk/client/models/private_cloud_response.py +++ b/src/shellrent_sdk/client/models/private_cloud_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.private_cloud import PrivateCloud - from ..models.private_cloud_response_meta_type_0 import PrivateCloudResponseMetaType0 T = TypeVar("T", bound="PrivateCloudResponse") @@ -16,15 +15,19 @@ @_attrs_define class PrivateCloudResponse: - error: int + """Successful response with one `PrivateCloud`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: PrivateCloud - meta: None | PrivateCloudResponseMetaType0 + """ Private cloud, with the resources of its plan and the limits of its virtual machines """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.private_cloud_response_meta_type_0 import PrivateCloudResponseMetaType0 - error = self.error message: None | str @@ -32,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, PrivateCloudResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.private_cloud import PrivateCloud - from ..models.private_cloud_response_meta_type_0 import ( - PrivateCloudResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -70,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = PrivateCloud.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | PrivateCloudResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = PrivateCloudResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | PrivateCloudResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") private_cloud_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/private_cloud_response_meta_type_0.py b/src/shellrent_sdk/client/models/private_cloud_response_meta_type_0.py deleted file mode 100644 index 9d9c862..0000000 --- a/src/shellrent_sdk/client/models/private_cloud_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="PrivateCloudResponseMetaType0") - - -@_attrs_define -class PrivateCloudResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - private_cloud_response_meta_type_0 = cls() - - private_cloud_response_meta_type_0.additional_properties = d - return private_cloud_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/private_cloud_vm_create_request.py b/src/shellrent_sdk/client/models/private_cloud_vm_create_request.py index 79322b6..56f261c 100644 --- a/src/shellrent_sdk/client/models/private_cloud_vm_create_request.py +++ b/src/shellrent_sdk/client/models/private_cloud_vm_create_request.py @@ -4,7 +4,6 @@ from typing import Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -13,9 +12,21 @@ @_attrs_define class PrivateCloudVmCreateRequest: + """Virtual machine to create on the private cloud: `template_vm_id` to copy a template VM, otherwise both + `server_configuration_id` and `template_id`; and either `ip_address_id` or `use_local_ip` true, not both + + """ + cpu: int + """ Number of CPU cores (vCPUs) of the virtual machine: between `min_vm_cpu` and `max_vm_cpu` of `GET + /api/v3/servers/{server_id}/private-cloud`, and within the vCPUs still free on the private cloud """ ram: int + """ RAM of the virtual machine, in MB: between `min_vm_ram` and `max_vm_ram` of `GET + /api/v3/servers/{server_id}/private-cloud`, and within the RAM still free on the private cloud """ disk: int + """ Disk space of the virtual machine, in GB: between `min_vm_disk` and `max_vm_disk` of `GET + /api/v3/servers/{server_id}/private-cloud`, within the disk and backup space still free on the private cloud + and, with `template_vm_id`, not lower than the disk of the template VM """ server_configuration_id: int | Unset = UNSET """ Server configuration ID """ template_id: int | Unset = UNSET @@ -24,13 +35,12 @@ class PrivateCloudVmCreateRequest: """ Template VM ID (optional alternative to configuration/template) """ ip_address_id: int | Unset = UNSET """ Primary IP address ID """ - use_local_ip: bool | Unset = UNSET + use_local_ip: bool | Unset = False """ Use local IP instead of public IP """ ssh_key_id: int | Unset = UNSET """ SSH key ID to associate with the VM """ note: str | Unset = UNSET """ Optional note """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: cpu = self.cpu @@ -54,7 +64,7 @@ def to_dict(self) -> dict[str, Any]: note = self.note field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "cpu": cpu, @@ -115,21 +125,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: note=note, ) - private_cloud_vm_create_request.additional_properties = d return private_cloud_vm_create_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/private_cloud_vm_update_request.py b/src/shellrent_sdk/client/models/private_cloud_vm_update_request.py index bded67d..6b7a3de 100644 --- a/src/shellrent_sdk/client/models/private_cloud_vm_update_request.py +++ b/src/shellrent_sdk/client/models/private_cloud_vm_update_request.py @@ -1,10 +1,9 @@ from __future__ import annotations from collections.abc import Mapping -from typing import Any, Self, TypeVar +from typing import Any, Self, TypeVar, cast from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -14,10 +13,16 @@ @_attrs_define class PrivateCloudVmUpdateRequest: cpu: int | Unset = UNSET + """ Number of CPU cores. Omit it to keep the current value; the allowed range depends on the resources available + on the private cloud """ ram: int | Unset = UNSET + """ RAM of the virtual machine, in megabytes. Omit it to keep the current value; the allowed range depends on + the resources available on the private cloud """ disk: int | Unset = UNSET - note: str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + """ Disk space of the virtual machine, in gigabytes: it cannot be lower than the current one. Omit it to keep + the current value """ + note: None | str | Unset = UNSET + """ Note of the virtual machine. Omit it to keep the current note; send an empty string or null to remove it """ def to_dict(self) -> dict[str, Any]: cpu = self.cpu @@ -26,10 +31,14 @@ def to_dict(self) -> dict[str, Any]: disk = self.disk - note = self.note + note: None | str | Unset + if isinstance(self.note, Unset): + note = UNSET + else: + note = self.note field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if cpu is not UNSET: field_dict["cpu"] = cpu @@ -51,7 +60,14 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: disk = d.pop("disk", UNSET) - note = d.pop("note", UNSET) + def _parse_note(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + note = _parse_note(d.pop("note", UNSET)) private_cloud_vm_update_request = cls( cpu=cpu, @@ -60,21 +76,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: note=note, ) - private_cloud_vm_update_request.additional_properties = d return private_cloud_vm_update_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/promotion.py b/src/shellrent_sdk/client/models/promotion.py index 4cd8727..b7a918c 100644 --- a/src/shellrent_sdk/client/models/promotion.py +++ b/src/shellrent_sdk/client/models/promotion.py @@ -16,15 +16,27 @@ @_attrs_define class Promotion: + """Promotion applied to a row of an order: of the `percentage_*` and `amount_*` fields, only the one of its type is set""" + promocode: None | str - description: str + """ Promotional code used; null when the promotion applies without a code """ + description: None | str + """ Promotion description; null when the promotion has none """ percentage_increase: float | None + """ Price increase, in percent; null for the other types """ percentage_decrease: float | None + """ Discount, in percent; null for the other types """ amount_increase: Amount | None + """ Price increase, as an amount before VAT; null for the other types """ amount_decrease: Amount | None + """ Discount, as an amount before VAT; null for the other types """ amount_fixed: Amount | None + """ Fixed price set by the promotion, before VAT; null for the other types """ applied_amount: Amount | None + """ Difference between the base price and the price of the order row (`base_price` and `price` of `OrderRow`): + negative when the promotion increases the price """ date_applied: datetime.datetime + """ When the promotion was applied to the order """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -33,6 +45,7 @@ def to_dict(self) -> dict[str, Any]: promocode: None | str promocode = self.promocode + description: None | str description = self.description percentage_increase: float | None @@ -98,7 +111,12 @@ def _parse_promocode(data: object) -> None | str: promocode = _parse_promocode(d.pop("promocode")) - description = d.pop("description") + def _parse_description(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + description = _parse_description(d.pop("description")) def _parse_percentage_increase(data: object) -> float | None: if data is None: diff --git a/src/shellrent_sdk/client/models/purchase.py b/src/shellrent_sdk/client/models/purchase.py index 97c9936..80952df 100644 --- a/src/shellrent_sdk/client/models/purchase.py +++ b/src/shellrent_sdk/client/models/purchase.py @@ -25,28 +25,37 @@ @_attrs_define class Purchase: + """Purchase of a service, with its status, prices, recurrence, billing data and the resources linked to it""" + purchase_id: int """ ID of purchase """ account: Account | None """ Account information of the user owner of the purchase. NULL if the purchase is not billed to a Reseller. """ service: Service + """ Service of the price list, with its category, recurrences, prices and purchase options """ billing: AccountBilling + """ Billing profile: the holder the documents are made out to, with its tax and electronic invoicing data """ recurrence: Recurrence + """ Billing recurrence: its frequency and, in days, the timings of renewal, suspension and dismission """ recurrence_default: Recurrence + """ Billing recurrence: its frequency and, in days, the timings of renewal, suspension and dismission """ purchase_id_primary: int | None """ ID of primary purchase if this is an additional purchase. """ purchase_status: PurchaseStatus purchase_provisioning_status: PurchaseProvisioningStatus + """ Operation in progress on the purchase, such as its activation or renewal """ purchase_name: PurchaseName + """ Names of the purchase: the name of the service, the name of its object and the two together """ activation_quantity: int """ Quantity (instances) purchased. """ quantity: int """ Current purchase quantity (instances). """ - activation_price: Amount + activation_price: Amount | None + """ Purchase price; null for sub-accounts. """ renew_price: Amount | None - """ Renew price (applied on recurring purchases only). """ + """ Renew price (applied on recurring purchases only); null for sub-accounts. """ restore_price: Amount | None - """ Restore/reactivation price (applied on domains only). """ + """ Restore/reactivation price (applied on domains only); null for sub-accounts. """ date_activation: datetime.date | None """ Purchase date. """ date_activation_start: datetime.date | None @@ -59,9 +68,10 @@ class Purchase: """ Tells if purchase has to be renewed. """ suspended: bool """ Tells if purchase is currently suspended. """ - comment: str + comment: None | str """ User comment (will be included in invoice description). """ billing_data: BillingData + """ Italian public administration codes of a document row: CIG, CUP and ODA """ tasks: list[Task] """ Tasks currently running on the purchase. """ purchase_additionals: list[int] @@ -84,8 +94,6 @@ class Purchase: """ ID of the license associated with this purchase. """ microsoft365_id: int | None """ ID of the Microsoft 365 subscription associated with this purchase. """ - securemail_id: int | None - """ ID of the SecureMail by LibraESVA associated with this purchase. """ cloud_storage_id: int | None """ ID of the cloud storage associated with this purchase. """ object_storage_id: int | None @@ -129,7 +137,11 @@ def to_dict(self) -> dict[str, Any]: quantity = self.quantity - activation_price = self.activation_price.to_dict() + activation_price: dict[str, Any] | None + if isinstance(self.activation_price, Amount): + activation_price = self.activation_price.to_dict() + else: + activation_price = self.activation_price renew_price: dict[str, Any] | None if isinstance(self.renew_price, Amount): @@ -171,6 +183,7 @@ def to_dict(self) -> dict[str, Any]: suspended = self.suspended + comment: None | str comment = self.comment billing_data = self.billing_data.to_dict() @@ -209,9 +222,6 @@ def to_dict(self) -> dict[str, Any]: microsoft365_id: int | None microsoft365_id = self.microsoft365_id - securemail_id: int | None - securemail_id = self.securemail_id - cloud_storage_id: int | None cloud_storage_id = self.cloud_storage_id @@ -261,7 +271,6 @@ def to_dict(self) -> dict[str, Any]: "monitoring_id": monitoring_id, "license_id": license_id, "microsoft365_id": microsoft365_id, - "securemail_id": securemail_id, "cloud_storage_id": cloud_storage_id, "object_storage_id": object_storage_id, "veeam_baas_id": veeam_baas_id, @@ -331,7 +340,20 @@ def _parse_purchase_id_primary(data: object) -> int | None: quantity = d.pop("quantity") - activation_price = Amount.from_dict(d.pop("activation_price")) + def _parse_activation_price(data: object) -> Amount | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + activation_price_type_0 = Amount.from_dict(data) + + return activation_price_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(Amount | None, data) + + activation_price = _parse_activation_price(d.pop("activation_price")) def _parse_renew_price(data: object) -> Amount | None: if data is None: @@ -427,7 +449,12 @@ def _parse_date_dismission(data: object) -> datetime.date | None: suspended = d.pop("suspended") - comment = d.pop("comment") + def _parse_comment(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + comment = _parse_comment(d.pop("comment")) billing_data = BillingData.from_dict(d.pop("billing_data")) @@ -503,13 +530,6 @@ def _parse_microsoft365_id(data: object) -> int | None: microsoft365_id = _parse_microsoft365_id(d.pop("microsoft365_id")) - def _parse_securemail_id(data: object) -> int | None: - if data is None: - return data - return cast(int | None, data) - - securemail_id = _parse_securemail_id(d.pop("securemail_id")) - def _parse_cloud_storage_id(data: object) -> int | None: if data is None: return data @@ -568,7 +588,6 @@ def _parse_veeam_baas_id(data: object) -> int | None: monitoring_id=monitoring_id, license_id=license_id, microsoft365_id=microsoft365_id, - securemail_id=securemail_id, cloud_storage_id=cloud_storage_id, object_storage_id=object_storage_id, veeam_baas_id=veeam_baas_id, diff --git a/src/shellrent_sdk/client/models/purchase_billing_info_change_request.py b/src/shellrent_sdk/client/models/purchase_billing_info_change_request.py index 64bbb61..9aa0bdf 100644 --- a/src/shellrent_sdk/client/models/purchase_billing_info_change_request.py +++ b/src/shellrent_sdk/client/models/purchase_billing_info_change_request.py @@ -4,7 +4,6 @@ from typing import Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -13,10 +12,17 @@ @_attrs_define class PurchaseBillingInfoChangeRequest: + """Billing data of the purchase to change: at least one of `oda`, `cig` and `cup`; the ones omitted stay unchanged""" + oda: str | Unset = UNSET + """ Number of the purchase order (ODA, "Ordine di Acquisto") of an Italian public administration, reported on + the invoices of the purchase """ cig: str | Unset = UNSET + """ CIG ("Codice Identificativo Gara"), the Italian code of a public tender, reported on the invoices of the + purchase """ cup: str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + """ CUP ("Codice Unico di Progetto"), the Italian code of a public investment project, reported on the invoices + of the purchase """ def to_dict(self) -> dict[str, Any]: oda = self.oda @@ -26,7 +32,7 @@ def to_dict(self) -> dict[str, Any]: cup = self.cup field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if oda is not UNSET: field_dict["oda"] = oda @@ -52,21 +58,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: cup=cup, ) - purchase_billing_info_change_request.additional_properties = d return purchase_billing_info_change_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/purchase_can_add_additional.py b/src/shellrent_sdk/client/models/purchase_can_add_additional.py index 91e1c6b..1b6c3f4 100644 --- a/src/shellrent_sdk/client/models/purchase_can_add_additional.py +++ b/src/shellrent_sdk/client/models/purchase_can_add_additional.py @@ -15,10 +15,14 @@ @_attrs_define class PurchaseCanAddAdditional: + """Whether additional services can be bought for the purchase, with the services available""" + purchase_id: int + """ Id of the purchase (`GET /api/v3/purchases/{purchase_id}`) """ can_add_additional: bool + """ Whether additional services can be bought for the purchase now """ services: list[Service] - """ Collection of Services to which it is possible to make the change. """ + """ Additional services that can be bought for the purchase; empty when `can_add_additional` is false """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/purchase_can_add_additional_response.py b/src/shellrent_sdk/client/models/purchase_can_add_additional_response.py index 6538342..3640ae9 100644 --- a/src/shellrent_sdk/client/models/purchase_can_add_additional_response.py +++ b/src/shellrent_sdk/client/models/purchase_can_add_additional_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.purchase_can_add_additional import PurchaseCanAddAdditional - from ..models.purchase_can_add_additional_response_meta_type_0 import ( - PurchaseCanAddAdditionalResponseMetaType0, - ) T = TypeVar("T", bound="PurchaseCanAddAdditionalResponse") @@ -18,17 +15,19 @@ @_attrs_define class PurchaseCanAddAdditionalResponse: - error: int + """Successful response with one `PurchaseCanAddAdditional`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: PurchaseCanAddAdditional - meta: None | PurchaseCanAddAdditionalResponseMetaType0 + """ Whether additional services can be bought for the purchase, with the services available """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.purchase_can_add_additional_response_meta_type_0 import ( - PurchaseCanAddAdditionalResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, PurchaseCanAddAdditionalResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -58,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.purchase_can_add_additional import PurchaseCanAddAdditional - from ..models.purchase_can_add_additional_response_meta_type_0 import ( - PurchaseCanAddAdditionalResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -74,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = PurchaseCanAddAdditional.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | PurchaseCanAddAdditionalResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = PurchaseCanAddAdditionalResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | PurchaseCanAddAdditionalResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") purchase_can_add_additional_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/purchase_can_add_additional_response_meta_type_0.py b/src/shellrent_sdk/client/models/purchase_can_add_additional_response_meta_type_0.py deleted file mode 100644 index 289892e..0000000 --- a/src/shellrent_sdk/client/models/purchase_can_add_additional_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="PurchaseCanAddAdditionalResponseMetaType0") - - -@_attrs_define -class PurchaseCanAddAdditionalResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - purchase_can_add_additional_response_meta_type_0 = cls() - - purchase_can_add_additional_response_meta_type_0.additional_properties = d - return purchase_can_add_additional_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/purchase_can_cancel.py b/src/shellrent_sdk/client/models/purchase_can_cancel.py index 9533392..7971a5c 100644 --- a/src/shellrent_sdk/client/models/purchase_can_cancel.py +++ b/src/shellrent_sdk/client/models/purchase_can_cancel.py @@ -11,8 +11,13 @@ @_attrs_define class PurchaseCanCancel: + """Whether the purchase can be cancelled (`DELETE /api/v3/purchases/{purchase_id}`)""" + purchase_id: int + """ Id of the purchase (`GET /api/v3/purchases/{purchase_id}`) """ can_cancel: bool + """ Whether the purchase can be cancelled: only before its activation, and if its additional purchases can be + cancelled too """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/purchase_can_cancel_response.py b/src/shellrent_sdk/client/models/purchase_can_cancel_response.py index 2b07719..b08d9df 100644 --- a/src/shellrent_sdk/client/models/purchase_can_cancel_response.py +++ b/src/shellrent_sdk/client/models/purchase_can_cancel_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.purchase_can_cancel import PurchaseCanCancel - from ..models.purchase_can_cancel_response_meta_type_0 import PurchaseCanCancelResponseMetaType0 T = TypeVar("T", bound="PurchaseCanCancelResponse") @@ -16,17 +15,19 @@ @_attrs_define class PurchaseCanCancelResponse: - error: int + """Successful response with one `PurchaseCanCancel`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: PurchaseCanCancel - meta: None | PurchaseCanCancelResponseMetaType0 + """ Whether the purchase can be cancelled (`DELETE /api/v3/purchases/{purchase_id}`) """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.purchase_can_cancel_response_meta_type_0 import ( - PurchaseCanCancelResponseMetaType0, - ) - error = self.error message: None | str @@ -34,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, PurchaseCanCancelResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -56,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.purchase_can_cancel import PurchaseCanCancel - from ..models.purchase_can_cancel_response_meta_type_0 import ( - PurchaseCanCancelResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -72,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = PurchaseCanCancel.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | PurchaseCanCancelResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = PurchaseCanCancelResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | PurchaseCanCancelResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") purchase_can_cancel_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/purchase_can_cancel_response_meta_type_0.py b/src/shellrent_sdk/client/models/purchase_can_cancel_response_meta_type_0.py deleted file mode 100644 index 4fec08d..0000000 --- a/src/shellrent_sdk/client/models/purchase_can_cancel_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="PurchaseCanCancelResponseMetaType0") - - -@_attrs_define -class PurchaseCanCancelResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - purchase_can_cancel_response_meta_type_0 = cls() - - purchase_can_cancel_response_meta_type_0.additional_properties = d - return purchase_can_cancel_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/purchase_can_change_recurrence.py b/src/shellrent_sdk/client/models/purchase_can_change_recurrence.py index 9f860f1..4073623 100644 --- a/src/shellrent_sdk/client/models/purchase_can_change_recurrence.py +++ b/src/shellrent_sdk/client/models/purchase_can_change_recurrence.py @@ -11,8 +11,12 @@ @_attrs_define class PurchaseCanChangeRecurrence: + """Whether the recurrence of the purchase can be changed (`PATCH /api/v3/purchases/{purchase_id}/recurrence`)""" + purchase_id: int + """ Id of the purchase (`GET /api/v3/purchases/{purchase_id}`) """ can_change_recurrence: bool + """ Whether the recurrence can be changed to the one in the `recurrence_id` query parameter """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/purchase_can_change_recurrence_response.py b/src/shellrent_sdk/client/models/purchase_can_change_recurrence_response.py index 7f1607d..67a615a 100644 --- a/src/shellrent_sdk/client/models/purchase_can_change_recurrence_response.py +++ b/src/shellrent_sdk/client/models/purchase_can_change_recurrence_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.purchase_can_change_recurrence import PurchaseCanChangeRecurrence - from ..models.purchase_can_change_recurrence_response_meta_type_0 import ( - PurchaseCanChangeRecurrenceResponseMetaType0, - ) T = TypeVar("T", bound="PurchaseCanChangeRecurrenceResponse") @@ -18,17 +15,20 @@ @_attrs_define class PurchaseCanChangeRecurrenceResponse: - error: int + """Successful response with one `PurchaseCanChangeRecurrence`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: PurchaseCanChangeRecurrence - meta: None | PurchaseCanChangeRecurrenceResponseMetaType0 + """ Whether the recurrence of the purchase can be changed (`PATCH /api/v3/purchases/{purchase_id}/recurrence`) + """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.purchase_can_change_recurrence_response_meta_type_0 import ( - PurchaseCanChangeRecurrenceResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +36,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, PurchaseCanChangeRecurrenceResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -60,12 +56,11 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.purchase_can_change_recurrence import ( PurchaseCanChangeRecurrence, ) - from ..models.purchase_can_change_recurrence_response_meta_type_0 import ( - PurchaseCanChangeRecurrenceResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -76,20 +71,7 @@ def _parse_message(data: object) -> None | str: data = PurchaseCanChangeRecurrence.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | PurchaseCanChangeRecurrenceResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = PurchaseCanChangeRecurrenceResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | PurchaseCanChangeRecurrenceResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") purchase_can_change_recurrence_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/purchase_can_change_recurrence_response_meta_type_0.py b/src/shellrent_sdk/client/models/purchase_can_change_recurrence_response_meta_type_0.py deleted file mode 100644 index e1e2f42..0000000 --- a/src/shellrent_sdk/client/models/purchase_can_change_recurrence_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="PurchaseCanChangeRecurrenceResponseMetaType0") - - -@_attrs_define -class PurchaseCanChangeRecurrenceResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - purchase_can_change_recurrence_response_meta_type_0 = cls() - - purchase_can_change_recurrence_response_meta_type_0.additional_properties = d - return purchase_can_change_recurrence_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/purchase_can_change_renew_status.py b/src/shellrent_sdk/client/models/purchase_can_change_renew_status.py index 5c06d45..818719b 100644 --- a/src/shellrent_sdk/client/models/purchase_can_change_renew_status.py +++ b/src/shellrent_sdk/client/models/purchase_can_change_renew_status.py @@ -11,8 +11,12 @@ @_attrs_define class PurchaseCanChangeRenewStatus: + """Whether the renew status of the purchase can be changed (`PATCH /api/v3/purchases/{purchase_id}/renew-status`)""" + purchase_id: int + """ Id of the purchase (`GET /api/v3/purchases/{purchase_id}`) """ can_change_renew_status: bool + """ Whether the renew status can be set to the one in the `status` query parameter """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/purchase_can_change_renew_status_response.py b/src/shellrent_sdk/client/models/purchase_can_change_renew_status_response.py index af9c9ae..473b918 100644 --- a/src/shellrent_sdk/client/models/purchase_can_change_renew_status_response.py +++ b/src/shellrent_sdk/client/models/purchase_can_change_renew_status_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.purchase_can_change_renew_status import PurchaseCanChangeRenewStatus - from ..models.purchase_can_change_renew_status_response_meta_type_0 import ( - PurchaseCanChangeRenewStatusResponseMetaType0, - ) T = TypeVar("T", bound="PurchaseCanChangeRenewStatusResponse") @@ -18,17 +15,20 @@ @_attrs_define class PurchaseCanChangeRenewStatusResponse: - error: int + """Successful response with one `PurchaseCanChangeRenewStatus`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: PurchaseCanChangeRenewStatus - meta: None | PurchaseCanChangeRenewStatusResponseMetaType0 + """ Whether the renew status of the purchase can be changed (`PATCH /api/v3/purchases/{purchase_id}/renew- + status`) """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.purchase_can_change_renew_status_response_meta_type_0 import ( - PurchaseCanChangeRenewStatusResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +36,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, PurchaseCanChangeRenewStatusResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -60,12 +56,11 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.purchase_can_change_renew_status import ( PurchaseCanChangeRenewStatus, ) - from ..models.purchase_can_change_renew_status_response_meta_type_0 import ( - PurchaseCanChangeRenewStatusResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -76,20 +71,7 @@ def _parse_message(data: object) -> None | str: data = PurchaseCanChangeRenewStatus.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | PurchaseCanChangeRenewStatusResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = PurchaseCanChangeRenewStatusResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | PurchaseCanChangeRenewStatusResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") purchase_can_change_renew_status_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/purchase_can_change_renew_status_response_meta_type_0.py b/src/shellrent_sdk/client/models/purchase_can_change_renew_status_response_meta_type_0.py deleted file mode 100644 index 291b11e..0000000 --- a/src/shellrent_sdk/client/models/purchase_can_change_renew_status_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="PurchaseCanChangeRenewStatusResponseMetaType0") - - -@_attrs_define -class PurchaseCanChangeRenewStatusResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - purchase_can_change_renew_status_response_meta_type_0 = cls() - - purchase_can_change_renew_status_response_meta_type_0.additional_properties = d - return purchase_can_change_renew_status_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/purchase_can_change_service.py b/src/shellrent_sdk/client/models/purchase_can_change_service.py index ea8aa38..e9c96fd 100644 --- a/src/shellrent_sdk/client/models/purchase_can_change_service.py +++ b/src/shellrent_sdk/client/models/purchase_can_change_service.py @@ -15,8 +15,12 @@ @_attrs_define class PurchaseCanChangeService: + """Whether the service of the purchase can be changed (plan change), with the services available""" + purchase_id: int + """ Id of the purchase (`GET /api/v3/purchases/{purchase_id}`) """ can_change_service: bool + """ Whether the purchase allows a change of service now """ services: list[ServiceChange] """ Collection of Services to which it is possible to make the change. """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) diff --git a/src/shellrent_sdk/client/models/purchase_can_change_service_response.py b/src/shellrent_sdk/client/models/purchase_can_change_service_response.py index fd6c9b6..62f36d9 100644 --- a/src/shellrent_sdk/client/models/purchase_can_change_service_response.py +++ b/src/shellrent_sdk/client/models/purchase_can_change_service_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.purchase_can_change_service import PurchaseCanChangeService - from ..models.purchase_can_change_service_response_meta_type_0 import ( - PurchaseCanChangeServiceResponseMetaType0, - ) T = TypeVar("T", bound="PurchaseCanChangeServiceResponse") @@ -18,17 +15,19 @@ @_attrs_define class PurchaseCanChangeServiceResponse: - error: int + """Successful response with one `PurchaseCanChangeService`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: PurchaseCanChangeService - meta: None | PurchaseCanChangeServiceResponseMetaType0 + """ Whether the service of the purchase can be changed (plan change), with the services available """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.purchase_can_change_service_response_meta_type_0 import ( - PurchaseCanChangeServiceResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, PurchaseCanChangeServiceResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -58,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.purchase_can_change_service import PurchaseCanChangeService - from ..models.purchase_can_change_service_response_meta_type_0 import ( - PurchaseCanChangeServiceResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -74,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = PurchaseCanChangeService.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | PurchaseCanChangeServiceResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = PurchaseCanChangeServiceResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | PurchaseCanChangeServiceResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") purchase_can_change_service_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/purchase_can_change_service_response_meta_type_0.py b/src/shellrent_sdk/client/models/purchase_can_change_service_response_meta_type_0.py deleted file mode 100644 index 7f5e42e..0000000 --- a/src/shellrent_sdk/client/models/purchase_can_change_service_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="PurchaseCanChangeServiceResponseMetaType0") - - -@_attrs_define -class PurchaseCanChangeServiceResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - purchase_can_change_service_response_meta_type_0 = cls() - - purchase_can_change_service_response_meta_type_0.additional_properties = d - return purchase_can_change_service_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/purchase_can_renew.py b/src/shellrent_sdk/client/models/purchase_can_renew.py index 9ad16ca..3c37b56 100644 --- a/src/shellrent_sdk/client/models/purchase_can_renew.py +++ b/src/shellrent_sdk/client/models/purchase_can_renew.py @@ -11,8 +11,13 @@ @_attrs_define class PurchaseCanRenew: + """Whether the purchase can be renewed now (`POST /api/v3/purchases/{purchase_id}/renewals`)""" + purchase_id: int + """ Id of the purchase (`GET /api/v3/purchases/{purchase_id}`) """ can_renew: bool + """ Whether the purchase can be renewed now: possible from `recurrence.days_renew` days before the expiry, when + it is set to renew and has no pending order """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/purchase_can_renew_response.py b/src/shellrent_sdk/client/models/purchase_can_renew_response.py index 93337d6..88000d3 100644 --- a/src/shellrent_sdk/client/models/purchase_can_renew_response.py +++ b/src/shellrent_sdk/client/models/purchase_can_renew_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.purchase_can_renew import PurchaseCanRenew - from ..models.purchase_can_renew_response_meta_type_0 import PurchaseCanRenewResponseMetaType0 T = TypeVar("T", bound="PurchaseCanRenewResponse") @@ -16,17 +15,19 @@ @_attrs_define class PurchaseCanRenewResponse: - error: int + """Successful response with one `PurchaseCanRenew`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: PurchaseCanRenew - meta: None | PurchaseCanRenewResponseMetaType0 + """ Whether the purchase can be renewed now (`POST /api/v3/purchases/{purchase_id}/renewals`) """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.purchase_can_renew_response_meta_type_0 import ( - PurchaseCanRenewResponseMetaType0, - ) - error = self.error message: None | str @@ -34,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, PurchaseCanRenewResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -56,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.purchase_can_renew import PurchaseCanRenew - from ..models.purchase_can_renew_response_meta_type_0 import ( - PurchaseCanRenewResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -72,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = PurchaseCanRenew.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | PurchaseCanRenewResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = PurchaseCanRenewResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | PurchaseCanRenewResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") purchase_can_renew_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/purchase_can_renew_response_meta_type_0.py b/src/shellrent_sdk/client/models/purchase_can_renew_response_meta_type_0.py deleted file mode 100644 index c985e80..0000000 --- a/src/shellrent_sdk/client/models/purchase_can_renew_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="PurchaseCanRenewResponseMetaType0") - - -@_attrs_define -class PurchaseCanRenewResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - purchase_can_renew_response_meta_type_0 = cls() - - purchase_can_renew_response_meta_type_0.additional_properties = d - return purchase_can_renew_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/purchase_comment_change_request.py b/src/shellrent_sdk/client/models/purchase_comment_change_request.py index 11ba227..754b21e 100644 --- a/src/shellrent_sdk/client/models/purchase_comment_change_request.py +++ b/src/shellrent_sdk/client/models/purchase_comment_change_request.py @@ -4,7 +4,6 @@ from typing import Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="PurchaseCommentChangeRequest") @@ -12,13 +11,13 @@ @_attrs_define class PurchaseCommentChangeRequest: comment: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + """ Comment of the user on the purchase, also shown in the description of its invoices """ def to_dict(self) -> dict[str, Any]: comment = self.comment field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "comment": comment, @@ -36,21 +35,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: comment=comment, ) - purchase_comment_change_request.additional_properties = d return purchase_comment_change_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/purchase_name.py b/src/shellrent_sdk/client/models/purchase_name.py index 76eecaa..7cef133 100644 --- a/src/shellrent_sdk/client/models/purchase_name.py +++ b/src/shellrent_sdk/client/models/purchase_name.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import Any, Self, TypeVar +from typing import Any, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -11,11 +11,13 @@ @_attrs_define class PurchaseName: + """Names of the purchase: the name of the service, the name of its object and the two together""" + name: str """ Service name """ full_name: str """ Complete name (Service and object name) """ - object_name: str + object_name: None | str """ Name of the purchase object (ie. domain name, server hostname, etc.) """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -24,6 +26,7 @@ def to_dict(self) -> dict[str, Any]: full_name = self.full_name + object_name: None | str object_name = self.object_name field_dict: dict[str, Any] = {} @@ -45,7 +48,12 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: full_name = d.pop("full_name") - object_name = d.pop("object_name") + def _parse_object_name(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + object_name = _parse_object_name(d.pop("object_name")) purchase_name = cls( name=name, diff --git a/src/shellrent_sdk/client/models/purchase_paginated_list_response.py b/src/shellrent_sdk/client/models/purchase_paginated_list_response.py index 907ab38..6fdbda4 100644 --- a/src/shellrent_sdk/client/models/purchase_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/purchase_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class PurchasePaginatedListResponse: - error: int + """Successful response with a page of `Purchase`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[Purchase] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.purchase import Purchase d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/purchase_provisioning_status.py b/src/shellrent_sdk/client/models/purchase_provisioning_status.py index 8e14ea5..ebd596e 100644 --- a/src/shellrent_sdk/client/models/purchase_provisioning_status.py +++ b/src/shellrent_sdk/client/models/purchase_provisioning_status.py @@ -11,8 +11,13 @@ @_attrs_define class PurchaseProvisioningStatus: + """Operation in progress on the purchase, such as its activation or renewal""" + status_code: str + """ Code of the operation in progress: `SLEEPY` (none), `TO_ACTIVATE`, `TO_RENEW`, `TO_SUSPEND`, `TO_RESUME` + (reactivation), `TO_DISMISS` or `TO_CANCEL` """ status_name: str + """ Name of the operation in progress, in Italian """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/purchase_recurrence_change_request.py b/src/shellrent_sdk/client/models/purchase_recurrence_change_request.py index 72db7d7..a336314 100644 --- a/src/shellrent_sdk/client/models/purchase_recurrence_change_request.py +++ b/src/shellrent_sdk/client/models/purchase_recurrence_change_request.py @@ -4,7 +4,6 @@ from typing import Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="PurchaseRecurrenceChangeRequest") @@ -13,13 +12,12 @@ class PurchaseRecurrenceChangeRequest: recurrence_id: int """ ID of the recurrence to use on the purchase """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: recurrence_id = self.recurrence_id field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "recurrence_id": recurrence_id, @@ -37,21 +35,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: recurrence_id=recurrence_id, ) - purchase_recurrence_change_request.additional_properties = d return purchase_recurrence_change_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/purchase_renew_status_change_request.py b/src/shellrent_sdk/client/models/purchase_renew_status_change_request.py index 3a8b0a4..bb6b064 100644 --- a/src/shellrent_sdk/client/models/purchase_renew_status_change_request.py +++ b/src/shellrent_sdk/client/models/purchase_renew_status_change_request.py @@ -4,7 +4,6 @@ from typing import Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="PurchaseRenewStatusChangeRequest") @@ -13,13 +12,12 @@ class PurchaseRenewStatusChangeRequest: do_not_renew: bool """ If true, the purchase will not renew. """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: do_not_renew = self.do_not_renew field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "do_not_renew": do_not_renew, @@ -37,21 +35,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: do_not_renew=do_not_renew, ) - purchase_renew_status_change_request.additional_properties = d return purchase_renew_status_change_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/purchase_response.py b/src/shellrent_sdk/client/models/purchase_response.py index 5af4349..e759ad1 100644 --- a/src/shellrent_sdk/client/models/purchase_response.py +++ b/src/shellrent_sdk/client/models/purchase_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.purchase import Purchase - from ..models.purchase_response_meta_type_0 import PurchaseResponseMetaType0 T = TypeVar("T", bound="PurchaseResponse") @@ -16,15 +15,19 @@ @_attrs_define class PurchaseResponse: - error: int + """Successful response with one `Purchase`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: Purchase - meta: None | PurchaseResponseMetaType0 + """ Purchase of a service, with its status, prices, recurrence, billing data and the resources linked to it """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.purchase_response_meta_type_0 import PurchaseResponseMetaType0 - error = self.error message: None | str @@ -32,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, PurchaseResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.purchase import Purchase - from ..models.purchase_response_meta_type_0 import ( - PurchaseResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -70,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = Purchase.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | PurchaseResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = PurchaseResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | PurchaseResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") purchase_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/purchase_response_meta_type_0.py b/src/shellrent_sdk/client/models/purchase_response_meta_type_0.py deleted file mode 100644 index a95bb03..0000000 --- a/src/shellrent_sdk/client/models/purchase_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="PurchaseResponseMetaType0") - - -@_attrs_define -class PurchaseResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - purchase_response_meta_type_0 = cls() - - purchase_response_meta_type_0.additional_properties = d - return purchase_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/purchase_status.py b/src/shellrent_sdk/client/models/purchase_status.py index 92ee388..bcbf704 100644 --- a/src/shellrent_sdk/client/models/purchase_status.py +++ b/src/shellrent_sdk/client/models/purchase_status.py @@ -12,7 +12,11 @@ @_attrs_define class PurchaseStatus: status_code: str + """ Status code: `NEW_V2` (just created), `ACTIVE_V2` (active), `DELIVERED_V2` (active without renewals), + `DISMISSED_V2` (at the end of its life), `CANCELED_V2` (cancelled before the activation) or `DELETED_V2` + (deleted one-off purchase) """ status_name: str + """ Name of the status, in Italian """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/recurrence.py b/src/shellrent_sdk/client/models/recurrence.py index 0122190..287d979 100644 --- a/src/shellrent_sdk/client/models/recurrence.py +++ b/src/shellrent_sdk/client/models/recurrence.py @@ -15,17 +15,29 @@ @_attrs_define class Recurrence: + """Billing recurrence: its frequency and, in days, the timings of renewal, suspension and dismission""" + recurrence_id: int frequency: RecurrenceFrequency + """ Frequency of a recurrence: a number of years, months or weeks, or a one-off charge """ days_renew: int | None + """ Days before the expiry from which the purchase can be renewed and the renewal order is created """ days_autorenew: int | None + """ Days before the expiry when the automatic renewal is attempted """ days_suspension: int | None + """ Days after the expiry when a purchase not renewed is suspended; null if it is not suspended """ days_restore: int | None + """ Days after the expiry from which the restore price is charged in addition to the renewal price """ days_dismission: int | None - days_cancel: int + """ Days after the expiry when a purchase not renewed is dismissed """ + days_cancel: int | None + """ Days after the start of the activation when a purchase never activated is cancelled automatically """ days_renew_dismission: int | None + """ Days after the expiry when a purchase whose renewal was not completed is dismissed automatically """ days_no_secondary: int | None + """ Days before the expiry from which additional services can no longer be bought for the purchase """ days_no_service_change: int | None + """ Days before the expiry from which the service of the purchase can no longer be changed """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -48,6 +60,7 @@ def to_dict(self) -> dict[str, Any]: days_dismission: int | None days_dismission = self.days_dismission + days_cancel: int | None days_cancel = self.days_cancel days_renew_dismission: int | None @@ -123,7 +136,12 @@ def _parse_days_dismission(data: object) -> int | None: days_dismission = _parse_days_dismission(d.pop("days_dismission")) - days_cancel = d.pop("days_cancel") + def _parse_days_cancel(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + days_cancel = _parse_days_cancel(d.pop("days_cancel")) def _parse_days_renew_dismission(data: object) -> int | None: if data is None: diff --git a/src/shellrent_sdk/client/models/recurrence_frequency.py b/src/shellrent_sdk/client/models/recurrence_frequency.py index c337132..d93a59a 100644 --- a/src/shellrent_sdk/client/models/recurrence_frequency.py +++ b/src/shellrent_sdk/client/models/recurrence_frequency.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import Any, Self, TypeVar +from typing import Any, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -11,13 +11,18 @@ @_attrs_define class RecurrenceFrequency: + """Frequency of a recurrence: a number of years, months or weeks, or a one-off charge""" + family: str - value: int + """ Unit of the frequency: `Y` (years), `M` (months), `W` (weeks) or `U` (one-off, without renewals) """ + value: int | None + """ Number of units of the frequency, for example 12 with `M`; null with `U` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: family = self.family + value: int | None value = self.value field_dict: dict[str, Any] = {} @@ -36,7 +41,12 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) family = d.pop("family") - value = d.pop("value") + def _parse_value(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + value = _parse_value(d.pop("value")) recurrence_frequency = cls( family=family, diff --git a/src/shellrent_sdk/client/models/request_access_token_body.py b/src/shellrent_sdk/client/models/request_access_token_body.py index 60b6af1..7ff45d9 100644 --- a/src/shellrent_sdk/client/models/request_access_token_body.py +++ b/src/shellrent_sdk/client/models/request_access_token_body.py @@ -17,13 +17,13 @@ class RequestAccessTokenBody: grant_type: RequestAccessTokenBodyGrantType client_id: None | str | Unset = UNSET - """ Client ID se non fornito tramite Authorization header Basic. """ + """ Client ID, when it is not sent in the Basic Authorization header. """ client_secret: None | str | Unset = UNSET - """ Client secret se non fornito tramite Authorization header Basic. """ + """ Client secret, when it is not sent in the Basic Authorization header. """ scope: None | str | Unset = UNSET - """ Scope separati da spazio. Se omesso: tutti gli scope assegnati al client. """ + """ Space-separated scopes. When omitted: all the scopes assigned to the client. """ audience: None | OAuthAudience | Unset = UNSET - """ Se omessa: l'unica audience del client. """ + """ When omitted or empty: the only audience of the client. """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/sdi_document_status.py b/src/shellrent_sdk/client/models/sdi_document_status.py index fb50a49..29a39b0 100644 --- a/src/shellrent_sdk/client/models/sdi_document_status.py +++ b/src/shellrent_sdk/client/models/sdi_document_status.py @@ -11,8 +11,12 @@ @_attrs_define class SdiDocumentStatus: + """Status of an electronic document on SDI (`Sistema di Interscambio`), the Italian e-invoicing exchange system""" + status_code: str + """ One of `TO_SIGN`, `TO_SEND`, `SENT`, `DELIVERED`, `NOT_DELIVERED` or `DISCARDED` (rejected by SDI) """ status_name: str + """ Name of the status, in Italian """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/sdi_document_type.py b/src/shellrent_sdk/client/models/sdi_document_type.py index 20c9caa..1a3975f 100644 --- a/src/shellrent_sdk/client/models/sdi_document_type.py +++ b/src/shellrent_sdk/client/models/sdi_document_type.py @@ -11,8 +11,12 @@ @_attrs_define class SdiDocumentType: + """Type of an electronic document on SDI, the Italian e-invoicing exchange system (`TipoDocumento`)""" + type_code: str + """ Code of the type, for example `TD01` (invoice), `TD02` (deposit invoice) or `TD04` (credit note) """ type_description: str + """ Description of the type, in Italian """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/securemail.py b/src/shellrent_sdk/client/models/securemail.py deleted file mode 100644 index d94f267..0000000 --- a/src/shellrent_sdk/client/models/securemail.py +++ /dev/null @@ -1,168 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="Securemail") - - -@_attrs_define -class Securemail: - securemail_id: int - purchase_id: int - service_name: None | str - purchase_name: None | str - purchase_status_code: None | str - quantity: int | None - domain: None | str - relay_to: None | str - relay_to_port: int | None - is_feasible: bool - provider: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - securemail_id = self.securemail_id - - purchase_id = self.purchase_id - - service_name: None | str - service_name = self.service_name - - purchase_name: None | str - purchase_name = self.purchase_name - - purchase_status_code: None | str - purchase_status_code = self.purchase_status_code - - quantity: int | None - quantity = self.quantity - - domain: None | str - domain = self.domain - - relay_to: None | str - relay_to = self.relay_to - - relay_to_port: int | None - relay_to_port = self.relay_to_port - - is_feasible = self.is_feasible - - provider = self.provider - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "securemail_id": securemail_id, - "purchase_id": purchase_id, - "service_name": service_name, - "purchase_name": purchase_name, - "purchase_status_code": purchase_status_code, - "quantity": quantity, - "domain": domain, - "relay_to": relay_to, - "relay_to_port": relay_to_port, - "is_feasible": is_feasible, - "provider": provider, - } - ) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - securemail_id = d.pop("securemail_id") - - purchase_id = d.pop("purchase_id") - - def _parse_service_name(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - service_name = _parse_service_name(d.pop("service_name")) - - def _parse_purchase_name(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - purchase_name = _parse_purchase_name(d.pop("purchase_name")) - - def _parse_purchase_status_code(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - purchase_status_code = _parse_purchase_status_code(d.pop("purchase_status_code")) - - def _parse_quantity(data: object) -> int | None: - if data is None: - return data - return cast(int | None, data) - - quantity = _parse_quantity(d.pop("quantity")) - - def _parse_domain(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - domain = _parse_domain(d.pop("domain")) - - def _parse_relay_to(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - relay_to = _parse_relay_to(d.pop("relay_to")) - - def _parse_relay_to_port(data: object) -> int | None: - if data is None: - return data - return cast(int | None, data) - - relay_to_port = _parse_relay_to_port(d.pop("relay_to_port")) - - is_feasible = d.pop("is_feasible") - - provider = d.pop("provider") - - securemail = cls( - securemail_id=securemail_id, - purchase_id=purchase_id, - service_name=service_name, - purchase_name=purchase_name, - purchase_status_code=purchase_status_code, - quantity=quantity, - domain=domain, - relay_to=relay_to, - relay_to_port=relay_to_port, - is_feasible=is_feasible, - provider=provider, - ) - - securemail.additional_properties = d - return securemail - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/securemail_mailbox.py b/src/shellrent_sdk/client/models/securemail_mailbox.py deleted file mode 100644 index 46edf94..0000000 --- a/src/shellrent_sdk/client/models/securemail_mailbox.py +++ /dev/null @@ -1,109 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="SecuremailMailbox") - - -@_attrs_define -class SecuremailMailbox: - mailbox_id: int - email_address: None | str - status: None | str - is_primary: bool - valid_recipient_id: int | None - aliases_count: int - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - mailbox_id = self.mailbox_id - - email_address: None | str - email_address = self.email_address - - status: None | str - status = self.status - - is_primary = self.is_primary - - valid_recipient_id: int | None - valid_recipient_id = self.valid_recipient_id - - aliases_count = self.aliases_count - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "mailbox_id": mailbox_id, - "email_address": email_address, - "status": status, - "is_primary": is_primary, - "valid_recipient_id": valid_recipient_id, - "aliases_count": aliases_count, - } - ) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - mailbox_id = d.pop("mailbox_id") - - def _parse_email_address(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - email_address = _parse_email_address(d.pop("email_address")) - - def _parse_status(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - status = _parse_status(d.pop("status")) - - is_primary = d.pop("is_primary") - - def _parse_valid_recipient_id(data: object) -> int | None: - if data is None: - return data - return cast(int | None, data) - - valid_recipient_id = _parse_valid_recipient_id(d.pop("valid_recipient_id")) - - aliases_count = d.pop("aliases_count") - - securemail_mailbox = cls( - mailbox_id=mailbox_id, - email_address=email_address, - status=status, - is_primary=is_primary, - valid_recipient_id=valid_recipient_id, - aliases_count=aliases_count, - ) - - securemail_mailbox.additional_properties = d - return securemail_mailbox - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/securemail_response.py b/src/shellrent_sdk/client/models/securemail_response.py deleted file mode 100644 index bcc3eb0..0000000 --- a/src/shellrent_sdk/client/models/securemail_response.py +++ /dev/null @@ -1,112 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.securemail import Securemail - from ..models.securemail_response_meta_type_0 import SecuremailResponseMetaType0 - - -T = TypeVar("T", bound="SecuremailResponse") - - -@_attrs_define -class SecuremailResponse: - error: int - message: None | str - data: Securemail - meta: None | SecuremailResponseMetaType0 - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.securemail_response_meta_type_0 import SecuremailResponseMetaType0 - - error = self.error - - message: None | str - message = self.message - - data = self.data.to_dict() - - meta: dict[str, Any] | None - if isinstance(self.meta, SecuremailResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "error": error, - "message": message, - "data": data, - "meta": meta, - } - ) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.securemail import Securemail - from ..models.securemail_response_meta_type_0 import ( - SecuremailResponseMetaType0, - ) - - d = dict(src_dict) - error = d.pop("error") - - def _parse_message(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - message = _parse_message(d.pop("message")) - - data = Securemail.from_dict(d.pop("data")) - - def _parse_meta(data: object) -> None | SecuremailResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = SecuremailResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | SecuremailResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) - - securemail_response = cls( - error=error, - message=message, - data=data, - meta=meta, - ) - - securemail_response.additional_properties = d - return securemail_response - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/securemail_response_meta_type_0.py b/src/shellrent_sdk/client/models/securemail_response_meta_type_0.py deleted file mode 100644 index 57ca6c3..0000000 --- a/src/shellrent_sdk/client/models/securemail_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="SecuremailResponseMetaType0") - - -@_attrs_define -class SecuremailResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - securemail_response_meta_type_0 = cls() - - securemail_response_meta_type_0.additional_properties = d - return securemail_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/securemail_statistics.py b/src/shellrent_sdk/client/models/securemail_statistics.py deleted file mode 100644 index ffc813d..0000000 --- a/src/shellrent_sdk/client/models/securemail_statistics.py +++ /dev/null @@ -1,91 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="SecuremailStatistics") - - -@_attrs_define -class SecuremailStatistics: - quantity: int - protected_mailboxes: int - not_protected_mailboxes: int - weekly_elaborated_messages: int - weekly_spam_messages: int - weekly_blocked_spam_percentage: int - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - quantity = self.quantity - - protected_mailboxes = self.protected_mailboxes - - not_protected_mailboxes = self.not_protected_mailboxes - - weekly_elaborated_messages = self.weekly_elaborated_messages - - weekly_spam_messages = self.weekly_spam_messages - - weekly_blocked_spam_percentage = self.weekly_blocked_spam_percentage - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "quantity": quantity, - "protected_mailboxes": protected_mailboxes, - "not_protected_mailboxes": not_protected_mailboxes, - "weekly_elaborated_messages": weekly_elaborated_messages, - "weekly_spam_messages": weekly_spam_messages, - "weekly_blocked_spam_percentage": weekly_blocked_spam_percentage, - } - ) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - quantity = d.pop("quantity") - - protected_mailboxes = d.pop("protected_mailboxes") - - not_protected_mailboxes = d.pop("not_protected_mailboxes") - - weekly_elaborated_messages = d.pop("weekly_elaborated_messages") - - weekly_spam_messages = d.pop("weekly_spam_messages") - - weekly_blocked_spam_percentage = d.pop("weekly_blocked_spam_percentage") - - securemail_statistics = cls( - quantity=quantity, - protected_mailboxes=protected_mailboxes, - not_protected_mailboxes=not_protected_mailboxes, - weekly_elaborated_messages=weekly_elaborated_messages, - weekly_spam_messages=weekly_spam_messages, - weekly_blocked_spam_percentage=weekly_blocked_spam_percentage, - ) - - securemail_statistics.additional_properties = d - return securemail_statistics - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/securemail_statistics_response.py b/src/shellrent_sdk/client/models/securemail_statistics_response.py deleted file mode 100644 index ab9e756..0000000 --- a/src/shellrent_sdk/client/models/securemail_statistics_response.py +++ /dev/null @@ -1,116 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.securemail_statistics import SecuremailStatistics - from ..models.securemail_statistics_response_meta_type_0 import ( - SecuremailStatisticsResponseMetaType0, - ) - - -T = TypeVar("T", bound="SecuremailStatisticsResponse") - - -@_attrs_define -class SecuremailStatisticsResponse: - error: int - message: None | str - data: SecuremailStatistics - meta: None | SecuremailStatisticsResponseMetaType0 - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.securemail_statistics_response_meta_type_0 import ( - SecuremailStatisticsResponseMetaType0, - ) - - error = self.error - - message: None | str - message = self.message - - data = self.data.to_dict() - - meta: dict[str, Any] | None - if isinstance(self.meta, SecuremailStatisticsResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "error": error, - "message": message, - "data": data, - "meta": meta, - } - ) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.securemail_statistics import SecuremailStatistics - from ..models.securemail_statistics_response_meta_type_0 import ( - SecuremailStatisticsResponseMetaType0, - ) - - d = dict(src_dict) - error = d.pop("error") - - def _parse_message(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - message = _parse_message(d.pop("message")) - - data = SecuremailStatistics.from_dict(d.pop("data")) - - def _parse_meta(data: object) -> None | SecuremailStatisticsResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = SecuremailStatisticsResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | SecuremailStatisticsResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) - - securemail_statistics_response = cls( - error=error, - message=message, - data=data, - meta=meta, - ) - - securemail_statistics_response.additional_properties = d - return securemail_statistics_response - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/securemail_statistics_response_meta_type_0.py b/src/shellrent_sdk/client/models/securemail_statistics_response_meta_type_0.py deleted file mode 100644 index 9d38e06..0000000 --- a/src/shellrent_sdk/client/models/securemail_statistics_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="SecuremailStatisticsResponseMetaType0") - - -@_attrs_define -class SecuremailStatisticsResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - securemail_statistics_response_meta_type_0 = cls() - - securemail_statistics_response_meta_type_0.additional_properties = d - return securemail_statistics_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/server.py b/src/shellrent_sdk/client/models/server.py index aa414bc..439cfa7 100644 --- a/src/shellrent_sdk/client/models/server.py +++ b/src/shellrent_sdk/client/models/server.py @@ -12,15 +12,28 @@ @_attrs_define class Server: + """Server of the account: dedicated server, cloud server, private cloud or virtual machine of a private cloud""" + server_id: int purchase_id: int | None + """ Id of the purchase of the server (`GET /api/v3/purchases/{purchase_id}`) """ hostname: None | str server_type: None | str + """ Type of the server: `PH` for a dedicated (physical) server, `VM` for a virtual machine, `HV` for a + hypervisor or a private cloud """ active: bool + """ Whether the server is active: false once it has been deleted """ consolidated: bool + """ Whether the server is ready, with its provisioning complete """ ip_address_id: int | None + """ Id of the primary IP address of the server (`GET /api/v3/servers/{server_id}/ip-addresses/{ip_address_id}`) + """ ip_address: None | str + """ Primary IP address of the server """ service_category_code: None | str + """ Code of the service category of the server: `DEDICATED` (dedicated server), `CLOUD` (Cloud Server), + `CLOUD_SERVER_IOPS` (Cloud VPS), `CLOUD_SERVER_HA` (Cloud Server HA), `PRIVATE_CLOUD` (private cloud) or + `PRIVATE_CLOUD_VM` (virtual machine of a private cloud) """ date_created: datetime.datetime | None additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) diff --git a/src/shellrent_sdk/client/models/server_automatic_snapshot.py b/src/shellrent_sdk/client/models/server_automatic_snapshot.py index ad587fc..5f772e2 100644 --- a/src/shellrent_sdk/client/models/server_automatic_snapshot.py +++ b/src/shellrent_sdk/client/models/server_automatic_snapshot.py @@ -11,12 +11,20 @@ @_attrs_define class ServerAutomaticSnapshot: + """Schedule of the automatic snapshots of a server""" + snapshot_id: int + """ Id of the schedule (not of a snapshot) """ server_id: int + """ Id of the server (`GET /api/v3/servers/{server_id}`) """ name: str + """ Name of the snapshots that the schedule creates """ days_of_week: list[int] + """ Days of the week of the snapshots, from 1 (Monday) to 7 (Sunday) """ hour_of_day: str + """ Time of the snapshots, in 24-hour `HH:MM` format """ is_active: bool + """ Whether the schedule is active """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/server_automatic_snapshot_request.py b/src/shellrent_sdk/client/models/server_automatic_snapshot_request.py index f53f160..6945060 100644 --- a/src/shellrent_sdk/client/models/server_automatic_snapshot_request.py +++ b/src/shellrent_sdk/client/models/server_automatic_snapshot_request.py @@ -4,19 +4,20 @@ from typing import Any, Self, TypeVar, cast from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="ServerAutomaticSnapshotRequest") @_attrs_define class ServerAutomaticSnapshotRequest: + """Schedule of the automatic snapshots of a server""" + name: str + """ Name of the snapshots: only letters, numbers, spaces, underscores and dashes """ day_of_week: list[int] """ Days of week (1-7, where 1 is Monday) """ hour_of_day: str - """ Time in HH:MM """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + """ Time of the snapshot, in 24-hour HH:MM format. Times after 01:00 and before 04:59 are not allowed """ def to_dict(self) -> dict[str, Any]: name = self.name @@ -26,7 +27,7 @@ def to_dict(self) -> dict[str, Any]: hour_of_day = self.hour_of_day field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "name": name, @@ -52,21 +53,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: hour_of_day=hour_of_day, ) - server_automatic_snapshot_request.additional_properties = d return server_automatic_snapshot_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/server_automatic_snapshot_response.py b/src/shellrent_sdk/client/models/server_automatic_snapshot_response.py index d5be5f8..5b497e2 100644 --- a/src/shellrent_sdk/client/models/server_automatic_snapshot_response.py +++ b/src/shellrent_sdk/client/models/server_automatic_snapshot_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.server_automatic_snapshot import ServerAutomaticSnapshot - from ..models.server_automatic_snapshot_response_meta_type_0 import ( - ServerAutomaticSnapshotResponseMetaType0, - ) T = TypeVar("T", bound="ServerAutomaticSnapshotResponse") @@ -18,17 +15,19 @@ @_attrs_define class ServerAutomaticSnapshotResponse: - error: int + """Successful response with one `ServerAutomaticSnapshot`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: ServerAutomaticSnapshot - meta: None | ServerAutomaticSnapshotResponseMetaType0 + """ Schedule of the automatic snapshots of a server """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.server_automatic_snapshot_response_meta_type_0 import ( - ServerAutomaticSnapshotResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, ServerAutomaticSnapshotResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -58,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.server_automatic_snapshot import ServerAutomaticSnapshot - from ..models.server_automatic_snapshot_response_meta_type_0 import ( - ServerAutomaticSnapshotResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -74,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = ServerAutomaticSnapshot.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | ServerAutomaticSnapshotResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = ServerAutomaticSnapshotResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | ServerAutomaticSnapshotResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") server_automatic_snapshot_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/server_automatic_snapshot_response_meta_type_0.py b/src/shellrent_sdk/client/models/server_automatic_snapshot_response_meta_type_0.py deleted file mode 100644 index d86c9c3..0000000 --- a/src/shellrent_sdk/client/models/server_automatic_snapshot_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ServerAutomaticSnapshotResponseMetaType0") - - -@_attrs_define -class ServerAutomaticSnapshotResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - server_automatic_snapshot_response_meta_type_0 = cls() - - server_automatic_snapshot_response_meta_type_0.additional_properties = d - return server_automatic_snapshot_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/server_backup.py b/src/shellrent_sdk/client/models/server_backup.py index e648073..494250a 100644 --- a/src/shellrent_sdk/client/models/server_backup.py +++ b/src/shellrent_sdk/client/models/server_backup.py @@ -12,27 +12,48 @@ @_attrs_define class ServerBackup: + """Backup of a server that the customer can see""" + server_backup_id: int backup_recurrent_id: int | None + """ Id of the run of the recurrent backup that made the backup; null for a one-off backup """ backup_server_id_parent: int | None - server_id: int + """ Id of the backup this one is based on, for incremental backups; null otherwise """ + server_id: int | None + """ Id of the backed up server (`GET /api/v3/servers/{server_id}`) """ cluster_id_server_residence: int | None + """ Id of the cluster where the server resides """ cluster_id_backup_residence: int | None + """ Id of the cluster where the backup is kept """ backup_type_id: int | None + """ Id of the backup type """ backup_mode: None | str + """ Strategy of the backup type: `FULL`, `INC` (incremental) or `DIFF` (differential) """ backup_frequency_id: int | None + """ Id of the frequency of the backup type """ backup_type_code: None | str + """ Code of the backup type, for example `CLOUD_DAILY`, `CLOUD_WEEKLY` or `CLOUD_UNA_TANTUM` (one-off) """ backup_frequency_code: None | str + """ Frequency of the backup type: `D` daily, `W` weekly, `HM` twice a month, `M` monthly, `HY` every six months, + `Y` yearly, `C` one-off, `R` private cloud replication """ backup_date: datetime.datetime | None + """ Date the backup was taken """ backup_size: int | None + """ Size of the backup, in MB """ backup_duration: None | str + """ Duration of the backup, as text in the `H:MM:SS` form, preceded by the days for longer backups (for example + `1 day, 2:03:04`) """ exit_status: int | None + """ Exit status of the backup: `0` if it succeeded """ error_type: None | str + """ Error of the backup, as a code or a message (for example `DOWNLOAD_DISK_FAILED`); `N.A.` when it succeeded + """ date_created: datetime.datetime | None - backup_path: None | str checksum: None | str - backup_path_parent: None | str + """ Checksum of the backup, sent by the backup scripts; null if not sent """ backup_user_visibility: bool | None + """ Whether the customer can see the backup: only the most recent successful backups of each type are visible, + as many as the retention of the type, and only those are returned """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,6 +65,7 @@ def to_dict(self) -> dict[str, Any]: backup_server_id_parent: int | None backup_server_id_parent = self.backup_server_id_parent + server_id: int | None server_id = self.server_id cluster_id_server_residence: int | None @@ -91,15 +113,9 @@ def to_dict(self) -> dict[str, Any]: else: date_created = self.date_created - backup_path: None | str - backup_path = self.backup_path - checksum: None | str checksum = self.checksum - backup_path_parent: None | str - backup_path_parent = self.backup_path_parent - backup_user_visibility: bool | None backup_user_visibility = self.backup_user_visibility @@ -124,9 +140,7 @@ def to_dict(self) -> dict[str, Any]: "exit_status": exit_status, "error_type": error_type, "date_created": date_created, - "backup_path": backup_path, "checksum": checksum, - "backup_path_parent": backup_path_parent, "backup_user_visibility": backup_user_visibility, } ) @@ -152,7 +166,12 @@ def _parse_backup_server_id_parent(data: object) -> int | None: backup_server_id_parent = _parse_backup_server_id_parent(d.pop("backup_server_id_parent")) - server_id = d.pop("server_id") + def _parse_server_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + server_id = _parse_server_id(d.pop("server_id")) def _parse_cluster_id_server_residence(data: object) -> int | None: if data is None: @@ -265,13 +284,6 @@ def _parse_date_created(data: object) -> datetime.datetime | None: date_created = _parse_date_created(d.pop("date_created")) - def _parse_backup_path(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - backup_path = _parse_backup_path(d.pop("backup_path")) - def _parse_checksum(data: object) -> None | str: if data is None: return data @@ -279,13 +291,6 @@ def _parse_checksum(data: object) -> None | str: checksum = _parse_checksum(d.pop("checksum")) - def _parse_backup_path_parent(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - backup_path_parent = _parse_backup_path_parent(d.pop("backup_path_parent")) - def _parse_backup_user_visibility(data: object) -> bool | None: if data is None: return data @@ -311,9 +316,7 @@ def _parse_backup_user_visibility(data: object) -> bool | None: exit_status=exit_status, error_type=error_type, date_created=date_created, - backup_path=backup_path, checksum=checksum, - backup_path_parent=backup_path_parent, backup_user_visibility=backup_user_visibility, ) diff --git a/src/shellrent_sdk/client/models/server_backup_exhibit_request.py b/src/shellrent_sdk/client/models/server_backup_exhibit_request.py index 5eaf646..ebea64b 100644 --- a/src/shellrent_sdk/client/models/server_backup_exhibit_request.py +++ b/src/shellrent_sdk/client/models/server_backup_exhibit_request.py @@ -4,22 +4,22 @@ from typing import Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="ServerBackupExhibitRequest") @_attrs_define class ServerBackupExhibitRequest: + """Backup of the server to expose""" + backup_id: int """ ID of the server backup to expose """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: backup_id = self.backup_id field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "backup_id": backup_id, @@ -37,21 +37,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: backup_id=backup_id, ) - server_backup_exhibit_request.additional_properties = d return server_backup_exhibit_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/server_backup_list_response.py b/src/shellrent_sdk/client/models/server_backup_list_response.py index 96b006a..4f92da2 100644 --- a/src/shellrent_sdk/client/models/server_backup_list_response.py +++ b/src/shellrent_sdk/client/models/server_backup_list_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.server_backup import ServerBackup - from ..models.server_backup_list_response_meta_type_0 import ServerBackupListResponseMetaType0 T = TypeVar("T", bound="ServerBackupListResponse") @@ -16,17 +15,19 @@ @_attrs_define class ServerBackupListResponse: - error: int + """Successful response with a list of `ServerBackup`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[ServerBackup] - meta: None | ServerBackupListResponseMetaType0 + """ Items returned by the operation """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.server_backup_list_response_meta_type_0 import ( - ServerBackupListResponseMetaType0, - ) - error = self.error message: None | str @@ -37,11 +38,7 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - meta: dict[str, Any] | None - if isinstance(self.meta, ServerBackupListResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -59,12 +56,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.server_backup import ServerBackup - from ..models.server_backup_list_response_meta_type_0 import ( - ServerBackupListResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -80,20 +76,7 @@ def _parse_message(data: object) -> None | str: data.append(data_item) - def _parse_meta(data: object) -> None | ServerBackupListResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = ServerBackupListResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | ServerBackupListResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") server_backup_list_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/server_backup_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/server_backup_list_response_meta_type_0.py deleted file mode 100644 index 90eb418..0000000 --- a/src/shellrent_sdk/client/models/server_backup_list_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ServerBackupListResponseMetaType0") - - -@_attrs_define -class ServerBackupListResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - server_backup_list_response_meta_type_0 = cls() - - server_backup_list_response_meta_type_0.additional_properties = d - return server_backup_list_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/server_backup_response.py b/src/shellrent_sdk/client/models/server_backup_response.py index 5bbe2de..b27b25c 100644 --- a/src/shellrent_sdk/client/models/server_backup_response.py +++ b/src/shellrent_sdk/client/models/server_backup_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.server_backup import ServerBackup - from ..models.server_backup_response_meta_type_0 import ServerBackupResponseMetaType0 T = TypeVar("T", bound="ServerBackupResponse") @@ -16,15 +15,19 @@ @_attrs_define class ServerBackupResponse: - error: int + """Successful response with one `ServerBackup`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: ServerBackup - meta: None | ServerBackupResponseMetaType0 + """ Backup of a server that the customer can see """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.server_backup_response_meta_type_0 import ServerBackupResponseMetaType0 - error = self.error message: None | str @@ -32,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, ServerBackupResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.server_backup import ServerBackup - from ..models.server_backup_response_meta_type_0 import ( - ServerBackupResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -70,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = ServerBackup.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | ServerBackupResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = ServerBackupResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | ServerBackupResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") server_backup_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/server_backup_response_meta_type_0.py b/src/shellrent_sdk/client/models/server_backup_response_meta_type_0.py deleted file mode 100644 index 2bcbf63..0000000 --- a/src/shellrent_sdk/client/models/server_backup_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ServerBackupResponseMetaType0") - - -@_attrs_define -class ServerBackupResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - server_backup_response_meta_type_0 = cls() - - server_backup_response_meta_type_0.additional_properties = d - return server_backup_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/server_can_action.py b/src/shellrent_sdk/client/models/server_can_action.py index 20dd4d9..127134d 100644 --- a/src/shellrent_sdk/client/models/server_can_action.py +++ b/src/shellrent_sdk/client/models/server_can_action.py @@ -11,8 +11,12 @@ @_attrs_define class ServerCanAction: + """Result of the check of a power action of the server""" + server_id: int + """ Id of the server (`GET /api/v3/servers/{server_id}`) """ can_action: bool + """ Whether the power action can start now with `POST /api/v3/servers/{server_id}/power-actions` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/server_can_action_response.py b/src/shellrent_sdk/client/models/server_can_action_response.py index 431ba02..ed5fdaa 100644 --- a/src/shellrent_sdk/client/models/server_can_action_response.py +++ b/src/shellrent_sdk/client/models/server_can_action_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.server_can_action import ServerCanAction - from ..models.server_can_action_response_meta_type_0 import ServerCanActionResponseMetaType0 T = TypeVar("T", bound="ServerCanActionResponse") @@ -16,15 +15,19 @@ @_attrs_define class ServerCanActionResponse: - error: int + """Successful response with one `ServerCanAction`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: ServerCanAction - meta: None | ServerCanActionResponseMetaType0 + """ Result of the check of a power action of the server """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.server_can_action_response_meta_type_0 import ServerCanActionResponseMetaType0 - error = self.error message: None | str @@ -32,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, ServerCanActionResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.server_can_action import ServerCanAction - from ..models.server_can_action_response_meta_type_0 import ( - ServerCanActionResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -70,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = ServerCanAction.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | ServerCanActionResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = ServerCanActionResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | ServerCanActionResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") server_can_action_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/server_can_action_response_meta_type_0.py b/src/shellrent_sdk/client/models/server_can_action_response_meta_type_0.py deleted file mode 100644 index 27ebcba..0000000 --- a/src/shellrent_sdk/client/models/server_can_action_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ServerCanActionResponseMetaType0") - - -@_attrs_define -class ServerCanActionResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - server_can_action_response_meta_type_0 = cls() - - server_can_action_response_meta_type_0.additional_properties = d - return server_can_action_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/server_credential.py b/src/shellrent_sdk/client/models/server_credential.py index 94b82bf..3f54f2c 100644 --- a/src/shellrent_sdk/client/models/server_credential.py +++ b/src/shellrent_sdk/client/models/server_credential.py @@ -11,10 +11,17 @@ @_attrs_define class ServerCredential: + """Root credentials of the server""" + type_: str + """ Type of the credentials: always `root` """ username: None | str + """ Username of the root user of the server; null when it is not set """ password: None | str + """ Password of the root user; null when `visible` is false """ visible: bool + """ Whether `password` is returned: false when the root password is not set or is not visible to the customer + """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/server_credential_response.py b/src/shellrent_sdk/client/models/server_credential_response.py index 86a395c..c937e13 100644 --- a/src/shellrent_sdk/client/models/server_credential_response.py +++ b/src/shellrent_sdk/client/models/server_credential_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.server_credential import ServerCredential - from ..models.server_credential_response_meta_type_0 import ServerCredentialResponseMetaType0 T = TypeVar("T", bound="ServerCredentialResponse") @@ -16,17 +15,19 @@ @_attrs_define class ServerCredentialResponse: - error: int + """Successful response with one `ServerCredential`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: ServerCredential - meta: None | ServerCredentialResponseMetaType0 + """ Root credentials of the server """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.server_credential_response_meta_type_0 import ( - ServerCredentialResponseMetaType0, - ) - error = self.error message: None | str @@ -34,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, ServerCredentialResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -56,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.server_credential import ServerCredential - from ..models.server_credential_response_meta_type_0 import ( - ServerCredentialResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -72,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = ServerCredential.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | ServerCredentialResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = ServerCredentialResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | ServerCredentialResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") server_credential_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/server_credential_response_meta_type_0.py b/src/shellrent_sdk/client/models/server_credential_response_meta_type_0.py deleted file mode 100644 index ac43435..0000000 --- a/src/shellrent_sdk/client/models/server_credential_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ServerCredentialResponseMetaType0") - - -@_attrs_define -class ServerCredentialResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - server_credential_response_meta_type_0 = cls() - - server_credential_response_meta_type_0.additional_properties = d - return server_credential_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/server_ip_address_reverse_update_request.py b/src/shellrent_sdk/client/models/server_ip_address_reverse_update_request.py index 2bc52a9..0cacc14 100644 --- a/src/shellrent_sdk/client/models/server_ip_address_reverse_update_request.py +++ b/src/shellrent_sdk/client/models/server_ip_address_reverse_update_request.py @@ -4,30 +4,27 @@ from typing import Any, Self, TypeVar, cast from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset T = TypeVar("T", bound="ServerIpAddressReverseUpdateRequest") @_attrs_define class ServerIpAddressReverseUpdateRequest: - reverse_dns: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + reverse_dns: None | str + """ Hostname to set as reverse DNS of the IP address; null or an empty string removes it, like `DELETE + /api/v3/servers/{server_id}/ip-addresses/{ip_address_id}/rdns` """ def to_dict(self) -> dict[str, Any]: - reverse_dns: None | str | Unset - if isinstance(self.reverse_dns, Unset): - reverse_dns = UNSET - else: - reverse_dns = self.reverse_dns + reverse_dns: None | str + reverse_dns = self.reverse_dns field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if reverse_dns is not UNSET: - field_dict["reverse_dns"] = reverse_dns + + field_dict.update( + { + "reverse_dns": reverse_dns, + } + ) return field_dict @@ -35,34 +32,15 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) - def _parse_reverse_dns(data: object) -> None | str | Unset: + def _parse_reverse_dns(data: object) -> None | str: if data is None: return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) + return cast(None | str, data) - reverse_dns = _parse_reverse_dns(d.pop("reverse_dns", UNSET)) + reverse_dns = _parse_reverse_dns(d.pop("reverse_dns")) server_ip_address_reverse_update_request = cls( reverse_dns=reverse_dns, ) - server_ip_address_reverse_update_request.additional_properties = d return server_ip_address_reverse_update_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/server_monitoring.py b/src/shellrent_sdk/client/models/server_monitoring.py index 4386b86..b2153be 100644 --- a/src/shellrent_sdk/client/models/server_monitoring.py +++ b/src/shellrent_sdk/client/models/server_monitoring.py @@ -11,22 +11,44 @@ @_attrs_define class ServerMonitoring: + """Server monitoring service of the account, with the host it checks and its settings""" + server_monitoring_id: int purchase_monitoring_id: int | None + """ Id of the purchase of the monitoring service (`GET /api/v3/purchases/{purchase_id}`) """ purchase_server_id: int | None + """ Id of the purchase of the monitored server (`GET /api/v3/purchases/{purchase_id}`); null when the monitoring + checks a hostname or an IP address """ service_name: None | str + """ Name of the service of the monitoring purchase """ purchase_name: None | str + """ Name of the object of the monitoring purchase, usually the monitored hostname or IP address """ purchase_status_code: None | str + """ Status code of the monitoring purchase, for example `ACTIVE_V2` or `NEW_V2` (not active yet) """ monitoring_key: None | str + """ Host checked by the monitoring: the hostname of the monitored server, or the hostname or IP address given + """ is_server_monitored: bool + """ Whether the monitoring checks a server, given by its purchase (`purchase_server_id`) or by its hostname """ is_ip_monitored: bool + """ Whether the monitoring checks an IP address """ is_external_device_monitored: bool + """ Whether the monitoring checks an external device, given by hostname or IP address instead of a server or an + IP address of the account """ monitoring_host_enabled: bool + """ Whether the monitoring of the host is enabled """ monitoring_type: None | str + """ Type of the monitoring: `default` (Base) or `plus` (Managed), which can also run the automatic actions of + the probes """ probe_limit: int | None + """ Maximum number of probes of the monitoring, counting the probes with `advanced_item` """ severity_level: None | str + """ Severity of the problems detected by the probes: `default`, `high` or `disaster` """ email_notification: None | str + """ Default email address for the notifications of the probes; each probe has its own (`notification_email`) """ sms_notification: None | str + """ Default phone number for the SMS notifications of the probes; each probe has its own (`notification_sms`) + """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/server_monitoring_paginated_list_response.py b/src/shellrent_sdk/client/models/server_monitoring_paginated_list_response.py index d24cd1f..60a5a6c 100644 --- a/src/shellrent_sdk/client/models/server_monitoring_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/server_monitoring_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class ServerMonitoringPaginatedListResponse: - error: int + """Successful response with a page of `ServerMonitoring`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[ServerMonitoring] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.server_monitoring import ServerMonitoring d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/server_monitoring_probe.py b/src/shellrent_sdk/client/models/server_monitoring_probe.py index 0410aa5..de887b3 100644 --- a/src/shellrent_sdk/client/models/server_monitoring_probe.py +++ b/src/shellrent_sdk/client/models/server_monitoring_probe.py @@ -12,23 +12,45 @@ @_attrs_define class ServerMonitoringProbe: + """Probe of a server monitoring: a check of the monitored host, with its state and its notification contacts""" + probe_id: int server_monitoring_id: int + """ Id of the server monitoring of the probe (`GET /api/v3/server-monitorings/{server_monitoring_id}`) """ template_id: int | None + """ Id of the probe template, the `server_monitoring_item_template_id` of `POST /api/v3/server- + monitorings/{server_monitoring_id}/probes` """ template_code: None | str + """ Code of the probe template, for example `SERVER_DOWN`, `HTTP_SERVICE_DOWN` or `FREE_DISK_SPACE` """ template_name: None | str + """ Name of the probe template """ monitoring_item_id: int | None + """ Id of the item of the probe in the monitoring system (Zabbix); null until the probe is created there """ monitoring_trigger_id: int | None + """ Id of the trigger of the probe in the monitoring system (Zabbix); null until it is created there """ is_default: bool + """ Whether it is the default probe of the monitoring, the ICMP check of the host (template `SERVER_DOWN`) """ advanced_item: bool - is_error: bool + """ Whether the probe counts towards `probe_limit` of the monitoring, like the probes added with `POST + /api/v3/server-monitorings/{server_monitoring_id}/probes`; the statistics probes do not """ + is_error: bool | None + """ Whether the probe is in error; null when no problem was detected or the solved problem has already been + notified """ monitoring_item_disabled: bool + """ Whether the probe is disabled in the monitoring system """ action_enabled: bool + """ Whether the automatic action of the probe is enabled; the actions run only on the `plus` monitorings """ notification_email: None | str + """ Email address that receives the notifications of the probe; empty or null when the probe sends no email """ notification_sms: None | str + """ Phone number that receives the notifications of the probe by SMS, an Italian number without the + international prefix; empty or null when the probe sends no SMS """ date_problem: datetime.datetime | None + """ When the last problem detected by the probe started; null when there is no problem """ date_last_notification: datetime.datetime | None + """ When the last notification of the problem was sent; null when none was sent for the current problem """ active: bool + """ Whether the probe is active: the endpoints return only active probes """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -55,6 +77,7 @@ def to_dict(self) -> dict[str, Any]: advanced_item = self.advanced_item + is_error: bool | None is_error = self.is_error monitoring_item_disabled = self.monitoring_item_disabled @@ -153,7 +176,12 @@ def _parse_monitoring_trigger_id(data: object) -> int | None: advanced_item = d.pop("advanced_item") - is_error = d.pop("is_error") + def _parse_is_error(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) + + is_error = _parse_is_error(d.pop("is_error")) monitoring_item_disabled = d.pop("monitoring_item_disabled") diff --git a/src/shellrent_sdk/client/models/server_monitoring_probe_chart.py b/src/shellrent_sdk/client/models/server_monitoring_probe_chart.py index 149b124..5e560e3 100644 --- a/src/shellrent_sdk/client/models/server_monitoring_probe_chart.py +++ b/src/shellrent_sdk/client/models/server_monitoring_probe_chart.py @@ -17,10 +17,16 @@ @_attrs_define class ServerMonitoringProbeChart: + """Values measured by a probe of a server monitoring in the last day""" + server_monitoring_id: int + """ Id of the server monitoring (`GET /api/v3/server-monitorings/{server_monitoring_id}`) """ probe_id: int + """ Id of the probe (`GET /api/v3/server-monitorings/{server_monitoring_id}/probes/{probe_id}`) """ interval: str + """ Period covered by the chart, as an ISO 8601 duration: always `P1D`, the last day """ points: list[ServerMonitoringProbeChartPointsItem] + """ Values measured by the probe in the period, in time order """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/server_monitoring_probe_chart_points_item.py b/src/shellrent_sdk/client/models/server_monitoring_probe_chart_points_item.py index 063fd78..991a0e4 100644 --- a/src/shellrent_sdk/client/models/server_monitoring_probe_chart_points_item.py +++ b/src/shellrent_sdk/client/models/server_monitoring_probe_chart_points_item.py @@ -6,16 +6,14 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset - T = TypeVar("T", bound="ServerMonitoringProbeChartPointsItem") @_attrs_define class ServerMonitoringProbeChartPointsItem: - x: float | Unset = UNSET + x: float """ UNIX timestamp in milliseconds """ - y: float | Unset = UNSET + y: float """ Probe value """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -26,20 +24,21 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - field_dict.update({}) - if x is not UNSET: - field_dict["x"] = x - if y is not UNSET: - field_dict["y"] = y + field_dict.update( + { + "x": x, + "y": y, + } + ) return field_dict @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) - x = d.pop("x", UNSET) + x = d.pop("x") - y = d.pop("y", UNSET) + y = d.pop("y") server_monitoring_probe_chart_points_item = cls( x=x, diff --git a/src/shellrent_sdk/client/models/server_monitoring_probe_chart_response.py b/src/shellrent_sdk/client/models/server_monitoring_probe_chart_response.py index ee41488..3b8dc3e 100644 --- a/src/shellrent_sdk/client/models/server_monitoring_probe_chart_response.py +++ b/src/shellrent_sdk/client/models/server_monitoring_probe_chart_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.server_monitoring_probe_chart import ServerMonitoringProbeChart - from ..models.server_monitoring_probe_chart_response_meta_type_0 import ( - ServerMonitoringProbeChartResponseMetaType0, - ) T = TypeVar("T", bound="ServerMonitoringProbeChartResponse") @@ -18,17 +15,19 @@ @_attrs_define class ServerMonitoringProbeChartResponse: - error: int + """Successful response with one `ServerMonitoringProbeChart`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: ServerMonitoringProbeChart - meta: None | ServerMonitoringProbeChartResponseMetaType0 + """ Values measured by a probe of a server monitoring in the last day """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.server_monitoring_probe_chart_response_meta_type_0 import ( - ServerMonitoringProbeChartResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, ServerMonitoringProbeChartResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -60,12 +55,11 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.server_monitoring_probe_chart import ( ServerMonitoringProbeChart, ) - from ..models.server_monitoring_probe_chart_response_meta_type_0 import ( - ServerMonitoringProbeChartResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -76,20 +70,7 @@ def _parse_message(data: object) -> None | str: data = ServerMonitoringProbeChart.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | ServerMonitoringProbeChartResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = ServerMonitoringProbeChartResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | ServerMonitoringProbeChartResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") server_monitoring_probe_chart_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/server_monitoring_probe_chart_response_meta_type_0.py b/src/shellrent_sdk/client/models/server_monitoring_probe_chart_response_meta_type_0.py deleted file mode 100644 index b147acc..0000000 --- a/src/shellrent_sdk/client/models/server_monitoring_probe_chart_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ServerMonitoringProbeChartResponseMetaType0") - - -@_attrs_define -class ServerMonitoringProbeChartResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - server_monitoring_probe_chart_response_meta_type_0 = cls() - - server_monitoring_probe_chart_response_meta_type_0.additional_properties = d - return server_monitoring_probe_chart_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/server_monitoring_probe_create_request.py b/src/shellrent_sdk/client/models/server_monitoring_probe_create_request.py index 38645b0..68afbe7 100644 --- a/src/shellrent_sdk/client/models/server_monitoring_probe_create_request.py +++ b/src/shellrent_sdk/client/models/server_monitoring_probe_create_request.py @@ -4,7 +4,6 @@ from typing import TYPE_CHECKING, Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -27,7 +26,6 @@ class ServerMonitoringProbeCreateRequest: """ Notification email for this probe. """ notification_sms: str | Unset = UNSET """ Notification phone number for this probe. """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: server_monitoring_item_template_id = self.server_monitoring_item_template_id @@ -41,7 +39,7 @@ def to_dict(self) -> dict[str, Any]: notification_sms = self.notification_sms field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "server_monitoring_item_template_id": server_monitoring_item_template_id, @@ -83,21 +81,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: notification_sms=notification_sms, ) - server_monitoring_probe_create_request.additional_properties = d return server_monitoring_probe_create_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/server_monitoring_probe_list_response.py b/src/shellrent_sdk/client/models/server_monitoring_probe_list_response.py index 5f9b0e2..6fad818 100644 --- a/src/shellrent_sdk/client/models/server_monitoring_probe_list_response.py +++ b/src/shellrent_sdk/client/models/server_monitoring_probe_list_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.server_monitoring_probe import ServerMonitoringProbe - from ..models.server_monitoring_probe_list_response_meta_type_0 import ( - ServerMonitoringProbeListResponseMetaType0, - ) T = TypeVar("T", bound="ServerMonitoringProbeListResponse") @@ -18,17 +15,19 @@ @_attrs_define class ServerMonitoringProbeListResponse: - error: int + """Successful response with a list of `ServerMonitoringProbe`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[ServerMonitoringProbe] - meta: None | ServerMonitoringProbeListResponseMetaType0 + """ Items returned by the operation """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.server_monitoring_probe_list_response_meta_type_0 import ( - ServerMonitoringProbeListResponseMetaType0, - ) - error = self.error message: None | str @@ -39,11 +38,7 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - meta: dict[str, Any] | None - if isinstance(self.meta, ServerMonitoringProbeListResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -61,12 +56,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.server_monitoring_probe import ServerMonitoringProbe - from ..models.server_monitoring_probe_list_response_meta_type_0 import ( - ServerMonitoringProbeListResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -82,20 +76,7 @@ def _parse_message(data: object) -> None | str: data.append(data_item) - def _parse_meta(data: object) -> None | ServerMonitoringProbeListResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = ServerMonitoringProbeListResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | ServerMonitoringProbeListResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") server_monitoring_probe_list_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/server_monitoring_probe_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/server_monitoring_probe_list_response_meta_type_0.py deleted file mode 100644 index de39053..0000000 --- a/src/shellrent_sdk/client/models/server_monitoring_probe_list_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ServerMonitoringProbeListResponseMetaType0") - - -@_attrs_define -class ServerMonitoringProbeListResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - server_monitoring_probe_list_response_meta_type_0 = cls() - - server_monitoring_probe_list_response_meta_type_0.additional_properties = d - return server_monitoring_probe_list_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/server_monitoring_probe_response.py b/src/shellrent_sdk/client/models/server_monitoring_probe_response.py index 810d4f2..dfe9d79 100644 --- a/src/shellrent_sdk/client/models/server_monitoring_probe_response.py +++ b/src/shellrent_sdk/client/models/server_monitoring_probe_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.server_monitoring_probe import ServerMonitoringProbe - from ..models.server_monitoring_probe_response_meta_type_0 import ( - ServerMonitoringProbeResponseMetaType0, - ) T = TypeVar("T", bound="ServerMonitoringProbeResponse") @@ -18,17 +15,20 @@ @_attrs_define class ServerMonitoringProbeResponse: - error: int + """Successful response with one `ServerMonitoringProbe`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: ServerMonitoringProbe - meta: None | ServerMonitoringProbeResponseMetaType0 + """ Probe of a server monitoring: a check of the monitored host, with its state and its notification contacts + """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.server_monitoring_probe_response_meta_type_0 import ( - ServerMonitoringProbeResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +36,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, ServerMonitoringProbeResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -58,12 +54,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.server_monitoring_probe import ServerMonitoringProbe - from ..models.server_monitoring_probe_response_meta_type_0 import ( - ServerMonitoringProbeResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -74,20 +69,7 @@ def _parse_message(data: object) -> None | str: data = ServerMonitoringProbe.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | ServerMonitoringProbeResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = ServerMonitoringProbeResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | ServerMonitoringProbeResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") server_monitoring_probe_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/server_monitoring_probe_response_meta_type_0.py b/src/shellrent_sdk/client/models/server_monitoring_probe_response_meta_type_0.py deleted file mode 100644 index d239d26..0000000 --- a/src/shellrent_sdk/client/models/server_monitoring_probe_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ServerMonitoringProbeResponseMetaType0") - - -@_attrs_define -class ServerMonitoringProbeResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - server_monitoring_probe_response_meta_type_0 = cls() - - server_monitoring_probe_response_meta_type_0.additional_properties = d - return server_monitoring_probe_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/server_monitoring_probe_update_request.py b/src/shellrent_sdk/client/models/server_monitoring_probe_update_request.py index 24aa6fc..1abbe51 100644 --- a/src/shellrent_sdk/client/models/server_monitoring_probe_update_request.py +++ b/src/shellrent_sdk/client/models/server_monitoring_probe_update_request.py @@ -4,7 +4,6 @@ from typing import Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -17,7 +16,6 @@ class ServerMonitoringProbeUpdateRequest: """ Notification email for this probe. Use empty string to remove the current email. """ notification_sms: str | Unset = UNSET """ Notification phone number for this probe. Use empty string to remove the current SMS. """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: notification_email = self.notification_email @@ -25,7 +23,7 @@ def to_dict(self) -> dict[str, Any]: notification_sms = self.notification_sms field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if notification_email is not UNSET: field_dict["notification_email"] = notification_email @@ -46,21 +44,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: notification_sms=notification_sms, ) - server_monitoring_probe_update_request.additional_properties = d return server_monitoring_probe_update_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/server_monitoring_response.py b/src/shellrent_sdk/client/models/server_monitoring_response.py index 1c9ee7b..038676f 100644 --- a/src/shellrent_sdk/client/models/server_monitoring_response.py +++ b/src/shellrent_sdk/client/models/server_monitoring_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.server_monitoring import ServerMonitoring - from ..models.server_monitoring_response_meta_type_0 import ServerMonitoringResponseMetaType0 T = TypeVar("T", bound="ServerMonitoringResponse") @@ -16,17 +15,19 @@ @_attrs_define class ServerMonitoringResponse: - error: int + """Successful response with one `ServerMonitoring`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: ServerMonitoring - meta: None | ServerMonitoringResponseMetaType0 + """ Server monitoring service of the account, with the host it checks and its settings """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.server_monitoring_response_meta_type_0 import ( - ServerMonitoringResponseMetaType0, - ) - error = self.error message: None | str @@ -34,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, ServerMonitoringResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -56,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.server_monitoring import ServerMonitoring - from ..models.server_monitoring_response_meta_type_0 import ( - ServerMonitoringResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -72,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = ServerMonitoring.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | ServerMonitoringResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = ServerMonitoringResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | ServerMonitoringResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") server_monitoring_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/server_monitoring_response_meta_type_0.py b/src/shellrent_sdk/client/models/server_monitoring_response_meta_type_0.py deleted file mode 100644 index 42ce9c3..0000000 --- a/src/shellrent_sdk/client/models/server_monitoring_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ServerMonitoringResponseMetaType0") - - -@_attrs_define -class ServerMonitoringResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - server_monitoring_response_meta_type_0 = cls() - - server_monitoring_response_meta_type_0.additional_properties = d - return server_monitoring_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/server_network_interface.py b/src/shellrent_sdk/client/models/server_network_interface.py index 3533537..ce72a7e 100644 --- a/src/shellrent_sdk/client/models/server_network_interface.py +++ b/src/shellrent_sdk/client/models/server_network_interface.py @@ -12,19 +12,36 @@ @_attrs_define class ServerNetworkInterface: + """Network interface (VIF) of a virtual machine, on a public or a local network""" + network_interface_id: int server_id: int + """ Id of the server of the interface (`GET /api/v3/servers/{server_id}`) """ network_id: int | None + """ Id of the network of the interface: for a local network, the `network_id` accepted by `POST + /api/v3/servers/{server_id}/network-interfaces` """ ip_address_id: int | None + """ Id of the IP address of the interface (`GET /api/v3/servers/{server_id}/ip-addresses/{ip_address_id}`); + always null on a local network """ vif_uuid: None | str + """ UUID of the interface on the hypervisor """ device_name: None | str + """ Device of the interface: usually its number (`0` for `eth0`), otherwise a name such as `ens3` """ mac_address: None | str + """ MAC address of the interface """ is_default: bool | None + """ Whether it is the default interface of the server, which cannot be deleted """ is_active: bool | None + """ Whether the interface is active: the endpoints return only active interfaces """ network_type: None | str + """ Type of the network: `P` for public, `L` for local """ network_label: None | str + """ Name of the network """ network_bridge: None | str + """ Bridge of the network on the hypervisor, for example `xenbr0`; `N.D.` when the hypervisor does not report it + """ ip_address: None | str + """ IP address of the interface; null when `ip_address_id` is null """ date_created: datetime.datetime | None additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) diff --git a/src/shellrent_sdk/client/models/server_network_interface_create_request.py b/src/shellrent_sdk/client/models/server_network_interface_create_request.py index 60dd1c6..61858c7 100644 --- a/src/shellrent_sdk/client/models/server_network_interface_create_request.py +++ b/src/shellrent_sdk/client/models/server_network_interface_create_request.py @@ -4,7 +4,6 @@ from typing import Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -14,10 +13,12 @@ @_attrs_define class ServerNetworkInterfaceCreateRequest: network_id: int | Unset = UNSET - """ Local network ID (for local VIF) """ + """ For a local network interface: ID of an active local network of the cluster where the server resides (for a + private cloud VM, a local network of the private cloud). Send either network_id or ip_address_id """ ip_address_id: int | Unset = UNSET - """ Server IP address ID (for public VIF) """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + """ For a public network interface: ID of an IP address without an active network interface. For a private cloud + VM it is a free and available IP address of the private cloud, which is assigned to the VM; for the other + servers an available IP address of the server. Send either network_id or ip_address_id """ def to_dict(self) -> dict[str, Any]: network_id = self.network_id @@ -25,7 +26,7 @@ def to_dict(self) -> dict[str, Any]: ip_address_id = self.ip_address_id field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if network_id is not UNSET: field_dict["network_id"] = network_id @@ -46,21 +47,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: ip_address_id=ip_address_id, ) - server_network_interface_create_request.additional_properties = d return server_network_interface_create_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/server_network_interface_list_response.py b/src/shellrent_sdk/client/models/server_network_interface_list_response.py index 4ae694f..949c336 100644 --- a/src/shellrent_sdk/client/models/server_network_interface_list_response.py +++ b/src/shellrent_sdk/client/models/server_network_interface_list_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.server_network_interface import ServerNetworkInterface - from ..models.server_network_interface_list_response_meta_type_0 import ( - ServerNetworkInterfaceListResponseMetaType0, - ) T = TypeVar("T", bound="ServerNetworkInterfaceListResponse") @@ -18,17 +15,19 @@ @_attrs_define class ServerNetworkInterfaceListResponse: - error: int + """Successful response with a list of `ServerNetworkInterface`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[ServerNetworkInterface] - meta: None | ServerNetworkInterfaceListResponseMetaType0 + """ Items returned by the operation """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.server_network_interface_list_response_meta_type_0 import ( - ServerNetworkInterfaceListResponseMetaType0, - ) - error = self.error message: None | str @@ -39,11 +38,7 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - meta: dict[str, Any] | None - if isinstance(self.meta, ServerNetworkInterfaceListResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -61,12 +56,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.server_network_interface import ServerNetworkInterface - from ..models.server_network_interface_list_response_meta_type_0 import ( - ServerNetworkInterfaceListResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -82,20 +76,7 @@ def _parse_message(data: object) -> None | str: data.append(data_item) - def _parse_meta(data: object) -> None | ServerNetworkInterfaceListResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = ServerNetworkInterfaceListResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | ServerNetworkInterfaceListResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") server_network_interface_list_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/server_network_interface_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/server_network_interface_list_response_meta_type_0.py deleted file mode 100644 index a6cd500..0000000 --- a/src/shellrent_sdk/client/models/server_network_interface_list_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ServerNetworkInterfaceListResponseMetaType0") - - -@_attrs_define -class ServerNetworkInterfaceListResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - server_network_interface_list_response_meta_type_0 = cls() - - server_network_interface_list_response_meta_type_0.additional_properties = d - return server_network_interface_list_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/server_network_interface_response.py b/src/shellrent_sdk/client/models/server_network_interface_response.py index 7f96f97..0de9bca 100644 --- a/src/shellrent_sdk/client/models/server_network_interface_response.py +++ b/src/shellrent_sdk/client/models/server_network_interface_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.server_network_interface import ServerNetworkInterface - from ..models.server_network_interface_response_meta_type_0 import ( - ServerNetworkInterfaceResponseMetaType0, - ) T = TypeVar("T", bound="ServerNetworkInterfaceResponse") @@ -18,17 +15,19 @@ @_attrs_define class ServerNetworkInterfaceResponse: - error: int + """Successful response with one `ServerNetworkInterface`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: ServerNetworkInterface - meta: None | ServerNetworkInterfaceResponseMetaType0 + """ Network interface (VIF) of a virtual machine, on a public or a local network """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.server_network_interface_response_meta_type_0 import ( - ServerNetworkInterfaceResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, ServerNetworkInterfaceResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -58,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.server_network_interface import ServerNetworkInterface - from ..models.server_network_interface_response_meta_type_0 import ( - ServerNetworkInterfaceResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -74,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = ServerNetworkInterface.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | ServerNetworkInterfaceResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = ServerNetworkInterfaceResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | ServerNetworkInterfaceResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") server_network_interface_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/server_network_interface_response_meta_type_0.py b/src/shellrent_sdk/client/models/server_network_interface_response_meta_type_0.py deleted file mode 100644 index df45aec..0000000 --- a/src/shellrent_sdk/client/models/server_network_interface_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ServerNetworkInterfaceResponseMetaType0") - - -@_attrs_define -class ServerNetworkInterfaceResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - server_network_interface_response_meta_type_0 = cls() - - server_network_interface_response_meta_type_0.additional_properties = d - return server_network_interface_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/server_os.py b/src/shellrent_sdk/client/models/server_os.py index 752ce33..95e5aed 100644 --- a/src/shellrent_sdk/client/models/server_os.py +++ b/src/shellrent_sdk/client/models/server_os.py @@ -11,8 +11,12 @@ @_attrs_define class ServerOs: + """Operating system that can be installed with a server template, with its minimum requirements""" + os_code: str + """ Code of the operating system, to send as `SERVER_TEMPLATE_CODE` in `data` when buying the service """ os_name: str + """ Name of the operating system """ min_ram: int | None """ Min RAM (GB), for VPS/VM only """ min_cpu: int | None diff --git a/src/shellrent_sdk/client/models/server_paginated_list_response.py b/src/shellrent_sdk/client/models/server_paginated_list_response.py index 4fc56bd..f0061ae 100644 --- a/src/shellrent_sdk/client/models/server_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/server_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class ServerPaginatedListResponse: - error: int + """Successful response with a page of `Server`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[Server] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.server import Server d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/server_power_action_request.py b/src/shellrent_sdk/client/models/server_power_action_request.py new file mode 100644 index 0000000..50b7582 --- /dev/null +++ b/src/shellrent_sdk/client/models/server_power_action_request.py @@ -0,0 +1,41 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Self, TypeVar + +from attrs import define as _attrs_define + +from ..models.server_power_action_request_action import ServerPowerActionRequestAction + +T = TypeVar("T", bound="ServerPowerActionRequest") + + +@_attrs_define +class ServerPowerActionRequest: + action: ServerPowerActionRequestAction + """ Power action: physical servers only have `reboot`. Whether it is possible can be checked first with the + matching check of the server, for example `GET /api/v3/servers/{server_id}/can-hard-reboot` """ + + def to_dict(self) -> dict[str, Any]: + action = self.action.value + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "action": action, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + action = ServerPowerActionRequestAction(d.pop("action")) + + server_power_action_request = cls( + action=action, + ) + + return server_power_action_request diff --git a/src/shellrent_sdk/client/models/server_power_action_request_action.py b/src/shellrent_sdk/client/models/server_power_action_request_action.py new file mode 100644 index 0000000..56c6b8a --- /dev/null +++ b/src/shellrent_sdk/client/models/server_power_action_request_action.py @@ -0,0 +1,12 @@ +from enum import StrEnum + + +class ServerPowerActionRequestAction(StrEnum): + HARD_REBOOT = "hard_reboot" + HARD_STOP = "hard_stop" + REBOOT = "reboot" + START = "start" + STOP = "stop" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/shellrent_sdk/client/models/server_reinstall_request.py b/src/shellrent_sdk/client/models/server_reinstall_request.py index 5965308..d4157c9 100644 --- a/src/shellrent_sdk/client/models/server_reinstall_request.py +++ b/src/shellrent_sdk/client/models/server_reinstall_request.py @@ -4,7 +4,6 @@ from typing import Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -15,13 +14,12 @@ class ServerReinstallRequest: safety_backup_enabled: bool | Unset = True """ Whether to perform a safety backup before reinstall """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: safety_backup_enabled = self.safety_backup_enabled field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if safety_backup_enabled is not UNSET: field_dict["safety_backup_enabled"] = safety_backup_enabled @@ -37,21 +35,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: safety_backup_enabled=safety_backup_enabled, ) - server_reinstall_request.additional_properties = d return server_reinstall_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/server_response.py b/src/shellrent_sdk/client/models/server_response.py index aeb3f1d..837cf97 100644 --- a/src/shellrent_sdk/client/models/server_response.py +++ b/src/shellrent_sdk/client/models/server_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.server import Server - from ..models.server_response_meta_type_0 import ServerResponseMetaType0 T = TypeVar("T", bound="ServerResponse") @@ -16,15 +15,20 @@ @_attrs_define class ServerResponse: - error: int + """Successful response with one `Server`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: Server - meta: None | ServerResponseMetaType0 + """ Server of the account: dedicated server, cloud server, private cloud or virtual machine of a private cloud + """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.server_response_meta_type_0 import ServerResponseMetaType0 - error = self.error message: None | str @@ -32,11 +36,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, ServerResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,10 +54,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.server import Server - from ..models.server_response_meta_type_0 import ServerResponseMetaType0 d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -68,20 +69,7 @@ def _parse_message(data: object) -> None | str: data = Server.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | ServerResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = ServerResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | ServerResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") server_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/server_response_meta_type_0.py b/src/shellrent_sdk/client/models/server_response_meta_type_0.py deleted file mode 100644 index 78cd274..0000000 --- a/src/shellrent_sdk/client/models/server_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ServerResponseMetaType0") - - -@_attrs_define -class ServerResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - server_response_meta_type_0 = cls() - - server_response_meta_type_0.additional_properties = d - return server_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/server_snapshot.py b/src/shellrent_sdk/client/models/server_snapshot.py index 5400cce..021f119 100644 --- a/src/shellrent_sdk/client/models/server_snapshot.py +++ b/src/shellrent_sdk/client/models/server_snapshot.py @@ -12,12 +12,19 @@ @_attrs_define class ServerSnapshot: + """Snapshot of a virtual server""" + snapshot_id: int server_id: int + """ Id of the server (`GET /api/v3/servers/{server_id}`) """ snapshot_name: None | str snapshot_reference: None | str + """ Id of the snapshot on the virtualization platform; null until the snapshot is created """ active: bool + """ Whether the snapshot is active: false once it is deleted or expired. The list returns only active snapshots + """ date_expiry: datetime.datetime | None + """ Date after which the snapshot is deleted automatically; null if it does not expire """ date_created: datetime.datetime | None additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) diff --git a/src/shellrent_sdk/client/models/server_snapshot_paginated_list_response.py b/src/shellrent_sdk/client/models/server_snapshot_paginated_list_response.py index cc31f9c..218c0cf 100644 --- a/src/shellrent_sdk/client/models/server_snapshot_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/server_snapshot_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class ServerSnapshotPaginatedListResponse: - error: int + """Successful response with a page of `ServerSnapshot`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[ServerSnapshot] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.server_snapshot import ServerSnapshot d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/server_snapshot_response.py b/src/shellrent_sdk/client/models/server_snapshot_response.py index 29caf29..427d82c 100644 --- a/src/shellrent_sdk/client/models/server_snapshot_response.py +++ b/src/shellrent_sdk/client/models/server_snapshot_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.server_snapshot import ServerSnapshot - from ..models.server_snapshot_response_meta_type_0 import ServerSnapshotResponseMetaType0 T = TypeVar("T", bound="ServerSnapshotResponse") @@ -16,15 +15,19 @@ @_attrs_define class ServerSnapshotResponse: - error: int + """Successful response with one `ServerSnapshot`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: ServerSnapshot - meta: None | ServerSnapshotResponseMetaType0 + """ Snapshot of a virtual server """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.server_snapshot_response_meta_type_0 import ServerSnapshotResponseMetaType0 - error = self.error message: None | str @@ -32,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, ServerSnapshotResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.server_snapshot import ServerSnapshot - from ..models.server_snapshot_response_meta_type_0 import ( - ServerSnapshotResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -70,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = ServerSnapshot.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | ServerSnapshotResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = ServerSnapshotResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | ServerSnapshotResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") server_snapshot_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/server_snapshot_response_meta_type_0.py b/src/shellrent_sdk/client/models/server_snapshot_response_meta_type_0.py deleted file mode 100644 index dcb5ddb..0000000 --- a/src/shellrent_sdk/client/models/server_snapshot_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ServerSnapshotResponseMetaType0") - - -@_attrs_define -class ServerSnapshotResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - server_snapshot_response_meta_type_0 = cls() - - server_snapshot_response_meta_type_0.additional_properties = d - return server_snapshot_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/server_template.py b/src/shellrent_sdk/client/models/server_template.py index 7367ee5..2f32f84 100644 --- a/src/shellrent_sdk/client/models/server_template.py +++ b/src/shellrent_sdk/client/models/server_template.py @@ -15,9 +15,14 @@ @_attrs_define class ServerTemplate: + """Server template that can be chosen when buying the service, with the operating systems compatible with it""" + template_code: str + """ Code of the server template, to send as `SERVER_CONFIGURATION_CODE` in `data` when buying the service """ template_name: str + """ Short name of the server template """ template_name_alternative: None | str + """ Longer name of the server template; null when it has none """ min_ram: int | None """ Min RAM (GB), for VPS/VM only """ min_cpu: int | None diff --git a/src/shellrent_sdk/client/models/service.py b/src/shellrent_sdk/client/models/service.py index baa2455..3292642 100644 --- a/src/shellrent_sdk/client/models/service.py +++ b/src/shellrent_sdk/client/models/service.py @@ -17,25 +17,46 @@ @_attrs_define class Service: + """Service of the price list, with its category, recurrences, prices and purchase options""" + service_id: int service_category: ServiceCategory service_name: str + """ Name of the service, in Italian """ recurrence: Recurrence + """ Billing recurrence: its frequency and, in days, the timings of renewal, suspension and dismission """ recurrences_available: list[Recurrence] + """ Recurrences that can be chosen when buying the service (`recurrence_id`) """ tld_id: int | None + """ Id of the TLD of a domain service (`GET /api/v3/tlds/{tld_id}`); null for the other services """ service_code: str + """ Code of the service, for example `CLOUD_STORAGE_100` or `BOX_PEC` """ service_url: str - activation_price: Amount + """ URL of the cart page of the service """ + activation_price: Amount | None + """ Activation price of the price list; null for sub-accounts """ renew_price: Amount | None + """ Renew price of the price list; null when the service has none and for sub-accounts """ restore_price: Amount | None + """ Restore price of the price list; null when the service has none and for sub-accounts """ transfer_price: Amount | None + """ Transfer price of the price list; null when the service has none and for sub-accounts """ is_primary: bool | None + """ Whether the service can be sold as a primary service """ is_secondary: bool | None + """ Whether the service is an additional service of a primary one """ is_presale: bool | None + """ Whether the service can be bought as an additional service together with its primary service (presale) """ is_aftersale: bool | None + """ Whether the service can be bought as an additional service after the activation of its primary service + (aftersale) """ is_quantifiable: bool | None + """ Whether the service can be added to the cart more than once; the quantity of one purchase is set by + `quantity_min` and `quantity_max` """ quantity_min: int | None + """ Minimum quantity of the service in one purchase """ quantity_max: int | None + """ Maximum quantity of the service in one purchase; null when the quantity cannot be chosen """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -61,7 +82,11 @@ def to_dict(self) -> dict[str, Any]: service_url = self.service_url - activation_price = self.activation_price.to_dict() + activation_price: dict[str, Any] | None + if isinstance(self.activation_price, Amount): + activation_price = self.activation_price.to_dict() + else: + activation_price = self.activation_price renew_price: dict[str, Any] | None if isinstance(self.renew_price, Amount): @@ -163,7 +188,20 @@ def _parse_tld_id(data: object) -> int | None: service_url = d.pop("service_url") - activation_price = Amount.from_dict(d.pop("activation_price")) + def _parse_activation_price(data: object) -> Amount | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + activation_price_type_0 = Amount.from_dict(data) + + return activation_price_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(Amount | None, data) + + activation_price = _parse_activation_price(d.pop("activation_price")) def _parse_renew_price(data: object) -> Amount | None: if data is None: diff --git a/src/shellrent_sdk/client/models/service_category.py b/src/shellrent_sdk/client/models/service_category.py index 3bf845f..566b353 100644 --- a/src/shellrent_sdk/client/models/service_category.py +++ b/src/shellrent_sdk/client/models/service_category.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import Any, Self, TypeVar +from typing import Any, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -12,9 +12,13 @@ @_attrs_define class ServiceCategory: category_code: str + """ Code of the category, for example `PEC` or `CLOUD_STORAGE` """ category_name: str - area_code: str + """ Name of the category, in Italian """ + area_code: None | str + """ Code of the area that groups the category, for example `HOSTING`, `DOMAIN` or `LICENSE` """ area_name: str + """ Name of the area, in Italian """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -22,6 +26,7 @@ def to_dict(self) -> dict[str, Any]: category_name = self.category_name + area_code: None | str area_code = self.area_code area_name = self.area_name @@ -46,7 +51,12 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: category_name = d.pop("category_name") - area_code = d.pop("area_code") + def _parse_area_code(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + area_code = _parse_area_code(d.pop("area_code")) area_name = d.pop("area_name") diff --git a/src/shellrent_sdk/client/models/service_change.py b/src/shellrent_sdk/client/models/service_change.py index ea1f5a7..5d39a01 100644 --- a/src/shellrent_sdk/client/models/service_change.py +++ b/src/shellrent_sdk/client/models/service_change.py @@ -16,8 +16,13 @@ @_attrs_define class ServiceChange: + """Service the purchase can change to, with the price of the change""" + service: Service + """ Service of the price list, with its category, recurrences, prices and purchase options """ activation_price: Amount + """ Amount in euros: the taxable amount and, when computed with a tax regime, the VAT rate, the VAT and the + total, which are null otherwise """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/service_paginated_list_response.py b/src/shellrent_sdk/client/models/service_paginated_list_response.py index f8a40f3..53767b0 100644 --- a/src/shellrent_sdk/client/models/service_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/service_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class ServicePaginatedListResponse: - error: int + """Successful response with a page of `Service`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[Service] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.service import Service d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/service_server.py b/src/shellrent_sdk/client/models/service_server.py index 308bbc5..646d4f6 100644 --- a/src/shellrent_sdk/client/models/service_server.py +++ b/src/shellrent_sdk/client/models/service_server.py @@ -18,26 +18,50 @@ @_attrs_define class ServiceServer: + """Server service of the price list, with the templates and operating systems it can be bought with""" + service_id: int service_category: ServiceCategory service_name: str + """ Name of the service, in Italian """ recurrence: Recurrence + """ Billing recurrence: its frequency and, in days, the timings of renewal, suspension and dismission """ recurrences_available: list[Recurrence] + """ Recurrences that can be chosen when buying the service (`recurrence_id`) """ tld_id: int | None + """ Id of the TLD of a domain service (`GET /api/v3/tlds/{tld_id}`); null for the other services """ service_code: str + """ Code of the service, for example `DEDICATED_SERVER_ADVANCE` or `CLOUD_VPS_STD_IOPS` """ service_url: str + """ URL of the cart page of the service """ activation_price: Amount + """ Amount in euros: the taxable amount and, when computed with a tax regime, the VAT rate, the VAT and the + total, which are null otherwise """ renew_price: Amount | None + """ Renew price of the price list; null when the service has none """ restore_price: Amount | None + """ Restore price of the price list; null when the service has none """ transfer_price: Amount | None + """ Transfer price of the price list; null when the service has none """ is_primary: bool | None + """ Whether the service can be sold as a primary service """ is_secondary: bool | None + """ Whether the service is an additional service of a primary one """ is_presale: bool | None + """ Whether the service can be bought as an additional service together with its primary service (presale) """ is_aftersale: bool | None + """ Whether the service can be bought as an additional service after the activation of its primary service + (aftersale) """ is_quantifiable: bool | None + """ Whether the service can be added to the cart more than once; the quantity of one purchase is set by + `quantity_min` and `quantity_max` """ quantity_min: int | None + """ Minimum quantity of the service in one purchase """ quantity_max: int | None + """ Maximum quantity of the service in one purchase; null when the quantity cannot be chosen """ templates: list[ServerTemplate] + """ Server templates compatible with the service, with their operating systems: `template_code` and `os_code` + are the values of `SERVER_CONFIGURATION_CODE` and `SERVER_TEMPLATE_CODE` when buying it """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/service_server_paginated_list_response.py b/src/shellrent_sdk/client/models/service_server_paginated_list_response.py index f6e5c8c..72d40f9 100644 --- a/src/shellrent_sdk/client/models/service_server_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/service_server_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class ServiceServerPaginatedListResponse: - error: int + """Successful response with a page of `ServiceServer`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[ServiceServer] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.service_server import ServiceServer d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/simple_pagination_meta.py b/src/shellrent_sdk/client/models/simple_pagination_meta.py index d5dee6b..88ba62f 100644 --- a/src/shellrent_sdk/client/models/simple_pagination_meta.py +++ b/src/shellrent_sdk/client/models/simple_pagination_meta.py @@ -11,9 +11,14 @@ @_attrs_define class SimplePaginationMeta: + """Pagination of a list without the totals: `next` says whether there is another page""" + count: int + """ Number of items in this page: 0 beyond the last page """ page: int + """ Number of this page, starting from 1 """ per_page: int + """ Maximum number of items in a page """ next_: bool """ Tells if there is another page after this one """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) diff --git a/src/shellrent_sdk/client/models/sms.py b/src/shellrent_sdk/client/models/sms.py index a172ced..65ddef5 100644 --- a/src/shellrent_sdk/client/models/sms.py +++ b/src/shellrent_sdk/client/models/sms.py @@ -12,15 +12,25 @@ @_attrs_define class Sms: + """SMS sending of the account: one message to one or more recipients (`GET /api/v3/sms/{sms_id}/messages`)""" + id: int quality: str + """ Delivery quality: `STANDARD` or `PREMIUM` """ status: str + """ Status of the sending: `DRAFT` (not confirmed), `PROCESSING` (being sent), `ACCOMPLISHED` (all the messages + sent) or `CANCELLED` (sending stopped) """ sender: None | str + """ Sender name, for the `PREMIUM` quality """ message: None | str send_from: datetime.datetime | None + """ Date and time from which the messages are sent """ date_approved: datetime.datetime | None + """ Date and time the sending was confirmed; null for a `DRAFT` """ stop_date: datetime.datetime | None + """ Date and time the sending was stopped; null if it was not """ sms_count: int | None + """ Number of SMS the message takes for each recipient: a long text is split into several SMS """ date_created: datetime.datetime additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) diff --git a/src/shellrent_sdk/client/models/sms_account.py b/src/shellrent_sdk/client/models/sms_account.py index b296422..9807362 100644 --- a/src/shellrent_sdk/client/models/sms_account.py +++ b/src/shellrent_sdk/client/models/sms_account.py @@ -15,7 +15,10 @@ @_attrs_define class SmsAccount: + """SMS credit of the account, with the estimated number of SMS it is enough for""" + credit: AmountSimple + """ Amount in euros, without the VAT details of `Amount` """ sms_standard: int """ Estimated number of SMS messages available with "STANDARD" quality if sent to Italy """ sms_premium: int diff --git a/src/shellrent_sdk/client/models/sms_account_response.py b/src/shellrent_sdk/client/models/sms_account_response.py index 037de6a..03244a4 100644 --- a/src/shellrent_sdk/client/models/sms_account_response.py +++ b/src/shellrent_sdk/client/models/sms_account_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.sms_account import SmsAccount - from ..models.sms_account_response_meta_type_0 import SmsAccountResponseMetaType0 T = TypeVar("T", bound="SmsAccountResponse") @@ -16,15 +15,19 @@ @_attrs_define class SmsAccountResponse: - error: int + """Successful response with one `SmsAccount`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: SmsAccount - meta: None | SmsAccountResponseMetaType0 + """ SMS credit of the account, with the estimated number of SMS it is enough for """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.sms_account_response_meta_type_0 import SmsAccountResponseMetaType0 - error = self.error message: None | str @@ -32,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, SmsAccountResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.sms_account import SmsAccount - from ..models.sms_account_response_meta_type_0 import ( - SmsAccountResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -70,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = SmsAccount.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | SmsAccountResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = SmsAccountResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | SmsAccountResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") sms_account_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/sms_account_response_meta_type_0.py b/src/shellrent_sdk/client/models/sms_account_response_meta_type_0.py deleted file mode 100644 index 2eacbf9..0000000 --- a/src/shellrent_sdk/client/models/sms_account_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="SmsAccountResponseMetaType0") - - -@_attrs_define -class SmsAccountResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - sms_account_response_meta_type_0 = cls() - - sms_account_response_meta_type_0.additional_properties = d - return sms_account_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/sms_can_cancel.py b/src/shellrent_sdk/client/models/sms_can_cancel.py index bea2925..155b6ed 100644 --- a/src/shellrent_sdk/client/models/sms_can_cancel.py +++ b/src/shellrent_sdk/client/models/sms_can_cancel.py @@ -11,8 +11,12 @@ @_attrs_define class SmsCanCancel: + """Whether the sending of an SMS can be cancelled (`POST /api/v3/sms/{sms_id}/cancellation`)""" + sms_id: int + """ Id of the SMS (`GET /api/v3/sms/{sms_id}`) """ can_cancel: bool + """ Whether the sending can be cancelled: only while it is `PROCESSING` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/sms_can_cancel_response.py b/src/shellrent_sdk/client/models/sms_can_cancel_response.py index 4f88aa5..4616d0a 100644 --- a/src/shellrent_sdk/client/models/sms_can_cancel_response.py +++ b/src/shellrent_sdk/client/models/sms_can_cancel_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.sms_can_cancel import SmsCanCancel - from ..models.sms_can_cancel_response_meta_type_0 import SmsCanCancelResponseMetaType0 T = TypeVar("T", bound="SmsCanCancelResponse") @@ -16,15 +15,19 @@ @_attrs_define class SmsCanCancelResponse: - error: int + """Successful response with one `SmsCanCancel`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: SmsCanCancel - meta: None | SmsCanCancelResponseMetaType0 + """ Whether the sending of an SMS can be cancelled (`POST /api/v3/sms/{sms_id}/cancellation`) """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.sms_can_cancel_response_meta_type_0 import SmsCanCancelResponseMetaType0 - error = self.error message: None | str @@ -32,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, SmsCanCancelResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.sms_can_cancel import SmsCanCancel - from ..models.sms_can_cancel_response_meta_type_0 import ( - SmsCanCancelResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -70,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = SmsCanCancel.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | SmsCanCancelResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = SmsCanCancelResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | SmsCanCancelResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") sms_can_cancel_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/sms_can_cancel_response_meta_type_0.py b/src/shellrent_sdk/client/models/sms_can_cancel_response_meta_type_0.py deleted file mode 100644 index bb5db98..0000000 --- a/src/shellrent_sdk/client/models/sms_can_cancel_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="SmsCanCancelResponseMetaType0") - - -@_attrs_define -class SmsCanCancelResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - sms_can_cancel_response_meta_type_0 = cls() - - sms_can_cancel_response_meta_type_0.additional_properties = d - return sms_can_cancel_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/sms_can_delete.py b/src/shellrent_sdk/client/models/sms_can_delete.py index 370d4c6..be9904b 100644 --- a/src/shellrent_sdk/client/models/sms_can_delete.py +++ b/src/shellrent_sdk/client/models/sms_can_delete.py @@ -11,8 +11,12 @@ @_attrs_define class SmsCanDelete: + """Whether an SMS can be deleted (`DELETE /api/v3/sms/{sms_id}`)""" + sms_id: int + """ Id of the SMS (`GET /api/v3/sms/{sms_id}`) """ can_delete: bool + """ Whether the SMS can be deleted: only a `DRAFT` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/sms_can_delete_response.py b/src/shellrent_sdk/client/models/sms_can_delete_response.py index 21ef22b..9f188eb 100644 --- a/src/shellrent_sdk/client/models/sms_can_delete_response.py +++ b/src/shellrent_sdk/client/models/sms_can_delete_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.sms_can_delete import SmsCanDelete - from ..models.sms_can_delete_response_meta_type_0 import SmsCanDeleteResponseMetaType0 T = TypeVar("T", bound="SmsCanDeleteResponse") @@ -16,15 +15,19 @@ @_attrs_define class SmsCanDeleteResponse: - error: int + """Successful response with one `SmsCanDelete`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: SmsCanDelete - meta: None | SmsCanDeleteResponseMetaType0 + """ Whether an SMS can be deleted (`DELETE /api/v3/sms/{sms_id}`) """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.sms_can_delete_response_meta_type_0 import SmsCanDeleteResponseMetaType0 - error = self.error message: None | str @@ -32,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, SmsCanDeleteResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.sms_can_delete import SmsCanDelete - from ..models.sms_can_delete_response_meta_type_0 import ( - SmsCanDeleteResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -70,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = SmsCanDelete.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | SmsCanDeleteResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = SmsCanDeleteResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | SmsCanDeleteResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") sms_can_delete_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/sms_can_delete_response_meta_type_0.py b/src/shellrent_sdk/client/models/sms_can_delete_response_meta_type_0.py deleted file mode 100644 index d21b6df..0000000 --- a/src/shellrent_sdk/client/models/sms_can_delete_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="SmsCanDeleteResponseMetaType0") - - -@_attrs_define -class SmsCanDeleteResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - sms_can_delete_response_meta_type_0 = cls() - - sms_can_delete_response_meta_type_0.additional_properties = d - return sms_can_delete_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/sms_create_request.py b/src/shellrent_sdk/client/models/sms_create_request.py index 45d2a8a..d9c0739 100644 --- a/src/shellrent_sdk/client/models/sms_create_request.py +++ b/src/shellrent_sdk/client/models/sms_create_request.py @@ -5,7 +5,6 @@ from typing import Any, Self, TypeVar, cast from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..models.sms_create_request_quality import SmsCreateRequestQuality from ..types import UNSET, Unset @@ -37,8 +36,8 @@ class SmsCreateRequest: """ Sender name, from 2 to 11 characters. Required when quality is PREMIUM, ignored when quality is STANDARD. """ send_date: datetime.datetime | Unset = UNSET - """ Date and time from which to send the SMS. If not specified, the SMS is sent immediately. """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + """ Date and time from which to send the SMS. If not specified, the SMS is sent immediately (ISO 8601 UTC: YYYY- + MM-DDTHH:MM:SSZ) """ def to_dict(self) -> dict[str, Any]: message = self.message @@ -60,7 +59,7 @@ def to_dict(self) -> dict[str, Any]: send_date = self.send_date.isoformat() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "message": message, @@ -107,21 +106,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: send_date=send_date, ) - sms_create_request.additional_properties = d return sms_create_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/sms_message.py b/src/shellrent_sdk/client/models/sms_message.py index 90668ee..234b1a7 100644 --- a/src/shellrent_sdk/client/models/sms_message.py +++ b/src/shellrent_sdk/client/models/sms_message.py @@ -7,8 +7,6 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset - if TYPE_CHECKING: from ..models.sms_price import SmsPrice @@ -18,22 +16,38 @@ @_attrs_define class SmsMessage: + """Message of an SMS sending to one recipient, with its delivery data""" + id: int sms_id: int + """ Id of the SMS sending (`GET /api/v3/sms/{sms_id}`) """ + sms_price: None | SmsPrice + """ Price list of the destination country; null for sub-accounts """ contact_name: None | str + """ Surname and name of the recipient, when taken from a phonebook; otherwise empty or null """ phone_number: str + """ Phone number of the recipient in international format with the `00` prefix, for example `00393331122444` """ date_sent: datetime.datetime | None + """ Date and time the message was sent; null until it is sent """ date_delivered: datetime.datetime | None + """ Date and time the message was delivered; null until the delivery is confirmed """ error: None | str """ Error code if the SMS was not delivered """ - sms_price: SmsPrice | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + from ..models.sms_price import SmsPrice + id = self.id sms_id = self.sms_id + sms_price: dict[str, Any] | None + if isinstance(self.sms_price, SmsPrice): + sms_price = self.sms_price.to_dict() + else: + sms_price = self.sms_price + contact_name: None | str contact_name = self.contact_name @@ -54,16 +68,13 @@ def to_dict(self) -> dict[str, Any]: error: None | str error = self.error - sms_price: dict[str, Any] | Unset = UNSET - if not isinstance(self.sms_price, Unset): - sms_price = self.sms_price.to_dict() - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( { "id": id, "sms_id": sms_id, + "sms_price": sms_price, "contact_name": contact_name, "phone_number": phone_number, "date_sent": date_sent, @@ -71,8 +82,6 @@ def to_dict(self) -> dict[str, Any]: "error": error, } ) - if sms_price is not UNSET: - field_dict["sms_price"] = sms_price return field_dict @@ -85,6 +94,21 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: sms_id = d.pop("sms_id") + def _parse_sms_price(data: object) -> None | SmsPrice: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + sms_price_type_0 = SmsPrice.from_dict(data) + + return sms_price_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | SmsPrice, data) + + sms_price = _parse_sms_price(d.pop("sms_price")) + def _parse_contact_name(data: object) -> None | str: if data is None: return data @@ -131,22 +155,15 @@ def _parse_error(data: object) -> None | str: error = _parse_error(d.pop("error")) - _sms_price = d.pop("sms_price", UNSET) - sms_price: SmsPrice | Unset - if isinstance(_sms_price, Unset): - sms_price = UNSET - else: - sms_price = SmsPrice.from_dict(_sms_price) - sms_message = cls( id=id, sms_id=sms_id, + sms_price=sms_price, contact_name=contact_name, phone_number=phone_number, date_sent=date_sent, date_delivered=date_delivered, error=error, - sms_price=sms_price, ) sms_message.additional_properties = d diff --git a/src/shellrent_sdk/client/models/sms_message_paginated_list_response.py b/src/shellrent_sdk/client/models/sms_message_paginated_list_response.py index ff76f77..6f99ff3 100644 --- a/src/shellrent_sdk/client/models/sms_message_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/sms_message_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class SmsMessagePaginatedListResponse: - error: int + """Successful response with a page of `SmsMessage`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[SmsMessage] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.sms_message import SmsMessage d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/sms_message_response.py b/src/shellrent_sdk/client/models/sms_message_response.py index 34932e9..ebfc09b 100644 --- a/src/shellrent_sdk/client/models/sms_message_response.py +++ b/src/shellrent_sdk/client/models/sms_message_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.sms_message import SmsMessage - from ..models.sms_message_response_meta_type_0 import SmsMessageResponseMetaType0 T = TypeVar("T", bound="SmsMessageResponse") @@ -16,15 +15,19 @@ @_attrs_define class SmsMessageResponse: - error: int + """Successful response with one `SmsMessage`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: SmsMessage - meta: None | SmsMessageResponseMetaType0 + """ Message of an SMS sending to one recipient, with its delivery data """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.sms_message_response_meta_type_0 import SmsMessageResponseMetaType0 - error = self.error message: None | str @@ -32,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, SmsMessageResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.sms_message import SmsMessage - from ..models.sms_message_response_meta_type_0 import ( - SmsMessageResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -70,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = SmsMessage.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | SmsMessageResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = SmsMessageResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | SmsMessageResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") sms_message_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/sms_message_response_meta_type_0.py b/src/shellrent_sdk/client/models/sms_message_response_meta_type_0.py deleted file mode 100644 index 9858fad..0000000 --- a/src/shellrent_sdk/client/models/sms_message_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="SmsMessageResponseMetaType0") - - -@_attrs_define -class SmsMessageResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - sms_message_response_meta_type_0 = cls() - - sms_message_response_meta_type_0.additional_properties = d - return sms_message_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/sms_paginated_list_response.py b/src/shellrent_sdk/client/models/sms_paginated_list_response.py index 8cd8923..8b7fadd 100644 --- a/src/shellrent_sdk/client/models/sms_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/sms_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class SmsPaginatedListResponse: - error: int + """Successful response with a page of `Sms`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[Sms] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.sms import Sms d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/sms_phonebook.py b/src/shellrent_sdk/client/models/sms_phonebook.py index 0a28cd8..023e3ff 100644 --- a/src/shellrent_sdk/client/models/sms_phonebook.py +++ b/src/shellrent_sdk/client/models/sms_phonebook.py @@ -11,9 +11,12 @@ @_attrs_define class SmsPhonebook: + """Phonebook of SMS recipients of the account""" + id: int name: None | str contacts_count: int + """ Number of contacts in the phonebook (`GET /api/v3/sms-phonebooks/{phonebook_id}/contacts`) """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/sms_phonebook_add_contacts_request.py b/src/shellrent_sdk/client/models/sms_phonebook_add_contacts_request.py index 50c3dbb..3e50307 100644 --- a/src/shellrent_sdk/client/models/sms_phonebook_add_contacts_request.py +++ b/src/shellrent_sdk/client/models/sms_phonebook_add_contacts_request.py @@ -4,7 +4,6 @@ from typing import TYPE_CHECKING, Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.sms_phonebook_add_contacts_request_phone_numbers_item import ( @@ -19,7 +18,6 @@ class SmsPhonebookAddContactsRequest: phone_numbers: list[SmsPhonebookAddContactsRequestPhoneNumbersItem] """ Collection of one or more phone numbers to create contacts in the Phonebook """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: phone_numbers = [] @@ -28,7 +26,7 @@ def to_dict(self) -> dict[str, Any]: phone_numbers.append(phone_numbers_item) field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "phone_numbers": phone_numbers, @@ -57,21 +55,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: phone_numbers=phone_numbers, ) - sms_phonebook_add_contacts_request.additional_properties = d return sms_phonebook_add_contacts_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/sms_phonebook_contact.py b/src/shellrent_sdk/client/models/sms_phonebook_contact.py index f8f3500..3c8db96 100644 --- a/src/shellrent_sdk/client/models/sms_phonebook_contact.py +++ b/src/shellrent_sdk/client/models/sms_phonebook_contact.py @@ -16,10 +16,14 @@ @_attrs_define class SmsPhonebookContact: + """Contact of the SMS phonebooks of the account""" + id: int phonebooks: list[int] + """ Ids of the phonebooks that contain the contact (`GET /api/v3/sms-phonebooks/{phonebook_id}`) """ country: Country phone_number: str + """ Phone number without the international prefix: the country is in `country` """ name: None | str surname: None | str birth_date: datetime.date | None diff --git a/src/shellrent_sdk/client/models/sms_phonebook_contact_paginated_list_response.py b/src/shellrent_sdk/client/models/sms_phonebook_contact_paginated_list_response.py index 3c5176c..00c773a 100644 --- a/src/shellrent_sdk/client/models/sms_phonebook_contact_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/sms_phonebook_contact_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class SmsPhonebookContactPaginatedListResponse: - error: int + """Successful response with a page of `SmsPhonebookContact`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[SmsPhonebookContact] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.sms_phonebook_contact import SmsPhonebookContact d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/sms_phonebook_create_request.py b/src/shellrent_sdk/client/models/sms_phonebook_create_request.py index 7c7c281..af74caa 100644 --- a/src/shellrent_sdk/client/models/sms_phonebook_create_request.py +++ b/src/shellrent_sdk/client/models/sms_phonebook_create_request.py @@ -4,7 +4,6 @@ from typing import TYPE_CHECKING, Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -23,7 +22,6 @@ class SmsPhonebookCreateRequest: """ Name of the Phonebook. """ phone_numbers: list[SmsPhonebookCreateRequestPhoneNumbersItem] | Unset = UNSET """ Collection of one or more phone numbers to create contacts in the Phonebook """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: name = self.name @@ -36,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: phone_numbers.append(phone_numbers_item) field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "name": name, @@ -72,21 +70,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: phone_numbers=phone_numbers, ) - sms_phonebook_create_request.additional_properties = d return sms_phonebook_create_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/sms_phonebook_edit_request.py b/src/shellrent_sdk/client/models/sms_phonebook_edit_request.py index ebd210e..22056f2 100644 --- a/src/shellrent_sdk/client/models/sms_phonebook_edit_request.py +++ b/src/shellrent_sdk/client/models/sms_phonebook_edit_request.py @@ -4,7 +4,6 @@ from typing import Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="SmsPhonebookEditRequest") @@ -13,13 +12,12 @@ class SmsPhonebookEditRequest: name: str """ Name of the Phonebook. """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: name = self.name field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "name": name, @@ -37,21 +35,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: name=name, ) - sms_phonebook_edit_request.additional_properties = d return sms_phonebook_edit_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/sms_phonebook_paginated_list_response.py b/src/shellrent_sdk/client/models/sms_phonebook_paginated_list_response.py index 6a661b7..b8a18fa 100644 --- a/src/shellrent_sdk/client/models/sms_phonebook_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/sms_phonebook_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class SmsPhonebookPaginatedListResponse: - error: int + """Successful response with a page of `SmsPhonebook`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[SmsPhonebook] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.sms_phonebook import SmsPhonebook d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/sms_phonebook_response.py b/src/shellrent_sdk/client/models/sms_phonebook_response.py index aca27d8..f0d9494 100644 --- a/src/shellrent_sdk/client/models/sms_phonebook_response.py +++ b/src/shellrent_sdk/client/models/sms_phonebook_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.sms_phonebook import SmsPhonebook - from ..models.sms_phonebook_response_meta_type_0 import SmsPhonebookResponseMetaType0 T = TypeVar("T", bound="SmsPhonebookResponse") @@ -16,15 +15,19 @@ @_attrs_define class SmsPhonebookResponse: - error: int + """Successful response with one `SmsPhonebook`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: SmsPhonebook - meta: None | SmsPhonebookResponseMetaType0 + """ Phonebook of SMS recipients of the account """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.sms_phonebook_response_meta_type_0 import SmsPhonebookResponseMetaType0 - error = self.error message: None | str @@ -32,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, SmsPhonebookResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.sms_phonebook import SmsPhonebook - from ..models.sms_phonebook_response_meta_type_0 import ( - SmsPhonebookResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -70,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = SmsPhonebook.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | SmsPhonebookResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = SmsPhonebookResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | SmsPhonebookResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") sms_phonebook_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/sms_phonebook_response_meta_type_0.py b/src/shellrent_sdk/client/models/sms_phonebook_response_meta_type_0.py deleted file mode 100644 index 943e09a..0000000 --- a/src/shellrent_sdk/client/models/sms_phonebook_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="SmsPhonebookResponseMetaType0") - - -@_attrs_define -class SmsPhonebookResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - sms_phonebook_response_meta_type_0 = cls() - - sms_phonebook_response_meta_type_0.additional_properties = d - return sms_phonebook_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/sms_price.py b/src/shellrent_sdk/client/models/sms_price.py index d256d0c..0d56ef4 100644 --- a/src/shellrent_sdk/client/models/sms_price.py +++ b/src/shellrent_sdk/client/models/sms_price.py @@ -17,10 +17,17 @@ @_attrs_define class SmsPrice: + """Prices of an SMS sent to a country, for each delivery quality""" + country: Country standard_price: Amount + """ Amount in euros: the taxable amount and, when computed with a tax regime, the VAT rate, the VAT and the + total, which are null otherwise """ premium_price: Amount + """ Amount in euros: the taxable amount and, when computed with a tax regime, the VAT rate, the VAT and the + total, which are null otherwise """ valid_from: datetime.datetime | None + """ Date and time from which these prices apply """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/sms_price_paginated_list_response.py b/src/shellrent_sdk/client/models/sms_price_paginated_list_response.py index 09dd056..7b2bde9 100644 --- a/src/shellrent_sdk/client/models/sms_price_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/sms_price_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class SmsPricePaginatedListResponse: - error: int + """Successful response with a page of `SmsPrice`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[SmsPrice] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.sms_price import SmsPrice d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/sms_price_response.py b/src/shellrent_sdk/client/models/sms_price_response.py index 82e9aa7..0a3cb0d 100644 --- a/src/shellrent_sdk/client/models/sms_price_response.py +++ b/src/shellrent_sdk/client/models/sms_price_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.sms_price import SmsPrice - from ..models.sms_price_response_meta_type_0 import SmsPriceResponseMetaType0 T = TypeVar("T", bound="SmsPriceResponse") @@ -16,15 +15,19 @@ @_attrs_define class SmsPriceResponse: - error: int + """Successful response with one `SmsPrice`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: SmsPrice - meta: None | SmsPriceResponseMetaType0 + """ Prices of an SMS sent to a country, for each delivery quality """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.sms_price_response_meta_type_0 import SmsPriceResponseMetaType0 - error = self.error message: None | str @@ -32,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, SmsPriceResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.sms_price import SmsPrice - from ..models.sms_price_response_meta_type_0 import ( - SmsPriceResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -70,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = SmsPrice.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | SmsPriceResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = SmsPriceResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | SmsPriceResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") sms_price_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/sms_price_response_meta_type_0.py b/src/shellrent_sdk/client/models/sms_price_response_meta_type_0.py deleted file mode 100644 index ed306f0..0000000 --- a/src/shellrent_sdk/client/models/sms_price_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="SmsPriceResponseMetaType0") - - -@_attrs_define -class SmsPriceResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - sms_price_response_meta_type_0 = cls() - - sms_price_response_meta_type_0.additional_properties = d - return sms_price_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/sms_response.py b/src/shellrent_sdk/client/models/sms_response.py index 27b6a0c..a95d55c 100644 --- a/src/shellrent_sdk/client/models/sms_response.py +++ b/src/shellrent_sdk/client/models/sms_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.sms import Sms - from ..models.sms_response_meta_type_0 import SmsResponseMetaType0 T = TypeVar("T", bound="SmsResponse") @@ -16,15 +15,19 @@ @_attrs_define class SmsResponse: - error: int + """Successful response with one `Sms`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: Sms - meta: None | SmsResponseMetaType0 + """ SMS sending of the account: one message to one or more recipients (`GET /api/v3/sms/{sms_id}/messages`) """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.sms_response_meta_type_0 import SmsResponseMetaType0 - error = self.error message: None | str @@ -32,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, SmsResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,10 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.sms import Sms - from ..models.sms_response_meta_type_0 import SmsResponseMetaType0 d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -68,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = Sms.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | SmsResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = SmsResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | SmsResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") sms_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/sms_response_meta_type_0.py b/src/shellrent_sdk/client/models/sms_response_meta_type_0.py deleted file mode 100644 index 83ffb39..0000000 --- a/src/shellrent_sdk/client/models/sms_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="SmsResponseMetaType0") - - -@_attrs_define -class SmsResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - sms_response_meta_type_0 = cls() - - sms_response_meta_type_0.additional_properties = d - return sms_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/ssl_certificate.py b/src/shellrent_sdk/client/models/ssl_certificate.py index 24a49d4..3fd9f1c 100644 --- a/src/shellrent_sdk/client/models/ssl_certificate.py +++ b/src/shellrent_sdk/client/models/ssl_certificate.py @@ -12,31 +12,62 @@ @_attrs_define class SslCertificate: + """SSL or code signing certificate of the account, with its validation data and its administrative contact""" + ssl_certificate_id: int purchase_id: int + """ Id of the purchase of the certificate (`GET /api/v3/purchases/{purchase_id}`) """ domain_name: None | str cn_type: None | str + """ Type of the common name: `NORMAL` (a single name) or `WILDCARD` (a wildcard name, for the subdomains) """ validation_type: None | str + """ Validation level: `DV` (domain validation), `OV` (organization validation) or `EV` (extended validation) """ san_max: int + """ Maximum number of additional names (SAN, Subject Alternative Names) the certificate can include """ can_reissue: bool + """ Whether the certificate includes reissues; `GET /api/v3/ssl-certificates/{ssl_certificate_id}/can-reissue` + tells whether one can start now """ validation_method: None | str + """ How the domain is validated: `APPROVER_EMAIL` (by email to `approver_email`) or `DNS` (with a CNAME record + that we add to the zone of the domain, see `csr_md5_hash`) """ valid_to: datetime.datetime | None + """ Expiry of the certificate, at the end of the day (Italian time) """ csr_md5_hash: None | str + """ MD5 hash of the CSR for the DNS validation, in uppercase hexadecimal: the name of the CNAME record is `_` + followed by this hash; null without a DNS validation """ csr_sha256_hash: None | str + """ SHA-256 hash of the CSR for the DNS validation, in uppercase hexadecimal split in two by a dot: the + destination of the CNAME record starts with it; null without a DNS validation """ certificate_status: None | str + """ Status of the certificate at the certification authority, for example `Issued`, `Expired`, `Rejected` or + `Revoked` """ approver_email: None | str + """ Address that receives the request to approve the validation of the domain, with the `APPROVER_EMAIL` method + (see `GET /api/v3/ssl-certificates/approver-emails`) """ admin_first_name: None | str + """ First name of the administrative contact of the certificate """ admin_last_name: None | str + """ Last name of the administrative contact """ admin_organization: None | str + """ Organization of the administrative contact """ admin_role: None | str + """ Role of the administrative contact: `Business Owner`, `Website Owner`, `President` or `Company Director` """ admin_email: None | str + """ Email of the administrative contact """ admin_phone_cc: None | str + """ International dialling code of the phone of the administrative contact, for example `39` """ admin_phone_number: None | str + """ Phone number of the administrative contact, without the dialling code """ admin_address: None | str + """ Address of the administrative contact """ admin_city: None | str + """ City of the administrative contact """ admin_state: None | str + """ State or province of the administrative contact """ admin_postal_code: None | str + """ Postal code of the administrative contact """ admin_country: None | str + """ Country of the administrative contact, as ISO 3166-1 alpha-2 code (for example `IT`) """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/ssl_certificate_approver_emails.py b/src/shellrent_sdk/client/models/ssl_certificate_approver_emails.py index bcc7659..a53aa87 100644 --- a/src/shellrent_sdk/client/models/ssl_certificate_approver_emails.py +++ b/src/shellrent_sdk/client/models/ssl_certificate_approver_emails.py @@ -11,8 +11,12 @@ @_attrs_define class SslCertificateApproverEmails: + """Email addresses that can approve the validation of a domain name (`approver_email` of the certificate)""" + domain_name: str approver_emails: list[str] + """ Addresses `admin`, `webmaster`, `hostmaster`, `postmaster` and `administrator` at the domain name and at + each of its parent domains """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/ssl_certificate_approver_emails_response.py b/src/shellrent_sdk/client/models/ssl_certificate_approver_emails_response.py index 9deb984..b99d20b 100644 --- a/src/shellrent_sdk/client/models/ssl_certificate_approver_emails_response.py +++ b/src/shellrent_sdk/client/models/ssl_certificate_approver_emails_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.ssl_certificate_approver_emails import SslCertificateApproverEmails - from ..models.ssl_certificate_approver_emails_response_meta_type_0 import ( - SslCertificateApproverEmailsResponseMetaType0, - ) T = TypeVar("T", bound="SslCertificateApproverEmailsResponse") @@ -18,17 +15,19 @@ @_attrs_define class SslCertificateApproverEmailsResponse: - error: int + """Successful response with one `SslCertificateApproverEmails`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: SslCertificateApproverEmails - meta: None | SslCertificateApproverEmailsResponseMetaType0 + """ Email addresses that can approve the validation of a domain name (`approver_email` of the certificate) """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.ssl_certificate_approver_emails_response_meta_type_0 import ( - SslCertificateApproverEmailsResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, SslCertificateApproverEmailsResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -60,12 +55,11 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.ssl_certificate_approver_emails import ( SslCertificateApproverEmails, ) - from ..models.ssl_certificate_approver_emails_response_meta_type_0 import ( - SslCertificateApproverEmailsResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -76,20 +70,7 @@ def _parse_message(data: object) -> None | str: data = SslCertificateApproverEmails.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | SslCertificateApproverEmailsResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = SslCertificateApproverEmailsResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | SslCertificateApproverEmailsResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") ssl_certificate_approver_emails_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/ssl_certificate_approver_emails_response_meta_type_0.py b/src/shellrent_sdk/client/models/ssl_certificate_approver_emails_response_meta_type_0.py deleted file mode 100644 index afa14a2..0000000 --- a/src/shellrent_sdk/client/models/ssl_certificate_approver_emails_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="SslCertificateApproverEmailsResponseMetaType0") - - -@_attrs_define -class SslCertificateApproverEmailsResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - ssl_certificate_approver_emails_response_meta_type_0 = cls() - - ssl_certificate_approver_emails_response_meta_type_0.additional_properties = d - return ssl_certificate_approver_emails_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/ssl_certificate_can_reemit_response.py b/src/shellrent_sdk/client/models/ssl_certificate_can_reemit_response.py deleted file mode 100644 index 4992060..0000000 --- a/src/shellrent_sdk/client/models/ssl_certificate_can_reemit_response.py +++ /dev/null @@ -1,116 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.ssl_certificate_can_reemit import SslCertificateCanReemit - from ..models.ssl_certificate_can_reemit_response_meta_type_0 import ( - SslCertificateCanReemitResponseMetaType0, - ) - - -T = TypeVar("T", bound="SslCertificateCanReemitResponse") - - -@_attrs_define -class SslCertificateCanReemitResponse: - error: int - message: None | str - data: SslCertificateCanReemit - meta: None | SslCertificateCanReemitResponseMetaType0 - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.ssl_certificate_can_reemit_response_meta_type_0 import ( - SslCertificateCanReemitResponseMetaType0, - ) - - error = self.error - - message: None | str - message = self.message - - data = self.data.to_dict() - - meta: dict[str, Any] | None - if isinstance(self.meta, SslCertificateCanReemitResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "error": error, - "message": message, - "data": data, - "meta": meta, - } - ) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - from ..models.ssl_certificate_can_reemit import SslCertificateCanReemit - from ..models.ssl_certificate_can_reemit_response_meta_type_0 import ( - SslCertificateCanReemitResponseMetaType0, - ) - - d = dict(src_dict) - error = d.pop("error") - - def _parse_message(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - message = _parse_message(d.pop("message")) - - data = SslCertificateCanReemit.from_dict(d.pop("data")) - - def _parse_meta(data: object) -> None | SslCertificateCanReemitResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = SslCertificateCanReemitResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | SslCertificateCanReemitResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) - - ssl_certificate_can_reemit_response = cls( - error=error, - message=message, - data=data, - meta=meta, - ) - - ssl_certificate_can_reemit_response.additional_properties = d - return ssl_certificate_can_reemit_response - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/ssl_certificate_can_reemit_response_meta_type_0.py b/src/shellrent_sdk/client/models/ssl_certificate_can_reemit_response_meta_type_0.py deleted file mode 100644 index 8b6850f..0000000 --- a/src/shellrent_sdk/client/models/ssl_certificate_can_reemit_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="SslCertificateCanReemitResponseMetaType0") - - -@_attrs_define -class SslCertificateCanReemitResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - ssl_certificate_can_reemit_response_meta_type_0 = cls() - - ssl_certificate_can_reemit_response_meta_type_0.additional_properties = d - return ssl_certificate_can_reemit_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/ssl_certificate_can_reemit.py b/src/shellrent_sdk/client/models/ssl_certificate_can_reissue.py similarity index 66% rename from src/shellrent_sdk/client/models/ssl_certificate_can_reemit.py rename to src/shellrent_sdk/client/models/ssl_certificate_can_reissue.py index 52b601b..f6e1861 100644 --- a/src/shellrent_sdk/client/models/ssl_certificate_can_reemit.py +++ b/src/shellrent_sdk/client/models/ssl_certificate_can_reissue.py @@ -6,26 +6,30 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -T = TypeVar("T", bound="SslCertificateCanReemit") +T = TypeVar("T", bound="SslCertificateCanReissue") @_attrs_define -class SslCertificateCanReemit: +class SslCertificateCanReissue: + """Whether a certificate can be reissued now""" + ssl_certificate_id: int - can_reemit: bool + can_reissue: bool + """ Whether the certificate can be reissued now (`POST /api/v3/ssl-certificates/{ssl_certificate_id}/reissues`): + it includes reissues, its purchase is active with no operation running and no other reissue is in progress """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: ssl_certificate_id = self.ssl_certificate_id - can_reemit = self.can_reemit + can_reissue = self.can_reissue field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( { "ssl_certificate_id": ssl_certificate_id, - "can_reemit": can_reemit, + "can_reissue": can_reissue, } ) @@ -36,15 +40,15 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) ssl_certificate_id = d.pop("ssl_certificate_id") - can_reemit = d.pop("can_reemit") + can_reissue = d.pop("can_reissue") - ssl_certificate_can_reemit = cls( + ssl_certificate_can_reissue = cls( ssl_certificate_id=ssl_certificate_id, - can_reemit=can_reemit, + can_reissue=can_reissue, ) - ssl_certificate_can_reemit.additional_properties = d - return ssl_certificate_can_reemit + ssl_certificate_can_reissue.additional_properties = d + return ssl_certificate_can_reissue @property def additional_keys(self) -> list[str]: diff --git a/src/shellrent_sdk/client/models/ssl_certificate_can_reissue_response.py b/src/shellrent_sdk/client/models/ssl_certificate_can_reissue_response.py new file mode 100644 index 0000000..35a3156 --- /dev/null +++ b/src/shellrent_sdk/client/models/ssl_certificate_can_reissue_response.py @@ -0,0 +1,97 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.ssl_certificate_can_reissue import SslCertificateCanReissue + + +T = TypeVar("T", bound="SslCertificateCanReissueResponse") + + +@_attrs_define +class SslCertificateCanReissueResponse: + """Successful response with one `SslCertificateCanReissue`""" + + error: Literal[0] + """ Always 0 in a successful response """ + message: None | str + """ Always null in a successful response """ + data: SslCertificateCanReissue + """ Whether a certificate can be reissued now """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + error = self.error + + message: None | str + message = self.message + + data = self.data.to_dict() + + meta = self.meta + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "error": error, + "message": message, + "data": data, + "meta": meta, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.ssl_certificate_can_reissue import SslCertificateCanReissue + + d = dict(src_dict) + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") + + def _parse_message(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + message = _parse_message(d.pop("message")) + + data = SslCertificateCanReissue.from_dict(d.pop("data")) + + meta = d.pop("meta") + + ssl_certificate_can_reissue_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + ssl_certificate_can_reissue_response.additional_properties = d + return ssl_certificate_can_reissue_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/ssl_certificate_change_csr_request.py b/src/shellrent_sdk/client/models/ssl_certificate_change_csr_request.py index 68fd010..3edddcf 100644 --- a/src/shellrent_sdk/client/models/ssl_certificate_change_csr_request.py +++ b/src/shellrent_sdk/client/models/ssl_certificate_change_csr_request.py @@ -4,7 +4,6 @@ from typing import Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="SslCertificateChangeCsrRequest") @@ -12,13 +11,14 @@ @_attrs_define class SslCertificateChangeCsrRequest: csr: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + """ Custom CSR in PEM format, verified with the certificate supplier; sending the current CSR changes nothing + """ def to_dict(self) -> dict[str, Any]: csr = self.csr field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "csr": csr, @@ -36,21 +36,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: csr=csr, ) - ssl_certificate_change_csr_request.additional_properties = d return ssl_certificate_change_csr_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/ssl_certificate_export.py b/src/shellrent_sdk/client/models/ssl_certificate_export.py index 35f76fe..422f26e 100644 --- a/src/shellrent_sdk/client/models/ssl_certificate_export.py +++ b/src/shellrent_sdk/client/models/ssl_certificate_export.py @@ -11,9 +11,14 @@ @_attrs_define class SslCertificateExport: + """File with the certificate or its keys in the requested format, encoded in base64""" + format_: str + """ Code of the exported format, as in the request; `MULTI_ZIP` when the file is a ZIP archive """ filename: str + """ Name to give to the file, for example `certificate.pem` """ content_base64: str + """ Content of the file, encoded in base64 """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/ssl_certificate_export_format.py b/src/shellrent_sdk/client/models/ssl_certificate_export_format.py index a03cad7..b572412 100644 --- a/src/shellrent_sdk/client/models/ssl_certificate_export_format.py +++ b/src/shellrent_sdk/client/models/ssl_certificate_export_format.py @@ -11,12 +11,23 @@ @_attrs_define class SslCertificateExportFormat: + """Format in which a certificate and its keys can be exported (`POST /api/v3/ssl- + certificates/{ssl_certificate_id}/exports`) + + """ + format_: str + """ Code of the format, for `format` of the export: one of `PK`, `CERT`, `CERT_PEM`, `CA`, `CA_PEM`, `CERT_CA`, + `CERT_CA_PEM`, `PK_CERT_CA`, `MULTI_ZIP`, `HASH_SHA256` or `HASH_SHA512` """ name: str description: None | str filename: str + """ Name of the exported file, for example `certificate.pem` """ available: bool + """ Whether the certificate can be exported in this format; otherwise the export is rejected with 409 """ requires_passphrase: bool + """ Whether the format takes `passphrase` of the export request, which protects the file: true for `PK` and + `PK_CERT_CA` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/ssl_certificate_export_format_list_response.py b/src/shellrent_sdk/client/models/ssl_certificate_export_format_list_response.py index fc55deb..699a99b 100644 --- a/src/shellrent_sdk/client/models/ssl_certificate_export_format_list_response.py +++ b/src/shellrent_sdk/client/models/ssl_certificate_export_format_list_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.ssl_certificate_export_format import SslCertificateExportFormat - from ..models.ssl_certificate_export_format_list_response_meta_type_0 import ( - SslCertificateExportFormatListResponseMetaType0, - ) T = TypeVar("T", bound="SslCertificateExportFormatListResponse") @@ -18,17 +15,19 @@ @_attrs_define class SslCertificateExportFormatListResponse: - error: int + """Successful response with a list of `SslCertificateExportFormat`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[SslCertificateExportFormat] - meta: None | SslCertificateExportFormatListResponseMetaType0 + """ Items returned by the operation """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.ssl_certificate_export_format_list_response_meta_type_0 import ( - SslCertificateExportFormatListResponseMetaType0, - ) - error = self.error message: None | str @@ -39,11 +38,7 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - meta: dict[str, Any] | None - if isinstance(self.meta, SslCertificateExportFormatListResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -63,12 +58,11 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.ssl_certificate_export_format import ( SslCertificateExportFormat, ) - from ..models.ssl_certificate_export_format_list_response_meta_type_0 import ( - SslCertificateExportFormatListResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -84,20 +78,7 @@ def _parse_message(data: object) -> None | str: data.append(data_item) - def _parse_meta(data: object) -> None | SslCertificateExportFormatListResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = SslCertificateExportFormatListResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | SslCertificateExportFormatListResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") ssl_certificate_export_format_list_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/ssl_certificate_export_format_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/ssl_certificate_export_format_list_response_meta_type_0.py deleted file mode 100644 index 4ceb3ff..0000000 --- a/src/shellrent_sdk/client/models/ssl_certificate_export_format_list_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="SslCertificateExportFormatListResponseMetaType0") - - -@_attrs_define -class SslCertificateExportFormatListResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - ssl_certificate_export_format_list_response_meta_type_0 = cls() - - ssl_certificate_export_format_list_response_meta_type_0.additional_properties = d - return ssl_certificate_export_format_list_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/ssl_certificate_export_request.py b/src/shellrent_sdk/client/models/ssl_certificate_export_request.py new file mode 100644 index 0000000..dfb6d4d --- /dev/null +++ b/src/shellrent_sdk/client/models/ssl_certificate_export_request.py @@ -0,0 +1,61 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Self, TypeVar + +from attrs import define as _attrs_define + +from ..models.ssl_certificate_export_request_format import SslCertificateExportRequestFormat +from ..types import UNSET, Unset + +T = TypeVar("T", bound="SslCertificateExportRequest") + + +@_attrs_define +class SslCertificateExportRequest: + format_: SslCertificateExportRequestFormat + """ Export format: one of the codes of `GET /api/v3/ssl-certificates/{ssl_certificate_id}/export-formats`, which + lists the formats available for the certificate """ + current_passphrase: str | Unset = UNSET + """ Passphrase of the current private key, if it is protected by one """ + passphrase: str | Unset = UNSET + """ Passphrase that protects the exported file, for the formats that require it (see requires_passphrase in the + export formats). If omitted, current_passphrase is used """ + + def to_dict(self) -> dict[str, Any]: + format_ = self.format_.value + + current_passphrase = self.current_passphrase + + passphrase = self.passphrase + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "format": format_, + } + ) + if current_passphrase is not UNSET: + field_dict["current_passphrase"] = current_passphrase + if passphrase is not UNSET: + field_dict["passphrase"] = passphrase + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + format_ = SslCertificateExportRequestFormat(d.pop("format")) + + current_passphrase = d.pop("current_passphrase", UNSET) + + passphrase = d.pop("passphrase", UNSET) + + ssl_certificate_export_request = cls( + format_=format_, + current_passphrase=current_passphrase, + passphrase=passphrase, + ) + + return ssl_certificate_export_request diff --git a/src/shellrent_sdk/client/models/ssl_certificate_export_request_format.py b/src/shellrent_sdk/client/models/ssl_certificate_export_request_format.py new file mode 100644 index 0000000..5a4aace --- /dev/null +++ b/src/shellrent_sdk/client/models/ssl_certificate_export_request_format.py @@ -0,0 +1,18 @@ +from enum import StrEnum + + +class SslCertificateExportRequestFormat(StrEnum): + CA = "CA" + CA_PEM = "CA_PEM" + CERT = "CERT" + CERT_CA = "CERT_CA" + CERT_CA_PEM = "CERT_CA_PEM" + CERT_PEM = "CERT_PEM" + HASH_SHA256 = "HASH_SHA256" + HASH_SHA512 = "HASH_SHA512" + MULTI_ZIP = "MULTI_ZIP" + PK = "PK" + PK_CERT_CA = "PK_CERT_CA" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/shellrent_sdk/client/models/ssl_certificate_export_response.py b/src/shellrent_sdk/client/models/ssl_certificate_export_response.py index 85d5b5c..1fa4f49 100644 --- a/src/shellrent_sdk/client/models/ssl_certificate_export_response.py +++ b/src/shellrent_sdk/client/models/ssl_certificate_export_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.ssl_certificate_export import SslCertificateExport - from ..models.ssl_certificate_export_response_meta_type_0 import ( - SslCertificateExportResponseMetaType0, - ) T = TypeVar("T", bound="SslCertificateExportResponse") @@ -18,17 +15,19 @@ @_attrs_define class SslCertificateExportResponse: - error: int + """Successful response with one `SslCertificateExport`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: SslCertificateExport - meta: None | SslCertificateExportResponseMetaType0 + """ File with the certificate or its keys in the requested format, encoded in base64 """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.ssl_certificate_export_response_meta_type_0 import ( - SslCertificateExportResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, SslCertificateExportResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -58,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.ssl_certificate_export import SslCertificateExport - from ..models.ssl_certificate_export_response_meta_type_0 import ( - SslCertificateExportResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -74,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = SslCertificateExport.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | SslCertificateExportResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = SslCertificateExportResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | SslCertificateExportResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") ssl_certificate_export_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/ssl_certificate_export_response_meta_type_0.py b/src/shellrent_sdk/client/models/ssl_certificate_export_response_meta_type_0.py deleted file mode 100644 index f2f6045..0000000 --- a/src/shellrent_sdk/client/models/ssl_certificate_export_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="SslCertificateExportResponseMetaType0") - - -@_attrs_define -class SslCertificateExportResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - ssl_certificate_export_response_meta_type_0 = cls() - - ssl_certificate_export_response_meta_type_0.additional_properties = d - return ssl_certificate_export_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/ssl_certificate_key.py b/src/shellrent_sdk/client/models/ssl_certificate_key.py index 4988c29..ccc4361 100644 --- a/src/shellrent_sdk/client/models/ssl_certificate_key.py +++ b/src/shellrent_sdk/client/models/ssl_certificate_key.py @@ -11,8 +11,11 @@ @_attrs_define class SslCertificateKey: + """CSR of a certificate""" + ssl_certificate_id: int csr: None | str + """ CSR of the certificate, in PEM format (the custom one, when set) """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/ssl_certificate_key_response.py b/src/shellrent_sdk/client/models/ssl_certificate_key_response.py index 02691f4..7362091 100644 --- a/src/shellrent_sdk/client/models/ssl_certificate_key_response.py +++ b/src/shellrent_sdk/client/models/ssl_certificate_key_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.ssl_certificate_key import SslCertificateKey - from ..models.ssl_certificate_key_response_meta_type_0 import SslCertificateKeyResponseMetaType0 T = TypeVar("T", bound="SslCertificateKeyResponse") @@ -16,17 +15,19 @@ @_attrs_define class SslCertificateKeyResponse: - error: int + """Successful response with one `SslCertificateKey`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: SslCertificateKey - meta: None | SslCertificateKeyResponseMetaType0 + """ CSR of a certificate """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.ssl_certificate_key_response_meta_type_0 import ( - SslCertificateKeyResponseMetaType0, - ) - error = self.error message: None | str @@ -34,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, SslCertificateKeyResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -56,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.ssl_certificate_key import SslCertificateKey - from ..models.ssl_certificate_key_response_meta_type_0 import ( - SslCertificateKeyResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -72,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = SslCertificateKey.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | SslCertificateKeyResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = SslCertificateKeyResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | SslCertificateKeyResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") ssl_certificate_key_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/ssl_certificate_key_response_meta_type_0.py b/src/shellrent_sdk/client/models/ssl_certificate_key_response_meta_type_0.py deleted file mode 100644 index 130b52c..0000000 --- a/src/shellrent_sdk/client/models/ssl_certificate_key_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="SslCertificateKeyResponseMetaType0") - - -@_attrs_define -class SslCertificateKeyResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - ssl_certificate_key_response_meta_type_0 = cls() - - ssl_certificate_key_response_meta_type_0.additional_properties = d - return ssl_certificate_key_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/ssl_certificate_keys.py b/src/shellrent_sdk/client/models/ssl_certificate_keys.py index 6a144f4..635ed0a 100644 --- a/src/shellrent_sdk/client/models/ssl_certificate_keys.py +++ b/src/shellrent_sdk/client/models/ssl_certificate_keys.py @@ -11,11 +11,21 @@ @_attrs_define class SslCertificateKeys: + """Keys of a certificate in PEM format: CSR, private key, issued certificate and certificate of the intermediate + authority + + """ + ssl_certificate_id: int csr: None | str + """ CSR of the certificate, in PEM format (the custom one, when set) """ private_key: None | str + """ Private key of the certificate, in PEM format (the custom one, when set) """ public_key: None | str + """ Certificate issued by the certification authority, in PEM format; empty until it is issued """ certificate_authority: None | str + """ Certificate of the intermediate certification authority, in PEM format; empty until the certificate is + issued """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/ssl_certificate_keys_response.py b/src/shellrent_sdk/client/models/ssl_certificate_keys_response.py index 4f7bc1d..f6af0d1 100644 --- a/src/shellrent_sdk/client/models/ssl_certificate_keys_response.py +++ b/src/shellrent_sdk/client/models/ssl_certificate_keys_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.ssl_certificate_keys import SslCertificateKeys - from ..models.ssl_certificate_keys_response_meta_type_0 import ( - SslCertificateKeysResponseMetaType0, - ) T = TypeVar("T", bound="SslCertificateKeysResponse") @@ -18,17 +15,20 @@ @_attrs_define class SslCertificateKeysResponse: - error: int + """Successful response with one `SslCertificateKeys`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: SslCertificateKeys - meta: None | SslCertificateKeysResponseMetaType0 + """ Keys of a certificate in PEM format: CSR, private key, issued certificate and certificate of the + intermediate authority """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.ssl_certificate_keys_response_meta_type_0 import ( - SslCertificateKeysResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +36,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, SslCertificateKeysResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -58,12 +54,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.ssl_certificate_keys import SslCertificateKeys - from ..models.ssl_certificate_keys_response_meta_type_0 import ( - SslCertificateKeysResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -74,20 +69,7 @@ def _parse_message(data: object) -> None | str: data = SslCertificateKeys.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | SslCertificateKeysResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = SslCertificateKeysResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | SslCertificateKeysResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") ssl_certificate_keys_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/ssl_certificate_keys_response_meta_type_0.py b/src/shellrent_sdk/client/models/ssl_certificate_keys_response_meta_type_0.py deleted file mode 100644 index d698958..0000000 --- a/src/shellrent_sdk/client/models/ssl_certificate_keys_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="SslCertificateKeysResponseMetaType0") - - -@_attrs_define -class SslCertificateKeysResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - ssl_certificate_keys_response_meta_type_0 = cls() - - ssl_certificate_keys_response_meta_type_0.additional_properties = d - return ssl_certificate_keys_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/ssl_certificate_owner_request.py b/src/shellrent_sdk/client/models/ssl_certificate_owner_request.py index 4ef0a71..53b6a8c 100644 --- a/src/shellrent_sdk/client/models/ssl_certificate_owner_request.py +++ b/src/shellrent_sdk/client/models/ssl_certificate_owner_request.py @@ -1,10 +1,9 @@ from __future__ import annotations from collections.abc import Mapping -from typing import Any, Self, TypeVar, cast +from typing import Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -13,102 +12,64 @@ @_attrs_define class SslCertificateOwnerRequest: - admin_title: None | str | Unset = UNSET - admin_role: None | str | Unset = UNSET - admin_first_name: None | str | Unset = UNSET - admin_last_name: None | str | Unset = UNSET - admin_email: None | str | Unset = UNSET - admin_organization: None | str | Unset = UNSET - admin_phone_cc: None | str | Unset = UNSET - admin_phone_number: None | str | Unset = UNSET - admin_address: None | str | Unset = UNSET - admin_city: None | str | Unset = UNSET - admin_state: None | str | Unset = UNSET - admin_postal_code: None | str | Unset = UNSET - admin_country: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + admin_title: str | Unset = UNSET + """ Title of the administrative contact, one of the values of the order: `Mrs`, `Mr`, `Miss`, `Ms`, `Dr` or + `Rev` """ + admin_role: str | Unset = UNSET + """ Role of the administrative contact, one of the values of the order: `Business Owner`, `Website Owner`, + `President` or `Company Director` """ + admin_first_name: str | Unset = UNSET + """ First name of the administrative contact """ + admin_last_name: str | Unset = UNSET + """ Last name of the administrative contact """ + admin_email: str | Unset = UNSET + """ Email of the administrative contact """ + admin_organization: str | Unset = UNSET + """ Organization of the administrative contact """ + admin_phone_cc: str | Unset = UNSET + """ International dialling code of the phone of the administrative contact, without `+` (for example `39`) """ + admin_phone_number: str | Unset = UNSET + """ Phone number of the administrative contact, without the dialling code """ + admin_address: str | Unset = UNSET + """ Address of the administrative contact """ + admin_city: str | Unset = UNSET + """ City of the administrative contact """ + admin_state: str | Unset = UNSET + """ State or province of the administrative contact """ + admin_postal_code: str | Unset = UNSET + """ Postal code of the administrative contact """ + admin_country: str | Unset = UNSET + """ Country of the administrative contact, as ISO 3166-1 alpha-2 code (for example `IT`) """ def to_dict(self) -> dict[str, Any]: - admin_title: None | str | Unset - if isinstance(self.admin_title, Unset): - admin_title = UNSET - else: - admin_title = self.admin_title - - admin_role: None | str | Unset - if isinstance(self.admin_role, Unset): - admin_role = UNSET - else: - admin_role = self.admin_role - - admin_first_name: None | str | Unset - if isinstance(self.admin_first_name, Unset): - admin_first_name = UNSET - else: - admin_first_name = self.admin_first_name - - admin_last_name: None | str | Unset - if isinstance(self.admin_last_name, Unset): - admin_last_name = UNSET - else: - admin_last_name = self.admin_last_name - - admin_email: None | str | Unset - if isinstance(self.admin_email, Unset): - admin_email = UNSET - else: - admin_email = self.admin_email - - admin_organization: None | str | Unset - if isinstance(self.admin_organization, Unset): - admin_organization = UNSET - else: - admin_organization = self.admin_organization - - admin_phone_cc: None | str | Unset - if isinstance(self.admin_phone_cc, Unset): - admin_phone_cc = UNSET - else: - admin_phone_cc = self.admin_phone_cc - - admin_phone_number: None | str | Unset - if isinstance(self.admin_phone_number, Unset): - admin_phone_number = UNSET - else: - admin_phone_number = self.admin_phone_number - - admin_address: None | str | Unset - if isinstance(self.admin_address, Unset): - admin_address = UNSET - else: - admin_address = self.admin_address - - admin_city: None | str | Unset - if isinstance(self.admin_city, Unset): - admin_city = UNSET - else: - admin_city = self.admin_city - - admin_state: None | str | Unset - if isinstance(self.admin_state, Unset): - admin_state = UNSET - else: - admin_state = self.admin_state - - admin_postal_code: None | str | Unset - if isinstance(self.admin_postal_code, Unset): - admin_postal_code = UNSET - else: - admin_postal_code = self.admin_postal_code - - admin_country: None | str | Unset - if isinstance(self.admin_country, Unset): - admin_country = UNSET - else: - admin_country = self.admin_country + admin_title = self.admin_title + + admin_role = self.admin_role + + admin_first_name = self.admin_first_name + + admin_last_name = self.admin_last_name + + admin_email = self.admin_email + + admin_organization = self.admin_organization + + admin_phone_cc = self.admin_phone_cc + + admin_phone_number = self.admin_phone_number + + admin_address = self.admin_address + + admin_city = self.admin_city + + admin_state = self.admin_state + + admin_postal_code = self.admin_postal_code + + admin_country = self.admin_country field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if admin_title is not UNSET: field_dict["admin_title"] = admin_title @@ -142,123 +103,31 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) + admin_title = d.pop("admin_title", UNSET) + + admin_role = d.pop("admin_role", UNSET) + + admin_first_name = d.pop("admin_first_name", UNSET) - def _parse_admin_title(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - admin_title = _parse_admin_title(d.pop("admin_title", UNSET)) - - def _parse_admin_role(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - admin_role = _parse_admin_role(d.pop("admin_role", UNSET)) - - def _parse_admin_first_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - admin_first_name = _parse_admin_first_name(d.pop("admin_first_name", UNSET)) - - def _parse_admin_last_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - admin_last_name = _parse_admin_last_name(d.pop("admin_last_name", UNSET)) - - def _parse_admin_email(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - admin_email = _parse_admin_email(d.pop("admin_email", UNSET)) - - def _parse_admin_organization(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - admin_organization = _parse_admin_organization(d.pop("admin_organization", UNSET)) - - def _parse_admin_phone_cc(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - admin_phone_cc = _parse_admin_phone_cc(d.pop("admin_phone_cc", UNSET)) - - def _parse_admin_phone_number(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - admin_phone_number = _parse_admin_phone_number(d.pop("admin_phone_number", UNSET)) - - def _parse_admin_address(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - admin_address = _parse_admin_address(d.pop("admin_address", UNSET)) - - def _parse_admin_city(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - admin_city = _parse_admin_city(d.pop("admin_city", UNSET)) - - def _parse_admin_state(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - admin_state = _parse_admin_state(d.pop("admin_state", UNSET)) - - def _parse_admin_postal_code(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - admin_postal_code = _parse_admin_postal_code(d.pop("admin_postal_code", UNSET)) - - def _parse_admin_country(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - admin_country = _parse_admin_country(d.pop("admin_country", UNSET)) + admin_last_name = d.pop("admin_last_name", UNSET) + + admin_email = d.pop("admin_email", UNSET) + + admin_organization = d.pop("admin_organization", UNSET) + + admin_phone_cc = d.pop("admin_phone_cc", UNSET) + + admin_phone_number = d.pop("admin_phone_number", UNSET) + + admin_address = d.pop("admin_address", UNSET) + + admin_city = d.pop("admin_city", UNSET) + + admin_state = d.pop("admin_state", UNSET) + + admin_postal_code = d.pop("admin_postal_code", UNSET) + + admin_country = d.pop("admin_country", UNSET) ssl_certificate_owner_request = cls( admin_title=admin_title, @@ -276,21 +145,4 @@ def _parse_admin_country(data: object) -> None | str | Unset: admin_country=admin_country, ) - ssl_certificate_owner_request.additional_properties = d return ssl_certificate_owner_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/ssl_certificate_paginated_list_response.py b/src/shellrent_sdk/client/models/ssl_certificate_paginated_list_response.py index 2369d0f..90d4b1d 100644 --- a/src/shellrent_sdk/client/models/ssl_certificate_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/ssl_certificate_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class SslCertificatePaginatedListResponse: - error: int + """Successful response with a page of `SslCertificate`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[SslCertificate] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.ssl_certificate import SslCertificate d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/ssl_certificate_reemit_request.py b/src/shellrent_sdk/client/models/ssl_certificate_reemit_request.py index b78c70e..0a81e38 100644 --- a/src/shellrent_sdk/client/models/ssl_certificate_reemit_request.py +++ b/src/shellrent_sdk/client/models/ssl_certificate_reemit_request.py @@ -1,10 +1,9 @@ from __future__ import annotations from collections.abc import Mapping -from typing import Any, Self, TypeVar, cast +from typing import Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -13,25 +12,20 @@ @_attrs_define class SslCertificateReemitRequest: - private_key: None | str | Unset = UNSET - csr_key: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + private_key: str | Unset = UNSET + """ Custom private key in PEM format, without passphrase. Omit it, or send an empty string or the current key, + to keep the current one """ + csr_key: str | Unset = UNSET + """ Custom CSR in PEM format, verified with the certificate supplier. Omit it, or send an empty string or the + current CSR, to keep the current one """ def to_dict(self) -> dict[str, Any]: - private_key: None | str | Unset - if isinstance(self.private_key, Unset): - private_key = UNSET - else: - private_key = self.private_key + private_key = self.private_key - csr_key: None | str | Unset - if isinstance(self.csr_key, Unset): - csr_key = UNSET - else: - csr_key = self.csr_key + csr_key = self.csr_key field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if private_key is not UNSET: field_dict["private_key"] = private_key @@ -43,45 +37,13 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) + private_key = d.pop("private_key", UNSET) - def _parse_private_key(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - private_key = _parse_private_key(d.pop("private_key", UNSET)) - - def _parse_csr_key(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - csr_key = _parse_csr_key(d.pop("csr_key", UNSET)) + csr_key = d.pop("csr_key", UNSET) ssl_certificate_reemit_request = cls( private_key=private_key, csr_key=csr_key, ) - ssl_certificate_reemit_request.additional_properties = d return ssl_certificate_reemit_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/ssl_certificate_response.py b/src/shellrent_sdk/client/models/ssl_certificate_response.py index 15b8886..34a29fd 100644 --- a/src/shellrent_sdk/client/models/ssl_certificate_response.py +++ b/src/shellrent_sdk/client/models/ssl_certificate_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.ssl_certificate import SslCertificate - from ..models.ssl_certificate_response_meta_type_0 import SslCertificateResponseMetaType0 T = TypeVar("T", bound="SslCertificateResponse") @@ -16,15 +15,19 @@ @_attrs_define class SslCertificateResponse: - error: int + """Successful response with one `SslCertificate`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: SslCertificate - meta: None | SslCertificateResponseMetaType0 + """ SSL or code signing certificate of the account, with its validation data and its administrative contact """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.ssl_certificate_response_meta_type_0 import SslCertificateResponseMetaType0 - error = self.error message: None | str @@ -32,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, SslCertificateResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.ssl_certificate import SslCertificate - from ..models.ssl_certificate_response_meta_type_0 import ( - SslCertificateResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -70,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = SslCertificate.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | SslCertificateResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = SslCertificateResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | SslCertificateResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") ssl_certificate_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/ssl_certificate_response_meta_type_0.py b/src/shellrent_sdk/client/models/ssl_certificate_response_meta_type_0.py deleted file mode 100644 index b8ddfa5..0000000 --- a/src/shellrent_sdk/client/models/ssl_certificate_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="SslCertificateResponseMetaType0") - - -@_attrs_define -class SslCertificateResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - ssl_certificate_response_meta_type_0 = cls() - - ssl_certificate_response_meta_type_0.additional_properties = d - return ssl_certificate_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/sub_account_create_request.py b/src/shellrent_sdk/client/models/sub_account_create_request.py index 7bb922b..6e387b7 100644 --- a/src/shellrent_sdk/client/models/sub_account_create_request.py +++ b/src/shellrent_sdk/client/models/sub_account_create_request.py @@ -4,7 +4,6 @@ from typing import Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -14,25 +13,32 @@ @_attrs_define class SubAccountCreateRequest: person_password: str + """ Password of the account: at least 13 characters, with at least one uppercase letter, one lowercase letter, + one number and one symbol """ administrative_person_name: str + """ First name of the administrative contact of the account """ administrative_person_surname: str + """ Surname of the administrative contact """ administrative_address: str + """ Address of the administrative contact """ administrative_city: str + """ City of the administrative contact """ administrative_state: str - """ State or province """ + """ Acronym of the Italian province, ie. "VI" for Vicenza, or "EE" for an address outside Italy """ administrative_country: str """ Country ISO code with 2 letters, ie. "IT" for Italy, "ES" for Spain, etc. """ administrative_postal_code: str + """ Postal code of the administrative contact """ administrative_phone: str """ Phone number without international phone code """ administrative_email: str + """ Email address of the administrative contact """ administrative_phone_prefix: str | Unset = UNSET """ International phone code (prefix) for "Phone", ie. "39" for Italy, "44" for United Kingdom """ administrative_mobile_prefix: str | Unset = UNSET - """ International phone code (prefix) for "Phone", ie. "39" for Italy, "44" for United Kingdom """ + """ International phone code (prefix) for "Mobile", ie. "39" for Italy, "44" for United Kingdom """ administrative_mobile: str | Unset = UNSET """ Mobile phone number without international phone code """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: person_password = self.person_password @@ -62,7 +68,7 @@ def to_dict(self) -> dict[str, Any]: administrative_mobile = self.administrative_mobile field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "person_password": person_password, @@ -131,21 +137,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: administrative_mobile=administrative_mobile, ) - sub_account_create_request.additional_properties = d return sub_account_create_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/sub_account_update_request.py b/src/shellrent_sdk/client/models/sub_account_update_request.py index 642dffc..9b16f07 100644 --- a/src/shellrent_sdk/client/models/sub_account_update_request.py +++ b/src/shellrent_sdk/client/models/sub_account_update_request.py @@ -4,7 +4,6 @@ from typing import Any, Self, TypeVar, cast from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -14,22 +13,37 @@ @_attrs_define class SubAccountUpdateRequest: person_password: str | Unset = UNSET + """ New password of the account: at least 13 characters, with at least one uppercase letter, one lowercase + letter, one number and one symbol """ username_alias: None | str | Unset = UNSET + """ Alternative username of the account, also valid to log in; null or empty to remove it """ administrative_person_name: str | Unset = UNSET + """ First name of the administrative contact of the account """ administrative_person_surname: str | Unset = UNSET + """ Surname of the administrative contact """ administrative_address: str | Unset = UNSET + """ Address of the administrative contact """ administrative_city: str | Unset = UNSET + """ City of the administrative contact """ administrative_state: str | Unset = UNSET - """ State or province """ + """ Acronym of the Italian province, ie. "VI" for Vicenza, or "EE" for an address outside Italy """ administrative_country: str | Unset = UNSET - """ Country ISO code with 2 letters """ + """ Country ISO code with 2 letters, ie. "IT" for Italy, "ES" for Spain, etc. """ administrative_postal_code: str | Unset = UNSET + """ Postal code of the administrative contact """ administrative_phone_prefix: str | Unset = UNSET + """ International phone code (prefix) for "Phone", ie. "39" for Italy, "44" for United Kingdom; empty for Italy. + Required with `administrative_phone` """ administrative_phone: str | Unset = UNSET + """ Phone number without international phone code, digits only. Required with `administrative_phone_prefix` """ administrative_mobile_prefix: str | Unset = UNSET + """ International phone code (prefix) for "Mobile", ie. "39" for Italy, "44" for United Kingdom; empty for + Italy. Required with `administrative_mobile` """ administrative_mobile: str | Unset = UNSET + """ Mobile phone number without international phone code, digits only. Required with + `administrative_mobile_prefix` """ administrative_email: str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + """ Email address of the administrative contact """ def to_dict(self) -> dict[str, Any]: person_password = self.person_password @@ -65,7 +79,7 @@ def to_dict(self) -> dict[str, Any]: administrative_email = self.administrative_email field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if person_password is not UNSET: field_dict["person_password"] = person_password @@ -153,21 +167,4 @@ def _parse_username_alias(data: object) -> None | str | Unset: administrative_email=administrative_email, ) - sub_account_update_request.additional_properties = d return sub_account_update_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/task.py b/src/shellrent_sdk/client/models/task.py index 29f8c35..0084b54 100644 --- a/src/shellrent_sdk/client/models/task.py +++ b/src/shellrent_sdk/client/models/task.py @@ -7,8 +7,6 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset - if TYPE_CHECKING: from ..models.task_status import TaskStatus @@ -18,14 +16,24 @@ @_attrs_define class Task: + """Operation on a purchase that goes on in the background, with its status and progress (`GET /api/v3/tasks/{task_id}`)""" + task_id: int purchase_id: int + """ Id of the purchase the task works on (`GET /api/v3/purchases/{purchase_id}`) """ task_status: TaskStatus executed_instructions: int | None + """ Number of the step reached by the task, out of `total_instructions`: equal to it when the task is done or + failed """ total_instructions: int | None + """ Total number of steps of the task """ is_started: bool + """ Whether the execution of the task has started """ + ask_user_error: None | str + """ Error found in the data provided for the task, null when there is none: the corrected data are sent with + `POST /api/v3/tasks/{task_id}/data` """ date_started: datetime.datetime - ask_user_error: None | str | Unset = UNSET + """ Date and time the task was created """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -43,13 +51,10 @@ def to_dict(self) -> dict[str, Any]: is_started = self.is_started - date_started = self.date_started.isoformat() + ask_user_error: None | str + ask_user_error = self.ask_user_error - ask_user_error: None | str | Unset - if isinstance(self.ask_user_error, Unset): - ask_user_error = UNSET - else: - ask_user_error = self.ask_user_error + date_started = self.date_started.isoformat() field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -61,11 +66,10 @@ def to_dict(self) -> dict[str, Any]: "executed_instructions": executed_instructions, "total_instructions": total_instructions, "is_started": is_started, + "ask_user_error": ask_user_error, "date_started": date_started, } ) - if ask_user_error is not UNSET: - field_dict["ask_user_error"] = ask_user_error return field_dict @@ -96,16 +100,14 @@ def _parse_total_instructions(data: object) -> int | None: is_started = d.pop("is_started") - date_started = datetime.datetime.fromisoformat(d.pop("date_started")) - - def _parse_ask_user_error(data: object) -> None | str | Unset: + def _parse_ask_user_error(data: object) -> None | str: if data is None: return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) + return cast(None | str, data) + + ask_user_error = _parse_ask_user_error(d.pop("ask_user_error")) - ask_user_error = _parse_ask_user_error(d.pop("ask_user_error", UNSET)) + date_started = datetime.datetime.fromisoformat(d.pop("date_started")) task = cls( task_id=task_id, @@ -114,8 +116,8 @@ def _parse_ask_user_error(data: object) -> None | str | Unset: executed_instructions=executed_instructions, total_instructions=total_instructions, is_started=is_started, - date_started=date_started, ask_user_error=ask_user_error, + date_started=date_started, ) task.additional_properties = d diff --git a/src/shellrent_sdk/client/models/task_paginated_list_response.py b/src/shellrent_sdk/client/models/task_paginated_list_response.py index f60ec76..1dfa10b 100644 --- a/src/shellrent_sdk/client/models/task_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/task_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class TaskPaginatedListResponse: - error: int + """Successful response with a page of `Task`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[Task] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.task import Task d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/task_response.py b/src/shellrent_sdk/client/models/task_response.py index bf99bc8..19916a1 100644 --- a/src/shellrent_sdk/client/models/task_response.py +++ b/src/shellrent_sdk/client/models/task_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.task import Task - from ..models.task_response_meta_type_0 import TaskResponseMetaType0 T = TypeVar("T", bound="TaskResponse") @@ -16,15 +15,20 @@ @_attrs_define class TaskResponse: - error: int + """Successful response with one `Task`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: Task - meta: None | TaskResponseMetaType0 + """ Operation on a purchase that goes on in the background, with its status and progress (`GET + /api/v3/tasks/{task_id}`) """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.task_response_meta_type_0 import TaskResponseMetaType0 - error = self.error message: None | str @@ -32,11 +36,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, TaskResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,10 +54,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.task import Task - from ..models.task_response_meta_type_0 import TaskResponseMetaType0 d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -68,20 +69,7 @@ def _parse_message(data: object) -> None | str: data = Task.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | TaskResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = TaskResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | TaskResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") task_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/task_response_meta_type_0.py b/src/shellrent_sdk/client/models/task_response_meta_type_0.py deleted file mode 100644 index 271be3c..0000000 --- a/src/shellrent_sdk/client/models/task_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="TaskResponseMetaType0") - - -@_attrs_define -class TaskResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - task_response_meta_type_0 = cls() - - task_response_meta_type_0.additional_properties = d - return task_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/task_status.py b/src/shellrent_sdk/client/models/task_status.py index c6d5c04..3676793 100644 --- a/src/shellrent_sdk/client/models/task_status.py +++ b/src/shellrent_sdk/client/models/task_status.py @@ -12,7 +12,12 @@ @_attrs_define class TaskStatus: status_code: str + """ Status code: `TO_EXECUTE` (queued), `MACHINE` (running), `WAIT` (paused), `HUMAN_INTERVENTION` (checked by + an operator), `ASK_USER` (waiting for data, `POST /api/v3/tasks/{task_id}/data`), `DONE` (completed) or `FAIL` + (failed) """ status_name: str + """ Name of the status for the customers, in Italian, as in the control panel (for example `In verifica` for + `HUMAN_INTERVENTION`) """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/tax_regime.py b/src/shellrent_sdk/client/models/tax_regime.py index 95f94fb..c793290 100644 --- a/src/shellrent_sdk/client/models/tax_regime.py +++ b/src/shellrent_sdk/client/models/tax_regime.py @@ -11,10 +11,18 @@ @_attrs_define class TaxRegime: + """Tax regime: how VAT applies to the documents""" + regime_code: str + """ One of `ORDINARY`, `SPLIT_PAYMENT`, `EU_VIES`, `EU_EXPORTER` (habitual exporter), `EXTRA_EU`, `VATICAN`, + `SANMARINO` or `ART_26` """ regime_name: str + """ Name of the regime, in Italian, for example `Ordinario` """ code_edocument: None | str + """ Nature code of the operation on the electronic invoice (`Natura`) when VAT is not applied, for example + `N2.1`; null for the regimes with VAT """ tax_rate: float + """ VAT rate as a fraction, for example `0.22` for 22% """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/tld.py b/src/shellrent_sdk/client/models/tld.py index 73269df..71f9ea6 100644 --- a/src/shellrent_sdk/client/models/tld.py +++ b/src/shellrent_sdk/client/models/tld.py @@ -16,26 +16,49 @@ @_attrs_define class Tld: + """TLD (domain extension), with the rules for the names and for the contacts of its domains""" + tld_id: int extension: str + """ Extension without the leading dot, in Unicode (for example `it` or `co.uk`) """ punycode: str + """ Extension in punycode """ country: Country | None + """ Country of the TLD, for the country-code TLDs (ccTLD); null for the others """ char_min: int | None + """ Minimum length of the name, without the extension """ char_max: int | None + """ Maximum length of the name, without the extension """ hyphen_allowed: bool + """ Whether the name can contain hyphens """ number_allowed: bool + """ Whether the name can contain numbers """ punycode_allowed: bool + """ Whether the name can contain international characters (IDN) """ dnssec_enabled: bool + """ Whether the TLD supports DNSSEC """ rdap_enabled: bool - rdap_url: str + """ Whether the availability of the names is checked with RDAP """ + rdap_url: None | str + """ URL of the RDAP service used for the TLD; null when not set """ contact_data: list[TldContactSpecification] - update_contact_r: bool - update_contact_a: bool - update_contact_t: bool - update_contact_o: bool + """ Fields of the contact data of the domains of the TLD, with their type and allowed values (the authcode + excluded) """ + update_contact_r: bool | None + """ Whether the registrant contact (`R`) can be changed (`PATCH + /api/v3/domains/{domain_id}/contacts/{domain_contact_id}`) """ + update_contact_a: bool | None + """ Whether the administrative contact (`A`) can be changed """ + update_contact_t: bool | None + """ Whether the technical contact (`T`) can be changed """ + update_contact_o: bool | None + """ Whether the organization contact (`O`) can be changed """ update_contact_additional: bool + """ Whether a change of the contacts must also send the additional data of the TLD to the registry """ update_contact_transfer: bool + """ Whether a transfer must also send the additional data of the TLD to the registry """ transfer_authcode: bool + """ Whether the transfer of a domain of the TLD requires the authcode """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -69,6 +92,7 @@ def to_dict(self) -> dict[str, Any]: rdap_enabled = self.rdap_enabled + rdap_url: None | str rdap_url = self.rdap_url contact_data = [] @@ -76,12 +100,16 @@ def to_dict(self) -> dict[str, Any]: contact_data_item = contact_data_item_data.to_dict() contact_data.append(contact_data_item) + update_contact_r: bool | None update_contact_r = self.update_contact_r + update_contact_a: bool | None update_contact_a = self.update_contact_a + update_contact_t: bool | None update_contact_t = self.update_contact_t + update_contact_o: bool | None update_contact_o = self.update_contact_o update_contact_additional = self.update_contact_additional @@ -170,7 +198,12 @@ def _parse_char_max(data: object) -> int | None: rdap_enabled = d.pop("rdap_enabled") - rdap_url = d.pop("rdap_url") + def _parse_rdap_url(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + rdap_url = _parse_rdap_url(d.pop("rdap_url")) contact_data = [] _contact_data = d.pop("contact_data") @@ -179,13 +212,33 @@ def _parse_char_max(data: object) -> int | None: contact_data.append(contact_data_item) - update_contact_r = d.pop("update_contact_r") + def _parse_update_contact_r(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) + + update_contact_r = _parse_update_contact_r(d.pop("update_contact_r")) + + def _parse_update_contact_a(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) + + update_contact_a = _parse_update_contact_a(d.pop("update_contact_a")) + + def _parse_update_contact_t(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) - update_contact_a = d.pop("update_contact_a") + update_contact_t = _parse_update_contact_t(d.pop("update_contact_t")) - update_contact_t = d.pop("update_contact_t") + def _parse_update_contact_o(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) - update_contact_o = d.pop("update_contact_o") + update_contact_o = _parse_update_contact_o(d.pop("update_contact_o")) update_contact_additional = d.pop("update_contact_additional") diff --git a/src/shellrent_sdk/client/models/tld_paginated_list_response.py b/src/shellrent_sdk/client/models/tld_paginated_list_response.py index 7b2d6f2..5d091ea 100644 --- a/src/shellrent_sdk/client/models/tld_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/tld_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class TldPaginatedListResponse: - error: int + """Successful response with a page of `Tld`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[Tld] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.tld import Tld d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/tld_response.py b/src/shellrent_sdk/client/models/tld_response.py index 41f014a..11ff31d 100644 --- a/src/shellrent_sdk/client/models/tld_response.py +++ b/src/shellrent_sdk/client/models/tld_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.tld import Tld - from ..models.tld_response_meta_type_0 import TldResponseMetaType0 T = TypeVar("T", bound="TldResponse") @@ -16,15 +15,19 @@ @_attrs_define class TldResponse: - error: int + """Successful response with one `Tld`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: Tld - meta: None | TldResponseMetaType0 + """ TLD (domain extension), with the rules for the names and for the contacts of its domains """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.tld_response_meta_type_0 import TldResponseMetaType0 - error = self.error message: None | str @@ -32,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, TldResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,10 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.tld import Tld - from ..models.tld_response_meta_type_0 import TldResponseMetaType0 d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -68,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = Tld.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | TldResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = TldResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | TldResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") tld_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/tld_response_meta_type_0.py b/src/shellrent_sdk/client/models/tld_response_meta_type_0.py deleted file mode 100644 index 6834037..0000000 --- a/src/shellrent_sdk/client/models/tld_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="TldResponseMetaType0") - - -@_attrs_define -class TldResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - tld_response_meta_type_0 = cls() - - tld_response_meta_type_0.additional_properties = d - return tld_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/upload_file_body.py b/src/shellrent_sdk/client/models/upload_file_body.py index 8abf68c..fc035e0 100644 --- a/src/shellrent_sdk/client/models/upload_file_body.py +++ b/src/shellrent_sdk/client/models/upload_file_body.py @@ -1,29 +1,56 @@ from __future__ import annotations from collections.abc import Mapping +from io import BytesIO from typing import Any, Self, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field +from .. import types +from ..types import File + T = TypeVar("T", bound="UploadFileBody") @_attrs_define class UploadFileBody: + file: File + """ File to upload, at most 5 MB, with extension pdf, p7m, jpg, jpeg, png, txt, doc, docx, xls or xlsx. The + content must match the extension """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + file = self.file.to_tuple() field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) + field_dict.update( + { + "file": file, + } + ) return field_dict + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("file", self.file.to_tuple())) + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + return files + @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) - upload_file_body = cls() + file = File(payload=BytesIO(d.pop("file"))) + + upload_file_body = cls( + file=file, + ) upload_file_body.additional_properties = d return upload_file_body diff --git a/src/shellrent_sdk/client/models/web_monitoring.py b/src/shellrent_sdk/client/models/web_monitoring.py index 87de7fb..a3c886e 100644 --- a/src/shellrent_sdk/client/models/web_monitoring.py +++ b/src/shellrent_sdk/client/models/web_monitoring.py @@ -12,24 +12,44 @@ @_attrs_define class WebMonitoring: + """Monitoring of a website: checks of the availability of the domain, and notices""" + web_monitoring_id: int purchase_id: int | None + """ Id of the purchase of the monitoring (`GET /api/v3/purchases/{purchase_id}`) """ service_name: None | str + """ Name of the service of the purchase """ purchase_name: None | str + """ Name of the object of the purchase: the monitored domain """ purchase_status_code: None | str + """ Status code of the purchase, for example `ACTIVE_V2` or `DISMISSED_V2` """ monitored_domain: None | str host_ref: None | str + """ Id of the monitored host on the monitoring system """ web_scenario_ref: None | str + """ Id of the check of the site (web scenario) on the monitoring system """ status: None | str + """ Status of the site: `healthy`, `problem` (a recent check got an HTTP status outside 2xx) or + `frequent_problem` """ email_notification: None | str + """ Email address for the notices of the monitoring (site down or back up, SSL expiry); without it no email + notice is sent """ sms_notification: None | str + """ Italian mobile number for the SMS notices, without the international prefix; without it no SMS is sent """ ips: None | str + """ IP address the monitored domain resolves to """ ip_isp: None | str + """ Internet service provider of the IP address """ ip_location: None | str + """ Country of the IP address, as ISO 3166-1 alpha-2 code (for example `IT`) """ last_http_response: int | None + """ HTTP status code of the last check, for example `200` """ last_down_date: datetime.datetime | None - send_ssl_notify: bool - active: bool + """ Last time a check found the site down (HTTP status outside 2xx) """ + send_ssl_notify: bool | None + """ Whether the notices of the expiry of the SSL certificate of the site are sent """ + active: bool | None + """ Whether the monitoring is active """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -83,8 +103,10 @@ def to_dict(self) -> dict[str, Any]: else: last_down_date = self.last_down_date + send_ssl_notify: bool | None send_ssl_notify = self.send_ssl_notify + active: bool | None active = self.active field_dict: dict[str, Any] = {} @@ -232,9 +254,19 @@ def _parse_last_down_date(data: object) -> datetime.datetime | None: last_down_date = _parse_last_down_date(d.pop("last_down_date")) - send_ssl_notify = d.pop("send_ssl_notify") + def _parse_send_ssl_notify(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) + + send_ssl_notify = _parse_send_ssl_notify(d.pop("send_ssl_notify")) + + def _parse_active(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) - active = d.pop("active") + active = _parse_active(d.pop("active")) web_monitoring = cls( web_monitoring_id=web_monitoring_id, diff --git a/src/shellrent_sdk/client/models/web_monitoring_availability_chart.py b/src/shellrent_sdk/client/models/web_monitoring_availability_chart.py index 55e5dfc..45cdd93 100644 --- a/src/shellrent_sdk/client/models/web_monitoring_availability_chart.py +++ b/src/shellrent_sdk/client/models/web_monitoring_availability_chart.py @@ -20,11 +20,18 @@ @_attrs_define class WebMonitoringAvailabilityChart: + """Availability of the monitored site in the last hour""" + web_monitoring_id: int + """ Id of the web monitoring (`GET /api/v3/web-monitorings/{web_monitoring_id}`) """ interval: str + """ Period covered by the chart, as an ISO 8601 duration: always `PT1H`, the last hour """ unit: str + """ Unit of the `y` values: always `status`, a code explained in `legend` """ legend: WebMonitoringAvailabilityChartLegend + """ Codes of the `y` values: 0 up, 1 down (HTTP 5xx), 2 warning (HTTP 4xx) """ points: list[WebMonitoringAvailabilityChartPointsItem] + """ Checks of the last hour, one point per check """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/web_monitoring_availability_chart_legend.py b/src/shellrent_sdk/client/models/web_monitoring_availability_chart_legend.py index 9210f5a..bb3f634 100644 --- a/src/shellrent_sdk/client/models/web_monitoring_availability_chart_legend.py +++ b/src/shellrent_sdk/client/models/web_monitoring_availability_chart_legend.py @@ -6,16 +6,16 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset - T = TypeVar("T", bound="WebMonitoringAvailabilityChartLegend") @_attrs_define class WebMonitoringAvailabilityChartLegend: - up: int | Unset = UNSET - down: int | Unset = UNSET - warning: int | Unset = UNSET + """Codes of the `y` values: 0 up, 1 down (HTTP 5xx), 2 warning (HTTP 4xx)""" + + up: int + down: int + warning: int additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -27,24 +27,24 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - field_dict.update({}) - if up is not UNSET: - field_dict["up"] = up - if down is not UNSET: - field_dict["down"] = down - if warning is not UNSET: - field_dict["warning"] = warning + field_dict.update( + { + "up": up, + "down": down, + "warning": warning, + } + ) return field_dict @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) - up = d.pop("up", UNSET) + up = d.pop("up") - down = d.pop("down", UNSET) + down = d.pop("down") - warning = d.pop("warning", UNSET) + warning = d.pop("warning") web_monitoring_availability_chart_legend = cls( up=up, diff --git a/src/shellrent_sdk/client/models/web_monitoring_availability_chart_points_item.py b/src/shellrent_sdk/client/models/web_monitoring_availability_chart_points_item.py index ead4a07..9c52c74 100644 --- a/src/shellrent_sdk/client/models/web_monitoring_availability_chart_points_item.py +++ b/src/shellrent_sdk/client/models/web_monitoring_availability_chart_points_item.py @@ -6,16 +6,14 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset - T = TypeVar("T", bound="WebMonitoringAvailabilityChartPointsItem") @_attrs_define class WebMonitoringAvailabilityChartPointsItem: - x: float | Unset = UNSET + x: float """ UNIX timestamp in milliseconds """ - y: int | Unset = UNSET + y: int """ Availability status code (0 up, 1 down, 2 warning) """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -26,20 +24,21 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - field_dict.update({}) - if x is not UNSET: - field_dict["x"] = x - if y is not UNSET: - field_dict["y"] = y + field_dict.update( + { + "x": x, + "y": y, + } + ) return field_dict @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) - x = d.pop("x", UNSET) + x = d.pop("x") - y = d.pop("y", UNSET) + y = d.pop("y") web_monitoring_availability_chart_points_item = cls( x=x, diff --git a/src/shellrent_sdk/client/models/web_monitoring_availability_chart_response.py b/src/shellrent_sdk/client/models/web_monitoring_availability_chart_response.py index 905bfb8..f4500f8 100644 --- a/src/shellrent_sdk/client/models/web_monitoring_availability_chart_response.py +++ b/src/shellrent_sdk/client/models/web_monitoring_availability_chart_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.web_monitoring_availability_chart import WebMonitoringAvailabilityChart - from ..models.web_monitoring_availability_chart_response_meta_type_0 import ( - WebMonitoringAvailabilityChartResponseMetaType0, - ) T = TypeVar("T", bound="WebMonitoringAvailabilityChartResponse") @@ -18,17 +15,19 @@ @_attrs_define class WebMonitoringAvailabilityChartResponse: - error: int + """Successful response with one `WebMonitoringAvailabilityChart`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: WebMonitoringAvailabilityChart - meta: None | WebMonitoringAvailabilityChartResponseMetaType0 + """ Availability of the monitored site in the last hour """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.web_monitoring_availability_chart_response_meta_type_0 import ( - WebMonitoringAvailabilityChartResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, WebMonitoringAvailabilityChartResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -60,12 +55,11 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.web_monitoring_availability_chart import ( WebMonitoringAvailabilityChart, ) - from ..models.web_monitoring_availability_chart_response_meta_type_0 import ( - WebMonitoringAvailabilityChartResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -76,20 +70,7 @@ def _parse_message(data: object) -> None | str: data = WebMonitoringAvailabilityChart.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | WebMonitoringAvailabilityChartResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = WebMonitoringAvailabilityChartResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | WebMonitoringAvailabilityChartResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") web_monitoring_availability_chart_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/web_monitoring_availability_chart_response_meta_type_0.py b/src/shellrent_sdk/client/models/web_monitoring_availability_chart_response_meta_type_0.py deleted file mode 100644 index 2f8ff26..0000000 --- a/src/shellrent_sdk/client/models/web_monitoring_availability_chart_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="WebMonitoringAvailabilityChartResponseMetaType0") - - -@_attrs_define -class WebMonitoringAvailabilityChartResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - web_monitoring_availability_chart_response_meta_type_0 = cls() - - web_monitoring_availability_chart_response_meta_type_0.additional_properties = d - return web_monitoring_availability_chart_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/web_monitoring_download_speed_chart.py b/src/shellrent_sdk/client/models/web_monitoring_download_speed_chart.py index dbf9179..e0a93bd 100644 --- a/src/shellrent_sdk/client/models/web_monitoring_download_speed_chart.py +++ b/src/shellrent_sdk/client/models/web_monitoring_download_speed_chart.py @@ -17,10 +17,16 @@ @_attrs_define class WebMonitoringDownloadSpeedChart: + """Download speed of the monitored site in the last hour""" + web_monitoring_id: int + """ Id of the web monitoring (`GET /api/v3/web-monitorings/{web_monitoring_id}`) """ interval: str + """ Period covered by the chart, as an ISO 8601 duration: always `PT1H`, the last hour """ unit: str + """ Unit of the `y` values: always `KB/s` """ points: list[WebMonitoringDownloadSpeedChartPointsItem] + """ Download speeds measured in the last hour, one point per check """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/web_monitoring_download_speed_chart_points_item.py b/src/shellrent_sdk/client/models/web_monitoring_download_speed_chart_points_item.py index dae539a..0af4b30 100644 --- a/src/shellrent_sdk/client/models/web_monitoring_download_speed_chart_points_item.py +++ b/src/shellrent_sdk/client/models/web_monitoring_download_speed_chart_points_item.py @@ -6,16 +6,14 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset - T = TypeVar("T", bound="WebMonitoringDownloadSpeedChartPointsItem") @_attrs_define class WebMonitoringDownloadSpeedChartPointsItem: - x: float | Unset = UNSET + x: float """ UNIX timestamp in milliseconds """ - y: float | Unset = UNSET + y: float """ Download speed value in KB/s """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -26,20 +24,21 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - field_dict.update({}) - if x is not UNSET: - field_dict["x"] = x - if y is not UNSET: - field_dict["y"] = y + field_dict.update( + { + "x": x, + "y": y, + } + ) return field_dict @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) - x = d.pop("x", UNSET) + x = d.pop("x") - y = d.pop("y", UNSET) + y = d.pop("y") web_monitoring_download_speed_chart_points_item = cls( x=x, diff --git a/src/shellrent_sdk/client/models/web_monitoring_download_speed_chart_response.py b/src/shellrent_sdk/client/models/web_monitoring_download_speed_chart_response.py index c6d3a0a..9dfb1c5 100644 --- a/src/shellrent_sdk/client/models/web_monitoring_download_speed_chart_response.py +++ b/src/shellrent_sdk/client/models/web_monitoring_download_speed_chart_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.web_monitoring_download_speed_chart import WebMonitoringDownloadSpeedChart - from ..models.web_monitoring_download_speed_chart_response_meta_type_0 import ( - WebMonitoringDownloadSpeedChartResponseMetaType0, - ) T = TypeVar("T", bound="WebMonitoringDownloadSpeedChartResponse") @@ -18,17 +15,19 @@ @_attrs_define class WebMonitoringDownloadSpeedChartResponse: - error: int + """Successful response with one `WebMonitoringDownloadSpeedChart`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: WebMonitoringDownloadSpeedChart - meta: None | WebMonitoringDownloadSpeedChartResponseMetaType0 + """ Download speed of the monitored site in the last hour """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.web_monitoring_download_speed_chart_response_meta_type_0 import ( - WebMonitoringDownloadSpeedChartResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, WebMonitoringDownloadSpeedChartResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -60,12 +55,11 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.web_monitoring_download_speed_chart import ( WebMonitoringDownloadSpeedChart, ) - from ..models.web_monitoring_download_speed_chart_response_meta_type_0 import ( - WebMonitoringDownloadSpeedChartResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -76,20 +70,7 @@ def _parse_message(data: object) -> None | str: data = WebMonitoringDownloadSpeedChart.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | WebMonitoringDownloadSpeedChartResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = WebMonitoringDownloadSpeedChartResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | WebMonitoringDownloadSpeedChartResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") web_monitoring_download_speed_chart_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/web_monitoring_download_speed_chart_response_meta_type_0.py b/src/shellrent_sdk/client/models/web_monitoring_download_speed_chart_response_meta_type_0.py deleted file mode 100644 index 58be829..0000000 --- a/src/shellrent_sdk/client/models/web_monitoring_download_speed_chart_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="WebMonitoringDownloadSpeedChartResponseMetaType0") - - -@_attrs_define -class WebMonitoringDownloadSpeedChartResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - web_monitoring_download_speed_chart_response_meta_type_0 = cls() - - web_monitoring_download_speed_chart_response_meta_type_0.additional_properties = d - return web_monitoring_download_speed_chart_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/web_monitoring_notices.py b/src/shellrent_sdk/client/models/web_monitoring_notices.py index af7a326..99be808 100644 --- a/src/shellrent_sdk/client/models/web_monitoring_notices.py +++ b/src/shellrent_sdk/client/models/web_monitoring_notices.py @@ -11,10 +11,17 @@ @_attrs_define class WebMonitoringNotices: + """Notice settings of a web monitoring""" + web_monitoring_id: int + """ Id of the web monitoring (`GET /api/v3/web-monitorings/{web_monitoring_id}`) """ notification_email: None | str + """ Email address for the notices of the monitoring (site down or back up, SSL expiry); without it no email + notice is sent """ notification_sms: None | str - send_ssl_notify: bool + """ Italian mobile number for the SMS notices, without the international prefix; without it no SMS is sent """ + send_ssl_notify: bool | None + """ Whether the notices of the expiry of the SSL certificate of the site are sent """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -26,6 +33,7 @@ def to_dict(self) -> dict[str, Any]: notification_sms: None | str notification_sms = self.notification_sms + send_ssl_notify: bool | None send_ssl_notify = self.send_ssl_notify field_dict: dict[str, Any] = {} @@ -60,7 +68,12 @@ def _parse_notification_sms(data: object) -> None | str: notification_sms = _parse_notification_sms(d.pop("notification_sms")) - send_ssl_notify = d.pop("send_ssl_notify") + def _parse_send_ssl_notify(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) + + send_ssl_notify = _parse_send_ssl_notify(d.pop("send_ssl_notify")) web_monitoring_notices = cls( web_monitoring_id=web_monitoring_id, diff --git a/src/shellrent_sdk/client/models/web_monitoring_notices_response.py b/src/shellrent_sdk/client/models/web_monitoring_notices_response.py index bc12ffe..d6fb83f 100644 --- a/src/shellrent_sdk/client/models/web_monitoring_notices_response.py +++ b/src/shellrent_sdk/client/models/web_monitoring_notices_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.web_monitoring_notices import WebMonitoringNotices - from ..models.web_monitoring_notices_response_meta_type_0 import ( - WebMonitoringNoticesResponseMetaType0, - ) T = TypeVar("T", bound="WebMonitoringNoticesResponse") @@ -18,17 +15,19 @@ @_attrs_define class WebMonitoringNoticesResponse: - error: int + """Successful response with one `WebMonitoringNotices`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: WebMonitoringNotices - meta: None | WebMonitoringNoticesResponseMetaType0 + """ Notice settings of a web monitoring """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.web_monitoring_notices_response_meta_type_0 import ( - WebMonitoringNoticesResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, WebMonitoringNoticesResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -58,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.web_monitoring_notices import WebMonitoringNotices - from ..models.web_monitoring_notices_response_meta_type_0 import ( - WebMonitoringNoticesResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -74,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = WebMonitoringNotices.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | WebMonitoringNoticesResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = WebMonitoringNoticesResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | WebMonitoringNoticesResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") web_monitoring_notices_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/web_monitoring_notices_response_meta_type_0.py b/src/shellrent_sdk/client/models/web_monitoring_notices_response_meta_type_0.py deleted file mode 100644 index 9ac5b02..0000000 --- a/src/shellrent_sdk/client/models/web_monitoring_notices_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="WebMonitoringNoticesResponseMetaType0") - - -@_attrs_define -class WebMonitoringNoticesResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - web_monitoring_notices_response_meta_type_0 = cls() - - web_monitoring_notices_response_meta_type_0.additional_properties = d - return web_monitoring_notices_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/web_monitoring_notices_update_request.py b/src/shellrent_sdk/client/models/web_monitoring_notices_update_request.py index c02d3e7..9a9bde6 100644 --- a/src/shellrent_sdk/client/models/web_monitoring_notices_update_request.py +++ b/src/shellrent_sdk/client/models/web_monitoring_notices_update_request.py @@ -4,7 +4,6 @@ from typing import Any, Self, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -19,7 +18,6 @@ class WebMonitoringNoticesUpdateRequest: """ Notification phone number. Use empty string to clear. """ send_ssl_notify: bool | Unset = UNSET """ Enable or disable SSL expiry notices. """ - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: notification_email = self.notification_email @@ -29,7 +27,7 @@ def to_dict(self) -> dict[str, Any]: send_ssl_notify = self.send_ssl_notify field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if notification_email is not UNSET: field_dict["notification_email"] = notification_email @@ -55,21 +53,4 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: send_ssl_notify=send_ssl_notify, ) - web_monitoring_notices_update_request.additional_properties = d return web_monitoring_notices_update_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/web_monitoring_paginated_list_response.py b/src/shellrent_sdk/client/models/web_monitoring_paginated_list_response.py index 5f5faa4..f038abb 100644 --- a/src/shellrent_sdk/client/models/web_monitoring_paginated_list_response.py +++ b/src/shellrent_sdk/client/models/web_monitoring_paginated_list_response.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,10 +16,16 @@ @_attrs_define class WebMonitoringPaginatedListResponse: - error: int + """Successful response with a page of `WebMonitoring`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: list[WebMonitoring] + """ Items of the page: an empty list beyond the last page """ meta: PaginationMeta + """ Pagination of a list, with the totals """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +60,9 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.web_monitoring import WebMonitoring d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: diff --git a/src/shellrent_sdk/client/models/web_monitoring_response.py b/src/shellrent_sdk/client/models/web_monitoring_response.py index 3457e87..000c3c0 100644 --- a/src/shellrent_sdk/client/models/web_monitoring_response.py +++ b/src/shellrent_sdk/client/models/web_monitoring_response.py @@ -1,14 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.web_monitoring import WebMonitoring - from ..models.web_monitoring_response_meta_type_0 import WebMonitoringResponseMetaType0 T = TypeVar("T", bound="WebMonitoringResponse") @@ -16,15 +15,19 @@ @_attrs_define class WebMonitoringResponse: - error: int + """Successful response with one `WebMonitoring`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: WebMonitoring - meta: None | WebMonitoringResponseMetaType0 + """ Monitoring of a website: checks of the availability of the domain, and notices """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.web_monitoring_response_meta_type_0 import WebMonitoringResponseMetaType0 - error = self.error message: None | str @@ -32,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, WebMonitoringResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -54,12 +53,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.web_monitoring import WebMonitoring - from ..models.web_monitoring_response_meta_type_0 import ( - WebMonitoringResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -70,20 +68,7 @@ def _parse_message(data: object) -> None | str: data = WebMonitoring.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | WebMonitoringResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = WebMonitoringResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | WebMonitoringResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") web_monitoring_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/web_monitoring_response_meta_type_0.py b/src/shellrent_sdk/client/models/web_monitoring_response_meta_type_0.py deleted file mode 100644 index 8949771..0000000 --- a/src/shellrent_sdk/client/models/web_monitoring_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="WebMonitoringResponseMetaType0") - - -@_attrs_define -class WebMonitoringResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - web_monitoring_response_meta_type_0 = cls() - - web_monitoring_response_meta_type_0.additional_properties = d - return web_monitoring_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/src/shellrent_sdk/client/models/web_monitoring_response_time_chart.py b/src/shellrent_sdk/client/models/web_monitoring_response_time_chart.py index 3de8154..ccdd81e 100644 --- a/src/shellrent_sdk/client/models/web_monitoring_response_time_chart.py +++ b/src/shellrent_sdk/client/models/web_monitoring_response_time_chart.py @@ -17,10 +17,16 @@ @_attrs_define class WebMonitoringResponseTimeChart: + """Response time of the monitored site in the last hour""" + web_monitoring_id: int + """ Id of the web monitoring (`GET /api/v3/web-monitorings/{web_monitoring_id}`) """ interval: str + """ Period covered by the chart, as an ISO 8601 duration: always `PT1H`, the last hour """ unit: str + """ Unit of the `y` values: always `ms` """ points: list[WebMonitoringResponseTimeChartPointsItem] + """ Response times measured in the last hour, one point per check """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/shellrent_sdk/client/models/web_monitoring_response_time_chart_points_item.py b/src/shellrent_sdk/client/models/web_monitoring_response_time_chart_points_item.py index 0e50366..76b0adc 100644 --- a/src/shellrent_sdk/client/models/web_monitoring_response_time_chart_points_item.py +++ b/src/shellrent_sdk/client/models/web_monitoring_response_time_chart_points_item.py @@ -6,16 +6,14 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset - T = TypeVar("T", bound="WebMonitoringResponseTimeChartPointsItem") @_attrs_define class WebMonitoringResponseTimeChartPointsItem: - x: float | Unset = UNSET + x: float """ UNIX timestamp in milliseconds """ - y: float | Unset = UNSET + y: float """ Response time value in milliseconds """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -26,20 +24,21 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - field_dict.update({}) - if x is not UNSET: - field_dict["x"] = x - if y is not UNSET: - field_dict["y"] = y + field_dict.update( + { + "x": x, + "y": y, + } + ) return field_dict @classmethod def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: d = dict(src_dict) - x = d.pop("x", UNSET) + x = d.pop("x") - y = d.pop("y", UNSET) + y = d.pop("y") web_monitoring_response_time_chart_points_item = cls( x=x, diff --git a/src/shellrent_sdk/client/models/web_monitoring_response_time_chart_response.py b/src/shellrent_sdk/client/models/web_monitoring_response_time_chart_response.py index 6a55370..33d9ea4 100644 --- a/src/shellrent_sdk/client/models/web_monitoring_response_time_chart_response.py +++ b/src/shellrent_sdk/client/models/web_monitoring_response_time_chart_response.py @@ -1,16 +1,13 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Self, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, Self, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.web_monitoring_response_time_chart import WebMonitoringResponseTimeChart - from ..models.web_monitoring_response_time_chart_response_meta_type_0 import ( - WebMonitoringResponseTimeChartResponseMetaType0, - ) T = TypeVar("T", bound="WebMonitoringResponseTimeChartResponse") @@ -18,17 +15,19 @@ @_attrs_define class WebMonitoringResponseTimeChartResponse: - error: int + """Successful response with one `WebMonitoringResponseTimeChart`""" + + error: Literal[0] + """ Always 0 in a successful response """ message: None | str + """ Always null in a successful response """ data: WebMonitoringResponseTimeChart - meta: None | WebMonitoringResponseTimeChartResponseMetaType0 + """ Response time of the monitored site in the last hour """ + meta: Any + """ Always null: only the paginated lists have a `meta` """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.web_monitoring_response_time_chart_response_meta_type_0 import ( - WebMonitoringResponseTimeChartResponseMetaType0, - ) - error = self.error message: None | str @@ -36,11 +35,7 @@ def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - meta: dict[str, Any] | None - if isinstance(self.meta, WebMonitoringResponseTimeChartResponseMetaType0): - meta = self.meta.to_dict() - else: - meta = self.meta + meta = self.meta field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -60,12 +55,11 @@ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: from ..models.web_monitoring_response_time_chart import ( WebMonitoringResponseTimeChart, ) - from ..models.web_monitoring_response_time_chart_response_meta_type_0 import ( - WebMonitoringResponseTimeChartResponseMetaType0, - ) d = dict(src_dict) - error = d.pop("error") + error = cast(Literal[0], d.pop("error")) + if error != 0: + raise ValueError(f"error must match const 0, got '{error}'") def _parse_message(data: object) -> None | str: if data is None: @@ -76,20 +70,7 @@ def _parse_message(data: object) -> None | str: data = WebMonitoringResponseTimeChart.from_dict(d.pop("data")) - def _parse_meta(data: object) -> None | WebMonitoringResponseTimeChartResponseMetaType0: - if data is None: - return data - try: - if not isinstance(data, dict): - raise TypeError() - meta_type_0 = WebMonitoringResponseTimeChartResponseMetaType0.from_dict(data) - - return meta_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | WebMonitoringResponseTimeChartResponseMetaType0, data) - - meta = _parse_meta(d.pop("meta")) + meta = d.pop("meta") web_monitoring_response_time_chart_response = cls( error=error, diff --git a/src/shellrent_sdk/client/models/web_monitoring_response_time_chart_response_meta_type_0.py b/src/shellrent_sdk/client/models/web_monitoring_response_time_chart_response_meta_type_0.py deleted file mode 100644 index 4f948dd..0000000 --- a/src/shellrent_sdk/client/models/web_monitoring_response_time_chart_response_meta_type_0.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Self, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="WebMonitoringResponseTimeChartResponseMetaType0") - - -@_attrs_define -class WebMonitoringResponseTimeChartResponseMetaType0: - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - - return field_dict - - @classmethod - def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: - d = dict(src_dict) - web_monitoring_response_time_chart_response_meta_type_0 = cls() - - web_monitoring_response_time_chart_response_meta_type_0.additional_properties = d - return web_monitoring_response_time_chart_response_meta_type_0 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/tests/unit/test_auth.py b/tests/unit/test_auth.py index fc59696..6dc4985 100644 --- a/tests/unit/test_auth.py +++ b/tests/unit/test_auth.py @@ -305,7 +305,7 @@ def test_sends_the_body_again_after_401() -> None: ) with sync_client(api, OAuth2Auth(credentials())) as client: - client.post("/api/v3/orders/pay", json={"order_ids": [1]}) + client.post("/api/v3/payments/prepaid-credit", json={"order_ids": [1]}) first, second = api.api_requests assert body(first) == body(second) == {"order_ids": [1]} diff --git a/tests/unit/test_cli.py b/tests/unit/test_cli.py index 33693f5..c646c95 100644 --- a/tests/unit/test_cli.py +++ b/tests/unit/test_cli.py @@ -95,7 +95,9 @@ def test_http_errors_exit_1_with_the_body_on_stdout( def test_sends_data_given_as_text(api: FakeApi, capsys: pytest.CaptureFixture[str]) -> None: api.responses += [token_response(), health_response()] - status, _, _ = run(capsys, "api", "POST", "/api/v3/orders/pay", "--data", '{"order_ids": [1]}') + status, _, _ = run( + capsys, "api", "POST", "/api/v3/payments/prepaid-credit", "--data", '{"order_ids": [1]}' + ) assert status == 0 request = api.requests[1] @@ -111,7 +113,9 @@ def test_sends_data_from_a_file( data = tmp_path / "body.json" data.write_text('{"order_ids": [2]}') - status, _, _ = run(capsys, "api", "POST", "/api/v3/orders/pay", "--data", f"@{data}") + status, _, _ = run( + capsys, "api", "POST", "/api/v3/payments/prepaid-credit", "--data", f"@{data}" + ) assert status == 0 assert body(api.requests[1]) == {"order_ids": [2]} @@ -123,7 +127,7 @@ def test_sends_data_from_stdin( api.responses += [token_response(), health_response()] monkeypatch.setattr("sys.stdin", io.TextIOWrapper(io.BytesIO(b'{"order_ids": [3]}'))) - status, _, _ = run(capsys, "api", "POST", "/api/v3/orders/pay", "-d", "-") + status, _, _ = run(capsys, "api", "POST", "/api/v3/payments/prepaid-credit", "-d", "-") assert status == 0 assert body(api.requests[1]) == {"order_ids": [3]} diff --git a/tests/unit/test_client.py b/tests/unit/test_client.py index a8541b8..89931c0 100644 --- a/tests/unit/test_client.py +++ b/tests/unit/test_client.py @@ -14,13 +14,14 @@ from shellrent_sdk.client.api.billing import download_invoice_pdf from shellrent_sdk.client.api.health import get_health from shellrent_sdk.client.api.hosting import get_hosting_antivirus +from shellrent_sdk.client.api.payment import create_prepaid_credit_payment from shellrent_sdk.client.api.purchases import get_purchase, list_tasks -from shellrent_sdk.client.api.shop import pay_orders +from shellrent_sdk.client.api.sms import delete_sms from shellrent_sdk.client.models import ( ApiError, HealthStatusResponse, - OrderPayRequest, Payment, + PrepaidCreditPaymentCreateRequest, ) from shellrent_sdk.http import RetryTransport, default_user_agent from tests.support import ( @@ -165,29 +166,32 @@ def test_undocumented_status_codes_raise_unexpected_status(api: FakeApi) -> None assert info.value.status_code == 503 -def test_inline_envelopes_accept_null_message_and_meta(api: FakeApi) -> None: +def test_envelopes_accept_null_data_message_and_meta(api: FakeApi) -> None: body = {"error": 0, "message": None, "data": None, "meta": None} - api.responses += [ - token_response(), - httpx.Response(200, json=body), - httpx.Response(200, json=body), - ] - client = create_client(credentials()) + api.responses += [token_response(), httpx.Response(200, json=body)] - # Nothing to pay: the total is 0.00. - payment = unwrap(pay_orders.sync_detailed(client=client, body=OrderPayRequest(order_ids=[1]))) - antivirus = unwrap(get_hosting_antivirus.sync_detailed(1, client=client)) + # No scan yet. + antivirus = unwrap(get_hosting_antivirus.sync_detailed(1, client=create_client(credentials()))) - assert (payment.data, payment.message, payment.meta) == (None, None, None) assert (antivirus.data, antivirus.message, antivirus.meta) == (None, None, None) +def test_unwrap_returns_none_for_204_no_content(api: FakeApi) -> None: + api.responses += [token_response(), httpx.Response(204), httpx.Response(204)] + client = create_client(credentials()) + + # Nothing to pay: the total is 0.00. + order = PrepaidCreditPaymentCreateRequest(order_ids=[1]) + assert unwrap(create_prepaid_credit_payment.sync_detailed(client=client, body=order)) is None + assert unwrap(delete_sms.sync_detailed(1, client=client)) is None + + def test_list_tasks_sends_only_the_parameters_with_a_default(api: FakeApi) -> None: body: dict[str, Any] = { "error": 0, "message": None, "data": [], - "meta": {"total": 0, "count": 0, "pages": 0, "page": 1, "per_page": 15}, + "meta": {"total": 0, "count": 0, "pages": 0, "page": 1, "per_page": 20}, } api.responses += [token_response(), httpx.Response(200, json=body)] @@ -196,7 +200,7 @@ def test_list_tasks_sends_only_the_parameters_with_a_default(api: FakeApi) -> No assert dict(api.api_requests[0].url.params) == { "alive_only": "true", "page": "1", - "per_page": "15", + "per_page": "20", } @@ -260,16 +264,15 @@ def test_without_retry(api: FakeApi) -> None: } -def test_pay_orders_returns_the_payment(api: FakeApi) -> None: - body = {"error": 0, "message": "", "data": PAYMENT, "meta": {}} - api.responses += [token_response(), httpx.Response(200, json=body)] - order = OrderPayRequest(order_ids=[1, 2], use_prepaid_credit=True) +def test_create_prepaid_credit_payment_returns_the_payment(api: FakeApi) -> None: + body = {"error": 0, "message": None, "data": PAYMENT, "meta": None} + api.responses += [token_response(), httpx.Response(201, json=body)] + order = PrepaidCreditPaymentCreateRequest(order_ids=[1, 2]) - result = unwrap(pay_orders.sync_detailed(client=create_client(credentials()), body=order)) + result = unwrap( + create_prepaid_credit_payment.sync_detailed(client=create_client(credentials()), body=order) + ) assert isinstance(result.data, Payment) assert result.data.payment_id == 7 - assert json.loads(api.api_requests[0].content) == { - "order_ids": [1, 2], - "use_prepaid_credit": True, - } + assert json.loads(api.api_requests[0].content) == {"order_ids": [1, 2]} diff --git a/tests/unit/test_errors.py b/tests/unit/test_errors.py index a222997..c067185 100644 --- a/tests/unit/test_errors.py +++ b/tests/unit/test_errors.py @@ -75,6 +75,14 @@ def test_unwrap_returns_the_body_of_another_client() -> None: assert assert_type(other_unwrap(response), OtherStatus) is status +def test_unwrap_returns_none_for_204_no_content() -> None: + response: OtherResponse[None | OtherApiError] = OtherResponse( + HTTPStatus.NO_CONTENT, b"", {}, None + ) + + assert other_unwrap(response) is None + + def test_api_exception_without_message() -> None: response: OtherResponse[OtherStatus | OtherApiError] = OtherResponse( HTTPStatus.CONFLICT, b"{}", {}, OtherApiError(error=409, message=None) diff --git a/tests/unit/test_http.py b/tests/unit/test_http.py index 1b9f3c9..ae22923 100644 --- a/tests/unit/test_http.py +++ b/tests/unit/test_http.py @@ -122,7 +122,7 @@ def test_sends_the_body_again() -> None: api, sleeps = FakeApi(too_many_requests("1"), health_response()), Sleeps() with retrying_client(api, sleeps) as client: - client.post("/api/v3/orders/pay", json={"order_ids": [1, 2]}) + client.post("/api/v3/payments/prepaid-credit", json={"order_ids": [1, 2]}) assert [body(request) for request in api.requests] == [{"order_ids": [1, 2]}] * 2