From 471270dae1c25c6d95edfb2da350b4a5107d6ede Mon Sep 17 00:00:00 2001 From: Tobia Zanarella Date: Wed, 30 Sep 2026 22:31:12 +0200 Subject: [PATCH 1/3] Update the OpenAPI spec to the 3.1 version of the application Copied from the Shellrent application: nullable references as anyOf with null, nullable data and meta in ApiError and in the inline envelopes, required fields on the response schemas, 429 documented on the throttled operations and on the token endpoint (OAuth2 format), OrderPayRequest and SmsCreateRequest as plain objects, payOrders data as Payment or null. Co-Authored-By: Claude Opus 5.5 --- spec/openapi.yaml | 6753 ++++++++++++++++++++++++++++++++------------- 1 file changed, 4780 insertions(+), 1973 deletions(-) diff --git a/spec/openapi.yaml b/spec/openapi.yaml index 8151f7d..75191cd 100644 --- a/spec/openapi.yaml +++ b/spec/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: 3.1.0 info: title: API Shellrent description: >- @@ -35,11 +35,11 @@ tags: description: Server - name: Monitoring description: Monitoring - - name: SSL + - name: Ssl description: SSL Certificates - name: License description: License - - name: PEC + - name: Pec description: PEC - name: Storage description: Storage @@ -118,6 +118,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - account:read @@ -184,6 +186,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - billing:read @@ -231,6 +235,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - billing:read @@ -278,6 +284,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - billing:read @@ -330,6 +338,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - billing:read @@ -412,6 +422,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - billing:read @@ -482,6 +494,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - billing:read @@ -560,6 +574,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - domains:read @@ -607,6 +623,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - domains:read @@ -655,6 +673,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - domains:read @@ -702,6 +722,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - domains:read @@ -748,6 +770,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - domains:write @@ -796,6 +820,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - domains:write @@ -850,6 +876,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - domains:write @@ -897,6 +925,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - domains:read @@ -944,6 +974,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - domains:read @@ -991,6 +1023,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - domains:read @@ -1043,6 +1077,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - domains:write @@ -1090,6 +1126,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - domains:read @@ -1137,6 +1175,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - domains:write @@ -1190,6 +1230,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - domains:write @@ -1243,6 +1285,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - domains:write @@ -1323,6 +1367,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - domains:read @@ -1375,6 +1421,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - domains:write @@ -1427,6 +1475,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - domains:read @@ -1478,6 +1528,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - domains:write @@ -1535,6 +1587,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - domains:write @@ -1582,6 +1636,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - domains:read @@ -1634,6 +1690,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - domains:read @@ -1691,6 +1749,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - domains:write @@ -1740,6 +1800,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - domains:write @@ -1794,6 +1856,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:read @@ -1841,6 +1905,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:read @@ -1893,6 +1959,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:write @@ -1939,6 +2007,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:write @@ -1986,6 +2056,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:read @@ -2033,6 +2105,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:read @@ -2080,6 +2154,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:read @@ -2132,6 +2208,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:write @@ -2184,6 +2262,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:read @@ -2231,6 +2311,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:read @@ -2283,6 +2365,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:write @@ -2335,6 +2419,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:read @@ -2386,6 +2472,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:write @@ -2433,6 +2521,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:read @@ -2485,6 +2575,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:write @@ -2537,6 +2629,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:write @@ -2583,6 +2677,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:write @@ -2643,6 +2739,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:read @@ -2695,6 +2793,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:write @@ -2747,6 +2847,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:read @@ -2798,6 +2900,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:write @@ -2857,6 +2961,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:read @@ -2909,6 +3015,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:write @@ -2961,6 +3069,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:read @@ -3012,6 +3122,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:write @@ -3071,6 +3183,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:read @@ -3123,6 +3237,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:write @@ -3175,6 +3291,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:read @@ -3226,6 +3344,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:write @@ -3273,6 +3393,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:read @@ -3325,6 +3447,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:write @@ -3385,6 +3509,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:read @@ -3437,6 +3563,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:read @@ -3484,6 +3612,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:read @@ -3536,6 +3666,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:write @@ -3588,6 +3720,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:write @@ -3634,6 +3768,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:write @@ -3686,6 +3822,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:read @@ -3737,6 +3875,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:write @@ -3790,6 +3930,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:write @@ -3843,6 +3985,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:write @@ -3890,6 +4034,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:read @@ -3943,6 +4089,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:write @@ -3996,6 +4144,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:write @@ -4023,16 +4173,23 @@ paths: type: integer example: 0 message: - type: string - example: '' + type: + - string + - 'null' data: - allOf: + anyOf: - $ref: '#/components/schemas/HostingAntivirus' - nullable: true - type: object + - type: 'null' meta: - type: object + type: + - object + - 'null' type: object + required: + - error + - message + - data + - meta '400': description: Bad request content: @@ -4057,6 +4214,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:read @@ -4116,6 +4275,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:read @@ -4162,6 +4323,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:write @@ -4214,6 +4377,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:read @@ -4274,6 +4439,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:read @@ -4320,6 +4487,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:write @@ -4372,6 +4541,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:read @@ -4419,6 +4590,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:read @@ -4473,6 +4646,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:write @@ -4525,6 +4700,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:read @@ -4576,6 +4753,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:write @@ -4623,6 +4802,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:write @@ -4676,6 +4857,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:write @@ -4723,6 +4906,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:read @@ -4775,6 +4960,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:write @@ -4822,6 +5009,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:read @@ -4874,6 +5063,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:read @@ -4926,6 +5117,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - hosting:write @@ -4997,6 +5190,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - billing:read @@ -5044,6 +5239,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - billing:read @@ -5091,6 +5288,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - billing:read @@ -5143,6 +5342,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - billing:read @@ -5225,6 +5426,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - billing:read @@ -5295,6 +5498,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - billing:read @@ -5349,6 +5554,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - weblicense:read @@ -5403,6 +5610,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - weblicense:read @@ -5450,6 +5659,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - weblicense:read @@ -5497,6 +5708,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - weblicense:read @@ -5553,6 +5766,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - securemail:read @@ -5600,6 +5815,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - securemail:read @@ -5647,6 +5864,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - securemail:read @@ -5708,6 +5927,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - securemail:read @@ -5763,6 +5984,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - securemail:write @@ -5818,6 +6041,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - securemail:write @@ -5874,6 +6099,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - m365:read @@ -5921,6 +6148,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - m365:read @@ -5977,6 +6206,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - m365:read @@ -6024,6 +6255,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - m365:read @@ -6079,6 +6312,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - m365:write @@ -6134,6 +6369,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - m365:write @@ -6181,6 +6418,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - m365:read @@ -6252,6 +6491,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - payment:read @@ -6299,6 +6540,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - payment:read @@ -6340,6 +6583,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - payment:read @@ -6380,6 +6625,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - payment:write @@ -6420,6 +6667,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - payment:write @@ -6516,6 +6765,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:read @@ -6563,6 +6814,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:read @@ -6609,6 +6862,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:write @@ -6656,6 +6911,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:read @@ -6703,6 +6960,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:read @@ -6711,7 +6970,9 @@ paths: tags: - Shop summary: Pay Orders - description: Pay one or more 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 @@ -6730,20 +6991,26 @@ paths: type: integer example: 0 message: - type: string - example: '' + type: + - string + - 'null' data: - oneOf: + description: >- + Payment data, null when there is nothing to pay (total + amount to pay = 0.00) + anyOf: - $ref: '#/components/schemas/Payment' - - description: >- - Empty object when there is no payment data (ie. total - amount to pay = 0.00) - maxProperties: 0 - minProperties: 0 - type: object + - type: 'null' meta: - type: object + type: + - object + - 'null' type: object + required: + - error + - message + - data + - meta '400': description: Bad request content: @@ -6768,6 +7035,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:write @@ -6815,6 +7084,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:read @@ -6867,6 +7138,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:read @@ -6938,6 +7211,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - payment:read @@ -6985,13 +7260,15 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - payment:read /api/v3/pec-domains: get: tags: - - PEC + - Pec summary: List PEC domains description: Get a paginated list of PEC domains for the authenticated account operationId: listPecDomains @@ -7039,13 +7316,15 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - pec:read /api/v3/pec-domains/{pec_domain_id}: get: tags: - - PEC + - Pec summary: Get PEC domain description: Get details of a PEC domain for the authenticated account operationId: getPecDomain @@ -7086,13 +7365,15 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - pec:read /api/v3/pec-domains/{pec_domain_id}/owner-changes: get: tags: - - PEC + - Pec summary: List PEC domain owner changes description: Get a paginated list of owner change requests for a PEC domain operationId: listPecDomainOwnerChanges @@ -7145,12 +7426,14 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - pec:read post: tags: - - PEC + - Pec summary: Create PEC domain owner change description: Create a new owner change request for a PEC domain operationId: createPecDomainOwnerChange @@ -7197,13 +7480,15 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - pec:write /api/v3/pec-domains/{pec_domain_id}/owner-changes/{owner_change_id}: get: tags: - - PEC + - Pec summary: Get PEC domain owner change description: Get details of a specific owner change request for a PEC domain operationId: getPecDomainOwnerChange @@ -7249,13 +7534,15 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - pec:read /api/v3/pec-mailboxes: get: tags: - - PEC + - Pec summary: List PEC mailboxes description: Get a paginated list of PEC mailboxes for the authenticated account operationId: listPecMailboxes @@ -7303,13 +7590,15 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - pec:read /api/v3/pec-mailboxes/{pec_id}: get: tags: - - PEC + - Pec summary: Get PEC mailbox description: Get details of a PEC mailbox for the authenticated account operationId: getPecMailbox @@ -7350,12 +7639,14 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - pec:read patch: tags: - - PEC + - Pec summary: Update PEC mailbox description: Update PEC mailbox settings for the authenticated account operationId: updatePecMailbox @@ -7402,13 +7693,15 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - pec:write /api/v3/pec-mailboxes/{pec_id}/owner-changes: get: tags: - - PEC + - Pec summary: List PEC mailbox owner changes description: Get a paginated list of owner change requests for a PEC mailbox operationId: listPecMailboxOwnerChanges @@ -7461,12 +7754,14 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - pec:read post: tags: - - PEC + - Pec summary: Create PEC mailbox owner change description: Create a new owner change request for a PEC mailbox operationId: createPecMailboxOwnerChange @@ -7513,6 +7808,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - pec:write @@ -7554,6 +7851,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - payment:read @@ -7621,6 +7920,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - payment:read @@ -7668,6 +7969,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - payment:read @@ -7754,6 +8057,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - payment:read @@ -7800,6 +8105,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - payment:write @@ -7847,6 +8154,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - payment:read @@ -7888,6 +8197,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - payment:write @@ -7928,6 +8239,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - payment:write @@ -8049,6 +8362,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - purchases:read @@ -8096,6 +8411,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - purchases:read @@ -8148,6 +8465,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - purchases:read @@ -8207,6 +8526,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - purchases:write @@ -8259,6 +8580,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - purchases:read @@ -8318,6 +8641,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - purchases:write @@ -8365,6 +8690,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - purchases:read @@ -8412,6 +8739,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - purchases:write @@ -8459,6 +8788,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - purchases:read @@ -8508,6 +8839,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - purchases:write @@ -8558,6 +8891,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - purchases:read @@ -8605,6 +8940,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - purchases:write @@ -8665,6 +9002,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - purchases:write @@ -8712,6 +9051,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - purchases:write @@ -8770,6 +9111,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - purchases:write @@ -8817,6 +9160,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - purchases:read @@ -8871,6 +9216,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - servermonitoring:read @@ -8918,6 +9265,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - servermonitoring:read @@ -8965,6 +9314,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - servermonitoring:read @@ -9017,6 +9368,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - servermonitoring:write @@ -9069,6 +9422,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - servermonitoring:read @@ -9120,6 +9475,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - servermonitoring:write @@ -9177,6 +9534,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - servermonitoring:write @@ -9229,6 +9588,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - servermonitoring:read @@ -9283,6 +9644,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:read @@ -9330,6 +9693,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:read @@ -9377,6 +9742,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:read @@ -9424,6 +9791,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:read @@ -9471,6 +9840,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:read @@ -9518,6 +9889,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:read @@ -9565,6 +9938,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:read @@ -9612,6 +9987,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:read @@ -9659,6 +10036,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:write @@ -9706,6 +10085,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:write @@ -9753,6 +10134,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:write @@ -9800,6 +10183,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:write @@ -9847,6 +10232,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:write @@ -9906,6 +10293,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:read @@ -9958,6 +10347,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:read @@ -10009,6 +10400,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:write @@ -10061,6 +10454,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:write @@ -10108,6 +10503,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:read @@ -10160,6 +10557,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:read @@ -10212,6 +10611,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:write @@ -10259,6 +10660,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:read @@ -10311,6 +10714,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:read @@ -10363,6 +10768,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:write @@ -10420,6 +10827,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:write @@ -10467,6 +10876,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:read @@ -10514,6 +10925,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:read @@ -10566,6 +10979,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:write @@ -10612,6 +11027,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:write @@ -10664,6 +11081,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:write @@ -10711,6 +11130,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:write @@ -10764,6 +11185,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:write @@ -10811,6 +11234,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:read @@ -10857,6 +11282,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:write @@ -10904,6 +11331,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:read @@ -10956,6 +11385,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:write @@ -11008,6 +11439,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:read @@ -11059,6 +11492,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:write @@ -11112,6 +11547,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:write @@ -11165,6 +11602,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:write @@ -11217,6 +11656,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:write @@ -11274,6 +11715,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - server:write @@ -11328,6 +11771,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:read @@ -11374,6 +11819,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:write @@ -11421,6 +11868,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:write @@ -11468,6 +11917,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:write @@ -11522,6 +11973,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:read @@ -11568,6 +12021,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:write @@ -11622,6 +12077,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:read @@ -11668,6 +12125,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:write @@ -11722,6 +12181,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:read @@ -11768,6 +12229,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:write @@ -11822,6 +12285,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:read @@ -11868,6 +12333,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:write @@ -11922,6 +12389,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:read @@ -11968,6 +12437,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:write @@ -12022,6 +12493,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:read @@ -12084,6 +12557,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:read @@ -12132,6 +12607,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:read @@ -12179,6 +12656,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:write @@ -12233,6 +12712,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:read @@ -12279,6 +12760,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:write @@ -12333,6 +12816,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:read @@ -12379,6 +12864,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:write @@ -12433,6 +12920,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:read @@ -12479,6 +12968,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:write @@ -12533,6 +13024,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:read @@ -12579,6 +13072,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:write @@ -12626,6 +13121,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:write @@ -12673,6 +13170,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:write @@ -12720,6 +13219,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:write @@ -12768,6 +13269,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:write @@ -12815,6 +13318,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:write @@ -12892,6 +13397,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - sms:read @@ -12938,6 +13445,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - sms:write @@ -12985,6 +13494,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - sms:read @@ -13031,6 +13542,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - sms:write @@ -13078,6 +13591,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - sms:read @@ -13125,6 +13640,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - sms:read @@ -13172,6 +13689,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - sms:write @@ -13219,6 +13738,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - sms:read @@ -13271,6 +13792,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - sms:read @@ -13312,6 +13835,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - sms:read @@ -13353,6 +13878,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - sms:read @@ -13401,6 +13928,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - sms:read @@ -13455,6 +13984,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - sms:read @@ -13501,6 +14032,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - sms:write @@ -13548,6 +14081,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - sms:read @@ -13594,6 +14129,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - sms:write @@ -13646,6 +14183,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - sms:write @@ -13705,6 +14244,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - sms:read @@ -13757,6 +14298,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - sms:write @@ -13809,6 +14352,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - sms:write @@ -13855,6 +14400,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - sms:write @@ -13907,13 +14454,15 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - sms:write /api/v3/ssl-certificates: get: tags: - - SSL + - Ssl summary: List all SSL Certificates description: Get a list of all SSL Certificates operationId: listSslCertificates @@ -13973,13 +14522,15 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - ssl:read /api/v3/ssl-certificates/{ssl_certificate_id}: get: tags: - - SSL + - Ssl summary: Get SSL certificate description: Get details of an SSL Certificate operationId: getSslCertificate @@ -14020,12 +14571,14 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - ssl:read patch: tags: - - SSL + - Ssl summary: Edit SSL certificate owner description: Edit SSL certificate owner operationId: updateSslCertificateOwner @@ -14072,13 +14625,15 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - ssl:write /api/v3/ssl-certificates/{ssl_certificate_id}/keys: get: tags: - - SSL + - Ssl summary: Get SSL certificate keys description: Get the keys of an SSL Certificate operationId: getSslCertificateKeys @@ -14119,13 +14674,15 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - ssl:read /api/v3/ssl-certificates/approver-emails/{domain_name}: get: tags: - - SSL + - Ssl summary: Get approver emails list description: Get a list of all acceptable approver emails for a domain name operationId: listSslApproverEmails @@ -14166,13 +14723,15 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - ssl:read /api/v3/ssl-certificates/{ssl_certificate_id}/can-reemit: get: tags: - - SSL + - Ssl summary: Can re-emit certificate description: Know if it's possible to re-emit the SSL Certificate operationId: canReemitSslCertificate @@ -14213,13 +14772,15 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - ssl:read /api/v3/ssl-certificates/{ssl_certificate_id}/reemit: post: tags: - - SSL + - Ssl summary: Re-emit certificate description: Ask for the SSL Certificate to be re-emitted operationId: reemitSslCertificate @@ -14266,13 +14827,15 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - ssl:write /api/v3/ssl-certificates/{ssl_certificate_id}/export_formats: get: tags: - - SSL + - Ssl summary: Get export formats description: Get a list of all export formats available for SSL Certificate keys operationId: listSslCertificateExportFormats @@ -14313,13 +14876,15 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - ssl:read /api/v3/ssl-certificates/{ssl_certificate_id}/export_format/{format}: get: tags: - - SSL + - Ssl summary: Export SSL certificate keys description: Export SSL certificate keys operationId: exportSslCertificate @@ -14365,13 +14930,15 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - ssl:read /api/v3/ssl-certificates/{ssl_certificate_id}/csr: put: tags: - - SSL + - Ssl summary: Change SSL certificate CSR description: Change SSL certificate CSR operationId: updateSslCertificateCsr @@ -14418,6 +14985,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - ssl:write @@ -14472,6 +15041,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - cloudstorage:read @@ -14519,6 +15090,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - cloudstorage:read @@ -14568,6 +15141,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - cloudstorage:write @@ -14617,6 +15192,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - cloudstorage:write @@ -14676,6 +15253,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - cloudstorage:read @@ -14728,6 +15307,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - cloudstorage:write @@ -14780,6 +15361,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - cloudstorage:read @@ -14831,6 +15414,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - cloudstorage:write @@ -14885,6 +15470,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - objectstorage:read @@ -14932,6 +15519,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - objectstorage:read @@ -14979,6 +15568,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - objectstorage:read @@ -15038,6 +15629,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - objectstorage:read @@ -15084,6 +15677,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - objectstorage:write @@ -15136,6 +15731,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - objectstorage:read @@ -15187,6 +15784,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - objectstorage:write @@ -15246,6 +15845,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - objectstorage:read @@ -15298,6 +15899,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - objectstorage:read @@ -15345,6 +15948,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - cloudstorage:read @@ -15397,6 +16002,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - cloudstorage:read @@ -15448,6 +16055,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - cloudstorage:write @@ -15506,6 +16115,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - cloudstorage:write @@ -15558,6 +16169,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - objectstorage:read @@ -15623,6 +16236,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - objectstorage:read @@ -15681,6 +16296,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - objectstorage:write @@ -15738,6 +16355,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - objectstorage:read @@ -15794,6 +16413,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - objectstorage:write @@ -15846,6 +16467,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - objectstorage:read @@ -15897,6 +16520,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - objectstorage:write @@ -15954,6 +16579,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - objectstorage:read @@ -16010,6 +16637,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - objectstorage:write @@ -16064,6 +16693,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - account:read @@ -16110,6 +16741,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - account:write @@ -16157,6 +16790,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - account:read @@ -16203,6 +16838,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - account:write @@ -16255,6 +16892,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - account:write @@ -16277,7 +16916,6 @@ paths: required: false schema: type: string - default: null - name: purchase_id in: query required: false @@ -16326,6 +16964,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - purchases:read @@ -16373,6 +17013,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - purchases:read @@ -16431,6 +17073,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - purchases:write @@ -16513,6 +17157,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:read @@ -16560,6 +17206,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - shop:read @@ -16607,6 +17255,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: [] /api/v3/web-monitorings: @@ -16660,6 +17310,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - webmonitoring:read @@ -16707,6 +17359,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - webmonitoring:read @@ -16754,6 +17408,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - webmonitoring:read @@ -16806,6 +17462,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - webmonitoring:write @@ -16853,6 +17511,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - webmonitoring:read @@ -16900,6 +17560,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - webmonitoring:read @@ -16947,6 +17609,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiError' + '429': + $ref: '#/components/responses/TooManyRequests' security: - oauth2: - webmonitoring:read @@ -16999,26 +17663,28 @@ paths: - client_credentials client_id: description: Client ID se non fornito tramite Authorization header Basic. - type: string - nullable: true + type: + - string + - 'null' client_secret: description: >- Client secret se non fornito tramite Authorization header Basic. - type: string - nullable: true + type: + - string + - 'null' scope: description: >- Scope separati da spazio. Se omesso: tutti gli scope assegnati al client. - type: string - nullable: true + type: + - string + - 'null' audience: - allOf: - - $ref: '#/components/schemas/OAuthAudience' - nullable: true description: 'Se omessa: l''unica audience del client.' - type: string + anyOf: + - $ref: '#/components/schemas/OAuthAudience' + - type: 'null' type: object responses: '200': @@ -17039,6 +17705,8 @@ paths: application/json: schema: $ref: '#/components/schemas/OAuthError' + '429': + $ref: '#/components/responses/TokenTooManyRequests' '500': description: Errore inatteso content: @@ -17064,11 +17732,15 @@ components: type: string example: Invalid request data: - description: Oggetto dati vuoto - type: object + description: Null nelle risposte d'errore + type: + - object + - 'null' meta: - description: Oggetto meta vuoto - type: object + description: Null nelle risposte d'errore + type: + - object + - 'null' type: object PaginationMeta: required: @@ -17148,13 +17820,15 @@ components: type: string example: invalid_client error_description: - type: string + type: + - string + - 'null' example: Client authentication failed. - nullable: true error_uri: - type: string + type: + - string + - 'null' example: https://docs.shellrent.com/oauth/errors#invalid_client - nullable: true type: object JwkKey: required: @@ -17186,9 +17860,10 @@ components: type: string example: AQAB status: - type: string + type: + - string + - 'null' example: trusted - nullable: true type: object JwksResponse: required: @@ -17471,8 +18146,9 @@ components: description: >- Domain auth-info code (authcode). Required if the domain must be transferred. - type: string - nullable: true + type: + - string + - 'null' type: object additionalProperties: false account_id: @@ -17522,87 +18198,101 @@ components: description: >- Tenant ID to which to assign the subscription when selecting an existing tenant - type: integer - nullable: true + type: + - integer + - 'null' domain_prefix: description: >- Prefix of the ".onmicrosoft.com" tenant domain when creating or transferring a tenant - type: string - nullable: true + type: + - string + - 'null' first_name: description: >- Contact first name for the tenant when not selecting an existing tenant - type: string - nullable: true + type: + - string + - 'null' last_name: description: >- Contact last name for the tenant when not selecting an existing tenant - type: string - nullable: true + type: + - string + - 'null' company_name: description: >- Company name for the tenant when not selecting an existing tenant - type: string - nullable: true + type: + - string + - 'null' address: description: Address for the tenant when not selecting an existing tenant - type: string - nullable: true + type: + - string + - 'null' city: description: City for the tenant when not selecting an existing tenant - type: string - nullable: true + type: + - string + - 'null' state: description: >- State/Province for the tenant address when not selecting an existing tenant - type: string - nullable: true + type: + - string + - 'null' postal_code: description: >- Postal code for the tenant address when not selecting an existing tenant - type: string - nullable: true + type: + - string + - 'null' country: description: >- ISO country code with 2 letters (e.g. "IT" or "ES") when not selecting an existing tenant - type: string - nullable: true + type: + - string + - 'null' email_address: description: >- Administrative email address for the tenant when not selecting an existing tenant - type: string + type: + - string + - 'null' format: email - nullable: true phone_prefix: description: >- Country code phone prefix with leading "+" sign when not selecting an existing tenant - type: string - nullable: true + type: + - string + - 'null' phone_number: description: >- Phone number for the tenant contact when not selecting an existing tenant - type: string - nullable: true + type: + - string + - 'null' locale: description: >- Locale to use for the tenant when not selecting an existing tenant - type: string + type: + - string + - 'null' enum: - it_IT - en_US - en_GB - nullable: true type: object additionalProperties: false type: object @@ -18160,15 +18850,17 @@ 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 - nullable: true + type: + - string + - 'null' 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 - nullable: true + type: + - string + - 'null' type: object additionalProperties: false type: object @@ -18521,11 +19213,13 @@ components: HostingBackupExposeRequest: properties: web_backup_id: - type: integer - nullable: true + type: + - integer + - 'null' db_backup_id: - type: integer - nullable: true + type: + - integer + - 'null' type: object HostingCronjobCreateRequest: properties: @@ -18539,31 +19233,38 @@ components: type: string default: GET plan_month: - type: string - nullable: true + type: + - string + - 'null' plan_monthday: - type: string - nullable: true + type: + - string + - 'null' plan_weekday: - type: string - nullable: true + type: + - string + - 'null' plan_hour: - type: string - nullable: true + type: + - string + - 'null' plan_minute: - type: string - nullable: true + type: + - string + - 'null' type: object HostingDatabaseCreateRequest: properties: database_name: description: Optional database name. - type: string - nullable: true + type: + - string + - 'null' name: description: Alias of database_name. - type: string - nullable: true + type: + - string + - 'null' type: object HostingEmailAliasCreateRequest: properties: @@ -18587,12 +19288,14 @@ components: HostingEmailWblistRequest: properties: domain: - type: string - nullable: true + type: + - string + - 'null' mailbox: - type: string + type: + - string + - 'null' format: email - nullable: true type: object HostingFileProtectionUpdateRequest: properties: @@ -18617,8 +19320,9 @@ components: rule_number: type: integer description: - type: string - nullable: true + type: + - string + - 'null' type: object HostingModSecurityUpdateRequest: properties: @@ -18643,8 +19347,9 @@ components: HostingSslCertificateInstallRequest: properties: ssl_certificate_id: - type: integer - nullable: true + type: + - integer + - 'null' destination_type: type: string default: web @@ -18679,24 +19384,35 @@ components: type: object OrderPayRequest: description: >- - Provide exactly one payment source: either set use_prepaid_credit to - true or specify a one_click_id. + 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. required: - order_ids properties: use_prepaid_credit: - description: Set to true to use available Prepaid Credit for the payment + 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: >- - Set to true to use One-Click payment methods. Payment will be - attempted using saved methods in priority order until one is - successfully authorized. + 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: >- - Identifier of the One-Click payment method to use. Use this if you - wish to use only one specific One-Click payment method. + 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: >- @@ -18707,13 +19423,6 @@ components: type: integer minItems: 1 type: object - oneOf: - - required: - - use_prepaid_credit - - required: - - use_one_click - - required: - - one_click_id PecMailboxOwnerChangeCreateRequest: required: - owner_id @@ -18871,8 +19580,9 @@ components: ServerIpAddressReverseUpdateRequest: properties: reverse_dns: - type: string - nullable: true + type: + - string + - 'null' type: object ServerMonitoringProbeCreateRequest: required: @@ -18925,76 +19635,60 @@ components: default: true type: object SmsCreateRequest: + description: >- + Sends an SMS. Recipients: provide exactly one of phone_numbers or + phonebooks, not both. Sender: required when quality is PREMIUM (from 2 + to 11 characters), ignored when quality is STANDARD. required: - message - quality + properties: + phone_numbers: + description: >- + SMS recipients (mutually exclusive). Provide exactly one of: + "phone_numbers" or "phonebooks". Collection of one or more phone + numbers in international format using the "00" prefix (digits only, + no spaces/separators). Example: 00393331122444. + type: array + items: + type: string + pattern: ^00[1-9]\d{6,14}$ + example: '00393331122444' + minItems: 1 + phonebooks: + description: >- + SMS recipients (mutually exclusive). Provide exactly one of: + "phone_numbers" or "phonebooks". Collection of one or more phonebook + IDs. + type: array + items: + type: integer + minItems: 1 + message: + description: >- + Text of the SMS you want to send. It can contain emojis, but keep in + mind that emojis take up more characters. GSM-7: max 160 chars (153 + per part if concatenated). Unicode (UCS-2): max 70 chars (67 per + part if concatenated). + type: string + quality: + description: SMS delivery quality. PREMIUM requires sender. + type: string + enum: + - STANDARD + - PREMIUM + sender: + description: >- + Sender name, from 2 to 11 characters. Required when quality is + PREMIUM, ignored when quality is STANDARD. + type: string + send_date: + description: >- + Date and time from which to send the SMS. If not specified, the SMS + is sent immediately. + type: string + format: date-time type: object - allOf: - - oneOf: - - required: - - phone_numbers - - required: - - phonebooks - - oneOf: - - properties: - quality: - type: string - enum: - - STANDARD - type: object - - required: - - sender - properties: - quality: - type: string - enum: - - PREMIUM - type: object - - properties: - phone_numbers: - description: >- - SMS recipients (mutually exclusive). Provide exactly one of: - "phone_numbers" or "phonebooks". Collection of one or more phone - numbers in international format using the "00" prefix (digits - only, no spaces/separators). Example: 00393331122444. - type: array - items: - type: string - pattern: ^00[1-9]\d{6,14}$ - example: '00393331122444' - minItems: 1 - phonebooks: - description: >- - SMS recipients (mutually exclusive). Provide exactly one of: - "phone_numbers" or "phonebooks". Collection of one or more - phonebook IDs. - type: array - items: - type: integer - minItems: 1 - message: - description: >- - Text of the SMS you want to send. It can contain emojis, but - keep in mind that emojis take up more characters. GSM-7: max 160 - chars (153 per part if concatenated). Unicode (UCS-2): max 70 - chars (67 per part if concatenated). - type: string - quality: - description: SMS delivery quality. - type: string - enum: - - STANDARD - - PREMIUM - sender: - description: Sender name. Required when "quality" is "PREMIUM". - type: string - send_date: - description: >- - Date and time from which to send the SMS. If not specified, the - SMS is sent immediately. - type: string - format: date-time - type: object SmsPhonebookAddContactsRequest: required: - phone_numbers @@ -19074,54 +19768,69 @@ components: SslCertificateOwnerRequest: properties: admin_title: - type: string - nullable: true + type: + - string + - 'null' admin_role: - type: string - nullable: true + type: + - string + - 'null' admin_first_name: - type: string - nullable: true + type: + - string + - 'null' admin_last_name: - type: string - nullable: true + type: + - string + - 'null' admin_email: - type: string + type: + - string + - 'null' format: email - nullable: true admin_organization: - type: string - nullable: true + type: + - string + - 'null' admin_phone_cc: - type: string - nullable: true + type: + - string + - 'null' admin_phone_number: - type: string - nullable: true + type: + - string + - 'null' admin_address: - type: string - nullable: true + type: + - string + - 'null' admin_city: - type: string - nullable: true + type: + - string + - 'null' admin_state: - type: string - nullable: true + type: + - string + - 'null' admin_postal_code: - type: string - nullable: true + type: + - string + - 'null' admin_country: - type: string - nullable: true + type: + - string + - 'null' type: object SslCertificateReemitRequest: properties: private_key: - type: string - nullable: true + type: + - string + - 'null' csr_key: - type: string - nullable: true + type: + - string + - 'null' type: object SubAccountCreateRequest: required: @@ -19181,8 +19890,9 @@ components: person_password: type: string username_alias: - type: string - nullable: true + type: + - string + - 'null' administrative_person_name: type: string administrative_person_surname: @@ -19226,6 +19936,31 @@ components: type: boolean type: object AccountBilling: + required: + - account_billing_id + - legal_entity + - tax_regime + - organization + - name + - surname + - address + - city + - state + - postal_code + - country + - gender + - birth_date + - birth_place + - phone + - vat_number + - is_vat_group + - fiscal_code + - edocument_pec + - edocument_code + - exporter_expiry + - exporter_number + - exporter_date + - is_split_payment properties: account_billing_id: type: integer @@ -19234,14 +19969,17 @@ components: tax_regime: $ref: '#/components/schemas/TaxRegime' organization: - type: string - nullable: true + type: + - string + - 'null' name: - type: string - nullable: true + type: + - string + - 'null' surname: - type: string - nullable: true + type: + - string + - 'null' address: type: string city: @@ -19253,77 +19991,112 @@ components: country: $ref: '#/components/schemas/Country' gender: - type: string - nullable: true + type: + - string + - 'null' birth_date: - type: string + type: + - string + - 'null' format: date - nullable: true birth_place: - type: string - nullable: true + type: + - string + - 'null' phone: type: string vat_number: - type: string - nullable: true + type: + - string + - 'null' is_vat_group: type: boolean fiscal_code: type: string edocument_pec: - type: string + type: + - string + - 'null' edocument_code: - type: string + type: + - string + - 'null' exporter_expiry: - type: string + type: + - string + - 'null' format: date - nullable: true exporter_number: - type: string - nullable: true + type: + - string + - 'null' exporter_date: - type: string + type: + - string + - 'null' format: date - nullable: true is_split_payment: type: boolean type: object Account: + required: + - account_id + - username + - username_alias + - account_name + - name + - surname + - email + - phone + - address + - city + - state + - postal_code + - country + - date_created properties: account_id: type: integer username: type: string username_alias: - type: string - nullable: true + type: + - string + - 'null' account_name: type: string name: - type: string - nullable: true + type: + - string + - 'null' surname: - type: string - nullable: true + type: + - string + - 'null' email: - type: string - nullable: true + type: + - string + - 'null' phone: - type: string - nullable: true + type: + - string + - 'null' address: - type: string - nullable: true + type: + - string + - 'null' city: - type: string - nullable: true + type: + - string + - 'null' state: - type: string - nullable: true + type: + - string + - 'null' postal_code: - type: string - nullable: true + type: + - string + - 'null' country: $ref: '#/components/schemas/Country' date_created: @@ -19331,6 +20104,9 @@ components: format: date-time type: object AmountSimple: + required: + - amount + - currency properties: amount: type: number @@ -19339,129 +20115,205 @@ components: type: string type: object Amount: + required: + - amount + - currency + - tax_rate + - tax + - total properties: amount: description: Taxable amount - type: number + type: + - number + - 'null' format: float currency: description: Currency (EUR, USD, GBP, ...) type: string tax_rate: description: VAT rate in cents (iva/vat) - type: number + type: + - number + - 'null' format: float - nullable: true tax: description: VAT (tax) amount - type: number + type: + - number + - 'null' format: float - nullable: true total: description: Total amount - type: number + type: + - number + - 'null' format: float - nullable: true type: object BillingData: + required: + - cig_value + - cup_value + - oda_value properties: cig_value: - type: string - nullable: true + type: + - string + - 'null' cup_value: - type: string - nullable: true + type: + - string + - 'null' oda_value: - type: string - nullable: true + type: + - string + - 'null' type: object CloudStorageAccess: + required: + - access_id + - cloud_storage_id + - hostname + - username properties: access_id: type: string cloud_storage_id: type: integer hostname: - type: string - nullable: true + type: + - string + - 'null' username: - type: string - nullable: true + type: + - string + - 'null' type: object CloudStorage: + required: + - cloud_storage_id + - purchase_id + - name + - read_write_host + - read_only_host + - app_host + - group_disk_used_bytes + - date_sync properties: cloud_storage_id: type: integer purchase_id: - type: integer - nullable: true + type: + - integer + - 'null' name: - type: string - nullable: true + type: + - string + - 'null' read_write_host: - type: string - nullable: true + type: + - string + - 'null' read_only_host: - type: string - nullable: true + type: + - string + - 'null' app_host: - type: string - nullable: true + type: + - string + - 'null' group_disk_used_bytes: - type: integer - nullable: true + type: + - integer + - 'null' date_sync: - type: string + type: + - string + - 'null' format: date-time - nullable: true type: object CloudStorageUser: + required: + - cloud_storage_user_id + - cloud_storage_id + - purchase_id + - type + - username + - password + - path + - soft_quota_gb + - hard_quota_gb + - used_space_bytes + - allocated_space_bytes + - grace_period_seconds + - last_alert + - active properties: cloud_storage_user_id: type: integer cloud_storage_id: type: integer purchase_id: - type: integer - nullable: true + type: + - integer + - 'null' type: - type: string - nullable: true + type: + - string + - 'null' username: - type: string - nullable: true + type: + - string + - 'null' password: - type: string - nullable: true + type: + - string + - 'null' path: - type: string - nullable: true + type: + - string + - 'null' soft_quota_gb: - type: number + type: + - number + - 'null' format: float - nullable: true hard_quota_gb: - type: number + type: + - number + - 'null' format: float - nullable: true used_space_bytes: - type: integer - nullable: true + type: + - integer + - 'null' allocated_space_bytes: - type: integer - nullable: true + type: + - integer + - 'null' grace_period_seconds: - type: integer - nullable: true + type: + - integer + - 'null' last_alert: - type: string + type: + - string + - 'null' format: date-time - nullable: true active: - type: boolean - nullable: true + type: + - boolean + - 'null' type: object Country: + required: + - iso_code_2 + - iso_code_3 + - country_name + - local_name + - phone_code + - continent + - region properties: iso_code_2: description: ie. IT @@ -19484,47 +20336,81 @@ components: 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 - nullable: true + type: + - integer + - 'null' service_name: - type: string - nullable: true + type: + - string + - 'null' purchase_name: - type: string - nullable: true + type: + - string + - 'null' license_ref: - type: string - nullable: true + type: + - string + - 'null' key_number: - type: string - nullable: true + type: + - string + - 'null' ip_address: - type: string - nullable: true + type: + - string + - 'null' is_els: type: boolean operative_system: - type: string - nullable: true + type: + - string + - 'null' purchase_status_code: - type: string - nullable: true + type: + - string + - 'null' date_activation: - type: string + type: + - string + - 'null' format: date - nullable: true date_expiry: - type: string + type: + - string + - 'null' format: date - nullable: true type: object CreditnoteRow: + required: + - creditnote_row_id + - creditnote_id + - invoice_row_id + - reason + - description + - amount + - billing_data + - date_start + - date_end properties: creditnote_row_id: type: integer @@ -19533,8 +20419,9 @@ components: invoice_row_id: type: integer reason: - type: string - nullable: true + type: + - string + - 'null' description: type: string amount: @@ -19542,15 +20429,33 @@ components: billing_data: $ref: '#/components/schemas/BillingData' date_start: - type: string + type: + - string + - 'null' format: date - nullable: true date_end: - type: string + type: + - string + - 'null' format: date - nullable: true type: object Creditnote: + required: + - creditnote_id + - invoice_id + - billing + - sdi_document_status + - sdi_document_type + - tax_regime + - date_emitted + - creditnote_year + - creditnote_number + - creditnote_caption + - sdi_identifier + - sdi_filename + - total_amount + - rows_count + - date_created properties: creditnote_id: type: integer @@ -19559,11 +20464,15 @@ components: billing: $ref: '#/components/schemas/AccountBilling' sdi_document_status: - $ref: '#/components/schemas/SdiDocumentStatus' + anyOf: + - $ref: '#/components/schemas/SdiDocumentStatus' + - type: 'null' sdi_document_type: $ref: '#/components/schemas/SdiDocumentType' tax_regime: - $ref: '#/components/schemas/TaxRegime' + anyOf: + - $ref: '#/components/schemas/TaxRegime' + - type: 'null' date_emitted: type: string format: date @@ -19572,8 +20481,9 @@ components: creditnote_number: type: string creditnote_caption: - type: string - nullable: true + type: + - string + - 'null' sdi_identifier: type: string sdi_filename: @@ -19587,30 +20497,58 @@ components: format: date-time type: object DnsRecordCaaData: + required: + - flag + - tag_value + - can_sign_http_exchanges properties: flag: - type: integer - nullable: true + type: + - integer + - 'null' tag_value: - type: string - nullable: true + type: + - string + - 'null' can_sign_http_exchanges: - type: boolean - nullable: true + type: + - boolean + - 'null' type: object DnsRecordTlsaData: + required: + - usage + - selector + - matching_type properties: usage: - type: string - nullable: true + type: + - string + - 'null' selector: - type: string - nullable: true + type: + - string + - 'null' matching_type: - type: string - nullable: true + type: + - string + - 'null' type: object DnsRecord: + required: + - record_id + - type + - host + - service + - protocol + - destination + - port + - weight + - priority + - ttl + - proxied + - caa_data + - tlsa_data properties: record_id: type: string @@ -19619,38 +20557,44 @@ components: host: type: string service: - type: string - nullable: true + type: + - string + - 'null' protocol: - type: string - nullable: true + type: + - string + - 'null' destination: type: string port: type: string weight: - type: integer - nullable: true + type: + - integer + - 'null' priority: - type: integer - nullable: true + type: + - integer + - 'null' ttl: - type: integer - nullable: true + type: + - integer + - 'null' proxied: type: boolean caa_data: - allOf: + anyOf: - $ref: '#/components/schemas/DnsRecordCaaData' - nullable: true - type: object + - type: 'null' tlsa_data: - allOf: + anyOf: - $ref: '#/components/schemas/DnsRecordTlsaData' - nullable: true - type: object + - type: 'null' type: object DnsType: + required: + - type_code + - type_name properties: type_code: type: string @@ -19658,6 +20602,11 @@ components: type: string type: object DnsZone: + required: + - zone_id + - zone_name + - nameservers + - ttl properties: zone_id: type: string @@ -19671,6 +20620,12 @@ components: type: integer type: object DnssecDsData: + required: + - zone_ttl + - key_tag + - key_algorithm + - digest_type + - digest_value properties: zone_ttl: type: integer @@ -19684,6 +20639,12 @@ components: type: string type: object DnssecKeyData: + required: + - zone_ttl + - flags + - key_protocol + - key_algorithm + - public_key properties: zone_ttl: type: integer @@ -19697,6 +20658,9 @@ components: type: string type: object DomainAvailability: + required: + - domain_name + - availability properties: domain_name: $ref: '#/components/schemas/DomainName' @@ -19704,6 +20668,11 @@ components: type: string type: object DomainCanChangeNameservers: + required: + - domain_id + - can_activate_standard + - can_activate_cloudflare + - can_activate_external properties: domain_id: type: integer @@ -19715,6 +20684,9 @@ components: type: boolean type: object DomainContactData: + required: + - data_field + - data_value properties: data_field: type: string @@ -19722,6 +20694,12 @@ components: type: string type: object DomainContact: + required: + - domain_contact_id + - domain_id + - type + - to_sync + - contact_data properties: domain_contact_id: type: integer @@ -19737,42 +20715,67 @@ components: $ref: '#/components/schemas/DomainContactData' type: object DomainData: + required: + - registry_status + - incoming_authcode + - outgoing_authcode + - registry_nameservers + - registry_expiry + - registry_created + - registry_updated + - registry_deletion + - date_deactivation + - identity_validation_status + - is_on_hold + - transfer_wrong_authcode + - transfer_locked + - date_created properties: registry_status: - type: string - nullable: true + type: + - string + - 'null' incoming_authcode: - type: string - nullable: true + type: + - string + - 'null' outgoing_authcode: - type: string - nullable: true + type: + - string + - 'null' registry_nameservers: - type: string - nullable: true + type: + - string + - 'null' registry_expiry: - type: string + type: + - string + - 'null' format: date-time - nullable: true registry_created: - type: string + type: + - string + - 'null' format: date-time - nullable: true registry_updated: - type: string + type: + - string + - 'null' format: date-time - nullable: true registry_deletion: - type: string + type: + - string + - 'null' format: date-time - nullable: true date_deactivation: - type: string + type: + - string + - 'null' format: date-time - nullable: true identity_validation_status: - type: string - nullable: true + type: + - string + - 'null' is_on_hold: type: boolean transfer_wrong_authcode: @@ -19784,6 +20787,9 @@ components: format: date-time type: object DomainDnssecCanActivate: + required: + - domain_id + - can_active properties: domain_id: type: integer @@ -19791,6 +20797,9 @@ components: type: boolean type: object DomainDnssecCanDeactivate: + required: + - domain_id + - can_deactivate properties: domain_id: type: integer @@ -19798,6 +20807,9 @@ components: type: boolean type: object DomainDnssec: + required: + - ds_data + - key_data properties: ds_data: type: array @@ -19809,27 +20821,53 @@ components: $ref: '#/components/schemas/DnssecKeyData' type: object DomainName: + required: + - unicode + - punycode + - unicode_name + - punycode_name + - unicode_tld + - punycode_tld properties: unicode: - type: string - nullable: true + type: + - string + - 'null' punycode: - type: string - nullable: true + type: + - string + - 'null' unicode_name: - type: string - nullable: true + type: + - string + - 'null' punycode_name: - type: string - nullable: true + type: + - string + - 'null' unicode_tld: - type: string - nullable: true + type: + - string + - 'null' punycode_tld: - type: string - nullable: true + type: + - string + - 'null' type: object Domain: + 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 @@ -19840,134 +20878,210 @@ components: dns_type: $ref: '#/components/schemas/DnsType' dns_account: - type: string - nullable: true + type: + - string + - 'null' nameservers: type: array items: type: string domain_data: - allOf: + anyOf: - $ref: '#/components/schemas/DomainData' - nullable: true - type: object + - type: 'null' contacts_count: type: integer dnssec_enabled: type: boolean date_info_last: - type: string + type: + - string + - 'null' format: date-time - nullable: true date_dns_check: - type: string + type: + - string + - 'null' format: date-time - nullable: true vanity_nameserver_enabled: type: boolean type: object HostingAntivirusRemovalScan: - properties: - removal_scan_id: + required: + - removal_scan_id + - hosting_id + - task_id + - status + - error + - date_created + properties: + removal_scan_id: type: integer hosting_id: type: integer task_id: - type: integer - nullable: true + type: + - integer + - 'null' status: - type: boolean - nullable: true + type: + - boolean + - 'null' error: - type: string - nullable: true + type: + - string + - 'null' date_created: type: string format: date-time type: object HostingAntivirusScan: + required: + - antivirus_id + - hosting_id + - status_code + - status_name + - status_color + - antivirus_type + - scan_id + - date_started + - date_completed + - date_timeout + - date_created + - total_files + - total_infected + - total_cleaned properties: antivirus_id: type: integer hosting_id: type: integer status_code: - type: string + type: + - string + - 'null' status_name: - type: string - nullable: true + type: + - string + - 'null' status_color: - type: string - nullable: true + type: + - string + - 'null' antivirus_type: type: string scan_id: - type: string - nullable: true + type: + - string + - 'null' date_started: - type: string + type: + - string + - 'null' format: date-time - nullable: true date_completed: - type: string + type: + - string + - 'null' format: date-time - nullable: true date_timeout: - type: string + type: + - string + - 'null' format: date-time - nullable: true date_created: type: string format: date-time total_files: - type: integer - nullable: true + type: + - integer + - 'null' total_infected: - type: integer - nullable: true + type: + - integer + - 'null' total_cleaned: - type: integer - nullable: true + type: + - integer + - 'null' type: object HostingAntivirus: + required: + - antivirus_id + - hosting_id + - status_code + - status_name + - status_color + - antivirus_type + - date_started + - date_completed + - date_timeout + - total_files + - total_infected + - total_cleaned properties: antivirus_id: type: integer hosting_id: type: integer status_code: - type: string + type: + - string + - 'null' status_name: - type: string - nullable: true + type: + - string + - 'null' status_color: - type: string - nullable: true + type: + - string + - 'null' antivirus_type: type: string date_started: - type: string + type: + - string + - 'null' format: date-time - nullable: true date_completed: - type: string + type: + - string + - 'null' format: date-time - nullable: true date_timeout: - type: string + type: + - string + - 'null' format: date-time - nullable: true total_files: - type: integer - nullable: true + type: + - integer + - 'null' total_infected: - type: integer - nullable: true + type: + - integer + - 'null' total_cleaned: - type: integer - nullable: true + type: + - integer + - 'null' type: object HostingBackup: + required: + - hosting_backup_id + - hosting_id + - backup_id + - category + - backup_type_code + - backup_frequency_code + - backup_date + - backup_size + - backup_duration + - exit_status + - error_type + - mailbox_name + - database_name + - date_created properties: hosting_backup_id: type: integer @@ -19976,42 +21090,60 @@ components: backup_id: type: integer category: - type: string - nullable: true + type: + - string + - 'null' backup_type_code: - type: string - nullable: true + type: + - string + - 'null' backup_frequency_code: - type: string - nullable: true + type: + - string + - 'null' backup_date: - type: string + type: + - string + - 'null' format: date-time - nullable: true backup_size: - type: integer - nullable: true + type: + - integer + - 'null' backup_duration: - type: string - nullable: true + type: + - string + - 'null' exit_status: - type: integer - nullable: true + type: + - integer + - 'null' error_type: - type: string - nullable: true + type: + - string + - 'null' mailbox_name: - type: string - nullable: true + type: + - string + - 'null' database_name: - type: string - nullable: true + type: + - string + - 'null' date_created: - type: string + type: + - string + - 'null' format: date-time - nullable: true type: object HostingCredential: + required: + - credential_id + - type + - username + - password + - root_path + - is_active properties: credential_id: type: integer @@ -20022,12 +21154,27 @@ components: password: type: string root_path: - type: string - nullable: true + type: + - string + - 'null' is_active: type: boolean type: object HostingCronjob: + required: + - cronjob_id + - hosting_id + - purchase_id + - request_url + - http_request_method + - plan_month + - plan_monthday + - plan_weekday + - plan_hour + - plan_minute + - active + - date_created + - date_disabled properties: cronjob_id: type: integer @@ -20038,35 +21185,51 @@ components: request_url: type: string http_request_method: - type: string - nullable: true + type: + - string + - 'null' plan_month: - type: string - nullable: true + type: + - string + - 'null' plan_monthday: - type: string - nullable: true + type: + - string + - 'null' plan_weekday: - type: string - nullable: true + type: + - string + - 'null' plan_hour: - type: string - nullable: true + type: + - string + - 'null' plan_minute: - type: string - nullable: true + type: + - string + - 'null' active: type: boolean date_created: - type: string + type: + - string + - 'null' format: date-time - nullable: true date_disabled: - type: string + type: + - string + - 'null' format: date-time - nullable: true type: object HostingDatabase: + required: + - database_id + - name + - type + - credential_id + - username + - supplier_code + - table_count properties: database_id: type: string @@ -20075,19 +21238,39 @@ components: type: type: string credential_id: - type: integer - nullable: true + type: + - integer + - 'null' username: - type: string - nullable: true + type: + - string + - 'null' supplier_code: - type: string - nullable: true + type: + - string + - 'null' table_count: - type: integer - nullable: true + type: + - integer + - 'null' type: object HostingDnsRecord: + required: + - dns_record_id + - type + - host + - destination + - priority + - weight + - port + - service + - protocol + - caa_flag + - caa_tag + - caa_can_sign_http_exchanges + - tlsa_usage + - tlsa_selector + - tlsa_matching_type properties: dns_record_id: type: integer @@ -20098,40 +21281,61 @@ components: destination: type: string priority: - type: integer - nullable: true + type: + - integer + - 'null' weight: - type: integer - nullable: true + type: + - integer + - 'null' port: - type: integer - nullable: true + type: + - integer + - 'null' service: - type: string - nullable: true + type: + - string + - 'null' protocol: - type: string - nullable: true + type: + - string + - 'null' caa_flag: - type: integer - nullable: true + type: + - integer + - 'null' caa_tag: - type: string - nullable: true + type: + - string + - 'null' caa_can_sign_http_exchanges: - type: boolean - nullable: true + type: + - boolean + - 'null' tlsa_usage: - type: string - nullable: true + type: + - string + - 'null' tlsa_selector: - type: string - nullable: true + type: + - string + - 'null' tlsa_matching_type: - type: string - nullable: true + type: + - string + - 'null' type: object HostingEmailAlias: + required: + - alias_id + - address + - address_idna + - goto + - goto_idna + - domain + - domain_idna + - is_active + - does_exist properties: alias_id: type: string @@ -20140,11 +21344,13 @@ components: address_idna: type: string goto: - type: string - nullable: true + type: + - string + - 'null' goto_idna: - type: string - nullable: true + type: + - string + - 'null' domain: type: string domain_idna: @@ -20155,6 +21361,12 @@ components: type: boolean type: object HostingEmailAllowList: + required: + - allow_list_id + - hosting_id + - sender + - domain + - mailbox properties: allow_list_id: type: integer @@ -20163,14 +21375,22 @@ components: sender: type: string domain: - type: string - nullable: true + type: + - string + - 'null' mailbox: - type: string + type: + - string + - 'null' format: email - nullable: true type: object HostingEmailBlocList: + required: + - block_list_id + - hosting_id + - sender + - domain + - mailbox properties: block_list_id: type: integer @@ -20179,14 +21399,21 @@ components: sender: type: string domain: - type: string - nullable: true + type: + - string + - 'null' mailbox: - type: string + type: + - string + - 'null' format: email - nullable: true type: object HostingEmailCatchAll: + required: + - is_active + - address + - address_idna + - destinations properties: is_active: type: boolean @@ -20201,6 +21428,12 @@ components: format: email type: object HostingModSecurityRule: + required: + - rule_id + - hosting_id + - rule_number + - description + - included properties: rule_id: type: integer @@ -20209,12 +21442,20 @@ components: rule_number: type: string description: - type: string - nullable: true + type: + - string + - 'null' included: type: boolean type: object HostingModSecurityScan: + required: + - scan_id + - hosting_id + - date_created + - error + - rules_found + - rules_excluded properties: scan_id: type: integer @@ -20224,14 +21465,23 @@ components: type: string format: date-time error: - type: string - nullable: true + type: + - string + - 'null' rules_found: type: integer rules_excluded: type: integer type: object HostingModSecurity: + required: + - hosting_id + - is_available + - is_active + - firewall_compatible + - full_strict + - custom_rules + - custom_set properties: hosting_id: type: integer @@ -20242,20 +21492,27 @@ components: firewall_compatible: type: boolean full_strict: - type: boolean - nullable: true + type: + - boolean + - 'null' custom_rules: - type: array + type: + - array + - 'null' items: type: string - nullable: true custom_set: - type: array + type: + - array + - 'null' items: type: string - nullable: true type: object HostingPhpVersion: + required: + - version + - is_current + - is_default properties: version: type: string @@ -20265,92 +21522,153 @@ components: type: boolean type: object HostingSslCertificate: + required: + - hosting_ssl_certificate_id + - hosting_id + - ssl_certificate_id + - lets_encrypt_id + - external_certificate_id + - cn_type + - installation_date + - https_rewrite + - destination_type properties: hosting_ssl_certificate_id: type: integer hosting_id: type: integer ssl_certificate_id: - type: integer - nullable: true + type: + - integer + - 'null' lets_encrypt_id: - type: integer - nullable: true + type: + - integer + - 'null' external_certificate_id: - type: integer - nullable: true + type: + - integer + - 'null' cn_type: - type: string - nullable: true + type: + - string + - 'null' installation_date: - type: string + type: + - string + - 'null' format: date-time - nullable: true https_rewrite: - type: boolean - nullable: true + type: + - boolean + - 'null' destination_type: - type: string - nullable: true + type: + - string + - 'null' type: object Hosting: + required: + - hosting_id + - purchase_id + - parent_hosting_id + - is_primary + - host_name + - host_name_idna + - full_name + - full_name_idna + - domain_full_name + - domain_full_name_idna + - php_version + - is_active properties: hosting_id: type: integer purchase_id: - type: integer - nullable: true + type: + - integer + - 'null' parent_hosting_id: - type: integer - nullable: true + type: + - integer + - 'null' is_primary: type: boolean host_name: - type: string - nullable: true + type: + - string + - 'null' host_name_idna: - type: string - nullable: true + type: + - string + - 'null' full_name: - type: string - nullable: true + type: + - string + - 'null' full_name_idna: - type: string - nullable: true + type: + - string + - 'null' domain_full_name: - type: string - nullable: true + type: + - string + - 'null' domain_full_name_idna: - type: string - nullable: true + type: + - string + - 'null' php_version: - type: string - nullable: true + type: + - string + - 'null' is_active: type: boolean type: object InvoiceRow: + required: + - invoice_row_id + - invoice_id + - invoice_id_deposit + - service + - purchase + - description + - unit_description + - unit_quantity + - unit_amount + - amount + - billing_data + - is_recurring + - date_start + - date_end properties: invoice_row_id: type: integer invoice_id: type: integer invoice_id_deposit: - type: integer - nullable: true + type: + - integer + - 'null' service: - $ref: '#/components/schemas/Service' + anyOf: + - $ref: '#/components/schemas/Service' + - type: 'null' purchase: - $ref: '#/components/schemas/Purchase' + anyOf: + - $ref: '#/components/schemas/Purchase' + - type: 'null' description: type: string unit_description: - type: string - nullable: true + type: + - string + - 'null' unit_quantity: - type: number + type: + - number + - 'null' format: float - nullable: true unit_amount: $ref: '#/components/schemas/Amount' amount: @@ -20360,33 +21678,54 @@ components: is_recurring: type: boolean date_start: - type: string + type: + - string + - 'null' format: date - nullable: true date_end: - type: string + type: + - string + - 'null' format: date - nullable: true type: object Invoice: + required: + - invoice_id + - billing + - type + - sdi_document_status + - sdi_document_type + - date_emitted + - invoice_year + - invoice_number + - invoice_caption + - invoice_caption_additional + - payed + - sdi_identifier + - sdi_filename + - total_amount + - amount_no_balance + - payment_amount + - orders + - rows_count + - date_created properties: invoice_id: type: integer billing: $ref: '#/components/schemas/AccountBilling' type: - type: string - nullable: true + type: + - string + - 'null' sdi_document_status: - allOf: + anyOf: - $ref: '#/components/schemas/SdiDocumentStatus' - nullable: true - type: object + - type: 'null' sdi_document_type: - allOf: + anyOf: - $ref: '#/components/schemas/SdiDocumentType' - nullable: true - type: object + - type: 'null' date_emitted: type: string format: date @@ -20395,19 +21734,23 @@ components: invoice_number: type: string invoice_caption: - type: string - nullable: true + type: + - string + - 'null' invoice_caption_additional: - type: string - nullable: true + type: + - string + - 'null' payed: type: boolean sdi_identifier: - type: string - nullable: true + type: + - string + - 'null' sdi_filename: - type: string - nullable: true + type: + - string + - 'null' total_amount: $ref: '#/components/schemas/Amount' amount_no_balance: @@ -20425,23 +21768,38 @@ components: format: date-time type: object IpAddress: + required: + - ip_address_id + - server_id + - ip_address + - reverse_dns + - reverse_dns_external + - mac_address + - blocked_for_spam + - active + - available + - date_created properties: ip_address_id: type: integer server_id: - type: integer - nullable: true + type: + - integer + - 'null' ip_address: type: string reverse_dns: - type: string - nullable: true + type: + - string + - 'null' reverse_dns_external: - type: string - nullable: true + type: + - string + - 'null' mac_address: - type: string - nullable: true + type: + - string + - 'null' blocked_for_spam: type: boolean active: @@ -20449,11 +21807,15 @@ components: available: type: boolean date_created: - type: string + type: + - string + - 'null' format: date-time - nullable: true type: object LegalEntityGroup: + required: + - group_code + - group_name properties: group_code: type: string @@ -20461,6 +21823,11 @@ components: type: string type: object LegalEntity: + required: + - legal_entity_group + - tax_regime + - entity_code + - entity_name properties: legal_entity_group: $ref: '#/components/schemas/LegalEntityGroup' @@ -20472,6 +21839,11 @@ components: type: string type: object Microsoft365DomainAvailable: + required: + - domain_prefix + - microsoft_domain + - available + - microsoft_uuid properties: domain_prefix: description: Requested tenant domain prefix @@ -20484,39 +21856,65 @@ components: type: boolean microsoft_uuid: description: Microsoft tenant UUID if available - type: string - nullable: true + type: + - string + - 'null' type: object Microsoft365: + required: + - microsoft365_id + - purchase_id + - tenant_id + - service_name + - purchase_name + - supplier_code + - supplier_status + - order_code + - order_reference + - order_status + - order_need_submit + - autorenew_enabled + - is_trial + - subscription_activation_date + - subscription_expiry_date + - tenant properties: microsoft365_id: type: integer purchase_id: type: integer tenant_id: - type: integer - nullable: true + type: + - integer + - 'null' service_name: - type: string - nullable: true + type: + - string + - 'null' purchase_name: - type: string - nullable: true + type: + - string + - 'null' supplier_code: - type: string - nullable: true + type: + - string + - 'null' supplier_status: - type: string - nullable: true + type: + - string + - 'null' order_code: - type: string - nullable: true + type: + - string + - 'null' order_reference: - type: string - nullable: true + type: + - string + - 'null' order_status: - type: string - nullable: true + type: + - string + - 'null' order_need_submit: type: boolean autorenew_enabled: @@ -20524,94 +21922,143 @@ components: is_trial: type: boolean subscription_activation_date: - type: string + type: + - string + - 'null' format: date - nullable: true subscription_expiry_date: - type: string + type: + - string + - 'null' format: date - nullable: true tenant: - allOf: + anyOf: - $ref: '#/components/schemas/Microsoft365Tenant' - nullable: true - type: object + - type: 'null' type: object Microsoft365PartnerLink: + required: + - partner_link properties: partner_link: type: string - nullable: false type: object Microsoft365Tenant: + required: + - tenant_id + - microsoft_uuid + - domain_prefix + - microsoft_domain + - imported + - first_name + - last_name + - country + - company_name + - address + - city + - state + - postal_code + - email_address + - phone_prefix + - phone_number + - locale + - account_login + - mca_compliant + - mca_sign_date + - mca_template_id + - mca_error properties: tenant_id: type: integer microsoft_uuid: - type: string - nullable: true + type: + - string + - 'null' domain_prefix: - type: string - nullable: true + type: + - string + - 'null' microsoft_domain: - type: string - nullable: true + type: + - string + - 'null' imported: type: boolean first_name: - type: string - nullable: true + type: + - string + - 'null' last_name: - type: string - nullable: true + type: + - string + - 'null' country: - type: string - nullable: true + type: + - string + - 'null' company_name: - type: string - nullable: true + type: + - string + - 'null' address: - type: string - nullable: true + type: + - string + - 'null' city: - type: string - nullable: true + type: + - string + - 'null' state: - type: string - nullable: true + type: + - string + - 'null' postal_code: - type: string - nullable: true + type: + - string + - 'null' email_address: - type: string + type: + - string + - 'null' format: email - nullable: true phone_prefix: - type: string - nullable: true + type: + - string + - 'null' phone_number: - type: string - nullable: true + type: + - string + - 'null' locale: - type: string - nullable: true + type: + - string + - 'null' account_login: - type: string - nullable: true + type: + - string + - 'null' mca_compliant: type: boolean mca_sign_date: - type: string + type: + - string + - 'null' format: date-time - nullable: true mca_template_id: - type: string - nullable: true + type: + - string + - 'null' mca_error: - type: string - nullable: true + type: + - string + - 'null' type: object ObjectStorageBucketChart: + required: + - object_storage_id + - bucket_id + - interval + - points properties: object_storage_id: type: integer @@ -20649,6 +22096,13 @@ components: type: object type: object ObjectStorageBucketFirewallEntry: + required: + - entry_id + - object_storage_id + - bucket_id + - ip + - active + - date_created properties: entry_id: type: integer @@ -20657,89 +22111,146 @@ components: bucket_id: type: integer ip: - type: string - nullable: true + type: + - string + - 'null' active: - type: boolean - nullable: true + type: + - boolean + - 'null' date_created: - type: string + type: + - string + - 'null' format: date-time - nullable: true type: object ObjectStorageBucket: + required: + - bucket_id + - object_storage_id + - sub_account_id + - region_id + - bucket_remote_id + - code + - code_full + - bucket_number + - name + - versioning + - creation_date + - arn + - policy_json + - active_storage_bytes + - deleted_storage_bytes + - active_objects + - deleted_objects + - api_calls_count + - storage_wrote_bytes + - storage_read_bytes + - egress_traffic_bytes + - ingress_traffic_bytes + - reference_date properties: bucket_id: type: integer object_storage_id: type: integer sub_account_id: - type: integer - nullable: true + type: + - integer + - 'null' region_id: - type: integer - nullable: true + type: + - integer + - 'null' bucket_remote_id: - type: integer - nullable: true + type: + - integer + - 'null' code: - type: string - nullable: true + type: + - string + - 'null' code_full: - type: string - nullable: true + type: + - string + - 'null' bucket_number: - type: string - nullable: true + type: + - string + - 'null' name: - type: string - nullable: true + type: + - string + - 'null' versioning: - type: string - nullable: true + type: + - string + - 'null' creation_date: - type: string + type: + - string + - 'null' format: date-time - nullable: true arn: - type: string - nullable: true + type: + - string + - 'null' policy_json: - type: string - nullable: true + type: + - string + - 'null' active_storage_bytes: - type: integer - nullable: true + type: + - integer + - 'null' deleted_storage_bytes: - type: integer - nullable: true + type: + - integer + - 'null' active_objects: - type: integer - nullable: true + type: + - integer + - 'null' deleted_objects: - type: integer - nullable: true + type: + - integer + - 'null' api_calls_count: - type: integer - nullable: true + type: + - integer + - 'null' storage_wrote_bytes: - type: integer - nullable: true + type: + - integer + - 'null' storage_read_bytes: - type: integer - nullable: true + type: + - integer + - 'null' egress_traffic_bytes: - type: integer - nullable: true + type: + - integer + - 'null' ingress_traffic_bytes: - type: integer - nullable: true + type: + - integer + - 'null' reference_date: - type: string + type: + - string + - 'null' format: date - nullable: true type: object ObjectStorageIamUserS3Key: + required: + - s3_key_id + - object_storage_id + - iam_user_id + - access_key + - secret_key + - status + - active + - date_created properties: s3_key_id: type: integer @@ -20748,23 +22259,39 @@ components: iam_user_id: type: integer access_key: - type: string - nullable: true + type: + - string + - 'null' secret_key: - type: string - nullable: true + type: + - string + - 'null' status: - type: string - nullable: true + type: + - string + - 'null' active: - type: boolean - nullable: true + type: + - boolean + - 'null' date_created: - type: string + type: + - string + - 'null' format: date-time - nullable: true type: object ObjectStorageIamUser: + required: + - iam_user_id + - object_storage_id + - sub_account_id + - code + - code_full + - iam_id + - arn + - active + - firewall_policy + - date_created properties: iam_user_id: type: integer @@ -20773,105 +22300,161 @@ components: sub_account_id: type: integer code: - type: string - nullable: true + type: + - string + - 'null' code_full: - type: string - nullable: true + type: + - string + - 'null' iam_id: - type: string - nullable: true + type: + - string + - 'null' arn: - type: string - nullable: true + type: + - string + - 'null' active: - type: boolean - nullable: true + type: + - boolean + - 'null' firewall_policy: - type: string - nullable: true + type: + - string + - 'null' date_created: - type: string + type: + - string + - 'null' format: date-time - nullable: true type: object ObjectStorageS3Key: + required: + - object_storage_id + - sub_account_id + - username + - user_id + - arn + - access_key + - secret_key properties: object_storage_id: type: integer sub_account_id: type: integer username: - type: string - nullable: true + type: + - string + - 'null' user_id: - type: string - nullable: true + type: + - string + - 'null' arn: - type: string - nullable: true + type: + - string + - 'null' access_key: - type: string - nullable: true + type: + - string + - 'null' secret_key: - type: string - nullable: true + type: + - string + - 'null' type: object ObjectStorage: + required: + - object_storage_id + - purchase_id + - name + - email + - code + - code_full + - active + - active_storage_bytes + - deleted_storage_bytes + - active_objects + - deleted_objects + - api_calls_count + - storage_wrote_bytes + - storage_read_bytes + - egress_traffic_bytes + - ingress_traffic_bytes + - reference_date properties: object_storage_id: type: integer purchase_id: - type: integer - nullable: true + type: + - integer + - 'null' name: - type: string - nullable: true + type: + - string + - 'null' email: - type: string - nullable: true + type: + - string + - 'null' code: - type: string - nullable: true + type: + - string + - 'null' code_full: - type: string - nullable: true + type: + - string + - 'null' active: - type: boolean - nullable: true + type: + - boolean + - 'null' active_storage_bytes: - type: integer - nullable: true + type: + - integer + - 'null' deleted_storage_bytes: - type: integer - nullable: true + type: + - integer + - 'null' active_objects: - type: integer - nullable: true + type: + - integer + - 'null' deleted_objects: - type: integer - nullable: true + type: + - integer + - 'null' api_calls_count: - type: integer - nullable: true + type: + - integer + - 'null' storage_wrote_bytes: - type: integer - nullable: true + type: + - integer + - 'null' storage_read_bytes: - type: integer - nullable: true + type: + - integer + - 'null' egress_traffic_bytes: - type: integer - nullable: true + type: + - integer + - 'null' ingress_traffic_bytes: - type: integer - nullable: true + type: + - integer + - 'null' reference_date: - type: string + type: + - string + - 'null' format: date - nullable: true type: object OneClickAutorenew: + required: + - one_click_preference properties: one_click_preference: type: array @@ -20879,6 +22462,14 @@ components: $ref: '#/components/schemas/OneClick' type: object OneClick: + required: + - one_click_id + - payment_method + - description + - method_type + - creditcard_pan + - date_expiry + - date_created properties: one_click_id: type: integer @@ -20887,15 +22478,18 @@ components: description: type: string method_type: - type: string - nullable: true + type: + - string + - 'null' creditcard_pan: - type: string - nullable: true + type: + - string + - 'null' date_expiry: - type: string + type: + - string + - 'null' format: date - nullable: true date_created: type: string format: date-time @@ -20905,6 +22499,9 @@ components: $ref: '#/components/schemas/OneClick' type: object OrderCanCancel: + required: + - order_id + - can_cancel properties: order_id: type: integer @@ -20912,6 +22509,9 @@ components: type: boolean type: object OrderCanPay: + required: + - order_id + - can_pay properties: order_id: type: integer @@ -20925,6 +22525,9 @@ components: type: boolean type: object OrderInvoiceStatus: + required: + - status_code + - status_name properties: status_code: type: string @@ -20932,6 +22535,9 @@ components: type: string type: object OrderPaymentStatus: + required: + - status_code + - status_name properties: status_code: type: string @@ -20939,26 +22545,40 @@ components: type: string type: object OrderRow: + required: + - order_row_id + - order_id + - service + - purchase + - recurrence + - price + - base_price properties: order_row_id: type: integer order_id: type: integer service: - type: integer - nullable: true + type: + - integer + - 'null' purchase: - type: integer - nullable: true + type: + - integer + - 'null' recurrence: - type: integer - nullable: true + type: + - integer + - 'null' price: $ref: '#/components/schemas/Amount' base_price: $ref: '#/components/schemas/Amount' type: object OrderStatus: + required: + - status_code + - status_name properties: status_code: type: string @@ -20966,6 +22586,24 @@ components: type: string type: object Order: + required: + - order_id + - type + - status + - payment_status + - invoice_status + - invoice + - billing + - intent_type + - date_payed + - date_confirmed + - payed + - total_amount + - payment_amount + - origin + - promotions + - rows_count + - date_created properties: order_id: type: integer @@ -20978,22 +22616,23 @@ components: invoice_status: $ref: '#/components/schemas/OrderInvoiceStatus' invoice: - allOf: + anyOf: - $ref: '#/components/schemas/Invoice' - nullable: true - type: object + - type: 'null' billing: $ref: '#/components/schemas/AccountBilling' intent_type: type: string date_payed: - type: string + type: + - string + - 'null' format: date - nullable: true date_confirmed: - type: string + type: + - string + - 'null' format: date-time - nullable: true payed: type: boolean total_amount: @@ -21013,6 +22652,16 @@ components: format: date-time type: object Payment: + required: + - payment_id + - payment_method + - payment_code + - amount_total + - amount_payed + - date_payment + - payed + - prepaid_credit_operations + - provider_data properties: payment_id: type: integer @@ -21025,9 +22674,10 @@ components: amount_payed: $ref: '#/components/schemas/AmountSimple' date_payment: - type: string + type: + - string + - 'null' format: date-time - nullable: true payed: type: boolean prepaid_credit_operations: @@ -21035,31 +22685,51 @@ components: items: $ref: '#/components/schemas/PrepaidCreditOperation' provider_data: - type: object - nullable: true + type: + - object + - 'null' type: object PecDomain: + required: + - pec_domain_id + - purchase_id + - purchase_name + - purchase_status_code + - purchase_pec_owner_id + - domain + - provider_domain_id + - transfer_in + - force_decertify_domain + - aruba_public + - shellrent_public + - can_require_owner_change properties: pec_domain_id: type: integer purchase_id: - type: integer - nullable: true + type: + - integer + - 'null' purchase_name: - type: string - nullable: true + type: + - string + - 'null' purchase_status_code: - type: string - nullable: true + type: + - string + - 'null' purchase_pec_owner_id: - type: integer - nullable: true + type: + - integer + - 'null' domain: - type: string - nullable: true + type: + - string + - 'null' provider_domain_id: - type: string - nullable: true + type: + - string + - 'null' transfer_in: type: boolean force_decertify_domain: @@ -21072,34 +22742,59 @@ components: type: boolean type: object PecOwnerChange: + required: + - owner_change_id + - pec_id + - pec_domain_id + - status_code + - rejection_reason + - submission_date + - acceptance_date + - rejection_date + - has_identity_document + - has_contract_document + - has_order_module_document + - person_id_accept + - person_id_reject + - owner_old + - owner_new + - date_created properties: owner_change_id: - type: integer - nullable: true + type: + - integer + - 'null' pec_id: - type: integer - nullable: true + type: + - integer + - 'null' pec_domain_id: - type: integer - nullable: true + type: + - integer + - 'null' status_code: - type: string - nullable: true + type: + - string + - 'null' rejection_reason: - type: string - nullable: true + type: + - string + - 'null' submission_date: - type: string + type: + - string + - 'null' format: date-time - nullable: true acceptance_date: - type: string + type: + - string + - 'null' format: date-time - nullable: true rejection_date: - type: string + type: + - string + - 'null' format: date-time - nullable: true has_identity_document: type: boolean has_contract_document: @@ -21107,98 +22802,153 @@ components: has_order_module_document: type: boolean person_id_accept: - type: integer - nullable: true + type: + - integer + - 'null' person_id_reject: - type: integer - nullable: true + type: + - integer + - 'null' owner_old: $ref: '#/components/schemas/PecOwnerSummary' owner_new: $ref: '#/components/schemas/PecOwnerSummary' date_created: - type: string + type: + - string + - 'null' format: date-time - nullable: true type: object PecOwnerSummary: + required: + - pec_owner_id + - owner_legal_entity_type + - admin_first_name + - admin_last_name + - admin_email + - admin_fiscal_code + - admin_vat_number + - company_name + - company_email + - company_fiscal_code properties: pec_owner_id: - type: integer - nullable: true + type: + - integer + - 'null' owner_legal_entity_type: - type: string - nullable: true + type: + - string + - 'null' admin_first_name: - type: string - nullable: true + type: + - string + - 'null' admin_last_name: - type: string - nullable: true + type: + - string + - 'null' admin_email: - type: string - nullable: true + type: + - string + - 'null' admin_fiscal_code: - type: string - nullable: true + type: + - string + - 'null' admin_vat_number: - type: string - nullable: true + type: + - string + - 'null' company_name: - type: string - nullable: true + type: + - string + - 'null' company_email: - type: string - nullable: true + type: + - string + - 'null' company_fiscal_code: - type: string - nullable: true + type: + - string + - 'null' type: object Pec: + required: + - pec_id + - purchase_id + - purchase_name + - purchase_status_code + - box_name + - full_box_name + - domain + - report_email + - report_sms + - password_recovery_email + - inbox_usage + - archive_usage + - extra_inbox + - extra_archive + - transfer_in + - owner_not_assignable + - password_wrong properties: pec_id: type: integer purchase_id: - type: integer - nullable: true + type: + - integer + - 'null' purchase_name: - type: string - nullable: true + type: + - string + - 'null' purchase_status_code: - type: string - nullable: true + type: + - string + - 'null' box_name: - type: string - nullable: true + type: + - string + - 'null' full_box_name: - type: string - nullable: true + type: + - string + - 'null' domain: - type: string - nullable: true + type: + - string + - 'null' report_email: - type: string - nullable: true + type: + - string + - 'null' report_sms: - type: string - nullable: true + type: + - string + - 'null' password_recovery_email: - type: string - nullable: true + type: + - string + - 'null' inbox_usage: - type: number + type: + - number + - 'null' format: float - nullable: true archive_usage: - type: number + type: + - number + - 'null' format: float - nullable: true extra_inbox: - type: integer - nullable: true + type: + - integer + - 'null' extra_archive: - type: integer - nullable: true + type: + - integer + - 'null' transfer_in: type: boolean owner_not_assignable: @@ -21207,53 +22957,85 @@ components: 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 - nullable: true + type: + - integer + - 'null' service_name: - type: string - nullable: true + type: + - string + - 'null' purchase_name: - type: string - nullable: true + type: + - string + - 'null' license_ref: - type: string - nullable: true + type: + - string + - 'null' key_number: - type: string - nullable: true + type: + - string + - 'null' ip_address: - type: string - nullable: true + type: + - string + - 'null' is_els: type: boolean operative_system: - type: string - nullable: true + type: + - string + - 'null' purchase_status_code: - type: string - nullable: true + type: + - string + - 'null' date_activation: - type: string + type: + - string + - 'null' format: date - nullable: true date_expiry: - type: string + type: + - string + - 'null' format: date - nullable: true type: object PrepaidCreditOperation: + required: + - operation_id + - operation_id_related + - prepaid_credit_topup + - operation_type + - amount + - date_created properties: operation_id: type: integer operation_id_related: - type: integer - nullable: true + type: + - integer + - 'null' prepaid_credit_topup: $ref: '#/components/schemas/PrepaidCreditTopup' operation_type: @@ -21267,6 +23049,9 @@ components: format: date-time type: object PrepaidCreditOperationType: + required: + - type_code + - type_description properties: type_code: type: string @@ -21274,139 +23059,196 @@ components: type: string type: object PrepaidCreditTopup: + required: + - topup_id + - invoice + - initial_credit + - current_credit + - refund_expiry + - credit_expiry + - date_created properties: topup_id: type: integer invoice: - allOf: + anyOf: - $ref: '#/components/schemas/Invoice' - nullable: true - type: object + - type: 'null' initial_credit: $ref: '#/components/schemas/AmountSimple' current_credit: $ref: '#/components/schemas/AmountSimple' refund_expiry: - type: string + type: + - string + - 'null' format: date - nullable: true credit_expiry: - type: string + type: + - string + - 'null' format: date - nullable: true date_created: type: string format: date-time type: object PrepaidCredit: + required: + - credit_amount + - credit_threshold + - threshold_exceeded properties: credit_amount: $ref: '#/components/schemas/AmountSimple' credit_threshold: - allOf: + anyOf: - $ref: '#/components/schemas/AmountSimple' - nullable: true - type: object + - type: 'null' threshold_exceeded: - type: boolean - nullable: true + type: + - boolean + - 'null' type: object PrivateCloud: + required: + - purchase_id + - server_id + - max_vm + - available_vm + - max_cpu + - cpu_overallocation + - min_vm_cpu + - max_vm_cpu + - max_ram + - min_vm_ram + - max_vm_ram + - max_disk + - min_vm_disk + - max_vm_disk + - max_backup + - max_disk_backup properties: purchase_id: type: integer server_id: - type: integer - nullable: true + type: + - integer + - 'null' max_vm: - type: integer - nullable: true + type: + - integer + - 'null' available_vm: - type: integer - nullable: true + type: + - integer + - 'null' max_cpu: - type: integer - nullable: true + type: + - integer + - 'null' cpu_overallocation: - type: integer - nullable: true + type: + - integer + - 'null' min_vm_cpu: - type: integer - nullable: true + type: + - integer + - 'null' max_vm_cpu: - type: integer - nullable: true + type: + - integer + - 'null' max_ram: - type: integer - nullable: true + type: + - integer + - 'null' min_vm_ram: - type: integer - nullable: true + type: + - integer + - 'null' max_vm_ram: - type: integer - nullable: true + type: + - integer + - 'null' max_disk: - type: integer - nullable: true + type: + - integer + - 'null' min_vm_disk: - type: integer - nullable: true + type: + - integer + - 'null' max_vm_disk: - type: integer - nullable: true + type: + - integer + - 'null' max_backup: - type: integer - nullable: true + type: + - integer + - 'null' max_disk_backup: - type: integer - nullable: true + type: + - integer + - 'null' type: object Promotion: + required: + - promocode + - description + - percentage_increase + - percentage_decrease + - amount_increase + - amount_decrease + - amount_fixed + - applied_amount + - date_applied properties: promocode: - type: string - nullable: true + type: + - string + - 'null' description: type: string percentage_increase: - type: number + type: + - number + - 'null' format: float - nullable: true percentage_decrease: - type: number + type: + - number + - 'null' format: float - nullable: true amount_increase: - allOf: + anyOf: - $ref: '#/components/schemas/Amount' - nullable: true - type: object + - type: 'null' amount_decrease: - allOf: + anyOf: - $ref: '#/components/schemas/Amount' - nullable: true - type: object + - type: 'null' amount_fixed: - allOf: + anyOf: - $ref: '#/components/schemas/Amount' - nullable: true - type: object + - type: 'null' applied_amount: - allOf: + anyOf: - $ref: '#/components/schemas/Amount' - nullable: true - type: object + - type: 'null' date_applied: type: string format: date-time type: object PurchaseCanAddAdditional: + required: + - purchase_id + - can_add_additional + - services properties: purchase_id: type: integer can_add_additional: type: boolean - nullable: false services: description: Collection of Services to which it is possible to make the change. type: array @@ -21414,6 +23256,9 @@ components: $ref: '#/components/schemas/Service' type: object PurchaseCanCancel: + required: + - purchase_id + - can_cancel properties: purchase_id: type: integer @@ -21421,6 +23266,9 @@ components: type: boolean type: object PurchaseCanChangeRecurrence: + required: + - purchase_id + - can_change_recurrence properties: purchase_id: type: integer @@ -21428,6 +23276,9 @@ components: type: boolean type: object PurchaseCanChangeRenewStatus: + required: + - purchase_id + - can_change_renew_status properties: purchase_id: type: integer @@ -21435,6 +23286,10 @@ components: type: boolean type: object PurchaseCanChangeService: + required: + - purchase_id + - can_change_service + - services properties: purchase_id: type: integer @@ -21447,6 +23302,9 @@ components: $ref: '#/components/schemas/ServiceChange' type: object PurchaseCanRenew: + required: + - purchase_id + - can_renew properties: purchase_id: type: integer @@ -21454,6 +23312,10 @@ components: type: boolean type: object PurchaseName: + required: + - name + - full_name + - object_name properties: name: description: Service name @@ -21466,6 +23328,9 @@ components: type: string type: object PurchaseProvisioningStatus: + required: + - status_code + - status_name properties: status_code: type: string @@ -21473,6 +23338,9 @@ components: type: string type: object PurchaseStatus: + required: + - status_code + - status_name properties: status_code: type: string @@ -21480,36 +23348,87 @@ components: type: string type: object Purchase: + required: + - purchase_id + - account + - service + - billing + - recurrence + - recurrence_default + - purchase_id_primary + - purchase_status + - purchase_provisioning_status + - purchase_name + - activation_quantity + - quantity + - activation_price + - renew_price + - restore_price + - date_activation + - date_activation_start + - date_expiry + - date_dismission + - do_not_renew + - suspended + - comment + - billing_data + - tasks + - purchase_additionals + - domain_id + - server_id + - ssl_certificate_id + - pec_id + - pec_domain_id + - hosting_id + - monitoring_id + - license_id + - microsoft365_id + - securemail_id + - cloud_storage_id + - object_storage_id + - veeam_baas_id + - date_created properties: purchase_id: description: ID of purchase type: integer account: - allOf: - - $ref: '#/components/schemas/Account' - nullable: true description: >- Account information of the user owner of the purchase. NULL if the purchase is not billed to a Reseller. - type: object + anyOf: + - $ref: '#/components/schemas/Account' + - type: 'null' service: $ref: '#/components/schemas/Service' + description: Service information of the purchase billing: $ref: '#/components/schemas/AccountBilling' + description: Billing information of the owner of the purchase. recurrence: $ref: '#/components/schemas/Recurrence' + description: Recurrence frequency information. recurrence_default: $ref: '#/components/schemas/Recurrence' + description: >- + Recurrence applied to the prices of the purchase, ie. "EUR + 100,00/month". purchase_id_primary: description: ID of primary purchase if this is an additional purchase. - type: integer - nullable: true + type: + - integer + - 'null' purchase_status: $ref: '#/components/schemas/PurchaseStatus' + description: Status of the purchase. purchase_provisioning_status: $ref: '#/components/schemas/PurchaseProvisioningStatus' + description: >- + Current provisioning status of purchase (changes during activation, + renews, etc.). purchase_name: $ref: '#/components/schemas/PurchaseName' + description: Name of the purchase. activation_quantity: description: Quantity (instances) purchased. type: integer @@ -21518,37 +23437,41 @@ components: type: integer activation_price: $ref: '#/components/schemas/Amount' + description: Purchase price. renew_price: - allOf: - - $ref: '#/components/schemas/Amount' - nullable: true description: Renew price (applied on recurring purchases only). - type: object - restore_price: - allOf: + anyOf: - $ref: '#/components/schemas/Amount' - nullable: true + - type: 'null' + restore_price: description: Restore/reactivation price (applied on domains only). - type: object + anyOf: + - $ref: '#/components/schemas/Amount' + - type: 'null' date_activation: description: Purchase date. - type: string + type: + - string + - 'null' format: date date_activation_start: description: Date when the activation started. - type: string + type: + - string + - 'null' format: date - nullable: true date_expiry: description: Purchase expiration date (applied on recurring purchases only). - type: string + type: + - string + - 'null' format: date - nullable: true date_dismission: description: Purchase dismission date. - type: string + type: + - string + - 'null' format: date - nullable: true do_not_renew: description: Tells if purchase has to be renewed. type: boolean @@ -21560,6 +23483,7 @@ components: type: string billing_data: $ref: '#/components/schemas/BillingData' + description: Billing data (ODA, CIG, CUP...). tasks: description: Tasks currently running on the purchase. type: array @@ -21572,62 +23496,78 @@ components: type: integer domain_id: description: ID of the domain associated with this purchase. - type: integer - nullable: true + type: + - integer + - 'null' server_id: description: ID of the server associated with this purchase. - type: integer - nullable: true + type: + - integer + - 'null' ssl_certificate_id: description: ID of the SSL certificate associated with this purchase. - type: integer - nullable: true + type: + - integer + - 'null' pec_id: description: ID of the PEC associated with this purchase. - type: integer - nullable: true + type: + - integer + - 'null' pec_domain_id: description: ID of the PEC domain associated with this purchase. - type: integer - nullable: true + type: + - integer + - 'null' hosting_id: description: ID of the web hosting associated with this purchase. - type: integer - nullable: true + type: + - integer + - 'null' monitoring_id: description: ID of the monitoring service associated with this purchase. - type: integer - nullable: true + type: + - integer + - 'null' license_id: description: ID of the license associated with this purchase. - type: integer - nullable: true + type: + - integer + - 'null' microsoft365_id: description: ID of the Microsoft 365 subscription associated with this purchase. - type: integer - nullable: true + type: + - integer + - 'null' securemail_id: description: ID of the SecureMail by LibraESVA associated with this purchase. - type: integer - nullable: true + type: + - integer + - 'null' cloud_storage_id: description: ID of the cloud storage associated with this purchase. - type: integer - nullable: true + type: + - integer + - 'null' object_storage_id: description: ID of the object storage associated with this purchase. - type: integer - nullable: true + type: + - integer + - 'null' veeam_baas_id: description: ID of the Veeam Backup as a Service associated with this purchase. - type: integer - nullable: true + type: + - integer + - 'null' date_created: description: Datetime when the purchase was first created. type: string format: date-time type: object RecurrenceFrequency: + required: + - family + - value properties: family: type: string @@ -21635,39 +23575,62 @@ components: type: integer type: object Recurrence: + required: + - recurrence_id + - frequency + - days_renew + - days_autorenew + - days_suspension + - days_restore + - days_dismission + - days_cancel + - days_renew_dismission + - days_no_secondary + - days_no_service_change properties: recurrence_id: type: integer frequency: $ref: '#/components/schemas/RecurrenceFrequency' days_renew: - type: integer - nullable: true + type: + - integer + - 'null' days_autorenew: - type: integer - nullable: true + type: + - integer + - 'null' days_suspension: - type: integer - nullable: true + type: + - integer + - 'null' days_restore: - type: integer - nullable: true + type: + - integer + - 'null' days_dismission: - type: integer - nullable: true + type: + - integer + - 'null' days_cancel: type: integer days_renew_dismission: - type: integer - nullable: true + type: + - integer + - 'null' days_no_secondary: - type: integer - nullable: true + type: + - integer + - 'null' days_no_service_change: - type: integer - nullable: true + type: + - integer + - 'null' type: object SdiDocumentStatus: + required: + - status_code + - status_name properties: status_code: type: string @@ -21675,6 +23638,9 @@ components: type: string type: object SdiDocumentType: + required: + - type_code + - type_description properties: type_code: type: string @@ -21682,24 +23648,41 @@ components: 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 - nullable: true + type: + - string + - 'null' status: - type: string - nullable: true + type: + - string + - 'null' is_primary: type: boolean valid_recipient_id: - type: integer - nullable: true + 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 @@ -21715,37 +23698,64 @@ components: 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 - nullable: true + type: + - string + - 'null' purchase_name: - type: string - nullable: true + type: + - string + - 'null' purchase_status_code: - type: string - nullable: true + type: + - string + - 'null' quantity: - type: integer + type: + - integer + - 'null' domain: - type: string - nullable: true + type: + - string + - 'null' relay_to: - type: string - nullable: true + type: + - string + - 'null' relay_to_port: - type: integer - nullable: true + type: + - integer + - 'null' is_feasible: type: boolean provider: type: string type: object ServerAutomaticSnapshot: + required: + - snapshot_id + - server_id + - name + - days_of_week + - hour_of_day + - is_active properties: snapshot_id: type: integer @@ -21763,72 +23773,116 @@ components: type: boolean type: object ServerBackup: + required: + - server_backup_id + - backup_recurrent_id + - backup_server_id_parent + - server_id + - cluster_id_server_residence + - cluster_id_backup_residence + - backup_type_id + - backup_mode + - backup_frequency_id + - backup_type_code + - backup_frequency_code + - backup_date + - backup_size + - backup_duration + - exit_status + - error_type + - date_created + - backup_path + - checksum + - backup_path_parent + - backup_user_visibility properties: server_backup_id: type: integer backup_recurrent_id: - type: integer - nullable: true + type: + - integer + - 'null' backup_server_id_parent: - type: integer - nullable: true + type: + - integer + - 'null' server_id: type: integer cluster_id_server_residence: - type: integer - nullable: true + type: + - integer + - 'null' cluster_id_backup_residence: - type: integer - nullable: true + type: + - integer + - 'null' backup_type_id: - type: integer - nullable: true + type: + - integer + - 'null' backup_mode: - type: string - nullable: true + type: + - string + - 'null' backup_frequency_id: - type: integer - nullable: true + type: + - integer + - 'null' backup_type_code: - type: string - nullable: true + type: + - string + - 'null' backup_frequency_code: - type: string - nullable: true + type: + - string + - 'null' backup_date: - type: string + type: + - string + - 'null' format: date-time - nullable: true backup_size: - type: integer - nullable: true + type: + - integer + - 'null' backup_duration: - type: string - nullable: true + type: + - string + - 'null' exit_status: - type: integer - nullable: true + type: + - integer + - 'null' error_type: - type: string - nullable: true + type: + - string + - 'null' date_created: - type: string + type: + - string + - 'null' format: date-time - nullable: true backup_path: - type: string - nullable: true + type: + - string + - 'null' checksum: - type: string - nullable: true + type: + - string + - 'null' backup_path_parent: - type: string - nullable: true + type: + - string + - 'null' backup_user_visibility: - type: boolean - nullable: true + type: + - boolean + - 'null' type: object ServerCanAction: + required: + - server_id + - can_action properties: server_id: type: integer @@ -21836,19 +23890,31 @@ components: type: boolean type: object ServerCredential: + required: + - type + - username + - password + - visible properties: type: type: string username: - type: string - nullable: true + type: + - string + - 'null' password: - type: string - nullable: true + type: + - string + - 'null' visible: type: boolean type: object ServerMonitoringProbeChart: + required: + - server_monitoring_id + - probe_id + - interval + - points properties: server_monitoring_id: type: integer @@ -21872,26 +23938,49 @@ components: type: object type: object ServerMonitoringProbe: + required: + - probe_id + - server_monitoring_id + - template_id + - template_code + - template_name + - monitoring_item_id + - monitoring_trigger_id + - is_default + - advanced_item + - is_error + - monitoring_item_disabled + - action_enabled + - notification_email + - notification_sms + - date_problem + - date_last_notification + - active properties: probe_id: type: integer server_monitoring_id: type: integer template_id: - type: integer - nullable: true + type: + - integer + - 'null' template_code: - type: string - nullable: true + type: + - string + - 'null' template_name: - type: string - nullable: true + type: + - string + - 'null' monitoring_item_id: - type: integer - nullable: true + type: + - integer + - 'null' monitoring_trigger_id: - type: integer - nullable: true + type: + - integer + - 'null' is_default: type: boolean advanced_item: @@ -21903,44 +23992,71 @@ components: action_enabled: type: boolean notification_email: - type: string - nullable: true + type: + - string + - 'null' notification_sms: - type: string - nullable: true + type: + - string + - 'null' date_problem: - type: string + type: + - string + - 'null' format: date-time - nullable: true date_last_notification: - type: string + type: + - string + - 'null' format: date-time - nullable: true active: type: boolean type: object ServerMonitoring: + required: + - server_monitoring_id + - purchase_monitoring_id + - purchase_server_id + - service_name + - purchase_name + - purchase_status_code + - monitoring_key + - is_server_monitored + - is_ip_monitored + - is_external_device_monitored + - monitoring_host_enabled + - monitoring_type + - probe_limit + - severity_level + - email_notification + - sms_notification properties: server_monitoring_id: type: integer purchase_monitoring_id: - type: integer - nullable: true + type: + - integer + - 'null' purchase_server_id: - type: integer - nullable: true + type: + - integer + - 'null' service_name: - type: string - nullable: true + type: + - string + - 'null' purchase_name: - type: string - nullable: true + type: + - string + - 'null' purchase_status_code: - type: string - nullable: true + type: + - string + - 'null' monitoring_key: - type: string - nullable: true + type: + - string + - 'null' is_server_monitored: type: boolean is_ip_monitored: @@ -21950,66 +24066,104 @@ components: monitoring_host_enabled: type: boolean monitoring_type: - type: string - nullable: true + type: + - string + - 'null' probe_limit: - type: integer - nullable: true + type: + - integer + - 'null' severity_level: - type: string - nullable: true + type: + - string + - 'null' email_notification: - type: string - nullable: true + type: + - string + - 'null' sms_notification: - type: string - nullable: true + type: + - string + - 'null' type: object ServerNetworkInterface: + required: + - network_interface_id + - server_id + - network_id + - ip_address_id + - vif_uuid + - device_name + - mac_address + - is_default + - is_active + - network_type + - network_label + - network_bridge + - ip_address + - date_created properties: network_interface_id: type: integer server_id: type: integer network_id: - type: integer - nullable: true + type: + - integer + - 'null' ip_address_id: - type: integer - nullable: true + type: + - integer + - 'null' vif_uuid: - type: string - nullable: true + type: + - string + - 'null' device_name: - type: string - nullable: true + type: + - string + - 'null' mac_address: - type: string - nullable: true + type: + - string + - 'null' is_default: - type: boolean - nullable: true + type: + - boolean + - 'null' is_active: - type: boolean - nullable: true + type: + - boolean + - 'null' network_type: - type: string - nullable: true + type: + - string + - 'null' network_label: - type: string - nullable: true + type: + - string + - 'null' network_bridge: - type: string - nullable: true + type: + - string + - 'null' ip_address: - type: string - nullable: true + type: + - string + - 'null' date_created: - type: string + type: + - string + - 'null' format: date-time - nullable: true type: object ServerOs: + required: + - os_code + - os_name + - min_ram + - min_cpu + - min_disk properties: os_code: type: string @@ -22017,61 +24171,88 @@ components: type: string min_ram: description: Min RAM (GB), for VPS/VM only - type: integer - nullable: true + type: + - integer + - 'null' min_cpu: description: Min vCPU, for VPS/VM only - type: integer - nullable: true + type: + - integer + - 'null' min_disk: description: Min disk (GB), for VPS/VM only - type: integer - nullable: true + type: + - integer + - 'null' type: object ServerSnapshot: + required: + - snapshot_id + - server_id + - snapshot_name + - snapshot_reference + - active + - date_expiry + - date_created properties: snapshot_id: type: integer server_id: type: integer snapshot_name: - type: string - nullable: true + type: + - string + - 'null' snapshot_reference: - type: string - nullable: true + type: + - string + - 'null' active: type: boolean date_expiry: - type: string + type: + - string + - 'null' format: date-time - nullable: true date_created: - type: string + type: + - string + - 'null' format: date-time - nullable: true type: object ServerTemplate: + required: + - template_code + - template_name + - template_name_alternative + - min_ram + - min_cpu + - min_disk + - operative_systems properties: template_code: type: string template_name: type: string template_name_alternative: - type: string - nullable: true + type: + - string + - 'null' min_ram: description: Min RAM (GB), for VPS/VM only - type: integer - nullable: true + type: + - integer + - 'null' min_cpu: description: Min vCPU, for VPS/VM only - type: integer - nullable: true + type: + - integer + - 'null' min_disk: description: Min disk (GB), for VPS/VM only - type: integer - nullable: true + type: + - integer + - 'null' operative_systems: description: Compatible operative systems type: array @@ -22079,37 +24260,60 @@ components: $ref: '#/components/schemas/ServerOs' type: object Server: + required: + - server_id + - purchase_id + - hostname + - server_type + - active + - consolidated + - ip_address_id + - ip_address + - service_category_code + - date_created properties: server_id: type: integer purchase_id: - type: integer - nullable: true + type: + - integer + - 'null' hostname: - type: string - nullable: true + type: + - string + - 'null' server_type: - type: string - nullable: true + type: + - string + - 'null' active: type: boolean consolidated: type: boolean ip_address_id: - type: integer - nullable: true + type: + - integer + - 'null' ip_address: - type: string - nullable: true + type: + - string + - 'null' service_category_code: - type: string - nullable: true + type: + - string + - 'null' date_created: - type: string + type: + - string + - 'null' format: date-time - nullable: true type: object ServiceCategory: + required: + - category_code + - category_name + - area_code + - area_name properties: category_code: type: string @@ -22121,6 +24325,9 @@ components: type: string type: object ServiceChange: + required: + - service + - activation_price properties: service: $ref: '#/components/schemas/Service' @@ -22128,6 +24335,8 @@ components: $ref: '#/components/schemas/Amount' type: object ServiceServer: + required: + - templates allOf: - $ref: '#/components/schemas/Service' - properties: @@ -22137,6 +24346,26 @@ components: $ref: '#/components/schemas/ServerTemplate' type: object Service: + 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 properties: service_id: type: integer @@ -22151,8 +24380,9 @@ components: items: $ref: '#/components/schemas/Recurrence' tld_id: - type: integer - nullable: true + type: + - integer + - 'null' service_code: type: string service_url: @@ -22160,43 +24390,51 @@ components: activation_price: $ref: '#/components/schemas/Amount' renew_price: - allOf: + anyOf: - $ref: '#/components/schemas/Amount' - nullable: true - type: object + - type: 'null' restore_price: - allOf: + anyOf: - $ref: '#/components/schemas/Amount' - nullable: true - type: object + - type: 'null' transfer_price: - allOf: + anyOf: - $ref: '#/components/schemas/Amount' - nullable: true - type: object + - type: 'null' is_primary: - type: boolean - nullable: true + type: + - boolean + - 'null' is_secondary: - type: boolean - nullable: true + type: + - boolean + - 'null' is_presale: - type: boolean - nullable: true + type: + - boolean + - 'null' is_aftersale: - type: boolean - nullable: true + type: + - boolean + - 'null' is_quantifiable: - type: boolean - nullable: true + type: + - boolean + - 'null' quantity_min: - type: integer - nullable: true + type: + - integer + - 'null' quantity_max: - type: integer - nullable: true + type: + - integer + - 'null' type: object SmsAccount: + required: + - credit + - sms_standard + - sms_premium properties: credit: $ref: '#/components/schemas/AmountSimple' @@ -22212,6 +24450,9 @@ components: type: integer type: object SmsCanCancel: + required: + - sms_id + - can_cancel properties: sms_id: type: integer @@ -22219,6 +24460,9 @@ components: type: boolean type: object SmsCanDelete: + required: + - sms_id + - can_delete properties: sms_id: type: integer @@ -22226,6 +24470,14 @@ components: type: boolean type: object SmsMessage: + required: + - id + - sms_id + - contact_name + - phone_number + - date_sent + - date_delivered + - error properties: id: type: integer @@ -22234,24 +24486,36 @@ components: sms_price: $ref: '#/components/schemas/SmsPrice' contact_name: - type: string - nullable: true + type: + - string + - 'null' phone_number: type: string date_sent: - type: string + type: + - string + - 'null' format: date-time - nullable: true date_delivered: - type: string + type: + - string + - 'null' format: date-time - nullable: true error: description: Error code if the SMS was not delivered - type: string - nullable: true + type: + - string + - 'null' type: object SmsPhonebookContact: + required: + - id + - phonebooks + - country + - phone_number + - name + - surname + - birth_date properties: id: type: integer @@ -22264,27 +24528,40 @@ components: phone_number: type: string name: - type: string - nullable: true + type: + - string + - 'null' surname: - type: string - nullable: true + type: + - string + - 'null' birth_date: - type: string + type: + - string + - 'null' format: date - nullable: true type: object SmsPhonebook: + required: + - id + - name + - contacts_count properties: id: type: integer name: - type: string - nullable: true + type: + - string + - 'null' contacts_count: type: integer type: object SmsPrice: + required: + - country + - standard_price + - premium_price + - valid_from properties: country: $ref: '#/components/schemas/Country' @@ -22293,11 +24570,23 @@ components: premium_price: $ref: '#/components/schemas/Amount' valid_from: - type: string + type: + - string + - 'null' format: date-time - nullable: true type: object Sms: + required: + - id + - quality + - status + - sender + - message + - send_from + - date_approved + - stop_date + - sms_count + - date_created properties: id: type: integer @@ -22306,31 +24595,40 @@ components: status: type: string sender: - type: string - nullable: true + type: + - string + - 'null' message: - type: string - nullable: true + type: + - string + - 'null' send_from: - type: string + type: + - string + - 'null' format: date-time - nullable: true date_approved: - type: string + type: + - string + - 'null' format: date-time - nullable: true stop_date: - type: string + type: + - string + - 'null' format: date-time - nullable: true sms_count: - type: integer - nullable: true + type: + - integer + - 'null' date_created: type: string format: date-time type: object SslCertificateApproverEmails: + required: + - domain_name + - approver_emails properties: domain_name: type: string @@ -22340,6 +24638,9 @@ components: type: string type: object SslCertificateCanReemit: + required: + - ssl_certificate_id + - can_reemit properties: ssl_certificate_id: type: integer @@ -22347,14 +24648,22 @@ components: type: boolean type: object SslCertificateExportFormat: + required: + - format + - name + - description + - filename + - available + - requires_passphrase properties: format: type: string name: type: string description: - type: string - nullable: true + type: + - string + - 'null' filename: type: string available: @@ -22363,6 +24672,10 @@ components: type: boolean type: object SslCertificateExport: + required: + - format + - filename + - content_base64 properties: format: type: string @@ -22372,108 +24685,172 @@ components: type: string type: object SslCertificateKey: + required: + - ssl_certificate_id + - csr properties: ssl_certificate_id: type: integer csr: - type: string - nullable: true + type: + - string + - 'null' type: object SslCertificateKeys: + required: + - ssl_certificate_id + - csr + - private_key + - public_key + - certificate_authority properties: ssl_certificate_id: type: integer csr: - type: string - nullable: true + type: + - string + - 'null' private_key: - type: string - nullable: true + type: + - string + - 'null' public_key: - type: string - nullable: true + type: + - string + - 'null' certificate_authority: - type: string - nullable: true + type: + - string + - 'null' type: object SslCertificate: + required: + - ssl_certificate_id + - purchase_id + - domain_name + - cn_type + - validation_type + - san_max + - can_reissue + - validation_method + - valid_to + - csr_md5_hash + - csr_sha256_hash + - certificate_status + - approver_email + - admin_first_name + - admin_last_name + - admin_organization + - admin_role + - admin_email + - admin_phone_cc + - admin_phone_number + - admin_address + - admin_city + - admin_state + - admin_postal_code + - admin_country properties: ssl_certificate_id: type: integer purchase_id: type: integer domain_name: - type: string - nullable: true + type: + - string + - 'null' cn_type: - type: string - nullable: true + type: + - string + - 'null' validation_type: - type: string - nullable: true + type: + - string + - 'null' san_max: type: integer can_reissue: type: boolean validation_method: - type: string - nullable: true + type: + - string + - 'null' valid_to: - type: string + type: + - string + - 'null' format: date-time - nullable: true csr_md5_hash: - type: string - nullable: true + type: + - string + - 'null' csr_sha256_hash: - type: string - nullable: true + type: + - string + - 'null' certificate_status: - type: string - nullable: true + type: + - string + - 'null' approver_email: - type: string + type: + - string + - 'null' format: email - nullable: true admin_first_name: - type: string - nullable: true + type: + - string + - 'null' admin_last_name: - type: string - nullable: true + type: + - string + - 'null' admin_organization: - type: string - nullable: true + type: + - string + - 'null' admin_role: - type: string - nullable: true + type: + - string + - 'null' admin_email: - type: string + type: + - string + - 'null' format: email - nullable: true admin_phone_cc: - type: string - nullable: true + type: + - string + - 'null' admin_phone_number: - type: string - nullable: true + type: + - string + - 'null' admin_address: - type: string - nullable: true + type: + - string + - 'null' admin_city: - type: string - nullable: true + type: + - string + - 'null' admin_state: - type: string - nullable: true + type: + - string + - 'null' admin_postal_code: - type: string - nullable: true + type: + - string + - 'null' admin_country: - type: string - nullable: true + type: + - string + - 'null' type: object TaskStatus: + required: + - status_code + - status_name properties: status_code: type: string @@ -22481,6 +24858,14 @@ components: type: string type: object Task: + required: + - task_id + - purchase_id + - task_status + - executed_instructions + - total_instructions + - is_started + - date_started properties: task_id: type: integer @@ -22489,34 +24874,48 @@ components: task_status: $ref: '#/components/schemas/TaskStatus' executed_instructions: - type: integer - nullable: true + type: + - integer + - 'null' total_instructions: - type: integer - nullable: true + type: + - integer + - 'null' is_started: type: boolean ask_user_error: - type: string - nullable: true + type: + - string + - 'null' date_started: type: string format: date-time type: object TaxRegime: + required: + - regime_code + - regime_name + - code_edocument + - tax_rate properties: regime_code: type: string regime_name: type: string code_edocument: - type: string + type: + - string + - 'null' tax_rate: type: number format: float type: object TldContactSpecification: description: Represents a single TLD contact specification + required: + - name + - type + - enum properties: name: description: Code of the contact specification @@ -22526,12 +24925,34 @@ components: type: string enum: description: If not null, the list of allowed values for this specification - type: array + type: + - array + - 'null' items: type: string - nullable: true type: object Tld: + required: + - tld_id + - extension + - punycode + - country + - char_min + - char_max + - hyphen_allowed + - number_allowed + - punycode_allowed + - dnssec_enabled + - rdap_enabled + - rdap_url + - contact_data + - update_contact_r + - update_contact_a + - update_contact_t + - update_contact_o + - update_contact_additional + - update_contact_transfer + - transfer_authcode properties: tld_id: type: integer @@ -22540,16 +24961,17 @@ components: punycode: type: string country: - allOf: + anyOf: - $ref: '#/components/schemas/Country' - nullable: true - type: object + - type: 'null' char_min: - type: integer - nullable: true + type: + - integer + - 'null' char_max: - type: integer - nullable: true + type: + - integer + - 'null' hyphen_allowed: type: boolean number_allowed: @@ -22582,6 +25004,12 @@ components: type: boolean type: object ApiUpload: + required: + - upload_id + - filename + - original_filename + - file_extension + - upload_date properties: upload_id: type: integer @@ -22590,16 +25018,24 @@ components: filename: type: string original_filename: - type: string - nullable: true + type: + - string + - 'null' file_extension: - type: string - nullable: true + type: + - string + - 'null' upload_date: type: string format: date type: object WebMonitoringAvailabilityChart: + required: + - web_monitoring_id + - interval + - unit + - legend + - points properties: web_monitoring_id: type: integer @@ -22635,6 +25071,11 @@ components: type: object type: object WebMonitoringDownloadSpeedChart: + required: + - web_monitoring_id + - interval + - unit + - points properties: web_monitoring_id: type: integer @@ -22659,19 +25100,31 @@ components: type: object type: object WebMonitoringNotices: + required: + - web_monitoring_id + - notification_email + - notification_sms + - send_ssl_notify properties: web_monitoring_id: type: integer notification_email: - type: string - nullable: true + type: + - string + - 'null' notification_sms: - type: string - nullable: true + type: + - string + - 'null' send_ssl_notify: type: boolean type: object WebMonitoringResponseTimeChart: + required: + - web_monitoring_id + - interval + - unit + - points properties: web_monitoring_id: type: integer @@ -22696,55 +25149,89 @@ components: type: object type: object WebMonitoring: + required: + - web_monitoring_id + - purchase_id + - service_name + - purchase_name + - purchase_status_code + - monitored_domain + - host_ref + - web_scenario_ref + - status + - email_notification + - sms_notification + - ips + - ip_isp + - ip_location + - last_http_response + - last_down_date + - send_ssl_notify + - active properties: web_monitoring_id: type: integer purchase_id: - type: integer - nullable: true + type: + - integer + - 'null' service_name: - type: string - nullable: true + type: + - string + - 'null' purchase_name: - type: string - nullable: true + type: + - string + - 'null' purchase_status_code: - type: string - nullable: true + type: + - string + - 'null' monitored_domain: - type: string - nullable: true + type: + - string + - 'null' host_ref: - type: string - nullable: true + type: + - string + - 'null' web_scenario_ref: - type: string - nullable: true + type: + - string + - 'null' status: - type: string - nullable: true + type: + - string + - 'null' email_notification: - type: string - nullable: true + type: + - string + - 'null' sms_notification: - type: string - nullable: true + type: + - string + - 'null' ips: - type: string - nullable: true + type: + - string + - 'null' ip_isp: - type: string - nullable: true + type: + - string + - 'null' ip_location: - type: string - nullable: true + type: + - string + - 'null' last_http_response: - type: integer - nullable: true + type: + - integer + - 'null' last_down_date: - type: string + type: + - string + - 'null' format: date-time - nullable: true send_ssl_notify: type: boolean active: @@ -22762,13 +25249,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/HealthStatus' meta: - type: object - nullable: true + type: + - object + - 'null' EmptyResponse: type: object required: @@ -22781,14 +25270,17 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: - type: object - nullable: true + type: + - object + - 'null' meta: - type: object - nullable: true + type: + - object + - 'null' ServerBackupListResponse: type: object required: @@ -22801,15 +25293,17 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: $ref: '#/components/schemas/ServerBackup' meta: - type: object - nullable: true + type: + - object + - 'null' AccountResponse: type: object required: @@ -22822,13 +25316,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/Account' meta: - type: object - nullable: true + type: + - object + - 'null' CreditnotePaginatedListResponse: type: object required: @@ -22841,8 +25337,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -22861,13 +25358,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/Creditnote' meta: - type: object - nullable: true + type: + - object + - 'null' CreditnoteRowListResponse: type: object required: @@ -22880,15 +25379,17 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: $ref: '#/components/schemas/CreditnoteRow' meta: - type: object - nullable: true + type: + - object + - 'null' CreditnoteRowResponse: type: object required: @@ -22901,13 +25402,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/CreditnoteRow' meta: - type: object - nullable: true + type: + - object + - 'null' DomainPaginatedListResponse: type: object required: @@ -22920,8 +25423,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -22940,13 +25444,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/Domain' meta: - type: object - nullable: true + type: + - object + - 'null' DomainAvailabilityResponse: type: object required: @@ -22959,13 +25465,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/DomainAvailability' meta: - type: object - nullable: true + type: + - object + - 'null' DomainDnssecResponse: type: object required: @@ -22978,13 +25486,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/DomainDnssec' meta: - type: object - nullable: true + type: + - object + - 'null' TaskResponse: type: object required: @@ -22997,13 +25507,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/Task' meta: - type: object - nullable: true + type: + - object + - 'null' DomainDnssecCanActivateResponse: type: object required: @@ -23016,13 +25528,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/DomainDnssecCanActivate' meta: - type: object - nullable: true + type: + - object + - 'null' DomainDnssecCanDeactivateResponse: type: object required: @@ -23035,13 +25549,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/DomainDnssecCanDeactivate' meta: - type: object - nullable: true + type: + - object + - 'null' DnsZoneResponse: type: object required: @@ -23054,13 +25570,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/DnsZone' meta: - type: object - nullable: true + type: + - object + - 'null' DomainCanChangeNameserversResponse: type: object required: @@ -23073,13 +25591,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/DomainCanChangeNameservers' meta: - type: object - nullable: true + type: + - object + - 'null' DnsRecordPaginatedListResponse: type: object required: @@ -23092,8 +25612,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -23112,13 +25633,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/DnsRecord' meta: - type: object - nullable: true + type: + - object + - 'null' DomainContactListResponse: type: object required: @@ -23131,15 +25654,17 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: $ref: '#/components/schemas/DomainContact' meta: - type: object - nullable: true + type: + - object + - 'null' DomainContactResponse: type: object required: @@ -23152,13 +25677,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/DomainContact' meta: - type: object - nullable: true + type: + - object + - 'null' HostingPaginatedListResponse: type: object required: @@ -23171,8 +25698,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -23191,13 +25719,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/Hosting' meta: - type: object - nullable: true + type: + - object + - 'null' HostingCredentialListResponse: type: object required: @@ -23210,15 +25740,17 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: $ref: '#/components/schemas/HostingCredential' meta: - type: object - nullable: true + type: + - object + - 'null' HostingDnsRecordListResponse: type: object required: @@ -23231,15 +25763,17 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: $ref: '#/components/schemas/HostingDnsRecord' meta: - type: object - nullable: true + type: + - object + - 'null' HostingDatabaseListResponse: type: object required: @@ -23252,15 +25786,17 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: $ref: '#/components/schemas/HostingDatabase' meta: - type: object - nullable: true + type: + - object + - 'null' HostingDatabaseResponse: type: object required: @@ -23273,13 +25809,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/HostingDatabase' meta: - type: object - nullable: true + type: + - object + - 'null' HostingEmailAliasListResponse: type: object required: @@ -23292,15 +25830,17 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: $ref: '#/components/schemas/HostingEmailAlias' meta: - type: object - nullable: true + type: + - object + - 'null' HostingEmailAliasResponse: type: object required: @@ -23313,13 +25853,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/HostingEmailAlias' meta: - type: object - nullable: true + type: + - object + - 'null' HostingEmailCatchAllResponse: type: object required: @@ -23332,13 +25874,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/HostingEmailCatchAll' meta: - type: object - nullable: true + type: + - object + - 'null' HostingEmailAllowListPaginatedListResponse: type: object required: @@ -23351,8 +25895,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -23371,13 +25916,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/HostingEmailAllowList' meta: - type: object - nullable: true + type: + - object + - 'null' HostingEmailBlocListPaginatedListResponse: type: object required: @@ -23390,8 +25937,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -23410,13 +25958,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/HostingEmailBlocList' meta: - type: object - nullable: true + type: + - object + - 'null' HostingCronjobPaginatedListResponse: type: object required: @@ -23429,8 +25979,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -23449,13 +26000,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/HostingCronjob' meta: - type: object - nullable: true + type: + - object + - 'null' HostingModSecurityResponse: type: object required: @@ -23468,13 +26021,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/HostingModSecurity' meta: - type: object - nullable: true + type: + - object + - 'null' HostingModSecurityScanPaginatedListResponse: type: object required: @@ -23487,8 +26042,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -23507,13 +26063,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/HostingModSecurityScan' meta: - type: object - nullable: true + type: + - object + - 'null' HostingModSecurityRuleListResponse: type: object required: @@ -23526,15 +26084,17 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: $ref: '#/components/schemas/HostingModSecurityRule' meta: - type: object - nullable: true + type: + - object + - 'null' HostingModSecurityRuleResponse: type: object required: @@ -23547,13 +26107,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/HostingModSecurityRule' meta: - type: object - nullable: true + type: + - object + - 'null' HostingPhpVersionListResponse: type: object required: @@ -23566,15 +26128,17 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: $ref: '#/components/schemas/HostingPhpVersion' meta: - type: object - nullable: true + type: + - object + - 'null' HostingAntivirusScanPaginatedListResponse: type: object required: @@ -23587,8 +26151,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -23607,13 +26172,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/HostingAntivirusScan' meta: - type: object - nullable: true + type: + - object + - 'null' HostingAntivirusRemovalScanPaginatedListResponse: type: object required: @@ -23626,8 +26193,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -23646,13 +26214,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/HostingAntivirusRemovalScan' meta: - type: object - nullable: true + type: + - object + - 'null' HostingSslCertificateListResponse: type: object required: @@ -23665,15 +26235,17 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: $ref: '#/components/schemas/HostingSslCertificate' meta: - type: object - nullable: true + type: + - object + - 'null' HostingSslCertificateResponse: type: object required: @@ -23686,13 +26258,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/HostingSslCertificate' meta: - type: object - nullable: true + type: + - object + - 'null' HostingBackupListResponse: type: object required: @@ -23705,15 +26279,17 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: $ref: '#/components/schemas/HostingBackup' meta: - type: object - nullable: true + type: + - object + - 'null' HostingBackupResponse: type: object required: @@ -23726,13 +26302,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/HostingBackup' meta: - type: object - nullable: true + type: + - object + - 'null' InvoicePaginatedListResponse: type: object required: @@ -23745,8 +26323,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -23765,13 +26344,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/Invoice' meta: - type: object - nullable: true + type: + - object + - 'null' InvoiceRowListResponse: type: object required: @@ -23784,15 +26365,17 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: $ref: '#/components/schemas/InvoiceRow' meta: - type: object - nullable: true + type: + - object + - 'null' InvoiceRowResponse: type: object required: @@ -23805,13 +26388,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/InvoiceRow' meta: - type: object - nullable: true + type: + - object + - 'null' PleskLicensePaginatedListResponse: type: object required: @@ -23824,8 +26409,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -23844,8 +26430,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -23864,13 +26451,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/CpanelLicense' meta: - type: object - nullable: true + type: + - object + - 'null' PleskLicenseResponse: type: object required: @@ -23883,13 +26472,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/PleskLicense' meta: - type: object - nullable: true + type: + - object + - 'null' SecuremailPaginatedListResponse: type: object required: @@ -23902,8 +26493,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -23922,13 +26514,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/Securemail' meta: - type: object - nullable: true + type: + - object + - 'null' SecuremailStatisticsResponse: type: object required: @@ -23941,13 +26535,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/SecuremailStatistics' meta: - type: object - nullable: true + type: + - object + - 'null' SecuremailMailboxPaginatedListResponse: type: object required: @@ -23960,8 +26556,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -23980,13 +26577,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/Order' meta: - type: object - nullable: true + type: + - object + - 'null' Microsoft365PaginatedListResponse: type: object required: @@ -23999,8 +26598,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -24019,13 +26619,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/Microsoft365' meta: - type: object - nullable: true + type: + - object + - 'null' Microsoft365TenantPaginatedListResponse: type: object required: @@ -24038,8 +26640,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -24058,13 +26661,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/Microsoft365Tenant' meta: - type: object - nullable: true + type: + - object + - 'null' Microsoft365PartnerLinkResponse: type: object required: @@ -24077,13 +26682,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/Microsoft365PartnerLink' meta: - type: object - nullable: true + type: + - object + - 'null' OneClickPaginatedListResponse: type: object required: @@ -24096,8 +26703,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -24116,13 +26724,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/OneClick' meta: - type: object - nullable: true + type: + - object + - 'null' OneClickAutorenewResponse: type: object required: @@ -24135,13 +26745,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/OneClickAutorenew' meta: - type: object - nullable: true + type: + - object + - 'null' OrderPaginatedListResponse: type: object required: @@ -24154,8 +26766,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -24174,13 +26787,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/OrderCanCancel' meta: - type: object - nullable: true + type: + - object + - 'null' OrderCanPayResponse: type: object required: @@ -24193,13 +26808,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/OrderCanPay' meta: - type: object - nullable: true + type: + - object + - 'null' OrderRowListResponse: type: object required: @@ -24212,15 +26829,17 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: $ref: '#/components/schemas/OrderRow' meta: - type: object - nullable: true + type: + - object + - 'null' OrderRowResponse: type: object required: @@ -24233,13 +26852,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/OrderRow' meta: - type: object - nullable: true + type: + - object + - 'null' PaymentPaginatedListResponse: type: object required: @@ -24252,8 +26873,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -24272,13 +26894,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/Payment' meta: - type: object - nullable: true + type: + - object + - 'null' PecDomainPaginatedListResponse: type: object required: @@ -24291,8 +26915,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -24311,13 +26936,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/PecDomain' meta: - type: object - nullable: true + type: + - object + - 'null' PecOwnerChangePaginatedListResponse: type: object required: @@ -24330,8 +26957,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -24350,13 +26978,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/PecOwnerChange' meta: - type: object - nullable: true + type: + - object + - 'null' PecPaginatedListResponse: type: object required: @@ -24369,8 +26999,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -24389,13 +27020,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/Pec' meta: - type: object - nullable: true + type: + - object + - 'null' PrepaidCreditResponse: type: object required: @@ -24408,13 +27041,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/PrepaidCredit' meta: - type: object - nullable: true + type: + - object + - 'null' PrepaidCreditOperationPaginatedListResponse: type: object required: @@ -24427,8 +27062,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -24447,13 +27083,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/PrepaidCreditOperation' meta: - type: object - nullable: true + type: + - object + - 'null' PrepaidCreditTopupPaginatedListResponse: type: object required: @@ -24466,8 +27104,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -24486,15 +27125,17 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: $ref: '#/components/schemas/Order' meta: - type: object - nullable: true + type: + - object + - 'null' PrepaidCreditTopupResponse: type: object required: @@ -24507,13 +27148,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/PrepaidCreditTopup' meta: - type: object - nullable: true + type: + - object + - 'null' PurchasePaginatedListResponse: type: object required: @@ -24526,8 +27169,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -24546,13 +27190,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/Purchase' meta: - type: object - nullable: true + type: + - object + - 'null' PurchaseCanChangeRenewStatusResponse: type: object required: @@ -24565,13 +27211,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/PurchaseCanChangeRenewStatus' meta: - type: object - nullable: true + type: + - object + - 'null' PurchaseCanChangeRecurrenceResponse: type: object required: @@ -24584,13 +27232,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/PurchaseCanChangeRecurrence' meta: - type: object - nullable: true + type: + - object + - 'null' PurchaseCanCancelResponse: type: object required: @@ -24603,13 +27253,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/PurchaseCanCancel' meta: - type: object - nullable: true + type: + - object + - 'null' PurchaseCanRenewResponse: type: object required: @@ -24622,13 +27274,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/PurchaseCanRenew' meta: - type: object - nullable: true + type: + - object + - 'null' PurchaseCanChangeServiceResponse: type: object required: @@ -24641,13 +27295,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/PurchaseCanChangeService' meta: - type: object - nullable: true + type: + - object + - 'null' PurchaseCanAddAdditionalResponse: type: object required: @@ -24660,13 +27316,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/PurchaseCanAddAdditional' meta: - type: object - nullable: true + type: + - object + - 'null' ServerMonitoringPaginatedListResponse: type: object required: @@ -24679,8 +27337,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -24699,13 +27358,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/ServerMonitoring' meta: - type: object - nullable: true + type: + - object + - 'null' ServerMonitoringProbeListResponse: type: object required: @@ -24718,15 +27379,17 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: $ref: '#/components/schemas/ServerMonitoringProbe' meta: - type: object - nullable: true + type: + - object + - 'null' ServerMonitoringProbeResponse: type: object required: @@ -24739,13 +27402,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/ServerMonitoringProbe' meta: - type: object - nullable: true + type: + - object + - 'null' ServerMonitoringProbeChartResponse: type: object required: @@ -24758,13 +27423,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/ServerMonitoringProbeChart' meta: - type: object - nullable: true + type: + - object + - 'null' ServerPaginatedListResponse: type: object required: @@ -24777,8 +27444,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -24797,13 +27465,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/Server' meta: - type: object - nullable: true + type: + - object + - 'null' ServerCredentialResponse: type: object required: @@ -24816,13 +27486,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/ServerCredential' meta: - type: object - nullable: true + type: + - object + - 'null' ServerCanActionResponse: type: object required: @@ -24835,13 +27507,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/ServerCanAction' meta: - type: object - nullable: true + type: + - object + - 'null' ServerSnapshotPaginatedListResponse: type: object required: @@ -24854,8 +27528,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -24874,13 +27549,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/ServerSnapshot' meta: - type: object - nullable: true + type: + - object + - 'null' ServerBackupResponse: type: object required: @@ -24893,13 +27570,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/ServerBackup' meta: - type: object - nullable: true + type: + - object + - 'null' IpAddressListResponse: type: object required: @@ -24912,15 +27591,17 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: $ref: '#/components/schemas/IpAddress' meta: - type: object - nullable: true + type: + - object + - 'null' IpAddressResponse: type: object required: @@ -24933,13 +27614,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/IpAddress' meta: - type: object - nullable: true + type: + - object + - 'null' PrivateCloudResponse: type: object required: @@ -24952,13 +27635,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/PrivateCloud' meta: - type: object - nullable: true + type: + - object + - 'null' ServerAutomaticSnapshotResponse: type: object required: @@ -24971,13 +27656,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/ServerAutomaticSnapshot' meta: - type: object - nullable: true + type: + - object + - 'null' ServerNetworkInterfaceListResponse: type: object required: @@ -24990,15 +27677,17 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: $ref: '#/components/schemas/ServerNetworkInterface' meta: - type: object - nullable: true + type: + - object + - 'null' ServerNetworkInterfaceResponse: type: object required: @@ -25011,13 +27700,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/ServerNetworkInterface' meta: - type: object - nullable: true + type: + - object + - 'null' ServicePaginatedListResponse: type: object required: @@ -25030,8 +27721,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -25050,13 +27742,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/Microsoft365DomainAvailable' meta: - type: object - nullable: true + type: + - object + - 'null' ServiceListResponse: type: object required: @@ -25069,15 +27763,17 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: $ref: '#/components/schemas/Service' meta: - type: object - nullable: true + type: + - object + - 'null' ServiceServerListResponse: type: object required: @@ -25090,15 +27786,17 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: $ref: '#/components/schemas/ServiceServer' meta: - type: object - nullable: true + type: + - object + - 'null' SmsPaginatedListResponse: type: object required: @@ -25111,8 +27809,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -25131,13 +27830,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/Sms' meta: - type: object - nullable: true + type: + - object + - 'null' SmsCanCancelResponse: type: object required: @@ -25150,13 +27851,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/SmsCanCancel' meta: - type: object - nullable: true + type: + - object + - 'null' SmsCanDeleteResponse: type: object required: @@ -25169,13 +27872,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/SmsCanDelete' meta: - type: object - nullable: true + type: + - object + - 'null' SmsMessagePaginatedListResponse: type: object required: @@ -25188,8 +27893,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -25208,13 +27914,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/SmsMessage' meta: - type: object - nullable: true + type: + - object + - 'null' SmsAccountResponse: type: object required: @@ -25227,13 +27935,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/SmsAccount' meta: - type: object - nullable: true + type: + - object + - 'null' SmsPricePaginatedListResponse: type: object required: @@ -25246,8 +27956,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -25266,13 +27977,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/SmsPrice' meta: - type: object - nullable: true + type: + - object + - 'null' SmsPhonebookPaginatedListResponse: type: object required: @@ -25285,8 +27998,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -25305,13 +28019,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/SmsPhonebook' meta: - type: object - nullable: true + type: + - object + - 'null' SmsPhonebookContactPaginatedListResponse: type: object required: @@ -25324,8 +28040,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -25344,8 +28061,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -25364,13 +28082,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/SslCertificate' meta: - type: object - nullable: true + type: + - object + - 'null' SslCertificateKeysResponse: type: object required: @@ -25383,13 +28103,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/SslCertificateKeys' meta: - type: object - nullable: true + type: + - object + - 'null' SslCertificateApproverEmailsResponse: type: object required: @@ -25402,13 +28124,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/SslCertificateApproverEmails' meta: - type: object - nullable: true + type: + - object + - 'null' SslCertificateCanReemitResponse: type: object required: @@ -25421,13 +28145,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/SslCertificateCanReemit' meta: - type: object - nullable: true + type: + - object + - 'null' SslCertificateExportFormatListResponse: type: object required: @@ -25440,15 +28166,17 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: $ref: '#/components/schemas/SslCertificateExportFormat' meta: - type: object - nullable: true + type: + - object + - 'null' SslCertificateExportResponse: type: object required: @@ -25461,13 +28189,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/SslCertificateExport' meta: - type: object - nullable: true + type: + - object + - 'null' SslCertificateKeyResponse: type: object required: @@ -25480,13 +28210,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/SslCertificateKey' meta: - type: object - nullable: true + type: + - object + - 'null' CloudStoragePaginatedListResponse: type: object required: @@ -25499,8 +28231,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -25519,13 +28252,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/CloudStorage' meta: - type: object - nullable: true + type: + - object + - 'null' CloudStorageAccessPaginatedListResponse: type: object required: @@ -25538,8 +28273,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -25558,13 +28294,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/CloudStorageAccess' meta: - type: object - nullable: true + type: + - object + - 'null' ObjectStoragePaginatedListResponse: type: object required: @@ -25577,8 +28315,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -25597,13 +28336,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/ObjectStorage' meta: - type: object - nullable: true + type: + - object + - 'null' ObjectStorageS3KeyResponse: type: object required: @@ -25616,13 +28357,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/ObjectStorageS3Key' meta: - type: object - nullable: true + type: + - object + - 'null' ObjectStorageIamUserPaginatedListResponse: type: object required: @@ -25635,8 +28378,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -25655,13 +28399,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/ObjectStorageIamUser' meta: - type: object - nullable: true + type: + - object + - 'null' ObjectStorageBucketPaginatedListResponse: type: object required: @@ -25674,8 +28420,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -25694,13 +28441,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/ObjectStorageBucket' meta: - type: object - nullable: true + type: + - object + - 'null' CloudStorageUserListResponse: type: object required: @@ -25713,15 +28462,17 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: $ref: '#/components/schemas/CloudStorageUser' meta: - type: object - nullable: true + type: + - object + - 'null' CloudStorageUserResponse: type: object required: @@ -25734,13 +28485,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/CloudStorageUser' meta: - type: object - nullable: true + type: + - object + - 'null' ObjectStorageBucketChartResponse: type: object required: @@ -25753,13 +28506,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/ObjectStorageBucketChart' meta: - type: object - nullable: true + type: + - object + - 'null' ObjectStorageBucketFirewallEntryPaginatedListResponse: type: object required: @@ -25772,8 +28527,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -25792,13 +28548,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/ObjectStorageBucketFirewallEntry' meta: - type: object - nullable: true + type: + - object + - 'null' ObjectStorageIamUserS3KeyListResponse: type: object required: @@ -25811,15 +28569,17 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: $ref: '#/components/schemas/ObjectStorageIamUserS3Key' meta: - type: object - nullable: true + type: + - object + - 'null' ObjectStorageIamUserS3KeyResponse: type: object required: @@ -25832,13 +28592,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/ObjectStorageIamUserS3Key' meta: - type: object - nullable: true + type: + - object + - 'null' AccountPaginatedListResponse: type: object required: @@ -25851,8 +28613,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -25871,8 +28634,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -25891,8 +28655,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -25911,13 +28676,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/Tld' meta: - type: object - nullable: true + type: + - object + - 'null' ApiUploadResponse: type: object required: @@ -25930,13 +28697,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/ApiUpload' meta: - type: object - nullable: true + type: + - object + - 'null' WebMonitoringPaginatedListResponse: type: object required: @@ -25949,8 +28718,9 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: type: array items: @@ -25969,13 +28739,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/WebMonitoring' meta: - type: object - nullable: true + type: + - object + - 'null' WebMonitoringNoticesResponse: type: object required: @@ -25988,13 +28760,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/WebMonitoringNotices' meta: - type: object - nullable: true + type: + - object + - 'null' WebMonitoringDownloadSpeedChartResponse: type: object required: @@ -26007,13 +28781,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/WebMonitoringDownloadSpeedChart' meta: - type: object - nullable: true + type: + - object + - 'null' WebMonitoringResponseTimeChartResponse: type: object required: @@ -26026,13 +28802,15 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/WebMonitoringResponseTimeChart' meta: - type: object - nullable: true + type: + - object + - 'null' WebMonitoringAvailabilityChartResponse: type: object required: @@ -26045,13 +28823,42 @@ components: type: integer example: 0 message: - type: string - nullable: true + type: + - string + - 'null' data: $ref: '#/components/schemas/WebMonitoringAvailabilityChart' meta: - type: object - nullable: true + type: + - object + - 'null' + responses: + TooManyRequests: + description: 'Troppe richieste: riprova dopo i secondi indicati in Retry-After' + headers: + Retry-After: + description: Secondi da attendere prima di riprovare + schema: + type: integer + minimum: 1 + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + TokenTooManyRequests: + description: >- + Troppe richieste al token endpoint (errore OAuth2 `rate_limited`): + riprova dopo i secondi indicati in Retry-After + headers: + Retry-After: + description: Secondi da attendere prima di riprovare + schema: + type: integer + minimum: 1 + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthError' securitySchemes: oauth2: type: oauth2 From 08e68cfbe752d2e808359aeb5126aa87f2c39d74 Mon Sep 17 00:00:00 2001 From: Tobia Zanarella Date: Wed, 30 Sep 2026 22:31:12 +0200 Subject: [PATCH 2/3] Generate the client with openapi-python-client 0.29.1 bin/generate runs the generator and Ruff, both pinned, through uvx, with --fail-on-warning so that no operation is skipped silently, and replaces src/shellrent_sdk/client entirely. The content type overrides return the PDF, XML and p7m downloads as File with the raw bytes: without them the PDFs are dropped and the XML is decoded as text. The generated code is never edited by hand. Co-Authored-By: Claude Opus 5.5 --- bin/generate | 30 + openapi-python-client.yaml | 12 + src/shellrent_sdk/client/__init__.py | 8 + src/shellrent_sdk/client/api/__init__.py | 1 + .../client/api/account/__init__.py | 1 + .../client/api/account/create_sub_account.py | 194 +++ .../client/api/account/delete_sub_account.py | 189 +++ .../client/api/account/get_account.py | 162 +++ .../client/api/account/get_sub_account.py | 189 +++ .../client/api/account/list_sub_accounts.py | 209 +++ .../client/api/account/update_sub_account.py | 210 +++ .../client/api/account/upload_file.py | 195 +++ .../client/api/billing/__init__.py | 1 + .../api/billing/download_credit_note_pdf.py | 189 +++ .../api/billing/download_credit_note_xml.py | 210 +++ .../api/billing/download_invoice_pdf.py | 189 +++ .../api/billing/download_invoice_xml.py | 210 +++ .../client/api/billing/get_credit_note.py | 189 +++ .../client/api/billing/get_credit_note_row.py | 203 +++ .../client/api/billing/get_invoice.py | 189 +++ .../client/api/billing/get_invoice_row.py | 203 +++ .../api/billing/list_credit_note_rows.py | 189 +++ .../client/api/billing/list_credit_notes.py | 246 ++++ .../client/api/billing/list_invoice_rows.py | 189 +++ .../client/api/billing/list_invoices.py | 261 ++++ .../client/api/domains/__init__.py | 1 + .../api/domains/activate_domain_dnssec.py | 189 +++ .../domains/apply_domain_contact_changes.py | 189 +++ .../api/domains/can_activate_domain_dnssec.py | 189 +++ .../domains/can_change_domain_nameservers.py | 189 +++ .../domains/can_deactivate_domain_dnssec.py | 189 +++ .../api/domains/check_domain_availability.py | 194 +++ .../api/domains/create_domain_dns_record.py | 210 +++ .../api/domains/deactivate_domain_dnssec.py | 193 +++ .../api/domains/delete_domain_dns_record.py | 203 +++ .../client/api/domains/get_domain.py | 189 +++ .../client/api/domains/get_domain_contact.py | 203 +++ .../api/domains/get_domain_dns_record.py | 203 +++ .../client/api/domains/get_domain_dns_zone.py | 189 +++ .../client/api/domains/get_domain_dnssec.py | 189 +++ .../api/domains/list_domain_contacts.py | 189 +++ .../api/domains/list_domain_dns_records.py | 278 ++++ .../client/api/domains/list_domains.py | 269 ++++ .../set_domain_cloudflare_nameservers.py | 212 +++ .../set_domain_external_nameservers.py | 210 +++ .../set_domain_standard_nameservers.py | 189 +++ .../api/domains/update_domain_contact.py | 224 +++ .../api/domains/update_domain_dns_record.py | 224 +++ .../api/domains/update_domain_dns_zone.py | 210 +++ .../api/domains/update_domain_dnssec.py | 210 +++ .../client/api/health/__init__.py | 1 + .../client/api/health/get_health.py | 152 ++ .../client/api/hosting/__init__.py | 1 + .../create_hosting_allow_list_entry.py | 210 +++ .../create_hosting_block_list_entry.py | 210 +++ .../api/hosting/create_hosting_catch_all.py | 210 +++ .../api/hosting/create_hosting_cronjob.py | 210 +++ .../api/hosting/create_hosting_database.py | 210 +++ .../api/hosting/create_hosting_email_alias.py | 210 +++ .../create_hosting_mod_security_rule.py | 210 +++ .../api/hosting/create_hosting_subdomain.py | 210 +++ .../delete_all_hosting_mod_security_rules.py | 189 +++ .../delete_hosting_allow_list_entry.py | 203 +++ .../delete_hosting_block_list_entry.py | 203 +++ .../api/hosting/delete_hosting_catch_all.py | 189 +++ .../api/hosting/delete_hosting_cronjob.py | 203 +++ .../api/hosting/delete_hosting_email_alias.py | 203 +++ .../hosting/delete_hosting_exposed_backup.py | 203 +++ .../delete_hosting_mod_security_rule.py | 203 +++ .../api/hosting/delete_hosting_subdomain.py | 189 +++ .../enable_hosting_mod_security_rules.py | 210 +++ .../api/hosting/expose_hosting_backups.py | 210 +++ .../client/api/hosting/get_hosting.py | 189 +++ .../hosting/get_hosting_allow_list_entry.py | 203 +++ .../api/hosting/get_hosting_antivirus.py | 189 +++ .../get_hosting_antivirus_removal_scan.py | 203 +++ .../api/hosting/get_hosting_antivirus_scan.py | 203 +++ .../client/api/hosting/get_hosting_backup.py | 203 +++ .../hosting/get_hosting_block_list_entry.py | 203 +++ .../api/hosting/get_hosting_catch_all.py | 189 +++ .../api/hosting/get_hosting_credentials.py | 189 +++ .../client/api/hosting/get_hosting_cronjob.py | 203 +++ .../api/hosting/get_hosting_database.py | 203 +++ .../api/hosting/get_hosting_email_alias.py | 203 +++ .../api/hosting/get_hosting_mod_security.py | 189 +++ .../hosting/get_hosting_mod_security_rule.py | 203 +++ .../hosting/get_hosting_mod_security_scan.py | 203 +++ .../hosting/get_hosting_ssl_certificate.py | 203 +++ .../install_hosting_ssl_certificate.py | 211 +++ .../list_hosting_allow_list_entries.py | 227 +++ .../list_hosting_antivirus_removal_scans.py | 227 +++ .../hosting/list_hosting_antivirus_scans.py | 227 +++ .../api/hosting/list_hosting_backups.py | 189 +++ .../list_hosting_block_list_entries.py | 227 +++ .../api/hosting/list_hosting_cronjobs.py | 225 +++ .../api/hosting/list_hosting_databases.py | 189 +++ .../api/hosting/list_hosting_dns_records.py | 189 +++ .../api/hosting/list_hosting_email_aliases.py | 189 +++ .../hosting/list_hosting_exposed_backups.py | 189 +++ .../list_hosting_mod_security_rules.py | 189 +++ .../list_hosting_mod_security_scans.py | 227 +++ .../api/hosting/list_hosting_php_versions.py | 189 +++ .../hosting/list_hosting_ssl_certificates.py | 189 +++ .../client/api/hosting/list_hostings.py | 209 +++ .../hosting/remove_hosting_ssl_certificate.py | 203 +++ .../api/hosting/restore_hosting_backup.py | 203 +++ .../start_hosting_antivirus_removal_scan.py | 189 +++ .../hosting/start_hosting_antivirus_scan.py | 189 +++ .../api/hosting/start_hosting_first_backup.py | 189 +++ .../api/hosting/update_hosting_catch_all.py | 210 +++ .../hosting/update_hosting_file_protection.py | 210 +++ .../hosting/update_hosting_http_version.py | 210 +++ .../hosting/update_hosting_mod_security.py | 210 +++ .../hosting/update_hosting_php_settings.py | 210 +++ .../api/hosting/update_hosting_php_version.py | 210 +++ .../client/api/license_/__init__.py | 1 + ...ade_microsoft_365_subscription_quantity.py | 212 +++ .../downgrade_secure_mail_quantity.py | 214 +++ .../client/api/license_/get_cpanel_license.py | 189 +++ .../get_microsoft_365_partner_link.py | 189 +++ .../get_microsoft_365_subscription.py | 189 +++ .../api/license_/get_microsoft_365_tenant.py | 189 +++ .../client/api/license_/get_plesk_license.py | 189 +++ .../client/api/license_/get_secure_mail.py | 189 +++ .../license_/get_secure_mail_statistics.py | 189 +++ .../api/license_/list_cpanel_licenses.py | 209 +++ .../list_microsoft_365_subscriptions.py | 209 +++ .../license_/list_microsoft_365_tenants.py | 211 +++ .../api/license_/list_plesk_licenses.py | 209 +++ .../license_/list_secure_mail_mailboxes.py | 227 +++ .../client/api/license_/list_secure_mails.py | 209 +++ ...ade_microsoft_365_subscription_quantity.py | 212 +++ .../license_/upgrade_secure_mail_quantity.py | 214 +++ .../client/api/monitoring/__init__.py | 1 + .../create_server_monitoring_probe.py | 210 +++ .../delete_server_monitoring_probe.py | 203 +++ .../api/monitoring/get_server_monitoring.py | 189 +++ .../monitoring/get_server_monitoring_probe.py | 203 +++ .../get_server_monitoring_probe_chart.py | 203 +++ .../api/monitoring/get_web_monitoring.py | 189 +++ .../get_web_monitoring_availability_chart.py | 191 +++ ...get_web_monitoring_download_speed_chart.py | 191 +++ .../monitoring/get_web_monitoring_notices.py | 189 +++ .../get_web_monitoring_response_time_chart.py | 191 +++ .../list_server_monitoring_probes.py | 189 +++ .../api/monitoring/list_server_monitorings.py | 211 +++ .../api/monitoring/list_web_monitorings.py | 209 +++ .../update_server_monitoring_probe.py | 224 +++ .../update_web_monitoring_notices.py | 210 +++ .../client/api/o_auth/__init__.py | 1 + .../client/api/o_auth/get_jwks.py | 142 ++ .../client/api/o_auth/request_access_token.py | 204 +++ .../client/api/payment/__init__.py | 1 + .../payment/activate_one_click_autorenew.py | 162 +++ .../activate_prepaid_credit_autorenew.py | 162 +++ .../payment/create_prepaid_credit_topup.py | 194 +++ .../client/api/payment/get_one_click.py | 189 +++ .../api/payment/get_one_click_autorenew.py | 162 +++ .../client/api/payment/get_payment.py | 189 +++ .../client/api/payment/get_prepaid_credit.py | 162 +++ .../payment/get_prepaid_credit_operation.py | 189 +++ .../api/payment/get_prepaid_credit_topup.py | 189 +++ .../client/api/payment/list_one_clicks.py | 261 ++++ .../client/api/payment/list_payments.py | 261 ++++ .../payment/list_prepaid_credit_operations.py | 248 ++++ .../api/payment/list_prepaid_credit_topups.py | 308 ++++ .../api/payment/revoke_one_click_autorenew.py | 162 +++ .../revoke_prepaid_credit_autorenew.py | 162 +++ src/shellrent_sdk/client/api/pec/__init__.py | 1 + .../api/pec/create_pec_domain_owner_change.py | 210 +++ .../pec/create_pec_mailbox_owner_change.py | 210 +++ .../client/api/pec/get_pec_domain.py | 189 +++ .../api/pec/get_pec_domain_owner_change.py | 203 +++ .../client/api/pec/get_pec_mailbox.py | 189 +++ .../api/pec/list_pec_domain_owner_changes.py | 225 +++ .../client/api/pec/list_pec_domains.py | 209 +++ .../api/pec/list_pec_mailbox_owner_changes.py | 225 +++ .../client/api/pec/list_pec_mailboxes.py | 209 +++ .../client/api/pec/update_pec_mailbox.py | 210 +++ .../client/api/purchases/__init__.py | 1 + .../purchases/can_add_purchase_additional.py | 189 +++ .../api/purchases/can_cancel_purchase.py | 189 +++ .../can_change_purchase_recurrence.py | 203 +++ .../can_change_purchase_renew_status.py | 203 +++ .../purchases/can_change_purchase_service.py | 193 +++ .../api/purchases/can_renew_purchase.py | 189 +++ .../client/api/purchases/cancel_purchase.py | 189 +++ .../purchases/change_purchase_recurrence.py | 215 +++ .../purchases/change_purchase_renew_status.py | 215 +++ .../api/purchases/complete_task_data.py | 210 +++ .../purchases/delete_purchase_billing_info.py | 189 +++ .../api/purchases/delete_purchase_comment.py | 189 +++ .../client/api/purchases/get_purchase.py | 189 +++ .../client/api/purchases/get_task.py | 189 +++ .../client/api/purchases/list_purchases.py | 406 ++++++ .../client/api/purchases/list_tasks.py | 254 ++++ .../client/api/purchases/renew_purchase.py | 189 +++ .../purchases/update_purchase_billing_info.py | 215 +++ .../api/purchases/update_purchase_comment.py | 215 +++ .../client/api/server/__init__.py | 1 + .../api/server/can_hard_reboot_server.py | 189 +++ .../client/api/server/can_hard_stop_server.py | 189 +++ .../client/api/server/can_reboot_server.py | 189 +++ .../client/api/server/can_start_server.py | 189 +++ .../client/api/server/can_stop_server.py | 189 +++ .../create_private_cloud_virtual_machine.py | 210 +++ .../create_server_automatic_snapshot.py | 210 +++ .../server/create_server_network_interface.py | 210 +++ .../delete_private_cloud_virtual_machine.py | 203 +++ .../delete_server_automatic_snapshot.py | 189 +++ .../server/delete_server_exposed_backups.py | 189 +++ .../delete_server_ip_address_reverse_dns.py | 203 +++ .../server/delete_server_network_interface.py | 203 +++ .../api/server/delete_server_snapshot.py | 203 +++ .../client/api/server/expose_server_backup.py | 210 +++ .../client/api/server/get_server.py | 189 +++ .../server/get_server_automatic_snapshot.py | 189 +++ .../client/api/server/get_server_backup.py | 203 +++ .../api/server/get_server_ip_address.py | 203 +++ .../server/get_server_network_interface.py | 203 +++ .../api/server/get_server_private_cloud.py | 189 +++ .../client/api/server/get_server_snapshot.py | 203 +++ .../client/api/server/hard_reboot_server.py | 189 +++ .../client/api/server/hard_stop_server.py | 189 +++ .../client/api/server/list_server_backups.py | 189 +++ .../api/server/list_server_credentials.py | 189 +++ .../api/server/list_server_exposed_backups.py | 189 +++ .../api/server/list_server_ip_addresses.py | 189 +++ .../server/list_server_network_interfaces.py | 189 +++ .../api/server/list_server_snapshots.py | 225 +++ .../client/api/server/list_servers.py | 209 +++ .../client/api/server/reboot_server.py | 189 +++ .../client/api/server/reinstall_server.py | 211 +++ .../api/server/restore_server_backup.py | 203 +++ .../api/server/restore_server_snapshot.py | 203 +++ .../client/api/server/start_server.py | 189 +++ .../api/server/start_server_first_backup.py | 189 +++ .../client/api/server/stop_server.py | 189 +++ .../update_private_cloud_virtual_machine.py | 224 +++ .../update_server_automatic_snapshot.py | 210 +++ .../update_server_ip_address_reverse_dns.py | 224 +++ src/shellrent_sdk/client/api/shop/__init__.py | 1 + .../client/api/shop/buy_active_monitoring.py | 194 +++ .../client/api/shop/buy_cloud_storage.py | 194 +++ .../client/api/shop/buy_cloud_vps.py | 194 +++ .../client/api/shop/buy_cpanel_license.py | 194 +++ .../client/api/shop/buy_dedicated_server.py | 194 +++ .../client/api/shop/buy_domain.py | 194 +++ .../shop/buy_microsoft_365_subscription.py | 194 +++ .../client/api/shop/buy_object_storage.py | 194 +++ src/shellrent_sdk/client/api/shop/buy_pec.py | 194 +++ .../client/api/shop/buy_pec_domain.py | 194 +++ .../client/api/shop/buy_plesk_license.py | 194 +++ .../client/api/shop/buy_private_cloud_sv.py | 194 +++ .../client/api/shop/buy_secure_mail.py | 194 +++ .../buy_secure_mail_for_google_workspace.py | 196 +++ .../shop/buy_secure_mail_for_microsoft_365.py | 196 +++ .../client/api/shop/buy_sms_topup.py | 194 +++ .../client/api/shop/buy_ssl_certificate.py | 194 +++ .../client/api/shop/buy_veeam_baas.py | 194 +++ .../client/api/shop/can_cancel_order.py | 189 +++ .../client/api/shop/can_pay_order.py | 189 +++ .../client/api/shop/cancel_order.py | 189 +++ ...check_microsoft_365_domain_availability.py | 194 +++ .../client/api/shop/get_order.py | 189 +++ .../client/api/shop/get_order_row.py | 203 +++ src/shellrent_sdk/client/api/shop/get_tld.py | 189 +++ .../shop/list_active_monitoring_products.py | 209 +++ .../api/shop/list_cloud_storage_products.py | 209 +++ .../api/shop/list_cloud_vps_products.py | 209 +++ .../api/shop/list_cpanel_license_products.py | 209 +++ .../shop/list_dedicated_server_products.py | 209 +++ .../api/shop/list_microsoft_365_products.py | 209 +++ .../client/api/shop/list_order_rows.py | 189 +++ .../client/api/shop/list_orders.py | 326 +++++ .../client/api/shop/list_pec_products.py | 209 +++ .../api/shop/list_plesk_license_products.py | 209 +++ .../shop/list_private_cloud_sv_products.py | 209 +++ .../shop/list_shop_microsoft_365_tenants.py | 230 +++ .../api/shop/list_sms_topup_products.py | 209 +++ .../api/shop/list_ssl_certificate_products.py | 209 +++ .../client/api/shop/list_tlds.py | 269 ++++ .../client/api/shop/pay_orders.py | 222 +++ src/shellrent_sdk/client/api/sms/__init__.py | 1 + .../api/sms/add_sms_phonebook_contacts.py | 210 +++ .../client/api/sms/can_cancel_sms.py | 189 +++ .../client/api/sms/can_delete_sms.py | 189 +++ .../client/api/sms/cancel_sms.py | 189 +++ .../client/api/sms/create_sms_phonebook.py | 194 +++ .../sms/delete_all_sms_phonebook_contacts.py | 189 +++ .../client/api/sms/delete_sms.py | 189 +++ .../client/api/sms/delete_sms_phonebook.py | 189 +++ .../api/sms/delete_sms_phonebook_contact.py | 203 +++ src/shellrent_sdk/client/api/sms/get_sms.py | 189 +++ .../client/api/sms/get_sms_credit.py | 162 +++ .../client/api/sms/get_sms_message.py | 203 +++ .../client/api/sms/get_sms_phonebook.py | 189 +++ .../client/api/sms/get_sms_price.py | 189 +++ src/shellrent_sdk/client/api/sms/list_sms.py | 266 ++++ .../client/api/sms/list_sms_messages.py | 189 +++ .../api/sms/list_sms_phonebook_contacts.py | 227 +++ .../client/api/sms/list_sms_phonebooks.py | 209 +++ .../client/api/sms/list_sms_prices.py | 162 +++ .../api/sms/replace_sms_phonebook_contacts.py | 210 +++ src/shellrent_sdk/client/api/sms/send_sms.py | 202 +++ .../client/api/sms/update_sms_phonebook.py | 210 +++ src/shellrent_sdk/client/api/ssl/__init__.py | 1 + .../api/ssl/can_reemit_ssl_certificate.py | 189 +++ .../client/api/ssl/export_ssl_certificate.py | 203 +++ .../client/api/ssl/get_ssl_certificate.py | 189 +++ .../api/ssl/get_ssl_certificate_keys.py | 189 +++ .../api/ssl/list_ssl_approver_emails.py | 189 +++ .../list_ssl_certificate_export_formats.py | 191 +++ .../client/api/ssl/list_ssl_certificates.py | 239 +++ .../client/api/ssl/reemit_ssl_certificate.py | 210 +++ .../api/ssl/update_ssl_certificate_csr.py | 210 +++ .../api/ssl/update_ssl_certificate_owner.py | 210 +++ .../client/api/storage/__init__.py | 1 + .../storage/create_cloud_storage_access.py | 210 +++ ...te_object_storage_bucket_firewall_entry.py | 228 +++ .../storage/create_object_storage_iam_user.py | 189 +++ .../create_object_storage_iam_user_s3_key.py | 203 +++ .../storage/delete_cloud_storage_access.py | 203 +++ .../api/storage/delete_cloud_storage_user.py | 203 +++ ...te_object_storage_bucket_firewall_entry.py | 219 +++ .../storage/delete_object_storage_iam_user.py | 203 +++ .../delete_object_storage_iam_user_s3_key.py | 217 +++ .../storage/downgrade_cloud_storage_size.py | 189 +++ .../client/api/storage/get_cloud_storage.py | 189 +++ .../api/storage/get_cloud_storage_access.py | 203 +++ .../api/storage/get_cloud_storage_user.py | 203 +++ .../client/api/storage/get_object_storage.py | 189 +++ .../api/storage/get_object_storage_bucket.py | 203 +++ .../get_object_storage_bucket_chart.py | 203 +++ ...et_object_storage_bucket_firewall_entry.py | 219 +++ .../storage/get_object_storage_iam_user.py | 203 +++ .../get_object_storage_iam_user_s3_key.py | 217 +++ .../api/storage/get_object_storage_s3_key.py | 189 +++ .../storage/list_cloud_storage_accesses.py | 227 +++ .../api/storage/list_cloud_storage_users.py | 189 +++ .../client/api/storage/list_cloud_storages.py | 209 +++ ..._object_storage_bucket_firewall_entries.py | 243 ++++ .../storage/list_object_storage_buckets.py | 227 +++ .../list_object_storage_iam_user_s3_keys.py | 205 +++ .../storage/list_object_storage_iam_users.py | 227 +++ .../api/storage/list_object_storages.py | 209 +++ .../storage/update_cloud_storage_user_size.py | 224 +++ .../api/storage/upgrade_cloud_storage_size.py | 189 +++ src/shellrent_sdk/client/client.py | 264 ++++ src/shellrent_sdk/client/errors.py | 16 + src/shellrent_sdk/client/models/__init__.py | 1289 +++++++++++++++++ src/shellrent_sdk/client/models/account.py | 208 +++ .../client/models/account_billing.py | 333 +++++ .../models/account_paginated_list_response.py | 99 ++ .../client/models/account_response.py | 110 ++ .../models/account_response_meta_type_0.py | 45 + src/shellrent_sdk/client/models/amount.py | 114 ++ .../client/models/amount_simple.py | 63 + src/shellrent_sdk/client/models/api_error.py | 125 ++ .../client/models/api_error_data_type_0.py | 47 + .../client/models/api_error_meta_type_0.py | 47 + src/shellrent_sdk/client/models/api_upload.py | 107 ++ .../client/models/api_upload_response.py | 112 ++ .../models/api_upload_response_meta_type_0.py | 45 + .../client/models/billing_data.py | 89 ++ .../buy_prepaid_credit_topup_request.py | 59 + ...buy_prepaid_credit_topup_request_amount.py | 17 + .../buy_service_active_monitoring_request.py | 94 ++ ..._service_active_monitoring_request_data.py | 85 ++ .../buy_service_cloud_storage_request.py | 77 + .../models/buy_service_cloud_vps_request.py | 95 ++ .../buy_service_cloud_vps_request_data.py | 77 + ...ice_cloud_vps_request_data_diskquantity.py | 24 + .../buy_service_cpanel_license_request.py | 84 ++ ...buy_service_cpanel_license_request_data.py | 72 + ..._license_request_data_installation_type.py | 9 + .../buy_service_dedicated_server_request.py | 95 ++ ...y_service_dedicated_server_request_data.py | 49 + .../models/buy_service_domain_request.py | 89 ++ ...uy_service_domain_request_configuration.py | 49 + .../models/buy_service_domain_request_data.py | 70 + ...ervice_domain_request_data_contact_data.py | 47 + .../buy_service_microsoft_365_request.py | 93 ++ .../buy_service_microsoft_365_request_data.py | 325 +++++ ...rvice_microsoft_365_request_data_locale.py | 10 + ...icrosoft_365_request_data_tenant_choice.py | 10 + .../buy_service_object_storage_request.py | 80 + ...ce_object_storage_request_configuration.py | 52 + ...t_storage_request_configuration_tb_size.py | 21 + .../models/buy_service_pec_domain_request.py | 75 + .../buy_service_pec_domain_request_data.py | 282 ++++ ...ce_pec_domain_request_data_legal_entity.py | 13 + .../client/models/buy_service_pec_request.py | 81 ++ .../models/buy_service_pec_request_data.py | 298 ++++ ...y_service_pec_request_data_legal_entity.py | 13 + .../buy_service_plesk_license_request.py | 84 ++ .../buy_service_plesk_license_request_data.py | 72 + ..._license_request_data_installation_type.py | 9 + .../buy_service_private_cloud_sv_request.py | 94 ++ ...y_service_private_cloud_sv_request_data.py | 64 + ...ata_additionalbackupdiskservicequantity.py | 9 + ...securemail_for_google_workspace_request.py | 93 ++ ..._google_workspace_request_configuration.py | 40 + ...email_for_google_workspace_request_data.py | 62 + ...ce_securemail_for_microsoft_365_request.py | 93 ++ ...for_microsoft_365_request_configuration.py | 40 + ...curemail_for_microsoft_365_request_data.py | 70 + .../models/buy_service_securemail_request.py | 78 + ...ervice_securemail_request_configuration.py | 40 + .../client/models/buy_service_sms_request.py | 68 + .../buy_service_ssl_certificate_request.py | 86 ++ ...uy_service_ssl_certificate_request_data.py | 194 +++ ...ssl_certificate_request_data_admin_role.py | 11 + ...sl_certificate_request_data_admin_title.py | 13 + .../models/buy_service_veeam_baas_request.py | 78 + ...ervice_veeam_baas_request_configuration.py | 149 ++ .../client/models/cloud_storage.py | 159 ++ .../client/models/cloud_storage_access.py | 89 ++ .../cloud_storage_access_create_request.py | 64 + ..._storage_access_paginated_list_response.py | 99 ++ .../models/cloud_storage_access_response.py | 116 ++ ...oud_storage_access_response_meta_type_0.py | 45 + .../cloud_storage_paginated_list_response.py | 99 ++ .../client/models/cloud_storage_response.py | 112 ++ .../cloud_storage_response_meta_type_0.py | 45 + .../client/models/cloud_storage_user.py | 231 +++ .../cloud_storage_user_list_response.py | 124 ++ ..._storage_user_list_response_meta_type_0.py | 45 + .../models/cloud_storage_user_response.py | 114 ++ ...cloud_storage_user_response_meta_type_0.py | 45 + .../cloud_storage_user_size_update_request.py | 56 + .../client/models/complete_task_data_body.py | 62 + .../models/complete_task_data_body_data.py | 45 + src/shellrent_sdk/client/models/country.py | 103 ++ .../client/models/cpanel_license.py | 223 +++ .../cpanel_license_paginated_list_response.py | 99 ++ .../client/models/cpanel_license_response.py | 112 ++ .../cpanel_license_response_meta_type_0.py | 45 + src/shellrent_sdk/client/models/creditnote.py | 212 +++ .../creditnote_paginated_list_response.py | 99 ++ .../client/models/creditnote_response.py | 112 ++ .../models/creditnote_response_meta_type_0.py | 45 + .../client/models/creditnote_row.py | 161 ++ .../models/creditnote_row_list_response.py | 122 ++ ...reditnote_row_list_response_meta_type_0.py | 45 + .../client/models/creditnote_row_response.py | 112 ++ .../creditnote_row_response_meta_type_0.py | 45 + src/shellrent_sdk/client/models/dns_record.py | 215 +++ .../client/models/dns_record_caa_data.py | 89 ++ .../dns_record_paginated_list_response.py | 99 ++ .../client/models/dns_record_response.py | 112 ++ .../models/dns_record_response_meta_type_0.py | 45 + .../client/models/dns_record_tlsa_data.py | 89 ++ src/shellrent_sdk/client/models/dns_type.py | 63 + src/shellrent_sdk/client/models/dns_zone.py | 77 + .../client/models/dns_zone_response.py | 110 ++ .../models/dns_zone_response_meta_type_0.py | 45 + .../client/models/dnssec_ds_data.py | 84 ++ .../client/models/dnssec_key_data.py | 84 ++ src/shellrent_sdk/client/models/domain.py | 203 +++ .../client/models/domain_availability.py | 69 + .../models/domain_availability_response.py | 116 ++ ...omain_availability_response_meta_type_0.py | 45 + .../models/domain_can_change_nameservers.py | 77 + .../domain_can_change_nameservers_response.py | 118 ++ ...change_nameservers_response_meta_type_0.py | 45 + .../client/models/domain_contact.py | 98 ++ .../client/models/domain_contact_data.py | 63 + .../models/domain_contact_list_response.py | 122 ++ ...omain_contact_list_response_meta_type_0.py | 45 + .../client/models/domain_contact_request.py | 76 + ...omain_contact_request_contact_data_item.py | 63 + .../client/models/domain_contact_response.py | 112 ++ .../domain_contact_response_meta_type_0.py | 45 + .../client/models/domain_data.py | 266 ++++ .../domain_dns_nameservers_change_request.py | 121 ++ ...main_dns_nameservers_cloudflare_request.py | 63 + .../domain_dns_record_change_request.py | 169 +++ ...main_dns_record_change_request_caa_data.py | 72 + ...ain_dns_record_change_request_tlsa_data.py | 72 + .../models/domain_dns_record_request.py | 172 +++ .../domain_dns_record_request_caa_data.py | 72 + .../domain_dns_record_request_tlsa_data.py | 72 + .../client/models/domain_dns_zone_request.py | 56 + .../client/models/domain_dnssec.py | 87 ++ .../models/domain_dnssec_can_activate.py | 63 + .../domain_dnssec_can_activate_response.py | 116 ++ ...nssec_can_activate_response_meta_type_0.py | 45 + .../models/domain_dnssec_can_deactivate.py | 63 + .../domain_dnssec_can_deactivate_response.py | 116 ++ ...sec_can_deactivate_response_meta_type_0.py | 45 + .../client/models/domain_dnssec_request.py | 140 ++ .../models/domain_dnssec_request_ds_data_1.py | 83 ++ ...in_dnssec_request_ds_data_1_digest_type.py | 10 + .../models/domain_dnssec_request_ds_data_2.py | 83 ++ ...in_dnssec_request_ds_data_2_digest_type.py | 10 + ...domain_dnssec_request_key_data_256_item.py | 74 + ...sec_request_key_data_256_item_algorithm.py | 9 + ...domain_dnssec_request_key_data_257_item.py | 74 + ...sec_request_key_data_257_item_algorithm.py | 9 + .../client/models/domain_dnssec_response.py | 112 ++ .../domain_dnssec_response_meta_type_0.py | 45 + .../client/models/domain_name.py | 128 ++ .../models/domain_paginated_list_response.py | 99 ++ .../client/models/domain_response.py | 110 ++ .../models/domain_response_meta_type_0.py | 45 + .../client/models/empty_response.py | 128 ++ .../models/empty_response_data_type_0.py | 45 + .../models/empty_response_meta_type_0.py | 45 + .../get_hosting_antivirus_response_200.py | 134 ++ ...ting_antivirus_response_200_meta_type_0.py | 45 + .../client/models/health_status.py | 56 + .../client/models/health_status_response.py | 112 ++ .../health_status_response_meta_type_0.py | 45 + src/shellrent_sdk/client/models/hosting.py | 187 +++ .../client/models/hosting_antivirus.py | 221 +++ .../models/hosting_antivirus_removal_scan.py | 110 ++ ...us_removal_scan_paginated_list_response.py | 101 ++ ...hosting_antivirus_removal_scan_response.py | 118 ++ ...virus_removal_scan_response_meta_type_0.py | 45 + .../client/models/hosting_antivirus_scan.py | 241 +++ ..._antivirus_scan_paginated_list_response.py | 99 ++ .../models/hosting_antivirus_scan_response.py | 116 ++ ...ing_antivirus_scan_response_meta_type_0.py | 45 + .../client/models/hosting_backup.py | 236 +++ .../models/hosting_backup_expose_request.py | 87 ++ .../models/hosting_backup_list_response.py | 122 ++ ...osting_backup_list_response_meta_type_0.py | 45 + .../client/models/hosting_backup_response.py | 112 ++ .../hosting_backup_response_meta_type_0.py | 45 + .../client/models/hosting_credential.py | 97 ++ .../hosting_credential_list_response.py | 124 ++ ...ng_credential_list_response_meta_type_0.py | 45 + .../client/models/hosting_cronjob.py | 211 +++ .../models/hosting_cronjob_create_request.py | 169 +++ ...hosting_cronjob_paginated_list_response.py | 99 ++ .../client/models/hosting_cronjob_response.py | 112 ++ .../hosting_cronjob_response_meta_type_0.py | 45 + .../client/models/hosting_database.py | 122 ++ .../models/hosting_database_create_request.py | 89 ++ .../models/hosting_database_list_response.py | 124 ++ ...ting_database_list_response_meta_type_0.py | 45 + .../models/hosting_database_response.py | 112 ++ .../hosting_database_response_meta_type_0.py | 45 + .../client/models/hosting_dns_record.py | 222 +++ .../hosting_dns_record_list_response.py | 124 ++ ...ng_dns_record_list_response_meta_type_0.py | 45 + .../client/models/hosting_email_alias.py | 124 ++ .../hosting_email_alias_create_request.py | 67 + .../hosting_email_alias_list_response.py | 124 ++ ...g_email_alias_list_response_meta_type_0.py | 45 + .../models/hosting_email_alias_response.py | 114 ++ ...osting_email_alias_response_meta_type_0.py | 45 + .../client/models/hosting_email_allow_list.py | 96 ++ ...mail_allow_list_paginated_list_response.py | 99 ++ .../hosting_email_allow_list_response.py | 116 ++ ...g_email_allow_list_response_meta_type_0.py | 45 + .../client/models/hosting_email_bloc_list.py | 96 ++ ...email_bloc_list_paginated_list_response.py | 99 ++ .../hosting_email_bloc_list_response.py | 116 ++ ...ng_email_bloc_list_response_meta_type_0.py | 45 + .../client/models/hosting_email_catch_all.py | 77 + .../models/hosting_email_catch_all_request.py | 58 + .../hosting_email_catch_all_response.py | 116 ++ ...ng_email_catch_all_response_meta_type_0.py | 45 + .../models/hosting_email_wblist_request.py | 87 ++ .../hosting_file_protection_update_request.py | 56 + .../hosting_http_version_update_request.py | 57 + .../client/models/hosting_mod_security.py | 140 ++ .../models/hosting_mod_security_response.py | 116 ++ ...sting_mod_security_response_meta_type_0.py | 45 + .../models/hosting_mod_security_rule.py | 90 ++ .../hosting_mod_security_rule_bulk_request.py | 58 + ...osting_mod_security_rule_create_request.py | 75 + ...hosting_mod_security_rule_list_response.py | 124 ++ ...security_rule_list_response_meta_type_0.py | 45 + .../hosting_mod_security_rule_response.py | 116 ++ ..._mod_security_rule_response_meta_type_0.py | 45 + .../models/hosting_mod_security_scan.py | 98 ++ ...d_security_scan_paginated_list_response.py | 99 ++ .../hosting_mod_security_scan_response.py | 116 ++ ..._mod_security_scan_response_meta_type_0.py | 45 + .../hosting_mod_security_update_request.py | 56 + .../models/hosting_paginated_list_response.py | 99 ++ .../hosting_php_settings_update_request.py | 66 + .../client/models/hosting_php_version.py | 70 + .../hosting_php_version_list_response.py | 124 ++ ...g_php_version_list_response_meta_type_0.py | 45 + .../hosting_php_version_update_request.py | 57 + .../client/models/hosting_response.py | 110 ++ .../models/hosting_response_meta_type_0.py | 45 + .../client/models/hosting_ssl_certificate.py | 166 +++ ...hosting_ssl_certificate_install_request.py | 84 ++ .../hosting_ssl_certificate_list_response.py | 124 ++ ...l_certificate_list_response_meta_type_0.py | 45 + .../hosting_ssl_certificate_response.py | 116 ++ ...ng_ssl_certificate_response_meta_type_0.py | 45 + .../hosting_subdomain_create_request.py | 68 + src/shellrent_sdk/client/models/invoice.py | 264 ++++ .../models/invoice_paginated_list_response.py | 99 ++ .../client/models/invoice_response.py | 110 ++ .../models/invoice_response_meta_type_0.py | 45 + .../client/models/invoice_row.py | 249 ++++ .../models/invoice_row_list_response.py | 120 ++ .../invoice_row_list_response_meta_type_0.py | 45 + .../client/models/invoice_row_response.py | 112 ++ .../invoice_row_response_meta_type_0.py | 45 + src/shellrent_sdk/client/models/ip_address.py | 161 ++ .../client/models/ip_address_list_response.py | 120 ++ .../ip_address_list_response_meta_type_0.py | 45 + .../client/models/ip_address_response.py | 112 ++ .../models/ip_address_response_meta_type_0.py | 45 + src/shellrent_sdk/client/models/jwk_key.py | 114 ++ .../client/models/jwks_response.py | 70 + .../client/models/legal_entity.py | 85 ++ .../client/models/legal_entity_group.py | 63 + .../client/models/list_orders_type.py | 9 + .../client/models/list_sms_sms_status.py | 11 + .../client/models/microsoft_365.py | 273 ++++ .../models/microsoft_365_domain_available.py | 87 ++ ...microsoft_365_domain_available_response.py | 118 ++ ...5_domain_available_response_meta_type_0.py | 45 + .../microsoft_365_paginated_list_response.py | 99 ++ .../models/microsoft_365_partner_link.py | 56 + .../microsoft_365_partner_link_response.py | 116 ++ ...t_365_partner_link_response_meta_type_0.py | 45 + .../client/models/microsoft_365_response.py | 112 ++ .../microsoft_365_response_meta_type_0.py | 45 + ...osoft_365_subscription_quantity_request.py | 57 + .../client/models/microsoft_365_tenant.py | 329 +++++ ...soft_365_tenant_paginated_list_response.py | 99 ++ .../models/microsoft_365_tenant_response.py | 116 ++ ...crosoft_365_tenant_response_meta_type_0.py | 45 + .../client/models/o_auth_audience.py | 9 + .../client/models/o_auth_error.py | 96 ++ .../client/models/o_auth_token_response.py | 86 ++ .../client/models/object_storage.py | 276 ++++ .../client/models/object_storage_bucket.py | 359 +++++ .../models/object_storage_bucket_chart.py | 93 ++ ...object_storage_bucket_chart_points_item.py | 129 ++ .../object_storage_bucket_chart_response.py | 116 ++ ...orage_bucket_chart_response_meta_type_0.py | 45 + .../object_storage_bucket_firewall_entry.py | 121 ++ ...ge_bucket_firewall_entry_create_request.py | 56 + ..._firewall_entry_paginated_list_response.py | 101 ++ ..._storage_bucket_firewall_entry_response.py | 118 ++ ...ket_firewall_entry_response_meta_type_0.py | 45 + ..._storage_bucket_paginated_list_response.py | 99 ++ .../models/object_storage_bucket_response.py | 116 ++ ...ect_storage_bucket_response_meta_type_0.py | 45 + .../client/models/object_storage_iam_user.py | 173 +++ ...torage_iam_user_paginated_list_response.py | 99 ++ .../object_storage_iam_user_response.py | 116 ++ ...t_storage_iam_user_response_meta_type_0.py | 45 + .../models/object_storage_iam_user_s3_key.py | 147 ++ ...t_storage_iam_user_s3_key_list_response.py | 126 ++ ...m_user_s3_key_list_response_meta_type_0.py | 45 + ...object_storage_iam_user_s3_key_response.py | 118 ++ ...ge_iam_user_s3_key_response_meta_type_0.py | 45 + .../object_storage_paginated_list_response.py | 99 ++ .../client/models/object_storage_response.py | 112 ++ .../object_storage_response_meta_type_0.py | 45 + .../client/models/object_storage_s3_key.py | 128 ++ .../models/object_storage_s3_key_response.py | 116 ++ ...ect_storage_s3_key_response_meta_type_0.py | 45 + src/shellrent_sdk/client/models/one_click.py | 150 ++ .../client/models/one_click_autorenew.py | 70 + .../models/one_click_autorenew_response.py | 114 ++ ...ne_click_autorenew_response_meta_type_0.py | 45 + .../one_click_paginated_list_response.py | 99 ++ .../client/models/one_click_response.py | 112 ++ .../models/one_click_response_meta_type_0.py | 45 + src/shellrent_sdk/client/models/order.py | 248 ++++ .../client/models/order_can_cancel.py | 63 + .../models/order_can_cancel_response.py | 112 ++ .../order_can_cancel_response_meta_type_0.py | 45 + .../client/models/order_can_pay.py | 108 ++ .../client/models/order_can_pay_response.py | 112 ++ .../order_can_pay_response_meta_type_0.py | 45 + .../client/models/order_invoice_status.py | 63 + .../client/models/order_list_response.py | 120 ++ .../models/order_list_response_meta_type_0.py | 45 + .../models/order_paginated_list_response.py | 99 ++ .../client/models/order_pay_request.py | 98 ++ .../client/models/order_payment_status.py | 63 + .../client/models/order_response.py | 110 ++ .../models/order_response_meta_type_0.py | 45 + src/shellrent_sdk/client/models/order_row.py | 122 ++ .../client/models/order_row_list_response.py | 120 ++ .../order_row_list_response_meta_type_0.py | 45 + .../client/models/order_row_response.py | 112 ++ .../models/order_row_response_meta_type_0.py | 45 + .../client/models/order_status.py | 63 + .../client/models/pagination_meta.py | 84 ++ .../client/models/pay_orders_response_200.py | 133 ++ .../pay_orders_response_200_meta_type_0.py | 45 + src/shellrent_sdk/client/models/payment.py | 169 +++ .../models/payment_paginated_list_response.py | 99 ++ .../models/payment_provider_data_type_0.py | 45 + .../client/models/payment_response.py | 110 ++ .../models/payment_response_meta_type_0.py | 45 + src/shellrent_sdk/client/models/pec.py | 246 ++++ src/shellrent_sdk/client/models/pec_domain.py | 169 +++ .../pec_domain_paginated_list_response.py | 99 ++ .../client/models/pec_domain_response.py | 112 ++ .../models/pec_domain_response_meta_type_0.py | 45 + ...pec_mailbox_owner_change_create_request.py | 81 ++ .../models/pec_mailbox_update_request.py | 75 + .../client/models/pec_owner_change.py | 279 ++++ ...ec_owner_change_paginated_list_response.py | 99 ++ .../models/pec_owner_change_response.py | 112 ++ .../pec_owner_change_response_meta_type_0.py | 45 + .../client/models/pec_owner_summary.py | 180 +++ .../models/pec_paginated_list_response.py | 99 ++ .../client/models/pec_response.py | 110 ++ .../client/models/pec_response_meta_type_0.py | 45 + .../client/models/plesk_license.py | 223 +++ .../plesk_license_paginated_list_response.py | 99 ++ .../client/models/plesk_license_response.py | 112 ++ .../plesk_license_response_meta_type_0.py | 45 + .../client/models/prepaid_credit.py | 101 ++ .../client/models/prepaid_credit_operation.py | 129 ++ ...redit_operation_paginated_list_response.py | 99 ++ .../prepaid_credit_operation_response.py | 116 ++ ...d_credit_operation_response_meta_type_0.py | 45 + .../models/prepaid_credit_operation_type.py | 63 + .../client/models/prepaid_credit_response.py | 112 ++ .../prepaid_credit_response_meta_type_0.py | 45 + .../client/models/prepaid_credit_topup.py | 160 ++ ...id_credit_topup_paginated_list_response.py | 99 ++ .../models/prepaid_credit_topup_response.py | 116 ++ ...epaid_credit_topup_response_meta_type_0.py | 45 + .../client/models/private_cloud.py | 251 ++++ .../client/models/private_cloud_response.py | 112 ++ .../private_cloud_response_meta_type_0.py | 45 + .../models/private_cloud_vm_create_request.py | 135 ++ .../models/private_cloud_vm_update_request.py | 80 + src/shellrent_sdk/client/models/promotion.py | 208 +++ src/shellrent_sdk/client/models/purchase.py | 595 ++++++++ .../purchase_billing_info_change_request.py | 72 + .../models/purchase_can_add_additional.py | 85 ++ .../purchase_can_add_additional_response.py | 116 ++ ...can_add_additional_response_meta_type_0.py | 45 + .../client/models/purchase_can_cancel.py | 63 + .../models/purchase_can_cancel_response.py | 114 ++ ...urchase_can_cancel_response_meta_type_0.py | 45 + .../models/purchase_can_change_recurrence.py | 63 + ...purchase_can_change_recurrence_response.py | 118 ++ ..._change_recurrence_response_meta_type_0.py | 45 + .../purchase_can_change_renew_status.py | 63 + ...rchase_can_change_renew_status_response.py | 118 ++ ...hange_renew_status_response_meta_type_0.py | 45 + .../models/purchase_can_change_service.py | 85 ++ .../purchase_can_change_service_response.py | 116 ++ ...can_change_service_response_meta_type_0.py | 45 + .../client/models/purchase_can_renew.py | 63 + .../models/purchase_can_renew_response.py | 114 ++ ...purchase_can_renew_response_meta_type_0.py | 45 + .../models/purchase_comment_change_request.py | 56 + .../client/models/purchase_name.py | 73 + .../purchase_paginated_list_response.py | 99 ++ .../models/purchase_provisioning_status.py | 63 + .../purchase_recurrence_change_request.py | 57 + .../purchase_renew_status_change_request.py | 57 + .../client/models/purchase_response.py | 112 ++ .../models/purchase_response_meta_type_0.py | 45 + .../client/models/purchase_status.py | 63 + src/shellrent_sdk/client/models/recurrence.py | 180 +++ .../client/models/recurrence_frequency.py | 63 + .../models/request_access_token_body.py | 150 ++ .../request_access_token_body_grant_type.py | 8 + .../client/models/sdi_document_status.py | 63 + .../client/models/sdi_document_type.py | 63 + src/shellrent_sdk/client/models/securemail.py | 168 +++ .../client/models/securemail_mailbox.py | 109 ++ ...uremail_mailbox_paginated_list_response.py | 99 ++ .../securemail_paginated_list_response.py | 99 ++ .../models/securemail_quantity_request.py | 57 + .../client/models/securemail_response.py | 112 ++ .../models/securemail_response_meta_type_0.py | 45 + .../client/models/securemail_statistics.py | 91 ++ .../models/securemail_statistics_response.py | 116 ++ ...uremail_statistics_response_meta_type_0.py | 45 + src/shellrent_sdk/client/models/server.py | 173 +++ .../models/server_automatic_snapshot.py | 91 ++ .../server_automatic_snapshot_request.py | 72 + .../server_automatic_snapshot_response.py | 116 ++ ...automatic_snapshot_response_meta_type_0.py | 45 + .../client/models/server_backup.py | 337 +++++ .../models/server_backup_exhibit_request.py | 57 + .../models/server_backup_list_response.py | 122 ++ ...server_backup_list_response_meta_type_0.py | 45 + .../client/models/server_backup_response.py | 112 ++ .../server_backup_response_meta_type_0.py | 45 + .../client/models/server_can_action.py | 63 + .../models/server_can_action_response.py | 112 ++ .../server_can_action_response_meta_type_0.py | 45 + .../client/models/server_credential.py | 89 ++ .../models/server_credential_response.py | 114 ++ .../server_credential_response_meta_type_0.py | 45 + ...erver_ip_address_reverse_update_request.py | 68 + .../client/models/server_monitoring.py | 227 +++ ...rver_monitoring_paginated_list_response.py | 99 ++ .../client/models/server_monitoring_probe.py | 245 ++++ .../models/server_monitoring_probe_chart.py | 95 ++ ...rver_monitoring_probe_chart_points_item.py | 66 + .../server_monitoring_probe_chart_response.py | 118 ++ ...toring_probe_chart_response_meta_type_0.py | 45 + .../server_monitoring_probe_create_request.py | 103 ++ ...itoring_probe_create_request_parameters.py | 47 + .../server_monitoring_probe_list_response.py | 124 ++ ...itoring_probe_list_response_meta_type_0.py | 45 + .../server_monitoring_probe_response.py | 116 ++ ...r_monitoring_probe_response_meta_type_0.py | 45 + .../server_monitoring_probe_update_request.py | 66 + .../models/server_monitoring_response.py | 114 ++ .../server_monitoring_response_meta_type_0.py | 45 + .../client/models/server_network_interface.py | 231 +++ ...server_network_interface_create_request.py | 66 + .../server_network_interface_list_response.py | 124 ++ ...ork_interface_list_response_meta_type_0.py | 45 + .../server_network_interface_response.py | 116 ++ ..._network_interface_response_meta_type_0.py | 45 + src/shellrent_sdk/client/models/server_os.py | 105 ++ .../models/server_paginated_list_response.py | 99 ++ .../client/models/server_reinstall_request.py | 57 + .../client/models/server_response.py | 110 ++ .../models/server_response_meta_type_0.py | 45 + .../client/models/server_snapshot.py | 145 ++ ...server_snapshot_paginated_list_response.py | 99 ++ .../client/models/server_snapshot_response.py | 112 ++ .../server_snapshot_response_meta_type_0.py | 45 + .../client/models/server_template.py | 142 ++ src/shellrent_sdk/client/models/service.py | 301 ++++ .../client/models/service_category.py | 77 + .../client/models/service_change.py | 71 + .../client/models/service_list_response.py | 120 ++ .../service_list_response_meta_type_0.py | 45 + .../models/service_paginated_list_response.py | 99 ++ .../client/models/service_server.py | 318 ++++ .../models/service_server_list_response.py | 122 ++ ...ervice_server_list_response_meta_type_0.py | 45 + .../client/models/simple_pagination_meta.py | 78 + src/shellrent_sdk/client/models/sms.py | 189 +++ .../client/models/sms_account.py | 78 + .../client/models/sms_account_response.py | 112 ++ .../sms_account_response_meta_type_0.py | 45 + .../client/models/sms_can_cancel.py | 63 + .../client/models/sms_can_cancel_response.py | 112 ++ .../sms_can_cancel_response_meta_type_0.py | 45 + .../client/models/sms_can_delete.py | 63 + .../client/models/sms_can_delete_response.py | 112 ++ .../sms_can_delete_response_meta_type_0.py | 45 + .../client/models/sms_create_request.py | 127 ++ .../models/sms_create_request_quality.py | 9 + .../client/models/sms_message.py | 169 +++ .../sms_message_paginated_list_response.py | 99 ++ .../client/models/sms_message_response.py | 112 ++ .../sms_message_response_meta_type_0.py | 45 + .../models/sms_paginated_list_response.py | 99 ++ .../client/models/sms_phonebook.py | 76 + .../sms_phonebook_add_contacts_request.py | 77 + ...add_contacts_request_phone_numbers_item.py | 92 ++ .../client/models/sms_phonebook_contact.py | 134 ++ ...onebook_contact_paginated_list_response.py | 99 ++ .../models/sms_phonebook_create_request.py | 92 ++ ...ebook_create_request_phone_numbers_item.py | 92 ++ .../models/sms_phonebook_edit_request.py | 57 + .../sms_phonebook_paginated_list_response.py | 99 ++ .../client/models/sms_phonebook_response.py | 112 ++ .../sms_phonebook_response_meta_type_0.py | 45 + src/shellrent_sdk/client/models/sms_price.py | 103 ++ .../sms_price_paginated_list_response.py | 99 ++ .../client/models/sms_price_response.py | 112 ++ .../models/sms_price_response_meta_type_0.py | 45 + .../client/models/sms_response.py | 110 ++ .../client/models/sms_response_meta_type_0.py | 45 + .../client/models/ssl_certificate.py | 362 +++++ .../models/ssl_certificate_approver_emails.py | 63 + ...sl_certificate_approver_emails_response.py | 118 ++ ...te_approver_emails_response_meta_type_0.py | 45 + .../models/ssl_certificate_can_reemit.py | 63 + .../ssl_certificate_can_reemit_response.py | 116 ++ ...ificate_can_reemit_response_meta_type_0.py | 45 + .../ssl_certificate_change_csr_request.py | 56 + .../client/models/ssl_certificate_export.py | 70 + .../models/ssl_certificate_export_format.py | 97 ++ ...certificate_export_format_list_response.py | 126 ++ ...export_format_list_response_meta_type_0.py | 45 + .../models/ssl_certificate_export_response.py | 116 ++ ...certificate_export_response_meta_type_0.py | 45 + .../client/models/ssl_certificate_key.py | 69 + .../models/ssl_certificate_key_response.py | 114 ++ ...sl_certificate_key_response_meta_type_0.py | 45 + .../client/models/ssl_certificate_keys.py | 108 ++ .../models/ssl_certificate_keys_response.py | 116 ++ ...l_certificate_keys_response_meta_type_0.py | 45 + .../models/ssl_certificate_owner_request.py | 296 ++++ ...ssl_certificate_paginated_list_response.py | 99 ++ .../models/ssl_certificate_reemit_request.py | 87 ++ .../client/models/ssl_certificate_response.py | 112 ++ .../ssl_certificate_response_meta_type_0.py | 45 + .../models/sub_account_create_request.py | 151 ++ .../models/sub_account_update_request.py | 173 +++ src/shellrent_sdk/client/models/task.py | 138 ++ .../models/task_paginated_list_response.py | 99 ++ .../client/models/task_response.py | 110 ++ .../models/task_response_meta_type_0.py | 45 + .../client/models/task_status.py | 63 + src/shellrent_sdk/client/models/tax_regime.py | 83 ++ src/shellrent_sdk/client/models/tld.py | 236 +++ .../models/tld_contact_specification.py | 93 ++ .../models/tld_paginated_list_response.py | 99 ++ .../client/models/tld_response.py | 110 ++ .../client/models/tld_response_meta_type_0.py | 45 + .../client/models/upload_file_body.py | 45 + .../client/models/web_monitoring.py | 277 ++++ .../web_monitoring_availability_chart.py | 108 ++ ...eb_monitoring_availability_chart_legend.py | 72 + ...nitoring_availability_chart_points_item.py | 66 + ..._monitoring_availability_chart_response.py | 118 ++ ...availability_chart_response_meta_type_0.py | 45 + .../web_monitoring_download_speed_chart.py | 95 ++ ...toring_download_speed_chart_points_item.py | 66 + ...onitoring_download_speed_chart_response.py | 118 ++ ...wnload_speed_chart_response_meta_type_0.py | 45 + .../client/models/web_monitoring_notices.py | 89 ++ .../models/web_monitoring_notices_response.py | 116 ++ ...monitoring_notices_response_meta_type_0.py | 45 + .../web_monitoring_notices_update_request.py | 75 + .../web_monitoring_paginated_list_response.py | 99 ++ .../client/models/web_monitoring_response.py | 112 ++ .../web_monitoring_response_meta_type_0.py | 45 + .../web_monitoring_response_time_chart.py | 95 ++ ...itoring_response_time_chart_points_item.py | 66 + ...monitoring_response_time_chart_response.py | 118 ++ ...esponse_time_chart_response_meta_type_0.py | 45 + src/shellrent_sdk/client/types.py | 54 + 938 files changed, 124158 insertions(+) create mode 100755 bin/generate create mode 100644 openapi-python-client.yaml create mode 100644 src/shellrent_sdk/client/__init__.py create mode 100644 src/shellrent_sdk/client/api/__init__.py create mode 100644 src/shellrent_sdk/client/api/account/__init__.py create mode 100644 src/shellrent_sdk/client/api/account/create_sub_account.py create mode 100644 src/shellrent_sdk/client/api/account/delete_sub_account.py create mode 100644 src/shellrent_sdk/client/api/account/get_account.py create mode 100644 src/shellrent_sdk/client/api/account/get_sub_account.py create mode 100644 src/shellrent_sdk/client/api/account/list_sub_accounts.py create mode 100644 src/shellrent_sdk/client/api/account/update_sub_account.py create mode 100644 src/shellrent_sdk/client/api/account/upload_file.py create mode 100644 src/shellrent_sdk/client/api/billing/__init__.py create mode 100644 src/shellrent_sdk/client/api/billing/download_credit_note_pdf.py create mode 100644 src/shellrent_sdk/client/api/billing/download_credit_note_xml.py create mode 100644 src/shellrent_sdk/client/api/billing/download_invoice_pdf.py create mode 100644 src/shellrent_sdk/client/api/billing/download_invoice_xml.py create mode 100644 src/shellrent_sdk/client/api/billing/get_credit_note.py create mode 100644 src/shellrent_sdk/client/api/billing/get_credit_note_row.py create mode 100644 src/shellrent_sdk/client/api/billing/get_invoice.py create mode 100644 src/shellrent_sdk/client/api/billing/get_invoice_row.py create mode 100644 src/shellrent_sdk/client/api/billing/list_credit_note_rows.py create mode 100644 src/shellrent_sdk/client/api/billing/list_credit_notes.py create mode 100644 src/shellrent_sdk/client/api/billing/list_invoice_rows.py create mode 100644 src/shellrent_sdk/client/api/billing/list_invoices.py create mode 100644 src/shellrent_sdk/client/api/domains/__init__.py create mode 100644 src/shellrent_sdk/client/api/domains/activate_domain_dnssec.py create mode 100644 src/shellrent_sdk/client/api/domains/apply_domain_contact_changes.py create mode 100644 src/shellrent_sdk/client/api/domains/can_activate_domain_dnssec.py create mode 100644 src/shellrent_sdk/client/api/domains/can_change_domain_nameservers.py create mode 100644 src/shellrent_sdk/client/api/domains/can_deactivate_domain_dnssec.py create mode 100644 src/shellrent_sdk/client/api/domains/check_domain_availability.py create mode 100644 src/shellrent_sdk/client/api/domains/create_domain_dns_record.py create mode 100644 src/shellrent_sdk/client/api/domains/deactivate_domain_dnssec.py create mode 100644 src/shellrent_sdk/client/api/domains/delete_domain_dns_record.py create mode 100644 src/shellrent_sdk/client/api/domains/get_domain.py create mode 100644 src/shellrent_sdk/client/api/domains/get_domain_contact.py create mode 100644 src/shellrent_sdk/client/api/domains/get_domain_dns_record.py create mode 100644 src/shellrent_sdk/client/api/domains/get_domain_dns_zone.py create mode 100644 src/shellrent_sdk/client/api/domains/get_domain_dnssec.py create mode 100644 src/shellrent_sdk/client/api/domains/list_domain_contacts.py create mode 100644 src/shellrent_sdk/client/api/domains/list_domain_dns_records.py create mode 100644 src/shellrent_sdk/client/api/domains/list_domains.py create mode 100644 src/shellrent_sdk/client/api/domains/set_domain_cloudflare_nameservers.py create mode 100644 src/shellrent_sdk/client/api/domains/set_domain_external_nameservers.py create mode 100644 src/shellrent_sdk/client/api/domains/set_domain_standard_nameservers.py create mode 100644 src/shellrent_sdk/client/api/domains/update_domain_contact.py create mode 100644 src/shellrent_sdk/client/api/domains/update_domain_dns_record.py create mode 100644 src/shellrent_sdk/client/api/domains/update_domain_dns_zone.py create mode 100644 src/shellrent_sdk/client/api/domains/update_domain_dnssec.py create mode 100644 src/shellrent_sdk/client/api/health/__init__.py create mode 100644 src/shellrent_sdk/client/api/health/get_health.py create mode 100644 src/shellrent_sdk/client/api/hosting/__init__.py create mode 100644 src/shellrent_sdk/client/api/hosting/create_hosting_allow_list_entry.py create mode 100644 src/shellrent_sdk/client/api/hosting/create_hosting_block_list_entry.py create mode 100644 src/shellrent_sdk/client/api/hosting/create_hosting_catch_all.py create mode 100644 src/shellrent_sdk/client/api/hosting/create_hosting_cronjob.py create mode 100644 src/shellrent_sdk/client/api/hosting/create_hosting_database.py create mode 100644 src/shellrent_sdk/client/api/hosting/create_hosting_email_alias.py create mode 100644 src/shellrent_sdk/client/api/hosting/create_hosting_mod_security_rule.py create mode 100644 src/shellrent_sdk/client/api/hosting/create_hosting_subdomain.py create mode 100644 src/shellrent_sdk/client/api/hosting/delete_all_hosting_mod_security_rules.py create mode 100644 src/shellrent_sdk/client/api/hosting/delete_hosting_allow_list_entry.py create mode 100644 src/shellrent_sdk/client/api/hosting/delete_hosting_block_list_entry.py create mode 100644 src/shellrent_sdk/client/api/hosting/delete_hosting_catch_all.py create mode 100644 src/shellrent_sdk/client/api/hosting/delete_hosting_cronjob.py create mode 100644 src/shellrent_sdk/client/api/hosting/delete_hosting_email_alias.py create mode 100644 src/shellrent_sdk/client/api/hosting/delete_hosting_exposed_backup.py create mode 100644 src/shellrent_sdk/client/api/hosting/delete_hosting_mod_security_rule.py create mode 100644 src/shellrent_sdk/client/api/hosting/delete_hosting_subdomain.py create mode 100644 src/shellrent_sdk/client/api/hosting/enable_hosting_mod_security_rules.py create mode 100644 src/shellrent_sdk/client/api/hosting/expose_hosting_backups.py create mode 100644 src/shellrent_sdk/client/api/hosting/get_hosting.py create mode 100644 src/shellrent_sdk/client/api/hosting/get_hosting_allow_list_entry.py create mode 100644 src/shellrent_sdk/client/api/hosting/get_hosting_antivirus.py create mode 100644 src/shellrent_sdk/client/api/hosting/get_hosting_antivirus_removal_scan.py create mode 100644 src/shellrent_sdk/client/api/hosting/get_hosting_antivirus_scan.py create mode 100644 src/shellrent_sdk/client/api/hosting/get_hosting_backup.py create mode 100644 src/shellrent_sdk/client/api/hosting/get_hosting_block_list_entry.py create mode 100644 src/shellrent_sdk/client/api/hosting/get_hosting_catch_all.py create mode 100644 src/shellrent_sdk/client/api/hosting/get_hosting_credentials.py create mode 100644 src/shellrent_sdk/client/api/hosting/get_hosting_cronjob.py create mode 100644 src/shellrent_sdk/client/api/hosting/get_hosting_database.py create mode 100644 src/shellrent_sdk/client/api/hosting/get_hosting_email_alias.py create mode 100644 src/shellrent_sdk/client/api/hosting/get_hosting_mod_security.py create mode 100644 src/shellrent_sdk/client/api/hosting/get_hosting_mod_security_rule.py create mode 100644 src/shellrent_sdk/client/api/hosting/get_hosting_mod_security_scan.py create mode 100644 src/shellrent_sdk/client/api/hosting/get_hosting_ssl_certificate.py create mode 100644 src/shellrent_sdk/client/api/hosting/install_hosting_ssl_certificate.py create mode 100644 src/shellrent_sdk/client/api/hosting/list_hosting_allow_list_entries.py create mode 100644 src/shellrent_sdk/client/api/hosting/list_hosting_antivirus_removal_scans.py create mode 100644 src/shellrent_sdk/client/api/hosting/list_hosting_antivirus_scans.py create mode 100644 src/shellrent_sdk/client/api/hosting/list_hosting_backups.py create mode 100644 src/shellrent_sdk/client/api/hosting/list_hosting_block_list_entries.py create mode 100644 src/shellrent_sdk/client/api/hosting/list_hosting_cronjobs.py create mode 100644 src/shellrent_sdk/client/api/hosting/list_hosting_databases.py create mode 100644 src/shellrent_sdk/client/api/hosting/list_hosting_dns_records.py create mode 100644 src/shellrent_sdk/client/api/hosting/list_hosting_email_aliases.py create mode 100644 src/shellrent_sdk/client/api/hosting/list_hosting_exposed_backups.py create mode 100644 src/shellrent_sdk/client/api/hosting/list_hosting_mod_security_rules.py create mode 100644 src/shellrent_sdk/client/api/hosting/list_hosting_mod_security_scans.py create mode 100644 src/shellrent_sdk/client/api/hosting/list_hosting_php_versions.py create mode 100644 src/shellrent_sdk/client/api/hosting/list_hosting_ssl_certificates.py create mode 100644 src/shellrent_sdk/client/api/hosting/list_hostings.py create mode 100644 src/shellrent_sdk/client/api/hosting/remove_hosting_ssl_certificate.py create mode 100644 src/shellrent_sdk/client/api/hosting/restore_hosting_backup.py create mode 100644 src/shellrent_sdk/client/api/hosting/start_hosting_antivirus_removal_scan.py create mode 100644 src/shellrent_sdk/client/api/hosting/start_hosting_antivirus_scan.py create mode 100644 src/shellrent_sdk/client/api/hosting/start_hosting_first_backup.py create mode 100644 src/shellrent_sdk/client/api/hosting/update_hosting_catch_all.py create mode 100644 src/shellrent_sdk/client/api/hosting/update_hosting_file_protection.py create mode 100644 src/shellrent_sdk/client/api/hosting/update_hosting_http_version.py create mode 100644 src/shellrent_sdk/client/api/hosting/update_hosting_mod_security.py create mode 100644 src/shellrent_sdk/client/api/hosting/update_hosting_php_settings.py create mode 100644 src/shellrent_sdk/client/api/hosting/update_hosting_php_version.py create mode 100644 src/shellrent_sdk/client/api/license_/__init__.py create mode 100644 src/shellrent_sdk/client/api/license_/downgrade_microsoft_365_subscription_quantity.py create mode 100644 src/shellrent_sdk/client/api/license_/downgrade_secure_mail_quantity.py create mode 100644 src/shellrent_sdk/client/api/license_/get_cpanel_license.py create mode 100644 src/shellrent_sdk/client/api/license_/get_microsoft_365_partner_link.py create mode 100644 src/shellrent_sdk/client/api/license_/get_microsoft_365_subscription.py create mode 100644 src/shellrent_sdk/client/api/license_/get_microsoft_365_tenant.py create mode 100644 src/shellrent_sdk/client/api/license_/get_plesk_license.py create mode 100644 src/shellrent_sdk/client/api/license_/get_secure_mail.py create mode 100644 src/shellrent_sdk/client/api/license_/get_secure_mail_statistics.py create mode 100644 src/shellrent_sdk/client/api/license_/list_cpanel_licenses.py create mode 100644 src/shellrent_sdk/client/api/license_/list_microsoft_365_subscriptions.py create mode 100644 src/shellrent_sdk/client/api/license_/list_microsoft_365_tenants.py create mode 100644 src/shellrent_sdk/client/api/license_/list_plesk_licenses.py create mode 100644 src/shellrent_sdk/client/api/license_/list_secure_mail_mailboxes.py create mode 100644 src/shellrent_sdk/client/api/license_/list_secure_mails.py create mode 100644 src/shellrent_sdk/client/api/license_/upgrade_microsoft_365_subscription_quantity.py create mode 100644 src/shellrent_sdk/client/api/license_/upgrade_secure_mail_quantity.py create mode 100644 src/shellrent_sdk/client/api/monitoring/__init__.py create mode 100644 src/shellrent_sdk/client/api/monitoring/create_server_monitoring_probe.py create mode 100644 src/shellrent_sdk/client/api/monitoring/delete_server_monitoring_probe.py create mode 100644 src/shellrent_sdk/client/api/monitoring/get_server_monitoring.py create mode 100644 src/shellrent_sdk/client/api/monitoring/get_server_monitoring_probe.py create mode 100644 src/shellrent_sdk/client/api/monitoring/get_server_monitoring_probe_chart.py create mode 100644 src/shellrent_sdk/client/api/monitoring/get_web_monitoring.py create mode 100644 src/shellrent_sdk/client/api/monitoring/get_web_monitoring_availability_chart.py create mode 100644 src/shellrent_sdk/client/api/monitoring/get_web_monitoring_download_speed_chart.py create mode 100644 src/shellrent_sdk/client/api/monitoring/get_web_monitoring_notices.py create mode 100644 src/shellrent_sdk/client/api/monitoring/get_web_monitoring_response_time_chart.py create mode 100644 src/shellrent_sdk/client/api/monitoring/list_server_monitoring_probes.py create mode 100644 src/shellrent_sdk/client/api/monitoring/list_server_monitorings.py create mode 100644 src/shellrent_sdk/client/api/monitoring/list_web_monitorings.py create mode 100644 src/shellrent_sdk/client/api/monitoring/update_server_monitoring_probe.py create mode 100644 src/shellrent_sdk/client/api/monitoring/update_web_monitoring_notices.py create mode 100644 src/shellrent_sdk/client/api/o_auth/__init__.py create mode 100644 src/shellrent_sdk/client/api/o_auth/get_jwks.py create mode 100644 src/shellrent_sdk/client/api/o_auth/request_access_token.py create mode 100644 src/shellrent_sdk/client/api/payment/__init__.py create mode 100644 src/shellrent_sdk/client/api/payment/activate_one_click_autorenew.py create mode 100644 src/shellrent_sdk/client/api/payment/activate_prepaid_credit_autorenew.py create mode 100644 src/shellrent_sdk/client/api/payment/create_prepaid_credit_topup.py create mode 100644 src/shellrent_sdk/client/api/payment/get_one_click.py create mode 100644 src/shellrent_sdk/client/api/payment/get_one_click_autorenew.py create mode 100644 src/shellrent_sdk/client/api/payment/get_payment.py create mode 100644 src/shellrent_sdk/client/api/payment/get_prepaid_credit.py create mode 100644 src/shellrent_sdk/client/api/payment/get_prepaid_credit_operation.py create mode 100644 src/shellrent_sdk/client/api/payment/get_prepaid_credit_topup.py create mode 100644 src/shellrent_sdk/client/api/payment/list_one_clicks.py create mode 100644 src/shellrent_sdk/client/api/payment/list_payments.py create mode 100644 src/shellrent_sdk/client/api/payment/list_prepaid_credit_operations.py create mode 100644 src/shellrent_sdk/client/api/payment/list_prepaid_credit_topups.py create mode 100644 src/shellrent_sdk/client/api/payment/revoke_one_click_autorenew.py create mode 100644 src/shellrent_sdk/client/api/payment/revoke_prepaid_credit_autorenew.py create mode 100644 src/shellrent_sdk/client/api/pec/__init__.py create mode 100644 src/shellrent_sdk/client/api/pec/create_pec_domain_owner_change.py create mode 100644 src/shellrent_sdk/client/api/pec/create_pec_mailbox_owner_change.py create mode 100644 src/shellrent_sdk/client/api/pec/get_pec_domain.py create mode 100644 src/shellrent_sdk/client/api/pec/get_pec_domain_owner_change.py create mode 100644 src/shellrent_sdk/client/api/pec/get_pec_mailbox.py create mode 100644 src/shellrent_sdk/client/api/pec/list_pec_domain_owner_changes.py create mode 100644 src/shellrent_sdk/client/api/pec/list_pec_domains.py create mode 100644 src/shellrent_sdk/client/api/pec/list_pec_mailbox_owner_changes.py create mode 100644 src/shellrent_sdk/client/api/pec/list_pec_mailboxes.py create mode 100644 src/shellrent_sdk/client/api/pec/update_pec_mailbox.py create mode 100644 src/shellrent_sdk/client/api/purchases/__init__.py create mode 100644 src/shellrent_sdk/client/api/purchases/can_add_purchase_additional.py create mode 100644 src/shellrent_sdk/client/api/purchases/can_cancel_purchase.py create mode 100644 src/shellrent_sdk/client/api/purchases/can_change_purchase_recurrence.py create mode 100644 src/shellrent_sdk/client/api/purchases/can_change_purchase_renew_status.py create mode 100644 src/shellrent_sdk/client/api/purchases/can_change_purchase_service.py create mode 100644 src/shellrent_sdk/client/api/purchases/can_renew_purchase.py create mode 100644 src/shellrent_sdk/client/api/purchases/cancel_purchase.py create mode 100644 src/shellrent_sdk/client/api/purchases/change_purchase_recurrence.py create mode 100644 src/shellrent_sdk/client/api/purchases/change_purchase_renew_status.py create mode 100644 src/shellrent_sdk/client/api/purchases/complete_task_data.py create mode 100644 src/shellrent_sdk/client/api/purchases/delete_purchase_billing_info.py create mode 100644 src/shellrent_sdk/client/api/purchases/delete_purchase_comment.py create mode 100644 src/shellrent_sdk/client/api/purchases/get_purchase.py create mode 100644 src/shellrent_sdk/client/api/purchases/get_task.py create mode 100644 src/shellrent_sdk/client/api/purchases/list_purchases.py create mode 100644 src/shellrent_sdk/client/api/purchases/list_tasks.py create mode 100644 src/shellrent_sdk/client/api/purchases/renew_purchase.py create mode 100644 src/shellrent_sdk/client/api/purchases/update_purchase_billing_info.py create mode 100644 src/shellrent_sdk/client/api/purchases/update_purchase_comment.py create mode 100644 src/shellrent_sdk/client/api/server/__init__.py create mode 100644 src/shellrent_sdk/client/api/server/can_hard_reboot_server.py create mode 100644 src/shellrent_sdk/client/api/server/can_hard_stop_server.py create mode 100644 src/shellrent_sdk/client/api/server/can_reboot_server.py create mode 100644 src/shellrent_sdk/client/api/server/can_start_server.py create mode 100644 src/shellrent_sdk/client/api/server/can_stop_server.py create mode 100644 src/shellrent_sdk/client/api/server/create_private_cloud_virtual_machine.py create mode 100644 src/shellrent_sdk/client/api/server/create_server_automatic_snapshot.py create mode 100644 src/shellrent_sdk/client/api/server/create_server_network_interface.py create mode 100644 src/shellrent_sdk/client/api/server/delete_private_cloud_virtual_machine.py create mode 100644 src/shellrent_sdk/client/api/server/delete_server_automatic_snapshot.py create mode 100644 src/shellrent_sdk/client/api/server/delete_server_exposed_backups.py create mode 100644 src/shellrent_sdk/client/api/server/delete_server_ip_address_reverse_dns.py create mode 100644 src/shellrent_sdk/client/api/server/delete_server_network_interface.py create mode 100644 src/shellrent_sdk/client/api/server/delete_server_snapshot.py create mode 100644 src/shellrent_sdk/client/api/server/expose_server_backup.py create mode 100644 src/shellrent_sdk/client/api/server/get_server.py create mode 100644 src/shellrent_sdk/client/api/server/get_server_automatic_snapshot.py create mode 100644 src/shellrent_sdk/client/api/server/get_server_backup.py create mode 100644 src/shellrent_sdk/client/api/server/get_server_ip_address.py create mode 100644 src/shellrent_sdk/client/api/server/get_server_network_interface.py create mode 100644 src/shellrent_sdk/client/api/server/get_server_private_cloud.py create mode 100644 src/shellrent_sdk/client/api/server/get_server_snapshot.py create mode 100644 src/shellrent_sdk/client/api/server/hard_reboot_server.py create mode 100644 src/shellrent_sdk/client/api/server/hard_stop_server.py create mode 100644 src/shellrent_sdk/client/api/server/list_server_backups.py create mode 100644 src/shellrent_sdk/client/api/server/list_server_credentials.py create mode 100644 src/shellrent_sdk/client/api/server/list_server_exposed_backups.py create mode 100644 src/shellrent_sdk/client/api/server/list_server_ip_addresses.py create mode 100644 src/shellrent_sdk/client/api/server/list_server_network_interfaces.py create mode 100644 src/shellrent_sdk/client/api/server/list_server_snapshots.py create mode 100644 src/shellrent_sdk/client/api/server/list_servers.py create mode 100644 src/shellrent_sdk/client/api/server/reboot_server.py create mode 100644 src/shellrent_sdk/client/api/server/reinstall_server.py create mode 100644 src/shellrent_sdk/client/api/server/restore_server_backup.py create mode 100644 src/shellrent_sdk/client/api/server/restore_server_snapshot.py create mode 100644 src/shellrent_sdk/client/api/server/start_server.py create mode 100644 src/shellrent_sdk/client/api/server/start_server_first_backup.py create mode 100644 src/shellrent_sdk/client/api/server/stop_server.py create mode 100644 src/shellrent_sdk/client/api/server/update_private_cloud_virtual_machine.py create mode 100644 src/shellrent_sdk/client/api/server/update_server_automatic_snapshot.py create mode 100644 src/shellrent_sdk/client/api/server/update_server_ip_address_reverse_dns.py create mode 100644 src/shellrent_sdk/client/api/shop/__init__.py create mode 100644 src/shellrent_sdk/client/api/shop/buy_active_monitoring.py create mode 100644 src/shellrent_sdk/client/api/shop/buy_cloud_storage.py create mode 100644 src/shellrent_sdk/client/api/shop/buy_cloud_vps.py create mode 100644 src/shellrent_sdk/client/api/shop/buy_cpanel_license.py create mode 100644 src/shellrent_sdk/client/api/shop/buy_dedicated_server.py create mode 100644 src/shellrent_sdk/client/api/shop/buy_domain.py create mode 100644 src/shellrent_sdk/client/api/shop/buy_microsoft_365_subscription.py create mode 100644 src/shellrent_sdk/client/api/shop/buy_object_storage.py create mode 100644 src/shellrent_sdk/client/api/shop/buy_pec.py create mode 100644 src/shellrent_sdk/client/api/shop/buy_pec_domain.py create mode 100644 src/shellrent_sdk/client/api/shop/buy_plesk_license.py create mode 100644 src/shellrent_sdk/client/api/shop/buy_private_cloud_sv.py create mode 100644 src/shellrent_sdk/client/api/shop/buy_secure_mail.py create mode 100644 src/shellrent_sdk/client/api/shop/buy_secure_mail_for_google_workspace.py create mode 100644 src/shellrent_sdk/client/api/shop/buy_secure_mail_for_microsoft_365.py create mode 100644 src/shellrent_sdk/client/api/shop/buy_sms_topup.py create mode 100644 src/shellrent_sdk/client/api/shop/buy_ssl_certificate.py create mode 100644 src/shellrent_sdk/client/api/shop/buy_veeam_baas.py create mode 100644 src/shellrent_sdk/client/api/shop/can_cancel_order.py create mode 100644 src/shellrent_sdk/client/api/shop/can_pay_order.py create mode 100644 src/shellrent_sdk/client/api/shop/cancel_order.py create mode 100644 src/shellrent_sdk/client/api/shop/check_microsoft_365_domain_availability.py create mode 100644 src/shellrent_sdk/client/api/shop/get_order.py create mode 100644 src/shellrent_sdk/client/api/shop/get_order_row.py create mode 100644 src/shellrent_sdk/client/api/shop/get_tld.py create mode 100644 src/shellrent_sdk/client/api/shop/list_active_monitoring_products.py create mode 100644 src/shellrent_sdk/client/api/shop/list_cloud_storage_products.py create mode 100644 src/shellrent_sdk/client/api/shop/list_cloud_vps_products.py create mode 100644 src/shellrent_sdk/client/api/shop/list_cpanel_license_products.py create mode 100644 src/shellrent_sdk/client/api/shop/list_dedicated_server_products.py create mode 100644 src/shellrent_sdk/client/api/shop/list_microsoft_365_products.py create mode 100644 src/shellrent_sdk/client/api/shop/list_order_rows.py create mode 100644 src/shellrent_sdk/client/api/shop/list_orders.py create mode 100644 src/shellrent_sdk/client/api/shop/list_pec_products.py create mode 100644 src/shellrent_sdk/client/api/shop/list_plesk_license_products.py create mode 100644 src/shellrent_sdk/client/api/shop/list_private_cloud_sv_products.py create mode 100644 src/shellrent_sdk/client/api/shop/list_shop_microsoft_365_tenants.py create mode 100644 src/shellrent_sdk/client/api/shop/list_sms_topup_products.py create mode 100644 src/shellrent_sdk/client/api/shop/list_ssl_certificate_products.py create mode 100644 src/shellrent_sdk/client/api/shop/list_tlds.py create mode 100644 src/shellrent_sdk/client/api/shop/pay_orders.py create mode 100644 src/shellrent_sdk/client/api/sms/__init__.py create mode 100644 src/shellrent_sdk/client/api/sms/add_sms_phonebook_contacts.py create mode 100644 src/shellrent_sdk/client/api/sms/can_cancel_sms.py create mode 100644 src/shellrent_sdk/client/api/sms/can_delete_sms.py create mode 100644 src/shellrent_sdk/client/api/sms/cancel_sms.py create mode 100644 src/shellrent_sdk/client/api/sms/create_sms_phonebook.py create mode 100644 src/shellrent_sdk/client/api/sms/delete_all_sms_phonebook_contacts.py create mode 100644 src/shellrent_sdk/client/api/sms/delete_sms.py create mode 100644 src/shellrent_sdk/client/api/sms/delete_sms_phonebook.py create mode 100644 src/shellrent_sdk/client/api/sms/delete_sms_phonebook_contact.py create mode 100644 src/shellrent_sdk/client/api/sms/get_sms.py create mode 100644 src/shellrent_sdk/client/api/sms/get_sms_credit.py create mode 100644 src/shellrent_sdk/client/api/sms/get_sms_message.py create mode 100644 src/shellrent_sdk/client/api/sms/get_sms_phonebook.py create mode 100644 src/shellrent_sdk/client/api/sms/get_sms_price.py create mode 100644 src/shellrent_sdk/client/api/sms/list_sms.py create mode 100644 src/shellrent_sdk/client/api/sms/list_sms_messages.py create mode 100644 src/shellrent_sdk/client/api/sms/list_sms_phonebook_contacts.py create mode 100644 src/shellrent_sdk/client/api/sms/list_sms_phonebooks.py create mode 100644 src/shellrent_sdk/client/api/sms/list_sms_prices.py create mode 100644 src/shellrent_sdk/client/api/sms/replace_sms_phonebook_contacts.py create mode 100644 src/shellrent_sdk/client/api/sms/send_sms.py create mode 100644 src/shellrent_sdk/client/api/sms/update_sms_phonebook.py create mode 100644 src/shellrent_sdk/client/api/ssl/__init__.py create mode 100644 src/shellrent_sdk/client/api/ssl/can_reemit_ssl_certificate.py create mode 100644 src/shellrent_sdk/client/api/ssl/export_ssl_certificate.py create mode 100644 src/shellrent_sdk/client/api/ssl/get_ssl_certificate.py create mode 100644 src/shellrent_sdk/client/api/ssl/get_ssl_certificate_keys.py create mode 100644 src/shellrent_sdk/client/api/ssl/list_ssl_approver_emails.py create mode 100644 src/shellrent_sdk/client/api/ssl/list_ssl_certificate_export_formats.py create mode 100644 src/shellrent_sdk/client/api/ssl/list_ssl_certificates.py create mode 100644 src/shellrent_sdk/client/api/ssl/reemit_ssl_certificate.py create mode 100644 src/shellrent_sdk/client/api/ssl/update_ssl_certificate_csr.py create mode 100644 src/shellrent_sdk/client/api/ssl/update_ssl_certificate_owner.py create mode 100644 src/shellrent_sdk/client/api/storage/__init__.py create mode 100644 src/shellrent_sdk/client/api/storage/create_cloud_storage_access.py create mode 100644 src/shellrent_sdk/client/api/storage/create_object_storage_bucket_firewall_entry.py create mode 100644 src/shellrent_sdk/client/api/storage/create_object_storage_iam_user.py create mode 100644 src/shellrent_sdk/client/api/storage/create_object_storage_iam_user_s3_key.py create mode 100644 src/shellrent_sdk/client/api/storage/delete_cloud_storage_access.py create mode 100644 src/shellrent_sdk/client/api/storage/delete_cloud_storage_user.py create mode 100644 src/shellrent_sdk/client/api/storage/delete_object_storage_bucket_firewall_entry.py create mode 100644 src/shellrent_sdk/client/api/storage/delete_object_storage_iam_user.py create mode 100644 src/shellrent_sdk/client/api/storage/delete_object_storage_iam_user_s3_key.py create mode 100644 src/shellrent_sdk/client/api/storage/downgrade_cloud_storage_size.py create mode 100644 src/shellrent_sdk/client/api/storage/get_cloud_storage.py create mode 100644 src/shellrent_sdk/client/api/storage/get_cloud_storage_access.py create mode 100644 src/shellrent_sdk/client/api/storage/get_cloud_storage_user.py create mode 100644 src/shellrent_sdk/client/api/storage/get_object_storage.py create mode 100644 src/shellrent_sdk/client/api/storage/get_object_storage_bucket.py create mode 100644 src/shellrent_sdk/client/api/storage/get_object_storage_bucket_chart.py create mode 100644 src/shellrent_sdk/client/api/storage/get_object_storage_bucket_firewall_entry.py create mode 100644 src/shellrent_sdk/client/api/storage/get_object_storage_iam_user.py create mode 100644 src/shellrent_sdk/client/api/storage/get_object_storage_iam_user_s3_key.py create mode 100644 src/shellrent_sdk/client/api/storage/get_object_storage_s3_key.py create mode 100644 src/shellrent_sdk/client/api/storage/list_cloud_storage_accesses.py create mode 100644 src/shellrent_sdk/client/api/storage/list_cloud_storage_users.py create mode 100644 src/shellrent_sdk/client/api/storage/list_cloud_storages.py create mode 100644 src/shellrent_sdk/client/api/storage/list_object_storage_bucket_firewall_entries.py create mode 100644 src/shellrent_sdk/client/api/storage/list_object_storage_buckets.py create mode 100644 src/shellrent_sdk/client/api/storage/list_object_storage_iam_user_s3_keys.py create mode 100644 src/shellrent_sdk/client/api/storage/list_object_storage_iam_users.py create mode 100644 src/shellrent_sdk/client/api/storage/list_object_storages.py create mode 100644 src/shellrent_sdk/client/api/storage/update_cloud_storage_user_size.py create mode 100644 src/shellrent_sdk/client/api/storage/upgrade_cloud_storage_size.py create mode 100644 src/shellrent_sdk/client/client.py create mode 100644 src/shellrent_sdk/client/errors.py create mode 100644 src/shellrent_sdk/client/models/__init__.py create mode 100644 src/shellrent_sdk/client/models/account.py create mode 100644 src/shellrent_sdk/client/models/account_billing.py create mode 100644 src/shellrent_sdk/client/models/account_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/account_response.py create mode 100644 src/shellrent_sdk/client/models/account_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/amount.py create mode 100644 src/shellrent_sdk/client/models/amount_simple.py create mode 100644 src/shellrent_sdk/client/models/api_error.py create mode 100644 src/shellrent_sdk/client/models/api_error_data_type_0.py create mode 100644 src/shellrent_sdk/client/models/api_error_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/api_upload.py create mode 100644 src/shellrent_sdk/client/models/api_upload_response.py create mode 100644 src/shellrent_sdk/client/models/api_upload_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/billing_data.py create mode 100644 src/shellrent_sdk/client/models/buy_prepaid_credit_topup_request.py create mode 100644 src/shellrent_sdk/client/models/buy_prepaid_credit_topup_request_amount.py create mode 100644 src/shellrent_sdk/client/models/buy_service_active_monitoring_request.py create mode 100644 src/shellrent_sdk/client/models/buy_service_active_monitoring_request_data.py create mode 100644 src/shellrent_sdk/client/models/buy_service_cloud_storage_request.py create mode 100644 src/shellrent_sdk/client/models/buy_service_cloud_vps_request.py create mode 100644 src/shellrent_sdk/client/models/buy_service_cloud_vps_request_data.py create mode 100644 src/shellrent_sdk/client/models/buy_service_cloud_vps_request_data_diskquantity.py create mode 100644 src/shellrent_sdk/client/models/buy_service_cpanel_license_request.py create mode 100644 src/shellrent_sdk/client/models/buy_service_cpanel_license_request_data.py create mode 100644 src/shellrent_sdk/client/models/buy_service_cpanel_license_request_data_installation_type.py create mode 100644 src/shellrent_sdk/client/models/buy_service_dedicated_server_request.py create mode 100644 src/shellrent_sdk/client/models/buy_service_dedicated_server_request_data.py create mode 100644 src/shellrent_sdk/client/models/buy_service_domain_request.py create mode 100644 src/shellrent_sdk/client/models/buy_service_domain_request_configuration.py create mode 100644 src/shellrent_sdk/client/models/buy_service_domain_request_data.py create mode 100644 src/shellrent_sdk/client/models/buy_service_domain_request_data_contact_data.py create mode 100644 src/shellrent_sdk/client/models/buy_service_microsoft_365_request.py create mode 100644 src/shellrent_sdk/client/models/buy_service_microsoft_365_request_data.py create mode 100644 src/shellrent_sdk/client/models/buy_service_microsoft_365_request_data_locale.py create mode 100644 src/shellrent_sdk/client/models/buy_service_microsoft_365_request_data_tenant_choice.py create mode 100644 src/shellrent_sdk/client/models/buy_service_object_storage_request.py create mode 100644 src/shellrent_sdk/client/models/buy_service_object_storage_request_configuration.py create mode 100644 src/shellrent_sdk/client/models/buy_service_object_storage_request_configuration_tb_size.py create mode 100644 src/shellrent_sdk/client/models/buy_service_pec_domain_request.py create mode 100644 src/shellrent_sdk/client/models/buy_service_pec_domain_request_data.py create mode 100644 src/shellrent_sdk/client/models/buy_service_pec_domain_request_data_legal_entity.py create mode 100644 src/shellrent_sdk/client/models/buy_service_pec_request.py create mode 100644 src/shellrent_sdk/client/models/buy_service_pec_request_data.py create mode 100644 src/shellrent_sdk/client/models/buy_service_pec_request_data_legal_entity.py create mode 100644 src/shellrent_sdk/client/models/buy_service_plesk_license_request.py create mode 100644 src/shellrent_sdk/client/models/buy_service_plesk_license_request_data.py create mode 100644 src/shellrent_sdk/client/models/buy_service_plesk_license_request_data_installation_type.py create mode 100644 src/shellrent_sdk/client/models/buy_service_private_cloud_sv_request.py create mode 100644 src/shellrent_sdk/client/models/buy_service_private_cloud_sv_request_data.py create mode 100644 src/shellrent_sdk/client/models/buy_service_private_cloud_sv_request_data_additionalbackupdiskservicequantity.py create mode 100644 src/shellrent_sdk/client/models/buy_service_securemail_for_google_workspace_request.py create mode 100644 src/shellrent_sdk/client/models/buy_service_securemail_for_google_workspace_request_configuration.py create mode 100644 src/shellrent_sdk/client/models/buy_service_securemail_for_google_workspace_request_data.py create mode 100644 src/shellrent_sdk/client/models/buy_service_securemail_for_microsoft_365_request.py create mode 100644 src/shellrent_sdk/client/models/buy_service_securemail_for_microsoft_365_request_configuration.py create mode 100644 src/shellrent_sdk/client/models/buy_service_securemail_for_microsoft_365_request_data.py create mode 100644 src/shellrent_sdk/client/models/buy_service_securemail_request.py create mode 100644 src/shellrent_sdk/client/models/buy_service_securemail_request_configuration.py create mode 100644 src/shellrent_sdk/client/models/buy_service_sms_request.py create mode 100644 src/shellrent_sdk/client/models/buy_service_ssl_certificate_request.py create mode 100644 src/shellrent_sdk/client/models/buy_service_ssl_certificate_request_data.py create mode 100644 src/shellrent_sdk/client/models/buy_service_ssl_certificate_request_data_admin_role.py create mode 100644 src/shellrent_sdk/client/models/buy_service_ssl_certificate_request_data_admin_title.py create mode 100644 src/shellrent_sdk/client/models/buy_service_veeam_baas_request.py create mode 100644 src/shellrent_sdk/client/models/buy_service_veeam_baas_request_configuration.py create mode 100644 src/shellrent_sdk/client/models/cloud_storage.py create mode 100644 src/shellrent_sdk/client/models/cloud_storage_access.py create mode 100644 src/shellrent_sdk/client/models/cloud_storage_access_create_request.py create mode 100644 src/shellrent_sdk/client/models/cloud_storage_access_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/cloud_storage_access_response.py create mode 100644 src/shellrent_sdk/client/models/cloud_storage_access_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/cloud_storage_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/cloud_storage_response.py create mode 100644 src/shellrent_sdk/client/models/cloud_storage_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/cloud_storage_user.py create mode 100644 src/shellrent_sdk/client/models/cloud_storage_user_list_response.py create mode 100644 src/shellrent_sdk/client/models/cloud_storage_user_list_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/cloud_storage_user_response.py create mode 100644 src/shellrent_sdk/client/models/cloud_storage_user_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/cloud_storage_user_size_update_request.py create mode 100644 src/shellrent_sdk/client/models/complete_task_data_body.py create mode 100644 src/shellrent_sdk/client/models/complete_task_data_body_data.py create mode 100644 src/shellrent_sdk/client/models/country.py create mode 100644 src/shellrent_sdk/client/models/cpanel_license.py create mode 100644 src/shellrent_sdk/client/models/cpanel_license_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/cpanel_license_response.py create mode 100644 src/shellrent_sdk/client/models/cpanel_license_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/creditnote.py create mode 100644 src/shellrent_sdk/client/models/creditnote_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/creditnote_response.py create mode 100644 src/shellrent_sdk/client/models/creditnote_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/creditnote_row.py create mode 100644 src/shellrent_sdk/client/models/creditnote_row_list_response.py create mode 100644 src/shellrent_sdk/client/models/creditnote_row_list_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/creditnote_row_response.py create mode 100644 src/shellrent_sdk/client/models/creditnote_row_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/dns_record.py create mode 100644 src/shellrent_sdk/client/models/dns_record_caa_data.py create mode 100644 src/shellrent_sdk/client/models/dns_record_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/dns_record_response.py create mode 100644 src/shellrent_sdk/client/models/dns_record_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/dns_record_tlsa_data.py create mode 100644 src/shellrent_sdk/client/models/dns_type.py create mode 100644 src/shellrent_sdk/client/models/dns_zone.py create mode 100644 src/shellrent_sdk/client/models/dns_zone_response.py create mode 100644 src/shellrent_sdk/client/models/dns_zone_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/dnssec_ds_data.py create mode 100644 src/shellrent_sdk/client/models/dnssec_key_data.py create mode 100644 src/shellrent_sdk/client/models/domain.py create mode 100644 src/shellrent_sdk/client/models/domain_availability.py create mode 100644 src/shellrent_sdk/client/models/domain_availability_response.py create mode 100644 src/shellrent_sdk/client/models/domain_availability_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/domain_can_change_nameservers.py create mode 100644 src/shellrent_sdk/client/models/domain_can_change_nameservers_response.py create mode 100644 src/shellrent_sdk/client/models/domain_can_change_nameservers_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/domain_contact.py create mode 100644 src/shellrent_sdk/client/models/domain_contact_data.py create mode 100644 src/shellrent_sdk/client/models/domain_contact_list_response.py create mode 100644 src/shellrent_sdk/client/models/domain_contact_list_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/domain_contact_request.py create mode 100644 src/shellrent_sdk/client/models/domain_contact_request_contact_data_item.py create mode 100644 src/shellrent_sdk/client/models/domain_contact_response.py create mode 100644 src/shellrent_sdk/client/models/domain_contact_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/domain_data.py create mode 100644 src/shellrent_sdk/client/models/domain_dns_nameservers_change_request.py create mode 100644 src/shellrent_sdk/client/models/domain_dns_nameservers_cloudflare_request.py create mode 100644 src/shellrent_sdk/client/models/domain_dns_record_change_request.py create mode 100644 src/shellrent_sdk/client/models/domain_dns_record_change_request_caa_data.py create mode 100644 src/shellrent_sdk/client/models/domain_dns_record_change_request_tlsa_data.py create mode 100644 src/shellrent_sdk/client/models/domain_dns_record_request.py create mode 100644 src/shellrent_sdk/client/models/domain_dns_record_request_caa_data.py create mode 100644 src/shellrent_sdk/client/models/domain_dns_record_request_tlsa_data.py create mode 100644 src/shellrent_sdk/client/models/domain_dns_zone_request.py create mode 100644 src/shellrent_sdk/client/models/domain_dnssec.py create mode 100644 src/shellrent_sdk/client/models/domain_dnssec_can_activate.py create mode 100644 src/shellrent_sdk/client/models/domain_dnssec_can_activate_response.py create mode 100644 src/shellrent_sdk/client/models/domain_dnssec_can_activate_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/domain_dnssec_can_deactivate.py create mode 100644 src/shellrent_sdk/client/models/domain_dnssec_can_deactivate_response.py create mode 100644 src/shellrent_sdk/client/models/domain_dnssec_can_deactivate_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/domain_dnssec_request.py create mode 100644 src/shellrent_sdk/client/models/domain_dnssec_request_ds_data_1.py create mode 100644 src/shellrent_sdk/client/models/domain_dnssec_request_ds_data_1_digest_type.py create mode 100644 src/shellrent_sdk/client/models/domain_dnssec_request_ds_data_2.py create mode 100644 src/shellrent_sdk/client/models/domain_dnssec_request_ds_data_2_digest_type.py create mode 100644 src/shellrent_sdk/client/models/domain_dnssec_request_key_data_256_item.py create mode 100644 src/shellrent_sdk/client/models/domain_dnssec_request_key_data_256_item_algorithm.py create mode 100644 src/shellrent_sdk/client/models/domain_dnssec_request_key_data_257_item.py create mode 100644 src/shellrent_sdk/client/models/domain_dnssec_request_key_data_257_item_algorithm.py create mode 100644 src/shellrent_sdk/client/models/domain_dnssec_response.py create mode 100644 src/shellrent_sdk/client/models/domain_dnssec_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/domain_name.py create mode 100644 src/shellrent_sdk/client/models/domain_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/domain_response.py create mode 100644 src/shellrent_sdk/client/models/domain_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/empty_response.py create mode 100644 src/shellrent_sdk/client/models/empty_response_data_type_0.py create mode 100644 src/shellrent_sdk/client/models/empty_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/get_hosting_antivirus_response_200.py create mode 100644 src/shellrent_sdk/client/models/get_hosting_antivirus_response_200_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/health_status.py create mode 100644 src/shellrent_sdk/client/models/health_status_response.py create mode 100644 src/shellrent_sdk/client/models/health_status_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/hosting.py create mode 100644 src/shellrent_sdk/client/models/hosting_antivirus.py create mode 100644 src/shellrent_sdk/client/models/hosting_antivirus_removal_scan.py create mode 100644 src/shellrent_sdk/client/models/hosting_antivirus_removal_scan_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/hosting_antivirus_removal_scan_response.py create mode 100644 src/shellrent_sdk/client/models/hosting_antivirus_removal_scan_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/hosting_antivirus_scan.py create mode 100644 src/shellrent_sdk/client/models/hosting_antivirus_scan_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/hosting_antivirus_scan_response.py create mode 100644 src/shellrent_sdk/client/models/hosting_antivirus_scan_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/hosting_backup.py create mode 100644 src/shellrent_sdk/client/models/hosting_backup_expose_request.py create mode 100644 src/shellrent_sdk/client/models/hosting_backup_list_response.py create mode 100644 src/shellrent_sdk/client/models/hosting_backup_list_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/hosting_backup_response.py create mode 100644 src/shellrent_sdk/client/models/hosting_backup_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/hosting_credential.py create mode 100644 src/shellrent_sdk/client/models/hosting_credential_list_response.py create mode 100644 src/shellrent_sdk/client/models/hosting_credential_list_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/hosting_cronjob.py create mode 100644 src/shellrent_sdk/client/models/hosting_cronjob_create_request.py create mode 100644 src/shellrent_sdk/client/models/hosting_cronjob_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/hosting_cronjob_response.py create mode 100644 src/shellrent_sdk/client/models/hosting_cronjob_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/hosting_database.py create mode 100644 src/shellrent_sdk/client/models/hosting_database_create_request.py create mode 100644 src/shellrent_sdk/client/models/hosting_database_list_response.py create mode 100644 src/shellrent_sdk/client/models/hosting_database_list_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/hosting_database_response.py create mode 100644 src/shellrent_sdk/client/models/hosting_database_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/hosting_dns_record.py create mode 100644 src/shellrent_sdk/client/models/hosting_dns_record_list_response.py create mode 100644 src/shellrent_sdk/client/models/hosting_dns_record_list_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/hosting_email_alias.py create mode 100644 src/shellrent_sdk/client/models/hosting_email_alias_create_request.py create mode 100644 src/shellrent_sdk/client/models/hosting_email_alias_list_response.py create mode 100644 src/shellrent_sdk/client/models/hosting_email_alias_list_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/hosting_email_alias_response.py create mode 100644 src/shellrent_sdk/client/models/hosting_email_alias_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/hosting_email_allow_list.py create mode 100644 src/shellrent_sdk/client/models/hosting_email_allow_list_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/hosting_email_allow_list_response.py create mode 100644 src/shellrent_sdk/client/models/hosting_email_allow_list_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/hosting_email_bloc_list.py create mode 100644 src/shellrent_sdk/client/models/hosting_email_bloc_list_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/hosting_email_bloc_list_response.py create mode 100644 src/shellrent_sdk/client/models/hosting_email_bloc_list_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/hosting_email_catch_all.py create mode 100644 src/shellrent_sdk/client/models/hosting_email_catch_all_request.py create mode 100644 src/shellrent_sdk/client/models/hosting_email_catch_all_response.py create mode 100644 src/shellrent_sdk/client/models/hosting_email_catch_all_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/hosting_email_wblist_request.py create mode 100644 src/shellrent_sdk/client/models/hosting_file_protection_update_request.py create mode 100644 src/shellrent_sdk/client/models/hosting_http_version_update_request.py create mode 100644 src/shellrent_sdk/client/models/hosting_mod_security.py create mode 100644 src/shellrent_sdk/client/models/hosting_mod_security_response.py create mode 100644 src/shellrent_sdk/client/models/hosting_mod_security_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/hosting_mod_security_rule.py create mode 100644 src/shellrent_sdk/client/models/hosting_mod_security_rule_bulk_request.py create mode 100644 src/shellrent_sdk/client/models/hosting_mod_security_rule_create_request.py create mode 100644 src/shellrent_sdk/client/models/hosting_mod_security_rule_list_response.py create mode 100644 src/shellrent_sdk/client/models/hosting_mod_security_rule_list_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/hosting_mod_security_rule_response.py create mode 100644 src/shellrent_sdk/client/models/hosting_mod_security_rule_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/hosting_mod_security_scan.py create mode 100644 src/shellrent_sdk/client/models/hosting_mod_security_scan_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/hosting_mod_security_scan_response.py create mode 100644 src/shellrent_sdk/client/models/hosting_mod_security_scan_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/hosting_mod_security_update_request.py create mode 100644 src/shellrent_sdk/client/models/hosting_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/hosting_php_settings_update_request.py create mode 100644 src/shellrent_sdk/client/models/hosting_php_version.py create mode 100644 src/shellrent_sdk/client/models/hosting_php_version_list_response.py create mode 100644 src/shellrent_sdk/client/models/hosting_php_version_list_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/hosting_php_version_update_request.py create mode 100644 src/shellrent_sdk/client/models/hosting_response.py create mode 100644 src/shellrent_sdk/client/models/hosting_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/hosting_ssl_certificate.py create mode 100644 src/shellrent_sdk/client/models/hosting_ssl_certificate_install_request.py create mode 100644 src/shellrent_sdk/client/models/hosting_ssl_certificate_list_response.py create mode 100644 src/shellrent_sdk/client/models/hosting_ssl_certificate_list_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/hosting_ssl_certificate_response.py create mode 100644 src/shellrent_sdk/client/models/hosting_ssl_certificate_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/hosting_subdomain_create_request.py create mode 100644 src/shellrent_sdk/client/models/invoice.py create mode 100644 src/shellrent_sdk/client/models/invoice_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/invoice_response.py create mode 100644 src/shellrent_sdk/client/models/invoice_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/invoice_row.py create mode 100644 src/shellrent_sdk/client/models/invoice_row_list_response.py create mode 100644 src/shellrent_sdk/client/models/invoice_row_list_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/invoice_row_response.py create mode 100644 src/shellrent_sdk/client/models/invoice_row_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/ip_address.py create mode 100644 src/shellrent_sdk/client/models/ip_address_list_response.py create mode 100644 src/shellrent_sdk/client/models/ip_address_list_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/ip_address_response.py create mode 100644 src/shellrent_sdk/client/models/ip_address_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/jwk_key.py create mode 100644 src/shellrent_sdk/client/models/jwks_response.py create mode 100644 src/shellrent_sdk/client/models/legal_entity.py create mode 100644 src/shellrent_sdk/client/models/legal_entity_group.py create mode 100644 src/shellrent_sdk/client/models/list_orders_type.py create mode 100644 src/shellrent_sdk/client/models/list_sms_sms_status.py create mode 100644 src/shellrent_sdk/client/models/microsoft_365.py create mode 100644 src/shellrent_sdk/client/models/microsoft_365_domain_available.py create mode 100644 src/shellrent_sdk/client/models/microsoft_365_domain_available_response.py create mode 100644 src/shellrent_sdk/client/models/microsoft_365_domain_available_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/microsoft_365_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/microsoft_365_partner_link.py create mode 100644 src/shellrent_sdk/client/models/microsoft_365_partner_link_response.py create mode 100644 src/shellrent_sdk/client/models/microsoft_365_partner_link_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/microsoft_365_response.py create mode 100644 src/shellrent_sdk/client/models/microsoft_365_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/microsoft_365_subscription_quantity_request.py create mode 100644 src/shellrent_sdk/client/models/microsoft_365_tenant.py create mode 100644 src/shellrent_sdk/client/models/microsoft_365_tenant_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/microsoft_365_tenant_response.py create mode 100644 src/shellrent_sdk/client/models/microsoft_365_tenant_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/o_auth_audience.py create mode 100644 src/shellrent_sdk/client/models/o_auth_error.py create mode 100644 src/shellrent_sdk/client/models/o_auth_token_response.py create mode 100644 src/shellrent_sdk/client/models/object_storage.py create mode 100644 src/shellrent_sdk/client/models/object_storage_bucket.py create mode 100644 src/shellrent_sdk/client/models/object_storage_bucket_chart.py create mode 100644 src/shellrent_sdk/client/models/object_storage_bucket_chart_points_item.py create mode 100644 src/shellrent_sdk/client/models/object_storage_bucket_chart_response.py create mode 100644 src/shellrent_sdk/client/models/object_storage_bucket_chart_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/object_storage_bucket_firewall_entry.py create mode 100644 src/shellrent_sdk/client/models/object_storage_bucket_firewall_entry_create_request.py create mode 100644 src/shellrent_sdk/client/models/object_storage_bucket_firewall_entry_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/object_storage_bucket_firewall_entry_response.py create mode 100644 src/shellrent_sdk/client/models/object_storage_bucket_firewall_entry_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/object_storage_bucket_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/object_storage_bucket_response.py create mode 100644 src/shellrent_sdk/client/models/object_storage_bucket_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/object_storage_iam_user.py create mode 100644 src/shellrent_sdk/client/models/object_storage_iam_user_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/object_storage_iam_user_response.py create mode 100644 src/shellrent_sdk/client/models/object_storage_iam_user_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/object_storage_iam_user_s3_key.py create mode 100644 src/shellrent_sdk/client/models/object_storage_iam_user_s3_key_list_response.py create mode 100644 src/shellrent_sdk/client/models/object_storage_iam_user_s3_key_list_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/object_storage_iam_user_s3_key_response.py create mode 100644 src/shellrent_sdk/client/models/object_storage_iam_user_s3_key_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/object_storage_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/object_storage_response.py create mode 100644 src/shellrent_sdk/client/models/object_storage_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/object_storage_s3_key.py create mode 100644 src/shellrent_sdk/client/models/object_storage_s3_key_response.py create mode 100644 src/shellrent_sdk/client/models/object_storage_s3_key_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/one_click.py create mode 100644 src/shellrent_sdk/client/models/one_click_autorenew.py create mode 100644 src/shellrent_sdk/client/models/one_click_autorenew_response.py create mode 100644 src/shellrent_sdk/client/models/one_click_autorenew_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/one_click_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/one_click_response.py create mode 100644 src/shellrent_sdk/client/models/one_click_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/order.py create mode 100644 src/shellrent_sdk/client/models/order_can_cancel.py create mode 100644 src/shellrent_sdk/client/models/order_can_cancel_response.py create mode 100644 src/shellrent_sdk/client/models/order_can_cancel_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/order_can_pay.py create mode 100644 src/shellrent_sdk/client/models/order_can_pay_response.py create mode 100644 src/shellrent_sdk/client/models/order_can_pay_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/order_invoice_status.py create mode 100644 src/shellrent_sdk/client/models/order_list_response.py create mode 100644 src/shellrent_sdk/client/models/order_list_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/order_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/order_pay_request.py create mode 100644 src/shellrent_sdk/client/models/order_payment_status.py create mode 100644 src/shellrent_sdk/client/models/order_response.py create mode 100644 src/shellrent_sdk/client/models/order_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/order_row.py create mode 100644 src/shellrent_sdk/client/models/order_row_list_response.py create mode 100644 src/shellrent_sdk/client/models/order_row_list_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/order_row_response.py create mode 100644 src/shellrent_sdk/client/models/order_row_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/order_status.py create mode 100644 src/shellrent_sdk/client/models/pagination_meta.py create mode 100644 src/shellrent_sdk/client/models/pay_orders_response_200.py create mode 100644 src/shellrent_sdk/client/models/pay_orders_response_200_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/payment.py create mode 100644 src/shellrent_sdk/client/models/payment_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/payment_provider_data_type_0.py create mode 100644 src/shellrent_sdk/client/models/payment_response.py create mode 100644 src/shellrent_sdk/client/models/payment_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/pec.py create mode 100644 src/shellrent_sdk/client/models/pec_domain.py create mode 100644 src/shellrent_sdk/client/models/pec_domain_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/pec_domain_response.py create mode 100644 src/shellrent_sdk/client/models/pec_domain_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/pec_mailbox_owner_change_create_request.py create mode 100644 src/shellrent_sdk/client/models/pec_mailbox_update_request.py create mode 100644 src/shellrent_sdk/client/models/pec_owner_change.py create mode 100644 src/shellrent_sdk/client/models/pec_owner_change_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/pec_owner_change_response.py create mode 100644 src/shellrent_sdk/client/models/pec_owner_change_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/pec_owner_summary.py create mode 100644 src/shellrent_sdk/client/models/pec_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/pec_response.py create mode 100644 src/shellrent_sdk/client/models/pec_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/plesk_license.py create mode 100644 src/shellrent_sdk/client/models/plesk_license_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/plesk_license_response.py create mode 100644 src/shellrent_sdk/client/models/plesk_license_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/prepaid_credit.py create mode 100644 src/shellrent_sdk/client/models/prepaid_credit_operation.py create mode 100644 src/shellrent_sdk/client/models/prepaid_credit_operation_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/prepaid_credit_operation_response.py create mode 100644 src/shellrent_sdk/client/models/prepaid_credit_operation_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/prepaid_credit_operation_type.py create mode 100644 src/shellrent_sdk/client/models/prepaid_credit_response.py create mode 100644 src/shellrent_sdk/client/models/prepaid_credit_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/prepaid_credit_topup.py create mode 100644 src/shellrent_sdk/client/models/prepaid_credit_topup_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/prepaid_credit_topup_response.py create mode 100644 src/shellrent_sdk/client/models/prepaid_credit_topup_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/private_cloud.py create mode 100644 src/shellrent_sdk/client/models/private_cloud_response.py create mode 100644 src/shellrent_sdk/client/models/private_cloud_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/private_cloud_vm_create_request.py create mode 100644 src/shellrent_sdk/client/models/private_cloud_vm_update_request.py create mode 100644 src/shellrent_sdk/client/models/promotion.py create mode 100644 src/shellrent_sdk/client/models/purchase.py create mode 100644 src/shellrent_sdk/client/models/purchase_billing_info_change_request.py create mode 100644 src/shellrent_sdk/client/models/purchase_can_add_additional.py create mode 100644 src/shellrent_sdk/client/models/purchase_can_add_additional_response.py create mode 100644 src/shellrent_sdk/client/models/purchase_can_add_additional_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/purchase_can_cancel.py create mode 100644 src/shellrent_sdk/client/models/purchase_can_cancel_response.py create mode 100644 src/shellrent_sdk/client/models/purchase_can_cancel_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/purchase_can_change_recurrence.py create mode 100644 src/shellrent_sdk/client/models/purchase_can_change_recurrence_response.py create mode 100644 src/shellrent_sdk/client/models/purchase_can_change_recurrence_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/purchase_can_change_renew_status.py create mode 100644 src/shellrent_sdk/client/models/purchase_can_change_renew_status_response.py create mode 100644 src/shellrent_sdk/client/models/purchase_can_change_renew_status_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/purchase_can_change_service.py create mode 100644 src/shellrent_sdk/client/models/purchase_can_change_service_response.py create mode 100644 src/shellrent_sdk/client/models/purchase_can_change_service_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/purchase_can_renew.py create mode 100644 src/shellrent_sdk/client/models/purchase_can_renew_response.py create mode 100644 src/shellrent_sdk/client/models/purchase_can_renew_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/purchase_comment_change_request.py create mode 100644 src/shellrent_sdk/client/models/purchase_name.py create mode 100644 src/shellrent_sdk/client/models/purchase_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/purchase_provisioning_status.py create mode 100644 src/shellrent_sdk/client/models/purchase_recurrence_change_request.py create mode 100644 src/shellrent_sdk/client/models/purchase_renew_status_change_request.py create mode 100644 src/shellrent_sdk/client/models/purchase_response.py create mode 100644 src/shellrent_sdk/client/models/purchase_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/purchase_status.py create mode 100644 src/shellrent_sdk/client/models/recurrence.py create mode 100644 src/shellrent_sdk/client/models/recurrence_frequency.py create mode 100644 src/shellrent_sdk/client/models/request_access_token_body.py create mode 100644 src/shellrent_sdk/client/models/request_access_token_body_grant_type.py create mode 100644 src/shellrent_sdk/client/models/sdi_document_status.py create mode 100644 src/shellrent_sdk/client/models/sdi_document_type.py create mode 100644 src/shellrent_sdk/client/models/securemail.py create mode 100644 src/shellrent_sdk/client/models/securemail_mailbox.py create mode 100644 src/shellrent_sdk/client/models/securemail_mailbox_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/securemail_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/securemail_quantity_request.py create mode 100644 src/shellrent_sdk/client/models/securemail_response.py create mode 100644 src/shellrent_sdk/client/models/securemail_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/securemail_statistics.py create mode 100644 src/shellrent_sdk/client/models/securemail_statistics_response.py create mode 100644 src/shellrent_sdk/client/models/securemail_statistics_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/server.py create mode 100644 src/shellrent_sdk/client/models/server_automatic_snapshot.py create mode 100644 src/shellrent_sdk/client/models/server_automatic_snapshot_request.py create mode 100644 src/shellrent_sdk/client/models/server_automatic_snapshot_response.py create mode 100644 src/shellrent_sdk/client/models/server_automatic_snapshot_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/server_backup.py create mode 100644 src/shellrent_sdk/client/models/server_backup_exhibit_request.py create mode 100644 src/shellrent_sdk/client/models/server_backup_list_response.py create mode 100644 src/shellrent_sdk/client/models/server_backup_list_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/server_backup_response.py create mode 100644 src/shellrent_sdk/client/models/server_backup_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/server_can_action.py create mode 100644 src/shellrent_sdk/client/models/server_can_action_response.py create mode 100644 src/shellrent_sdk/client/models/server_can_action_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/server_credential.py create mode 100644 src/shellrent_sdk/client/models/server_credential_response.py create mode 100644 src/shellrent_sdk/client/models/server_credential_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/server_ip_address_reverse_update_request.py create mode 100644 src/shellrent_sdk/client/models/server_monitoring.py create mode 100644 src/shellrent_sdk/client/models/server_monitoring_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/server_monitoring_probe.py create mode 100644 src/shellrent_sdk/client/models/server_monitoring_probe_chart.py create mode 100644 src/shellrent_sdk/client/models/server_monitoring_probe_chart_points_item.py create mode 100644 src/shellrent_sdk/client/models/server_monitoring_probe_chart_response.py create mode 100644 src/shellrent_sdk/client/models/server_monitoring_probe_chart_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/server_monitoring_probe_create_request.py create mode 100644 src/shellrent_sdk/client/models/server_monitoring_probe_create_request_parameters.py create mode 100644 src/shellrent_sdk/client/models/server_monitoring_probe_list_response.py create mode 100644 src/shellrent_sdk/client/models/server_monitoring_probe_list_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/server_monitoring_probe_response.py create mode 100644 src/shellrent_sdk/client/models/server_monitoring_probe_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/server_monitoring_probe_update_request.py create mode 100644 src/shellrent_sdk/client/models/server_monitoring_response.py create mode 100644 src/shellrent_sdk/client/models/server_monitoring_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/server_network_interface.py create mode 100644 src/shellrent_sdk/client/models/server_network_interface_create_request.py create mode 100644 src/shellrent_sdk/client/models/server_network_interface_list_response.py create mode 100644 src/shellrent_sdk/client/models/server_network_interface_list_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/server_network_interface_response.py create mode 100644 src/shellrent_sdk/client/models/server_network_interface_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/server_os.py create mode 100644 src/shellrent_sdk/client/models/server_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/server_reinstall_request.py create mode 100644 src/shellrent_sdk/client/models/server_response.py create mode 100644 src/shellrent_sdk/client/models/server_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/server_snapshot.py create mode 100644 src/shellrent_sdk/client/models/server_snapshot_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/server_snapshot_response.py create mode 100644 src/shellrent_sdk/client/models/server_snapshot_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/server_template.py create mode 100644 src/shellrent_sdk/client/models/service.py create mode 100644 src/shellrent_sdk/client/models/service_category.py create mode 100644 src/shellrent_sdk/client/models/service_change.py create mode 100644 src/shellrent_sdk/client/models/service_list_response.py create mode 100644 src/shellrent_sdk/client/models/service_list_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/service_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/service_server.py create mode 100644 src/shellrent_sdk/client/models/service_server_list_response.py create mode 100644 src/shellrent_sdk/client/models/service_server_list_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/simple_pagination_meta.py create mode 100644 src/shellrent_sdk/client/models/sms.py create mode 100644 src/shellrent_sdk/client/models/sms_account.py create mode 100644 src/shellrent_sdk/client/models/sms_account_response.py create mode 100644 src/shellrent_sdk/client/models/sms_account_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/sms_can_cancel.py create mode 100644 src/shellrent_sdk/client/models/sms_can_cancel_response.py create mode 100644 src/shellrent_sdk/client/models/sms_can_cancel_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/sms_can_delete.py create mode 100644 src/shellrent_sdk/client/models/sms_can_delete_response.py create mode 100644 src/shellrent_sdk/client/models/sms_can_delete_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/sms_create_request.py create mode 100644 src/shellrent_sdk/client/models/sms_create_request_quality.py create mode 100644 src/shellrent_sdk/client/models/sms_message.py create mode 100644 src/shellrent_sdk/client/models/sms_message_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/sms_message_response.py create mode 100644 src/shellrent_sdk/client/models/sms_message_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/sms_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/sms_phonebook.py create mode 100644 src/shellrent_sdk/client/models/sms_phonebook_add_contacts_request.py create mode 100644 src/shellrent_sdk/client/models/sms_phonebook_add_contacts_request_phone_numbers_item.py create mode 100644 src/shellrent_sdk/client/models/sms_phonebook_contact.py create mode 100644 src/shellrent_sdk/client/models/sms_phonebook_contact_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/sms_phonebook_create_request.py create mode 100644 src/shellrent_sdk/client/models/sms_phonebook_create_request_phone_numbers_item.py create mode 100644 src/shellrent_sdk/client/models/sms_phonebook_edit_request.py create mode 100644 src/shellrent_sdk/client/models/sms_phonebook_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/sms_phonebook_response.py create mode 100644 src/shellrent_sdk/client/models/sms_phonebook_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/sms_price.py create mode 100644 src/shellrent_sdk/client/models/sms_price_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/sms_price_response.py create mode 100644 src/shellrent_sdk/client/models/sms_price_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/sms_response.py create mode 100644 src/shellrent_sdk/client/models/sms_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/ssl_certificate.py create mode 100644 src/shellrent_sdk/client/models/ssl_certificate_approver_emails.py create mode 100644 src/shellrent_sdk/client/models/ssl_certificate_approver_emails_response.py create mode 100644 src/shellrent_sdk/client/models/ssl_certificate_approver_emails_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/ssl_certificate_can_reemit.py create mode 100644 src/shellrent_sdk/client/models/ssl_certificate_can_reemit_response.py create mode 100644 src/shellrent_sdk/client/models/ssl_certificate_can_reemit_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/ssl_certificate_change_csr_request.py create mode 100644 src/shellrent_sdk/client/models/ssl_certificate_export.py create mode 100644 src/shellrent_sdk/client/models/ssl_certificate_export_format.py create mode 100644 src/shellrent_sdk/client/models/ssl_certificate_export_format_list_response.py create mode 100644 src/shellrent_sdk/client/models/ssl_certificate_export_format_list_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/ssl_certificate_export_response.py create mode 100644 src/shellrent_sdk/client/models/ssl_certificate_export_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/ssl_certificate_key.py create mode 100644 src/shellrent_sdk/client/models/ssl_certificate_key_response.py create mode 100644 src/shellrent_sdk/client/models/ssl_certificate_key_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/ssl_certificate_keys.py create mode 100644 src/shellrent_sdk/client/models/ssl_certificate_keys_response.py create mode 100644 src/shellrent_sdk/client/models/ssl_certificate_keys_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/ssl_certificate_owner_request.py create mode 100644 src/shellrent_sdk/client/models/ssl_certificate_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/ssl_certificate_reemit_request.py create mode 100644 src/shellrent_sdk/client/models/ssl_certificate_response.py create mode 100644 src/shellrent_sdk/client/models/ssl_certificate_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/sub_account_create_request.py create mode 100644 src/shellrent_sdk/client/models/sub_account_update_request.py create mode 100644 src/shellrent_sdk/client/models/task.py create mode 100644 src/shellrent_sdk/client/models/task_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/task_response.py create mode 100644 src/shellrent_sdk/client/models/task_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/task_status.py create mode 100644 src/shellrent_sdk/client/models/tax_regime.py create mode 100644 src/shellrent_sdk/client/models/tld.py create mode 100644 src/shellrent_sdk/client/models/tld_contact_specification.py create mode 100644 src/shellrent_sdk/client/models/tld_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/tld_response.py create mode 100644 src/shellrent_sdk/client/models/tld_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/upload_file_body.py create mode 100644 src/shellrent_sdk/client/models/web_monitoring.py create mode 100644 src/shellrent_sdk/client/models/web_monitoring_availability_chart.py create mode 100644 src/shellrent_sdk/client/models/web_monitoring_availability_chart_legend.py create mode 100644 src/shellrent_sdk/client/models/web_monitoring_availability_chart_points_item.py create mode 100644 src/shellrent_sdk/client/models/web_monitoring_availability_chart_response.py create mode 100644 src/shellrent_sdk/client/models/web_monitoring_availability_chart_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/web_monitoring_download_speed_chart.py create mode 100644 src/shellrent_sdk/client/models/web_monitoring_download_speed_chart_points_item.py create mode 100644 src/shellrent_sdk/client/models/web_monitoring_download_speed_chart_response.py create mode 100644 src/shellrent_sdk/client/models/web_monitoring_download_speed_chart_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/web_monitoring_notices.py create mode 100644 src/shellrent_sdk/client/models/web_monitoring_notices_response.py create mode 100644 src/shellrent_sdk/client/models/web_monitoring_notices_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/web_monitoring_notices_update_request.py create mode 100644 src/shellrent_sdk/client/models/web_monitoring_paginated_list_response.py create mode 100644 src/shellrent_sdk/client/models/web_monitoring_response.py create mode 100644 src/shellrent_sdk/client/models/web_monitoring_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/models/web_monitoring_response_time_chart.py create mode 100644 src/shellrent_sdk/client/models/web_monitoring_response_time_chart_points_item.py create mode 100644 src/shellrent_sdk/client/models/web_monitoring_response_time_chart_response.py create mode 100644 src/shellrent_sdk/client/models/web_monitoring_response_time_chart_response_meta_type_0.py create mode 100644 src/shellrent_sdk/client/types.py diff --git a/bin/generate b/bin/generate new file mode 100755 index 0000000..4269718 --- /dev/null +++ b/bin/generate @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# Regenerates src/shellrent_sdk/client from spec/openapi.yaml with openapi-python-client, run through uvx. +# Configuration: openapi-python-client.yaml. +set -euo pipefail + +GENERATOR_VERSION="0.29.1" +# Ruff runs in the post hooks of the generator, from the same uvx environment. It is pinned too, +# because its rules and formatting change between releases and so would the generated code. +RUFF_VERSION="0.16.9" +OUTPUT_PATH="src/shellrent_sdk/client" + +cd "$(dirname "$0")/.." + +if ! command -v uvx >/dev/null 2>&1; then + echo "bin/generate: uv is required, see https://docs.astral.sh/uv/" >&2 + exit 1 +fi + +# The generator rewrites api/ and models/ but leaves other files in place: +# start from scratch, so that nothing removed from the spec lingers. +rm -rf -- "$OUTPUT_PATH" + +uvx --from "openapi-python-client==$GENERATOR_VERSION" --with "ruff==$RUFF_VERSION" \ + openapi-python-client generate \ + --path spec/openapi.yaml \ + --config openapi-python-client.yaml \ + --meta none \ + --output-path "$OUTPUT_PATH" \ + --overwrite \ + --fail-on-warning diff --git a/openapi-python-client.yaml b/openapi-python-client.yaml new file mode 100644 index 0000000..66ae265 --- /dev/null +++ b/openapi-python-client.yaml @@ -0,0 +1,12 @@ +# Configuration of openapi-python-client, used by bin/generate. +# Options: https://github.com/openapi-generators/openapi-python-client#configuration + +# Downloads of invoices and credit notes (PDF, XML, signed p7m) are returned as File, with the raw +# bytes: without these overrides the PDFs are skipped and the XML is decoded as text. +content_type_overrides: + application/pdf: application/octet-stream + application/x-pkcs7-mime: application/octet-stream + text/xml: application/octet-stream + +# Attribute descriptions as docstrings of the attributes, where editors show them. +docstrings_on_attributes: true diff --git a/src/shellrent_sdk/client/__init__.py b/src/shellrent_sdk/client/__init__.py new file mode 100644 index 0000000..7187ba8 --- /dev/null +++ b/src/shellrent_sdk/client/__init__.py @@ -0,0 +1,8 @@ +"""A client library for accessing API Shellrent""" + +from .client import AuthenticatedClient, Client + +__all__ = ( + "AuthenticatedClient", + "Client", +) diff --git a/src/shellrent_sdk/client/api/__init__.py b/src/shellrent_sdk/client/api/__init__.py new file mode 100644 index 0000000..81f9fa2 --- /dev/null +++ b/src/shellrent_sdk/client/api/__init__.py @@ -0,0 +1 @@ +"""Contains methods for accessing the API""" diff --git a/src/shellrent_sdk/client/api/account/__init__.py b/src/shellrent_sdk/client/api/account/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/src/shellrent_sdk/client/api/account/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/src/shellrent_sdk/client/api/account/create_sub_account.py b/src/shellrent_sdk/client/api/account/create_sub_account.py new file mode 100644 index 0000000..ee38f50 --- /dev/null +++ b/src/shellrent_sdk/client/api/account/create_sub_account.py @@ -0,0 +1,194 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.account_response import AccountResponse +from ...models.api_error import ApiError +from ...models.sub_account_create_request import SubAccountCreateRequest +from ...types import Response + + +def _get_kwargs( + *, + body: SubAccountCreateRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/account/sub-accounts", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _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()) + + 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[AccountResponse | ApiError]: + 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: SubAccountCreateRequest, +) -> Response[AccountResponse | ApiError]: + """Create a user sub-account + + Create a new user sub-account + + Args: + body (SubAccountCreateRequest): + + 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[AccountResponse | ApiError] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: SubAccountCreateRequest, +) -> AccountResponse | ApiError | None: + """Create a user sub-account + + Create a new user sub-account + + Args: + body (SubAccountCreateRequest): + + 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: + AccountResponse | ApiError + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: SubAccountCreateRequest, +) -> Response[AccountResponse | ApiError]: + """Create a user sub-account + + Create a new user sub-account + + Args: + body (SubAccountCreateRequest): + + 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[AccountResponse | ApiError] + """ + + 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: SubAccountCreateRequest, +) -> AccountResponse | ApiError | None: + """Create a user sub-account + + Create a new user sub-account + + Args: + body (SubAccountCreateRequest): + + 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: + AccountResponse | ApiError + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/account/delete_sub_account.py b/src/shellrent_sdk/client/api/account/delete_sub_account.py new file mode 100644 index 0000000..89a6fcc --- /dev/null +++ b/src/shellrent_sdk/client/api/account/delete_sub_account.py @@ -0,0 +1,189 @@ +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.empty_response import EmptyResponse +from ...types import Response + + +def _get_kwargs( + account_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/api/v3/account/sub-accounts/{account_id}".format( + account_id=quote(str(account_id), safe=""), + ), + } + + return _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 + + 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 | EmptyResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + account_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Delete a user sub-account + + Delete a user sub-account + + Args: + account_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] + """ + + kwargs = _get_kwargs( + account_id=account_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + account_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Delete a user sub-account + + Delete a user sub-account + + Args: + account_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 + """ + + return sync_detailed( + account_id=account_id, + client=client, + ).parsed + + +async def asyncio_detailed( + account_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Delete a user sub-account + + Delete a user sub-account + + Args: + account_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] + """ + + kwargs = _get_kwargs( + account_id=account_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + account_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Delete a user sub-account + + Delete a user sub-account + + Args: + account_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 + """ + + return ( + await asyncio_detailed( + account_id=account_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/account/get_account.py b/src/shellrent_sdk/client/api/account/get_account.py new file mode 100644 index 0000000..7e9be28 --- /dev/null +++ b/src/shellrent_sdk/client/api/account/get_account.py @@ -0,0 +1,162 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.account_response import AccountResponse +from ...models.api_error import ApiError +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/account", + } + + return _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()) + + 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[AccountResponse | ApiError]: + 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, +) -> Response[AccountResponse | ApiError]: + """My user account + + Get all details of my user account + + 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[AccountResponse | ApiError] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> AccountResponse | ApiError | None: + """My user account + + Get all details of my user account + + 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: + AccountResponse | ApiError + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[AccountResponse | ApiError]: + """My user account + + Get all details of my user account + + 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[AccountResponse | ApiError] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> AccountResponse | ApiError | None: + """My user account + + Get all details of my user account + + 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: + AccountResponse | ApiError + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/account/get_sub_account.py b/src/shellrent_sdk/client/api/account/get_sub_account.py new file mode 100644 index 0000000..bbb0f7b --- /dev/null +++ b/src/shellrent_sdk/client/api/account/get_sub_account.py @@ -0,0 +1,189 @@ +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.account_response import AccountResponse +from ...models.api_error import ApiError +from ...types import Response + + +def _get_kwargs( + account_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/account/sub-accounts/{account_id}".format( + account_id=quote(str(account_id), safe=""), + ), + } + + return _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()) + + 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[AccountResponse | ApiError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + account_id: int, + *, + client: AuthenticatedClient, +) -> Response[AccountResponse | ApiError]: + """Get a user sub-account + + Get details of a user sub-account + + Args: + account_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[AccountResponse | ApiError] + """ + + kwargs = _get_kwargs( + account_id=account_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + account_id: int, + *, + client: AuthenticatedClient, +) -> AccountResponse | ApiError | None: + """Get a user sub-account + + Get details of a user sub-account + + Args: + account_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: + AccountResponse | ApiError + """ + + return sync_detailed( + account_id=account_id, + client=client, + ).parsed + + +async def asyncio_detailed( + account_id: int, + *, + client: AuthenticatedClient, +) -> Response[AccountResponse | ApiError]: + """Get a user sub-account + + Get details of a user sub-account + + Args: + account_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[AccountResponse | ApiError] + """ + + kwargs = _get_kwargs( + account_id=account_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + account_id: int, + *, + client: AuthenticatedClient, +) -> AccountResponse | ApiError | None: + """Get a user sub-account + + Get details of a user sub-account + + Args: + account_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: + AccountResponse | ApiError + """ + + return ( + await asyncio_detailed( + account_id=account_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/account/list_sub_accounts.py b/src/shellrent_sdk/client/api/account/list_sub_accounts.py new file mode 100644 index 0000000..cab419d --- /dev/null +++ b/src/shellrent_sdk/client/api/account/list_sub_accounts.py @@ -0,0 +1,209 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.account_paginated_list_response import AccountPaginatedListResponse +from ...models.api_error import ApiError +from ...types import UNSET, Response, Unset + + +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/account/sub-accounts", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AccountPaginatedListResponse | ApiError | None: + if response.status_code == 200: + response_200 = AccountPaginatedListResponse.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[AccountPaginatedListResponse | ApiError]: + 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 = 20, +) -> Response[AccountPaginatedListResponse | ApiError]: + """List all sub accounts + + Get a list of all user sub accounts + + 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. + + Returns: + Response[AccountPaginatedListResponse | ApiError] + """ + + 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 = 20, +) -> AccountPaginatedListResponse | ApiError | None: + """List all sub accounts + + Get a list of all user sub accounts + + 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. + + Returns: + AccountPaginatedListResponse | ApiError + """ + + 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[AccountPaginatedListResponse | ApiError]: + """List all sub accounts + + Get a list of all user sub accounts + + 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. + + Returns: + Response[AccountPaginatedListResponse | ApiError] + """ + + 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 = 20, +) -> AccountPaginatedListResponse | ApiError | None: + """List all sub accounts + + Get a list of all user sub accounts + + 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. + + Returns: + AccountPaginatedListResponse | ApiError + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + per_page=per_page, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/account/update_sub_account.py b/src/shellrent_sdk/client/api/account/update_sub_account.py new file mode 100644 index 0000000..f2a8785 --- /dev/null +++ b/src/shellrent_sdk/client/api/account/update_sub_account.py @@ -0,0 +1,210 @@ +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.account_response import AccountResponse +from ...models.api_error import ApiError +from ...models.sub_account_update_request import SubAccountUpdateRequest +from ...types import Response + + +def _get_kwargs( + account_id: int, + *, + body: SubAccountUpdateRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/api/v3/account/sub-accounts/{account_id}".format( + account_id=quote(str(account_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 +) -> AccountResponse | ApiError | None: + if response.status_code == 200: + response_200 = AccountResponse.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[AccountResponse | ApiError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + account_id: int, + *, + client: AuthenticatedClient, + body: SubAccountUpdateRequest, +) -> Response[AccountResponse | ApiError]: + """Edit a user sub-account + + Edit an existing user sub-account + + Args: + account_id (int): + body (SubAccountUpdateRequest): + + 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[AccountResponse | ApiError] + """ + + kwargs = _get_kwargs( + account_id=account_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + account_id: int, + *, + client: AuthenticatedClient, + body: SubAccountUpdateRequest, +) -> AccountResponse | ApiError | None: + """Edit a user sub-account + + Edit an existing user sub-account + + Args: + account_id (int): + body (SubAccountUpdateRequest): + + 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: + AccountResponse | ApiError + """ + + return sync_detailed( + account_id=account_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + account_id: int, + *, + client: AuthenticatedClient, + body: SubAccountUpdateRequest, +) -> Response[AccountResponse | ApiError]: + """Edit a user sub-account + + Edit an existing user sub-account + + Args: + account_id (int): + body (SubAccountUpdateRequest): + + 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[AccountResponse | ApiError] + """ + + kwargs = _get_kwargs( + account_id=account_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + account_id: int, + *, + client: AuthenticatedClient, + body: SubAccountUpdateRequest, +) -> AccountResponse | ApiError | None: + """Edit a user sub-account + + Edit an existing user sub-account + + Args: + account_id (int): + body (SubAccountUpdateRequest): + + 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: + AccountResponse | ApiError + """ + + return ( + await asyncio_detailed( + account_id=account_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/account/upload_file.py b/src/shellrent_sdk/client/api/account/upload_file.py new file mode 100644 index 0000000..be9ef92 --- /dev/null +++ b/src/shellrent_sdk/client/api/account/upload_file.py @@ -0,0 +1,195 @@ +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.api_upload_response import ApiUploadResponse +from ...models.upload_file_body import UploadFileBody +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + body: UploadFileBody | Unset = UNSET, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/upload", + } + + if not isinstance(body, Unset): + _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 | ApiUploadResponse | None: + if response.status_code == 200: + response_200 = ApiUploadResponse.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 | ApiUploadResponse]: + 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: UploadFileBody | Unset = UNSET, +) -> Response[ApiError | ApiUploadResponse]: + """Upload file + + Upload one or more files + + Args: + body (UploadFileBody | Unset): + + 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 | ApiUploadResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: UploadFileBody | Unset = UNSET, +) -> ApiError | ApiUploadResponse | None: + """Upload file + + Upload one or more files + + Args: + body (UploadFileBody | Unset): + + 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 | ApiUploadResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: UploadFileBody | Unset = UNSET, +) -> Response[ApiError | ApiUploadResponse]: + """Upload file + + Upload one or more files + + Args: + body (UploadFileBody | Unset): + + 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 | ApiUploadResponse] + """ + + 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: UploadFileBody | Unset = UNSET, +) -> ApiError | ApiUploadResponse | None: + """Upload file + + Upload one or more files + + Args: + body (UploadFileBody | Unset): + + 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 | ApiUploadResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/billing/__init__.py b/src/shellrent_sdk/client/api/billing/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/src/shellrent_sdk/client/api/billing/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" 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 new file mode 100644 index 0000000..db966f0 --- /dev/null +++ b/src/shellrent_sdk/client/api/billing/download_credit_note_pdf.py @@ -0,0 +1,189 @@ +from http import HTTPStatus +from io import BytesIO +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 ...types import File, Response + + +def _get_kwargs( + creditnote_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=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | File | None: + if response.status_code == 200: + response_200 = File(payload=BytesIO(response.content)) + + 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 | File]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + creditnote_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | File]: + """Download credit note PDF + + Download the courtesy PDF file of a Credit note + + Args: + creditnote_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 | File] + """ + + kwargs = _get_kwargs( + creditnote_id=creditnote_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + creditnote_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | File | None: + """Download credit note PDF + + Download the courtesy PDF file of a Credit note + + Args: + creditnote_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 | File + """ + + return sync_detailed( + creditnote_id=creditnote_id, + client=client, + ).parsed + + +async def asyncio_detailed( + creditnote_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | File]: + """Download credit note PDF + + Download the courtesy PDF file of a Credit note + + Args: + creditnote_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 | File] + """ + + kwargs = _get_kwargs( + creditnote_id=creditnote_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + creditnote_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | File | None: + """Download credit note PDF + + Download the courtesy PDF file of a Credit note + + Args: + creditnote_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 | File + """ + + return ( + await asyncio_detailed( + creditnote_id=creditnote_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 new file mode 100644 index 0000000..5c84747 --- /dev/null +++ b/src/shellrent_sdk/client/api/billing/download_credit_note_xml.py @@ -0,0 +1,210 @@ +from http import HTTPStatus +from io import BytesIO +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 ...types import UNSET, File, Response, Unset + + +def _get_kwargs( + creditnote_id: int, + *, + prefer_xml: bool | Unset = UNSET, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["prefer_xml"] = prefer_xml + + 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/creditnotes/{creditnote_id}/download".format( + creditnote_id=quote(str(creditnote_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | File | None: + if response.status_code == 200: + response_200 = File(payload=BytesIO(response.content)) + + 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 | File]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + creditnote_id: int, + *, + client: AuthenticatedClient, + prefer_xml: bool | Unset = UNSET, +) -> Response[ApiError | File]: + """Download credit note XML + + Download the XML file of a Credit note + + Args: + creditnote_id (int): + prefer_xml (bool | Unset): + + 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 | File] + """ + + kwargs = _get_kwargs( + creditnote_id=creditnote_id, + prefer_xml=prefer_xml, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + creditnote_id: int, + *, + client: AuthenticatedClient, + prefer_xml: bool | Unset = UNSET, +) -> ApiError | File | None: + """Download credit note XML + + Download the XML file of a Credit note + + Args: + creditnote_id (int): + prefer_xml (bool | Unset): + + 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 | File + """ + + return sync_detailed( + creditnote_id=creditnote_id, + client=client, + prefer_xml=prefer_xml, + ).parsed + + +async def asyncio_detailed( + creditnote_id: int, + *, + client: AuthenticatedClient, + prefer_xml: bool | Unset = UNSET, +) -> Response[ApiError | File]: + """Download credit note XML + + Download the XML file of a Credit note + + Args: + creditnote_id (int): + prefer_xml (bool | Unset): + + 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 | File] + """ + + kwargs = _get_kwargs( + creditnote_id=creditnote_id, + prefer_xml=prefer_xml, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + creditnote_id: int, + *, + client: AuthenticatedClient, + prefer_xml: bool | Unset = UNSET, +) -> ApiError | File | None: + """Download credit note XML + + Download the XML file of a Credit note + + Args: + creditnote_id (int): + prefer_xml (bool | Unset): + + 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 | File + """ + + return ( + await asyncio_detailed( + creditnote_id=creditnote_id, + client=client, + prefer_xml=prefer_xml, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/billing/download_invoice_pdf.py b/src/shellrent_sdk/client/api/billing/download_invoice_pdf.py new file mode 100644 index 0000000..51cf4ec --- /dev/null +++ b/src/shellrent_sdk/client/api/billing/download_invoice_pdf.py @@ -0,0 +1,189 @@ +from http import HTTPStatus +from io import BytesIO +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 ...types import File, Response + + +def _get_kwargs( + invoice_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/invoices/{invoice_id}/download/pdf".format( + invoice_id=quote(str(invoice_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | File | None: + if response.status_code == 200: + response_200 = File(payload=BytesIO(response.content)) + + 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 | File]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + invoice_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | File]: + """Download invoice PDF + + Download the courtesy PDF file of an Invoice + + Args: + invoice_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 | File] + """ + + kwargs = _get_kwargs( + invoice_id=invoice_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + invoice_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | File | None: + """Download invoice PDF + + Download the courtesy PDF file of an Invoice + + Args: + invoice_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 | File + """ + + return sync_detailed( + invoice_id=invoice_id, + client=client, + ).parsed + + +async def asyncio_detailed( + invoice_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | File]: + """Download invoice PDF + + Download the courtesy PDF file of an Invoice + + Args: + invoice_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 | File] + """ + + kwargs = _get_kwargs( + invoice_id=invoice_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + invoice_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | File | None: + """Download invoice PDF + + Download the courtesy PDF file of an Invoice + + Args: + invoice_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 | File + """ + + return ( + await asyncio_detailed( + invoice_id=invoice_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/billing/download_invoice_xml.py b/src/shellrent_sdk/client/api/billing/download_invoice_xml.py new file mode 100644 index 0000000..1a8068b --- /dev/null +++ b/src/shellrent_sdk/client/api/billing/download_invoice_xml.py @@ -0,0 +1,210 @@ +from http import HTTPStatus +from io import BytesIO +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 ...types import UNSET, File, Response, Unset + + +def _get_kwargs( + invoice_id: int, + *, + prefer_xml: bool | Unset = UNSET, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["prefer_xml"] = prefer_xml + + 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/invoices/{invoice_id}/download".format( + invoice_id=quote(str(invoice_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | File | None: + if response.status_code == 200: + response_200 = File(payload=BytesIO(response.content)) + + 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 | File]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + invoice_id: int, + *, + client: AuthenticatedClient, + prefer_xml: bool | Unset = UNSET, +) -> Response[ApiError | File]: + """Download invoice XML + + Download the XML file of an Invoice + + Args: + invoice_id (int): + prefer_xml (bool | Unset): + + 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 | File] + """ + + kwargs = _get_kwargs( + invoice_id=invoice_id, + prefer_xml=prefer_xml, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + invoice_id: int, + *, + client: AuthenticatedClient, + prefer_xml: bool | Unset = UNSET, +) -> ApiError | File | None: + """Download invoice XML + + Download the XML file of an Invoice + + Args: + invoice_id (int): + prefer_xml (bool | Unset): + + 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 | File + """ + + return sync_detailed( + invoice_id=invoice_id, + client=client, + prefer_xml=prefer_xml, + ).parsed + + +async def asyncio_detailed( + invoice_id: int, + *, + client: AuthenticatedClient, + prefer_xml: bool | Unset = UNSET, +) -> Response[ApiError | File]: + """Download invoice XML + + Download the XML file of an Invoice + + Args: + invoice_id (int): + prefer_xml (bool | Unset): + + 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 | File] + """ + + kwargs = _get_kwargs( + invoice_id=invoice_id, + prefer_xml=prefer_xml, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + invoice_id: int, + *, + client: AuthenticatedClient, + prefer_xml: bool | Unset = UNSET, +) -> ApiError | File | None: + """Download invoice XML + + Download the XML file of an Invoice + + Args: + invoice_id (int): + prefer_xml (bool | Unset): + + 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 | File + """ + + return ( + await asyncio_detailed( + invoice_id=invoice_id, + client=client, + prefer_xml=prefer_xml, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/billing/get_credit_note.py b/src/shellrent_sdk/client/api/billing/get_credit_note.py new file mode 100644 index 0000000..4ff24bd --- /dev/null +++ b/src/shellrent_sdk/client/api/billing/get_credit_note.py @@ -0,0 +1,189 @@ +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.creditnote_response import CreditnoteResponse +from ...types import Response + + +def _get_kwargs( + creditnote_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=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | CreditnoteResponse | None: + if response.status_code == 200: + response_200 = CreditnoteResponse.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 | CreditnoteResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + creditnote_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | CreditnoteResponse]: + """Get a Credit note + + Get details of a credit note + + Args: + creditnote_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 | CreditnoteResponse] + """ + + kwargs = _get_kwargs( + creditnote_id=creditnote_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + creditnote_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | CreditnoteResponse | None: + """Get a Credit note + + Get details of a credit note + + Args: + creditnote_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 | CreditnoteResponse + """ + + return sync_detailed( + creditnote_id=creditnote_id, + client=client, + ).parsed + + +async def asyncio_detailed( + creditnote_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | CreditnoteResponse]: + """Get a Credit note + + Get details of a credit note + + Args: + creditnote_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 | CreditnoteResponse] + """ + + kwargs = _get_kwargs( + creditnote_id=creditnote_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + creditnote_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | CreditnoteResponse | None: + """Get a Credit note + + Get details of a credit note + + Args: + creditnote_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 | CreditnoteResponse + """ + + return ( + await asyncio_detailed( + creditnote_id=creditnote_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 new file mode 100644 index 0000000..cb525a6 --- /dev/null +++ b/src/shellrent_sdk/client/api/billing/get_credit_note_row.py @@ -0,0 +1,203 @@ +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.creditnote_row_response import CreditnoteRowResponse +from ...types import Response + + +def _get_kwargs( + creditnote_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=""), + row_id=quote(str(row_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | CreditnoteRowResponse | None: + if response.status_code == 200: + response_200 = CreditnoteRowResponse.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 | CreditnoteRowResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + creditnote_id: int, + row_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | CreditnoteRowResponse]: + """Get a credit note row + + Get details of a Credit note row + + Args: + creditnote_id (int): + row_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 | CreditnoteRowResponse] + """ + + kwargs = _get_kwargs( + creditnote_id=creditnote_id, + row_id=row_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + creditnote_id: int, + row_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | CreditnoteRowResponse | None: + """Get a credit note row + + Get details of a Credit note row + + Args: + creditnote_id (int): + row_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 | CreditnoteRowResponse + """ + + return sync_detailed( + creditnote_id=creditnote_id, + row_id=row_id, + client=client, + ).parsed + + +async def asyncio_detailed( + creditnote_id: int, + row_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | CreditnoteRowResponse]: + """Get a credit note row + + Get details of a Credit note row + + Args: + creditnote_id (int): + row_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 | CreditnoteRowResponse] + """ + + kwargs = _get_kwargs( + creditnote_id=creditnote_id, + row_id=row_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + creditnote_id: int, + row_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | CreditnoteRowResponse | None: + """Get a credit note row + + Get details of a Credit note row + + Args: + creditnote_id (int): + row_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 | CreditnoteRowResponse + """ + + return ( + await asyncio_detailed( + creditnote_id=creditnote_id, + row_id=row_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/billing/get_invoice.py b/src/shellrent_sdk/client/api/billing/get_invoice.py new file mode 100644 index 0000000..864e93a --- /dev/null +++ b/src/shellrent_sdk/client/api/billing/get_invoice.py @@ -0,0 +1,189 @@ +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.invoice_response import InvoiceResponse +from ...types import Response + + +def _get_kwargs( + invoice_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/invoices/{invoice_id}".format( + invoice_id=quote(str(invoice_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | InvoiceResponse | None: + if response.status_code == 200: + response_200 = InvoiceResponse.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 | InvoiceResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + invoice_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | InvoiceResponse]: + """Get an invoice + + Get details of an invoice + + Args: + invoice_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 | InvoiceResponse] + """ + + kwargs = _get_kwargs( + invoice_id=invoice_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + invoice_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | InvoiceResponse | None: + """Get an invoice + + Get details of an invoice + + Args: + invoice_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 | InvoiceResponse + """ + + return sync_detailed( + invoice_id=invoice_id, + client=client, + ).parsed + + +async def asyncio_detailed( + invoice_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | InvoiceResponse]: + """Get an invoice + + Get details of an invoice + + Args: + invoice_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 | InvoiceResponse] + """ + + kwargs = _get_kwargs( + invoice_id=invoice_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + invoice_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | InvoiceResponse | None: + """Get an invoice + + Get details of an invoice + + Args: + invoice_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 | InvoiceResponse + """ + + return ( + await asyncio_detailed( + invoice_id=invoice_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/billing/get_invoice_row.py b/src/shellrent_sdk/client/api/billing/get_invoice_row.py new file mode 100644 index 0000000..0d3ae0b --- /dev/null +++ b/src/shellrent_sdk/client/api/billing/get_invoice_row.py @@ -0,0 +1,203 @@ +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.invoice_row_response import InvoiceRowResponse +from ...types import Response + + +def _get_kwargs( + invoice_id: int, + row_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/invoices/{invoice_id}/rows/{row_id}".format( + invoice_id=quote(str(invoice_id), safe=""), + row_id=quote(str(row_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | InvoiceRowResponse | None: + if response.status_code == 200: + response_200 = InvoiceRowResponse.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 | InvoiceRowResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + invoice_id: int, + row_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | InvoiceRowResponse]: + """Get an invoice row + + Get details of an Invoice row + + Args: + invoice_id (int): + row_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 | InvoiceRowResponse] + """ + + kwargs = _get_kwargs( + invoice_id=invoice_id, + row_id=row_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + invoice_id: int, + row_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | InvoiceRowResponse | None: + """Get an invoice row + + Get details of an Invoice row + + Args: + invoice_id (int): + row_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 | InvoiceRowResponse + """ + + return sync_detailed( + invoice_id=invoice_id, + row_id=row_id, + client=client, + ).parsed + + +async def asyncio_detailed( + invoice_id: int, + row_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | InvoiceRowResponse]: + """Get an invoice row + + Get details of an Invoice row + + Args: + invoice_id (int): + row_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 | InvoiceRowResponse] + """ + + kwargs = _get_kwargs( + invoice_id=invoice_id, + row_id=row_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + invoice_id: int, + row_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | InvoiceRowResponse | None: + """Get an invoice row + + Get details of an Invoice row + + Args: + invoice_id (int): + row_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 | InvoiceRowResponse + """ + + return ( + await asyncio_detailed( + invoice_id=invoice_id, + row_id=row_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..9d3fc55 --- /dev/null +++ b/src/shellrent_sdk/client/api/billing/list_credit_note_rows.py @@ -0,0 +1,189 @@ +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.creditnote_row_list_response import CreditnoteRowListResponse +from ...types import Response + + +def _get_kwargs( + creditnote_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=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | CreditnoteRowListResponse | None: + if response.status_code == 200: + response_200 = CreditnoteRowListResponse.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 | CreditnoteRowListResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + creditnote_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | CreditnoteRowListResponse]: + """List all credit note rows + + Get the list of all the rows of a Credit Note + + Args: + creditnote_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 | CreditnoteRowListResponse] + """ + + kwargs = _get_kwargs( + creditnote_id=creditnote_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + creditnote_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | CreditnoteRowListResponse | None: + """List all credit note rows + + Get the list of all the rows of a Credit Note + + Args: + creditnote_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 | CreditnoteRowListResponse + """ + + return sync_detailed( + creditnote_id=creditnote_id, + client=client, + ).parsed + + +async def asyncio_detailed( + creditnote_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | CreditnoteRowListResponse]: + """List all credit note rows + + Get the list of all the rows of a Credit Note + + Args: + creditnote_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 | CreditnoteRowListResponse] + """ + + kwargs = _get_kwargs( + creditnote_id=creditnote_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + creditnote_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | CreditnoteRowListResponse | None: + """List all credit note rows + + Get the list of all the rows of a Credit Note + + Args: + creditnote_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 | CreditnoteRowListResponse + """ + + return ( + await asyncio_detailed( + creditnote_id=creditnote_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 new file mode 100644 index 0000000..722907a --- /dev/null +++ b/src/shellrent_sdk/client/api/billing/list_credit_notes.py @@ -0,0 +1,246 @@ +import datetime +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.creditnote_paginated_list_response import CreditnotePaginatedListResponse +from ...types import UNSET, Response, Unset + + +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 = 20, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + json_date_emission_from: str | Unset = UNSET + if not isinstance(date_emission_from, Unset): + json_date_emission_from = date_emission_from.isoformat() + params["date_emission_from"] = json_date_emission_from + + json_date_emission_to: str | Unset = UNSET + if not isinstance(date_emission_to, Unset): + json_date_emission_to = date_emission_to.isoformat() + params["date_emission_to"] = json_date_emission_to + + 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/creditnotes", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | CreditnotePaginatedListResponse | None: + if response.status_code == 200: + response_200 = CreditnotePaginatedListResponse.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 | CreditnotePaginatedListResponse]: + 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, + date_emission_from: datetime.date | Unset = UNSET, + date_emission_to: datetime.date | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | CreditnotePaginatedListResponse]: + """List all Credit notes + + Get a list of all Credit notes + + Args: + date_emission_from (datetime.date | Unset): + date_emission_to (datetime.date | Unset): + 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. + + Returns: + Response[ApiError | CreditnotePaginatedListResponse] + """ + + kwargs = _get_kwargs( + date_emission_from=date_emission_from, + date_emission_to=date_emission_to, + page=page, + per_page=per_page, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + date_emission_from: datetime.date | Unset = UNSET, + date_emission_to: datetime.date | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | CreditnotePaginatedListResponse | None: + """List all Credit notes + + Get a list of all Credit notes + + Args: + date_emission_from (datetime.date | Unset): + date_emission_to (datetime.date | Unset): + 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. + + Returns: + ApiError | CreditnotePaginatedListResponse + """ + + return sync_detailed( + client=client, + date_emission_from=date_emission_from, + date_emission_to=date_emission_to, + page=page, + per_page=per_page, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + date_emission_from: datetime.date | Unset = UNSET, + date_emission_to: datetime.date | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | CreditnotePaginatedListResponse]: + """List all Credit notes + + Get a list of all Credit notes + + Args: + date_emission_from (datetime.date | Unset): + date_emission_to (datetime.date | Unset): + 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. + + Returns: + Response[ApiError | CreditnotePaginatedListResponse] + """ + + kwargs = _get_kwargs( + date_emission_from=date_emission_from, + date_emission_to=date_emission_to, + 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, + date_emission_from: datetime.date | Unset = UNSET, + date_emission_to: datetime.date | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | CreditnotePaginatedListResponse | None: + """List all Credit notes + + Get a list of all Credit notes + + Args: + date_emission_from (datetime.date | Unset): + date_emission_to (datetime.date | Unset): + 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. + + Returns: + ApiError | CreditnotePaginatedListResponse + """ + + return ( + await asyncio_detailed( + client=client, + date_emission_from=date_emission_from, + date_emission_to=date_emission_to, + page=page, + per_page=per_page, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/billing/list_invoice_rows.py b/src/shellrent_sdk/client/api/billing/list_invoice_rows.py new file mode 100644 index 0000000..7edc737 --- /dev/null +++ b/src/shellrent_sdk/client/api/billing/list_invoice_rows.py @@ -0,0 +1,189 @@ +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.invoice_row_list_response import InvoiceRowListResponse +from ...types import Response + + +def _get_kwargs( + invoice_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/invoices/{invoice_id}/rows".format( + invoice_id=quote(str(invoice_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | InvoiceRowListResponse | None: + if response.status_code == 200: + response_200 = InvoiceRowListResponse.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 | InvoiceRowListResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + invoice_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | InvoiceRowListResponse]: + """List all invoice rows + + Get the list of all the rows of an Invoice + + Args: + invoice_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 | InvoiceRowListResponse] + """ + + kwargs = _get_kwargs( + invoice_id=invoice_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + invoice_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | InvoiceRowListResponse | None: + """List all invoice rows + + Get the list of all the rows of an Invoice + + Args: + invoice_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 | InvoiceRowListResponse + """ + + return sync_detailed( + invoice_id=invoice_id, + client=client, + ).parsed + + +async def asyncio_detailed( + invoice_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | InvoiceRowListResponse]: + """List all invoice rows + + Get the list of all the rows of an Invoice + + Args: + invoice_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 | InvoiceRowListResponse] + """ + + kwargs = _get_kwargs( + invoice_id=invoice_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + invoice_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | InvoiceRowListResponse | None: + """List all invoice rows + + Get the list of all the rows of an Invoice + + Args: + invoice_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 | InvoiceRowListResponse + """ + + return ( + await asyncio_detailed( + invoice_id=invoice_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/billing/list_invoices.py b/src/shellrent_sdk/client/api/billing/list_invoices.py new file mode 100644 index 0000000..4247de6 --- /dev/null +++ b/src/shellrent_sdk/client/api/billing/list_invoices.py @@ -0,0 +1,261 @@ +import datetime +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.invoice_paginated_list_response import InvoicePaginatedListResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + date_emission_from: datetime.date | Unset = UNSET, + date_emission_to: datetime.date | Unset = UNSET, + payed: bool | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + json_date_emission_from: str | Unset = UNSET + if not isinstance(date_emission_from, Unset): + json_date_emission_from = date_emission_from.isoformat() + params["date_emission_from"] = json_date_emission_from + + json_date_emission_to: str | Unset = UNSET + if not isinstance(date_emission_to, Unset): + json_date_emission_to = date_emission_to.isoformat() + params["date_emission_to"] = json_date_emission_to + + params["payed"] = payed + + 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/invoices", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | InvoicePaginatedListResponse | None: + if response.status_code == 200: + response_200 = InvoicePaginatedListResponse.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 | InvoicePaginatedListResponse]: + 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, + date_emission_from: datetime.date | Unset = UNSET, + date_emission_to: datetime.date | Unset = UNSET, + payed: bool | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | InvoicePaginatedListResponse]: + """List all Invoices + + Get a list of all Invoices + + 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: 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 | InvoicePaginatedListResponse] + """ + + kwargs = _get_kwargs( + date_emission_from=date_emission_from, + date_emission_to=date_emission_to, + payed=payed, + page=page, + per_page=per_page, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + date_emission_from: datetime.date | Unset = UNSET, + date_emission_to: datetime.date | Unset = UNSET, + payed: bool | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | InvoicePaginatedListResponse | None: + """List all Invoices + + Get a list of all Invoices + + 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: 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 | InvoicePaginatedListResponse + """ + + return sync_detailed( + client=client, + date_emission_from=date_emission_from, + date_emission_to=date_emission_to, + payed=payed, + page=page, + per_page=per_page, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + date_emission_from: datetime.date | Unset = UNSET, + date_emission_to: datetime.date | Unset = UNSET, + payed: bool | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | InvoicePaginatedListResponse]: + """List all Invoices + + Get a list of all Invoices + + 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: 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 | InvoicePaginatedListResponse] + """ + + kwargs = _get_kwargs( + date_emission_from=date_emission_from, + date_emission_to=date_emission_to, + payed=payed, + 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, + date_emission_from: datetime.date | Unset = UNSET, + date_emission_to: datetime.date | Unset = UNSET, + payed: bool | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | InvoicePaginatedListResponse | None: + """List all Invoices + + Get a list of all Invoices + + 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: 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 | InvoicePaginatedListResponse + """ + + return ( + await asyncio_detailed( + client=client, + date_emission_from=date_emission_from, + date_emission_to=date_emission_to, + payed=payed, + page=page, + per_page=per_page, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/domains/__init__.py b/src/shellrent_sdk/client/api/domains/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/src/shellrent_sdk/client/api/domains/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/src/shellrent_sdk/client/api/domains/activate_domain_dnssec.py b/src/shellrent_sdk/client/api/domains/activate_domain_dnssec.py new file mode 100644 index 0000000..10bc92d --- /dev/null +++ b/src/shellrent_sdk/client/api/domains/activate_domain_dnssec.py @@ -0,0 +1,189 @@ +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( + domain_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/domains/{domain_id}/dnssec".format( + domain_id=quote(str(domain_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( + domain_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | TaskResponse]: + """Activate DNSSEC + + Activate DNSSEC (for domains with "standard" nameservers only) + + Args: + domain_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( + domain_id=domain_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + domain_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | TaskResponse | None: + """Activate DNSSEC + + Activate DNSSEC (for domains with "standard" nameservers only) + + Args: + domain_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( + domain_id=domain_id, + client=client, + ).parsed + + +async def asyncio_detailed( + domain_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | TaskResponse]: + """Activate DNSSEC + + Activate DNSSEC (for domains with "standard" nameservers only) + + Args: + domain_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( + domain_id=domain_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + domain_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | TaskResponse | None: + """Activate DNSSEC + + Activate DNSSEC (for domains with "standard" nameservers only) + + Args: + domain_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( + domain_id=domain_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..5c90d0d --- /dev/null +++ b/src/shellrent_sdk/client/api/domains/apply_domain_contact_changes.py @@ -0,0 +1,189 @@ +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.empty_response import EmptyResponse +from ...types import Response + + +def _get_kwargs( + domain_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/domains/{domain_id}/contacts/apply".format( + domain_id=quote(str(domain_id), safe=""), + ), + } + + return _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 + + 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 | EmptyResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + domain_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Apply contacts changes + + Apply changes made on contacts to the domain (send changes to domain's Registry) + + Args: + domain_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] + """ + + kwargs = _get_kwargs( + domain_id=domain_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + domain_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Apply contacts changes + + Apply changes made on contacts to the domain (send changes to domain's Registry) + + Args: + domain_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 + """ + + return sync_detailed( + domain_id=domain_id, + client=client, + ).parsed + + +async def asyncio_detailed( + domain_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Apply contacts changes + + Apply changes made on contacts to the domain (send changes to domain's Registry) + + Args: + domain_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] + """ + + kwargs = _get_kwargs( + domain_id=domain_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + domain_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Apply contacts changes + + Apply changes made on contacts to the domain (send changes to domain's Registry) + + Args: + domain_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 + """ + + return ( + await asyncio_detailed( + domain_id=domain_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..78837c4 --- /dev/null +++ b/src/shellrent_sdk/client/api/domains/can_activate_domain_dnssec.py @@ -0,0 +1,189 @@ +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.domain_dnssec_can_activate_response import DomainDnssecCanActivateResponse +from ...types import Response + + +def _get_kwargs( + domain_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/domains/{domain_id}/dnssec/can-activate".format( + domain_id=quote(str(domain_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | DomainDnssecCanActivateResponse | None: + if response.status_code == 200: + response_200 = DomainDnssecCanActivateResponse.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 | DomainDnssecCanActivateResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + domain_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | DomainDnssecCanActivateResponse]: + """Can activate DNSSEC + + Know if it's possible to activate DNSSEC + + Args: + domain_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 | DomainDnssecCanActivateResponse] + """ + + kwargs = _get_kwargs( + domain_id=domain_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + domain_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | DomainDnssecCanActivateResponse | None: + """Can activate DNSSEC + + Know if it's possible to activate DNSSEC + + Args: + domain_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 | DomainDnssecCanActivateResponse + """ + + return sync_detailed( + domain_id=domain_id, + client=client, + ).parsed + + +async def asyncio_detailed( + domain_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | DomainDnssecCanActivateResponse]: + """Can activate DNSSEC + + Know if it's possible to activate DNSSEC + + Args: + domain_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 | DomainDnssecCanActivateResponse] + """ + + kwargs = _get_kwargs( + domain_id=domain_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + domain_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | DomainDnssecCanActivateResponse | None: + """Can activate DNSSEC + + Know if it's possible to activate DNSSEC + + Args: + domain_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 | DomainDnssecCanActivateResponse + """ + + return ( + await asyncio_detailed( + domain_id=domain_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..1aa651c --- /dev/null +++ b/src/shellrent_sdk/client/api/domains/can_change_domain_nameservers.py @@ -0,0 +1,189 @@ +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.domain_can_change_nameservers_response import DomainCanChangeNameserversResponse +from ...types import Response + + +def _get_kwargs( + domain_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/domains/{domain_id}/dns/can-change-nameservers".format( + domain_id=quote(str(domain_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | DomainCanChangeNameserversResponse | None: + if response.status_code == 200: + response_200 = DomainCanChangeNameserversResponse.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 | DomainCanChangeNameserversResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + domain_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | DomainCanChangeNameserversResponse]: + """Can change Nameservers + + Know if it's possible to change Nameservers + + Args: + domain_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 | DomainCanChangeNameserversResponse] + """ + + kwargs = _get_kwargs( + domain_id=domain_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + domain_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | DomainCanChangeNameserversResponse | None: + """Can change Nameservers + + Know if it's possible to change Nameservers + + Args: + domain_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 | DomainCanChangeNameserversResponse + """ + + return sync_detailed( + domain_id=domain_id, + client=client, + ).parsed + + +async def asyncio_detailed( + domain_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | DomainCanChangeNameserversResponse]: + """Can change Nameservers + + Know if it's possible to change Nameservers + + Args: + domain_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 | DomainCanChangeNameserversResponse] + """ + + kwargs = _get_kwargs( + domain_id=domain_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + domain_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | DomainCanChangeNameserversResponse | None: + """Can change Nameservers + + Know if it's possible to change Nameservers + + Args: + domain_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 | DomainCanChangeNameserversResponse + """ + + return ( + await asyncio_detailed( + domain_id=domain_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..a556a14 --- /dev/null +++ b/src/shellrent_sdk/client/api/domains/can_deactivate_domain_dnssec.py @@ -0,0 +1,189 @@ +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.domain_dnssec_can_deactivate_response import DomainDnssecCanDeactivateResponse +from ...types import Response + + +def _get_kwargs( + domain_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/domains/{domain_id}/dnssec/can-deactivate".format( + domain_id=quote(str(domain_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | DomainDnssecCanDeactivateResponse | None: + if response.status_code == 200: + response_200 = DomainDnssecCanDeactivateResponse.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 | DomainDnssecCanDeactivateResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + domain_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | DomainDnssecCanDeactivateResponse]: + """Can deactivate DNSSEC + + Know if it's possible to deactivate DNSSEC + + Args: + domain_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 | DomainDnssecCanDeactivateResponse] + """ + + kwargs = _get_kwargs( + domain_id=domain_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + domain_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | DomainDnssecCanDeactivateResponse | None: + """Can deactivate DNSSEC + + Know if it's possible to deactivate DNSSEC + + Args: + domain_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 | DomainDnssecCanDeactivateResponse + """ + + return sync_detailed( + domain_id=domain_id, + client=client, + ).parsed + + +async def asyncio_detailed( + domain_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | DomainDnssecCanDeactivateResponse]: + """Can deactivate DNSSEC + + Know if it's possible to deactivate DNSSEC + + Args: + domain_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 | DomainDnssecCanDeactivateResponse] + """ + + kwargs = _get_kwargs( + domain_id=domain_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + domain_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | DomainDnssecCanDeactivateResponse | None: + """Can deactivate DNSSEC + + Know if it's possible to deactivate DNSSEC + + Args: + domain_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 | DomainDnssecCanDeactivateResponse + """ + + return ( + await asyncio_detailed( + domain_id=domain_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/domains/check_domain_availability.py b/src/shellrent_sdk/client/api/domains/check_domain_availability.py new file mode 100644 index 0000000..071ffc4 --- /dev/null +++ b/src/shellrent_sdk/client/api/domains/check_domain_availability.py @@ -0,0 +1,194 @@ +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.domain_availability_response import DomainAvailabilityResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + domain_full_name: str | Unset = UNSET, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["domain_full_name"] = domain_full_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/domains/availability", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | DomainAvailabilityResponse | None: + if response.status_code == 200: + response_200 = DomainAvailabilityResponse.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 | DomainAvailabilityResponse]: + 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, + domain_full_name: str | Unset = UNSET, +) -> Response[ApiError | DomainAvailabilityResponse]: + """Domain whois + + Search availability status for a domain (whois) + + Args: + domain_full_name (str | Unset): + + 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 | DomainAvailabilityResponse] + """ + + kwargs = _get_kwargs( + domain_full_name=domain_full_name, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + domain_full_name: str | Unset = UNSET, +) -> ApiError | DomainAvailabilityResponse | None: + """Domain whois + + Search availability status for a domain (whois) + + Args: + domain_full_name (str | Unset): + + 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 | DomainAvailabilityResponse + """ + + return sync_detailed( + client=client, + domain_full_name=domain_full_name, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + domain_full_name: str | Unset = UNSET, +) -> Response[ApiError | DomainAvailabilityResponse]: + """Domain whois + + Search availability status for a domain (whois) + + Args: + domain_full_name (str | Unset): + + 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 | DomainAvailabilityResponse] + """ + + kwargs = _get_kwargs( + domain_full_name=domain_full_name, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + domain_full_name: str | Unset = UNSET, +) -> ApiError | DomainAvailabilityResponse | None: + """Domain whois + + Search availability status for a domain (whois) + + Args: + domain_full_name (str | Unset): + + 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 | DomainAvailabilityResponse + """ + + return ( + await asyncio_detailed( + client=client, + domain_full_name=domain_full_name, + ) + ).parsed 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 new file mode 100644 index 0000000..6a2fa6a --- /dev/null +++ b/src/shellrent_sdk/client/api/domains/create_domain_dns_record.py @@ -0,0 +1,210 @@ +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.dns_record_response import DnsRecordResponse +from ...models.domain_dns_record_request import DomainDnsRecordRequest +from ...types import Response + + +def _get_kwargs( + domain_id: int, + *, + body: DomainDnsRecordRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/domains/{domain_id}/dns/records".format( + domain_id=quote(str(domain_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 | DnsRecordResponse | None: + if response.status_code == 200: + response_200 = DnsRecordResponse.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 | DnsRecordResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + domain_id: int, + *, + client: AuthenticatedClient, + body: DomainDnsRecordRequest, +) -> Response[ApiError | DnsRecordResponse]: + """Create DNS record + + Create a new DNS record + + Args: + domain_id (int): + body (DomainDnsRecordRequest): + + 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 | DnsRecordResponse] + """ + + kwargs = _get_kwargs( + domain_id=domain_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + domain_id: int, + *, + client: AuthenticatedClient, + body: DomainDnsRecordRequest, +) -> ApiError | DnsRecordResponse | None: + """Create DNS record + + Create a new DNS record + + Args: + domain_id (int): + body (DomainDnsRecordRequest): + + 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 | DnsRecordResponse + """ + + return sync_detailed( + domain_id=domain_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + domain_id: int, + *, + client: AuthenticatedClient, + body: DomainDnsRecordRequest, +) -> Response[ApiError | DnsRecordResponse]: + """Create DNS record + + Create a new DNS record + + Args: + domain_id (int): + body (DomainDnsRecordRequest): + + 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 | DnsRecordResponse] + """ + + kwargs = _get_kwargs( + domain_id=domain_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + domain_id: int, + *, + client: AuthenticatedClient, + body: DomainDnsRecordRequest, +) -> ApiError | DnsRecordResponse | None: + """Create DNS record + + Create a new DNS record + + Args: + domain_id (int): + body (DomainDnsRecordRequest): + + 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 | DnsRecordResponse + """ + + return ( + await asyncio_detailed( + domain_id=domain_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/domains/deactivate_domain_dnssec.py b/src/shellrent_sdk/client/api/domains/deactivate_domain_dnssec.py new file mode 100644 index 0000000..0617119 --- /dev/null +++ b/src/shellrent_sdk/client/api/domains/deactivate_domain_dnssec.py @@ -0,0 +1,193 @@ +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( + domain_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/api/v3/domains/{domain_id}/dnssec".format( + domain_id=quote(str(domain_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( + domain_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | TaskResponse]: + """Deactivate DNSSEC + + Deactivate DNSSEC (for domains with "standard" nameservers) or remove all DNSSEC data records (for + domains with "external" nameservers) + + Args: + domain_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( + domain_id=domain_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + domain_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | TaskResponse | None: + """Deactivate DNSSEC + + Deactivate DNSSEC (for domains with "standard" nameservers) or remove all DNSSEC data records (for + domains with "external" nameservers) + + Args: + domain_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( + domain_id=domain_id, + client=client, + ).parsed + + +async def asyncio_detailed( + domain_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | TaskResponse]: + """Deactivate DNSSEC + + Deactivate DNSSEC (for domains with "standard" nameservers) or remove all DNSSEC data records (for + domains with "external" nameservers) + + Args: + domain_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( + domain_id=domain_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + domain_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | TaskResponse | None: + """Deactivate DNSSEC + + Deactivate DNSSEC (for domains with "standard" nameservers) or remove all DNSSEC data records (for + domains with "external" nameservers) + + Args: + domain_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( + domain_id=domain_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..70c4b73 --- /dev/null +++ b/src/shellrent_sdk/client/api/domains/delete_domain_dns_record.py @@ -0,0 +1,203 @@ +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.empty_response import EmptyResponse +from ...types import Response + + +def _get_kwargs( + domain_id: int, + record_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/api/v3/domains/{domain_id}/dns/records/{record_id}".format( + domain_id=quote(str(domain_id), safe=""), + record_id=quote(str(record_id), safe=""), + ), + } + + return _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 + + 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 | EmptyResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + domain_id: int, + record_id: str, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Delete DNS record + + Delete an existing DNS record + + Args: + domain_id (int): + record_id (str): + + 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] + """ + + kwargs = _get_kwargs( + domain_id=domain_id, + record_id=record_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + domain_id: int, + record_id: str, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Delete DNS record + + Delete an existing DNS record + + Args: + domain_id (int): + record_id (str): + + 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 + """ + + return sync_detailed( + domain_id=domain_id, + record_id=record_id, + client=client, + ).parsed + + +async def asyncio_detailed( + domain_id: int, + record_id: str, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Delete DNS record + + Delete an existing DNS record + + Args: + domain_id (int): + record_id (str): + + 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] + """ + + kwargs = _get_kwargs( + domain_id=domain_id, + record_id=record_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + domain_id: int, + record_id: str, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Delete DNS record + + Delete an existing DNS record + + Args: + domain_id (int): + record_id (str): + + 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 + """ + + return ( + await asyncio_detailed( + domain_id=domain_id, + record_id=record_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/domains/get_domain.py b/src/shellrent_sdk/client/api/domains/get_domain.py new file mode 100644 index 0000000..36f75c2 --- /dev/null +++ b/src/shellrent_sdk/client/api/domains/get_domain.py @@ -0,0 +1,189 @@ +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.domain_response import DomainResponse +from ...types import Response + + +def _get_kwargs( + domain_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/domains/{domain_id}".format( + domain_id=quote(str(domain_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | DomainResponse | None: + if response.status_code == 200: + response_200 = DomainResponse.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 | DomainResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + domain_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | DomainResponse]: + """Get domain + + Get a domain + + Args: + domain_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 | DomainResponse] + """ + + kwargs = _get_kwargs( + domain_id=domain_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + domain_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | DomainResponse | None: + """Get domain + + Get a domain + + Args: + domain_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 | DomainResponse + """ + + return sync_detailed( + domain_id=domain_id, + client=client, + ).parsed + + +async def asyncio_detailed( + domain_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | DomainResponse]: + """Get domain + + Get a domain + + Args: + domain_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 | DomainResponse] + """ + + kwargs = _get_kwargs( + domain_id=domain_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + domain_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | DomainResponse | None: + """Get domain + + Get a domain + + Args: + domain_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 | DomainResponse + """ + + return ( + await asyncio_detailed( + domain_id=domain_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/domains/get_domain_contact.py b/src/shellrent_sdk/client/api/domains/get_domain_contact.py new file mode 100644 index 0000000..1a1d03b --- /dev/null +++ b/src/shellrent_sdk/client/api/domains/get_domain_contact.py @@ -0,0 +1,203 @@ +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.domain_contact_response import DomainContactResponse +from ...types import Response + + +def _get_kwargs( + domain_id: int, + domain_contact_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/domains/{domain_id}/contacts/{domain_contact_id}".format( + domain_id=quote(str(domain_id), safe=""), + domain_contact_id=quote(str(domain_contact_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | DomainContactResponse | None: + if response.status_code == 200: + response_200 = DomainContactResponse.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 | DomainContactResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + domain_id: int, + domain_contact_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | DomainContactResponse]: + """Get a contact + + Get a contact of domain + + Args: + domain_id (int): + domain_contact_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 | DomainContactResponse] + """ + + kwargs = _get_kwargs( + domain_id=domain_id, + domain_contact_id=domain_contact_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + domain_id: int, + domain_contact_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | DomainContactResponse | None: + """Get a contact + + Get a contact of domain + + Args: + domain_id (int): + domain_contact_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 | DomainContactResponse + """ + + return sync_detailed( + domain_id=domain_id, + domain_contact_id=domain_contact_id, + client=client, + ).parsed + + +async def asyncio_detailed( + domain_id: int, + domain_contact_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | DomainContactResponse]: + """Get a contact + + Get a contact of domain + + Args: + domain_id (int): + domain_contact_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 | DomainContactResponse] + """ + + kwargs = _get_kwargs( + domain_id=domain_id, + domain_contact_id=domain_contact_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + domain_id: int, + domain_contact_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | DomainContactResponse | None: + """Get a contact + + Get a contact of domain + + Args: + domain_id (int): + domain_contact_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 | DomainContactResponse + """ + + return ( + await asyncio_detailed( + domain_id=domain_id, + domain_contact_id=domain_contact_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..0bf1d59 --- /dev/null +++ b/src/shellrent_sdk/client/api/domains/get_domain_dns_record.py @@ -0,0 +1,203 @@ +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.dns_record_response import DnsRecordResponse +from ...types import Response + + +def _get_kwargs( + domain_id: int, + record_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/domains/{domain_id}/dns/records/{record_id}".format( + domain_id=quote(str(domain_id), safe=""), + record_id=quote(str(record_id), safe=""), + ), + } + + return _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()) + + 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 | DnsRecordResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + domain_id: int, + record_id: str, + *, + client: AuthenticatedClient, +) -> Response[ApiError | DnsRecordResponse]: + """Get DNS record + + Get a DNS record + + Args: + domain_id (int): + record_id (str): + + 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 | DnsRecordResponse] + """ + + kwargs = _get_kwargs( + domain_id=domain_id, + record_id=record_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + domain_id: int, + record_id: str, + *, + client: AuthenticatedClient, +) -> ApiError | DnsRecordResponse | None: + """Get DNS record + + Get a DNS record + + Args: + domain_id (int): + record_id (str): + + 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 | DnsRecordResponse + """ + + return sync_detailed( + domain_id=domain_id, + record_id=record_id, + client=client, + ).parsed + + +async def asyncio_detailed( + domain_id: int, + record_id: str, + *, + client: AuthenticatedClient, +) -> Response[ApiError | DnsRecordResponse]: + """Get DNS record + + Get a DNS record + + Args: + domain_id (int): + record_id (str): + + 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 | DnsRecordResponse] + """ + + kwargs = _get_kwargs( + domain_id=domain_id, + record_id=record_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + domain_id: int, + record_id: str, + *, + client: AuthenticatedClient, +) -> ApiError | DnsRecordResponse | None: + """Get DNS record + + Get a DNS record + + Args: + domain_id (int): + record_id (str): + + 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 | DnsRecordResponse + """ + + return ( + await asyncio_detailed( + domain_id=domain_id, + record_id=record_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..5b2112e --- /dev/null +++ b/src/shellrent_sdk/client/api/domains/get_domain_dns_zone.py @@ -0,0 +1,189 @@ +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.dns_zone_response import DnsZoneResponse +from ...types import Response + + +def _get_kwargs( + domain_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/domains/{domain_id}/dns".format( + domain_id=quote(str(domain_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | DnsZoneResponse | None: + if response.status_code == 200: + response_200 = DnsZoneResponse.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 | DnsZoneResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + domain_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | DnsZoneResponse]: + """DNS Zone + + DNS Zone details + + Args: + domain_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 | DnsZoneResponse] + """ + + kwargs = _get_kwargs( + domain_id=domain_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + domain_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | DnsZoneResponse | None: + """DNS Zone + + DNS Zone details + + Args: + domain_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 | DnsZoneResponse + """ + + return sync_detailed( + domain_id=domain_id, + client=client, + ).parsed + + +async def asyncio_detailed( + domain_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | DnsZoneResponse]: + """DNS Zone + + DNS Zone details + + Args: + domain_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 | DnsZoneResponse] + """ + + kwargs = _get_kwargs( + domain_id=domain_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + domain_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | DnsZoneResponse | None: + """DNS Zone + + DNS Zone details + + Args: + domain_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 | DnsZoneResponse + """ + + return ( + await asyncio_detailed( + domain_id=domain_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/domains/get_domain_dnssec.py b/src/shellrent_sdk/client/api/domains/get_domain_dnssec.py new file mode 100644 index 0000000..22864ed --- /dev/null +++ b/src/shellrent_sdk/client/api/domains/get_domain_dnssec.py @@ -0,0 +1,189 @@ +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.domain_dnssec_response import DomainDnssecResponse +from ...types import Response + + +def _get_kwargs( + domain_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/domains/{domain_id}/dnssec".format( + domain_id=quote(str(domain_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | DomainDnssecResponse | None: + if response.status_code == 200: + response_200 = DomainDnssecResponse.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 | DomainDnssecResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + domain_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | DomainDnssecResponse]: + """DNSSEC + + Get DNSSEC data records + + Args: + domain_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 | DomainDnssecResponse] + """ + + kwargs = _get_kwargs( + domain_id=domain_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + domain_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | DomainDnssecResponse | None: + """DNSSEC + + Get DNSSEC data records + + Args: + domain_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 | DomainDnssecResponse + """ + + return sync_detailed( + domain_id=domain_id, + client=client, + ).parsed + + +async def asyncio_detailed( + domain_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | DomainDnssecResponse]: + """DNSSEC + + Get DNSSEC data records + + Args: + domain_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 | DomainDnssecResponse] + """ + + kwargs = _get_kwargs( + domain_id=domain_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + domain_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | DomainDnssecResponse | None: + """DNSSEC + + Get DNSSEC data records + + Args: + domain_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 | DomainDnssecResponse + """ + + return ( + await asyncio_detailed( + domain_id=domain_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/domains/list_domain_contacts.py b/src/shellrent_sdk/client/api/domains/list_domain_contacts.py new file mode 100644 index 0000000..a6d3922 --- /dev/null +++ b/src/shellrent_sdk/client/api/domains/list_domain_contacts.py @@ -0,0 +1,189 @@ +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.domain_contact_list_response import DomainContactListResponse +from ...types import Response + + +def _get_kwargs( + domain_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/domains/{domain_id}/contacts".format( + domain_id=quote(str(domain_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | DomainContactListResponse | None: + if response.status_code == 200: + response_200 = DomainContactListResponse.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 | DomainContactListResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + domain_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | DomainContactListResponse]: + """List domain contacts + + Get all contacts of domain + + Args: + domain_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 | DomainContactListResponse] + """ + + kwargs = _get_kwargs( + domain_id=domain_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + domain_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | DomainContactListResponse | None: + """List domain contacts + + Get all contacts of domain + + Args: + domain_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 | DomainContactListResponse + """ + + return sync_detailed( + domain_id=domain_id, + client=client, + ).parsed + + +async def asyncio_detailed( + domain_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | DomainContactListResponse]: + """List domain contacts + + Get all contacts of domain + + Args: + domain_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 | DomainContactListResponse] + """ + + kwargs = _get_kwargs( + domain_id=domain_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + domain_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | DomainContactListResponse | None: + """List domain contacts + + Get all contacts of domain + + Args: + domain_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 | DomainContactListResponse + """ + + return ( + await asyncio_detailed( + domain_id=domain_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..965f47d --- /dev/null +++ b/src/shellrent_sdk/client/api/domains/list_domain_dns_records.py @@ -0,0 +1,278 @@ +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.dns_record_paginated_list_response import DnsRecordPaginatedListResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + domain_id: int, + *, + type_: str | Unset = UNSET, + host: str | Unset = UNSET, + destination: str | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["type"] = type_ + + params["host"] = host + + params["destination"] = destination + + 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/domains/{domain_id}/dns/records".format( + domain_id=quote(str(domain_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | DnsRecordPaginatedListResponse | None: + if response.status_code == 200: + response_200 = DnsRecordPaginatedListResponse.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 | DnsRecordPaginatedListResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + domain_id: int, + *, + client: AuthenticatedClient, + type_: str | Unset = UNSET, + host: str | Unset = UNSET, + destination: str | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | DnsRecordPaginatedListResponse]: + """List DNS records + + Get a list of all DNS Records. The results are paginated but the pagination does not have + information about the total number of items and the total number of pages. Only forward pages + navigation is supported. + + Args: + domain_id (int): + type_ (str | Unset): + host (str | Unset): + destination (str | Unset): + 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. + + Returns: + Response[ApiError | DnsRecordPaginatedListResponse] + """ + + kwargs = _get_kwargs( + domain_id=domain_id, + type_=type_, + host=host, + destination=destination, + page=page, + per_page=per_page, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + domain_id: int, + *, + client: AuthenticatedClient, + type_: str | Unset = UNSET, + host: str | Unset = UNSET, + destination: str | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | DnsRecordPaginatedListResponse | None: + """List DNS records + + Get a list of all DNS Records. The results are paginated but the pagination does not have + information about the total number of items and the total number of pages. Only forward pages + navigation is supported. + + Args: + domain_id (int): + type_ (str | Unset): + host (str | Unset): + destination (str | Unset): + 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. + + Returns: + ApiError | DnsRecordPaginatedListResponse + """ + + return sync_detailed( + domain_id=domain_id, + client=client, + type_=type_, + host=host, + destination=destination, + page=page, + per_page=per_page, + ).parsed + + +async def asyncio_detailed( + domain_id: int, + *, + client: AuthenticatedClient, + type_: str | Unset = UNSET, + host: str | Unset = UNSET, + destination: str | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | DnsRecordPaginatedListResponse]: + """List DNS records + + Get a list of all DNS Records. The results are paginated but the pagination does not have + information about the total number of items and the total number of pages. Only forward pages + navigation is supported. + + Args: + domain_id (int): + type_ (str | Unset): + host (str | Unset): + destination (str | Unset): + 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. + + Returns: + Response[ApiError | DnsRecordPaginatedListResponse] + """ + + kwargs = _get_kwargs( + domain_id=domain_id, + type_=type_, + host=host, + destination=destination, + 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( + domain_id: int, + *, + client: AuthenticatedClient, + type_: str | Unset = UNSET, + host: str | Unset = UNSET, + destination: str | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | DnsRecordPaginatedListResponse | None: + """List DNS records + + Get a list of all DNS Records. The results are paginated but the pagination does not have + information about the total number of items and the total number of pages. Only forward pages + navigation is supported. + + Args: + domain_id (int): + type_ (str | Unset): + host (str | Unset): + destination (str | Unset): + 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. + + Returns: + ApiError | DnsRecordPaginatedListResponse + """ + + return ( + await asyncio_detailed( + domain_id=domain_id, + client=client, + type_=type_, + host=host, + destination=destination, + page=page, + per_page=per_page, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/domains/list_domains.py b/src/shellrent_sdk/client/api/domains/list_domains.py new file mode 100644 index 0000000..a77a092 --- /dev/null +++ b/src/shellrent_sdk/client/api/domains/list_domains.py @@ -0,0 +1,269 @@ +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.domain_paginated_list_response import DomainPaginatedListResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + domain_full_name: str | Unset = UNSET, + domain_name: str | Unset = UNSET, + tld_id: int | Unset = UNSET, + tld_extension: str | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["domain_full_name"] = domain_full_name + + params["domain_name"] = domain_name + + params["tld_id"] = tld_id + + params["tld_extension"] = tld_extension + + 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/domains", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | DomainPaginatedListResponse | None: + if response.status_code == 200: + response_200 = DomainPaginatedListResponse.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 | DomainPaginatedListResponse]: + 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, + domain_full_name: str | Unset = UNSET, + domain_name: str | Unset = UNSET, + tld_id: int | Unset = UNSET, + tld_extension: str | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | DomainPaginatedListResponse]: + """List domains + + Get a list of all Domains + + Args: + domain_full_name (str | Unset): + domain_name (str | Unset): + tld_id (int | Unset): + tld_extension (str | Unset): + 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. + + Returns: + Response[ApiError | DomainPaginatedListResponse] + """ + + kwargs = _get_kwargs( + domain_full_name=domain_full_name, + domain_name=domain_name, + tld_id=tld_id, + tld_extension=tld_extension, + page=page, + per_page=per_page, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + domain_full_name: str | Unset = UNSET, + domain_name: str | Unset = UNSET, + tld_id: int | Unset = UNSET, + tld_extension: str | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | DomainPaginatedListResponse | None: + """List domains + + Get a list of all Domains + + Args: + domain_full_name (str | Unset): + domain_name (str | Unset): + tld_id (int | Unset): + tld_extension (str | Unset): + 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. + + Returns: + ApiError | DomainPaginatedListResponse + """ + + return sync_detailed( + client=client, + domain_full_name=domain_full_name, + domain_name=domain_name, + tld_id=tld_id, + tld_extension=tld_extension, + page=page, + per_page=per_page, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + domain_full_name: str | Unset = UNSET, + domain_name: str | Unset = UNSET, + tld_id: int | Unset = UNSET, + tld_extension: str | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | DomainPaginatedListResponse]: + """List domains + + Get a list of all Domains + + Args: + domain_full_name (str | Unset): + domain_name (str | Unset): + tld_id (int | Unset): + tld_extension (str | Unset): + 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. + + Returns: + Response[ApiError | DomainPaginatedListResponse] + """ + + kwargs = _get_kwargs( + domain_full_name=domain_full_name, + domain_name=domain_name, + tld_id=tld_id, + tld_extension=tld_extension, + 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, + domain_full_name: str | Unset = UNSET, + domain_name: str | Unset = UNSET, + tld_id: int | Unset = UNSET, + tld_extension: str | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | DomainPaginatedListResponse | None: + """List domains + + Get a list of all Domains + + Args: + domain_full_name (str | Unset): + domain_name (str | Unset): + tld_id (int | Unset): + tld_extension (str | Unset): + 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. + + Returns: + ApiError | DomainPaginatedListResponse + """ + + return ( + await asyncio_detailed( + client=client, + domain_full_name=domain_full_name, + domain_name=domain_name, + tld_id=tld_id, + tld_extension=tld_extension, + page=page, + per_page=per_page, + ) + ).parsed 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 new file mode 100644 index 0000000..ef1304d --- /dev/null +++ b/src/shellrent_sdk/client/api/domains/set_domain_cloudflare_nameservers.py @@ -0,0 +1,212 @@ +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.domain_dns_nameservers_cloudflare_request import ( + DomainDnsNameserversCloudflareRequest, +) +from ...models.task_response import TaskResponse +from ...types import Response + + +def _get_kwargs( + domain_id: int, + *, + body: DomainDnsNameserversCloudflareRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/api/v3/domains/{domain_id}/dns/cloudflare".format( + domain_id=quote(str(domain_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( + domain_id: int, + *, + client: AuthenticatedClient, + body: DomainDnsNameserversCloudflareRequest, +) -> Response[ApiError | TaskResponse]: + """Nameservers: Cloudflare + + Activate "Cloudflare" nameservers on domain + + Args: + domain_id (int): + body (DomainDnsNameserversCloudflareRequest): + + 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( + domain_id=domain_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + domain_id: int, + *, + client: AuthenticatedClient, + body: DomainDnsNameserversCloudflareRequest, +) -> ApiError | TaskResponse | None: + """Nameservers: Cloudflare + + Activate "Cloudflare" nameservers on domain + + Args: + domain_id (int): + body (DomainDnsNameserversCloudflareRequest): + + 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( + domain_id=domain_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + domain_id: int, + *, + client: AuthenticatedClient, + body: DomainDnsNameserversCloudflareRequest, +) -> Response[ApiError | TaskResponse]: + """Nameservers: Cloudflare + + Activate "Cloudflare" nameservers on domain + + Args: + domain_id (int): + body (DomainDnsNameserversCloudflareRequest): + + 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( + domain_id=domain_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + domain_id: int, + *, + client: AuthenticatedClient, + body: DomainDnsNameserversCloudflareRequest, +) -> ApiError | TaskResponse | None: + """Nameservers: Cloudflare + + Activate "Cloudflare" nameservers on domain + + Args: + domain_id (int): + body (DomainDnsNameserversCloudflareRequest): + + 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( + domain_id=domain_id, + client=client, + body=body, + ) + ).parsed 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 new file mode 100644 index 0000000..30d9028 --- /dev/null +++ b/src/shellrent_sdk/client/api/domains/set_domain_external_nameservers.py @@ -0,0 +1,210 @@ +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.domain_dns_nameservers_change_request import DomainDnsNameserversChangeRequest +from ...models.task_response import TaskResponse +from ...types import Response + + +def _get_kwargs( + domain_id: int, + *, + body: DomainDnsNameserversChangeRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/api/v3/domains/{domain_id}/dns/change-nameservers".format( + domain_id=quote(str(domain_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( + domain_id: int, + *, + client: AuthenticatedClient, + body: DomainDnsNameserversChangeRequest, +) -> Response[ApiError | TaskResponse]: + """Nameservers: external + + Activate "external" nameservers or change current "external" nameservers + + Args: + domain_id (int): + body (DomainDnsNameserversChangeRequest): + + 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( + domain_id=domain_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + domain_id: int, + *, + client: AuthenticatedClient, + body: DomainDnsNameserversChangeRequest, +) -> ApiError | TaskResponse | None: + """Nameservers: external + + Activate "external" nameservers or change current "external" nameservers + + Args: + domain_id (int): + body (DomainDnsNameserversChangeRequest): + + 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( + domain_id=domain_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + domain_id: int, + *, + client: AuthenticatedClient, + body: DomainDnsNameserversChangeRequest, +) -> Response[ApiError | TaskResponse]: + """Nameservers: external + + Activate "external" nameservers or change current "external" nameservers + + Args: + domain_id (int): + body (DomainDnsNameserversChangeRequest): + + 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( + domain_id=domain_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + domain_id: int, + *, + client: AuthenticatedClient, + body: DomainDnsNameserversChangeRequest, +) -> ApiError | TaskResponse | None: + """Nameservers: external + + Activate "external" nameservers or change current "external" nameservers + + Args: + domain_id (int): + body (DomainDnsNameserversChangeRequest): + + 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( + domain_id=domain_id, + client=client, + body=body, + ) + ).parsed 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 new file mode 100644 index 0000000..fe5d570 --- /dev/null +++ b/src/shellrent_sdk/client/api/domains/set_domain_standard_nameservers.py @@ -0,0 +1,189 @@ +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( + domain_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/api/v3/domains/{domain_id}/dns/standard".format( + domain_id=quote(str(domain_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( + domain_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | TaskResponse]: + """Nameservers: standard + + Activate "standard" nameservers on domain + + Args: + domain_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( + domain_id=domain_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + domain_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | TaskResponse | None: + """Nameservers: standard + + Activate "standard" nameservers on domain + + Args: + domain_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( + domain_id=domain_id, + client=client, + ).parsed + + +async def asyncio_detailed( + domain_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | TaskResponse]: + """Nameservers: standard + + Activate "standard" nameservers on domain + + Args: + domain_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( + domain_id=domain_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + domain_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | TaskResponse | None: + """Nameservers: standard + + Activate "standard" nameservers on domain + + Args: + domain_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( + domain_id=domain_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/domains/update_domain_contact.py b/src/shellrent_sdk/client/api/domains/update_domain_contact.py new file mode 100644 index 0000000..02616a3 --- /dev/null +++ b/src/shellrent_sdk/client/api/domains/update_domain_contact.py @@ -0,0 +1,224 @@ +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.domain_contact_request import DomainContactRequest +from ...models.domain_contact_response import DomainContactResponse +from ...types import Response + + +def _get_kwargs( + domain_id: int, + domain_contact_id: int, + *, + body: DomainContactRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/api/v3/domains/{domain_id}/contacts/{domain_contact_id}".format( + domain_id=quote(str(domain_id), safe=""), + domain_contact_id=quote(str(domain_contact_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 | DomainContactResponse | None: + if response.status_code == 200: + response_200 = DomainContactResponse.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 | DomainContactResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + domain_id: int, + domain_contact_id: int, + *, + client: AuthenticatedClient, + body: DomainContactRequest, +) -> Response[ApiError | DomainContactResponse]: + """Modify contact + + Modify a contact's data + + Args: + domain_id (int): + domain_contact_id (int): + body (DomainContactRequest): + + 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 | DomainContactResponse] + """ + + kwargs = _get_kwargs( + domain_id=domain_id, + domain_contact_id=domain_contact_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + domain_id: int, + domain_contact_id: int, + *, + client: AuthenticatedClient, + body: DomainContactRequest, +) -> ApiError | DomainContactResponse | None: + """Modify contact + + Modify a contact's data + + Args: + domain_id (int): + domain_contact_id (int): + body (DomainContactRequest): + + 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 | DomainContactResponse + """ + + return sync_detailed( + domain_id=domain_id, + domain_contact_id=domain_contact_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + domain_id: int, + domain_contact_id: int, + *, + client: AuthenticatedClient, + body: DomainContactRequest, +) -> Response[ApiError | DomainContactResponse]: + """Modify contact + + Modify a contact's data + + Args: + domain_id (int): + domain_contact_id (int): + body (DomainContactRequest): + + 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 | DomainContactResponse] + """ + + kwargs = _get_kwargs( + domain_id=domain_id, + domain_contact_id=domain_contact_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + domain_id: int, + domain_contact_id: int, + *, + client: AuthenticatedClient, + body: DomainContactRequest, +) -> ApiError | DomainContactResponse | None: + """Modify contact + + Modify a contact's data + + Args: + domain_id (int): + domain_contact_id (int): + body (DomainContactRequest): + + 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 | DomainContactResponse + """ + + return ( + await asyncio_detailed( + domain_id=domain_id, + domain_contact_id=domain_contact_id, + client=client, + body=body, + ) + ).parsed 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 new file mode 100644 index 0000000..79ddaed --- /dev/null +++ b/src/shellrent_sdk/client/api/domains/update_domain_dns_record.py @@ -0,0 +1,224 @@ +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.dns_record_response import DnsRecordResponse +from ...models.domain_dns_record_change_request import DomainDnsRecordChangeRequest +from ...types import Response + + +def _get_kwargs( + domain_id: int, + record_id: str, + *, + body: DomainDnsRecordChangeRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/api/v3/domains/{domain_id}/dns/records/{record_id}".format( + domain_id=quote(str(domain_id), safe=""), + record_id=quote(str(record_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 | DnsRecordResponse | None: + if response.status_code == 200: + response_200 = DnsRecordResponse.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 | DnsRecordResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + domain_id: int, + record_id: str, + *, + client: AuthenticatedClient, + body: DomainDnsRecordChangeRequest, +) -> Response[ApiError | DnsRecordResponse]: + """Modify DNS record + + Modify an existing DNS record + + Args: + domain_id (int): + record_id (str): + body (DomainDnsRecordChangeRequest): + + 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 | DnsRecordResponse] + """ + + kwargs = _get_kwargs( + domain_id=domain_id, + record_id=record_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + domain_id: int, + record_id: str, + *, + client: AuthenticatedClient, + body: DomainDnsRecordChangeRequest, +) -> ApiError | DnsRecordResponse | None: + """Modify DNS record + + Modify an existing DNS record + + Args: + domain_id (int): + record_id (str): + body (DomainDnsRecordChangeRequest): + + 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 | DnsRecordResponse + """ + + return sync_detailed( + domain_id=domain_id, + record_id=record_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + domain_id: int, + record_id: str, + *, + client: AuthenticatedClient, + body: DomainDnsRecordChangeRequest, +) -> Response[ApiError | DnsRecordResponse]: + """Modify DNS record + + Modify an existing DNS record + + Args: + domain_id (int): + record_id (str): + body (DomainDnsRecordChangeRequest): + + 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 | DnsRecordResponse] + """ + + kwargs = _get_kwargs( + domain_id=domain_id, + record_id=record_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + domain_id: int, + record_id: str, + *, + client: AuthenticatedClient, + body: DomainDnsRecordChangeRequest, +) -> ApiError | DnsRecordResponse | None: + """Modify DNS record + + Modify an existing DNS record + + Args: + domain_id (int): + record_id (str): + body (DomainDnsRecordChangeRequest): + + 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 | DnsRecordResponse + """ + + return ( + await asyncio_detailed( + domain_id=domain_id, + record_id=record_id, + client=client, + body=body, + ) + ).parsed 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 new file mode 100644 index 0000000..7e013c9 --- /dev/null +++ b/src/shellrent_sdk/client/api/domains/update_domain_dns_zone.py @@ -0,0 +1,210 @@ +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.dns_zone_response import DnsZoneResponse +from ...models.domain_dns_zone_request import DomainDnsZoneRequest +from ...types import Response + + +def _get_kwargs( + domain_id: int, + *, + body: DomainDnsZoneRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/api/v3/domains/{domain_id}/dns".format( + domain_id=quote(str(domain_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 | DnsZoneResponse | None: + if response.status_code == 200: + response_200 = DnsZoneResponse.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 | DnsZoneResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + domain_id: int, + *, + client: AuthenticatedClient, + body: DomainDnsZoneRequest, +) -> Response[ApiError | DnsZoneResponse]: + """Change DNS Zone data + + Change DNS Zone data + + Args: + domain_id (int): + body (DomainDnsZoneRequest): + + 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 | DnsZoneResponse] + """ + + kwargs = _get_kwargs( + domain_id=domain_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + domain_id: int, + *, + client: AuthenticatedClient, + body: DomainDnsZoneRequest, +) -> ApiError | DnsZoneResponse | None: + """Change DNS Zone data + + Change DNS Zone data + + Args: + domain_id (int): + body (DomainDnsZoneRequest): + + 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 | DnsZoneResponse + """ + + return sync_detailed( + domain_id=domain_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + domain_id: int, + *, + client: AuthenticatedClient, + body: DomainDnsZoneRequest, +) -> Response[ApiError | DnsZoneResponse]: + """Change DNS Zone data + + Change DNS Zone data + + Args: + domain_id (int): + body (DomainDnsZoneRequest): + + 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 | DnsZoneResponse] + """ + + kwargs = _get_kwargs( + domain_id=domain_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + domain_id: int, + *, + client: AuthenticatedClient, + body: DomainDnsZoneRequest, +) -> ApiError | DnsZoneResponse | None: + """Change DNS Zone data + + Change DNS Zone data + + Args: + domain_id (int): + body (DomainDnsZoneRequest): + + 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 | DnsZoneResponse + """ + + return ( + await asyncio_detailed( + domain_id=domain_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/domains/update_domain_dnssec.py b/src/shellrent_sdk/client/api/domains/update_domain_dnssec.py new file mode 100644 index 0000000..134338c --- /dev/null +++ b/src/shellrent_sdk/client/api/domains/update_domain_dnssec.py @@ -0,0 +1,210 @@ +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.domain_dnssec_request import DomainDnssecRequest +from ...models.task_response import TaskResponse +from ...types import Response + + +def _get_kwargs( + domain_id: int, + *, + body: DomainDnssecRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/api/v3/domains/{domain_id}/dnssec".format( + domain_id=quote(str(domain_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( + domain_id: int, + *, + client: AuthenticatedClient, + body: DomainDnssecRequest, +) -> Response[ApiError | TaskResponse]: + """Change DNSSEC data + + Add or change DNSSEC data records (for domains with "external" nameservers only) + + Args: + domain_id (int): + body (DomainDnssecRequest): + + 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( + domain_id=domain_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + domain_id: int, + *, + client: AuthenticatedClient, + body: DomainDnssecRequest, +) -> ApiError | TaskResponse | None: + """Change DNSSEC data + + Add or change DNSSEC data records (for domains with "external" nameservers only) + + Args: + domain_id (int): + body (DomainDnssecRequest): + + 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( + domain_id=domain_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + domain_id: int, + *, + client: AuthenticatedClient, + body: DomainDnssecRequest, +) -> Response[ApiError | TaskResponse]: + """Change DNSSEC data + + Add or change DNSSEC data records (for domains with "external" nameservers only) + + Args: + domain_id (int): + body (DomainDnssecRequest): + + 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( + domain_id=domain_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + domain_id: int, + *, + client: AuthenticatedClient, + body: DomainDnssecRequest, +) -> ApiError | TaskResponse | None: + """Change DNSSEC data + + Add or change DNSSEC data records (for domains with "external" nameservers only) + + Args: + domain_id (int): + body (DomainDnssecRequest): + + 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( + domain_id=domain_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/health/__init__.py b/src/shellrent_sdk/client/api/health/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/src/shellrent_sdk/client/api/health/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/src/shellrent_sdk/client/api/health/get_health.py b/src/shellrent_sdk/client/api/health/get_health.py new file mode 100644 index 0000000..d6bff83 --- /dev/null +++ b/src/shellrent_sdk/client/api/health/get_health.py @@ -0,0 +1,152 @@ +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.health_status_response import HealthStatusResponse +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/health", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | HealthStatusResponse | None: + if response.status_code == 200: + response_200 = HealthStatusResponse.from_dict(response.json()) + + return response_200 + + 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 == 500: + response_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[ApiError | HealthStatusResponse]: + 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, +) -> Response[ApiError | HealthStatusResponse]: + """Verifica lo stato del servizio + + Restituisce lo stato corrente dell'API. + + 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 | HealthStatusResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> ApiError | HealthStatusResponse | None: + """Verifica lo stato del servizio + + Restituisce lo stato corrente dell'API. + + 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 | HealthStatusResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[ApiError | HealthStatusResponse]: + """Verifica lo stato del servizio + + Restituisce lo stato corrente dell'API. + + 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 | HealthStatusResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> ApiError | HealthStatusResponse | None: + """Verifica lo stato del servizio + + Restituisce lo stato corrente dell'API. + + 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 | HealthStatusResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/hosting/__init__.py b/src/shellrent_sdk/client/api/hosting/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" 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 new file mode 100644 index 0000000..1423ecb --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/create_hosting_allow_list_entry.py @@ -0,0 +1,210 @@ +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_allow_list_response import HostingEmailAllowListResponse +from ...models.hosting_email_wblist_request import HostingEmailWblistRequest +from ...types import Response + + +def _get_kwargs( + hosting_id: int, + *, + body: HostingEmailWblistRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/hostings/{hosting_id}/allow-lists".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 | HostingEmailAllowListResponse | None: + if response.status_code == 200: + response_200 = HostingEmailAllowListResponse.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 | HostingEmailAllowListResponse]: + 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: HostingEmailWblistRequest, +) -> Response[ApiError | HostingEmailAllowListResponse]: + """Create allow list entry + + Create a new allow list entry for hosting + + Args: + hosting_id (int): + body (HostingEmailWblistRequest): + + 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 | HostingEmailAllowListResponse] + """ + + 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: HostingEmailWblistRequest, +) -> ApiError | HostingEmailAllowListResponse | None: + """Create allow list entry + + Create a new allow list entry for hosting + + Args: + hosting_id (int): + body (HostingEmailWblistRequest): + + 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 | HostingEmailAllowListResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, + body: HostingEmailWblistRequest, +) -> Response[ApiError | HostingEmailAllowListResponse]: + """Create allow list entry + + Create a new allow list entry for hosting + + Args: + hosting_id (int): + body (HostingEmailWblistRequest): + + 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 | HostingEmailAllowListResponse] + """ + + 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: HostingEmailWblistRequest, +) -> ApiError | HostingEmailAllowListResponse | None: + """Create allow list entry + + Create a new allow list entry for hosting + + Args: + hosting_id (int): + body (HostingEmailWblistRequest): + + 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 | HostingEmailAllowListResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + client=client, + body=body, + ) + ).parsed 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 new file mode 100644 index 0000000..e489bc0 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/create_hosting_block_list_entry.py @@ -0,0 +1,210 @@ +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_bloc_list_response import HostingEmailBlocListResponse +from ...models.hosting_email_wblist_request import HostingEmailWblistRequest +from ...types import Response + + +def _get_kwargs( + hosting_id: int, + *, + body: HostingEmailWblistRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/hostings/{hosting_id}/block-lists".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 | HostingEmailBlocListResponse | None: + if response.status_code == 200: + response_200 = HostingEmailBlocListResponse.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 | HostingEmailBlocListResponse]: + 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: HostingEmailWblistRequest, +) -> Response[ApiError | HostingEmailBlocListResponse]: + """Create block list entry + + Create a new block list entry for hosting + + Args: + hosting_id (int): + body (HostingEmailWblistRequest): + + 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] + """ + + 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: HostingEmailWblistRequest, +) -> ApiError | HostingEmailBlocListResponse | None: + """Create block list entry + + Create a new block list entry for hosting + + Args: + hosting_id (int): + body (HostingEmailWblistRequest): + + 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 + """ + + return sync_detailed( + hosting_id=hosting_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, + body: HostingEmailWblistRequest, +) -> Response[ApiError | HostingEmailBlocListResponse]: + """Create block list entry + + Create a new block list entry for hosting + + Args: + hosting_id (int): + body (HostingEmailWblistRequest): + + 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] + """ + + 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: HostingEmailWblistRequest, +) -> ApiError | HostingEmailBlocListResponse | None: + """Create block list entry + + Create a new block list entry for hosting + + Args: + hosting_id (int): + body (HostingEmailWblistRequest): + + 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 + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + client=client, + body=body, + ) + ).parsed 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 new file mode 100644 index 0000000..08798b0 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/create_hosting_catch_all.py @@ -0,0 +1,210 @@ +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 new file mode 100644 index 0000000..974df08 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/create_hosting_cronjob.py @@ -0,0 +1,210 @@ +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_cronjob_create_request import HostingCronjobCreateRequest +from ...models.hosting_cronjob_response import HostingCronjobResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, + *, + body: HostingCronjobCreateRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/hostings/{hosting_id}/cronjobs".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 | HostingCronjobResponse | None: + if response.status_code == 200: + response_200 = HostingCronjobResponse.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 | HostingCronjobResponse]: + 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: HostingCronjobCreateRequest, +) -> Response[ApiError | HostingCronjobResponse]: + """Create hosting cronjob + + Create a new cronjob for hosting + + Args: + hosting_id (int): + body (HostingCronjobCreateRequest): + + 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 | HostingCronjobResponse] + """ + + 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: HostingCronjobCreateRequest, +) -> ApiError | HostingCronjobResponse | None: + """Create hosting cronjob + + Create a new cronjob for hosting + + Args: + hosting_id (int): + body (HostingCronjobCreateRequest): + + 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 | HostingCronjobResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, + body: HostingCronjobCreateRequest, +) -> Response[ApiError | HostingCronjobResponse]: + """Create hosting cronjob + + Create a new cronjob for hosting + + Args: + hosting_id (int): + body (HostingCronjobCreateRequest): + + 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 | HostingCronjobResponse] + """ + + 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: HostingCronjobCreateRequest, +) -> ApiError | HostingCronjobResponse | None: + """Create hosting cronjob + + Create a new cronjob for hosting + + Args: + hosting_id (int): + body (HostingCronjobCreateRequest): + + 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 | HostingCronjobResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/hosting/create_hosting_database.py b/src/shellrent_sdk/client/api/hosting/create_hosting_database.py new file mode 100644 index 0000000..b0374dd --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/create_hosting_database.py @@ -0,0 +1,210 @@ +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_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", + "url": "/api/v3/hostings/{hosting_id}/databases".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 | HostingDatabaseResponse | None: + if response.status_code == 200: + response_200 = HostingDatabaseResponse.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 | HostingDatabaseResponse]: + 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: HostingDatabaseCreateRequest, +) -> Response[ApiError | HostingDatabaseResponse]: + """Create hosting database + + Create hosting database + + 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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ApiError | HostingDatabaseResponse] + """ + + 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: HostingDatabaseCreateRequest, +) -> ApiError | HostingDatabaseResponse | None: + """Create hosting database + + Create hosting database + + 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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ApiError | HostingDatabaseResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, + body: HostingDatabaseCreateRequest, +) -> Response[ApiError | HostingDatabaseResponse]: + """Create hosting database + + Create hosting database + + 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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ApiError | HostingDatabaseResponse] + """ + + 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: HostingDatabaseCreateRequest, +) -> ApiError | HostingDatabaseResponse | None: + """Create hosting database + + Create hosting database + + 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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ApiError | HostingDatabaseResponse + """ + + return ( + 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 new file mode 100644 index 0000000..04f9f7b --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/create_hosting_email_alias.py @@ -0,0 +1,210 @@ +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_alias_create_request import HostingEmailAliasCreateRequest +from ...models.hosting_email_alias_response import HostingEmailAliasResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, + *, + body: HostingEmailAliasCreateRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/hostings/{hosting_id}/email/aliases".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 | HostingEmailAliasResponse | None: + if response.status_code == 200: + response_200 = HostingEmailAliasResponse.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 | HostingEmailAliasResponse]: + 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: HostingEmailAliasCreateRequest, +) -> Response[ApiError | HostingEmailAliasResponse]: + """Create hosting email alias + + Create a new email alias for the hosting + + Args: + hosting_id (int): + body (HostingEmailAliasCreateRequest): + + 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 | HostingEmailAliasResponse] + """ + + 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: HostingEmailAliasCreateRequest, +) -> ApiError | HostingEmailAliasResponse | None: + """Create hosting email alias + + Create a new email alias for the hosting + + Args: + hosting_id (int): + body (HostingEmailAliasCreateRequest): + + 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 | HostingEmailAliasResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, + body: HostingEmailAliasCreateRequest, +) -> Response[ApiError | HostingEmailAliasResponse]: + """Create hosting email alias + + Create a new email alias for the hosting + + Args: + hosting_id (int): + body (HostingEmailAliasCreateRequest): + + 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 | HostingEmailAliasResponse] + """ + + 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: HostingEmailAliasCreateRequest, +) -> ApiError | HostingEmailAliasResponse | None: + """Create hosting email alias + + Create a new email alias for the hosting + + Args: + hosting_id (int): + body (HostingEmailAliasCreateRequest): + + 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 | HostingEmailAliasResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + client=client, + body=body, + ) + ).parsed 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 new file mode 100644 index 0000000..ded4d80 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/create_hosting_mod_security_rule.py @@ -0,0 +1,210 @@ +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_mod_security_rule_create_request import HostingModSecurityRuleCreateRequest +from ...models.hosting_mod_security_rule_response import HostingModSecurityRuleResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, + *, + body: HostingModSecurityRuleCreateRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/hostings/{hosting_id}/modsecurity/rules".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 | HostingModSecurityRuleResponse | None: + if response.status_code == 200: + response_200 = HostingModSecurityRuleResponse.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 | HostingModSecurityRuleResponse]: + 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: HostingModSecurityRuleCreateRequest, +) -> Response[ApiError | HostingModSecurityRuleResponse]: + """Create ModSecurity rule + + Add a ModSecurity rule by rule number + + Args: + hosting_id (int): + body (HostingModSecurityRuleCreateRequest): + + 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 | HostingModSecurityRuleResponse] + """ + + 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: HostingModSecurityRuleCreateRequest, +) -> ApiError | HostingModSecurityRuleResponse | None: + """Create ModSecurity rule + + Add a ModSecurity rule by rule number + + Args: + hosting_id (int): + body (HostingModSecurityRuleCreateRequest): + + 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 | HostingModSecurityRuleResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, + body: HostingModSecurityRuleCreateRequest, +) -> Response[ApiError | HostingModSecurityRuleResponse]: + """Create ModSecurity rule + + Add a ModSecurity rule by rule number + + Args: + hosting_id (int): + body (HostingModSecurityRuleCreateRequest): + + 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 | HostingModSecurityRuleResponse] + """ + + 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: HostingModSecurityRuleCreateRequest, +) -> ApiError | HostingModSecurityRuleResponse | None: + """Create ModSecurity rule + + Add a ModSecurity rule by rule number + + Args: + hosting_id (int): + body (HostingModSecurityRuleCreateRequest): + + 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 | HostingModSecurityRuleResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/hosting/create_hosting_subdomain.py b/src/shellrent_sdk/client/api/hosting/create_hosting_subdomain.py new file mode 100644 index 0000000..4d16755 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/create_hosting_subdomain.py @@ -0,0 +1,210 @@ +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_response import HostingResponse +from ...models.hosting_subdomain_create_request import HostingSubdomainCreateRequest +from ...types import Response + + +def _get_kwargs( + hosting_id: int, + *, + body: HostingSubdomainCreateRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/hostings/{hosting_id}".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 | HostingResponse | None: + if response.status_code == 200: + response_200 = HostingResponse.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 | HostingResponse]: + 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: HostingSubdomainCreateRequest, +) -> Response[ApiError | HostingResponse]: + """Create subdomain + + Create subdomain + + Args: + hosting_id (int): + body (HostingSubdomainCreateRequest): + + 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 | HostingResponse] + """ + + 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: HostingSubdomainCreateRequest, +) -> ApiError | HostingResponse | None: + """Create subdomain + + Create subdomain + + Args: + hosting_id (int): + body (HostingSubdomainCreateRequest): + + 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 | HostingResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, + body: HostingSubdomainCreateRequest, +) -> Response[ApiError | HostingResponse]: + """Create subdomain + + Create subdomain + + Args: + hosting_id (int): + body (HostingSubdomainCreateRequest): + + 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 | HostingResponse] + """ + + 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: HostingSubdomainCreateRequest, +) -> ApiError | HostingResponse | None: + """Create subdomain + + Create subdomain + + Args: + hosting_id (int): + body (HostingSubdomainCreateRequest): + + 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 | HostingResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + client=client, + body=body, + ) + ).parsed 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 new file mode 100644 index 0000000..82f2608 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/delete_all_hosting_mod_security_rules.py @@ -0,0 +1,189 @@ +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.empty_response import EmptyResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/api/v3/hostings/{hosting_id}/modsecurity/rules".format( + hosting_id=quote(str(hosting_id), safe=""), + ), + } + + return _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 + + 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 | EmptyResponse]: + 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, +) -> Response[ApiError | EmptyResponse]: + """Delete all ModSecurity rules + + Disable all ModSecurity rules for a hosting + + Args: + hosting_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] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Delete all ModSecurity rules + + Disable all ModSecurity rules for a hosting + + Args: + hosting_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 + """ + + return sync_detailed( + hosting_id=hosting_id, + client=client, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Delete all ModSecurity rules + + Disable all ModSecurity rules for a hosting + + Args: + hosting_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] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Delete all ModSecurity rules + + Disable all ModSecurity rules for a hosting + + Args: + hosting_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 + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..c234133 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/delete_hosting_allow_list_entry.py @@ -0,0 +1,203 @@ +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.empty_response import EmptyResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, + allow_list_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/api/v3/hostings/{hosting_id}/allow-lists/{allow_list_id}".format( + hosting_id=quote(str(hosting_id), safe=""), + allow_list_id=quote(str(allow_list_id), safe=""), + ), + } + + return _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 + + 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 | EmptyResponse]: + 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, + allow_list_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Delete allow list entry + + Delete an allow list entry for hosting + + Args: + hosting_id (int): + allow_list_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] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + allow_list_id=allow_list_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + allow_list_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Delete allow list entry + + Delete an allow list entry for hosting + + Args: + hosting_id (int): + allow_list_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 + """ + + return sync_detailed( + hosting_id=hosting_id, + allow_list_id=allow_list_id, + client=client, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + allow_list_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Delete allow list entry + + Delete an allow list entry for hosting + + Args: + hosting_id (int): + allow_list_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] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + allow_list_id=allow_list_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + hosting_id: int, + allow_list_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Delete allow list entry + + Delete an allow list entry for hosting + + Args: + hosting_id (int): + allow_list_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 + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + allow_list_id=allow_list_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..6141708 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/delete_hosting_block_list_entry.py @@ -0,0 +1,203 @@ +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.empty_response import EmptyResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, + block_list_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/api/v3/hostings/{hosting_id}/block-lists/{block_list_id}".format( + hosting_id=quote(str(hosting_id), safe=""), + block_list_id=quote(str(block_list_id), safe=""), + ), + } + + return _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 + + 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 | EmptyResponse]: + 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, + block_list_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Delete block list entry + + Delete a block list entry for hosting + + Args: + hosting_id (int): + block_list_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] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + block_list_id=block_list_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + block_list_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Delete block list entry + + Delete a block list entry for hosting + + Args: + hosting_id (int): + block_list_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 + """ + + return sync_detailed( + hosting_id=hosting_id, + block_list_id=block_list_id, + client=client, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + block_list_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Delete block list entry + + Delete a block list entry for hosting + + Args: + hosting_id (int): + block_list_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] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + block_list_id=block_list_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + hosting_id: int, + block_list_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Delete block list entry + + Delete a block list entry for hosting + + Args: + hosting_id (int): + block_list_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 + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + block_list_id=block_list_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..3f982de --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/delete_hosting_catch_all.py @@ -0,0 +1,189 @@ +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.empty_response import EmptyResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/api/v3/hostings/{hosting_id}/email/catch-all".format( + hosting_id=quote(str(hosting_id), safe=""), + ), + } + + return _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 + + 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 | EmptyResponse]: + 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, +) -> Response[ApiError | EmptyResponse]: + """Delete catch-all alias + + Delete the catch-all alias + + Args: + hosting_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] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Delete catch-all alias + + Delete the catch-all alias + + Args: + hosting_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 + """ + + return sync_detailed( + hosting_id=hosting_id, + client=client, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Delete catch-all alias + + Delete the catch-all alias + + Args: + hosting_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] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Delete catch-all alias + + Delete the catch-all alias + + Args: + hosting_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 + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/hosting/delete_hosting_cronjob.py b/src/shellrent_sdk/client/api/hosting/delete_hosting_cronjob.py new file mode 100644 index 0000000..6019153 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/delete_hosting_cronjob.py @@ -0,0 +1,203 @@ +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.empty_response import EmptyResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, + cronjob_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/api/v3/hostings/{hosting_id}/cronjobs/{cronjob_id}".format( + hosting_id=quote(str(hosting_id), safe=""), + cronjob_id=quote(str(cronjob_id), safe=""), + ), + } + + return _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 + + 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 | EmptyResponse]: + 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, + cronjob_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Delete hosting cronjob + + Delete a cronjob for hosting + + Args: + hosting_id (int): + cronjob_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] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + cronjob_id=cronjob_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + cronjob_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Delete hosting cronjob + + Delete a cronjob for hosting + + Args: + hosting_id (int): + cronjob_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 + """ + + return sync_detailed( + hosting_id=hosting_id, + cronjob_id=cronjob_id, + client=client, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + cronjob_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Delete hosting cronjob + + Delete a cronjob for hosting + + Args: + hosting_id (int): + cronjob_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] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + cronjob_id=cronjob_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + hosting_id: int, + cronjob_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Delete hosting cronjob + + Delete a cronjob for hosting + + Args: + hosting_id (int): + cronjob_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 + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + cronjob_id=cronjob_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 new file mode 100644 index 0000000..44b6bec --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/delete_hosting_email_alias.py @@ -0,0 +1,203 @@ +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.empty_response import EmptyResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, + alias_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/api/v3/hostings/{hosting_id}/email/aliases/{alias_id}".format( + hosting_id=quote(str(hosting_id), safe=""), + alias_id=quote(str(alias_id), safe=""), + ), + } + + return _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 + + 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 | EmptyResponse]: + 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, + alias_id: str, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Delete hosting email alias + + Delete an email alias + + Args: + hosting_id (int): + alias_id (str): + + 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] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + alias_id=alias_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + alias_id: str, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Delete hosting email alias + + Delete an email alias + + Args: + hosting_id (int): + alias_id (str): + + 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 + """ + + return sync_detailed( + hosting_id=hosting_id, + alias_id=alias_id, + client=client, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + alias_id: str, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Delete hosting email alias + + Delete an email alias + + Args: + hosting_id (int): + alias_id (str): + + 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] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + alias_id=alias_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + hosting_id: int, + alias_id: str, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Delete hosting email alias + + Delete an email alias + + Args: + hosting_id (int): + alias_id (str): + + 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 + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + alias_id=alias_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..dde44b3 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/delete_hosting_exposed_backup.py @@ -0,0 +1,203 @@ +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( + hosting_id: int, + hosting_backup_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/api/v3/hostings/{hosting_id}/backups/exhibitions/{hosting_backup_id}".format( + hosting_id=quote(str(hosting_id), safe=""), + hosting_backup_id=quote(str(hosting_backup_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( + hosting_id: int, + hosting_backup_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | TaskResponse]: + """Delete exposed backup + + Delete a single exposed backup for hosting + + Args: + hosting_id (int): + hosting_backup_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( + hosting_id=hosting_id, + hosting_backup_id=hosting_backup_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + hosting_backup_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | TaskResponse | None: + """Delete exposed backup + + Delete a single exposed backup for hosting + + Args: + hosting_id (int): + hosting_backup_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( + hosting_id=hosting_id, + hosting_backup_id=hosting_backup_id, + client=client, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + hosting_backup_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | TaskResponse]: + """Delete exposed backup + + Delete a single exposed backup for hosting + + Args: + hosting_id (int): + hosting_backup_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( + hosting_id=hosting_id, + hosting_backup_id=hosting_backup_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + hosting_id: int, + hosting_backup_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | TaskResponse | None: + """Delete exposed backup + + Delete a single exposed backup for hosting + + Args: + hosting_id (int): + hosting_backup_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( + hosting_id=hosting_id, + hosting_backup_id=hosting_backup_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..fdfeea8 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/delete_hosting_mod_security_rule.py @@ -0,0 +1,203 @@ +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.empty_response import EmptyResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, + rule_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/api/v3/hostings/{hosting_id}/modsecurity/rules/{rule_id}".format( + hosting_id=quote(str(hosting_id), safe=""), + rule_id=quote(str(rule_id), safe=""), + ), + } + + return _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 + + 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 | EmptyResponse]: + 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, + rule_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Delete ModSecurity rule + + Disable a ModSecurity rule by id + + Args: + hosting_id (int): + rule_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] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + rule_id=rule_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + rule_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Delete ModSecurity rule + + Disable a ModSecurity rule by id + + Args: + hosting_id (int): + rule_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 + """ + + return sync_detailed( + hosting_id=hosting_id, + rule_id=rule_id, + client=client, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + rule_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Delete ModSecurity rule + + Disable a ModSecurity rule by id + + Args: + hosting_id (int): + rule_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] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + rule_id=rule_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + hosting_id: int, + rule_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Delete ModSecurity rule + + Disable a ModSecurity rule by id + + Args: + hosting_id (int): + rule_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 + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + rule_id=rule_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/hosting/delete_hosting_subdomain.py b/src/shellrent_sdk/client/api/hosting/delete_hosting_subdomain.py new file mode 100644 index 0000000..ae8807f --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/delete_hosting_subdomain.py @@ -0,0 +1,189 @@ +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.empty_response import EmptyResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/api/v3/hostings/{hosting_id}".format( + hosting_id=quote(str(hosting_id), safe=""), + ), + } + + return _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 + + 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 | EmptyResponse]: + 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, +) -> Response[ApiError | EmptyResponse]: + """Delete subdomain + + Delete subdomain + + Args: + hosting_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] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Delete subdomain + + Delete subdomain + + Args: + hosting_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 + """ + + return sync_detailed( + hosting_id=hosting_id, + client=client, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Delete subdomain + + Delete subdomain + + Args: + hosting_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] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Delete subdomain + + Delete subdomain + + Args: + hosting_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 + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..a3b9f46 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/enable_hosting_mod_security_rules.py @@ -0,0 +1,210 @@ +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_mod_security_rule_bulk_request import HostingModSecurityRuleBulkRequest +from ...models.hosting_mod_security_rule_list_response import HostingModSecurityRuleListResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, + *, + body: HostingModSecurityRuleBulkRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/api/v3/hostings/{hosting_id}/modsecurity/rules".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 | HostingModSecurityRuleListResponse | None: + if response.status_code == 200: + response_200 = HostingModSecurityRuleListResponse.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 | HostingModSecurityRuleListResponse]: + 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: HostingModSecurityRuleBulkRequest, +) -> Response[ApiError | HostingModSecurityRuleListResponse]: + """Enable ModSecurity rules + + Enable multiple ModSecurity rules by id + + Args: + hosting_id (int): + body (HostingModSecurityRuleBulkRequest): + + 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 | HostingModSecurityRuleListResponse] + """ + + 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: HostingModSecurityRuleBulkRequest, +) -> ApiError | HostingModSecurityRuleListResponse | None: + """Enable ModSecurity rules + + Enable multiple ModSecurity rules by id + + Args: + hosting_id (int): + body (HostingModSecurityRuleBulkRequest): + + 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 | HostingModSecurityRuleListResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, + body: HostingModSecurityRuleBulkRequest, +) -> Response[ApiError | HostingModSecurityRuleListResponse]: + """Enable ModSecurity rules + + Enable multiple ModSecurity rules by id + + Args: + hosting_id (int): + body (HostingModSecurityRuleBulkRequest): + + 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 | HostingModSecurityRuleListResponse] + """ + + 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: HostingModSecurityRuleBulkRequest, +) -> ApiError | HostingModSecurityRuleListResponse | None: + """Enable ModSecurity rules + + Enable multiple ModSecurity rules by id + + Args: + hosting_id (int): + body (HostingModSecurityRuleBulkRequest): + + 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 | HostingModSecurityRuleListResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/hosting/expose_hosting_backups.py b/src/shellrent_sdk/client/api/hosting/expose_hosting_backups.py new file mode 100644 index 0000000..567a82c --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/expose_hosting_backups.py @@ -0,0 +1,210 @@ +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_backup_expose_request import HostingBackupExposeRequest +from ...models.task_response import TaskResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, + *, + body: HostingBackupExposeRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/hostings/{hosting_id}/backups/exhibit".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 | 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( + hosting_id: int, + *, + client: AuthenticatedClient, + body: HostingBackupExposeRequest, +) -> Response[ApiError | TaskResponse]: + """Expose hosting backups + + Expose backups for hosting + + Args: + hosting_id (int): + body (HostingBackupExposeRequest): + + 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( + 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: HostingBackupExposeRequest, +) -> ApiError | TaskResponse | None: + """Expose hosting backups + + Expose backups for hosting + + Args: + hosting_id (int): + body (HostingBackupExposeRequest): + + 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( + hosting_id=hosting_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, + body: HostingBackupExposeRequest, +) -> Response[ApiError | TaskResponse]: + """Expose hosting backups + + Expose backups for hosting + + Args: + hosting_id (int): + body (HostingBackupExposeRequest): + + 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( + 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: HostingBackupExposeRequest, +) -> ApiError | TaskResponse | None: + """Expose hosting backups + + Expose backups for hosting + + Args: + hosting_id (int): + body (HostingBackupExposeRequest): + + 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( + hosting_id=hosting_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/hosting/get_hosting.py b/src/shellrent_sdk/client/api/hosting/get_hosting.py new file mode 100644 index 0000000..26506e8 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/get_hosting.py @@ -0,0 +1,189 @@ +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_response import HostingResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/hostings/{hosting_id}".format( + hosting_id=quote(str(hosting_id), safe=""), + ), + } + + return _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()) + + 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 | HostingResponse]: + 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, +) -> Response[ApiError | HostingResponse]: + """Get hosting + + Get details of a hosting + + Args: + hosting_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 | HostingResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingResponse | None: + """Get hosting + + Get details of a hosting + + Args: + hosting_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 | HostingResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + client=client, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | HostingResponse]: + """Get hosting + + Get details of a hosting + + Args: + hosting_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 | HostingResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingResponse | None: + """Get hosting + + Get details of a hosting + + Args: + hosting_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 | HostingResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..2408100 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/get_hosting_allow_list_entry.py @@ -0,0 +1,203 @@ +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_allow_list_response import HostingEmailAllowListResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, + allow_list_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/hostings/{hosting_id}/allow-lists/{allow_list_id}".format( + hosting_id=quote(str(hosting_id), safe=""), + allow_list_id=quote(str(allow_list_id), safe=""), + ), + } + + return _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()) + + 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 | HostingEmailAllowListResponse]: + 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, + allow_list_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | HostingEmailAllowListResponse]: + """Get hosting allow list entry + + Get allow list entry details for hosting + + Args: + hosting_id (int): + allow_list_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 | HostingEmailAllowListResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + allow_list_id=allow_list_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + allow_list_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingEmailAllowListResponse | None: + """Get hosting allow list entry + + Get allow list entry details for hosting + + Args: + hosting_id (int): + allow_list_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 | HostingEmailAllowListResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + allow_list_id=allow_list_id, + client=client, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + allow_list_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | HostingEmailAllowListResponse]: + """Get hosting allow list entry + + Get allow list entry details for hosting + + Args: + hosting_id (int): + allow_list_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 | HostingEmailAllowListResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + allow_list_id=allow_list_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + hosting_id: int, + allow_list_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingEmailAllowListResponse | None: + """Get hosting allow list entry + + Get allow list entry details for hosting + + Args: + hosting_id (int): + allow_list_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 | HostingEmailAllowListResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + allow_list_id=allow_list_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/hosting/get_hosting_antivirus.py b/src/shellrent_sdk/client/api/hosting/get_hosting_antivirus.py new file mode 100644 index 0000000..b0b3584 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/get_hosting_antivirus.py @@ -0,0 +1,189 @@ +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.get_hosting_antivirus_response_200 import GetHostingAntivirusResponse200 +from ...types import Response + + +def _get_kwargs( + hosting_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/hostings/{hosting_id}/antivirus".format( + hosting_id=quote(str(hosting_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | GetHostingAntivirusResponse200 | None: + if response.status_code == 200: + response_200 = GetHostingAntivirusResponse200.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 | GetHostingAntivirusResponse200]: + 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, +) -> Response[ApiError | GetHostingAntivirusResponse200]: + """Get antivirus status + + Get latest antivirus scan status for hosting + + Args: + hosting_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 | GetHostingAntivirusResponse200] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | GetHostingAntivirusResponse200 | None: + """Get antivirus status + + Get latest antivirus scan status for hosting + + Args: + hosting_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 | GetHostingAntivirusResponse200 + """ + + return sync_detailed( + hosting_id=hosting_id, + client=client, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | GetHostingAntivirusResponse200]: + """Get antivirus status + + Get latest antivirus scan status for hosting + + Args: + hosting_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 | GetHostingAntivirusResponse200] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | GetHostingAntivirusResponse200 | None: + """Get antivirus status + + Get latest antivirus scan status for hosting + + Args: + hosting_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 | GetHostingAntivirusResponse200 + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..1812fa9 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/get_hosting_antivirus_removal_scan.py @@ -0,0 +1,203 @@ +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_antivirus_removal_scan_response import HostingAntivirusRemovalScanResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, + removal_scan_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/hostings/{hosting_id}/antivirus/removal-scans/{removal_scan_id}".format( + hosting_id=quote(str(hosting_id), safe=""), + removal_scan_id=quote(str(removal_scan_id), safe=""), + ), + } + + return _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()) + + 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 | HostingAntivirusRemovalScanResponse]: + 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, + removal_scan_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | HostingAntivirusRemovalScanResponse]: + """Get antivirus removal scan + + Get antivirus removal scan details + + Args: + hosting_id (int): + removal_scan_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 | HostingAntivirusRemovalScanResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + removal_scan_id=removal_scan_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + removal_scan_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingAntivirusRemovalScanResponse | None: + """Get antivirus removal scan + + Get antivirus removal scan details + + Args: + hosting_id (int): + removal_scan_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 | HostingAntivirusRemovalScanResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + removal_scan_id=removal_scan_id, + client=client, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + removal_scan_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | HostingAntivirusRemovalScanResponse]: + """Get antivirus removal scan + + Get antivirus removal scan details + + Args: + hosting_id (int): + removal_scan_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 | HostingAntivirusRemovalScanResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + removal_scan_id=removal_scan_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + hosting_id: int, + removal_scan_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingAntivirusRemovalScanResponse | None: + """Get antivirus removal scan + + Get antivirus removal scan details + + Args: + hosting_id (int): + removal_scan_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 | HostingAntivirusRemovalScanResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + removal_scan_id=removal_scan_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..bf8ceb6 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/get_hosting_antivirus_scan.py @@ -0,0 +1,203 @@ +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_antivirus_scan_response import HostingAntivirusScanResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, + antivirus_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/hostings/{hosting_id}/antivirus/scans/{antivirus_id}".format( + hosting_id=quote(str(hosting_id), safe=""), + antivirus_id=quote(str(antivirus_id), safe=""), + ), + } + + return _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()) + + 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 | HostingAntivirusScanResponse]: + 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, + antivirus_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | HostingAntivirusScanResponse]: + """Get antivirus scan + + Get antivirus scan details + + Args: + hosting_id (int): + antivirus_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 | HostingAntivirusScanResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + antivirus_id=antivirus_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + antivirus_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingAntivirusScanResponse | None: + """Get antivirus scan + + Get antivirus scan details + + Args: + hosting_id (int): + antivirus_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 | HostingAntivirusScanResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + antivirus_id=antivirus_id, + client=client, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + antivirus_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | HostingAntivirusScanResponse]: + """Get antivirus scan + + Get antivirus scan details + + Args: + hosting_id (int): + antivirus_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 | HostingAntivirusScanResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + antivirus_id=antivirus_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + hosting_id: int, + antivirus_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingAntivirusScanResponse | None: + """Get antivirus scan + + Get antivirus scan details + + Args: + hosting_id (int): + antivirus_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 | HostingAntivirusScanResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + antivirus_id=antivirus_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/hosting/get_hosting_backup.py b/src/shellrent_sdk/client/api/hosting/get_hosting_backup.py new file mode 100644 index 0000000..83a5349 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/get_hosting_backup.py @@ -0,0 +1,203 @@ +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_backup_response import HostingBackupResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, + hosting_backup_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/hostings/{hosting_id}/backups/{hosting_backup_id}".format( + hosting_id=quote(str(hosting_id), safe=""), + hosting_backup_id=quote(str(hosting_backup_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | HostingBackupResponse | None: + if response.status_code == 200: + response_200 = HostingBackupResponse.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 | HostingBackupResponse]: + 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, + hosting_backup_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | HostingBackupResponse]: + """Get hosting backup + + Get details of a hosting backup + + Args: + hosting_id (int): + hosting_backup_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 | HostingBackupResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + hosting_backup_id=hosting_backup_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + hosting_backup_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingBackupResponse | None: + """Get hosting backup + + Get details of a hosting backup + + Args: + hosting_id (int): + hosting_backup_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 | HostingBackupResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + hosting_backup_id=hosting_backup_id, + client=client, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + hosting_backup_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | HostingBackupResponse]: + """Get hosting backup + + Get details of a hosting backup + + Args: + hosting_id (int): + hosting_backup_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 | HostingBackupResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + hosting_backup_id=hosting_backup_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + hosting_id: int, + hosting_backup_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingBackupResponse | None: + """Get hosting backup + + Get details of a hosting backup + + Args: + hosting_id (int): + hosting_backup_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 | HostingBackupResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + hosting_backup_id=hosting_backup_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..f820331 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/get_hosting_block_list_entry.py @@ -0,0 +1,203 @@ +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_bloc_list_response import HostingEmailBlocListResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, + block_list_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/hostings/{hosting_id}/block-lists/{block_list_id}".format( + hosting_id=quote(str(hosting_id), safe=""), + block_list_id=quote(str(block_list_id), safe=""), + ), + } + + return _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()) + + 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 | HostingEmailBlocListResponse]: + 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, + block_list_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | HostingEmailBlocListResponse]: + """Get hosting block list entry + + Get block list entry details for hosting + + Args: + hosting_id (int): + block_list_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 | HostingEmailBlocListResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + block_list_id=block_list_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + block_list_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingEmailBlocListResponse | None: + """Get hosting block list entry + + Get block list entry details for hosting + + Args: + hosting_id (int): + block_list_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 | HostingEmailBlocListResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + block_list_id=block_list_id, + client=client, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + block_list_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | HostingEmailBlocListResponse]: + """Get hosting block list entry + + Get block list entry details for hosting + + Args: + hosting_id (int): + block_list_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 | HostingEmailBlocListResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + block_list_id=block_list_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + hosting_id: int, + block_list_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingEmailBlocListResponse | None: + """Get hosting block list entry + + Get block list entry details for hosting + + Args: + hosting_id (int): + block_list_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 | HostingEmailBlocListResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + block_list_id=block_list_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..3a5acbc --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/get_hosting_catch_all.py @@ -0,0 +1,189 @@ +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_response import HostingEmailCatchAllResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/hostings/{hosting_id}/email/catch-all".format( + hosting_id=quote(str(hosting_id), safe=""), + ), + } + + 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, +) -> Response[ApiError | HostingEmailCatchAllResponse]: + """Get catch-all alias + + Get catch-all alias status and destinations + + Args: + hosting_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 | HostingEmailCatchAllResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingEmailCatchAllResponse | None: + """Get catch-all alias + + Get catch-all alias status and destinations + + Args: + hosting_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 | HostingEmailCatchAllResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + client=client, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | HostingEmailCatchAllResponse]: + """Get catch-all alias + + Get catch-all alias status and destinations + + Args: + hosting_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 | HostingEmailCatchAllResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingEmailCatchAllResponse | None: + """Get catch-all alias + + Get catch-all alias status and destinations + + Args: + hosting_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 | HostingEmailCatchAllResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/hosting/get_hosting_credentials.py b/src/shellrent_sdk/client/api/hosting/get_hosting_credentials.py new file mode 100644 index 0000000..51b7fa3 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/get_hosting_credentials.py @@ -0,0 +1,189 @@ +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_credential_list_response import HostingCredentialListResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/hostings/{hosting_id}/credentials".format( + hosting_id=quote(str(hosting_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | HostingCredentialListResponse | None: + if response.status_code == 200: + response_200 = HostingCredentialListResponse.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 | HostingCredentialListResponse]: + 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, +) -> Response[ApiError | HostingCredentialListResponse]: + """Get hosting credentials + + Get hosting credentials + + Args: + hosting_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 | HostingCredentialListResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingCredentialListResponse | None: + """Get hosting credentials + + Get hosting credentials + + Args: + hosting_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 | HostingCredentialListResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + client=client, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | HostingCredentialListResponse]: + """Get hosting credentials + + Get hosting credentials + + Args: + hosting_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 | HostingCredentialListResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingCredentialListResponse | None: + """Get hosting credentials + + Get hosting credentials + + Args: + hosting_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 | HostingCredentialListResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/hosting/get_hosting_cronjob.py b/src/shellrent_sdk/client/api/hosting/get_hosting_cronjob.py new file mode 100644 index 0000000..bfa0819 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/get_hosting_cronjob.py @@ -0,0 +1,203 @@ +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_cronjob_response import HostingCronjobResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, + cronjob_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/hostings/{hosting_id}/cronjobs/{cronjob_id}".format( + hosting_id=quote(str(hosting_id), safe=""), + cronjob_id=quote(str(cronjob_id), safe=""), + ), + } + + return _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()) + + 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 | HostingCronjobResponse]: + 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, + cronjob_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | HostingCronjobResponse]: + """Get hosting cronjob + + Get a cronjob details for hosting + + Args: + hosting_id (int): + cronjob_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 | HostingCronjobResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + cronjob_id=cronjob_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + cronjob_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingCronjobResponse | None: + """Get hosting cronjob + + Get a cronjob details for hosting + + Args: + hosting_id (int): + cronjob_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 | HostingCronjobResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + cronjob_id=cronjob_id, + client=client, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + cronjob_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | HostingCronjobResponse]: + """Get hosting cronjob + + Get a cronjob details for hosting + + Args: + hosting_id (int): + cronjob_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 | HostingCronjobResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + cronjob_id=cronjob_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + hosting_id: int, + cronjob_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingCronjobResponse | None: + """Get hosting cronjob + + Get a cronjob details for hosting + + Args: + hosting_id (int): + cronjob_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 | HostingCronjobResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + cronjob_id=cronjob_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 new file mode 100644 index 0000000..4c0ae4a --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/get_hosting_database.py @@ -0,0 +1,203 @@ +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_database_response import HostingDatabaseResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, + database_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/hostings/{hosting_id}/databases/{database_id}".format( + hosting_id=quote(str(hosting_id), safe=""), + database_id=quote(str(database_id), safe=""), + ), + } + + 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()) + + 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 | HostingDatabaseResponse]: + 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, + database_id: str, + *, + client: AuthenticatedClient, +) -> Response[ApiError | HostingDatabaseResponse]: + """Get hosting database + + Get hosting database + + Args: + hosting_id (int): + database_id (str): + + 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 | HostingDatabaseResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + database_id=database_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + database_id: str, + *, + client: AuthenticatedClient, +) -> ApiError | HostingDatabaseResponse | None: + """Get hosting database + + Get hosting database + + Args: + hosting_id (int): + database_id (str): + + 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 | HostingDatabaseResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + database_id=database_id, + client=client, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + database_id: str, + *, + client: AuthenticatedClient, +) -> Response[ApiError | HostingDatabaseResponse]: + """Get hosting database + + Get hosting database + + Args: + hosting_id (int): + database_id (str): + + 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 | HostingDatabaseResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + database_id=database_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + hosting_id: int, + database_id: str, + *, + client: AuthenticatedClient, +) -> ApiError | HostingDatabaseResponse | None: + """Get hosting database + + Get hosting database + + Args: + hosting_id (int): + database_id (str): + + 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 | HostingDatabaseResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + database_id=database_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..6a95780 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/get_hosting_email_alias.py @@ -0,0 +1,203 @@ +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_alias_response import HostingEmailAliasResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, + alias_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/hostings/{hosting_id}/email/aliases/{alias_id}".format( + hosting_id=quote(str(hosting_id), safe=""), + alias_id=quote(str(alias_id), safe=""), + ), + } + + return _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()) + + 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 | HostingEmailAliasResponse]: + 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, + alias_id: str, + *, + client: AuthenticatedClient, +) -> Response[ApiError | HostingEmailAliasResponse]: + """Get hosting email alias + + Get details of a single email alias + + Args: + hosting_id (int): + alias_id (str): + + 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 | HostingEmailAliasResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + alias_id=alias_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + alias_id: str, + *, + client: AuthenticatedClient, +) -> ApiError | HostingEmailAliasResponse | None: + """Get hosting email alias + + Get details of a single email alias + + Args: + hosting_id (int): + alias_id (str): + + 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 | HostingEmailAliasResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + alias_id=alias_id, + client=client, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + alias_id: str, + *, + client: AuthenticatedClient, +) -> Response[ApiError | HostingEmailAliasResponse]: + """Get hosting email alias + + Get details of a single email alias + + Args: + hosting_id (int): + alias_id (str): + + 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 | HostingEmailAliasResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + alias_id=alias_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + hosting_id: int, + alias_id: str, + *, + client: AuthenticatedClient, +) -> ApiError | HostingEmailAliasResponse | None: + """Get hosting email alias + + Get details of a single email alias + + Args: + hosting_id (int): + alias_id (str): + + 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 | HostingEmailAliasResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + alias_id=alias_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..2d7f32a --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/get_hosting_mod_security.py @@ -0,0 +1,189 @@ +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_mod_security_response import HostingModSecurityResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/hostings/{hosting_id}/modsecurity".format( + hosting_id=quote(str(hosting_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | HostingModSecurityResponse | None: + if response.status_code == 200: + response_200 = HostingModSecurityResponse.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 | HostingModSecurityResponse]: + 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, +) -> Response[ApiError | HostingModSecurityResponse]: + """Get ModSecurity status + + Get ModSecurity configuration status + + Args: + hosting_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 | HostingModSecurityResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingModSecurityResponse | None: + """Get ModSecurity status + + Get ModSecurity configuration status + + Args: + hosting_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 | HostingModSecurityResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + client=client, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | HostingModSecurityResponse]: + """Get ModSecurity status + + Get ModSecurity configuration status + + Args: + hosting_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 | HostingModSecurityResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingModSecurityResponse | None: + """Get ModSecurity status + + Get ModSecurity configuration status + + Args: + hosting_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 | HostingModSecurityResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..034b808 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/get_hosting_mod_security_rule.py @@ -0,0 +1,203 @@ +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_mod_security_rule_response import HostingModSecurityRuleResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, + rule_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/hostings/{hosting_id}/modsecurity/rules/{rule_id}".format( + hosting_id=quote(str(hosting_id), safe=""), + rule_id=quote(str(rule_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | HostingModSecurityRuleResponse | None: + if response.status_code == 200: + response_200 = HostingModSecurityRuleResponse.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 | HostingModSecurityRuleResponse]: + 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, + rule_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | HostingModSecurityRuleResponse]: + """Get ModSecurity rule + + Get a ModSecurity rule details + + Args: + hosting_id (int): + rule_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 | HostingModSecurityRuleResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + rule_id=rule_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + rule_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingModSecurityRuleResponse | None: + """Get ModSecurity rule + + Get a ModSecurity rule details + + Args: + hosting_id (int): + rule_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 | HostingModSecurityRuleResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + rule_id=rule_id, + client=client, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + rule_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | HostingModSecurityRuleResponse]: + """Get ModSecurity rule + + Get a ModSecurity rule details + + Args: + hosting_id (int): + rule_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 | HostingModSecurityRuleResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + rule_id=rule_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + hosting_id: int, + rule_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingModSecurityRuleResponse | None: + """Get ModSecurity rule + + Get a ModSecurity rule details + + Args: + hosting_id (int): + rule_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 | HostingModSecurityRuleResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + rule_id=rule_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..dec0750 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/get_hosting_mod_security_scan.py @@ -0,0 +1,203 @@ +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_mod_security_scan_response import HostingModSecurityScanResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, + scan_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/hostings/{hosting_id}/modsecurity/scans/{scan_id}".format( + hosting_id=quote(str(hosting_id), safe=""), + scan_id=quote(str(scan_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | HostingModSecurityScanResponse | None: + if response.status_code == 200: + response_200 = HostingModSecurityScanResponse.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 | HostingModSecurityScanResponse]: + 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, + scan_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | HostingModSecurityScanResponse]: + """Get ModSecurity scan + + Get ModSecurity scan details + + Args: + hosting_id (int): + scan_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 | HostingModSecurityScanResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + scan_id=scan_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + scan_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingModSecurityScanResponse | None: + """Get ModSecurity scan + + Get ModSecurity scan details + + Args: + hosting_id (int): + scan_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 | HostingModSecurityScanResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + scan_id=scan_id, + client=client, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + scan_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | HostingModSecurityScanResponse]: + """Get ModSecurity scan + + Get ModSecurity scan details + + Args: + hosting_id (int): + scan_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 | HostingModSecurityScanResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + scan_id=scan_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + hosting_id: int, + scan_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingModSecurityScanResponse | None: + """Get ModSecurity scan + + Get ModSecurity scan details + + Args: + hosting_id (int): + scan_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 | HostingModSecurityScanResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + scan_id=scan_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..999ad91 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/get_hosting_ssl_certificate.py @@ -0,0 +1,203 @@ +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_ssl_certificate_response import HostingSslCertificateResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, + hosting_ssl_certificate_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/hostings/{hosting_id}/ssl-certificates/{hosting_ssl_certificate_id}".format( + hosting_id=quote(str(hosting_id), safe=""), + hosting_ssl_certificate_id=quote(str(hosting_ssl_certificate_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | HostingSslCertificateResponse | None: + if response.status_code == 200: + response_200 = HostingSslCertificateResponse.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 | HostingSslCertificateResponse]: + 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, + hosting_ssl_certificate_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | HostingSslCertificateResponse]: + """Get hosting SSL certificate + + Get details of a hosting SSL certificate installation + + Args: + hosting_id (int): + hosting_ssl_certificate_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 | HostingSslCertificateResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + hosting_ssl_certificate_id=hosting_ssl_certificate_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + hosting_ssl_certificate_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingSslCertificateResponse | None: + """Get hosting SSL certificate + + Get details of a hosting SSL certificate installation + + Args: + hosting_id (int): + hosting_ssl_certificate_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 | HostingSslCertificateResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + hosting_ssl_certificate_id=hosting_ssl_certificate_id, + client=client, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + hosting_ssl_certificate_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | HostingSslCertificateResponse]: + """Get hosting SSL certificate + + Get details of a hosting SSL certificate installation + + Args: + hosting_id (int): + hosting_ssl_certificate_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 | HostingSslCertificateResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + hosting_ssl_certificate_id=hosting_ssl_certificate_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + hosting_id: int, + hosting_ssl_certificate_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingSslCertificateResponse | None: + """Get hosting SSL certificate + + Get details of a hosting SSL certificate installation + + Args: + hosting_id (int): + hosting_ssl_certificate_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 | HostingSslCertificateResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + hosting_ssl_certificate_id=hosting_ssl_certificate_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..1df258d --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/install_hosting_ssl_certificate.py @@ -0,0 +1,211 @@ +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_ssl_certificate_install_request import HostingSslCertificateInstallRequest +from ...models.task_response import TaskResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + hosting_id: int, + *, + body: HostingSslCertificateInstallRequest | Unset = UNSET, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/hostings/{hosting_id}/ssl-certificates".format( + hosting_id=quote(str(hosting_id), safe=""), + ), + } + + if not isinstance(body, Unset): + _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( + hosting_id: int, + *, + client: AuthenticatedClient, + body: HostingSslCertificateInstallRequest | Unset = UNSET, +) -> Response[ApiError | TaskResponse]: + """Install SSL certificate on hosting + + Install an SSL certificate on hosting or create and install Let's Encrypt + + Args: + hosting_id (int): + body (HostingSslCertificateInstallRequest | Unset): + + 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( + 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: HostingSslCertificateInstallRequest | Unset = UNSET, +) -> ApiError | TaskResponse | None: + """Install SSL certificate on hosting + + Install an SSL certificate on hosting or create and install Let's Encrypt + + Args: + hosting_id (int): + body (HostingSslCertificateInstallRequest | Unset): + + 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( + hosting_id=hosting_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, + body: HostingSslCertificateInstallRequest | Unset = UNSET, +) -> Response[ApiError | TaskResponse]: + """Install SSL certificate on hosting + + Install an SSL certificate on hosting or create and install Let's Encrypt + + Args: + hosting_id (int): + body (HostingSslCertificateInstallRequest | Unset): + + 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( + 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: HostingSslCertificateInstallRequest | Unset = UNSET, +) -> ApiError | TaskResponse | None: + """Install SSL certificate on hosting + + Install an SSL certificate on hosting or create and install Let's Encrypt + + Args: + hosting_id (int): + body (HostingSslCertificateInstallRequest | Unset): + + 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( + hosting_id=hosting_id, + client=client, + body=body, + ) + ).parsed 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 new file mode 100644 index 0000000..7199a78 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/list_hosting_allow_list_entries.py @@ -0,0 +1,227 @@ +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_allow_list_paginated_list_response import ( + HostingEmailAllowListPaginatedListResponse, +) +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + hosting_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/hostings/{hosting_id}/allow-lists".format( + hosting_id=quote(str(hosting_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | HostingEmailAllowListPaginatedListResponse | None: + if response.status_code == 200: + response_200 = HostingEmailAllowListPaginatedListResponse.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 | HostingEmailAllowListPaginatedListResponse]: + 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, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | HostingEmailAllowListPaginatedListResponse]: + """List hosting allow list + + Get list of allow list entries for hosting + + Args: + hosting_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ApiError | HostingEmailAllowListPaginatedListResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + page=page, + per_page=per_page, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | HostingEmailAllowListPaginatedListResponse | None: + """List hosting allow list + + Get list of allow list entries for hosting + + Args: + hosting_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ApiError | HostingEmailAllowListPaginatedListResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + client=client, + page=page, + per_page=per_page, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | HostingEmailAllowListPaginatedListResponse]: + """List hosting allow list + + Get list of allow list entries for hosting + + Args: + hosting_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ApiError | HostingEmailAllowListPaginatedListResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + 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( + hosting_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | HostingEmailAllowListPaginatedListResponse | None: + """List hosting allow list + + Get list of allow list entries for hosting + + Args: + hosting_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ApiError | HostingEmailAllowListPaginatedListResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + client=client, + page=page, + per_page=per_page, + ) + ).parsed 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 new file mode 100644 index 0000000..b9963b3 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/list_hosting_antivirus_removal_scans.py @@ -0,0 +1,227 @@ +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_antivirus_removal_scan_paginated_list_response import ( + HostingAntivirusRemovalScanPaginatedListResponse, +) +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + hosting_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/hostings/{hosting_id}/antivirus/removal-scans".format( + hosting_id=quote(str(hosting_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | HostingAntivirusRemovalScanPaginatedListResponse | None: + if response.status_code == 200: + response_200 = HostingAntivirusRemovalScanPaginatedListResponse.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 | HostingAntivirusRemovalScanPaginatedListResponse]: + 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, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | HostingAntivirusRemovalScanPaginatedListResponse]: + """List antivirus removal scans + + Get a list of antivirus removal scans for hosting + + Args: + hosting_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ApiError | HostingAntivirusRemovalScanPaginatedListResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + page=page, + per_page=per_page, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | HostingAntivirusRemovalScanPaginatedListResponse | None: + """List antivirus removal scans + + Get a list of antivirus removal scans for hosting + + Args: + hosting_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ApiError | HostingAntivirusRemovalScanPaginatedListResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + client=client, + page=page, + per_page=per_page, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | HostingAntivirusRemovalScanPaginatedListResponse]: + """List antivirus removal scans + + Get a list of antivirus removal scans for hosting + + Args: + hosting_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ApiError | HostingAntivirusRemovalScanPaginatedListResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + 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( + hosting_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | HostingAntivirusRemovalScanPaginatedListResponse | None: + """List antivirus removal scans + + Get a list of antivirus removal scans for hosting + + Args: + hosting_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ApiError | HostingAntivirusRemovalScanPaginatedListResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + client=client, + page=page, + per_page=per_page, + ) + ).parsed 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 new file mode 100644 index 0000000..0b9c4b5 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/list_hosting_antivirus_scans.py @@ -0,0 +1,227 @@ +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_antivirus_scan_paginated_list_response import ( + HostingAntivirusScanPaginatedListResponse, +) +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + hosting_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/hostings/{hosting_id}/antivirus/scans".format( + hosting_id=quote(str(hosting_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | HostingAntivirusScanPaginatedListResponse | None: + if response.status_code == 200: + response_200 = HostingAntivirusScanPaginatedListResponse.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 | HostingAntivirusScanPaginatedListResponse]: + 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, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | HostingAntivirusScanPaginatedListResponse]: + """List antivirus scans + + Get a list of antivirus scans for hosting + + Args: + hosting_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ApiError | HostingAntivirusScanPaginatedListResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + page=page, + per_page=per_page, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | HostingAntivirusScanPaginatedListResponse | None: + """List antivirus scans + + Get a list of antivirus scans for hosting + + Args: + hosting_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ApiError | HostingAntivirusScanPaginatedListResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + client=client, + page=page, + per_page=per_page, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | HostingAntivirusScanPaginatedListResponse]: + """List antivirus scans + + Get a list of antivirus scans for hosting + + Args: + hosting_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ApiError | HostingAntivirusScanPaginatedListResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + 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( + hosting_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | HostingAntivirusScanPaginatedListResponse | None: + """List antivirus scans + + Get a list of antivirus scans for hosting + + Args: + hosting_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ApiError | HostingAntivirusScanPaginatedListResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + client=client, + page=page, + per_page=per_page, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/hosting/list_hosting_backups.py b/src/shellrent_sdk/client/api/hosting/list_hosting_backups.py new file mode 100644 index 0000000..a2e87a0 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/list_hosting_backups.py @@ -0,0 +1,189 @@ +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_backup_list_response import HostingBackupListResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/hostings/{hosting_id}/backups".format( + hosting_id=quote(str(hosting_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | HostingBackupListResponse | None: + if response.status_code == 200: + response_200 = HostingBackupListResponse.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 | HostingBackupListResponse]: + 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, +) -> Response[ApiError | HostingBackupListResponse]: + """List hosting backups + + Get list of backups for hosting + + Args: + hosting_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 | HostingBackupListResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingBackupListResponse | None: + """List hosting backups + + Get list of backups for hosting + + Args: + hosting_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 | HostingBackupListResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + client=client, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | HostingBackupListResponse]: + """List hosting backups + + Get list of backups for hosting + + Args: + hosting_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 | HostingBackupListResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingBackupListResponse | None: + """List hosting backups + + Get list of backups for hosting + + Args: + hosting_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 | HostingBackupListResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..2daf0ac --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/list_hosting_block_list_entries.py @@ -0,0 +1,227 @@ +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_bloc_list_paginated_list_response import ( + HostingEmailBlocListPaginatedListResponse, +) +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + hosting_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/hostings/{hosting_id}/block-lists".format( + hosting_id=quote(str(hosting_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | HostingEmailBlocListPaginatedListResponse | None: + if response.status_code == 200: + response_200 = HostingEmailBlocListPaginatedListResponse.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 | HostingEmailBlocListPaginatedListResponse]: + 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, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | HostingEmailBlocListPaginatedListResponse]: + """List hosting block list + + Get list of block list entries for hosting + + Args: + hosting_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ApiError | HostingEmailBlocListPaginatedListResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + page=page, + per_page=per_page, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | HostingEmailBlocListPaginatedListResponse | None: + """List hosting block list + + Get list of block list entries for hosting + + Args: + hosting_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ApiError | HostingEmailBlocListPaginatedListResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + client=client, + page=page, + per_page=per_page, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | HostingEmailBlocListPaginatedListResponse]: + """List hosting block list + + Get list of block list entries for hosting + + Args: + hosting_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ApiError | HostingEmailBlocListPaginatedListResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + 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( + hosting_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | HostingEmailBlocListPaginatedListResponse | None: + """List hosting block list + + Get list of block list entries for hosting + + Args: + hosting_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ApiError | HostingEmailBlocListPaginatedListResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + client=client, + page=page, + per_page=per_page, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/hosting/list_hosting_cronjobs.py b/src/shellrent_sdk/client/api/hosting/list_hosting_cronjobs.py new file mode 100644 index 0000000..c504f0f --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/list_hosting_cronjobs.py @@ -0,0 +1,225 @@ +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_cronjob_paginated_list_response import HostingCronjobPaginatedListResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + hosting_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/hostings/{hosting_id}/cronjobs".format( + hosting_id=quote(str(hosting_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | HostingCronjobPaginatedListResponse | None: + if response.status_code == 200: + response_200 = HostingCronjobPaginatedListResponse.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 | HostingCronjobPaginatedListResponse]: + 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, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | HostingCronjobPaginatedListResponse]: + """List hosting cronjobs + + Get list of cronjobs for a hosting + + Args: + hosting_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ApiError | HostingCronjobPaginatedListResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + page=page, + per_page=per_page, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | HostingCronjobPaginatedListResponse | None: + """List hosting cronjobs + + Get list of cronjobs for a hosting + + Args: + hosting_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ApiError | HostingCronjobPaginatedListResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + client=client, + page=page, + per_page=per_page, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | HostingCronjobPaginatedListResponse]: + """List hosting cronjobs + + Get list of cronjobs for a hosting + + Args: + hosting_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ApiError | HostingCronjobPaginatedListResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + 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( + hosting_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | HostingCronjobPaginatedListResponse | None: + """List hosting cronjobs + + Get list of cronjobs for a hosting + + Args: + hosting_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ApiError | HostingCronjobPaginatedListResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + client=client, + page=page, + per_page=per_page, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/hosting/list_hosting_databases.py b/src/shellrent_sdk/client/api/hosting/list_hosting_databases.py new file mode 100644 index 0000000..c77680e --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/list_hosting_databases.py @@ -0,0 +1,189 @@ +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_database_list_response import HostingDatabaseListResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/hostings/{hosting_id}/databases".format( + hosting_id=quote(str(hosting_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | HostingDatabaseListResponse | None: + if response.status_code == 200: + response_200 = HostingDatabaseListResponse.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 | HostingDatabaseListResponse]: + 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, +) -> Response[ApiError | HostingDatabaseListResponse]: + """Get hosting databases + + Get hosting databases + + Args: + hosting_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 | HostingDatabaseListResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingDatabaseListResponse | None: + """Get hosting databases + + Get hosting databases + + Args: + hosting_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 | HostingDatabaseListResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + client=client, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | HostingDatabaseListResponse]: + """Get hosting databases + + Get hosting databases + + Args: + hosting_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 | HostingDatabaseListResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingDatabaseListResponse | None: + """Get hosting databases + + Get hosting databases + + Args: + hosting_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 | HostingDatabaseListResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..2304d03 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/list_hosting_dns_records.py @@ -0,0 +1,189 @@ +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_dns_record_list_response import HostingDnsRecordListResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/hostings/{hosting_id}/dns-records".format( + hosting_id=quote(str(hosting_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | HostingDnsRecordListResponse | None: + if response.status_code == 200: + response_200 = HostingDnsRecordListResponse.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 | HostingDnsRecordListResponse]: + 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, +) -> Response[ApiError | HostingDnsRecordListResponse]: + """Get hosting DNS records + + Get hosting DNS records + + Args: + hosting_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 | HostingDnsRecordListResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingDnsRecordListResponse | None: + """Get hosting DNS records + + Get hosting DNS records + + Args: + hosting_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 | HostingDnsRecordListResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + client=client, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | HostingDnsRecordListResponse]: + """Get hosting DNS records + + Get hosting DNS records + + Args: + hosting_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 | HostingDnsRecordListResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingDnsRecordListResponse | None: + """Get hosting DNS records + + Get hosting DNS records + + Args: + hosting_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 | HostingDnsRecordListResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..39b9c59 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/list_hosting_email_aliases.py @@ -0,0 +1,189 @@ +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_alias_list_response import HostingEmailAliasListResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/hostings/{hosting_id}/email/aliases".format( + hosting_id=quote(str(hosting_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | HostingEmailAliasListResponse | None: + if response.status_code == 200: + response_200 = HostingEmailAliasListResponse.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 | HostingEmailAliasListResponse]: + 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, +) -> Response[ApiError | HostingEmailAliasListResponse]: + """List hosting email aliases + + Get list of email aliases for a hosting (excluding catch-all) + + Args: + hosting_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 | HostingEmailAliasListResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingEmailAliasListResponse | None: + """List hosting email aliases + + Get list of email aliases for a hosting (excluding catch-all) + + Args: + hosting_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 | HostingEmailAliasListResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + client=client, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | HostingEmailAliasListResponse]: + """List hosting email aliases + + Get list of email aliases for a hosting (excluding catch-all) + + Args: + hosting_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 | HostingEmailAliasListResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingEmailAliasListResponse | None: + """List hosting email aliases + + Get list of email aliases for a hosting (excluding catch-all) + + Args: + hosting_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 | HostingEmailAliasListResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..6b2ea03 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/list_hosting_exposed_backups.py @@ -0,0 +1,189 @@ +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_backup_list_response import HostingBackupListResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/hostings/{hosting_id}/backups/exhibitions".format( + hosting_id=quote(str(hosting_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | HostingBackupListResponse | None: + if response.status_code == 200: + response_200 = HostingBackupListResponse.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 | HostingBackupListResponse]: + 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, +) -> Response[ApiError | HostingBackupListResponse]: + """List exposed backups + + Get list of exposed backups for hosting + + Args: + hosting_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 | HostingBackupListResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingBackupListResponse | None: + """List exposed backups + + Get list of exposed backups for hosting + + Args: + hosting_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 | HostingBackupListResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + client=client, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | HostingBackupListResponse]: + """List exposed backups + + Get list of exposed backups for hosting + + Args: + hosting_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 | HostingBackupListResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingBackupListResponse | None: + """List exposed backups + + Get list of exposed backups for hosting + + Args: + hosting_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 | HostingBackupListResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..66a5a4e --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/list_hosting_mod_security_rules.py @@ -0,0 +1,189 @@ +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_mod_security_rule_list_response import HostingModSecurityRuleListResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/hostings/{hosting_id}/modsecurity/rules".format( + hosting_id=quote(str(hosting_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | HostingModSecurityRuleListResponse | None: + if response.status_code == 200: + response_200 = HostingModSecurityRuleListResponse.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 | HostingModSecurityRuleListResponse]: + 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, +) -> Response[ApiError | HostingModSecurityRuleListResponse]: + """List ModSecurity rules + + Get ModSecurity rules for a hosting + + Args: + hosting_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 | HostingModSecurityRuleListResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingModSecurityRuleListResponse | None: + """List ModSecurity rules + + Get ModSecurity rules for a hosting + + Args: + hosting_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 | HostingModSecurityRuleListResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + client=client, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | HostingModSecurityRuleListResponse]: + """List ModSecurity rules + + Get ModSecurity rules for a hosting + + Args: + hosting_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 | HostingModSecurityRuleListResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingModSecurityRuleListResponse | None: + """List ModSecurity rules + + Get ModSecurity rules for a hosting + + Args: + hosting_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 | HostingModSecurityRuleListResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..b1eb3dc --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/list_hosting_mod_security_scans.py @@ -0,0 +1,227 @@ +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_mod_security_scan_paginated_list_response import ( + HostingModSecurityScanPaginatedListResponse, +) +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + hosting_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/hostings/{hosting_id}/modsecurity/scans".format( + hosting_id=quote(str(hosting_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | HostingModSecurityScanPaginatedListResponse | None: + if response.status_code == 200: + response_200 = HostingModSecurityScanPaginatedListResponse.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 | HostingModSecurityScanPaginatedListResponse]: + 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, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | HostingModSecurityScanPaginatedListResponse]: + """List ModSecurity scans + + Get ModSecurity scan history + + Args: + hosting_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ApiError | HostingModSecurityScanPaginatedListResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + page=page, + per_page=per_page, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | HostingModSecurityScanPaginatedListResponse | None: + """List ModSecurity scans + + Get ModSecurity scan history + + Args: + hosting_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ApiError | HostingModSecurityScanPaginatedListResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + client=client, + page=page, + per_page=per_page, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | HostingModSecurityScanPaginatedListResponse]: + """List ModSecurity scans + + Get ModSecurity scan history + + Args: + hosting_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ApiError | HostingModSecurityScanPaginatedListResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + 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( + hosting_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | HostingModSecurityScanPaginatedListResponse | None: + """List ModSecurity scans + + Get ModSecurity scan history + + Args: + hosting_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ApiError | HostingModSecurityScanPaginatedListResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + client=client, + page=page, + per_page=per_page, + ) + ).parsed 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 new file mode 100644 index 0000000..03fd57b --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/list_hosting_php_versions.py @@ -0,0 +1,189 @@ +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_php_version_list_response import HostingPhpVersionListResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/hostings/{hosting_id}/php-versions".format( + hosting_id=quote(str(hosting_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | HostingPhpVersionListResponse | None: + if response.status_code == 200: + response_200 = HostingPhpVersionListResponse.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 | HostingPhpVersionListResponse]: + 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, +) -> Response[ApiError | HostingPhpVersionListResponse]: + """List PHP versions + + Get available PHP versions for hosting + + Args: + hosting_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 | HostingPhpVersionListResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingPhpVersionListResponse | None: + """List PHP versions + + Get available PHP versions for hosting + + Args: + hosting_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 | HostingPhpVersionListResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + client=client, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | HostingPhpVersionListResponse]: + """List PHP versions + + Get available PHP versions for hosting + + Args: + hosting_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 | HostingPhpVersionListResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingPhpVersionListResponse | None: + """List PHP versions + + Get available PHP versions for hosting + + Args: + hosting_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 | HostingPhpVersionListResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..44bb289 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/list_hosting_ssl_certificates.py @@ -0,0 +1,189 @@ +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_ssl_certificate_list_response import HostingSslCertificateListResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/hostings/{hosting_id}/ssl-certificates".format( + hosting_id=quote(str(hosting_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | HostingSslCertificateListResponse | None: + if response.status_code == 200: + response_200 = HostingSslCertificateListResponse.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 | HostingSslCertificateListResponse]: + 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, +) -> Response[ApiError | HostingSslCertificateListResponse]: + """List hosting SSL certificates + + Get list of SSL certificates installed on hosting + + Args: + hosting_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 | HostingSslCertificateListResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingSslCertificateListResponse | None: + """List hosting SSL certificates + + Get list of SSL certificates installed on hosting + + Args: + hosting_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 | HostingSslCertificateListResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + client=client, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | HostingSslCertificateListResponse]: + """List hosting SSL certificates + + Get list of SSL certificates installed on hosting + + Args: + hosting_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 | HostingSslCertificateListResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingSslCertificateListResponse | None: + """List hosting SSL certificates + + Get list of SSL certificates installed on hosting + + Args: + hosting_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 | HostingSslCertificateListResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/hosting/list_hostings.py b/src/shellrent_sdk/client/api/hosting/list_hostings.py new file mode 100644 index 0000000..2333771 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/list_hostings.py @@ -0,0 +1,209 @@ +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.hosting_paginated_list_response import HostingPaginatedListResponse +from ...types import UNSET, Response, Unset + + +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/hostings", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | HostingPaginatedListResponse | None: + if response.status_code == 200: + response_200 = HostingPaginatedListResponse.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 | HostingPaginatedListResponse]: + 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 = 20, +) -> Response[ApiError | HostingPaginatedListResponse]: + """List all hostings + + Get a list of all hostings + + 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. + + Returns: + Response[ApiError | HostingPaginatedListResponse] + """ + + 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 = 20, +) -> ApiError | HostingPaginatedListResponse | None: + """List all hostings + + Get a list of all hostings + + 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. + + Returns: + ApiError | HostingPaginatedListResponse + """ + + 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 | HostingPaginatedListResponse]: + """List all hostings + + Get a list of all hostings + + 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. + + Returns: + Response[ApiError | HostingPaginatedListResponse] + """ + + 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 = 20, +) -> ApiError | HostingPaginatedListResponse | None: + """List all hostings + + Get a list of all hostings + + 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. + + Returns: + ApiError | HostingPaginatedListResponse + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + per_page=per_page, + ) + ).parsed 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 new file mode 100644 index 0000000..c3aabdc --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/remove_hosting_ssl_certificate.py @@ -0,0 +1,203 @@ +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( + hosting_id: int, + hosting_ssl_certificate_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/api/v3/hostings/{hosting_id}/ssl-certificates/{hosting_ssl_certificate_id}".format( + hosting_id=quote(str(hosting_id), safe=""), + hosting_ssl_certificate_id=quote(str(hosting_ssl_certificate_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( + hosting_id: int, + hosting_ssl_certificate_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | TaskResponse]: + """Remove hosting SSL certificate + + Remove an SSL certificate installation from hosting + + Args: + hosting_id (int): + hosting_ssl_certificate_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( + hosting_id=hosting_id, + hosting_ssl_certificate_id=hosting_ssl_certificate_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + hosting_ssl_certificate_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | TaskResponse | None: + """Remove hosting SSL certificate + + Remove an SSL certificate installation from hosting + + Args: + hosting_id (int): + hosting_ssl_certificate_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( + hosting_id=hosting_id, + hosting_ssl_certificate_id=hosting_ssl_certificate_id, + client=client, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + hosting_ssl_certificate_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | TaskResponse]: + """Remove hosting SSL certificate + + Remove an SSL certificate installation from hosting + + Args: + hosting_id (int): + hosting_ssl_certificate_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( + hosting_id=hosting_id, + hosting_ssl_certificate_id=hosting_ssl_certificate_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + hosting_id: int, + hosting_ssl_certificate_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | TaskResponse | None: + """Remove hosting SSL certificate + + Remove an SSL certificate installation from hosting + + Args: + hosting_id (int): + hosting_ssl_certificate_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( + hosting_id=hosting_id, + hosting_ssl_certificate_id=hosting_ssl_certificate_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/hosting/restore_hosting_backup.py b/src/shellrent_sdk/client/api/hosting/restore_hosting_backup.py new file mode 100644 index 0000000..15cf89e --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/restore_hosting_backup.py @@ -0,0 +1,203 @@ +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( + hosting_id: int, + hosting_backup_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/hostings/{hosting_id}/backups/{hosting_backup_id}/restore".format( + hosting_id=quote(str(hosting_id), safe=""), + hosting_backup_id=quote(str(hosting_backup_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( + hosting_id: int, + hosting_backup_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | TaskResponse]: + """Restore hosting backup + + Start a restore of a hosting backup (web contents) + + Args: + hosting_id (int): + hosting_backup_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( + hosting_id=hosting_id, + hosting_backup_id=hosting_backup_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + hosting_backup_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | TaskResponse | None: + """Restore hosting backup + + Start a restore of a hosting backup (web contents) + + Args: + hosting_id (int): + hosting_backup_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( + hosting_id=hosting_id, + hosting_backup_id=hosting_backup_id, + client=client, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + hosting_backup_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | TaskResponse]: + """Restore hosting backup + + Start a restore of a hosting backup (web contents) + + Args: + hosting_id (int): + hosting_backup_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( + hosting_id=hosting_id, + hosting_backup_id=hosting_backup_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + hosting_id: int, + hosting_backup_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | TaskResponse | None: + """Restore hosting backup + + Start a restore of a hosting backup (web contents) + + Args: + hosting_id (int): + hosting_backup_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( + hosting_id=hosting_id, + hosting_backup_id=hosting_backup_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..a612300 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/start_hosting_antivirus_removal_scan.py @@ -0,0 +1,189 @@ +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_antivirus_removal_scan_response import HostingAntivirusRemovalScanResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/hostings/{hosting_id}/antivirus/removal-scans".format( + hosting_id=quote(str(hosting_id), safe=""), + ), + } + + return _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()) + + 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 | HostingAntivirusRemovalScanResponse]: + 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, +) -> Response[ApiError | HostingAntivirusRemovalScanResponse]: + """Start antivirus removal scan + + Start an antivirus removal scan for hosting + + Args: + hosting_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 | HostingAntivirusRemovalScanResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingAntivirusRemovalScanResponse | None: + """Start antivirus removal scan + + Start an antivirus removal scan for hosting + + Args: + hosting_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 | HostingAntivirusRemovalScanResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + client=client, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | HostingAntivirusRemovalScanResponse]: + """Start antivirus removal scan + + Start an antivirus removal scan for hosting + + Args: + hosting_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 | HostingAntivirusRemovalScanResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingAntivirusRemovalScanResponse | None: + """Start antivirus removal scan + + Start an antivirus removal scan for hosting + + Args: + hosting_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 | HostingAntivirusRemovalScanResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..00865de --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/start_hosting_antivirus_scan.py @@ -0,0 +1,189 @@ +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_antivirus_scan_response import HostingAntivirusScanResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/hostings/{hosting_id}/antivirus/scans".format( + hosting_id=quote(str(hosting_id), safe=""), + ), + } + + return _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()) + + 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 | HostingAntivirusScanResponse]: + 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, +) -> Response[ApiError | HostingAntivirusScanResponse]: + """Start antivirus scan + + Start a manual antivirus scan for hosting + + Args: + hosting_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 | HostingAntivirusScanResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingAntivirusScanResponse | None: + """Start antivirus scan + + Start a manual antivirus scan for hosting + + Args: + hosting_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 | HostingAntivirusScanResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + client=client, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | HostingAntivirusScanResponse]: + """Start antivirus scan + + Start a manual antivirus scan for hosting + + Args: + hosting_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 | HostingAntivirusScanResponse] + """ + + kwargs = _get_kwargs( + hosting_id=hosting_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | HostingAntivirusScanResponse | None: + """Start antivirus scan + + Start a manual antivirus scan for hosting + + Args: + hosting_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 | HostingAntivirusScanResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..e4f16c9 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/start_hosting_first_backup.py @@ -0,0 +1,189 @@ +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( + hosting_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/hostings/{hosting_id}/backups/first-save".format( + hosting_id=quote(str(hosting_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( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | TaskResponse]: + """Start hosting backup + + Start a backup for hosting + + Args: + hosting_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( + hosting_id=hosting_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | TaskResponse | None: + """Start hosting backup + + Start a backup for hosting + + Args: + hosting_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( + hosting_id=hosting_id, + client=client, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | TaskResponse]: + """Start hosting backup + + Start a backup for hosting + + Args: + hosting_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( + hosting_id=hosting_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + hosting_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | TaskResponse | None: + """Start hosting backup + + Start a backup for hosting + + Args: + hosting_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( + hosting_id=hosting_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..07781b6 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/update_hosting_catch_all.py @@ -0,0 +1,210 @@ +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": "put", + "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]: + """Update catch-all alias + + Update a catch-all alias 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: + """Update catch-all alias + + Update a catch-all alias 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]: + """Update catch-all alias + + Update a catch-all alias 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: + """Update catch-all alias + + Update a catch-all alias 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/update_hosting_file_protection.py b/src/shellrent_sdk/client/api/hosting/update_hosting_file_protection.py new file mode 100644 index 0000000..2707819 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/update_hosting_file_protection.py @@ -0,0 +1,210 @@ +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_file_protection_update_request import HostingFileProtectionUpdateRequest +from ...models.hosting_response import HostingResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, + *, + body: HostingFileProtectionUpdateRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/api/v3/hostings/{hosting_id}/file-protection".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 | HostingResponse | None: + if response.status_code == 200: + response_200 = HostingResponse.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 | HostingResponse]: + 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: HostingFileProtectionUpdateRequest, +) -> Response[ApiError | HostingResponse]: + """Update file protection status + + Enable or disable file protection + + Args: + hosting_id (int): + body (HostingFileProtectionUpdateRequest): + + 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 | HostingResponse] + """ + + 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: HostingFileProtectionUpdateRequest, +) -> ApiError | HostingResponse | None: + """Update file protection status + + Enable or disable file protection + + Args: + hosting_id (int): + body (HostingFileProtectionUpdateRequest): + + 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 | HostingResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, + body: HostingFileProtectionUpdateRequest, +) -> Response[ApiError | HostingResponse]: + """Update file protection status + + Enable or disable file protection + + Args: + hosting_id (int): + body (HostingFileProtectionUpdateRequest): + + 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 | HostingResponse] + """ + + 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: HostingFileProtectionUpdateRequest, +) -> ApiError | HostingResponse | None: + """Update file protection status + + Enable or disable file protection + + Args: + hosting_id (int): + body (HostingFileProtectionUpdateRequest): + + 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 | HostingResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + client=client, + body=body, + ) + ).parsed 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 new file mode 100644 index 0000000..7fcdd63 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/update_hosting_http_version.py @@ -0,0 +1,210 @@ +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_http_version_update_request import HostingHttpVersionUpdateRequest +from ...models.hosting_response import HostingResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, + *, + body: HostingHttpVersionUpdateRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/api/v3/hostings/{hosting_id}/http-version".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 | HostingResponse | None: + if response.status_code == 200: + response_200 = HostingResponse.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 | HostingResponse]: + 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: HostingHttpVersionUpdateRequest, +) -> Response[ApiError | HostingResponse]: + """Update HTTP version + + Change HTTP version for hosting + + Args: + hosting_id (int): + body (HostingHttpVersionUpdateRequest): + + 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 | HostingResponse] + """ + + 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: HostingHttpVersionUpdateRequest, +) -> ApiError | HostingResponse | None: + """Update HTTP version + + Change HTTP version for hosting + + Args: + hosting_id (int): + body (HostingHttpVersionUpdateRequest): + + 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 | HostingResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, + body: HostingHttpVersionUpdateRequest, +) -> Response[ApiError | HostingResponse]: + """Update HTTP version + + Change HTTP version for hosting + + Args: + hosting_id (int): + body (HostingHttpVersionUpdateRequest): + + 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 | HostingResponse] + """ + + 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: HostingHttpVersionUpdateRequest, +) -> ApiError | HostingResponse | None: + """Update HTTP version + + Change HTTP version for hosting + + Args: + hosting_id (int): + body (HostingHttpVersionUpdateRequest): + + 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 | HostingResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + client=client, + body=body, + ) + ).parsed 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 new file mode 100644 index 0000000..352d459 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/update_hosting_mod_security.py @@ -0,0 +1,210 @@ +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_mod_security_response import HostingModSecurityResponse +from ...models.hosting_mod_security_update_request import HostingModSecurityUpdateRequest +from ...types import Response + + +def _get_kwargs( + hosting_id: int, + *, + body: HostingModSecurityUpdateRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/api/v3/hostings/{hosting_id}/modsecurity".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 | HostingModSecurityResponse | None: + if response.status_code == 200: + response_200 = HostingModSecurityResponse.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 | HostingModSecurityResponse]: + 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: HostingModSecurityUpdateRequest, +) -> Response[ApiError | HostingModSecurityResponse]: + """Update ModSecurity status + + Enable or disable ModSecurity + + Args: + hosting_id (int): + body (HostingModSecurityUpdateRequest): + + 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 | HostingModSecurityResponse] + """ + + 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: HostingModSecurityUpdateRequest, +) -> ApiError | HostingModSecurityResponse | None: + """Update ModSecurity status + + Enable or disable ModSecurity + + Args: + hosting_id (int): + body (HostingModSecurityUpdateRequest): + + 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 | HostingModSecurityResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, + body: HostingModSecurityUpdateRequest, +) -> Response[ApiError | HostingModSecurityResponse]: + """Update ModSecurity status + + Enable or disable ModSecurity + + Args: + hosting_id (int): + body (HostingModSecurityUpdateRequest): + + 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 | HostingModSecurityResponse] + """ + + 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: HostingModSecurityUpdateRequest, +) -> ApiError | HostingModSecurityResponse | None: + """Update ModSecurity status + + Enable or disable ModSecurity + + Args: + hosting_id (int): + body (HostingModSecurityUpdateRequest): + + 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 | HostingModSecurityResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + client=client, + body=body, + ) + ).parsed 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 new file mode 100644 index 0000000..843a6b9 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/update_hosting_php_settings.py @@ -0,0 +1,210 @@ +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_php_settings_update_request import HostingPhpSettingsUpdateRequest +from ...models.hosting_response import HostingResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, + *, + body: HostingPhpSettingsUpdateRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/api/v3/hostings/{hosting_id}/php-settings".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 | HostingResponse | None: + if response.status_code == 200: + response_200 = HostingResponse.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 | HostingResponse]: + 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: HostingPhpSettingsUpdateRequest, +) -> Response[ApiError | HostingResponse]: + """Update PHP settings + + Update a PHP setting for hosting + + Args: + hosting_id (int): + body (HostingPhpSettingsUpdateRequest): + + 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 | HostingResponse] + """ + + 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: HostingPhpSettingsUpdateRequest, +) -> ApiError | HostingResponse | None: + """Update PHP settings + + Update a PHP setting for hosting + + Args: + hosting_id (int): + body (HostingPhpSettingsUpdateRequest): + + 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 | HostingResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, + body: HostingPhpSettingsUpdateRequest, +) -> Response[ApiError | HostingResponse]: + """Update PHP settings + + Update a PHP setting for hosting + + Args: + hosting_id (int): + body (HostingPhpSettingsUpdateRequest): + + 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 | HostingResponse] + """ + + 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: HostingPhpSettingsUpdateRequest, +) -> ApiError | HostingResponse | None: + """Update PHP settings + + Update a PHP setting for hosting + + Args: + hosting_id (int): + body (HostingPhpSettingsUpdateRequest): + + 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 | HostingResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + client=client, + body=body, + ) + ).parsed 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 new file mode 100644 index 0000000..258ea37 --- /dev/null +++ b/src/shellrent_sdk/client/api/hosting/update_hosting_php_version.py @@ -0,0 +1,210 @@ +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_php_version_update_request import HostingPhpVersionUpdateRequest +from ...models.hosting_response import HostingResponse +from ...types import Response + + +def _get_kwargs( + hosting_id: int, + *, + body: HostingPhpVersionUpdateRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/api/v3/hostings/{hosting_id}/php-version".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 | HostingResponse | None: + if response.status_code == 200: + response_200 = HostingResponse.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 | HostingResponse]: + 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: HostingPhpVersionUpdateRequest, +) -> Response[ApiError | HostingResponse]: + """Update PHP version + + Change PHP version for hosting + + Args: + hosting_id (int): + body (HostingPhpVersionUpdateRequest): + + 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 | HostingResponse] + """ + + 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: HostingPhpVersionUpdateRequest, +) -> ApiError | HostingResponse | None: + """Update PHP version + + Change PHP version for hosting + + Args: + hosting_id (int): + body (HostingPhpVersionUpdateRequest): + + 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 | HostingResponse + """ + + return sync_detailed( + hosting_id=hosting_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + hosting_id: int, + *, + client: AuthenticatedClient, + body: HostingPhpVersionUpdateRequest, +) -> Response[ApiError | HostingResponse]: + """Update PHP version + + Change PHP version for hosting + + Args: + hosting_id (int): + body (HostingPhpVersionUpdateRequest): + + 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 | HostingResponse] + """ + + 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: HostingPhpVersionUpdateRequest, +) -> ApiError | HostingResponse | None: + """Update PHP version + + Change PHP version for hosting + + Args: + hosting_id (int): + body (HostingPhpVersionUpdateRequest): + + 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 | HostingResponse + """ + + return ( + await asyncio_detailed( + hosting_id=hosting_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/license_/__init__.py b/src/shellrent_sdk/client/api/license_/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/src/shellrent_sdk/client/api/license_/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" 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 new file mode 100644 index 0000000..adfc077 --- /dev/null +++ b/src/shellrent_sdk/client/api/license_/downgrade_microsoft_365_subscription_quantity.py @@ -0,0 +1,212 @@ +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.microsoft_365_subscription_quantity_request import ( + Microsoft365SubscriptionQuantityRequest, +) +from ...models.task_response import TaskResponse +from ...types import Response + + +def _get_kwargs( + microsoft365_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=""), + ), + } + + _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( + microsoft365_id: int, + *, + client: AuthenticatedClient, + body: Microsoft365SubscriptionQuantityRequest, +) -> Response[ApiError | TaskResponse]: + """Downgrade Microsoft 365 subscription quantity + + Decrease the Microsoft 365 seats quantity. Returns the background Task created for seat removal. + + Args: + microsoft365_id (int): + body (Microsoft365SubscriptionQuantityRequest): + + 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( + microsoft365_id=microsoft365_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + microsoft365_id: int, + *, + client: AuthenticatedClient, + body: Microsoft365SubscriptionQuantityRequest, +) -> ApiError | TaskResponse | None: + """Downgrade Microsoft 365 subscription quantity + + Decrease the Microsoft 365 seats quantity. Returns the background Task created for seat removal. + + Args: + microsoft365_id (int): + body (Microsoft365SubscriptionQuantityRequest): + + 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( + microsoft365_id=microsoft365_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + microsoft365_id: int, + *, + client: AuthenticatedClient, + body: Microsoft365SubscriptionQuantityRequest, +) -> Response[ApiError | TaskResponse]: + """Downgrade Microsoft 365 subscription quantity + + Decrease the Microsoft 365 seats quantity. Returns the background Task created for seat removal. + + Args: + microsoft365_id (int): + body (Microsoft365SubscriptionQuantityRequest): + + 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( + microsoft365_id=microsoft365_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + microsoft365_id: int, + *, + client: AuthenticatedClient, + body: Microsoft365SubscriptionQuantityRequest, +) -> ApiError | TaskResponse | None: + """Downgrade Microsoft 365 subscription quantity + + Decrease the Microsoft 365 seats quantity. Returns the background Task created for seat removal. + + Args: + microsoft365_id (int): + body (Microsoft365SubscriptionQuantityRequest): + + 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( + microsoft365_id=microsoft365_id, + client=client, + body=body, + ) + ).parsed 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 new file mode 100644 index 0000000..908edf8 --- /dev/null +++ b/src/shellrent_sdk/client/api/license_/downgrade_secure_mail_quantity.py @@ -0,0 +1,214 @@ +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 new file mode 100644 index 0000000..631510a --- /dev/null +++ b/src/shellrent_sdk/client/api/license_/get_cpanel_license.py @@ -0,0 +1,189 @@ +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.cpanel_license_response import CpanelLicenseResponse +from ...types import Response + + +def _get_kwargs( + license_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/licenses/cpanel/{license_id}".format( + license_id=quote(str(license_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | CpanelLicenseResponse | None: + if response.status_code == 200: + response_200 = CpanelLicenseResponse.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 | CpanelLicenseResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + license_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | CpanelLicenseResponse]: + """Get cPanel license + + Get details of a cPanel license + + Args: + license_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 | CpanelLicenseResponse] + """ + + kwargs = _get_kwargs( + license_id=license_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + license_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | CpanelLicenseResponse | None: + """Get cPanel license + + Get details of a cPanel license + + Args: + license_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 | CpanelLicenseResponse + """ + + return sync_detailed( + license_id=license_id, + client=client, + ).parsed + + +async def asyncio_detailed( + license_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | CpanelLicenseResponse]: + """Get cPanel license + + Get details of a cPanel license + + Args: + license_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 | CpanelLicenseResponse] + """ + + kwargs = _get_kwargs( + license_id=license_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + license_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | CpanelLicenseResponse | None: + """Get cPanel license + + Get details of a cPanel license + + Args: + license_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 | CpanelLicenseResponse + """ + + return ( + await asyncio_detailed( + license_id=license_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..e5e07d4 --- /dev/null +++ b/src/shellrent_sdk/client/api/license_/get_microsoft_365_partner_link.py @@ -0,0 +1,189 @@ +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.microsoft_365_partner_link_response import Microsoft365PartnerLinkResponse +from ...types import Response + + +def _get_kwargs( + service_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/microsoft365-subscriptions/partner-link/{service_id}".format( + service_id=quote(str(service_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | Microsoft365PartnerLinkResponse | None: + if response.status_code == 200: + response_200 = Microsoft365PartnerLinkResponse.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 | Microsoft365PartnerLinkResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + service_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | Microsoft365PartnerLinkResponse]: + """Partner link + + Get the partner authorization link for Microsoft 365 subscriptions + + Args: + service_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 | Microsoft365PartnerLinkResponse] + """ + + kwargs = _get_kwargs( + service_id=service_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + service_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | Microsoft365PartnerLinkResponse | None: + """Partner link + + Get the partner authorization link for Microsoft 365 subscriptions + + Args: + service_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 | Microsoft365PartnerLinkResponse + """ + + return sync_detailed( + service_id=service_id, + client=client, + ).parsed + + +async def asyncio_detailed( + service_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | Microsoft365PartnerLinkResponse]: + """Partner link + + Get the partner authorization link for Microsoft 365 subscriptions + + Args: + service_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 | Microsoft365PartnerLinkResponse] + """ + + kwargs = _get_kwargs( + service_id=service_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + service_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | Microsoft365PartnerLinkResponse | None: + """Partner link + + Get the partner authorization link for Microsoft 365 subscriptions + + Args: + service_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 | Microsoft365PartnerLinkResponse + """ + + return ( + await asyncio_detailed( + service_id=service_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..39a9dfe --- /dev/null +++ b/src/shellrent_sdk/client/api/license_/get_microsoft_365_subscription.py @@ -0,0 +1,189 @@ +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.microsoft_365_response import Microsoft365Response +from ...types import Response + + +def _get_kwargs( + microsoft365_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=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | Microsoft365Response | None: + if response.status_code == 200: + response_200 = Microsoft365Response.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 | Microsoft365Response]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + microsoft365_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | Microsoft365Response]: + """Get Microsoft 365 subscription + + Get details of a Microsoft 365 subscription + + Args: + microsoft365_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 | Microsoft365Response] + """ + + kwargs = _get_kwargs( + microsoft365_id=microsoft365_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + microsoft365_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | Microsoft365Response | None: + """Get Microsoft 365 subscription + + Get details of a Microsoft 365 subscription + + Args: + microsoft365_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 | Microsoft365Response + """ + + return sync_detailed( + microsoft365_id=microsoft365_id, + client=client, + ).parsed + + +async def asyncio_detailed( + microsoft365_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | Microsoft365Response]: + """Get Microsoft 365 subscription + + Get details of a Microsoft 365 subscription + + Args: + microsoft365_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 | Microsoft365Response] + """ + + kwargs = _get_kwargs( + microsoft365_id=microsoft365_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + microsoft365_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | Microsoft365Response | None: + """Get Microsoft 365 subscription + + Get details of a Microsoft 365 subscription + + Args: + microsoft365_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 | Microsoft365Response + """ + + return ( + await asyncio_detailed( + microsoft365_id=microsoft365_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 new file mode 100644 index 0000000..6fe2566 --- /dev/null +++ b/src/shellrent_sdk/client/api/license_/get_microsoft_365_tenant.py @@ -0,0 +1,189 @@ +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.microsoft_365_tenant_response import Microsoft365TenantResponse +from ...types import Response + + +def _get_kwargs( + microsoft_365_tenant_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/microsoft365-tenants/{microsoft_365_tenant_id}".format( + microsoft_365_tenant_id=quote(str(microsoft_365_tenant_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | Microsoft365TenantResponse | None: + if response.status_code == 200: + response_200 = Microsoft365TenantResponse.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 | Microsoft365TenantResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + microsoft_365_tenant_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | Microsoft365TenantResponse]: + """Get Microsoft 365 tenant + + Get details of a Microsoft 365 tenant + + Args: + microsoft_365_tenant_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 | Microsoft365TenantResponse] + """ + + kwargs = _get_kwargs( + microsoft_365_tenant_id=microsoft_365_tenant_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + microsoft_365_tenant_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | Microsoft365TenantResponse | None: + """Get Microsoft 365 tenant + + Get details of a Microsoft 365 tenant + + Args: + microsoft_365_tenant_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 | Microsoft365TenantResponse + """ + + return sync_detailed( + microsoft_365_tenant_id=microsoft_365_tenant_id, + client=client, + ).parsed + + +async def asyncio_detailed( + microsoft_365_tenant_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | Microsoft365TenantResponse]: + """Get Microsoft 365 tenant + + Get details of a Microsoft 365 tenant + + Args: + microsoft_365_tenant_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 | Microsoft365TenantResponse] + """ + + kwargs = _get_kwargs( + microsoft_365_tenant_id=microsoft_365_tenant_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + microsoft_365_tenant_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | Microsoft365TenantResponse | None: + """Get Microsoft 365 tenant + + Get details of a Microsoft 365 tenant + + Args: + microsoft_365_tenant_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 | Microsoft365TenantResponse + """ + + return ( + await asyncio_detailed( + microsoft_365_tenant_id=microsoft_365_tenant_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/license_/get_plesk_license.py b/src/shellrent_sdk/client/api/license_/get_plesk_license.py new file mode 100644 index 0000000..6dcff53 --- /dev/null +++ b/src/shellrent_sdk/client/api/license_/get_plesk_license.py @@ -0,0 +1,189 @@ +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.plesk_license_response import PleskLicenseResponse +from ...types import Response + + +def _get_kwargs( + license_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/licenses/plesk/{license_id}".format( + license_id=quote(str(license_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | PleskLicenseResponse | None: + if response.status_code == 200: + response_200 = PleskLicenseResponse.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 | PleskLicenseResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + license_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | PleskLicenseResponse]: + """Get Plesk license + + Get details of a Plesk license + + Args: + license_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 | PleskLicenseResponse] + """ + + kwargs = _get_kwargs( + license_id=license_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + license_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | PleskLicenseResponse | None: + """Get Plesk license + + Get details of a Plesk license + + Args: + license_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 | PleskLicenseResponse + """ + + return sync_detailed( + license_id=license_id, + client=client, + ).parsed + + +async def asyncio_detailed( + license_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | PleskLicenseResponse]: + """Get Plesk license + + Get details of a Plesk license + + Args: + license_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 | PleskLicenseResponse] + """ + + kwargs = _get_kwargs( + license_id=license_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + license_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | PleskLicenseResponse | None: + """Get Plesk license + + Get details of a Plesk license + + Args: + license_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 | PleskLicenseResponse + """ + + return ( + await asyncio_detailed( + license_id=license_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/license_/get_secure_mail.py b/src/shellrent_sdk/client/api/license_/get_secure_mail.py new file mode 100644 index 0000000..9d84d3d --- /dev/null +++ b/src/shellrent_sdk/client/api/license_/get_secure_mail.py @@ -0,0 +1,189 @@ +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_response import SecuremailResponse +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}".format( + securemail_id=quote(str(securemail_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | SecuremailResponse | None: + if response.status_code == 200: + response_200 = SecuremailResponse.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 | SecuremailResponse]: + 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 | SecuremailResponse]: + """Get SecureMail subscription + + Get details of 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 | SecuremailResponse] + """ + + 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 | SecuremailResponse | None: + """Get SecureMail subscription + + Get details of 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 | SecuremailResponse + """ + + return sync_detailed( + securemail_id=securemail_id, + client=client, + ).parsed + + +async def asyncio_detailed( + securemail_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | SecuremailResponse]: + """Get SecureMail subscription + + Get details of 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 | SecuremailResponse] + """ + + 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 | SecuremailResponse | None: + """Get SecureMail subscription + + Get details of 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 | SecuremailResponse + """ + + return ( + await asyncio_detailed( + securemail_id=securemail_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..29aa81c --- /dev/null +++ b/src/shellrent_sdk/client/api/license_/get_secure_mail_statistics.py @@ -0,0 +1,189 @@ +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 new file mode 100644 index 0000000..ec5fff1 --- /dev/null +++ b/src/shellrent_sdk/client/api/license_/list_cpanel_licenses.py @@ -0,0 +1,209 @@ +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.cpanel_license_paginated_list_response import CpanelLicensePaginatedListResponse +from ...types import UNSET, Response, Unset + + +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/licenses/cpanel", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | CpanelLicensePaginatedListResponse | None: + if response.status_code == 200: + response_200 = CpanelLicensePaginatedListResponse.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 | CpanelLicensePaginatedListResponse]: + 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 = 20, +) -> Response[ApiError | CpanelLicensePaginatedListResponse]: + """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: 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] + """ + + 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 = 20, +) -> ApiError | CpanelLicensePaginatedListResponse | 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: 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 + """ + + 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 | CpanelLicensePaginatedListResponse]: + """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: 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] + """ + + 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 = 20, +) -> ApiError | CpanelLicensePaginatedListResponse | 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: 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 + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + per_page=per_page, + ) + ).parsed 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 new file mode 100644 index 0000000..2b18b3a --- /dev/null +++ b/src/shellrent_sdk/client/api/license_/list_microsoft_365_subscriptions.py @@ -0,0 +1,209 @@ +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.microsoft_365_paginated_list_response import Microsoft365PaginatedListResponse +from ...types import UNSET, Response, Unset + + +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/microsoft365-subscriptions", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | Microsoft365PaginatedListResponse | None: + if response.status_code == 200: + response_200 = Microsoft365PaginatedListResponse.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 | Microsoft365PaginatedListResponse]: + 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 = 20, +) -> Response[ApiError | Microsoft365PaginatedListResponse]: + """List Microsoft 365 subscriptions + + Get a paginated list of Microsoft 365 subscriptions for the authenticated account + + 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. + + Returns: + Response[ApiError | Microsoft365PaginatedListResponse] + """ + + 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 = 20, +) -> ApiError | Microsoft365PaginatedListResponse | None: + """List Microsoft 365 subscriptions + + Get a paginated list of Microsoft 365 subscriptions for the authenticated account + + 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. + + Returns: + ApiError | Microsoft365PaginatedListResponse + """ + + 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 | Microsoft365PaginatedListResponse]: + """List Microsoft 365 subscriptions + + Get a paginated list of Microsoft 365 subscriptions for the authenticated account + + 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. + + Returns: + Response[ApiError | Microsoft365PaginatedListResponse] + """ + + 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 = 20, +) -> ApiError | Microsoft365PaginatedListResponse | None: + """List Microsoft 365 subscriptions + + Get a paginated list of Microsoft 365 subscriptions for the authenticated account + + 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. + + Returns: + ApiError | Microsoft365PaginatedListResponse + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + per_page=per_page, + ) + ).parsed 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 new file mode 100644 index 0000000..31f170a --- /dev/null +++ b/src/shellrent_sdk/client/api/license_/list_microsoft_365_tenants.py @@ -0,0 +1,211 @@ +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.microsoft_365_tenant_paginated_list_response import ( + Microsoft365TenantPaginatedListResponse, +) +from ...types import UNSET, Response, Unset + + +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/microsoft365-tenants", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | Microsoft365TenantPaginatedListResponse | None: + if response.status_code == 200: + response_200 = Microsoft365TenantPaginatedListResponse.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 | Microsoft365TenantPaginatedListResponse]: + 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 = 20, +) -> Response[ApiError | Microsoft365TenantPaginatedListResponse]: + """List Microsoft 365 tenants + + Get a paginated list of Microsoft 365 tenants for the authenticated account + + 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. + + Returns: + Response[ApiError | Microsoft365TenantPaginatedListResponse] + """ + + 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 = 20, +) -> ApiError | Microsoft365TenantPaginatedListResponse | None: + """List Microsoft 365 tenants + + Get a paginated list of Microsoft 365 tenants for the authenticated account + + 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. + + Returns: + ApiError | Microsoft365TenantPaginatedListResponse + """ + + 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 | Microsoft365TenantPaginatedListResponse]: + """List Microsoft 365 tenants + + Get a paginated list of Microsoft 365 tenants for the authenticated account + + 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. + + Returns: + Response[ApiError | Microsoft365TenantPaginatedListResponse] + """ + + 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 = 20, +) -> ApiError | Microsoft365TenantPaginatedListResponse | None: + """List Microsoft 365 tenants + + Get a paginated list of Microsoft 365 tenants for the authenticated account + + 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. + + Returns: + ApiError | Microsoft365TenantPaginatedListResponse + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + per_page=per_page, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/license_/list_plesk_licenses.py b/src/shellrent_sdk/client/api/license_/list_plesk_licenses.py new file mode 100644 index 0000000..d719572 --- /dev/null +++ b/src/shellrent_sdk/client/api/license_/list_plesk_licenses.py @@ -0,0 +1,209 @@ +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.plesk_license_paginated_list_response import PleskLicensePaginatedListResponse +from ...types import UNSET, Response, Unset + + +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/licenses/plesk", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | PleskLicensePaginatedListResponse | None: + if response.status_code == 200: + response_200 = PleskLicensePaginatedListResponse.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 | PleskLicensePaginatedListResponse]: + 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 = 20, +) -> Response[ApiError | PleskLicensePaginatedListResponse]: + """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: 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] + """ + + 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 = 20, +) -> ApiError | PleskLicensePaginatedListResponse | 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: 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 + """ + + 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 | PleskLicensePaginatedListResponse]: + """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: 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] + """ + + 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 = 20, +) -> ApiError | PleskLicensePaginatedListResponse | 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: 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 + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + per_page=per_page, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/license_/list_secure_mail_mailboxes.py b/src/shellrent_sdk/client/api/license_/list_secure_mail_mailboxes.py new file mode 100644 index 0000000..1f3d30a --- /dev/null +++ b/src/shellrent_sdk/client/api/license_/list_secure_mail_mailboxes.py @@ -0,0 +1,227 @@ +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_mailbox_paginated_list_response import ( + SecuremailMailboxPaginatedListResponse, +) +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + securemail_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/securemails/{securemail_id}/mailboxes".format( + securemail_id=quote(str(securemail_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | SecuremailMailboxPaginatedListResponse | None: + if response.status_code == 200: + response_200 = SecuremailMailboxPaginatedListResponse.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 | SecuremailMailboxPaginatedListResponse]: + 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, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | SecuremailMailboxPaginatedListResponse]: + """List SecureMail mailboxes + + Get a paginated list of primary mailboxes for a SecureMail by LibraESVA subscription + + Args: + securemail_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ApiError | SecuremailMailboxPaginatedListResponse] + """ + + kwargs = _get_kwargs( + securemail_id=securemail_id, + page=page, + per_page=per_page, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + securemail_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | SecuremailMailboxPaginatedListResponse | None: + """List SecureMail mailboxes + + Get a paginated list of primary mailboxes for a SecureMail by LibraESVA subscription + + Args: + securemail_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ApiError | SecuremailMailboxPaginatedListResponse + """ + + return sync_detailed( + securemail_id=securemail_id, + client=client, + page=page, + per_page=per_page, + ).parsed + + +async def asyncio_detailed( + securemail_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | SecuremailMailboxPaginatedListResponse]: + """List SecureMail mailboxes + + Get a paginated list of primary mailboxes for a SecureMail by LibraESVA subscription + + Args: + securemail_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ApiError | SecuremailMailboxPaginatedListResponse] + """ + + kwargs = _get_kwargs( + securemail_id=securemail_id, + 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( + securemail_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | SecuremailMailboxPaginatedListResponse | None: + """List SecureMail mailboxes + + Get a paginated list of primary mailboxes for a SecureMail by LibraESVA subscription + + Args: + securemail_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ApiError | SecuremailMailboxPaginatedListResponse + """ + + return ( + await asyncio_detailed( + securemail_id=securemail_id, + client=client, + page=page, + per_page=per_page, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/license_/list_secure_mails.py b/src/shellrent_sdk/client/api/license_/list_secure_mails.py new file mode 100644 index 0000000..7fd75ae --- /dev/null +++ b/src/shellrent_sdk/client/api/license_/list_secure_mails.py @@ -0,0 +1,209 @@ +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 = 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/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 = 20, +) -> 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: 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 | 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 = 20, +) -> 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: 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 | 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 = 20, +) -> 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: 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 | 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 = 20, +) -> 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: 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 | 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 new file mode 100644 index 0000000..d4c7d2b --- /dev/null +++ b/src/shellrent_sdk/client/api/license_/upgrade_microsoft_365_subscription_quantity.py @@ -0,0 +1,212 @@ +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.microsoft_365_subscription_quantity_request import ( + Microsoft365SubscriptionQuantityRequest, +) +from ...models.order_response import OrderResponse +from ...types import Response + + +def _get_kwargs( + microsoft365_id: int, + *, + body: Microsoft365SubscriptionQuantityRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/microsoft365-subscriptions/{microsoft365_id}/quantity-upgrade".format( + microsoft365_id=quote(str(microsoft365_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( + microsoft365_id: int, + *, + client: AuthenticatedClient, + body: Microsoft365SubscriptionQuantityRequest, +) -> Response[ApiError | OrderResponse]: + """Upgrade Microsoft 365 subscription quantity + + Increase the Microsoft 365 seats quantity. Returns the generated Order to pay the additional seats. + + Args: + microsoft365_id (int): + body (Microsoft365SubscriptionQuantityRequest): + + 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( + microsoft365_id=microsoft365_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + microsoft365_id: int, + *, + client: AuthenticatedClient, + body: Microsoft365SubscriptionQuantityRequest, +) -> ApiError | OrderResponse | None: + """Upgrade Microsoft 365 subscription quantity + + Increase the Microsoft 365 seats quantity. Returns the generated Order to pay the additional seats. + + Args: + microsoft365_id (int): + body (Microsoft365SubscriptionQuantityRequest): + + 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( + microsoft365_id=microsoft365_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + microsoft365_id: int, + *, + client: AuthenticatedClient, + body: Microsoft365SubscriptionQuantityRequest, +) -> Response[ApiError | OrderResponse]: + """Upgrade Microsoft 365 subscription quantity + + Increase the Microsoft 365 seats quantity. Returns the generated Order to pay the additional seats. + + Args: + microsoft365_id (int): + body (Microsoft365SubscriptionQuantityRequest): + + 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( + microsoft365_id=microsoft365_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + microsoft365_id: int, + *, + client: AuthenticatedClient, + body: Microsoft365SubscriptionQuantityRequest, +) -> ApiError | OrderResponse | None: + """Upgrade Microsoft 365 subscription quantity + + Increase the Microsoft 365 seats quantity. Returns the generated Order to pay the additional seats. + + Args: + microsoft365_id (int): + body (Microsoft365SubscriptionQuantityRequest): + + 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( + microsoft365_id=microsoft365_id, + client=client, + body=body, + ) + ).parsed 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 new file mode 100644 index 0000000..5c3aaf1 --- /dev/null +++ b/src/shellrent_sdk/client/api/license_/upgrade_secure_mail_quantity.py @@ -0,0 +1,214 @@ +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/__init__.py b/src/shellrent_sdk/client/api/monitoring/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/src/shellrent_sdk/client/api/monitoring/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" 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 new file mode 100644 index 0000000..50876e8 --- /dev/null +++ b/src/shellrent_sdk/client/api/monitoring/create_server_monitoring_probe.py @@ -0,0 +1,210 @@ +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.server_monitoring_probe_create_request import ServerMonitoringProbeCreateRequest +from ...models.server_monitoring_probe_response import ServerMonitoringProbeResponse +from ...types import Response + + +def _get_kwargs( + server_monitoring_id: int, + *, + body: ServerMonitoringProbeCreateRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/server-monitorings/{server_monitoring_id}/probes".format( + server_monitoring_id=quote(str(server_monitoring_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 | ServerMonitoringProbeResponse | None: + if response.status_code == 200: + response_200 = ServerMonitoringProbeResponse.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 | ServerMonitoringProbeResponse]: + 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_monitoring_id: int, + *, + client: AuthenticatedClient, + body: ServerMonitoringProbeCreateRequest, +) -> Response[ApiError | ServerMonitoringProbeResponse]: + """Create server monitoring probe + + Create a probe associated with a server monitoring + + Args: + server_monitoring_id (int): + body (ServerMonitoringProbeCreateRequest): + + 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 | ServerMonitoringProbeResponse] + """ + + kwargs = _get_kwargs( + server_monitoring_id=server_monitoring_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + server_monitoring_id: int, + *, + client: AuthenticatedClient, + body: ServerMonitoringProbeCreateRequest, +) -> ApiError | ServerMonitoringProbeResponse | None: + """Create server monitoring probe + + Create a probe associated with a server monitoring + + Args: + server_monitoring_id (int): + body (ServerMonitoringProbeCreateRequest): + + 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 | ServerMonitoringProbeResponse + """ + + return sync_detailed( + server_monitoring_id=server_monitoring_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + server_monitoring_id: int, + *, + client: AuthenticatedClient, + body: ServerMonitoringProbeCreateRequest, +) -> Response[ApiError | ServerMonitoringProbeResponse]: + """Create server monitoring probe + + Create a probe associated with a server monitoring + + Args: + server_monitoring_id (int): + body (ServerMonitoringProbeCreateRequest): + + 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 | ServerMonitoringProbeResponse] + """ + + kwargs = _get_kwargs( + server_monitoring_id=server_monitoring_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + server_monitoring_id: int, + *, + client: AuthenticatedClient, + body: ServerMonitoringProbeCreateRequest, +) -> ApiError | ServerMonitoringProbeResponse | None: + """Create server monitoring probe + + Create a probe associated with a server monitoring + + Args: + server_monitoring_id (int): + body (ServerMonitoringProbeCreateRequest): + + 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 | ServerMonitoringProbeResponse + """ + + return ( + await asyncio_detailed( + server_monitoring_id=server_monitoring_id, + client=client, + body=body, + ) + ).parsed 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 new file mode 100644 index 0000000..288550c --- /dev/null +++ b/src/shellrent_sdk/client/api/monitoring/delete_server_monitoring_probe.py @@ -0,0 +1,203 @@ +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.empty_response import EmptyResponse +from ...types import Response + + +def _get_kwargs( + server_monitoring_id: int, + probe_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/api/v3/server-monitorings/{server_monitoring_id}/probes/{probe_id}".format( + server_monitoring_id=quote(str(server_monitoring_id), safe=""), + probe_id=quote(str(probe_id), safe=""), + ), + } + + return _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 + + 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 | EmptyResponse]: + 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_monitoring_id: int, + probe_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Delete server monitoring probe + + Delete a probe associated with a server monitoring + + Args: + server_monitoring_id (int): + probe_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] + """ + + kwargs = _get_kwargs( + server_monitoring_id=server_monitoring_id, + probe_id=probe_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + server_monitoring_id: int, + probe_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Delete server monitoring probe + + Delete a probe associated with a server monitoring + + Args: + server_monitoring_id (int): + probe_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 + """ + + return sync_detailed( + server_monitoring_id=server_monitoring_id, + probe_id=probe_id, + client=client, + ).parsed + + +async def asyncio_detailed( + server_monitoring_id: int, + probe_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Delete server monitoring probe + + Delete a probe associated with a server monitoring + + Args: + server_monitoring_id (int): + probe_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] + """ + + kwargs = _get_kwargs( + server_monitoring_id=server_monitoring_id, + probe_id=probe_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + server_monitoring_id: int, + probe_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Delete server monitoring probe + + Delete a probe associated with a server monitoring + + Args: + server_monitoring_id (int): + probe_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 + """ + + return ( + await asyncio_detailed( + server_monitoring_id=server_monitoring_id, + probe_id=probe_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/monitoring/get_server_monitoring.py b/src/shellrent_sdk/client/api/monitoring/get_server_monitoring.py new file mode 100644 index 0000000..7a9ea06 --- /dev/null +++ b/src/shellrent_sdk/client/api/monitoring/get_server_monitoring.py @@ -0,0 +1,189 @@ +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.server_monitoring_response import ServerMonitoringResponse +from ...types import Response + + +def _get_kwargs( + server_monitoring_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/server-monitorings/{server_monitoring_id}".format( + server_monitoring_id=quote(str(server_monitoring_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | ServerMonitoringResponse | None: + if response.status_code == 200: + response_200 = ServerMonitoringResponse.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 | ServerMonitoringResponse]: + 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_monitoring_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ServerMonitoringResponse]: + """Get server monitoring + + Get details of a server monitoring for the authenticated account + + Args: + server_monitoring_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 | ServerMonitoringResponse] + """ + + kwargs = _get_kwargs( + server_monitoring_id=server_monitoring_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + server_monitoring_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | ServerMonitoringResponse | None: + """Get server monitoring + + Get details of a server monitoring for the authenticated account + + Args: + server_monitoring_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 | ServerMonitoringResponse + """ + + return sync_detailed( + server_monitoring_id=server_monitoring_id, + client=client, + ).parsed + + +async def asyncio_detailed( + server_monitoring_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ServerMonitoringResponse]: + """Get server monitoring + + Get details of a server monitoring for the authenticated account + + Args: + server_monitoring_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 | ServerMonitoringResponse] + """ + + kwargs = _get_kwargs( + server_monitoring_id=server_monitoring_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + server_monitoring_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | ServerMonitoringResponse | None: + """Get server monitoring + + Get details of a server monitoring for the authenticated account + + Args: + server_monitoring_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 | ServerMonitoringResponse + """ + + return ( + await asyncio_detailed( + server_monitoring_id=server_monitoring_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..ddbd318 --- /dev/null +++ b/src/shellrent_sdk/client/api/monitoring/get_server_monitoring_probe.py @@ -0,0 +1,203 @@ +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.server_monitoring_probe_response import ServerMonitoringProbeResponse +from ...types import Response + + +def _get_kwargs( + server_monitoring_id: int, + probe_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/server-monitorings/{server_monitoring_id}/probes/{probe_id}".format( + server_monitoring_id=quote(str(server_monitoring_id), safe=""), + probe_id=quote(str(probe_id), safe=""), + ), + } + + return _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()) + + 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 | ServerMonitoringProbeResponse]: + 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_monitoring_id: int, + probe_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ServerMonitoringProbeResponse]: + """Get server monitoring probe + + Get details of a probe associated with a server monitoring + + Args: + server_monitoring_id (int): + probe_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 | ServerMonitoringProbeResponse] + """ + + kwargs = _get_kwargs( + server_monitoring_id=server_monitoring_id, + probe_id=probe_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + server_monitoring_id: int, + probe_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | ServerMonitoringProbeResponse | None: + """Get server monitoring probe + + Get details of a probe associated with a server monitoring + + Args: + server_monitoring_id (int): + probe_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 | ServerMonitoringProbeResponse + """ + + return sync_detailed( + server_monitoring_id=server_monitoring_id, + probe_id=probe_id, + client=client, + ).parsed + + +async def asyncio_detailed( + server_monitoring_id: int, + probe_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ServerMonitoringProbeResponse]: + """Get server monitoring probe + + Get details of a probe associated with a server monitoring + + Args: + server_monitoring_id (int): + probe_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 | ServerMonitoringProbeResponse] + """ + + kwargs = _get_kwargs( + server_monitoring_id=server_monitoring_id, + probe_id=probe_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + server_monitoring_id: int, + probe_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | ServerMonitoringProbeResponse | None: + """Get server monitoring probe + + Get details of a probe associated with a server monitoring + + Args: + server_monitoring_id (int): + probe_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 | ServerMonitoringProbeResponse + """ + + return ( + await asyncio_detailed( + server_monitoring_id=server_monitoring_id, + probe_id=probe_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..bbe2c42 --- /dev/null +++ b/src/shellrent_sdk/client/api/monitoring/get_server_monitoring_probe_chart.py @@ -0,0 +1,203 @@ +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.server_monitoring_probe_chart_response import ServerMonitoringProbeChartResponse +from ...types import Response + + +def _get_kwargs( + server_monitoring_id: int, + probe_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/server-monitorings/{server_monitoring_id}/probes/{probe_id}/chart".format( + server_monitoring_id=quote(str(server_monitoring_id), safe=""), + probe_id=quote(str(probe_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | ServerMonitoringProbeChartResponse | None: + if response.status_code == 200: + response_200 = ServerMonitoringProbeChartResponse.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 | ServerMonitoringProbeChartResponse]: + 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_monitoring_id: int, + probe_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ServerMonitoringProbeChartResponse]: + """Get server monitoring probe chart + + Get chart data points for a probe associated with a server monitoring + + Args: + server_monitoring_id (int): + probe_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 | ServerMonitoringProbeChartResponse] + """ + + kwargs = _get_kwargs( + server_monitoring_id=server_monitoring_id, + probe_id=probe_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + server_monitoring_id: int, + probe_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | ServerMonitoringProbeChartResponse | None: + """Get server monitoring probe chart + + Get chart data points for a probe associated with a server monitoring + + Args: + server_monitoring_id (int): + probe_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 | ServerMonitoringProbeChartResponse + """ + + return sync_detailed( + server_monitoring_id=server_monitoring_id, + probe_id=probe_id, + client=client, + ).parsed + + +async def asyncio_detailed( + server_monitoring_id: int, + probe_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ServerMonitoringProbeChartResponse]: + """Get server monitoring probe chart + + Get chart data points for a probe associated with a server monitoring + + Args: + server_monitoring_id (int): + probe_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 | ServerMonitoringProbeChartResponse] + """ + + kwargs = _get_kwargs( + server_monitoring_id=server_monitoring_id, + probe_id=probe_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + server_monitoring_id: int, + probe_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | ServerMonitoringProbeChartResponse | None: + """Get server monitoring probe chart + + Get chart data points for a probe associated with a server monitoring + + Args: + server_monitoring_id (int): + probe_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 | ServerMonitoringProbeChartResponse + """ + + return ( + await asyncio_detailed( + server_monitoring_id=server_monitoring_id, + probe_id=probe_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/monitoring/get_web_monitoring.py b/src/shellrent_sdk/client/api/monitoring/get_web_monitoring.py new file mode 100644 index 0000000..0c9aee1 --- /dev/null +++ b/src/shellrent_sdk/client/api/monitoring/get_web_monitoring.py @@ -0,0 +1,189 @@ +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.web_monitoring_response import WebMonitoringResponse +from ...types import Response + + +def _get_kwargs( + web_monitoring_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/web-monitorings/{web_monitoring_id}".format( + web_monitoring_id=quote(str(web_monitoring_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | WebMonitoringResponse | None: + if response.status_code == 200: + response_200 = WebMonitoringResponse.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 | WebMonitoringResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + web_monitoring_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | WebMonitoringResponse]: + """Get web monitoring + + Get details of a web monitoring for the authenticated account + + Args: + web_monitoring_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 | WebMonitoringResponse] + """ + + kwargs = _get_kwargs( + web_monitoring_id=web_monitoring_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + web_monitoring_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | WebMonitoringResponse | None: + """Get web monitoring + + Get details of a web monitoring for the authenticated account + + Args: + web_monitoring_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 | WebMonitoringResponse + """ + + return sync_detailed( + web_monitoring_id=web_monitoring_id, + client=client, + ).parsed + + +async def asyncio_detailed( + web_monitoring_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | WebMonitoringResponse]: + """Get web monitoring + + Get details of a web monitoring for the authenticated account + + Args: + web_monitoring_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 | WebMonitoringResponse] + """ + + kwargs = _get_kwargs( + web_monitoring_id=web_monitoring_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + web_monitoring_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | WebMonitoringResponse | None: + """Get web monitoring + + Get details of a web monitoring for the authenticated account + + Args: + web_monitoring_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 | WebMonitoringResponse + """ + + return ( + await asyncio_detailed( + web_monitoring_id=web_monitoring_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..0c69086 --- /dev/null +++ b/src/shellrent_sdk/client/api/monitoring/get_web_monitoring_availability_chart.py @@ -0,0 +1,191 @@ +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.web_monitoring_availability_chart_response import ( + WebMonitoringAvailabilityChartResponse, +) +from ...types import Response + + +def _get_kwargs( + web_monitoring_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/web-monitorings/{web_monitoring_id}/charts/availability".format( + web_monitoring_id=quote(str(web_monitoring_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | WebMonitoringAvailabilityChartResponse | None: + if response.status_code == 200: + response_200 = WebMonitoringAvailabilityChartResponse.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 | WebMonitoringAvailabilityChartResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + web_monitoring_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | WebMonitoringAvailabilityChartResponse]: + """Get web monitoring availability chart + + Get availability chart points for a web monitoring service + + Args: + web_monitoring_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 | WebMonitoringAvailabilityChartResponse] + """ + + kwargs = _get_kwargs( + web_monitoring_id=web_monitoring_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + web_monitoring_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | WebMonitoringAvailabilityChartResponse | None: + """Get web monitoring availability chart + + Get availability chart points for a web monitoring service + + Args: + web_monitoring_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 | WebMonitoringAvailabilityChartResponse + """ + + return sync_detailed( + web_monitoring_id=web_monitoring_id, + client=client, + ).parsed + + +async def asyncio_detailed( + web_monitoring_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | WebMonitoringAvailabilityChartResponse]: + """Get web monitoring availability chart + + Get availability chart points for a web monitoring service + + Args: + web_monitoring_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 | WebMonitoringAvailabilityChartResponse] + """ + + kwargs = _get_kwargs( + web_monitoring_id=web_monitoring_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + web_monitoring_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | WebMonitoringAvailabilityChartResponse | None: + """Get web monitoring availability chart + + Get availability chart points for a web monitoring service + + Args: + web_monitoring_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 | WebMonitoringAvailabilityChartResponse + """ + + return ( + await asyncio_detailed( + web_monitoring_id=web_monitoring_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..9b7441d --- /dev/null +++ b/src/shellrent_sdk/client/api/monitoring/get_web_monitoring_download_speed_chart.py @@ -0,0 +1,191 @@ +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.web_monitoring_download_speed_chart_response import ( + WebMonitoringDownloadSpeedChartResponse, +) +from ...types import Response + + +def _get_kwargs( + web_monitoring_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/web-monitorings/{web_monitoring_id}/charts/download-speed".format( + web_monitoring_id=quote(str(web_monitoring_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | WebMonitoringDownloadSpeedChartResponse | None: + if response.status_code == 200: + response_200 = WebMonitoringDownloadSpeedChartResponse.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 | WebMonitoringDownloadSpeedChartResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + web_monitoring_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | WebMonitoringDownloadSpeedChartResponse]: + """Get web monitoring download speed chart + + Get download speed chart points for a web monitoring service + + Args: + web_monitoring_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 | WebMonitoringDownloadSpeedChartResponse] + """ + + kwargs = _get_kwargs( + web_monitoring_id=web_monitoring_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + web_monitoring_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | WebMonitoringDownloadSpeedChartResponse | None: + """Get web monitoring download speed chart + + Get download speed chart points for a web monitoring service + + Args: + web_monitoring_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 | WebMonitoringDownloadSpeedChartResponse + """ + + return sync_detailed( + web_monitoring_id=web_monitoring_id, + client=client, + ).parsed + + +async def asyncio_detailed( + web_monitoring_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | WebMonitoringDownloadSpeedChartResponse]: + """Get web monitoring download speed chart + + Get download speed chart points for a web monitoring service + + Args: + web_monitoring_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 | WebMonitoringDownloadSpeedChartResponse] + """ + + kwargs = _get_kwargs( + web_monitoring_id=web_monitoring_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + web_monitoring_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | WebMonitoringDownloadSpeedChartResponse | None: + """Get web monitoring download speed chart + + Get download speed chart points for a web monitoring service + + Args: + web_monitoring_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 | WebMonitoringDownloadSpeedChartResponse + """ + + return ( + await asyncio_detailed( + web_monitoring_id=web_monitoring_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..d8ddddd --- /dev/null +++ b/src/shellrent_sdk/client/api/monitoring/get_web_monitoring_notices.py @@ -0,0 +1,189 @@ +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.web_monitoring_notices_response import WebMonitoringNoticesResponse +from ...types import Response + + +def _get_kwargs( + web_monitoring_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/web-monitorings/{web_monitoring_id}/notices".format( + web_monitoring_id=quote(str(web_monitoring_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | WebMonitoringNoticesResponse | None: + if response.status_code == 200: + response_200 = WebMonitoringNoticesResponse.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 | WebMonitoringNoticesResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + web_monitoring_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | WebMonitoringNoticesResponse]: + """Get web monitoring notices + + Get notification notices configuration for a web monitoring + + Args: + web_monitoring_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 | WebMonitoringNoticesResponse] + """ + + kwargs = _get_kwargs( + web_monitoring_id=web_monitoring_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + web_monitoring_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | WebMonitoringNoticesResponse | None: + """Get web monitoring notices + + Get notification notices configuration for a web monitoring + + Args: + web_monitoring_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 | WebMonitoringNoticesResponse + """ + + return sync_detailed( + web_monitoring_id=web_monitoring_id, + client=client, + ).parsed + + +async def asyncio_detailed( + web_monitoring_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | WebMonitoringNoticesResponse]: + """Get web monitoring notices + + Get notification notices configuration for a web monitoring + + Args: + web_monitoring_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 | WebMonitoringNoticesResponse] + """ + + kwargs = _get_kwargs( + web_monitoring_id=web_monitoring_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + web_monitoring_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | WebMonitoringNoticesResponse | None: + """Get web monitoring notices + + Get notification notices configuration for a web monitoring + + Args: + web_monitoring_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 | WebMonitoringNoticesResponse + """ + + return ( + await asyncio_detailed( + web_monitoring_id=web_monitoring_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..5dd1421 --- /dev/null +++ b/src/shellrent_sdk/client/api/monitoring/get_web_monitoring_response_time_chart.py @@ -0,0 +1,191 @@ +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.web_monitoring_response_time_chart_response import ( + WebMonitoringResponseTimeChartResponse, +) +from ...types import Response + + +def _get_kwargs( + web_monitoring_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/web-monitorings/{web_monitoring_id}/charts/response-time".format( + web_monitoring_id=quote(str(web_monitoring_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | WebMonitoringResponseTimeChartResponse | None: + if response.status_code == 200: + response_200 = WebMonitoringResponseTimeChartResponse.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 | WebMonitoringResponseTimeChartResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + web_monitoring_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | WebMonitoringResponseTimeChartResponse]: + """Get web monitoring response time chart + + Get response time chart points for a web monitoring service + + Args: + web_monitoring_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 | WebMonitoringResponseTimeChartResponse] + """ + + kwargs = _get_kwargs( + web_monitoring_id=web_monitoring_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + web_monitoring_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | WebMonitoringResponseTimeChartResponse | None: + """Get web monitoring response time chart + + Get response time chart points for a web monitoring service + + Args: + web_monitoring_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 | WebMonitoringResponseTimeChartResponse + """ + + return sync_detailed( + web_monitoring_id=web_monitoring_id, + client=client, + ).parsed + + +async def asyncio_detailed( + web_monitoring_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | WebMonitoringResponseTimeChartResponse]: + """Get web monitoring response time chart + + Get response time chart points for a web monitoring service + + Args: + web_monitoring_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 | WebMonitoringResponseTimeChartResponse] + """ + + kwargs = _get_kwargs( + web_monitoring_id=web_monitoring_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + web_monitoring_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | WebMonitoringResponseTimeChartResponse | None: + """Get web monitoring response time chart + + Get response time chart points for a web monitoring service + + Args: + web_monitoring_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 | WebMonitoringResponseTimeChartResponse + """ + + return ( + await asyncio_detailed( + web_monitoring_id=web_monitoring_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..6c7df8d --- /dev/null +++ b/src/shellrent_sdk/client/api/monitoring/list_server_monitoring_probes.py @@ -0,0 +1,189 @@ +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.server_monitoring_probe_list_response import ServerMonitoringProbeListResponse +from ...types import Response + + +def _get_kwargs( + server_monitoring_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/server-monitorings/{server_monitoring_id}/probes".format( + server_monitoring_id=quote(str(server_monitoring_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | ServerMonitoringProbeListResponse | None: + if response.status_code == 200: + response_200 = ServerMonitoringProbeListResponse.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 | ServerMonitoringProbeListResponse]: + 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_monitoring_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ServerMonitoringProbeListResponse]: + """List server monitoring probes + + Get the probes associated with a server monitoring + + Args: + server_monitoring_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 | ServerMonitoringProbeListResponse] + """ + + kwargs = _get_kwargs( + server_monitoring_id=server_monitoring_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + server_monitoring_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | ServerMonitoringProbeListResponse | None: + """List server monitoring probes + + Get the probes associated with a server monitoring + + Args: + server_monitoring_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 | ServerMonitoringProbeListResponse + """ + + return sync_detailed( + server_monitoring_id=server_monitoring_id, + client=client, + ).parsed + + +async def asyncio_detailed( + server_monitoring_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ServerMonitoringProbeListResponse]: + """List server monitoring probes + + Get the probes associated with a server monitoring + + Args: + server_monitoring_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 | ServerMonitoringProbeListResponse] + """ + + kwargs = _get_kwargs( + server_monitoring_id=server_monitoring_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + server_monitoring_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | ServerMonitoringProbeListResponse | None: + """List server monitoring probes + + Get the probes associated with a server monitoring + + Args: + server_monitoring_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 | ServerMonitoringProbeListResponse + """ + + return ( + await asyncio_detailed( + server_monitoring_id=server_monitoring_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/monitoring/list_server_monitorings.py b/src/shellrent_sdk/client/api/monitoring/list_server_monitorings.py new file mode 100644 index 0000000..23f8c86 --- /dev/null +++ b/src/shellrent_sdk/client/api/monitoring/list_server_monitorings.py @@ -0,0 +1,211 @@ +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.server_monitoring_paginated_list_response import ( + ServerMonitoringPaginatedListResponse, +) +from ...types import UNSET, Response, Unset + + +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/server-monitorings", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | ServerMonitoringPaginatedListResponse | None: + if response.status_code == 200: + response_200 = ServerMonitoringPaginatedListResponse.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 | ServerMonitoringPaginatedListResponse]: + 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 = 20, +) -> Response[ApiError | ServerMonitoringPaginatedListResponse]: + """List server monitorings + + Get a paginated list of server monitorings for the authenticated account + + 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. + + Returns: + Response[ApiError | ServerMonitoringPaginatedListResponse] + """ + + 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 = 20, +) -> ApiError | ServerMonitoringPaginatedListResponse | None: + """List server monitorings + + Get a paginated list of server monitorings for the authenticated account + + 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. + + Returns: + ApiError | ServerMonitoringPaginatedListResponse + """ + + 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 | ServerMonitoringPaginatedListResponse]: + """List server monitorings + + Get a paginated list of server monitorings for the authenticated account + + 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. + + Returns: + Response[ApiError | ServerMonitoringPaginatedListResponse] + """ + + 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 = 20, +) -> ApiError | ServerMonitoringPaginatedListResponse | None: + """List server monitorings + + Get a paginated list of server monitorings for the authenticated account + + 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. + + Returns: + ApiError | ServerMonitoringPaginatedListResponse + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + per_page=per_page, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/monitoring/list_web_monitorings.py b/src/shellrent_sdk/client/api/monitoring/list_web_monitorings.py new file mode 100644 index 0000000..996ad77 --- /dev/null +++ b/src/shellrent_sdk/client/api/monitoring/list_web_monitorings.py @@ -0,0 +1,209 @@ +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.web_monitoring_paginated_list_response import WebMonitoringPaginatedListResponse +from ...types import UNSET, Response, Unset + + +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/web-monitorings", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | WebMonitoringPaginatedListResponse | None: + if response.status_code == 200: + response_200 = WebMonitoringPaginatedListResponse.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 | WebMonitoringPaginatedListResponse]: + 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 = 20, +) -> Response[ApiError | WebMonitoringPaginatedListResponse]: + """List web monitorings + + Get a paginated list of web monitorings for the authenticated account + + 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. + + Returns: + Response[ApiError | WebMonitoringPaginatedListResponse] + """ + + 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 = 20, +) -> ApiError | WebMonitoringPaginatedListResponse | None: + """List web monitorings + + Get a paginated list of web monitorings for the authenticated account + + 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. + + Returns: + ApiError | WebMonitoringPaginatedListResponse + """ + + 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 | WebMonitoringPaginatedListResponse]: + """List web monitorings + + Get a paginated list of web monitorings for the authenticated account + + 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. + + Returns: + Response[ApiError | WebMonitoringPaginatedListResponse] + """ + + 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 = 20, +) -> ApiError | WebMonitoringPaginatedListResponse | None: + """List web monitorings + + Get a paginated list of web monitorings for the authenticated account + + 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. + + Returns: + ApiError | WebMonitoringPaginatedListResponse + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + per_page=per_page, + ) + ).parsed 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 new file mode 100644 index 0000000..e54154b --- /dev/null +++ b/src/shellrent_sdk/client/api/monitoring/update_server_monitoring_probe.py @@ -0,0 +1,224 @@ +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.server_monitoring_probe_response import ServerMonitoringProbeResponse +from ...models.server_monitoring_probe_update_request import ServerMonitoringProbeUpdateRequest +from ...types import Response + + +def _get_kwargs( + server_monitoring_id: int, + probe_id: int, + *, + body: ServerMonitoringProbeUpdateRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/api/v3/server-monitorings/{server_monitoring_id}/probes/{probe_id}".format( + server_monitoring_id=quote(str(server_monitoring_id), safe=""), + probe_id=quote(str(probe_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 | ServerMonitoringProbeResponse | None: + if response.status_code == 200: + response_200 = ServerMonitoringProbeResponse.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 | ServerMonitoringProbeResponse]: + 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_monitoring_id: int, + probe_id: int, + *, + client: AuthenticatedClient, + body: ServerMonitoringProbeUpdateRequest, +) -> Response[ApiError | ServerMonitoringProbeResponse]: + """Update server monitoring probe + + Update a probe associated with a server monitoring + + Args: + server_monitoring_id (int): + probe_id (int): + body (ServerMonitoringProbeUpdateRequest): + + 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 | ServerMonitoringProbeResponse] + """ + + kwargs = _get_kwargs( + server_monitoring_id=server_monitoring_id, + probe_id=probe_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + server_monitoring_id: int, + probe_id: int, + *, + client: AuthenticatedClient, + body: ServerMonitoringProbeUpdateRequest, +) -> ApiError | ServerMonitoringProbeResponse | None: + """Update server monitoring probe + + Update a probe associated with a server monitoring + + Args: + server_monitoring_id (int): + probe_id (int): + body (ServerMonitoringProbeUpdateRequest): + + 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 | ServerMonitoringProbeResponse + """ + + return sync_detailed( + server_monitoring_id=server_monitoring_id, + probe_id=probe_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + server_monitoring_id: int, + probe_id: int, + *, + client: AuthenticatedClient, + body: ServerMonitoringProbeUpdateRequest, +) -> Response[ApiError | ServerMonitoringProbeResponse]: + """Update server monitoring probe + + Update a probe associated with a server monitoring + + Args: + server_monitoring_id (int): + probe_id (int): + body (ServerMonitoringProbeUpdateRequest): + + 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 | ServerMonitoringProbeResponse] + """ + + kwargs = _get_kwargs( + server_monitoring_id=server_monitoring_id, + probe_id=probe_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + server_monitoring_id: int, + probe_id: int, + *, + client: AuthenticatedClient, + body: ServerMonitoringProbeUpdateRequest, +) -> ApiError | ServerMonitoringProbeResponse | None: + """Update server monitoring probe + + Update a probe associated with a server monitoring + + Args: + server_monitoring_id (int): + probe_id (int): + body (ServerMonitoringProbeUpdateRequest): + + 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 | ServerMonitoringProbeResponse + """ + + return ( + await asyncio_detailed( + server_monitoring_id=server_monitoring_id, + probe_id=probe_id, + client=client, + body=body, + ) + ).parsed 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 new file mode 100644 index 0000000..7cb3fa9 --- /dev/null +++ b/src/shellrent_sdk/client/api/monitoring/update_web_monitoring_notices.py @@ -0,0 +1,210 @@ +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.web_monitoring_notices_response import WebMonitoringNoticesResponse +from ...models.web_monitoring_notices_update_request import WebMonitoringNoticesUpdateRequest +from ...types import Response + + +def _get_kwargs( + web_monitoring_id: int, + *, + body: WebMonitoringNoticesUpdateRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/api/v3/web-monitorings/{web_monitoring_id}/notices".format( + web_monitoring_id=quote(str(web_monitoring_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 | WebMonitoringNoticesResponse | None: + if response.status_code == 200: + response_200 = WebMonitoringNoticesResponse.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 | WebMonitoringNoticesResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + web_monitoring_id: int, + *, + client: AuthenticatedClient, + body: WebMonitoringNoticesUpdateRequest, +) -> Response[ApiError | WebMonitoringNoticesResponse]: + """Update web monitoring notices + + Update notification notices configuration for a web monitoring + + Args: + web_monitoring_id (int): + body (WebMonitoringNoticesUpdateRequest): + + 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 | WebMonitoringNoticesResponse] + """ + + kwargs = _get_kwargs( + web_monitoring_id=web_monitoring_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + web_monitoring_id: int, + *, + client: AuthenticatedClient, + body: WebMonitoringNoticesUpdateRequest, +) -> ApiError | WebMonitoringNoticesResponse | None: + """Update web monitoring notices + + Update notification notices configuration for a web monitoring + + Args: + web_monitoring_id (int): + body (WebMonitoringNoticesUpdateRequest): + + 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 | WebMonitoringNoticesResponse + """ + + return sync_detailed( + web_monitoring_id=web_monitoring_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + web_monitoring_id: int, + *, + client: AuthenticatedClient, + body: WebMonitoringNoticesUpdateRequest, +) -> Response[ApiError | WebMonitoringNoticesResponse]: + """Update web monitoring notices + + Update notification notices configuration for a web monitoring + + Args: + web_monitoring_id (int): + body (WebMonitoringNoticesUpdateRequest): + + 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 | WebMonitoringNoticesResponse] + """ + + kwargs = _get_kwargs( + web_monitoring_id=web_monitoring_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + web_monitoring_id: int, + *, + client: AuthenticatedClient, + body: WebMonitoringNoticesUpdateRequest, +) -> ApiError | WebMonitoringNoticesResponse | None: + """Update web monitoring notices + + Update notification notices configuration for a web monitoring + + Args: + web_monitoring_id (int): + body (WebMonitoringNoticesUpdateRequest): + + 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 | WebMonitoringNoticesResponse + """ + + return ( + await asyncio_detailed( + web_monitoring_id=web_monitoring_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/o_auth/__init__.py b/src/shellrent_sdk/client/api/o_auth/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/src/shellrent_sdk/client/api/o_auth/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/src/shellrent_sdk/client/api/o_auth/get_jwks.py b/src/shellrent_sdk/client/api/o_auth/get_jwks.py new file mode 100644 index 0000000..4b8196f --- /dev/null +++ b/src/shellrent_sdk/client/api/o_auth/get_jwks.py @@ -0,0 +1,142 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.jwks_response import JwksResponse +from ...models.o_auth_error import OAuthError +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/.well-known/jwks.json", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> JwksResponse | OAuthError | None: + if response.status_code == 200: + response_200 = JwksResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 500: + response_500 = OAuthError.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[JwksResponse | OAuthError]: + 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 | Client, +) -> Response[JwksResponse | OAuthError]: + """Esponi JWKS + + Restituisce le chiavi pubbliche usate per firmare gli access token JWT. + + 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[JwksResponse | OAuthError] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, +) -> JwksResponse | OAuthError | None: + """Esponi JWKS + + Restituisce le chiavi pubbliche usate per firmare gli access token JWT. + + 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: + JwksResponse | OAuthError + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[JwksResponse | OAuthError]: + """Esponi JWKS + + Restituisce le chiavi pubbliche usate per firmare gli access token JWT. + + 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[JwksResponse | OAuthError] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, +) -> JwksResponse | OAuthError | None: + """Esponi JWKS + + Restituisce le chiavi pubbliche usate per firmare gli access token JWT. + + 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: + JwksResponse | OAuthError + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..c17fcc7 --- /dev/null +++ b/src/shellrent_sdk/client/api/o_auth/request_access_token.py @@ -0,0 +1,204 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.o_auth_error import OAuthError +from ...models.o_auth_token_response import OAuthTokenResponse +from ...models.request_access_token_body import RequestAccessTokenBody +from ...types import Response + + +def _get_kwargs( + *, + body: RequestAccessTokenBody, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/oauth/token", + } + + _kwargs["data"] = body.to_dict() + headers["Content-Type"] = "application/x-www-form-urlencoded" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> OAuthError | OAuthTokenResponse | None: + if response.status_code == 200: + response_200 = OAuthTokenResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = OAuthError.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = OAuthError.from_dict(response.json()) + + return response_401 + + if response.status_code == 429: + response_429 = OAuthError.from_dict(response.json()) + + return response_429 + + if response.status_code == 500: + response_500 = OAuthError.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[OAuthError | OAuthTokenResponse]: + 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 | Client, + body: RequestAccessTokenBody, +) -> Response[OAuthError | OAuthTokenResponse]: + """Richiedi un 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. + + Args: + body (RequestAccessTokenBody): + + 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[OAuthError | OAuthTokenResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: RequestAccessTokenBody, +) -> OAuthError | OAuthTokenResponse | None: + """Richiedi un 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. + + Args: + body (RequestAccessTokenBody): + + 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: + OAuthError | OAuthTokenResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: RequestAccessTokenBody, +) -> Response[OAuthError | OAuthTokenResponse]: + """Richiedi un 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. + + Args: + body (RequestAccessTokenBody): + + 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[OAuthError | OAuthTokenResponse] + """ + + 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 | Client, + body: RequestAccessTokenBody, +) -> OAuthError | OAuthTokenResponse | None: + """Richiedi un 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. + + Args: + body (RequestAccessTokenBody): + + 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: + OAuthError | OAuthTokenResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/payment/__init__.py b/src/shellrent_sdk/client/api/payment/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/src/shellrent_sdk/client/api/payment/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" 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 new file mode 100644 index 0000000..8cd9073 --- /dev/null +++ b/src/shellrent_sdk/client/api/payment/activate_one_click_autorenew.py @@ -0,0 +1,162 @@ +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.one_click_autorenew_response import OneClickAutorenewResponse +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/one-clicks/autorenew", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | OneClickAutorenewResponse | None: + if response.status_code == 200: + response_200 = OneClickAutorenewResponse.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 | OneClickAutorenewResponse]: + 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, +) -> Response[ApiError | OneClickAutorenewResponse]: + """Activate One-Click autorenew + + Activate automatic renewal service with One-Click Payment + + 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 | OneClickAutorenewResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> ApiError | OneClickAutorenewResponse | None: + """Activate One-Click autorenew + + Activate automatic renewal service with One-Click Payment + + 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 | OneClickAutorenewResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[ApiError | OneClickAutorenewResponse]: + """Activate One-Click autorenew + + Activate automatic renewal service with One-Click Payment + + 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 | OneClickAutorenewResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> ApiError | OneClickAutorenewResponse | None: + """Activate One-Click autorenew + + Activate automatic renewal service with One-Click Payment + + 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 | OneClickAutorenewResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..4ad5c59 --- /dev/null +++ b/src/shellrent_sdk/client/api/payment/activate_prepaid_credit_autorenew.py @@ -0,0 +1,162 @@ +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.prepaid_credit_response import PrepaidCreditResponse +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/prepaid-credit/autorenew", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | PrepaidCreditResponse | None: + if response.status_code == 200: + response_200 = PrepaidCreditResponse.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 | PrepaidCreditResponse]: + 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, +) -> Response[ApiError | PrepaidCreditResponse]: + """Activate Prepaid credit autorenew + + Activate automatic renewal service with 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[ApiError | PrepaidCreditResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> ApiError | PrepaidCreditResponse | None: + """Activate Prepaid credit autorenew + + Activate automatic renewal service with 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: + ApiError | PrepaidCreditResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[ApiError | PrepaidCreditResponse]: + """Activate Prepaid credit autorenew + + Activate automatic renewal service with 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[ApiError | PrepaidCreditResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> ApiError | PrepaidCreditResponse | None: + """Activate Prepaid credit autorenew + + Activate automatic renewal service with 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: + ApiError | PrepaidCreditResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).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 new file mode 100644 index 0000000..e6951a0 --- /dev/null +++ b/src/shellrent_sdk/client/api/payment/create_prepaid_credit_topup.py @@ -0,0 +1,194 @@ +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_prepaid_credit_topup_request import BuyPrepaidCreditTopupRequest +from ...models.order_list_response import OrderListResponse +from ...types import Response + + +def _get_kwargs( + *, + body: BuyPrepaidCreditTopupRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/prepaid-credit/topups", + } + + _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: BuyPrepaidCreditTopupRequest, +) -> Response[ApiError | OrderListResponse]: + """Topup Prepaid credit + + Topup Prepaid credit + + Args: + body (BuyPrepaidCreditTopupRequest): + + 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: BuyPrepaidCreditTopupRequest, +) -> ApiError | OrderListResponse | None: + """Topup Prepaid credit + + Topup Prepaid credit + + Args: + body (BuyPrepaidCreditTopupRequest): + + 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: BuyPrepaidCreditTopupRequest, +) -> Response[ApiError | OrderListResponse]: + """Topup Prepaid credit + + Topup Prepaid credit + + Args: + body (BuyPrepaidCreditTopupRequest): + + 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: BuyPrepaidCreditTopupRequest, +) -> ApiError | OrderListResponse | None: + """Topup Prepaid credit + + Topup Prepaid credit + + Args: + body (BuyPrepaidCreditTopupRequest): + + 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/payment/get_one_click.py b/src/shellrent_sdk/client/api/payment/get_one_click.py new file mode 100644 index 0000000..b6e4638 --- /dev/null +++ b/src/shellrent_sdk/client/api/payment/get_one_click.py @@ -0,0 +1,189 @@ +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.one_click_response import OneClickResponse +from ...types import Response + + +def _get_kwargs( + one_click_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/one-clicks/{one_click_id}".format( + one_click_id=quote(str(one_click_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | OneClickResponse | None: + if response.status_code == 200: + response_200 = OneClickResponse.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 | OneClickResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + one_click_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | OneClickResponse]: + """Get a One-Click + + Get details of an active One-Click Payment + + Args: + one_click_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 | OneClickResponse] + """ + + kwargs = _get_kwargs( + one_click_id=one_click_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + one_click_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | OneClickResponse | None: + """Get a One-Click + + Get details of an active One-Click Payment + + Args: + one_click_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 | OneClickResponse + """ + + return sync_detailed( + one_click_id=one_click_id, + client=client, + ).parsed + + +async def asyncio_detailed( + one_click_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | OneClickResponse]: + """Get a One-Click + + Get details of an active One-Click Payment + + Args: + one_click_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 | OneClickResponse] + """ + + kwargs = _get_kwargs( + one_click_id=one_click_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + one_click_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | OneClickResponse | None: + """Get a One-Click + + Get details of an active One-Click Payment + + Args: + one_click_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 | OneClickResponse + """ + + return ( + await asyncio_detailed( + one_click_id=one_click_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..bf3ec57 --- /dev/null +++ b/src/shellrent_sdk/client/api/payment/get_one_click_autorenew.py @@ -0,0 +1,162 @@ +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.one_click_autorenew_response import OneClickAutorenewResponse +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/one-clicks/autorenew", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | OneClickAutorenewResponse | None: + if response.status_code == 200: + response_200 = OneClickAutorenewResponse.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 | OneClickAutorenewResponse]: + 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, +) -> Response[ApiError | OneClickAutorenewResponse]: + """Get autorenew status + + Get the status of the automatic renewal service with One-Click Payment + + 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 | OneClickAutorenewResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> ApiError | OneClickAutorenewResponse | None: + """Get autorenew status + + Get the status of the automatic renewal service with One-Click Payment + + 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 | OneClickAutorenewResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[ApiError | OneClickAutorenewResponse]: + """Get autorenew status + + Get the status of the automatic renewal service with One-Click Payment + + 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 | OneClickAutorenewResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> ApiError | OneClickAutorenewResponse | None: + """Get autorenew status + + Get the status of the automatic renewal service with One-Click Payment + + 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 | OneClickAutorenewResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/payment/get_payment.py b/src/shellrent_sdk/client/api/payment/get_payment.py new file mode 100644 index 0000000..449361c --- /dev/null +++ b/src/shellrent_sdk/client/api/payment/get_payment.py @@ -0,0 +1,189 @@ +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.payment_response import PaymentResponse +from ...types import Response + + +def _get_kwargs( + payment_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/payments/{payment_id}".format( + payment_id=quote(str(payment_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | PaymentResponse | None: + if response.status_code == 200: + response_200 = PaymentResponse.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 | 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( + payment_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | PaymentResponse]: + """Get a payment + + Get details of a payment + + Args: + payment_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 | PaymentResponse] + """ + + kwargs = _get_kwargs( + payment_id=payment_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + payment_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | PaymentResponse | None: + """Get a payment + + Get details of a payment + + Args: + payment_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 | PaymentResponse + """ + + return sync_detailed( + payment_id=payment_id, + client=client, + ).parsed + + +async def asyncio_detailed( + payment_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | PaymentResponse]: + """Get a payment + + Get details of a payment + + Args: + payment_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 | PaymentResponse] + """ + + kwargs = _get_kwargs( + payment_id=payment_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + payment_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | PaymentResponse | None: + """Get a payment + + Get details of a payment + + Args: + payment_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 | PaymentResponse + """ + + return ( + await asyncio_detailed( + payment_id=payment_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/payment/get_prepaid_credit.py b/src/shellrent_sdk/client/api/payment/get_prepaid_credit.py new file mode 100644 index 0000000..3247807 --- /dev/null +++ b/src/shellrent_sdk/client/api/payment/get_prepaid_credit.py @@ -0,0 +1,162 @@ +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.prepaid_credit_response import PrepaidCreditResponse +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/prepaid-credit", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | PrepaidCreditResponse | None: + if response.status_code == 200: + response_200 = PrepaidCreditResponse.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 | PrepaidCreditResponse]: + 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, +) -> Response[ApiError | PrepaidCreditResponse]: + """Prepaid credit account + + Get details of the Prepaid Credit for the account + + 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 | PrepaidCreditResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> ApiError | PrepaidCreditResponse | None: + """Prepaid credit account + + Get details of the Prepaid Credit for the account + + 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 | PrepaidCreditResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[ApiError | PrepaidCreditResponse]: + """Prepaid credit account + + Get details of the Prepaid Credit for the account + + 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 | PrepaidCreditResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> ApiError | PrepaidCreditResponse | None: + """Prepaid credit account + + Get details of the Prepaid Credit for the account + + 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 | PrepaidCreditResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..a2a3f9f --- /dev/null +++ b/src/shellrent_sdk/client/api/payment/get_prepaid_credit_operation.py @@ -0,0 +1,189 @@ +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.prepaid_credit_operation_response import PrepaidCreditOperationResponse +from ...types import Response + + +def _get_kwargs( + operation_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/prepaid-credit/operations/{operation_id}".format( + operation_id=quote(str(operation_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | PrepaidCreditOperationResponse | None: + if response.status_code == 200: + response_200 = PrepaidCreditOperationResponse.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 | PrepaidCreditOperationResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + operation_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | PrepaidCreditOperationResponse]: + """Get a Prepaid credit operation + + Get details of a Prepaid credit operation + + Args: + operation_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 | PrepaidCreditOperationResponse] + """ + + kwargs = _get_kwargs( + operation_id=operation_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + operation_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | PrepaidCreditOperationResponse | None: + """Get a Prepaid credit operation + + Get details of a Prepaid credit operation + + Args: + operation_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 | PrepaidCreditOperationResponse + """ + + return sync_detailed( + operation_id=operation_id, + client=client, + ).parsed + + +async def asyncio_detailed( + operation_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | PrepaidCreditOperationResponse]: + """Get a Prepaid credit operation + + Get details of a Prepaid credit operation + + Args: + operation_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 | PrepaidCreditOperationResponse] + """ + + kwargs = _get_kwargs( + operation_id=operation_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + operation_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | PrepaidCreditOperationResponse | None: + """Get a Prepaid credit operation + + Get details of a Prepaid credit operation + + Args: + operation_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 | PrepaidCreditOperationResponse + """ + + return ( + await asyncio_detailed( + operation_id=operation_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..c340fc7 --- /dev/null +++ b/src/shellrent_sdk/client/api/payment/get_prepaid_credit_topup.py @@ -0,0 +1,189 @@ +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.prepaid_credit_topup_response import PrepaidCreditTopupResponse +from ...types import Response + + +def _get_kwargs( + topup_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=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | PrepaidCreditTopupResponse | None: + if response.status_code == 200: + response_200 = PrepaidCreditTopupResponse.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 | PrepaidCreditTopupResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + topup_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | PrepaidCreditTopupResponse]: + """Get a Prepaid credit topup + + Get details of a Prepaid credit topup + + Args: + topup_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 | PrepaidCreditTopupResponse] + """ + + kwargs = _get_kwargs( + topup_id=topup_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + topup_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | PrepaidCreditTopupResponse | None: + """Get a Prepaid credit topup + + Get details of a Prepaid credit topup + + Args: + topup_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 | PrepaidCreditTopupResponse + """ + + return sync_detailed( + topup_id=topup_id, + client=client, + ).parsed + + +async def asyncio_detailed( + topup_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | PrepaidCreditTopupResponse]: + """Get a Prepaid credit topup + + Get details of a Prepaid credit topup + + Args: + topup_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 | PrepaidCreditTopupResponse] + """ + + kwargs = _get_kwargs( + topup_id=topup_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + topup_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | PrepaidCreditTopupResponse | None: + """Get a Prepaid credit topup + + Get details of a Prepaid credit topup + + Args: + topup_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 | PrepaidCreditTopupResponse + """ + + return ( + await asyncio_detailed( + topup_id=topup_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 new file mode 100644 index 0000000..cc9ee57 --- /dev/null +++ b/src/shellrent_sdk/client/api/payment/list_one_clicks.py @@ -0,0 +1,261 @@ +import datetime +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.one_click_paginated_list_response import OneClickPaginatedListResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + payment_method: str | Unset = UNSET, + date_created_from: datetime.datetime | Unset = UNSET, + date_created_to: datetime.datetime | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["payment_method"] = payment_method + + json_date_created_from: str | Unset = UNSET + if not isinstance(date_created_from, Unset): + json_date_created_from = date_created_from.isoformat() + params["date_created_from"] = json_date_created_from + + json_date_created_to: str | Unset = UNSET + if not isinstance(date_created_to, Unset): + json_date_created_to = date_created_to.isoformat() + params["date_created_to"] = json_date_created_to + + 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/one-clicks", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | OneClickPaginatedListResponse | None: + if response.status_code == 200: + response_200 = OneClickPaginatedListResponse.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 | OneClickPaginatedListResponse]: + 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, + payment_method: str | Unset = UNSET, + date_created_from: datetime.datetime | Unset = UNSET, + date_created_to: datetime.datetime | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | OneClickPaginatedListResponse]: + """List all One-Clicks + + Get a list of all active One-Click Payments + + 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: 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 | OneClickPaginatedListResponse] + """ + + kwargs = _get_kwargs( + payment_method=payment_method, + date_created_from=date_created_from, + date_created_to=date_created_to, + page=page, + per_page=per_page, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + payment_method: str | Unset = UNSET, + date_created_from: datetime.datetime | Unset = UNSET, + date_created_to: datetime.datetime | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | OneClickPaginatedListResponse | None: + """List all One-Clicks + + Get a list of all active One-Click Payments + + 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: 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 | OneClickPaginatedListResponse + """ + + return sync_detailed( + client=client, + payment_method=payment_method, + date_created_from=date_created_from, + date_created_to=date_created_to, + page=page, + per_page=per_page, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + payment_method: str | Unset = UNSET, + date_created_from: datetime.datetime | Unset = UNSET, + date_created_to: datetime.datetime | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | OneClickPaginatedListResponse]: + """List all One-Clicks + + Get a list of all active One-Click Payments + + 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: 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 | OneClickPaginatedListResponse] + """ + + kwargs = _get_kwargs( + payment_method=payment_method, + date_created_from=date_created_from, + date_created_to=date_created_to, + 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, + payment_method: str | Unset = UNSET, + date_created_from: datetime.datetime | Unset = UNSET, + date_created_to: datetime.datetime | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | OneClickPaginatedListResponse | None: + """List all One-Clicks + + Get a list of all active One-Click Payments + + 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: 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 | OneClickPaginatedListResponse + """ + + return ( + await asyncio_detailed( + client=client, + payment_method=payment_method, + date_created_from=date_created_from, + date_created_to=date_created_to, + page=page, + per_page=per_page, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/payment/list_payments.py b/src/shellrent_sdk/client/api/payment/list_payments.py new file mode 100644 index 0000000..b372cad --- /dev/null +++ b/src/shellrent_sdk/client/api/payment/list_payments.py @@ -0,0 +1,261 @@ +import datetime +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.payment_paginated_list_response import PaymentPaginatedListResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + payment_method: str | Unset = UNSET, + date_payment_from: datetime.datetime | Unset = UNSET, + date_payment_to: datetime.datetime | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["payment_method"] = payment_method + + json_date_payment_from: str | Unset = UNSET + if not isinstance(date_payment_from, Unset): + json_date_payment_from = date_payment_from.isoformat() + params["date_payment_from"] = json_date_payment_from + + json_date_payment_to: str | Unset = UNSET + if not isinstance(date_payment_to, Unset): + json_date_payment_to = date_payment_to.isoformat() + params["date_payment_to"] = json_date_payment_to + + 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/payments", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | PaymentPaginatedListResponse | None: + if response.status_code == 200: + response_200 = PaymentPaginatedListResponse.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 | PaymentPaginatedListResponse]: + 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, + payment_method: str | Unset = UNSET, + date_payment_from: datetime.datetime | Unset = UNSET, + date_payment_to: datetime.datetime | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | PaymentPaginatedListResponse]: + """List all Payments + + Get a list of all Payments + + 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: 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 | PaymentPaginatedListResponse] + """ + + kwargs = _get_kwargs( + payment_method=payment_method, + date_payment_from=date_payment_from, + date_payment_to=date_payment_to, + page=page, + per_page=per_page, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + payment_method: str | Unset = UNSET, + date_payment_from: datetime.datetime | Unset = UNSET, + date_payment_to: datetime.datetime | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | PaymentPaginatedListResponse | None: + """List all Payments + + Get a list of all Payments + + 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: 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 | PaymentPaginatedListResponse + """ + + return sync_detailed( + client=client, + payment_method=payment_method, + date_payment_from=date_payment_from, + date_payment_to=date_payment_to, + page=page, + per_page=per_page, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + payment_method: str | Unset = UNSET, + date_payment_from: datetime.datetime | Unset = UNSET, + date_payment_to: datetime.datetime | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | PaymentPaginatedListResponse]: + """List all Payments + + Get a list of all Payments + + 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: 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 | PaymentPaginatedListResponse] + """ + + kwargs = _get_kwargs( + payment_method=payment_method, + date_payment_from=date_payment_from, + date_payment_to=date_payment_to, + 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, + payment_method: str | Unset = UNSET, + date_payment_from: datetime.datetime | Unset = UNSET, + date_payment_to: datetime.datetime | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | PaymentPaginatedListResponse | None: + """List all Payments + + Get a list of all Payments + + 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: 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 | PaymentPaginatedListResponse + """ + + return ( + await asyncio_detailed( + client=client, + payment_method=payment_method, + date_payment_from=date_payment_from, + date_payment_to=date_payment_to, + page=page, + per_page=per_page, + ) + ).parsed 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 new file mode 100644 index 0000000..d6b4178 --- /dev/null +++ b/src/shellrent_sdk/client/api/payment/list_prepaid_credit_operations.py @@ -0,0 +1,248 @@ +import datetime +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.prepaid_credit_operation_paginated_list_response import ( + PrepaidCreditOperationPaginatedListResponse, +) +from ...types import UNSET, Response, Unset + + +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 = 20, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + json_date_created_from: str | Unset = UNSET + if not isinstance(date_created_from, Unset): + json_date_created_from = date_created_from.isoformat() + params["date_created_from"] = json_date_created_from + + json_date_created_to: str | Unset = UNSET + if not isinstance(date_created_to, Unset): + json_date_created_to = date_created_to.isoformat() + params["date_created_to"] = json_date_created_to + + 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/prepaid-credit/operations", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | PrepaidCreditOperationPaginatedListResponse | None: + if response.status_code == 200: + response_200 = PrepaidCreditOperationPaginatedListResponse.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 | PrepaidCreditOperationPaginatedListResponse]: + 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, + date_created_from: datetime.datetime | Unset = UNSET, + date_created_to: datetime.datetime | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | PrepaidCreditOperationPaginatedListResponse]: + """List all Prepaid credit operations + + Get a list of all Prepaid credit operations + + Args: + date_created_from (datetime.datetime | Unset): + date_created_to (datetime.datetime | Unset): + 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. + + Returns: + Response[ApiError | PrepaidCreditOperationPaginatedListResponse] + """ + + kwargs = _get_kwargs( + date_created_from=date_created_from, + date_created_to=date_created_to, + page=page, + per_page=per_page, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + date_created_from: datetime.datetime | Unset = UNSET, + date_created_to: datetime.datetime | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | PrepaidCreditOperationPaginatedListResponse | None: + """List all Prepaid credit operations + + Get a list of all Prepaid credit operations + + Args: + date_created_from (datetime.datetime | Unset): + date_created_to (datetime.datetime | Unset): + 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. + + Returns: + ApiError | PrepaidCreditOperationPaginatedListResponse + """ + + return sync_detailed( + client=client, + date_created_from=date_created_from, + date_created_to=date_created_to, + page=page, + per_page=per_page, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + date_created_from: datetime.datetime | Unset = UNSET, + date_created_to: datetime.datetime | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | PrepaidCreditOperationPaginatedListResponse]: + """List all Prepaid credit operations + + Get a list of all Prepaid credit operations + + Args: + date_created_from (datetime.datetime | Unset): + date_created_to (datetime.datetime | Unset): + 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. + + Returns: + Response[ApiError | PrepaidCreditOperationPaginatedListResponse] + """ + + kwargs = _get_kwargs( + date_created_from=date_created_from, + date_created_to=date_created_to, + 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, + date_created_from: datetime.datetime | Unset = UNSET, + date_created_to: datetime.datetime | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | PrepaidCreditOperationPaginatedListResponse | None: + """List all Prepaid credit operations + + Get a list of all Prepaid credit operations + + Args: + date_created_from (datetime.datetime | Unset): + date_created_to (datetime.datetime | Unset): + 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. + + Returns: + ApiError | PrepaidCreditOperationPaginatedListResponse + """ + + return ( + await asyncio_detailed( + client=client, + date_created_from=date_created_from, + date_created_to=date_created_to, + page=page, + per_page=per_page, + ) + ).parsed 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 new file mode 100644 index 0000000..9042c48 --- /dev/null +++ b/src/shellrent_sdk/client/api/payment/list_prepaid_credit_topups.py @@ -0,0 +1,308 @@ +import datetime +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.prepaid_credit_topup_paginated_list_response import ( + PrepaidCreditTopupPaginatedListResponse, +) +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + invoice_id: int | Unset = UNSET, + with_current_credit: bool | Unset = UNSET, + refund_expired: bool | Unset = UNSET, + credit_expired: bool | Unset = UNSET, + date_created_from: datetime.datetime | Unset = UNSET, + date_created_to: datetime.datetime | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["invoice_id"] = invoice_id + + params["with_current_credit"] = with_current_credit + + params["refund_expired"] = refund_expired + + params["credit_expired"] = credit_expired + + json_date_created_from: str | Unset = UNSET + if not isinstance(date_created_from, Unset): + json_date_created_from = date_created_from.isoformat() + params["date_created_from"] = json_date_created_from + + json_date_created_to: str | Unset = UNSET + if not isinstance(date_created_to, Unset): + json_date_created_to = date_created_to.isoformat() + params["date_created_to"] = json_date_created_to + + 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/prepaid-credit/topups", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | PrepaidCreditTopupPaginatedListResponse | None: + if response.status_code == 200: + response_200 = PrepaidCreditTopupPaginatedListResponse.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 | PrepaidCreditTopupPaginatedListResponse]: + 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, + invoice_id: int | Unset = UNSET, + with_current_credit: bool | Unset = UNSET, + refund_expired: bool | Unset = UNSET, + credit_expired: bool | Unset = UNSET, + date_created_from: datetime.datetime | Unset = UNSET, + date_created_to: datetime.datetime | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | PrepaidCreditTopupPaginatedListResponse]: + """List all topups + + Get a list of all Prepaid credit topups + + Args: + invoice_id (int | Unset): + with_current_credit (bool | Unset): + refund_expired (bool | Unset): + credit_expired (bool | Unset): + date_created_from (datetime.datetime | Unset): + date_created_to (datetime.datetime | Unset): + 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. + + Returns: + Response[ApiError | PrepaidCreditTopupPaginatedListResponse] + """ + + kwargs = _get_kwargs( + invoice_id=invoice_id, + with_current_credit=with_current_credit, + refund_expired=refund_expired, + credit_expired=credit_expired, + date_created_from=date_created_from, + date_created_to=date_created_to, + page=page, + per_page=per_page, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + invoice_id: int | Unset = UNSET, + with_current_credit: bool | Unset = UNSET, + refund_expired: bool | Unset = UNSET, + credit_expired: bool | Unset = UNSET, + date_created_from: datetime.datetime | Unset = UNSET, + date_created_to: datetime.datetime | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | PrepaidCreditTopupPaginatedListResponse | None: + """List all topups + + Get a list of all Prepaid credit topups + + Args: + invoice_id (int | Unset): + with_current_credit (bool | Unset): + refund_expired (bool | Unset): + credit_expired (bool | Unset): + date_created_from (datetime.datetime | Unset): + date_created_to (datetime.datetime | Unset): + 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. + + Returns: + ApiError | PrepaidCreditTopupPaginatedListResponse + """ + + return sync_detailed( + client=client, + invoice_id=invoice_id, + with_current_credit=with_current_credit, + refund_expired=refund_expired, + credit_expired=credit_expired, + date_created_from=date_created_from, + date_created_to=date_created_to, + page=page, + per_page=per_page, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + invoice_id: int | Unset = UNSET, + with_current_credit: bool | Unset = UNSET, + refund_expired: bool | Unset = UNSET, + credit_expired: bool | Unset = UNSET, + date_created_from: datetime.datetime | Unset = UNSET, + date_created_to: datetime.datetime | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | PrepaidCreditTopupPaginatedListResponse]: + """List all topups + + Get a list of all Prepaid credit topups + + Args: + invoice_id (int | Unset): + with_current_credit (bool | Unset): + refund_expired (bool | Unset): + credit_expired (bool | Unset): + date_created_from (datetime.datetime | Unset): + date_created_to (datetime.datetime | Unset): + 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. + + Returns: + Response[ApiError | PrepaidCreditTopupPaginatedListResponse] + """ + + kwargs = _get_kwargs( + invoice_id=invoice_id, + with_current_credit=with_current_credit, + refund_expired=refund_expired, + credit_expired=credit_expired, + date_created_from=date_created_from, + date_created_to=date_created_to, + 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, + invoice_id: int | Unset = UNSET, + with_current_credit: bool | Unset = UNSET, + refund_expired: bool | Unset = UNSET, + credit_expired: bool | Unset = UNSET, + date_created_from: datetime.datetime | Unset = UNSET, + date_created_to: datetime.datetime | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | PrepaidCreditTopupPaginatedListResponse | None: + """List all topups + + Get a list of all Prepaid credit topups + + Args: + invoice_id (int | Unset): + with_current_credit (bool | Unset): + refund_expired (bool | Unset): + credit_expired (bool | Unset): + date_created_from (datetime.datetime | Unset): + date_created_to (datetime.datetime | Unset): + 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. + + Returns: + ApiError | PrepaidCreditTopupPaginatedListResponse + """ + + return ( + await asyncio_detailed( + client=client, + invoice_id=invoice_id, + with_current_credit=with_current_credit, + refund_expired=refund_expired, + credit_expired=credit_expired, + date_created_from=date_created_from, + date_created_to=date_created_to, + page=page, + per_page=per_page, + ) + ).parsed 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 new file mode 100644 index 0000000..0b830d1 --- /dev/null +++ b/src/shellrent_sdk/client/api/payment/revoke_one_click_autorenew.py @@ -0,0 +1,162 @@ +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.empty_response import EmptyResponse +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/api/v3/one-clicks/autorenew", + } + + return _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 + + 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 | EmptyResponse]: + 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, +) -> Response[ApiError | EmptyResponse]: + """Revoke One-Click autorenew + + Revoke automatic renewal service with One-Click Payment + + 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] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Revoke One-Click autorenew + + Revoke automatic renewal service with One-Click Payment + + 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 + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Revoke One-Click autorenew + + Revoke automatic renewal service with One-Click Payment + + 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] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Revoke One-Click autorenew + + Revoke automatic renewal service with One-Click Payment + + 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 + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..ae9e26d --- /dev/null +++ b/src/shellrent_sdk/client/api/payment/revoke_prepaid_credit_autorenew.py @@ -0,0 +1,162 @@ +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.prepaid_credit_response import PrepaidCreditResponse +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/api/v3/prepaid-credit/autorenew", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | PrepaidCreditResponse | None: + if response.status_code == 200: + response_200 = PrepaidCreditResponse.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 | PrepaidCreditResponse]: + 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, +) -> Response[ApiError | PrepaidCreditResponse]: + """Revoke Prepaid credit autorenew + + Revoke automatic renewal service with 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[ApiError | PrepaidCreditResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> ApiError | PrepaidCreditResponse | None: + """Revoke Prepaid credit autorenew + + Revoke automatic renewal service with 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: + ApiError | PrepaidCreditResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[ApiError | PrepaidCreditResponse]: + """Revoke Prepaid credit autorenew + + Revoke automatic renewal service with 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[ApiError | PrepaidCreditResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> ApiError | PrepaidCreditResponse | None: + """Revoke Prepaid credit autorenew + + Revoke automatic renewal service with 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: + ApiError | PrepaidCreditResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/pec/__init__.py b/src/shellrent_sdk/client/api/pec/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/src/shellrent_sdk/client/api/pec/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" 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 new file mode 100644 index 0000000..1c9aca3 --- /dev/null +++ b/src/shellrent_sdk/client/api/pec/create_pec_domain_owner_change.py @@ -0,0 +1,210 @@ +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.pec_mailbox_owner_change_create_request import PecMailboxOwnerChangeCreateRequest +from ...models.pec_owner_change_response import PecOwnerChangeResponse +from ...types import Response + + +def _get_kwargs( + pec_domain_id: int, + *, + body: PecMailboxOwnerChangeCreateRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/pec-domains/{pec_domain_id}/owner-changes".format( + pec_domain_id=quote(str(pec_domain_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 | PecOwnerChangeResponse | None: + if response.status_code == 200: + response_200 = PecOwnerChangeResponse.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 | PecOwnerChangeResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + pec_domain_id: int, + *, + client: AuthenticatedClient, + body: PecMailboxOwnerChangeCreateRequest, +) -> Response[ApiError | PecOwnerChangeResponse]: + """Create PEC domain owner change + + Create a new owner change request for a PEC domain + + Args: + pec_domain_id (int): + body (PecMailboxOwnerChangeCreateRequest): + + 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 | PecOwnerChangeResponse] + """ + + kwargs = _get_kwargs( + pec_domain_id=pec_domain_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + pec_domain_id: int, + *, + client: AuthenticatedClient, + body: PecMailboxOwnerChangeCreateRequest, +) -> ApiError | PecOwnerChangeResponse | None: + """Create PEC domain owner change + + Create a new owner change request for a PEC domain + + Args: + pec_domain_id (int): + body (PecMailboxOwnerChangeCreateRequest): + + 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 | PecOwnerChangeResponse + """ + + return sync_detailed( + pec_domain_id=pec_domain_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + pec_domain_id: int, + *, + client: AuthenticatedClient, + body: PecMailboxOwnerChangeCreateRequest, +) -> Response[ApiError | PecOwnerChangeResponse]: + """Create PEC domain owner change + + Create a new owner change request for a PEC domain + + Args: + pec_domain_id (int): + body (PecMailboxOwnerChangeCreateRequest): + + 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 | PecOwnerChangeResponse] + """ + + kwargs = _get_kwargs( + pec_domain_id=pec_domain_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + pec_domain_id: int, + *, + client: AuthenticatedClient, + body: PecMailboxOwnerChangeCreateRequest, +) -> ApiError | PecOwnerChangeResponse | None: + """Create PEC domain owner change + + Create a new owner change request for a PEC domain + + Args: + pec_domain_id (int): + body (PecMailboxOwnerChangeCreateRequest): + + 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 | PecOwnerChangeResponse + """ + + return ( + await asyncio_detailed( + pec_domain_id=pec_domain_id, + client=client, + body=body, + ) + ).parsed 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 new file mode 100644 index 0000000..145d33c --- /dev/null +++ b/src/shellrent_sdk/client/api/pec/create_pec_mailbox_owner_change.py @@ -0,0 +1,210 @@ +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.pec_mailbox_owner_change_create_request import PecMailboxOwnerChangeCreateRequest +from ...models.pec_owner_change_response import PecOwnerChangeResponse +from ...types import Response + + +def _get_kwargs( + pec_id: int, + *, + body: PecMailboxOwnerChangeCreateRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/pec-mailboxes/{pec_id}/owner-changes".format( + pec_id=quote(str(pec_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 | PecOwnerChangeResponse | None: + if response.status_code == 200: + response_200 = PecOwnerChangeResponse.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 | PecOwnerChangeResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + pec_id: int, + *, + client: AuthenticatedClient, + body: PecMailboxOwnerChangeCreateRequest, +) -> Response[ApiError | PecOwnerChangeResponse]: + """Create PEC mailbox owner change + + Create a new owner change request for a PEC mailbox + + Args: + pec_id (int): + body (PecMailboxOwnerChangeCreateRequest): + + 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 | PecOwnerChangeResponse] + """ + + kwargs = _get_kwargs( + pec_id=pec_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + pec_id: int, + *, + client: AuthenticatedClient, + body: PecMailboxOwnerChangeCreateRequest, +) -> ApiError | PecOwnerChangeResponse | None: + """Create PEC mailbox owner change + + Create a new owner change request for a PEC mailbox + + Args: + pec_id (int): + body (PecMailboxOwnerChangeCreateRequest): + + 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 | PecOwnerChangeResponse + """ + + return sync_detailed( + pec_id=pec_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + pec_id: int, + *, + client: AuthenticatedClient, + body: PecMailboxOwnerChangeCreateRequest, +) -> Response[ApiError | PecOwnerChangeResponse]: + """Create PEC mailbox owner change + + Create a new owner change request for a PEC mailbox + + Args: + pec_id (int): + body (PecMailboxOwnerChangeCreateRequest): + + 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 | PecOwnerChangeResponse] + """ + + kwargs = _get_kwargs( + pec_id=pec_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + pec_id: int, + *, + client: AuthenticatedClient, + body: PecMailboxOwnerChangeCreateRequest, +) -> ApiError | PecOwnerChangeResponse | None: + """Create PEC mailbox owner change + + Create a new owner change request for a PEC mailbox + + Args: + pec_id (int): + body (PecMailboxOwnerChangeCreateRequest): + + 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 | PecOwnerChangeResponse + """ + + return ( + await asyncio_detailed( + pec_id=pec_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/pec/get_pec_domain.py b/src/shellrent_sdk/client/api/pec/get_pec_domain.py new file mode 100644 index 0000000..3ddfd67 --- /dev/null +++ b/src/shellrent_sdk/client/api/pec/get_pec_domain.py @@ -0,0 +1,189 @@ +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.pec_domain_response import PecDomainResponse +from ...types import Response + + +def _get_kwargs( + pec_domain_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/pec-domains/{pec_domain_id}".format( + pec_domain_id=quote(str(pec_domain_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | PecDomainResponse | None: + if response.status_code == 200: + response_200 = PecDomainResponse.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 | PecDomainResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + pec_domain_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | PecDomainResponse]: + """Get PEC domain + + Get details of a PEC domain for the authenticated account + + Args: + pec_domain_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 | PecDomainResponse] + """ + + kwargs = _get_kwargs( + pec_domain_id=pec_domain_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + pec_domain_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | PecDomainResponse | None: + """Get PEC domain + + Get details of a PEC domain for the authenticated account + + Args: + pec_domain_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 | PecDomainResponse + """ + + return sync_detailed( + pec_domain_id=pec_domain_id, + client=client, + ).parsed + + +async def asyncio_detailed( + pec_domain_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | PecDomainResponse]: + """Get PEC domain + + Get details of a PEC domain for the authenticated account + + Args: + pec_domain_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 | PecDomainResponse] + """ + + kwargs = _get_kwargs( + pec_domain_id=pec_domain_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + pec_domain_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | PecDomainResponse | None: + """Get PEC domain + + Get details of a PEC domain for the authenticated account + + Args: + pec_domain_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 | PecDomainResponse + """ + + return ( + await asyncio_detailed( + pec_domain_id=pec_domain_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..795d64f --- /dev/null +++ b/src/shellrent_sdk/client/api/pec/get_pec_domain_owner_change.py @@ -0,0 +1,203 @@ +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.pec_owner_change_response import PecOwnerChangeResponse +from ...types import Response + + +def _get_kwargs( + pec_domain_id: int, + owner_change_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/pec-domains/{pec_domain_id}/owner-changes/{owner_change_id}".format( + pec_domain_id=quote(str(pec_domain_id), safe=""), + owner_change_id=quote(str(owner_change_id), safe=""), + ), + } + + return _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()) + + 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 | PecOwnerChangeResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + pec_domain_id: int, + owner_change_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | PecOwnerChangeResponse]: + """Get PEC domain owner change + + Get details of a specific owner change request for a PEC domain + + Args: + pec_domain_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 | PecOwnerChangeResponse] + """ + + kwargs = _get_kwargs( + pec_domain_id=pec_domain_id, + owner_change_id=owner_change_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + pec_domain_id: int, + owner_change_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | PecOwnerChangeResponse | None: + """Get PEC domain owner change + + Get details of a specific owner change request for a PEC domain + + Args: + pec_domain_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 | PecOwnerChangeResponse + """ + + return sync_detailed( + pec_domain_id=pec_domain_id, + owner_change_id=owner_change_id, + client=client, + ).parsed + + +async def asyncio_detailed( + pec_domain_id: int, + owner_change_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | PecOwnerChangeResponse]: + """Get PEC domain owner change + + Get details of a specific owner change request for a PEC domain + + Args: + pec_domain_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 | PecOwnerChangeResponse] + """ + + kwargs = _get_kwargs( + pec_domain_id=pec_domain_id, + owner_change_id=owner_change_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + pec_domain_id: int, + owner_change_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | PecOwnerChangeResponse | None: + """Get PEC domain owner change + + Get details of a specific owner change request for a PEC domain + + Args: + pec_domain_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 | PecOwnerChangeResponse + """ + + return ( + await asyncio_detailed( + pec_domain_id=pec_domain_id, + owner_change_id=owner_change_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/pec/get_pec_mailbox.py b/src/shellrent_sdk/client/api/pec/get_pec_mailbox.py new file mode 100644 index 0000000..abdf44f --- /dev/null +++ b/src/shellrent_sdk/client/api/pec/get_pec_mailbox.py @@ -0,0 +1,189 @@ +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.pec_response import PecResponse +from ...types import Response + + +def _get_kwargs( + pec_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/pec-mailboxes/{pec_id}".format( + pec_id=quote(str(pec_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | PecResponse | None: + if response.status_code == 200: + response_200 = PecResponse.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 | PecResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + pec_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | PecResponse]: + """Get PEC mailbox + + Get details of a PEC mailbox for the authenticated account + + Args: + pec_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 | PecResponse] + """ + + kwargs = _get_kwargs( + pec_id=pec_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + pec_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | PecResponse | None: + """Get PEC mailbox + + Get details of a PEC mailbox for the authenticated account + + Args: + pec_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 | PecResponse + """ + + return sync_detailed( + pec_id=pec_id, + client=client, + ).parsed + + +async def asyncio_detailed( + pec_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | PecResponse]: + """Get PEC mailbox + + Get details of a PEC mailbox for the authenticated account + + Args: + pec_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 | PecResponse] + """ + + kwargs = _get_kwargs( + pec_id=pec_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + pec_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | PecResponse | None: + """Get PEC mailbox + + Get details of a PEC mailbox for the authenticated account + + Args: + pec_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 | PecResponse + """ + + return ( + await asyncio_detailed( + pec_id=pec_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 new file mode 100644 index 0000000..1b7235e --- /dev/null +++ b/src/shellrent_sdk/client/api/pec/list_pec_domain_owner_changes.py @@ -0,0 +1,225 @@ +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.pec_owner_change_paginated_list_response import PecOwnerChangePaginatedListResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + pec_domain_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/pec-domains/{pec_domain_id}/owner-changes".format( + pec_domain_id=quote(str(pec_domain_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | PecOwnerChangePaginatedListResponse | None: + if response.status_code == 200: + response_200 = PecOwnerChangePaginatedListResponse.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 | PecOwnerChangePaginatedListResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + pec_domain_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | PecOwnerChangePaginatedListResponse]: + """List PEC domain owner changes + + Get a paginated list of owner change requests for a PEC domain + + Args: + pec_domain_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ApiError | PecOwnerChangePaginatedListResponse] + """ + + kwargs = _get_kwargs( + pec_domain_id=pec_domain_id, + page=page, + per_page=per_page, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + pec_domain_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | PecOwnerChangePaginatedListResponse | None: + """List PEC domain owner changes + + Get a paginated list of owner change requests for a PEC domain + + Args: + pec_domain_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ApiError | PecOwnerChangePaginatedListResponse + """ + + return sync_detailed( + pec_domain_id=pec_domain_id, + client=client, + page=page, + per_page=per_page, + ).parsed + + +async def asyncio_detailed( + pec_domain_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | PecOwnerChangePaginatedListResponse]: + """List PEC domain owner changes + + Get a paginated list of owner change requests for a PEC domain + + Args: + pec_domain_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ApiError | PecOwnerChangePaginatedListResponse] + """ + + kwargs = _get_kwargs( + pec_domain_id=pec_domain_id, + 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( + pec_domain_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | PecOwnerChangePaginatedListResponse | None: + """List PEC domain owner changes + + Get a paginated list of owner change requests for a PEC domain + + Args: + pec_domain_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ApiError | PecOwnerChangePaginatedListResponse + """ + + return ( + await asyncio_detailed( + pec_domain_id=pec_domain_id, + client=client, + page=page, + per_page=per_page, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/pec/list_pec_domains.py b/src/shellrent_sdk/client/api/pec/list_pec_domains.py new file mode 100644 index 0000000..e59c1b7 --- /dev/null +++ b/src/shellrent_sdk/client/api/pec/list_pec_domains.py @@ -0,0 +1,209 @@ +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.pec_domain_paginated_list_response import PecDomainPaginatedListResponse +from ...types import UNSET, Response, Unset + + +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/pec-domains", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | PecDomainPaginatedListResponse | None: + if response.status_code == 200: + response_200 = PecDomainPaginatedListResponse.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 | PecDomainPaginatedListResponse]: + 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 = 20, +) -> Response[ApiError | PecDomainPaginatedListResponse]: + """List PEC domains + + Get a paginated list of PEC domains for the authenticated account + + 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. + + Returns: + Response[ApiError | PecDomainPaginatedListResponse] + """ + + 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 = 20, +) -> ApiError | PecDomainPaginatedListResponse | None: + """List PEC domains + + Get a paginated list of PEC domains for the authenticated account + + 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. + + Returns: + ApiError | PecDomainPaginatedListResponse + """ + + 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 | PecDomainPaginatedListResponse]: + """List PEC domains + + Get a paginated list of PEC domains for the authenticated account + + 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. + + Returns: + Response[ApiError | PecDomainPaginatedListResponse] + """ + + 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 = 20, +) -> ApiError | PecDomainPaginatedListResponse | None: + """List PEC domains + + Get a paginated list of PEC domains for the authenticated account + + 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. + + Returns: + ApiError | PecDomainPaginatedListResponse + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + per_page=per_page, + ) + ).parsed 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 new file mode 100644 index 0000000..69f9ed3 --- /dev/null +++ b/src/shellrent_sdk/client/api/pec/list_pec_mailbox_owner_changes.py @@ -0,0 +1,225 @@ +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.pec_owner_change_paginated_list_response import PecOwnerChangePaginatedListResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + pec_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/pec-mailboxes/{pec_id}/owner-changes".format( + pec_id=quote(str(pec_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | PecOwnerChangePaginatedListResponse | None: + if response.status_code == 200: + response_200 = PecOwnerChangePaginatedListResponse.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 | PecOwnerChangePaginatedListResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + pec_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | PecOwnerChangePaginatedListResponse]: + """List PEC mailbox owner changes + + Get a paginated list of owner change requests for a PEC mailbox + + Args: + pec_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ApiError | PecOwnerChangePaginatedListResponse] + """ + + kwargs = _get_kwargs( + pec_id=pec_id, + page=page, + per_page=per_page, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + pec_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | PecOwnerChangePaginatedListResponse | None: + """List PEC mailbox owner changes + + Get a paginated list of owner change requests for a PEC mailbox + + Args: + pec_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ApiError | PecOwnerChangePaginatedListResponse + """ + + return sync_detailed( + pec_id=pec_id, + client=client, + page=page, + per_page=per_page, + ).parsed + + +async def asyncio_detailed( + pec_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | PecOwnerChangePaginatedListResponse]: + """List PEC mailbox owner changes + + Get a paginated list of owner change requests for a PEC mailbox + + Args: + pec_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ApiError | PecOwnerChangePaginatedListResponse] + """ + + kwargs = _get_kwargs( + pec_id=pec_id, + 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( + pec_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | PecOwnerChangePaginatedListResponse | None: + """List PEC mailbox owner changes + + Get a paginated list of owner change requests for a PEC mailbox + + Args: + pec_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ApiError | PecOwnerChangePaginatedListResponse + """ + + return ( + await asyncio_detailed( + pec_id=pec_id, + client=client, + page=page, + per_page=per_page, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/pec/list_pec_mailboxes.py b/src/shellrent_sdk/client/api/pec/list_pec_mailboxes.py new file mode 100644 index 0000000..bd3c9f4 --- /dev/null +++ b/src/shellrent_sdk/client/api/pec/list_pec_mailboxes.py @@ -0,0 +1,209 @@ +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.pec_paginated_list_response import PecPaginatedListResponse +from ...types import UNSET, Response, Unset + + +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/pec-mailboxes", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | PecPaginatedListResponse | None: + if response.status_code == 200: + response_200 = PecPaginatedListResponse.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 | PecPaginatedListResponse]: + 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 = 20, +) -> Response[ApiError | PecPaginatedListResponse]: + """List PEC mailboxes + + Get a paginated list of PEC mailboxes for the authenticated account + + 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. + + Returns: + Response[ApiError | PecPaginatedListResponse] + """ + + 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 = 20, +) -> ApiError | PecPaginatedListResponse | None: + """List PEC mailboxes + + Get a paginated list of PEC mailboxes for the authenticated account + + 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. + + Returns: + ApiError | PecPaginatedListResponse + """ + + 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 | PecPaginatedListResponse]: + """List PEC mailboxes + + Get a paginated list of PEC mailboxes for the authenticated account + + 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. + + Returns: + Response[ApiError | PecPaginatedListResponse] + """ + + 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 = 20, +) -> ApiError | PecPaginatedListResponse | None: + """List PEC mailboxes + + Get a paginated list of PEC mailboxes for the authenticated account + + 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. + + Returns: + ApiError | PecPaginatedListResponse + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + per_page=per_page, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/pec/update_pec_mailbox.py b/src/shellrent_sdk/client/api/pec/update_pec_mailbox.py new file mode 100644 index 0000000..9b87ba8 --- /dev/null +++ b/src/shellrent_sdk/client/api/pec/update_pec_mailbox.py @@ -0,0 +1,210 @@ +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.pec_mailbox_update_request import PecMailboxUpdateRequest +from ...models.pec_response import PecResponse +from ...types import Response + + +def _get_kwargs( + pec_id: int, + *, + body: PecMailboxUpdateRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/api/v3/pec-mailboxes/{pec_id}".format( + pec_id=quote(str(pec_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 | PecResponse | None: + if response.status_code == 200: + response_200 = PecResponse.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 | PecResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + pec_id: int, + *, + client: AuthenticatedClient, + body: PecMailboxUpdateRequest, +) -> Response[ApiError | PecResponse]: + """Update PEC mailbox + + Update PEC mailbox settings for the authenticated account + + Args: + pec_id (int): + body (PecMailboxUpdateRequest): + + 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 | PecResponse] + """ + + kwargs = _get_kwargs( + pec_id=pec_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + pec_id: int, + *, + client: AuthenticatedClient, + body: PecMailboxUpdateRequest, +) -> ApiError | PecResponse | None: + """Update PEC mailbox + + Update PEC mailbox settings for the authenticated account + + Args: + pec_id (int): + body (PecMailboxUpdateRequest): + + 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 | PecResponse + """ + + return sync_detailed( + pec_id=pec_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + pec_id: int, + *, + client: AuthenticatedClient, + body: PecMailboxUpdateRequest, +) -> Response[ApiError | PecResponse]: + """Update PEC mailbox + + Update PEC mailbox settings for the authenticated account + + Args: + pec_id (int): + body (PecMailboxUpdateRequest): + + 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 | PecResponse] + """ + + kwargs = _get_kwargs( + pec_id=pec_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + pec_id: int, + *, + client: AuthenticatedClient, + body: PecMailboxUpdateRequest, +) -> ApiError | PecResponse | None: + """Update PEC mailbox + + Update PEC mailbox settings for the authenticated account + + Args: + pec_id (int): + body (PecMailboxUpdateRequest): + + 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 | PecResponse + """ + + return ( + await asyncio_detailed( + pec_id=pec_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/purchases/__init__.py b/src/shellrent_sdk/client/api/purchases/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/src/shellrent_sdk/client/api/purchases/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" 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 new file mode 100644 index 0000000..b046e95 --- /dev/null +++ b/src/shellrent_sdk/client/api/purchases/can_add_purchase_additional.py @@ -0,0 +1,189 @@ +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.purchase_can_add_additional_response import PurchaseCanAddAdditionalResponse +from ...types import Response + + +def _get_kwargs( + purchase_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/purchases/{purchase_id}/can-add-additional".format( + purchase_id=quote(str(purchase_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | PurchaseCanAddAdditionalResponse | None: + if response.status_code == 200: + response_200 = PurchaseCanAddAdditionalResponse.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 | PurchaseCanAddAdditionalResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + purchase_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | PurchaseCanAddAdditionalResponse]: + """Can add additional purchase + + Know if it's possible to buy an additional purchase for the purchase. + + Args: + purchase_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 | PurchaseCanAddAdditionalResponse] + """ + + kwargs = _get_kwargs( + purchase_id=purchase_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + purchase_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | PurchaseCanAddAdditionalResponse | None: + """Can add additional purchase + + Know if it's possible to buy an additional purchase for the purchase. + + Args: + purchase_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 | PurchaseCanAddAdditionalResponse + """ + + return sync_detailed( + purchase_id=purchase_id, + client=client, + ).parsed + + +async def asyncio_detailed( + purchase_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | PurchaseCanAddAdditionalResponse]: + """Can add additional purchase + + Know if it's possible to buy an additional purchase for the purchase. + + Args: + purchase_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 | PurchaseCanAddAdditionalResponse] + """ + + kwargs = _get_kwargs( + purchase_id=purchase_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + purchase_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | PurchaseCanAddAdditionalResponse | None: + """Can add additional purchase + + Know if it's possible to buy an additional purchase for the purchase. + + Args: + purchase_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 | PurchaseCanAddAdditionalResponse + """ + + return ( + await asyncio_detailed( + purchase_id=purchase_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/purchases/can_cancel_purchase.py b/src/shellrent_sdk/client/api/purchases/can_cancel_purchase.py new file mode 100644 index 0000000..b68dcf1 --- /dev/null +++ b/src/shellrent_sdk/client/api/purchases/can_cancel_purchase.py @@ -0,0 +1,189 @@ +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.purchase_can_cancel_response import PurchaseCanCancelResponse +from ...types import Response + + +def _get_kwargs( + purchase_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/purchases/{purchase_id}/can-cancel".format( + purchase_id=quote(str(purchase_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | PurchaseCanCancelResponse | None: + if response.status_code == 200: + response_200 = PurchaseCanCancelResponse.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 | PurchaseCanCancelResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + purchase_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | PurchaseCanCancelResponse]: + """Can cancel + + Know if it's possible to cancel a purchase + + Args: + purchase_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 | PurchaseCanCancelResponse] + """ + + kwargs = _get_kwargs( + purchase_id=purchase_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + purchase_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | PurchaseCanCancelResponse | None: + """Can cancel + + Know if it's possible to cancel a purchase + + Args: + purchase_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 | PurchaseCanCancelResponse + """ + + return sync_detailed( + purchase_id=purchase_id, + client=client, + ).parsed + + +async def asyncio_detailed( + purchase_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | PurchaseCanCancelResponse]: + """Can cancel + + Know if it's possible to cancel a purchase + + Args: + purchase_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 | PurchaseCanCancelResponse] + """ + + kwargs = _get_kwargs( + purchase_id=purchase_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + purchase_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | PurchaseCanCancelResponse | None: + """Can cancel + + Know if it's possible to cancel a purchase + + Args: + purchase_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 | PurchaseCanCancelResponse + """ + + return ( + await asyncio_detailed( + purchase_id=purchase_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..4274dd1 --- /dev/null +++ b/src/shellrent_sdk/client/api/purchases/can_change_purchase_recurrence.py @@ -0,0 +1,203 @@ +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.purchase_can_change_recurrence_response import PurchaseCanChangeRecurrenceResponse +from ...types import Response + + +def _get_kwargs( + purchase_id: int, + recurrence_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/purchases/{purchase_id}/can-change-recurrence/{recurrence_id}".format( + purchase_id=quote(str(purchase_id), safe=""), + recurrence_id=quote(str(recurrence_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | PurchaseCanChangeRecurrenceResponse | None: + if response.status_code == 200: + response_200 = PurchaseCanChangeRecurrenceResponse.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 | PurchaseCanChangeRecurrenceResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + purchase_id: int, + recurrence_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | PurchaseCanChangeRecurrenceResponse]: + """Can change recurrence + + Know if it's possible to change the recurrence on purchase + + Args: + purchase_id (int): + recurrence_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 | PurchaseCanChangeRecurrenceResponse] + """ + + kwargs = _get_kwargs( + purchase_id=purchase_id, + recurrence_id=recurrence_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + purchase_id: int, + recurrence_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | PurchaseCanChangeRecurrenceResponse | None: + """Can change recurrence + + Know if it's possible to change the recurrence on purchase + + Args: + purchase_id (int): + recurrence_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 | PurchaseCanChangeRecurrenceResponse + """ + + return sync_detailed( + purchase_id=purchase_id, + recurrence_id=recurrence_id, + client=client, + ).parsed + + +async def asyncio_detailed( + purchase_id: int, + recurrence_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | PurchaseCanChangeRecurrenceResponse]: + """Can change recurrence + + Know if it's possible to change the recurrence on purchase + + Args: + purchase_id (int): + recurrence_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 | PurchaseCanChangeRecurrenceResponse] + """ + + kwargs = _get_kwargs( + purchase_id=purchase_id, + recurrence_id=recurrence_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + purchase_id: int, + recurrence_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | PurchaseCanChangeRecurrenceResponse | None: + """Can change recurrence + + Know if it's possible to change the recurrence on purchase + + Args: + purchase_id (int): + recurrence_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 | PurchaseCanChangeRecurrenceResponse + """ + + return ( + await asyncio_detailed( + purchase_id=purchase_id, + recurrence_id=recurrence_id, + client=client, + ) + ).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 new file mode 100644 index 0000000..f42f516 --- /dev/null +++ b/src/shellrent_sdk/client/api/purchases/can_change_purchase_renew_status.py @@ -0,0 +1,203 @@ +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.purchase_can_change_renew_status_response import PurchaseCanChangeRenewStatusResponse +from ...types import Response + + +def _get_kwargs( + purchase_id: int, + status: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/purchases/{purchase_id}/can-change-renew-status/{status}".format( + purchase_id=quote(str(purchase_id), safe=""), + status=quote(str(status), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | PurchaseCanChangeRenewStatusResponse | None: + if response.status_code == 200: + response_200 = PurchaseCanChangeRenewStatusResponse.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 | PurchaseCanChangeRenewStatusResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + purchase_id: int, + status: str, + *, + client: AuthenticatedClient, +) -> Response[ApiError | PurchaseCanChangeRenewStatusResponse]: + """Can change "to renew" status + + Know if it's possible to change the status of "do_not_renew" on purchase + + Args: + purchase_id (int): + status (str): + + 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 | PurchaseCanChangeRenewStatusResponse] + """ + + kwargs = _get_kwargs( + purchase_id=purchase_id, + status=status, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + purchase_id: int, + status: str, + *, + client: AuthenticatedClient, +) -> ApiError | PurchaseCanChangeRenewStatusResponse | None: + """Can change "to renew" status + + Know if it's possible to change the status of "do_not_renew" on purchase + + Args: + purchase_id (int): + status (str): + + 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 | PurchaseCanChangeRenewStatusResponse + """ + + return sync_detailed( + purchase_id=purchase_id, + status=status, + client=client, + ).parsed + + +async def asyncio_detailed( + purchase_id: int, + status: str, + *, + client: AuthenticatedClient, +) -> Response[ApiError | PurchaseCanChangeRenewStatusResponse]: + """Can change "to renew" status + + Know if it's possible to change the status of "do_not_renew" on purchase + + Args: + purchase_id (int): + status (str): + + 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 | PurchaseCanChangeRenewStatusResponse] + """ + + kwargs = _get_kwargs( + purchase_id=purchase_id, + status=status, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + purchase_id: int, + status: str, + *, + client: AuthenticatedClient, +) -> ApiError | PurchaseCanChangeRenewStatusResponse | None: + """Can change "to renew" status + + Know if it's possible to change the status of "do_not_renew" on purchase + + Args: + purchase_id (int): + status (str): + + 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 | PurchaseCanChangeRenewStatusResponse + """ + + return ( + await asyncio_detailed( + purchase_id=purchase_id, + status=status, + client=client, + ) + ).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 new file mode 100644 index 0000000..2cc72d7 --- /dev/null +++ b/src/shellrent_sdk/client/api/purchases/can_change_purchase_service.py @@ -0,0 +1,193 @@ +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.purchase_can_change_service_response import PurchaseCanChangeServiceResponse +from ...types import Response + + +def _get_kwargs( + purchase_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/purchases/{purchase_id}/can-change-service".format( + purchase_id=quote(str(purchase_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | PurchaseCanChangeServiceResponse | None: + if response.status_code == 200: + response_200 = PurchaseCanChangeServiceResponse.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 | PurchaseCanChangeServiceResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + purchase_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | PurchaseCanChangeServiceResponse]: + """Can change Service + + 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. + + Args: + purchase_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 | PurchaseCanChangeServiceResponse] + """ + + kwargs = _get_kwargs( + purchase_id=purchase_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + purchase_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | PurchaseCanChangeServiceResponse | None: + """Can change Service + + 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. + + Args: + purchase_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 | PurchaseCanChangeServiceResponse + """ + + return sync_detailed( + purchase_id=purchase_id, + client=client, + ).parsed + + +async def asyncio_detailed( + purchase_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | PurchaseCanChangeServiceResponse]: + """Can change Service + + 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. + + Args: + purchase_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 | PurchaseCanChangeServiceResponse] + """ + + kwargs = _get_kwargs( + purchase_id=purchase_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + purchase_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | PurchaseCanChangeServiceResponse | None: + """Can change Service + + 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. + + Args: + purchase_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 | PurchaseCanChangeServiceResponse + """ + + return ( + await asyncio_detailed( + purchase_id=purchase_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/purchases/can_renew_purchase.py b/src/shellrent_sdk/client/api/purchases/can_renew_purchase.py new file mode 100644 index 0000000..9811b5b --- /dev/null +++ b/src/shellrent_sdk/client/api/purchases/can_renew_purchase.py @@ -0,0 +1,189 @@ +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.purchase_can_renew_response import PurchaseCanRenewResponse +from ...types import Response + + +def _get_kwargs( + purchase_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/purchases/{purchase_id}/can-renew".format( + purchase_id=quote(str(purchase_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | PurchaseCanRenewResponse | None: + if response.status_code == 200: + response_200 = PurchaseCanRenewResponse.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 | PurchaseCanRenewResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + purchase_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | PurchaseCanRenewResponse]: + """Can renew + + Know if it's possible to renew a purchase + + Args: + purchase_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 | PurchaseCanRenewResponse] + """ + + kwargs = _get_kwargs( + purchase_id=purchase_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + purchase_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | PurchaseCanRenewResponse | None: + """Can renew + + Know if it's possible to renew a purchase + + Args: + purchase_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 | PurchaseCanRenewResponse + """ + + return sync_detailed( + purchase_id=purchase_id, + client=client, + ).parsed + + +async def asyncio_detailed( + purchase_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | PurchaseCanRenewResponse]: + """Can renew + + Know if it's possible to renew a purchase + + Args: + purchase_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 | PurchaseCanRenewResponse] + """ + + kwargs = _get_kwargs( + purchase_id=purchase_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + purchase_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | PurchaseCanRenewResponse | None: + """Can renew + + Know if it's possible to renew a purchase + + Args: + purchase_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 | PurchaseCanRenewResponse + """ + + return ( + await asyncio_detailed( + purchase_id=purchase_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/purchases/cancel_purchase.py b/src/shellrent_sdk/client/api/purchases/cancel_purchase.py new file mode 100644 index 0000000..8299e9b --- /dev/null +++ b/src/shellrent_sdk/client/api/purchases/cancel_purchase.py @@ -0,0 +1,189 @@ +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.empty_response import EmptyResponse +from ...types import Response + + +def _get_kwargs( + purchase_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/api/v3/purchases/{purchase_id}/cancel".format( + purchase_id=quote(str(purchase_id), safe=""), + ), + } + + return _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 + + 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 | EmptyResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + purchase_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Cancel purchase + + Cancel a purchase (only on a "New" status purchase) + + Args: + purchase_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] + """ + + kwargs = _get_kwargs( + purchase_id=purchase_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + purchase_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Cancel purchase + + Cancel a purchase (only on a "New" status purchase) + + Args: + purchase_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 + """ + + return sync_detailed( + purchase_id=purchase_id, + client=client, + ).parsed + + +async def asyncio_detailed( + purchase_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Cancel purchase + + Cancel a purchase (only on a "New" status purchase) + + Args: + purchase_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] + """ + + kwargs = _get_kwargs( + purchase_id=purchase_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + purchase_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Cancel purchase + + Cancel a purchase (only on a "New" status purchase) + + Args: + purchase_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 + """ + + return ( + await asyncio_detailed( + purchase_id=purchase_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/purchases/change_purchase_recurrence.py b/src/shellrent_sdk/client/api/purchases/change_purchase_recurrence.py new file mode 100644 index 0000000..6e92b33 --- /dev/null +++ b/src/shellrent_sdk/client/api/purchases/change_purchase_recurrence.py @@ -0,0 +1,215 @@ +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.purchase_recurrence_change_request import PurchaseRecurrenceChangeRequest +from ...models.purchase_response import PurchaseResponse +from ...types import Response + + +def _get_kwargs( + purchase_id: int, + *, + body: PurchaseRecurrenceChangeRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/api/v3/purchases/{purchase_id}/recurrence".format( + purchase_id=quote(str(purchase_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 | PurchaseResponse | None: + if response.status_code == 200: + response_200 = PurchaseResponse.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 == 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 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 | PurchaseResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + purchase_id: int, + *, + client: AuthenticatedClient, + body: PurchaseRecurrenceChangeRequest, +) -> Response[ApiError | PurchaseResponse]: + """Change recurrence + + Change the recurrence on purchase + + Args: + purchase_id (int): + body (PurchaseRecurrenceChangeRequest): + + 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 | PurchaseResponse] + """ + + kwargs = _get_kwargs( + purchase_id=purchase_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + purchase_id: int, + *, + client: AuthenticatedClient, + body: PurchaseRecurrenceChangeRequest, +) -> ApiError | PurchaseResponse | None: + """Change recurrence + + Change the recurrence on purchase + + Args: + purchase_id (int): + body (PurchaseRecurrenceChangeRequest): + + 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 | PurchaseResponse + """ + + return sync_detailed( + purchase_id=purchase_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + purchase_id: int, + *, + client: AuthenticatedClient, + body: PurchaseRecurrenceChangeRequest, +) -> Response[ApiError | PurchaseResponse]: + """Change recurrence + + Change the recurrence on purchase + + Args: + purchase_id (int): + body (PurchaseRecurrenceChangeRequest): + + 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 | PurchaseResponse] + """ + + kwargs = _get_kwargs( + purchase_id=purchase_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + purchase_id: int, + *, + client: AuthenticatedClient, + body: PurchaseRecurrenceChangeRequest, +) -> ApiError | PurchaseResponse | None: + """Change recurrence + + Change the recurrence on purchase + + Args: + purchase_id (int): + body (PurchaseRecurrenceChangeRequest): + + 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 | PurchaseResponse + """ + + return ( + await asyncio_detailed( + purchase_id=purchase_id, + client=client, + body=body, + ) + ).parsed 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 new file mode 100644 index 0000000..9161f20 --- /dev/null +++ b/src/shellrent_sdk/client/api/purchases/change_purchase_renew_status.py @@ -0,0 +1,215 @@ +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.purchase_renew_status_change_request import PurchaseRenewStatusChangeRequest +from ...models.purchase_response import PurchaseResponse +from ...types import Response + + +def _get_kwargs( + purchase_id: int, + *, + body: PurchaseRenewStatusChangeRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/api/v3/purchases/{purchase_id}/renew-status".format( + purchase_id=quote(str(purchase_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 | PurchaseResponse | None: + if response.status_code == 200: + response_200 = PurchaseResponse.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 == 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 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 | PurchaseResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + purchase_id: int, + *, + client: AuthenticatedClient, + body: PurchaseRenewStatusChangeRequest, +) -> Response[ApiError | PurchaseResponse]: + """Change "to renew" status + + Change the status of "do_not_renew" on purchase + + Args: + purchase_id (int): + body (PurchaseRenewStatusChangeRequest): + + 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 | PurchaseResponse] + """ + + kwargs = _get_kwargs( + purchase_id=purchase_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + purchase_id: int, + *, + client: AuthenticatedClient, + body: PurchaseRenewStatusChangeRequest, +) -> ApiError | PurchaseResponse | None: + """Change "to renew" status + + Change the status of "do_not_renew" on purchase + + Args: + purchase_id (int): + body (PurchaseRenewStatusChangeRequest): + + 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 | PurchaseResponse + """ + + return sync_detailed( + purchase_id=purchase_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + purchase_id: int, + *, + client: AuthenticatedClient, + body: PurchaseRenewStatusChangeRequest, +) -> Response[ApiError | PurchaseResponse]: + """Change "to renew" status + + Change the status of "do_not_renew" on purchase + + Args: + purchase_id (int): + body (PurchaseRenewStatusChangeRequest): + + 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 | PurchaseResponse] + """ + + kwargs = _get_kwargs( + purchase_id=purchase_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + purchase_id: int, + *, + client: AuthenticatedClient, + body: PurchaseRenewStatusChangeRequest, +) -> ApiError | PurchaseResponse | None: + """Change "to renew" status + + Change the status of "do_not_renew" on purchase + + Args: + purchase_id (int): + body (PurchaseRenewStatusChangeRequest): + + 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 | PurchaseResponse + """ + + return ( + await asyncio_detailed( + purchase_id=purchase_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/purchases/complete_task_data.py b/src/shellrent_sdk/client/api/purchases/complete_task_data.py new file mode 100644 index 0000000..4934fee --- /dev/null +++ b/src/shellrent_sdk/client/api/purchases/complete_task_data.py @@ -0,0 +1,210 @@ +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.complete_task_data_body import CompleteTaskDataBody +from ...models.task_response import TaskResponse +from ...types import Response + + +def _get_kwargs( + task_id: int, + *, + body: CompleteTaskDataBody, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/tasks/{task_id}/data".format( + task_id=quote(str(task_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( + task_id: int, + *, + client: AuthenticatedClient, + body: CompleteTaskDataBody, +) -> Response[ApiError | TaskResponse]: + """Complete task data + + Complete task with extra data + + Args: + task_id (int): + body (CompleteTaskDataBody): + + 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( + task_id=task_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + task_id: int, + *, + client: AuthenticatedClient, + body: CompleteTaskDataBody, +) -> ApiError | TaskResponse | None: + """Complete task data + + Complete task with extra data + + Args: + task_id (int): + body (CompleteTaskDataBody): + + 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( + task_id=task_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + task_id: int, + *, + client: AuthenticatedClient, + body: CompleteTaskDataBody, +) -> Response[ApiError | TaskResponse]: + """Complete task data + + Complete task with extra data + + Args: + task_id (int): + body (CompleteTaskDataBody): + + 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( + task_id=task_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + task_id: int, + *, + client: AuthenticatedClient, + body: CompleteTaskDataBody, +) -> ApiError | TaskResponse | None: + """Complete task data + + Complete task with extra data + + Args: + task_id (int): + body (CompleteTaskDataBody): + + 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( + task_id=task_id, + client=client, + body=body, + ) + ).parsed 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 new file mode 100644 index 0000000..9df0846 --- /dev/null +++ b/src/shellrent_sdk/client/api/purchases/delete_purchase_billing_info.py @@ -0,0 +1,189 @@ +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.purchase_response import PurchaseResponse +from ...types import Response + + +def _get_kwargs( + purchase_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/api/v3/purchases/{purchase_id}/billing-info".format( + purchase_id=quote(str(purchase_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | PurchaseResponse | None: + if response.status_code == 200: + response_200 = PurchaseResponse.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 | PurchaseResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + purchase_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | PurchaseResponse]: + """Delete billing info + + Deletes all billing infos from purchase (ODA, CIG, CUP). + + Args: + purchase_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 | PurchaseResponse] + """ + + kwargs = _get_kwargs( + purchase_id=purchase_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + purchase_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | PurchaseResponse | None: + """Delete billing info + + Deletes all billing infos from purchase (ODA, CIG, CUP). + + Args: + purchase_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 | PurchaseResponse + """ + + return sync_detailed( + purchase_id=purchase_id, + client=client, + ).parsed + + +async def asyncio_detailed( + purchase_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | PurchaseResponse]: + """Delete billing info + + Deletes all billing infos from purchase (ODA, CIG, CUP). + + Args: + purchase_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 | PurchaseResponse] + """ + + kwargs = _get_kwargs( + purchase_id=purchase_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + purchase_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | PurchaseResponse | None: + """Delete billing info + + Deletes all billing infos from purchase (ODA, CIG, CUP). + + Args: + purchase_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 | PurchaseResponse + """ + + return ( + await asyncio_detailed( + purchase_id=purchase_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/purchases/delete_purchase_comment.py b/src/shellrent_sdk/client/api/purchases/delete_purchase_comment.py new file mode 100644 index 0000000..9c7b118 --- /dev/null +++ b/src/shellrent_sdk/client/api/purchases/delete_purchase_comment.py @@ -0,0 +1,189 @@ +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.purchase_response import PurchaseResponse +from ...types import Response + + +def _get_kwargs( + purchase_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/api/v3/purchases/{purchase_id}/comment".format( + purchase_id=quote(str(purchase_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | PurchaseResponse | None: + if response.status_code == 200: + response_200 = PurchaseResponse.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 | PurchaseResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + purchase_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | PurchaseResponse]: + """Delete comment + + Deletes the user's comment from purchase. + + Args: + purchase_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 | PurchaseResponse] + """ + + kwargs = _get_kwargs( + purchase_id=purchase_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + purchase_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | PurchaseResponse | None: + """Delete comment + + Deletes the user's comment from purchase. + + Args: + purchase_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 | PurchaseResponse + """ + + return sync_detailed( + purchase_id=purchase_id, + client=client, + ).parsed + + +async def asyncio_detailed( + purchase_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | PurchaseResponse]: + """Delete comment + + Deletes the user's comment from purchase. + + Args: + purchase_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 | PurchaseResponse] + """ + + kwargs = _get_kwargs( + purchase_id=purchase_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + purchase_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | PurchaseResponse | None: + """Delete comment + + Deletes the user's comment from purchase. + + Args: + purchase_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 | PurchaseResponse + """ + + return ( + await asyncio_detailed( + purchase_id=purchase_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/purchases/get_purchase.py b/src/shellrent_sdk/client/api/purchases/get_purchase.py new file mode 100644 index 0000000..5a7a10a --- /dev/null +++ b/src/shellrent_sdk/client/api/purchases/get_purchase.py @@ -0,0 +1,189 @@ +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.purchase_response import PurchaseResponse +from ...types import Response + + +def _get_kwargs( + purchase_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/purchases/{purchase_id}".format( + purchase_id=quote(str(purchase_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | PurchaseResponse | None: + if response.status_code == 200: + response_200 = PurchaseResponse.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 | PurchaseResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + purchase_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | PurchaseResponse]: + """Get purchase + + Get a purchase + + Args: + purchase_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 | PurchaseResponse] + """ + + kwargs = _get_kwargs( + purchase_id=purchase_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + purchase_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | PurchaseResponse | None: + """Get purchase + + Get a purchase + + Args: + purchase_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 | PurchaseResponse + """ + + return sync_detailed( + purchase_id=purchase_id, + client=client, + ).parsed + + +async def asyncio_detailed( + purchase_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | PurchaseResponse]: + """Get purchase + + Get a purchase + + Args: + purchase_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 | PurchaseResponse] + """ + + kwargs = _get_kwargs( + purchase_id=purchase_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + purchase_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | PurchaseResponse | None: + """Get purchase + + Get a purchase + + Args: + purchase_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 | PurchaseResponse + """ + + return ( + await asyncio_detailed( + purchase_id=purchase_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/purchases/get_task.py b/src/shellrent_sdk/client/api/purchases/get_task.py new file mode 100644 index 0000000..8cabbba --- /dev/null +++ b/src/shellrent_sdk/client/api/purchases/get_task.py @@ -0,0 +1,189 @@ +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( + task_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/tasks/{task_id}".format( + task_id=quote(str(task_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( + task_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | TaskResponse]: + """Get task + + Get a task + + Args: + task_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( + task_id=task_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + task_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | TaskResponse | None: + """Get task + + Get a task + + Args: + task_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( + task_id=task_id, + client=client, + ).parsed + + +async def asyncio_detailed( + task_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | TaskResponse]: + """Get task + + Get a task + + Args: + task_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( + task_id=task_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + task_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | TaskResponse | None: + """Get task + + Get a task + + Args: + task_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( + task_id=task_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/purchases/list_purchases.py b/src/shellrent_sdk/client/api/purchases/list_purchases.py new file mode 100644 index 0000000..7beae5a --- /dev/null +++ b/src/shellrent_sdk/client/api/purchases/list_purchases.py @@ -0,0 +1,406 @@ +import datetime +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.purchase_paginated_list_response import PurchasePaginatedListResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + alive_only: bool | Unset = True, + suspended: bool | Unset = UNSET, + do_not_renew: bool | Unset = UNSET, + purchase_id_primary: int | Unset = UNSET, + activation_date_from: datetime.date | Unset = UNSET, + activation_date_to: datetime.date | Unset = UNSET, + expire_date_from: datetime.date | Unset = UNSET, + expire_date_to: datetime.date | Unset = UNSET, + purchase_ids: list[int] | Unset = UNSET, + service_code: str | Unset = UNSET, + service_category_code: str | Unset = UNSET, + search: str | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["alive_only"] = alive_only + + params["suspended"] = suspended + + params["do_not_renew"] = do_not_renew + + params["purchase_id_primary"] = purchase_id_primary + + json_activation_date_from: str | Unset = UNSET + if not isinstance(activation_date_from, Unset): + json_activation_date_from = activation_date_from.isoformat() + params["activation_date_from"] = json_activation_date_from + + json_activation_date_to: str | Unset = UNSET + if not isinstance(activation_date_to, Unset): + json_activation_date_to = activation_date_to.isoformat() + params["activation_date_to"] = json_activation_date_to + + json_expire_date_from: str | Unset = UNSET + if not isinstance(expire_date_from, Unset): + json_expire_date_from = expire_date_from.isoformat() + params["expire_date_from"] = json_expire_date_from + + json_expire_date_to: str | Unset = UNSET + if not isinstance(expire_date_to, Unset): + json_expire_date_to = expire_date_to.isoformat() + params["expire_date_to"] = json_expire_date_to + + json_purchase_ids: list[int] | Unset = UNSET + if not isinstance(purchase_ids, Unset): + json_purchase_ids = purchase_ids + + params["purchase_ids"] = json_purchase_ids + + params["service_code"] = service_code + + params["service_category_code"] = service_category_code + + params["search"] = search + + 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/purchases", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | PurchasePaginatedListResponse | None: + if response.status_code == 200: + response_200 = PurchasePaginatedListResponse.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 | PurchasePaginatedListResponse]: + 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, + alive_only: bool | Unset = True, + suspended: bool | Unset = UNSET, + do_not_renew: bool | Unset = UNSET, + purchase_id_primary: int | Unset = UNSET, + activation_date_from: datetime.date | Unset = UNSET, + activation_date_to: datetime.date | Unset = UNSET, + expire_date_from: datetime.date | Unset = UNSET, + expire_date_to: datetime.date | Unset = UNSET, + purchase_ids: list[int] | Unset = UNSET, + service_code: str | Unset = UNSET, + service_category_code: str | Unset = UNSET, + search: str | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | PurchasePaginatedListResponse]: + """List purchases + + Get a list of all purchases + + Args: + alive_only (bool | Unset): Default: True. + suspended (bool | Unset): + do_not_renew (bool | Unset): + purchase_id_primary (int | Unset): + activation_date_from (datetime.date | Unset): + activation_date_to (datetime.date | Unset): + expire_date_from (datetime.date | Unset): + expire_date_to (datetime.date | Unset): + purchase_ids (list[int] | Unset): + service_code (str | Unset): + service_category_code (str | Unset): + search (str | Unset): + 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. + + Returns: + Response[ApiError | PurchasePaginatedListResponse] + """ + + kwargs = _get_kwargs( + alive_only=alive_only, + suspended=suspended, + do_not_renew=do_not_renew, + purchase_id_primary=purchase_id_primary, + activation_date_from=activation_date_from, + activation_date_to=activation_date_to, + expire_date_from=expire_date_from, + expire_date_to=expire_date_to, + purchase_ids=purchase_ids, + service_code=service_code, + service_category_code=service_category_code, + search=search, + page=page, + per_page=per_page, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + alive_only: bool | Unset = True, + suspended: bool | Unset = UNSET, + do_not_renew: bool | Unset = UNSET, + purchase_id_primary: int | Unset = UNSET, + activation_date_from: datetime.date | Unset = UNSET, + activation_date_to: datetime.date | Unset = UNSET, + expire_date_from: datetime.date | Unset = UNSET, + expire_date_to: datetime.date | Unset = UNSET, + purchase_ids: list[int] | Unset = UNSET, + service_code: str | Unset = UNSET, + service_category_code: str | Unset = UNSET, + search: str | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | PurchasePaginatedListResponse | None: + """List purchases + + Get a list of all purchases + + Args: + alive_only (bool | Unset): Default: True. + suspended (bool | Unset): + do_not_renew (bool | Unset): + purchase_id_primary (int | Unset): + activation_date_from (datetime.date | Unset): + activation_date_to (datetime.date | Unset): + expire_date_from (datetime.date | Unset): + expire_date_to (datetime.date | Unset): + purchase_ids (list[int] | Unset): + service_code (str | Unset): + service_category_code (str | Unset): + search (str | Unset): + 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. + + Returns: + ApiError | PurchasePaginatedListResponse + """ + + return sync_detailed( + client=client, + alive_only=alive_only, + suspended=suspended, + do_not_renew=do_not_renew, + purchase_id_primary=purchase_id_primary, + activation_date_from=activation_date_from, + activation_date_to=activation_date_to, + expire_date_from=expire_date_from, + expire_date_to=expire_date_to, + purchase_ids=purchase_ids, + service_code=service_code, + service_category_code=service_category_code, + search=search, + page=page, + per_page=per_page, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + alive_only: bool | Unset = True, + suspended: bool | Unset = UNSET, + do_not_renew: bool | Unset = UNSET, + purchase_id_primary: int | Unset = UNSET, + activation_date_from: datetime.date | Unset = UNSET, + activation_date_to: datetime.date | Unset = UNSET, + expire_date_from: datetime.date | Unset = UNSET, + expire_date_to: datetime.date | Unset = UNSET, + purchase_ids: list[int] | Unset = UNSET, + service_code: str | Unset = UNSET, + service_category_code: str | Unset = UNSET, + search: str | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | PurchasePaginatedListResponse]: + """List purchases + + Get a list of all purchases + + Args: + alive_only (bool | Unset): Default: True. + suspended (bool | Unset): + do_not_renew (bool | Unset): + purchase_id_primary (int | Unset): + activation_date_from (datetime.date | Unset): + activation_date_to (datetime.date | Unset): + expire_date_from (datetime.date | Unset): + expire_date_to (datetime.date | Unset): + purchase_ids (list[int] | Unset): + service_code (str | Unset): + service_category_code (str | Unset): + search (str | Unset): + 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. + + Returns: + Response[ApiError | PurchasePaginatedListResponse] + """ + + kwargs = _get_kwargs( + alive_only=alive_only, + suspended=suspended, + do_not_renew=do_not_renew, + purchase_id_primary=purchase_id_primary, + activation_date_from=activation_date_from, + activation_date_to=activation_date_to, + expire_date_from=expire_date_from, + expire_date_to=expire_date_to, + purchase_ids=purchase_ids, + service_code=service_code, + service_category_code=service_category_code, + search=search, + 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, + alive_only: bool | Unset = True, + suspended: bool | Unset = UNSET, + do_not_renew: bool | Unset = UNSET, + purchase_id_primary: int | Unset = UNSET, + activation_date_from: datetime.date | Unset = UNSET, + activation_date_to: datetime.date | Unset = UNSET, + expire_date_from: datetime.date | Unset = UNSET, + expire_date_to: datetime.date | Unset = UNSET, + purchase_ids: list[int] | Unset = UNSET, + service_code: str | Unset = UNSET, + service_category_code: str | Unset = UNSET, + search: str | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | PurchasePaginatedListResponse | None: + """List purchases + + Get a list of all purchases + + Args: + alive_only (bool | Unset): Default: True. + suspended (bool | Unset): + do_not_renew (bool | Unset): + purchase_id_primary (int | Unset): + activation_date_from (datetime.date | Unset): + activation_date_to (datetime.date | Unset): + expire_date_from (datetime.date | Unset): + expire_date_to (datetime.date | Unset): + purchase_ids (list[int] | Unset): + service_code (str | Unset): + service_category_code (str | Unset): + search (str | Unset): + 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. + + Returns: + ApiError | PurchasePaginatedListResponse + """ + + return ( + await asyncio_detailed( + client=client, + alive_only=alive_only, + suspended=suspended, + do_not_renew=do_not_renew, + purchase_id_primary=purchase_id_primary, + activation_date_from=activation_date_from, + activation_date_to=activation_date_to, + expire_date_from=expire_date_from, + expire_date_to=expire_date_to, + purchase_ids=purchase_ids, + service_code=service_code, + service_category_code=service_category_code, + search=search, + page=page, + per_page=per_page, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/purchases/list_tasks.py b/src/shellrent_sdk/client/api/purchases/list_tasks.py new file mode 100644 index 0000000..f4b2fb5 --- /dev/null +++ b/src/shellrent_sdk/client/api/purchases/list_tasks.py @@ -0,0 +1,254 @@ +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.task_paginated_list_response import TaskPaginatedListResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + alive_only: bool | Unset = True, + ask_user_error: str | Unset = UNSET, + purchase_id: int | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["alive_only"] = alive_only + + params["ask_user_error"] = ask_user_error + + params["purchase_id"] = purchase_id + + 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/tasks", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | TaskPaginatedListResponse | None: + if response.status_code == 200: + response_200 = TaskPaginatedListResponse.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 | TaskPaginatedListResponse]: + 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, + alive_only: bool | Unset = True, + ask_user_error: str | Unset = UNSET, + purchase_id: int | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | TaskPaginatedListResponse]: + """List purchases tasks + + Get a list of all tasks on purchases + + Args: + alive_only (bool | Unset): Default: True. + ask_user_error (str | Unset): + purchase_id (int | Unset): + 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. + + Returns: + Response[ApiError | TaskPaginatedListResponse] + """ + + kwargs = _get_kwargs( + alive_only=alive_only, + ask_user_error=ask_user_error, + purchase_id=purchase_id, + page=page, + per_page=per_page, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + alive_only: bool | Unset = True, + ask_user_error: str | Unset = UNSET, + purchase_id: int | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | TaskPaginatedListResponse | None: + """List purchases tasks + + Get a list of all tasks on purchases + + Args: + alive_only (bool | Unset): Default: True. + ask_user_error (str | Unset): + purchase_id (int | Unset): + 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. + + Returns: + ApiError | TaskPaginatedListResponse + """ + + return sync_detailed( + client=client, + alive_only=alive_only, + ask_user_error=ask_user_error, + purchase_id=purchase_id, + page=page, + per_page=per_page, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + alive_only: bool | Unset = True, + ask_user_error: str | Unset = UNSET, + purchase_id: int | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | TaskPaginatedListResponse]: + """List purchases tasks + + Get a list of all tasks on purchases + + Args: + alive_only (bool | Unset): Default: True. + ask_user_error (str | Unset): + purchase_id (int | Unset): + 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. + + Returns: + Response[ApiError | TaskPaginatedListResponse] + """ + + kwargs = _get_kwargs( + alive_only=alive_only, + ask_user_error=ask_user_error, + purchase_id=purchase_id, + 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, + alive_only: bool | Unset = True, + ask_user_error: str | Unset = UNSET, + purchase_id: int | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | TaskPaginatedListResponse | None: + """List purchases tasks + + Get a list of all tasks on purchases + + Args: + alive_only (bool | Unset): Default: True. + ask_user_error (str | Unset): + purchase_id (int | Unset): + 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. + + Returns: + ApiError | TaskPaginatedListResponse + """ + + return ( + await asyncio_detailed( + client=client, + alive_only=alive_only, + ask_user_error=ask_user_error, + purchase_id=purchase_id, + page=page, + per_page=per_page, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/purchases/renew_purchase.py b/src/shellrent_sdk/client/api/purchases/renew_purchase.py new file mode 100644 index 0000000..fb71aad --- /dev/null +++ b/src/shellrent_sdk/client/api/purchases/renew_purchase.py @@ -0,0 +1,189 @@ +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_list_response import OrderListResponse +from ...types import Response + + +def _get_kwargs( + purchase_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/purchases/{purchase_id}/renew".format( + purchase_id=quote(str(purchase_id), safe=""), + ), + } + + 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( + purchase_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | OrderListResponse]: + """Renew + + Renew a purchase. It returns the orders created to renew the purchase (usually one order). + + Args: + purchase_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 | OrderListResponse] + """ + + kwargs = _get_kwargs( + purchase_id=purchase_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + purchase_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | OrderListResponse | None: + """Renew + + Renew a purchase. It returns the orders created to renew the purchase (usually one order). + + Args: + purchase_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 | OrderListResponse + """ + + return sync_detailed( + purchase_id=purchase_id, + client=client, + ).parsed + + +async def asyncio_detailed( + purchase_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | OrderListResponse]: + """Renew + + Renew a purchase. It returns the orders created to renew the purchase (usually one order). + + Args: + purchase_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 | OrderListResponse] + """ + + kwargs = _get_kwargs( + purchase_id=purchase_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + purchase_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | OrderListResponse | None: + """Renew + + Renew a purchase. It returns the orders created to renew the purchase (usually one order). + + Args: + purchase_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 | OrderListResponse + """ + + return ( + await asyncio_detailed( + purchase_id=purchase_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..37c5e8a --- /dev/null +++ b/src/shellrent_sdk/client/api/purchases/update_purchase_billing_info.py @@ -0,0 +1,215 @@ +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.purchase_billing_info_change_request import PurchaseBillingInfoChangeRequest +from ...models.purchase_response import PurchaseResponse +from ...types import Response + + +def _get_kwargs( + purchase_id: int, + *, + body: PurchaseBillingInfoChangeRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/api/v3/purchases/{purchase_id}/billing-info".format( + purchase_id=quote(str(purchase_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 | PurchaseResponse | None: + if response.status_code == 200: + response_200 = PurchaseResponse.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 == 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 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 | PurchaseResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + purchase_id: int, + *, + client: AuthenticatedClient, + body: PurchaseBillingInfoChangeRequest, +) -> Response[ApiError | PurchaseResponse]: + """Change billing info + + Changes the billing info on purchase (ODA, CIG, CUP, ...) + + Args: + purchase_id (int): + body (PurchaseBillingInfoChangeRequest): + + 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 | PurchaseResponse] + """ + + kwargs = _get_kwargs( + purchase_id=purchase_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + purchase_id: int, + *, + client: AuthenticatedClient, + body: PurchaseBillingInfoChangeRequest, +) -> ApiError | PurchaseResponse | None: + """Change billing info + + Changes the billing info on purchase (ODA, CIG, CUP, ...) + + Args: + purchase_id (int): + body (PurchaseBillingInfoChangeRequest): + + 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 | PurchaseResponse + """ + + return sync_detailed( + purchase_id=purchase_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + purchase_id: int, + *, + client: AuthenticatedClient, + body: PurchaseBillingInfoChangeRequest, +) -> Response[ApiError | PurchaseResponse]: + """Change billing info + + Changes the billing info on purchase (ODA, CIG, CUP, ...) + + Args: + purchase_id (int): + body (PurchaseBillingInfoChangeRequest): + + 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 | PurchaseResponse] + """ + + kwargs = _get_kwargs( + purchase_id=purchase_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + purchase_id: int, + *, + client: AuthenticatedClient, + body: PurchaseBillingInfoChangeRequest, +) -> ApiError | PurchaseResponse | None: + """Change billing info + + Changes the billing info on purchase (ODA, CIG, CUP, ...) + + Args: + purchase_id (int): + body (PurchaseBillingInfoChangeRequest): + + 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 | PurchaseResponse + """ + + return ( + await asyncio_detailed( + purchase_id=purchase_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/purchases/update_purchase_comment.py b/src/shellrent_sdk/client/api/purchases/update_purchase_comment.py new file mode 100644 index 0000000..6872085 --- /dev/null +++ b/src/shellrent_sdk/client/api/purchases/update_purchase_comment.py @@ -0,0 +1,215 @@ +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.purchase_comment_change_request import PurchaseCommentChangeRequest +from ...models.purchase_response import PurchaseResponse +from ...types import Response + + +def _get_kwargs( + purchase_id: int, + *, + body: PurchaseCommentChangeRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/api/v3/purchases/{purchase_id}/comment".format( + purchase_id=quote(str(purchase_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 | PurchaseResponse | None: + if response.status_code == 200: + response_200 = PurchaseResponse.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 == 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 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 | PurchaseResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + purchase_id: int, + *, + client: AuthenticatedClient, + body: PurchaseCommentChangeRequest, +) -> Response[ApiError | PurchaseResponse]: + """Change comment + + Change the user's comment on purchase (it is also reported on purchase's invoices). + + Args: + purchase_id (int): + body (PurchaseCommentChangeRequest): + + 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 | PurchaseResponse] + """ + + kwargs = _get_kwargs( + purchase_id=purchase_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + purchase_id: int, + *, + client: AuthenticatedClient, + body: PurchaseCommentChangeRequest, +) -> ApiError | PurchaseResponse | None: + """Change comment + + Change the user's comment on purchase (it is also reported on purchase's invoices). + + Args: + purchase_id (int): + body (PurchaseCommentChangeRequest): + + 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 | PurchaseResponse + """ + + return sync_detailed( + purchase_id=purchase_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + purchase_id: int, + *, + client: AuthenticatedClient, + body: PurchaseCommentChangeRequest, +) -> Response[ApiError | PurchaseResponse]: + """Change comment + + Change the user's comment on purchase (it is also reported on purchase's invoices). + + Args: + purchase_id (int): + body (PurchaseCommentChangeRequest): + + 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 | PurchaseResponse] + """ + + kwargs = _get_kwargs( + purchase_id=purchase_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + purchase_id: int, + *, + client: AuthenticatedClient, + body: PurchaseCommentChangeRequest, +) -> ApiError | PurchaseResponse | None: + """Change comment + + Change the user's comment on purchase (it is also reported on purchase's invoices). + + Args: + purchase_id (int): + body (PurchaseCommentChangeRequest): + + 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 | PurchaseResponse + """ + + return ( + await asyncio_detailed( + purchase_id=purchase_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/server/__init__.py b/src/shellrent_sdk/client/api/server/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/src/shellrent_sdk/client/api/server/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" 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 new file mode 100644 index 0000000..41c0542 --- /dev/null +++ b/src/shellrent_sdk/client/api/server/can_hard_reboot_server.py @@ -0,0 +1,189 @@ +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.server_can_action_response import ServerCanActionResponse +from ...types import Response + + +def _get_kwargs( + server_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/servers/{server_id}/can-hard-reboot".format( + server_id=quote(str(server_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | ServerCanActionResponse | None: + if response.status_code == 200: + response_200 = ServerCanActionResponse.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 | ServerCanActionResponse]: + 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 | ServerCanActionResponse]: + """Check if server can hard reboot + + Check if server can hard reboot + + 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 | ServerCanActionResponse] + """ + + 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 | ServerCanActionResponse | None: + """Check if server can hard reboot + + Check if server can hard reboot + + 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 | ServerCanActionResponse + """ + + return sync_detailed( + server_id=server_id, + client=client, + ).parsed + + +async def asyncio_detailed( + server_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ServerCanActionResponse]: + """Check if server can hard reboot + + Check if server can hard reboot + + 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 | ServerCanActionResponse] + """ + + 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 | ServerCanActionResponse | None: + """Check if server can hard reboot + + Check if server can hard reboot + + 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 | ServerCanActionResponse + """ + + return ( + await asyncio_detailed( + server_id=server_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..6d4c0d1 --- /dev/null +++ b/src/shellrent_sdk/client/api/server/can_hard_stop_server.py @@ -0,0 +1,189 @@ +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.server_can_action_response import ServerCanActionResponse +from ...types import Response + + +def _get_kwargs( + server_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/servers/{server_id}/can-hard-stop".format( + server_id=quote(str(server_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | ServerCanActionResponse | None: + if response.status_code == 200: + response_200 = ServerCanActionResponse.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 | ServerCanActionResponse]: + 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 | ServerCanActionResponse]: + """Check if server can hard stop + + Check if server can hard stop + + 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 | ServerCanActionResponse] + """ + + 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 | ServerCanActionResponse | None: + """Check if server can hard stop + + Check if server can hard stop + + 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 | ServerCanActionResponse + """ + + return sync_detailed( + server_id=server_id, + client=client, + ).parsed + + +async def asyncio_detailed( + server_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ServerCanActionResponse]: + """Check if server can hard stop + + Check if server can hard stop + + 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 | ServerCanActionResponse] + """ + + 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 | ServerCanActionResponse | None: + """Check if server can hard stop + + Check if server can hard stop + + 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 | ServerCanActionResponse + """ + + return ( + await asyncio_detailed( + server_id=server_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/server/can_reboot_server.py b/src/shellrent_sdk/client/api/server/can_reboot_server.py new file mode 100644 index 0000000..bbd3538 --- /dev/null +++ b/src/shellrent_sdk/client/api/server/can_reboot_server.py @@ -0,0 +1,189 @@ +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.server_can_action_response import ServerCanActionResponse +from ...types import Response + + +def _get_kwargs( + server_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/servers/{server_id}/can-reboot".format( + server_id=quote(str(server_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | ServerCanActionResponse | None: + if response.status_code == 200: + response_200 = ServerCanActionResponse.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 | ServerCanActionResponse]: + 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 | ServerCanActionResponse]: + """Check if server can reboot + + Check if server can reboot + + 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 | ServerCanActionResponse] + """ + + 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 | ServerCanActionResponse | None: + """Check if server can reboot + + Check if server can reboot + + 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 | ServerCanActionResponse + """ + + return sync_detailed( + server_id=server_id, + client=client, + ).parsed + + +async def asyncio_detailed( + server_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ServerCanActionResponse]: + """Check if server can reboot + + Check if server can reboot + + 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 | ServerCanActionResponse] + """ + + 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 | ServerCanActionResponse | None: + """Check if server can reboot + + Check if server can reboot + + 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 | ServerCanActionResponse + """ + + return ( + await asyncio_detailed( + server_id=server_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/server/can_start_server.py b/src/shellrent_sdk/client/api/server/can_start_server.py new file mode 100644 index 0000000..a3b5343 --- /dev/null +++ b/src/shellrent_sdk/client/api/server/can_start_server.py @@ -0,0 +1,189 @@ +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.server_can_action_response import ServerCanActionResponse +from ...types import Response + + +def _get_kwargs( + server_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/servers/{server_id}/can-start".format( + server_id=quote(str(server_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | ServerCanActionResponse | None: + if response.status_code == 200: + response_200 = ServerCanActionResponse.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 | ServerCanActionResponse]: + 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 | ServerCanActionResponse]: + """Check if server can start + + Check if server can start + + 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 | ServerCanActionResponse] + """ + + 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 | ServerCanActionResponse | None: + """Check if server can start + + Check if server can start + + 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 | ServerCanActionResponse + """ + + return sync_detailed( + server_id=server_id, + client=client, + ).parsed + + +async def asyncio_detailed( + server_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ServerCanActionResponse]: + """Check if server can start + + Check if server can start + + 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 | ServerCanActionResponse] + """ + + 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 | ServerCanActionResponse | None: + """Check if server can start + + Check if server can start + + 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 | ServerCanActionResponse + """ + + return ( + await asyncio_detailed( + server_id=server_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/server/can_stop_server.py b/src/shellrent_sdk/client/api/server/can_stop_server.py new file mode 100644 index 0000000..4dfab09 --- /dev/null +++ b/src/shellrent_sdk/client/api/server/can_stop_server.py @@ -0,0 +1,189 @@ +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.server_can_action_response import ServerCanActionResponse +from ...types import Response + + +def _get_kwargs( + server_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/servers/{server_id}/can-stop".format( + server_id=quote(str(server_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | ServerCanActionResponse | None: + if response.status_code == 200: + response_200 = ServerCanActionResponse.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 | ServerCanActionResponse]: + 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 | ServerCanActionResponse]: + """Check if server can stop + + Check if server can stop + + 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 | ServerCanActionResponse] + """ + + 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 | ServerCanActionResponse | None: + """Check if server can stop + + Check if server can stop + + 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 | ServerCanActionResponse + """ + + return sync_detailed( + server_id=server_id, + client=client, + ).parsed + + +async def asyncio_detailed( + server_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ServerCanActionResponse]: + """Check if server can stop + + Check if server can stop + + 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 | ServerCanActionResponse] + """ + + 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 | ServerCanActionResponse | None: + """Check if server can stop + + Check if server can stop + + 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 | ServerCanActionResponse + """ + + return ( + await asyncio_detailed( + server_id=server_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..eb70613 --- /dev/null +++ b/src/shellrent_sdk/client/api/server/create_private_cloud_virtual_machine.py @@ -0,0 +1,210 @@ +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.private_cloud_vm_create_request import PrivateCloudVmCreateRequest +from ...models.task_response import TaskResponse +from ...types import Response + + +def _get_kwargs( + server_id: int, + *, + body: PrivateCloudVmCreateRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/servers/{server_id}/private_cloud/virtual-machines".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()) + + 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, + body: PrivateCloudVmCreateRequest, +) -> Response[ApiError | TaskResponse]: + """Create private cloud VM + + Create private cloud VM + + Args: + server_id (int): + body (PrivateCloudVmCreateRequest): + + 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, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + server_id: int, + *, + client: AuthenticatedClient, + body: PrivateCloudVmCreateRequest, +) -> ApiError | TaskResponse | None: + """Create private cloud VM + + Create private cloud VM + + Args: + server_id (int): + body (PrivateCloudVmCreateRequest): + + 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, + body=body, + ).parsed + + +async def asyncio_detailed( + server_id: int, + *, + client: AuthenticatedClient, + body: PrivateCloudVmCreateRequest, +) -> Response[ApiError | TaskResponse]: + """Create private cloud VM + + Create private cloud VM + + Args: + server_id (int): + body (PrivateCloudVmCreateRequest): + + 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, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + server_id: int, + *, + client: AuthenticatedClient, + body: PrivateCloudVmCreateRequest, +) -> ApiError | TaskResponse | None: + """Create private cloud VM + + Create private cloud VM + + Args: + server_id (int): + body (PrivateCloudVmCreateRequest): + + 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, + body=body, + ) + ).parsed 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 new file mode 100644 index 0000000..b282bab --- /dev/null +++ b/src/shellrent_sdk/client/api/server/create_server_automatic_snapshot.py @@ -0,0 +1,210 @@ +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.server_automatic_snapshot_request import ServerAutomaticSnapshotRequest +from ...models.server_automatic_snapshot_response import ServerAutomaticSnapshotResponse +from ...types import Response + + +def _get_kwargs( + server_id: int, + *, + body: ServerAutomaticSnapshotRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/servers/{server_id}/snapshots/automatic-snapshot".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 | ServerAutomaticSnapshotResponse | None: + if response.status_code == 200: + response_200 = ServerAutomaticSnapshotResponse.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 | ServerAutomaticSnapshotResponse]: + 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, + body: ServerAutomaticSnapshotRequest, +) -> Response[ApiError | ServerAutomaticSnapshotResponse]: + """Create automatic snapshot settings + + Create automatic snapshot settings + + Args: + server_id (int): + body (ServerAutomaticSnapshotRequest): + + 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 | ServerAutomaticSnapshotResponse] + """ + + kwargs = _get_kwargs( + server_id=server_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + server_id: int, + *, + client: AuthenticatedClient, + body: ServerAutomaticSnapshotRequest, +) -> ApiError | ServerAutomaticSnapshotResponse | None: + """Create automatic snapshot settings + + Create automatic snapshot settings + + Args: + server_id (int): + body (ServerAutomaticSnapshotRequest): + + 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 | ServerAutomaticSnapshotResponse + """ + + return sync_detailed( + server_id=server_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + server_id: int, + *, + client: AuthenticatedClient, + body: ServerAutomaticSnapshotRequest, +) -> Response[ApiError | ServerAutomaticSnapshotResponse]: + """Create automatic snapshot settings + + Create automatic snapshot settings + + Args: + server_id (int): + body (ServerAutomaticSnapshotRequest): + + 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 | ServerAutomaticSnapshotResponse] + """ + + kwargs = _get_kwargs( + server_id=server_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + server_id: int, + *, + client: AuthenticatedClient, + body: ServerAutomaticSnapshotRequest, +) -> ApiError | ServerAutomaticSnapshotResponse | None: + """Create automatic snapshot settings + + Create automatic snapshot settings + + Args: + server_id (int): + body (ServerAutomaticSnapshotRequest): + + 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 | ServerAutomaticSnapshotResponse + """ + + return ( + await asyncio_detailed( + server_id=server_id, + client=client, + body=body, + ) + ).parsed 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 new file mode 100644 index 0000000..70d4750 --- /dev/null +++ b/src/shellrent_sdk/client/api/server/create_server_network_interface.py @@ -0,0 +1,210 @@ +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.server_network_interface_create_request import ServerNetworkInterfaceCreateRequest +from ...models.server_network_interface_response import ServerNetworkInterfaceResponse +from ...types import Response + + +def _get_kwargs( + server_id: int, + *, + body: ServerNetworkInterfaceCreateRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/servers/{server_id}/network-interfaces".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 | ServerNetworkInterfaceResponse | None: + if response.status_code == 200: + response_200 = ServerNetworkInterfaceResponse.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 | ServerNetworkInterfaceResponse]: + 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, + body: ServerNetworkInterfaceCreateRequest, +) -> Response[ApiError | ServerNetworkInterfaceResponse]: + """Create server network interface + + Create server network interface + + Args: + server_id (int): + body (ServerNetworkInterfaceCreateRequest): + + 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 | ServerNetworkInterfaceResponse] + """ + + kwargs = _get_kwargs( + server_id=server_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + server_id: int, + *, + client: AuthenticatedClient, + body: ServerNetworkInterfaceCreateRequest, +) -> ApiError | ServerNetworkInterfaceResponse | None: + """Create server network interface + + Create server network interface + + Args: + server_id (int): + body (ServerNetworkInterfaceCreateRequest): + + 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 | ServerNetworkInterfaceResponse + """ + + return sync_detailed( + server_id=server_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + server_id: int, + *, + client: AuthenticatedClient, + body: ServerNetworkInterfaceCreateRequest, +) -> Response[ApiError | ServerNetworkInterfaceResponse]: + """Create server network interface + + Create server network interface + + Args: + server_id (int): + body (ServerNetworkInterfaceCreateRequest): + + 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 | ServerNetworkInterfaceResponse] + """ + + kwargs = _get_kwargs( + server_id=server_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + server_id: int, + *, + client: AuthenticatedClient, + body: ServerNetworkInterfaceCreateRequest, +) -> ApiError | ServerNetworkInterfaceResponse | None: + """Create server network interface + + Create server network interface + + Args: + server_id (int): + body (ServerNetworkInterfaceCreateRequest): + + 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 | ServerNetworkInterfaceResponse + """ + + return ( + 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 new file mode 100644 index 0000000..98c3a1c --- /dev/null +++ b/src/shellrent_sdk/client/api/server/delete_private_cloud_virtual_machine.py @@ -0,0 +1,203 @@ +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, + vm_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "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=""), + ), + } + + 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, + vm_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | TaskResponse]: + """Delete private cloud VM + + Delete private cloud VM + + Args: + server_id (int): + vm_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, + vm_id=vm_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + server_id: int, + vm_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | TaskResponse | None: + """Delete private cloud VM + + Delete private cloud VM + + Args: + server_id (int): + vm_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, + vm_id=vm_id, + client=client, + ).parsed + + +async def asyncio_detailed( + server_id: int, + vm_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | TaskResponse]: + """Delete private cloud VM + + Delete private cloud VM + + Args: + server_id (int): + vm_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, + vm_id=vm_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + server_id: int, + vm_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | TaskResponse | None: + """Delete private cloud VM + + Delete private cloud VM + + Args: + server_id (int): + vm_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, + vm_id=vm_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..ffecaf1 --- /dev/null +++ b/src/shellrent_sdk/client/api/server/delete_server_automatic_snapshot.py @@ -0,0 +1,189 @@ +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.empty_response import EmptyResponse +from ...types import Response + + +def _get_kwargs( + server_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/api/v3/servers/{server_id}/snapshots/automatic-snapshot".format( + server_id=quote(str(server_id), safe=""), + ), + } + + return _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 + + 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 | EmptyResponse]: + 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 | EmptyResponse]: + """Delete automatic snapshot settings + + Delete automatic snapshot settings + + 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 | EmptyResponse] + """ + + 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 | EmptyResponse | None: + """Delete automatic snapshot settings + + Delete automatic snapshot settings + + 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 | EmptyResponse + """ + + return sync_detailed( + server_id=server_id, + client=client, + ).parsed + + +async def asyncio_detailed( + server_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Delete automatic snapshot settings + + Delete automatic snapshot settings + + 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 | EmptyResponse] + """ + + 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 | EmptyResponse | None: + """Delete automatic snapshot settings + + Delete automatic snapshot settings + + 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 | EmptyResponse + """ + + return ( + await asyncio_detailed( + server_id=server_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..755b067 --- /dev/null +++ b/src/shellrent_sdk/client/api/server/delete_server_exposed_backups.py @@ -0,0 +1,189 @@ +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": "delete", + "url": "/api/v3/servers/{server_id}/backups/exhibitions".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]: + """Delete exposed backups + + Delete exposed backups + + 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: + """Delete exposed backups + + Delete exposed backups + + 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]: + """Delete exposed backups + + Delete exposed backups + + 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: + """Delete exposed backups + + Delete exposed backups + + 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/delete_server_ip_address_reverse_dns.py b/src/shellrent_sdk/client/api/server/delete_server_ip_address_reverse_dns.py new file mode 100644 index 0000000..951618e --- /dev/null +++ b/src/shellrent_sdk/client/api/server/delete_server_ip_address_reverse_dns.py @@ -0,0 +1,203 @@ +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.ip_address_response import IpAddressResponse +from ...types import Response + + +def _get_kwargs( + server_id: int, + ip_address_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "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=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | IpAddressResponse | None: + if response.status_code == 200: + response_200 = IpAddressResponse.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 | IpAddressResponse]: + 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, + ip_address_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | IpAddressResponse]: + """Delete IP reverse DNS + + Delete reverse DNS for an IP address + + Args: + server_id (int): + ip_address_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 | IpAddressResponse] + """ + + kwargs = _get_kwargs( + server_id=server_id, + ip_address_id=ip_address_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + server_id: int, + ip_address_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | IpAddressResponse | None: + """Delete IP reverse DNS + + Delete reverse DNS for an IP address + + Args: + server_id (int): + ip_address_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 | IpAddressResponse + """ + + return sync_detailed( + server_id=server_id, + ip_address_id=ip_address_id, + client=client, + ).parsed + + +async def asyncio_detailed( + server_id: int, + ip_address_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | IpAddressResponse]: + """Delete IP reverse DNS + + Delete reverse DNS for an IP address + + Args: + server_id (int): + ip_address_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 | IpAddressResponse] + """ + + kwargs = _get_kwargs( + server_id=server_id, + ip_address_id=ip_address_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + server_id: int, + ip_address_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | IpAddressResponse | None: + """Delete IP reverse DNS + + Delete reverse DNS for an IP address + + Args: + server_id (int): + ip_address_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 | IpAddressResponse + """ + + return ( + await asyncio_detailed( + server_id=server_id, + ip_address_id=ip_address_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..2974e7e --- /dev/null +++ b/src/shellrent_sdk/client/api/server/delete_server_network_interface.py @@ -0,0 +1,203 @@ +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.empty_response import EmptyResponse +from ...types import Response + + +def _get_kwargs( + server_id: int, + network_interface_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/api/v3/servers/{server_id}/network-interfaces/{network_interface_id}".format( + server_id=quote(str(server_id), safe=""), + network_interface_id=quote(str(network_interface_id), safe=""), + ), + } + + return _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 + + 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 | EmptyResponse]: + 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, + network_interface_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Delete server network interface + + Delete server network interface + + Args: + server_id (int): + network_interface_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] + """ + + kwargs = _get_kwargs( + server_id=server_id, + network_interface_id=network_interface_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + server_id: int, + network_interface_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Delete server network interface + + Delete server network interface + + Args: + server_id (int): + network_interface_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 + """ + + return sync_detailed( + server_id=server_id, + network_interface_id=network_interface_id, + client=client, + ).parsed + + +async def asyncio_detailed( + server_id: int, + network_interface_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Delete server network interface + + Delete server network interface + + Args: + server_id (int): + network_interface_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] + """ + + kwargs = _get_kwargs( + server_id=server_id, + network_interface_id=network_interface_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + server_id: int, + network_interface_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Delete server network interface + + Delete server network interface + + Args: + server_id (int): + network_interface_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 + """ + + return ( + await asyncio_detailed( + server_id=server_id, + network_interface_id=network_interface_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/server/delete_server_snapshot.py b/src/shellrent_sdk/client/api/server/delete_server_snapshot.py new file mode 100644 index 0000000..f088327 --- /dev/null +++ b/src/shellrent_sdk/client/api/server/delete_server_snapshot.py @@ -0,0 +1,203 @@ +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, + snapshot_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/api/v3/servers/{server_id}/snapshots/{snapshot_id}".format( + server_id=quote(str(server_id), safe=""), + snapshot_id=quote(str(snapshot_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, + snapshot_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | TaskResponse]: + """Delete server snapshot + + Delete a server snapshot + + Args: + server_id (int): + snapshot_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, + snapshot_id=snapshot_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + server_id: int, + snapshot_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | TaskResponse | None: + """Delete server snapshot + + Delete a server snapshot + + Args: + server_id (int): + snapshot_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, + snapshot_id=snapshot_id, + client=client, + ).parsed + + +async def asyncio_detailed( + server_id: int, + snapshot_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | TaskResponse]: + """Delete server snapshot + + Delete a server snapshot + + Args: + server_id (int): + snapshot_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, + snapshot_id=snapshot_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + server_id: int, + snapshot_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | TaskResponse | None: + """Delete server snapshot + + Delete a server snapshot + + Args: + server_id (int): + snapshot_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, + snapshot_id=snapshot_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/server/expose_server_backup.py b/src/shellrent_sdk/client/api/server/expose_server_backup.py new file mode 100644 index 0000000..f408fad --- /dev/null +++ b/src/shellrent_sdk/client/api/server/expose_server_backup.py @@ -0,0 +1,210 @@ +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.server_backup_exhibit_request import ServerBackupExhibitRequest +from ...models.task_response import TaskResponse +from ...types import Response + + +def _get_kwargs( + server_id: int, + *, + body: ServerBackupExhibitRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/servers/{server_id}/backups/exhibit".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()) + + 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, + body: ServerBackupExhibitRequest, +) -> Response[ApiError | TaskResponse]: + """Expose a server backup + + Expose a server backup + + Args: + server_id (int): + body (ServerBackupExhibitRequest): + + 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, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + server_id: int, + *, + client: AuthenticatedClient, + body: ServerBackupExhibitRequest, +) -> ApiError | TaskResponse | None: + """Expose a server backup + + Expose a server backup + + Args: + server_id (int): + body (ServerBackupExhibitRequest): + + 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, + body=body, + ).parsed + + +async def asyncio_detailed( + server_id: int, + *, + client: AuthenticatedClient, + body: ServerBackupExhibitRequest, +) -> Response[ApiError | TaskResponse]: + """Expose a server backup + + Expose a server backup + + Args: + server_id (int): + body (ServerBackupExhibitRequest): + + 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, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + server_id: int, + *, + client: AuthenticatedClient, + body: ServerBackupExhibitRequest, +) -> ApiError | TaskResponse | None: + """Expose a server backup + + Expose a server backup + + Args: + server_id (int): + body (ServerBackupExhibitRequest): + + 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, + body=body, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/server/get_server.py b/src/shellrent_sdk/client/api/server/get_server.py new file mode 100644 index 0000000..d7146ae --- /dev/null +++ b/src/shellrent_sdk/client/api/server/get_server.py @@ -0,0 +1,189 @@ +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.server_response import ServerResponse +from ...types import Response + + +def _get_kwargs( + server_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/servers/{server_id}".format( + server_id=quote(str(server_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | ServerResponse | None: + if response.status_code == 200: + response_200 = ServerResponse.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 | ServerResponse]: + 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 | ServerResponse]: + """Get server + + Get server details + + 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 | ServerResponse] + """ + + 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 | ServerResponse | None: + """Get server + + Get server details + + 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 | ServerResponse + """ + + return sync_detailed( + server_id=server_id, + client=client, + ).parsed + + +async def asyncio_detailed( + server_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ServerResponse]: + """Get server + + Get server details + + 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 | ServerResponse] + """ + + 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 | ServerResponse | None: + """Get server + + Get server details + + 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 | ServerResponse + """ + + return ( + await asyncio_detailed( + server_id=server_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..4ef6dbc --- /dev/null +++ b/src/shellrent_sdk/client/api/server/get_server_automatic_snapshot.py @@ -0,0 +1,189 @@ +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.server_automatic_snapshot_response import ServerAutomaticSnapshotResponse +from ...types import Response + + +def _get_kwargs( + server_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/servers/{server_id}/snapshots/automatic-snapshot".format( + server_id=quote(str(server_id), safe=""), + ), + } + + return _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()) + + 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 | ServerAutomaticSnapshotResponse]: + 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 | ServerAutomaticSnapshotResponse]: + """Get automatic snapshot settings + + Get automatic snapshot settings + + 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 | ServerAutomaticSnapshotResponse] + """ + + 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 | ServerAutomaticSnapshotResponse | None: + """Get automatic snapshot settings + + Get automatic snapshot settings + + 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 | ServerAutomaticSnapshotResponse + """ + + return sync_detailed( + server_id=server_id, + client=client, + ).parsed + + +async def asyncio_detailed( + server_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ServerAutomaticSnapshotResponse]: + """Get automatic snapshot settings + + Get automatic snapshot settings + + 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 | ServerAutomaticSnapshotResponse] + """ + + 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 | ServerAutomaticSnapshotResponse | None: + """Get automatic snapshot settings + + Get automatic snapshot settings + + 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 | ServerAutomaticSnapshotResponse + """ + + return ( + await asyncio_detailed( + server_id=server_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/server/get_server_backup.py b/src/shellrent_sdk/client/api/server/get_server_backup.py new file mode 100644 index 0000000..a196e40 --- /dev/null +++ b/src/shellrent_sdk/client/api/server/get_server_backup.py @@ -0,0 +1,203 @@ +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.server_backup_response import ServerBackupResponse +from ...types import Response + + +def _get_kwargs( + server_id: int, + server_backup_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/servers/{server_id}/backups/{server_backup_id}".format( + server_id=quote(str(server_id), safe=""), + server_backup_id=quote(str(server_backup_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | ServerBackupResponse | None: + if response.status_code == 200: + response_200 = ServerBackupResponse.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 | ServerBackupResponse]: + 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, + server_backup_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ServerBackupResponse]: + """Get server backup + + Get backup details for server + + Args: + server_id (int): + server_backup_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 | ServerBackupResponse] + """ + + kwargs = _get_kwargs( + server_id=server_id, + server_backup_id=server_backup_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + server_id: int, + server_backup_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | ServerBackupResponse | None: + """Get server backup + + Get backup details for server + + Args: + server_id (int): + server_backup_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 | ServerBackupResponse + """ + + return sync_detailed( + server_id=server_id, + server_backup_id=server_backup_id, + client=client, + ).parsed + + +async def asyncio_detailed( + server_id: int, + server_backup_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ServerBackupResponse]: + """Get server backup + + Get backup details for server + + Args: + server_id (int): + server_backup_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 | ServerBackupResponse] + """ + + kwargs = _get_kwargs( + server_id=server_id, + server_backup_id=server_backup_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + server_id: int, + server_backup_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | ServerBackupResponse | None: + """Get server backup + + Get backup details for server + + Args: + server_id (int): + server_backup_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 | ServerBackupResponse + """ + + return ( + await asyncio_detailed( + server_id=server_id, + server_backup_id=server_backup_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..ac24ab1 --- /dev/null +++ b/src/shellrent_sdk/client/api/server/get_server_ip_address.py @@ -0,0 +1,203 @@ +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.ip_address_response import IpAddressResponse +from ...types import Response + + +def _get_kwargs( + server_id: int, + ip_address_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "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=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | IpAddressResponse | None: + if response.status_code == 200: + response_200 = IpAddressResponse.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 | IpAddressResponse]: + 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, + ip_address_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | IpAddressResponse]: + """Get server IP address + + Get IP address details for server + + Args: + server_id (int): + ip_address_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 | IpAddressResponse] + """ + + kwargs = _get_kwargs( + server_id=server_id, + ip_address_id=ip_address_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + server_id: int, + ip_address_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | IpAddressResponse | None: + """Get server IP address + + Get IP address details for server + + Args: + server_id (int): + ip_address_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 | IpAddressResponse + """ + + return sync_detailed( + server_id=server_id, + ip_address_id=ip_address_id, + client=client, + ).parsed + + +async def asyncio_detailed( + server_id: int, + ip_address_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | IpAddressResponse]: + """Get server IP address + + Get IP address details for server + + Args: + server_id (int): + ip_address_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 | IpAddressResponse] + """ + + kwargs = _get_kwargs( + server_id=server_id, + ip_address_id=ip_address_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + server_id: int, + ip_address_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | IpAddressResponse | None: + """Get server IP address + + Get IP address details for server + + Args: + server_id (int): + ip_address_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 | IpAddressResponse + """ + + return ( + await asyncio_detailed( + server_id=server_id, + ip_address_id=ip_address_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..695eff8 --- /dev/null +++ b/src/shellrent_sdk/client/api/server/get_server_network_interface.py @@ -0,0 +1,203 @@ +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.server_network_interface_response import ServerNetworkInterfaceResponse +from ...types import Response + + +def _get_kwargs( + server_id: int, + network_interface_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/servers/{server_id}/network-interfaces/{network_interface_id}".format( + server_id=quote(str(server_id), safe=""), + network_interface_id=quote(str(network_interface_id), safe=""), + ), + } + + return _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()) + + 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 | ServerNetworkInterfaceResponse]: + 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, + network_interface_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ServerNetworkInterfaceResponse]: + """Get server network interface + + Get server network interface + + Args: + server_id (int): + network_interface_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 | ServerNetworkInterfaceResponse] + """ + + kwargs = _get_kwargs( + server_id=server_id, + network_interface_id=network_interface_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + server_id: int, + network_interface_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | ServerNetworkInterfaceResponse | None: + """Get server network interface + + Get server network interface + + Args: + server_id (int): + network_interface_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 | ServerNetworkInterfaceResponse + """ + + return sync_detailed( + server_id=server_id, + network_interface_id=network_interface_id, + client=client, + ).parsed + + +async def asyncio_detailed( + server_id: int, + network_interface_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ServerNetworkInterfaceResponse]: + """Get server network interface + + Get server network interface + + Args: + server_id (int): + network_interface_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 | ServerNetworkInterfaceResponse] + """ + + kwargs = _get_kwargs( + server_id=server_id, + network_interface_id=network_interface_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + server_id: int, + network_interface_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | ServerNetworkInterfaceResponse | None: + """Get server network interface + + Get server network interface + + Args: + server_id (int): + network_interface_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 | ServerNetworkInterfaceResponse + """ + + return ( + await asyncio_detailed( + server_id=server_id, + network_interface_id=network_interface_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..3111ce3 --- /dev/null +++ b/src/shellrent_sdk/client/api/server/get_server_private_cloud.py @@ -0,0 +1,189 @@ +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.private_cloud_response import PrivateCloudResponse +from ...types import Response + + +def _get_kwargs( + server_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/servers/{server_id}/private_cloud".format( + server_id=quote(str(server_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | PrivateCloudResponse | None: + if response.status_code == 200: + response_200 = PrivateCloudResponse.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 | PrivateCloudResponse]: + 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 | PrivateCloudResponse]: + """Get private cloud info + + Get private cloud details for 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 | PrivateCloudResponse] + """ + + 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 | PrivateCloudResponse | None: + """Get private cloud info + + Get private cloud details for 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 | PrivateCloudResponse + """ + + return sync_detailed( + server_id=server_id, + client=client, + ).parsed + + +async def asyncio_detailed( + server_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | PrivateCloudResponse]: + """Get private cloud info + + Get private cloud details for 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 | PrivateCloudResponse] + """ + + 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 | PrivateCloudResponse | None: + """Get private cloud info + + Get private cloud details for 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 | PrivateCloudResponse + """ + + return ( + await asyncio_detailed( + server_id=server_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/server/get_server_snapshot.py b/src/shellrent_sdk/client/api/server/get_server_snapshot.py new file mode 100644 index 0000000..9ad0a6f --- /dev/null +++ b/src/shellrent_sdk/client/api/server/get_server_snapshot.py @@ -0,0 +1,203 @@ +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.server_snapshot_response import ServerSnapshotResponse +from ...types import Response + + +def _get_kwargs( + server_id: int, + snapshot_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/servers/{server_id}/snapshots/{snapshot_id}".format( + server_id=quote(str(server_id), safe=""), + snapshot_id=quote(str(snapshot_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | ServerSnapshotResponse | None: + if response.status_code == 200: + response_200 = ServerSnapshotResponse.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 | ServerSnapshotResponse]: + 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, + snapshot_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ServerSnapshotResponse]: + """Get server snapshot + + Get snapshot details for server + + Args: + server_id (int): + snapshot_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 | ServerSnapshotResponse] + """ + + kwargs = _get_kwargs( + server_id=server_id, + snapshot_id=snapshot_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + server_id: int, + snapshot_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | ServerSnapshotResponse | None: + """Get server snapshot + + Get snapshot details for server + + Args: + server_id (int): + snapshot_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 | ServerSnapshotResponse + """ + + return sync_detailed( + server_id=server_id, + snapshot_id=snapshot_id, + client=client, + ).parsed + + +async def asyncio_detailed( + server_id: int, + snapshot_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ServerSnapshotResponse]: + """Get server snapshot + + Get snapshot details for server + + Args: + server_id (int): + snapshot_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 | ServerSnapshotResponse] + """ + + kwargs = _get_kwargs( + server_id=server_id, + snapshot_id=snapshot_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + server_id: int, + snapshot_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | ServerSnapshotResponse | None: + """Get server snapshot + + Get snapshot details for server + + Args: + server_id (int): + snapshot_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 | ServerSnapshotResponse + """ + + return ( + await asyncio_detailed( + server_id=server_id, + snapshot_id=snapshot_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/server/hard_reboot_server.py b/src/shellrent_sdk/client/api/server/hard_reboot_server.py new file mode 100644 index 0000000..bd88b11 --- /dev/null +++ b/src/shellrent_sdk/client/api/server/hard_reboot_server.py @@ -0,0 +1,189 @@ +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-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]: + """Hard reboot server + + Hard 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: + """Hard reboot server + + Hard 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]: + """Hard reboot server + + Hard 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: + """Hard reboot server + + Hard 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/hard_stop_server.py b/src/shellrent_sdk/client/api/server/hard_stop_server.py new file mode 100644 index 0000000..b4fe224 --- /dev/null +++ b/src/shellrent_sdk/client/api/server/hard_stop_server.py @@ -0,0 +1,189 @@ +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/server/list_server_backups.py b/src/shellrent_sdk/client/api/server/list_server_backups.py new file mode 100644 index 0000000..d050bcc --- /dev/null +++ b/src/shellrent_sdk/client/api/server/list_server_backups.py @@ -0,0 +1,189 @@ +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.server_backup_list_response import ServerBackupListResponse +from ...types import Response + + +def _get_kwargs( + server_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/servers/{server_id}/backups".format( + server_id=quote(str(server_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | ServerBackupListResponse | None: + if response.status_code == 200: + response_200 = ServerBackupListResponse.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 | ServerBackupListResponse]: + 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 | ServerBackupListResponse]: + """List server backups + + Get list of backups for 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 | ServerBackupListResponse] + """ + + 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 | ServerBackupListResponse | None: + """List server backups + + Get list of backups for 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 | ServerBackupListResponse + """ + + return sync_detailed( + server_id=server_id, + client=client, + ).parsed + + +async def asyncio_detailed( + server_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ServerBackupListResponse]: + """List server backups + + Get list of backups for 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 | ServerBackupListResponse] + """ + + 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 | ServerBackupListResponse | None: + """List server backups + + Get list of backups for 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 | ServerBackupListResponse + """ + + return ( + await asyncio_detailed( + server_id=server_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/server/list_server_credentials.py b/src/shellrent_sdk/client/api/server/list_server_credentials.py new file mode 100644 index 0000000..8f1ae75 --- /dev/null +++ b/src/shellrent_sdk/client/api/server/list_server_credentials.py @@ -0,0 +1,189 @@ +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.server_credential_response import ServerCredentialResponse +from ...types import Response + + +def _get_kwargs( + server_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/servers/{server_id}/credentials".format( + server_id=quote(str(server_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | ServerCredentialResponse | None: + if response.status_code == 200: + response_200 = ServerCredentialResponse.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 | ServerCredentialResponse]: + 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 | ServerCredentialResponse]: + """List server credentials + + Get credentials for 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 | ServerCredentialResponse] + """ + + 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 | ServerCredentialResponse | None: + """List server credentials + + Get credentials for 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 | ServerCredentialResponse + """ + + return sync_detailed( + server_id=server_id, + client=client, + ).parsed + + +async def asyncio_detailed( + server_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ServerCredentialResponse]: + """List server credentials + + Get credentials for 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 | ServerCredentialResponse] + """ + + 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 | ServerCredentialResponse | None: + """List server credentials + + Get credentials for 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 | ServerCredentialResponse + """ + + return ( + await asyncio_detailed( + server_id=server_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..f55b94c --- /dev/null +++ b/src/shellrent_sdk/client/api/server/list_server_exposed_backups.py @@ -0,0 +1,189 @@ +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.server_backup_list_response import ServerBackupListResponse +from ...types import Response + + +def _get_kwargs( + server_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/servers/{server_id}/backups/exhibitions".format( + server_id=quote(str(server_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | ServerBackupListResponse | None: + if response.status_code == 200: + response_200 = ServerBackupListResponse.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 | ServerBackupListResponse]: + 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 | ServerBackupListResponse]: + """List exposed server backups + + List server backups + + 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 | ServerBackupListResponse] + """ + + 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 | ServerBackupListResponse | None: + """List exposed server backups + + List server backups + + 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 | ServerBackupListResponse + """ + + return sync_detailed( + server_id=server_id, + client=client, + ).parsed + + +async def asyncio_detailed( + server_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ServerBackupListResponse]: + """List exposed server backups + + List server backups + + 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 | ServerBackupListResponse] + """ + + 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 | ServerBackupListResponse | None: + """List exposed server backups + + List server backups + + 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 | ServerBackupListResponse + """ + + return ( + await asyncio_detailed( + server_id=server_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..0e62fd9 --- /dev/null +++ b/src/shellrent_sdk/client/api/server/list_server_ip_addresses.py @@ -0,0 +1,189 @@ +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.ip_address_list_response import IpAddressListResponse +from ...types import Response + + +def _get_kwargs( + server_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/servers/{server_id}/ip_addresses".format( + server_id=quote(str(server_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | IpAddressListResponse | None: + if response.status_code == 200: + response_200 = IpAddressListResponse.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 | IpAddressListResponse]: + 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 | IpAddressListResponse]: + """List server IP addresses + + Get list of IP addresses for 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 | IpAddressListResponse] + """ + + 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 | IpAddressListResponse | None: + """List server IP addresses + + Get list of IP addresses for 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 | IpAddressListResponse + """ + + return sync_detailed( + server_id=server_id, + client=client, + ).parsed + + +async def asyncio_detailed( + server_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | IpAddressListResponse]: + """List server IP addresses + + Get list of IP addresses for 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 | IpAddressListResponse] + """ + + 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 | IpAddressListResponse | None: + """List server IP addresses + + Get list of IP addresses for 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 | IpAddressListResponse + """ + + return ( + await asyncio_detailed( + server_id=server_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..c6db0ce --- /dev/null +++ b/src/shellrent_sdk/client/api/server/list_server_network_interfaces.py @@ -0,0 +1,189 @@ +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.server_network_interface_list_response import ServerNetworkInterfaceListResponse +from ...types import Response + + +def _get_kwargs( + server_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/servers/{server_id}/network-interfaces".format( + server_id=quote(str(server_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | ServerNetworkInterfaceListResponse | None: + if response.status_code == 200: + response_200 = ServerNetworkInterfaceListResponse.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 | ServerNetworkInterfaceListResponse]: + 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 | ServerNetworkInterfaceListResponse]: + """List server network interfaces + + List server network interfaces + + 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 | ServerNetworkInterfaceListResponse] + """ + + 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 | ServerNetworkInterfaceListResponse | None: + """List server network interfaces + + List server network interfaces + + 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 | ServerNetworkInterfaceListResponse + """ + + return sync_detailed( + server_id=server_id, + client=client, + ).parsed + + +async def asyncio_detailed( + server_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ServerNetworkInterfaceListResponse]: + """List server network interfaces + + List server network interfaces + + 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 | ServerNetworkInterfaceListResponse] + """ + + 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 | ServerNetworkInterfaceListResponse | None: + """List server network interfaces + + List server network interfaces + + 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 | ServerNetworkInterfaceListResponse + """ + + return ( + await asyncio_detailed( + server_id=server_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/server/list_server_snapshots.py b/src/shellrent_sdk/client/api/server/list_server_snapshots.py new file mode 100644 index 0000000..75d1d94 --- /dev/null +++ b/src/shellrent_sdk/client/api/server/list_server_snapshots.py @@ -0,0 +1,225 @@ +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.server_snapshot_paginated_list_response import ServerSnapshotPaginatedListResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + server_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/servers/{server_id}/snapshots".format( + server_id=quote(str(server_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | ServerSnapshotPaginatedListResponse | None: + if response.status_code == 200: + response_200 = ServerSnapshotPaginatedListResponse.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 | ServerSnapshotPaginatedListResponse]: + 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, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | ServerSnapshotPaginatedListResponse]: + """List server snapshots + + Get list of snapshots for server + + Args: + server_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ApiError | ServerSnapshotPaginatedListResponse] + """ + + kwargs = _get_kwargs( + server_id=server_id, + page=page, + per_page=per_page, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + server_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | ServerSnapshotPaginatedListResponse | None: + """List server snapshots + + Get list of snapshots for server + + Args: + server_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ApiError | ServerSnapshotPaginatedListResponse + """ + + return sync_detailed( + server_id=server_id, + client=client, + page=page, + per_page=per_page, + ).parsed + + +async def asyncio_detailed( + server_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | ServerSnapshotPaginatedListResponse]: + """List server snapshots + + Get list of snapshots for server + + Args: + server_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ApiError | ServerSnapshotPaginatedListResponse] + """ + + kwargs = _get_kwargs( + server_id=server_id, + 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( + server_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | ServerSnapshotPaginatedListResponse | None: + """List server snapshots + + Get list of snapshots for server + + Args: + server_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ApiError | ServerSnapshotPaginatedListResponse + """ + + return ( + await asyncio_detailed( + server_id=server_id, + client=client, + page=page, + per_page=per_page, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/server/list_servers.py b/src/shellrent_sdk/client/api/server/list_servers.py new file mode 100644 index 0000000..bb6e281 --- /dev/null +++ b/src/shellrent_sdk/client/api/server/list_servers.py @@ -0,0 +1,209 @@ +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.server_paginated_list_response import ServerPaginatedListResponse +from ...types import UNSET, Response, Unset + + +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/servers", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | ServerPaginatedListResponse | None: + if response.status_code == 200: + response_200 = ServerPaginatedListResponse.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 | ServerPaginatedListResponse]: + 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 = 20, +) -> Response[ApiError | ServerPaginatedListResponse]: + """List servers + + Get list of servers + + 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. + + Returns: + Response[ApiError | ServerPaginatedListResponse] + """ + + 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 = 20, +) -> ApiError | ServerPaginatedListResponse | None: + """List servers + + Get list of servers + + 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. + + Returns: + ApiError | ServerPaginatedListResponse + """ + + 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 | ServerPaginatedListResponse]: + """List servers + + Get list of servers + + 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. + + Returns: + Response[ApiError | ServerPaginatedListResponse] + """ + + 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 = 20, +) -> ApiError | ServerPaginatedListResponse | None: + """List servers + + Get list of servers + + 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. + + Returns: + ApiError | ServerPaginatedListResponse + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + per_page=per_page, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/server/reboot_server.py b/src/shellrent_sdk/client/api/server/reboot_server.py new file mode 100644 index 0000000..31909d9 --- /dev/null +++ b/src/shellrent_sdk/client/api/server/reboot_server.py @@ -0,0 +1,189 @@ +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 new file mode 100644 index 0000000..4afd8f4 --- /dev/null +++ b/src/shellrent_sdk/client/api/server/reinstall_server.py @@ -0,0 +1,211 @@ +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.server_reinstall_request import ServerReinstallRequest +from ...models.task_response import TaskResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + server_id: int, + *, + body: ServerReinstallRequest | Unset = UNSET, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/servers/{server_id}/reinstall".format( + server_id=quote(str(server_id), safe=""), + ), + } + + if not isinstance(body, Unset): + _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( + server_id: int, + *, + client: AuthenticatedClient, + body: ServerReinstallRequest | Unset = UNSET, +) -> Response[ApiError | TaskResponse]: + """Reinstall server + + Reinstall server + + Args: + server_id (int): + body (ServerReinstallRequest | Unset): + + 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, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + server_id: int, + *, + client: AuthenticatedClient, + body: ServerReinstallRequest | Unset = UNSET, +) -> ApiError | TaskResponse | None: + """Reinstall server + + Reinstall server + + Args: + server_id (int): + body (ServerReinstallRequest | Unset): + + 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, + body=body, + ).parsed + + +async def asyncio_detailed( + server_id: int, + *, + client: AuthenticatedClient, + body: ServerReinstallRequest | Unset = UNSET, +) -> Response[ApiError | TaskResponse]: + """Reinstall server + + Reinstall server + + Args: + server_id (int): + body (ServerReinstallRequest | Unset): + + 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, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + server_id: int, + *, + client: AuthenticatedClient, + body: ServerReinstallRequest | Unset = UNSET, +) -> ApiError | TaskResponse | None: + """Reinstall server + + Reinstall server + + Args: + server_id (int): + body (ServerReinstallRequest | Unset): + + 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, + body=body, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/server/restore_server_backup.py b/src/shellrent_sdk/client/api/server/restore_server_backup.py new file mode 100644 index 0000000..ff8ad99 --- /dev/null +++ b/src/shellrent_sdk/client/api/server/restore_server_backup.py @@ -0,0 +1,203 @@ +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, + server_backup_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/servers/{server_id}/backups/{server_backup_id}/restore".format( + server_id=quote(str(server_id), safe=""), + server_backup_id=quote(str(server_backup_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, + server_backup_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | TaskResponse]: + """Restore server backup + + Restore a server backup + + Args: + server_id (int): + server_backup_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, + server_backup_id=server_backup_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + server_id: int, + server_backup_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | TaskResponse | None: + """Restore server backup + + Restore a server backup + + Args: + server_id (int): + server_backup_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, + server_backup_id=server_backup_id, + client=client, + ).parsed + + +async def asyncio_detailed( + server_id: int, + server_backup_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | TaskResponse]: + """Restore server backup + + Restore a server backup + + Args: + server_id (int): + server_backup_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, + server_backup_id=server_backup_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + server_id: int, + server_backup_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | TaskResponse | None: + """Restore server backup + + Restore a server backup + + Args: + server_id (int): + server_backup_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, + server_backup_id=server_backup_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/server/restore_server_snapshot.py b/src/shellrent_sdk/client/api/server/restore_server_snapshot.py new file mode 100644 index 0000000..e239c88 --- /dev/null +++ b/src/shellrent_sdk/client/api/server/restore_server_snapshot.py @@ -0,0 +1,203 @@ +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, + snapshot_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/servers/{server_id}/snapshots/{snapshot_id}/restore".format( + server_id=quote(str(server_id), safe=""), + snapshot_id=quote(str(snapshot_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, + snapshot_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | TaskResponse]: + """Restore server snapshot + + Restore a server snapshot + + Args: + server_id (int): + snapshot_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, + snapshot_id=snapshot_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + server_id: int, + snapshot_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | TaskResponse | None: + """Restore server snapshot + + Restore a server snapshot + + Args: + server_id (int): + snapshot_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, + snapshot_id=snapshot_id, + client=client, + ).parsed + + +async def asyncio_detailed( + server_id: int, + snapshot_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | TaskResponse]: + """Restore server snapshot + + Restore a server snapshot + + Args: + server_id (int): + snapshot_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, + snapshot_id=snapshot_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + server_id: int, + snapshot_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | TaskResponse | None: + """Restore server snapshot + + Restore a server snapshot + + Args: + server_id (int): + snapshot_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, + snapshot_id=snapshot_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/server/start_server.py b/src/shellrent_sdk/client/api/server/start_server.py new file mode 100644 index 0000000..08f5efd --- /dev/null +++ b/src/shellrent_sdk/client/api/server/start_server.py @@ -0,0 +1,189 @@ +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 new file mode 100644 index 0000000..3d5f9a1 --- /dev/null +++ b/src/shellrent_sdk/client/api/server/start_server_first_backup.py @@ -0,0 +1,189 @@ +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 new file mode 100644 index 0000000..cfda508 --- /dev/null +++ b/src/shellrent_sdk/client/api/server/stop_server.py @@ -0,0 +1,189 @@ +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 new file mode 100644 index 0000000..c1cffe9 --- /dev/null +++ b/src/shellrent_sdk/client/api/server/update_private_cloud_virtual_machine.py @@ -0,0 +1,224 @@ +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.private_cloud_vm_update_request import PrivateCloudVmUpdateRequest +from ...models.task_response import TaskResponse +from ...types import Response + + +def _get_kwargs( + server_id: int, + vm_id: int, + *, + body: PrivateCloudVmUpdateRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "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=""), + ), + } + + _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( + server_id: int, + vm_id: int, + *, + client: AuthenticatedClient, + body: PrivateCloudVmUpdateRequest, +) -> Response[ApiError | TaskResponse]: + """Update private cloud VM + + Update private cloud VM + + Args: + server_id (int): + vm_id (int): + body (PrivateCloudVmUpdateRequest): + + 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, + vm_id=vm_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + server_id: int, + vm_id: int, + *, + client: AuthenticatedClient, + body: PrivateCloudVmUpdateRequest, +) -> ApiError | TaskResponse | None: + """Update private cloud VM + + Update private cloud VM + + Args: + server_id (int): + vm_id (int): + body (PrivateCloudVmUpdateRequest): + + 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, + vm_id=vm_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + server_id: int, + vm_id: int, + *, + client: AuthenticatedClient, + body: PrivateCloudVmUpdateRequest, +) -> Response[ApiError | TaskResponse]: + """Update private cloud VM + + Update private cloud VM + + Args: + server_id (int): + vm_id (int): + body (PrivateCloudVmUpdateRequest): + + 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, + vm_id=vm_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + server_id: int, + vm_id: int, + *, + client: AuthenticatedClient, + body: PrivateCloudVmUpdateRequest, +) -> ApiError | TaskResponse | None: + """Update private cloud VM + + Update private cloud VM + + Args: + server_id (int): + vm_id (int): + body (PrivateCloudVmUpdateRequest): + + 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, + vm_id=vm_id, + client=client, + body=body, + ) + ).parsed 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 new file mode 100644 index 0000000..15db4a9 --- /dev/null +++ b/src/shellrent_sdk/client/api/server/update_server_automatic_snapshot.py @@ -0,0 +1,210 @@ +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.server_automatic_snapshot_request import ServerAutomaticSnapshotRequest +from ...models.server_automatic_snapshot_response import ServerAutomaticSnapshotResponse +from ...types import Response + + +def _get_kwargs( + server_id: int, + *, + body: ServerAutomaticSnapshotRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/api/v3/servers/{server_id}/snapshots/automatic-snapshot".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 | ServerAutomaticSnapshotResponse | None: + if response.status_code == 200: + response_200 = ServerAutomaticSnapshotResponse.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 | ServerAutomaticSnapshotResponse]: + 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, + body: ServerAutomaticSnapshotRequest, +) -> Response[ApiError | ServerAutomaticSnapshotResponse]: + """Update automatic snapshot settings + + Update automatic snapshot settings + + Args: + server_id (int): + body (ServerAutomaticSnapshotRequest): + + 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 | ServerAutomaticSnapshotResponse] + """ + + kwargs = _get_kwargs( + server_id=server_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + server_id: int, + *, + client: AuthenticatedClient, + body: ServerAutomaticSnapshotRequest, +) -> ApiError | ServerAutomaticSnapshotResponse | None: + """Update automatic snapshot settings + + Update automatic snapshot settings + + Args: + server_id (int): + body (ServerAutomaticSnapshotRequest): + + 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 | ServerAutomaticSnapshotResponse + """ + + return sync_detailed( + server_id=server_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + server_id: int, + *, + client: AuthenticatedClient, + body: ServerAutomaticSnapshotRequest, +) -> Response[ApiError | ServerAutomaticSnapshotResponse]: + """Update automatic snapshot settings + + Update automatic snapshot settings + + Args: + server_id (int): + body (ServerAutomaticSnapshotRequest): + + 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 | ServerAutomaticSnapshotResponse] + """ + + kwargs = _get_kwargs( + server_id=server_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + server_id: int, + *, + client: AuthenticatedClient, + body: ServerAutomaticSnapshotRequest, +) -> ApiError | ServerAutomaticSnapshotResponse | None: + """Update automatic snapshot settings + + Update automatic snapshot settings + + Args: + server_id (int): + body (ServerAutomaticSnapshotRequest): + + 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 | ServerAutomaticSnapshotResponse + """ + + return ( + await asyncio_detailed( + server_id=server_id, + client=client, + body=body, + ) + ).parsed 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 new file mode 100644 index 0000000..53881e4 --- /dev/null +++ b/src/shellrent_sdk/client/api/server/update_server_ip_address_reverse_dns.py @@ -0,0 +1,224 @@ +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.ip_address_response import IpAddressResponse +from ...models.server_ip_address_reverse_update_request import ServerIpAddressReverseUpdateRequest +from ...types import Response + + +def _get_kwargs( + server_id: int, + ip_address_id: int, + *, + body: ServerIpAddressReverseUpdateRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "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=""), + ), + } + + _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 | IpAddressResponse | None: + if response.status_code == 200: + response_200 = IpAddressResponse.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 | IpAddressResponse]: + 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, + ip_address_id: int, + *, + client: AuthenticatedClient, + body: ServerIpAddressReverseUpdateRequest, +) -> Response[ApiError | IpAddressResponse]: + """Update IP reverse DNS + + Update reverse DNS for an IP address + + Args: + server_id (int): + ip_address_id (int): + body (ServerIpAddressReverseUpdateRequest): + + 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 | IpAddressResponse] + """ + + kwargs = _get_kwargs( + server_id=server_id, + ip_address_id=ip_address_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + server_id: int, + ip_address_id: int, + *, + client: AuthenticatedClient, + body: ServerIpAddressReverseUpdateRequest, +) -> ApiError | IpAddressResponse | None: + """Update IP reverse DNS + + Update reverse DNS for an IP address + + Args: + server_id (int): + ip_address_id (int): + body (ServerIpAddressReverseUpdateRequest): + + 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 | IpAddressResponse + """ + + return sync_detailed( + server_id=server_id, + ip_address_id=ip_address_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + server_id: int, + ip_address_id: int, + *, + client: AuthenticatedClient, + body: ServerIpAddressReverseUpdateRequest, +) -> Response[ApiError | IpAddressResponse]: + """Update IP reverse DNS + + Update reverse DNS for an IP address + + Args: + server_id (int): + ip_address_id (int): + body (ServerIpAddressReverseUpdateRequest): + + 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 | IpAddressResponse] + """ + + kwargs = _get_kwargs( + server_id=server_id, + ip_address_id=ip_address_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + server_id: int, + ip_address_id: int, + *, + client: AuthenticatedClient, + body: ServerIpAddressReverseUpdateRequest, +) -> ApiError | IpAddressResponse | None: + """Update IP reverse DNS + + Update reverse DNS for an IP address + + Args: + server_id (int): + ip_address_id (int): + body (ServerIpAddressReverseUpdateRequest): + + 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 | IpAddressResponse + """ + + return ( + await asyncio_detailed( + server_id=server_id, + ip_address_id=ip_address_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/shop/__init__.py b/src/shellrent_sdk/client/api/shop/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/src/shellrent_sdk/client/api/shop/buy_active_monitoring.py b/src/shellrent_sdk/client/api/shop/buy_active_monitoring.py new file mode 100644 index 0000000..dcb18e2 --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/buy_active_monitoring.py @@ -0,0 +1,194 @@ +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_active_monitoring_request import BuyServiceActiveMonitoringRequest +from ...models.order_list_response import OrderListResponse +from ...types import Response + + +def _get_kwargs( + *, + body: BuyServiceActiveMonitoringRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/shop/active-monitoring", + } + + _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: BuyServiceActiveMonitoringRequest, +) -> Response[ApiError | OrderListResponse]: + """Buy Active Monitoring + + Buy a new Active Monitoring product + + Args: + body (BuyServiceActiveMonitoringRequest): + + 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: BuyServiceActiveMonitoringRequest, +) -> ApiError | OrderListResponse | None: + """Buy Active Monitoring + + Buy a new Active Monitoring product + + Args: + body (BuyServiceActiveMonitoringRequest): + + 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: BuyServiceActiveMonitoringRequest, +) -> Response[ApiError | OrderListResponse]: + """Buy Active Monitoring + + Buy a new Active Monitoring product + + Args: + body (BuyServiceActiveMonitoringRequest): + + 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: BuyServiceActiveMonitoringRequest, +) -> ApiError | OrderListResponse | None: + """Buy Active Monitoring + + Buy a new Active Monitoring product + + Args: + body (BuyServiceActiveMonitoringRequest): + + 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_cloud_storage.py b/src/shellrent_sdk/client/api/shop/buy_cloud_storage.py new file mode 100644 index 0000000..19a8a70 --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/buy_cloud_storage.py @@ -0,0 +1,194 @@ +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_cloud_storage_request import BuyServiceCloudStorageRequest +from ...models.order_list_response import OrderListResponse +from ...types import Response + + +def _get_kwargs( + *, + body: BuyServiceCloudStorageRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/shop/cloud-storage", + } + + _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: BuyServiceCloudStorageRequest, +) -> Response[ApiError | OrderListResponse]: + """Buy Cloud Storage + + Buy a new Cloud Storage product + + Args: + body (BuyServiceCloudStorageRequest): + + 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: BuyServiceCloudStorageRequest, +) -> ApiError | OrderListResponse | None: + """Buy Cloud Storage + + Buy a new Cloud Storage product + + Args: + body (BuyServiceCloudStorageRequest): + + 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: BuyServiceCloudStorageRequest, +) -> Response[ApiError | OrderListResponse]: + """Buy Cloud Storage + + Buy a new Cloud Storage product + + Args: + body (BuyServiceCloudStorageRequest): + + 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: BuyServiceCloudStorageRequest, +) -> ApiError | OrderListResponse | None: + """Buy Cloud Storage + + Buy a new Cloud Storage product + + Args: + body (BuyServiceCloudStorageRequest): + + 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_cloud_vps.py b/src/shellrent_sdk/client/api/shop/buy_cloud_vps.py new file mode 100644 index 0000000..8614e00 --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/buy_cloud_vps.py @@ -0,0 +1,194 @@ +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_cloud_vps_request import BuyServiceCloudVpsRequest +from ...models.order_list_response import OrderListResponse +from ...types import Response + + +def _get_kwargs( + *, + body: BuyServiceCloudVpsRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/shop/cloud-vps", + } + + _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: BuyServiceCloudVpsRequest, +) -> Response[ApiError | OrderListResponse]: + """Buy Cloud VPS + + Buy a new Cloud VPS product + + Args: + body (BuyServiceCloudVpsRequest): + + 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: BuyServiceCloudVpsRequest, +) -> ApiError | OrderListResponse | None: + """Buy Cloud VPS + + Buy a new Cloud VPS product + + Args: + body (BuyServiceCloudVpsRequest): + + 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: BuyServiceCloudVpsRequest, +) -> Response[ApiError | OrderListResponse]: + """Buy Cloud VPS + + Buy a new Cloud VPS product + + Args: + body (BuyServiceCloudVpsRequest): + + 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: BuyServiceCloudVpsRequest, +) -> ApiError | OrderListResponse | None: + """Buy Cloud VPS + + Buy a new Cloud VPS product + + Args: + body (BuyServiceCloudVpsRequest): + + 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_cpanel_license.py b/src/shellrent_sdk/client/api/shop/buy_cpanel_license.py new file mode 100644 index 0000000..1ab9e98 --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/buy_cpanel_license.py @@ -0,0 +1,194 @@ +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_cpanel_license_request import BuyServiceCpanelLicenseRequest +from ...models.order_list_response import OrderListResponse +from ...types import Response + + +def _get_kwargs( + *, + body: BuyServiceCpanelLicenseRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/shop/cpanel-license", + } + + _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: BuyServiceCpanelLicenseRequest, +) -> Response[ApiError | OrderListResponse]: + """Buy cPanel license + + Buy a new cPanel license product + + Args: + body (BuyServiceCpanelLicenseRequest): + + 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: BuyServiceCpanelLicenseRequest, +) -> ApiError | OrderListResponse | None: + """Buy cPanel license + + Buy a new cPanel license product + + Args: + body (BuyServiceCpanelLicenseRequest): + + 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: BuyServiceCpanelLicenseRequest, +) -> Response[ApiError | OrderListResponse]: + """Buy cPanel license + + Buy a new cPanel license product + + Args: + body (BuyServiceCpanelLicenseRequest): + + 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: BuyServiceCpanelLicenseRequest, +) -> ApiError | OrderListResponse | None: + """Buy cPanel license + + Buy a new cPanel license product + + Args: + body (BuyServiceCpanelLicenseRequest): + + 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_dedicated_server.py b/src/shellrent_sdk/client/api/shop/buy_dedicated_server.py new file mode 100644 index 0000000..b3412a6 --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/buy_dedicated_server.py @@ -0,0 +1,194 @@ +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_dedicated_server_request import BuyServiceDedicatedServerRequest +from ...models.order_list_response import OrderListResponse +from ...types import Response + + +def _get_kwargs( + *, + body: BuyServiceDedicatedServerRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/shop/dedicated-server", + } + + _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: BuyServiceDedicatedServerRequest, +) -> Response[ApiError | OrderListResponse]: + """Buy Dedicated Server + + Buy a new Dedicated Server product + + Args: + body (BuyServiceDedicatedServerRequest): + + 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: BuyServiceDedicatedServerRequest, +) -> ApiError | OrderListResponse | None: + """Buy Dedicated Server + + Buy a new Dedicated Server product + + Args: + body (BuyServiceDedicatedServerRequest): + + 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: BuyServiceDedicatedServerRequest, +) -> Response[ApiError | OrderListResponse]: + """Buy Dedicated Server + + Buy a new Dedicated Server product + + Args: + body (BuyServiceDedicatedServerRequest): + + 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: BuyServiceDedicatedServerRequest, +) -> ApiError | OrderListResponse | None: + """Buy Dedicated Server + + Buy a new Dedicated Server product + + Args: + body (BuyServiceDedicatedServerRequest): + + 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_domain.py b/src/shellrent_sdk/client/api/shop/buy_domain.py new file mode 100644 index 0000000..ad7032d --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/buy_domain.py @@ -0,0 +1,194 @@ +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_domain_request import BuyServiceDomainRequest +from ...models.order_list_response import OrderListResponse +from ...types import Response + + +def _get_kwargs( + *, + body: BuyServiceDomainRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/shop/domain", + } + + _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: BuyServiceDomainRequest, +) -> Response[ApiError | OrderListResponse]: + """Buy Domain + + Buy a new Domain + + Args: + body (BuyServiceDomainRequest): + + 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: BuyServiceDomainRequest, +) -> ApiError | OrderListResponse | None: + """Buy Domain + + Buy a new Domain + + Args: + body (BuyServiceDomainRequest): + + 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: BuyServiceDomainRequest, +) -> Response[ApiError | OrderListResponse]: + """Buy Domain + + Buy a new Domain + + Args: + body (BuyServiceDomainRequest): + + 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: BuyServiceDomainRequest, +) -> ApiError | OrderListResponse | None: + """Buy Domain + + Buy a new Domain + + Args: + body (BuyServiceDomainRequest): + + 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_microsoft_365_subscription.py b/src/shellrent_sdk/client/api/shop/buy_microsoft_365_subscription.py new file mode 100644 index 0000000..08caf2b --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/buy_microsoft_365_subscription.py @@ -0,0 +1,194 @@ +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_microsoft_365_request import BuyServiceMicrosoft365Request +from ...models.order_list_response import OrderListResponse +from ...types import Response + + +def _get_kwargs( + *, + body: BuyServiceMicrosoft365Request, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/shop/microsoft-365", + } + + _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: BuyServiceMicrosoft365Request, +) -> Response[ApiError | OrderListResponse]: + """Buy Microsoft 365 subscription + + Buy a new Microsoft 365 subscription + + Args: + body (BuyServiceMicrosoft365Request): + + 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: BuyServiceMicrosoft365Request, +) -> ApiError | OrderListResponse | None: + """Buy Microsoft 365 subscription + + Buy a new Microsoft 365 subscription + + Args: + body (BuyServiceMicrosoft365Request): + + 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: BuyServiceMicrosoft365Request, +) -> Response[ApiError | OrderListResponse]: + """Buy Microsoft 365 subscription + + Buy a new Microsoft 365 subscription + + Args: + body (BuyServiceMicrosoft365Request): + + 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: BuyServiceMicrosoft365Request, +) -> ApiError | OrderListResponse | None: + """Buy Microsoft 365 subscription + + Buy a new Microsoft 365 subscription + + Args: + body (BuyServiceMicrosoft365Request): + + 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_object_storage.py b/src/shellrent_sdk/client/api/shop/buy_object_storage.py new file mode 100644 index 0000000..3328f0b --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/buy_object_storage.py @@ -0,0 +1,194 @@ +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_object_storage_request import BuyServiceObjectStorageRequest +from ...models.order_list_response import OrderListResponse +from ...types import Response + + +def _get_kwargs( + *, + body: BuyServiceObjectStorageRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/shop/object-storage", + } + + _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: BuyServiceObjectStorageRequest, +) -> Response[ApiError | OrderListResponse]: + """Buy Object Storage + + Buy a new Object Storage product + + Args: + body (BuyServiceObjectStorageRequest): + + 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: BuyServiceObjectStorageRequest, +) -> ApiError | OrderListResponse | None: + """Buy Object Storage + + Buy a new Object Storage product + + Args: + body (BuyServiceObjectStorageRequest): + + 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: BuyServiceObjectStorageRequest, +) -> Response[ApiError | OrderListResponse]: + """Buy Object Storage + + Buy a new Object Storage product + + Args: + body (BuyServiceObjectStorageRequest): + + 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: BuyServiceObjectStorageRequest, +) -> ApiError | OrderListResponse | None: + """Buy Object Storage + + Buy a new Object Storage product + + Args: + body (BuyServiceObjectStorageRequest): + + 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_pec.py b/src/shellrent_sdk/client/api/shop/buy_pec.py new file mode 100644 index 0000000..b85679d --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/buy_pec.py @@ -0,0 +1,194 @@ +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_pec_request import BuyServicePecRequest +from ...models.order_list_response import OrderListResponse +from ...types import Response + + +def _get_kwargs( + *, + body: BuyServicePecRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/shop/pec", + } + + _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: BuyServicePecRequest, +) -> Response[ApiError | OrderListResponse]: + """Buy PEC + + Buy a new PEC product + + Args: + body (BuyServicePecRequest): + + 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: BuyServicePecRequest, +) -> ApiError | OrderListResponse | None: + """Buy PEC + + Buy a new PEC product + + Args: + body (BuyServicePecRequest): + + 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: BuyServicePecRequest, +) -> Response[ApiError | OrderListResponse]: + """Buy PEC + + Buy a new PEC product + + Args: + body (BuyServicePecRequest): + + 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: BuyServicePecRequest, +) -> ApiError | OrderListResponse | None: + """Buy PEC + + Buy a new PEC product + + Args: + body (BuyServicePecRequest): + + 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_pec_domain.py b/src/shellrent_sdk/client/api/shop/buy_pec_domain.py new file mode 100644 index 0000000..737d853 --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/buy_pec_domain.py @@ -0,0 +1,194 @@ +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_pec_domain_request import BuyServicePecDomainRequest +from ...models.order_list_response import OrderListResponse +from ...types import Response + + +def _get_kwargs( + *, + body: BuyServicePecDomainRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/shop/pec-domain", + } + + _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: BuyServicePecDomainRequest, +) -> Response[ApiError | OrderListResponse]: + """Buy PEC Domain + + Buy a new PEC Domain product + + Args: + body (BuyServicePecDomainRequest): + + 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: BuyServicePecDomainRequest, +) -> ApiError | OrderListResponse | None: + """Buy PEC Domain + + Buy a new PEC Domain product + + Args: + body (BuyServicePecDomainRequest): + + 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: BuyServicePecDomainRequest, +) -> Response[ApiError | OrderListResponse]: + """Buy PEC Domain + + Buy a new PEC Domain product + + Args: + body (BuyServicePecDomainRequest): + + 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: BuyServicePecDomainRequest, +) -> ApiError | OrderListResponse | None: + """Buy PEC Domain + + Buy a new PEC Domain product + + Args: + body (BuyServicePecDomainRequest): + + 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_plesk_license.py b/src/shellrent_sdk/client/api/shop/buy_plesk_license.py new file mode 100644 index 0000000..f55b084 --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/buy_plesk_license.py @@ -0,0 +1,194 @@ +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_plesk_license_request import BuyServicePleskLicenseRequest +from ...models.order_list_response import OrderListResponse +from ...types import Response + + +def _get_kwargs( + *, + body: BuyServicePleskLicenseRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/shop/plesk-license", + } + + _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: BuyServicePleskLicenseRequest, +) -> Response[ApiError | OrderListResponse]: + """Buy Plesk license + + Buy a new Plesk license product + + Args: + body (BuyServicePleskLicenseRequest): + + 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: BuyServicePleskLicenseRequest, +) -> ApiError | OrderListResponse | None: + """Buy Plesk license + + Buy a new Plesk license product + + Args: + body (BuyServicePleskLicenseRequest): + + 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: BuyServicePleskLicenseRequest, +) -> Response[ApiError | OrderListResponse]: + """Buy Plesk license + + Buy a new Plesk license product + + Args: + body (BuyServicePleskLicenseRequest): + + 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: BuyServicePleskLicenseRequest, +) -> ApiError | OrderListResponse | None: + """Buy Plesk license + + Buy a new Plesk license product + + Args: + body (BuyServicePleskLicenseRequest): + + 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_private_cloud_sv.py b/src/shellrent_sdk/client/api/shop/buy_private_cloud_sv.py new file mode 100644 index 0000000..3d6429b --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/buy_private_cloud_sv.py @@ -0,0 +1,194 @@ +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_private_cloud_sv_request import BuyServicePrivateCloudSvRequest +from ...models.order_list_response import OrderListResponse +from ...types import Response + + +def _get_kwargs( + *, + body: BuyServicePrivateCloudSvRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/shop/private-cloud-sv", + } + + _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: BuyServicePrivateCloudSvRequest, +) -> Response[ApiError | OrderListResponse]: + """Buy Private Cloud SV + + Buy a new Private Cloud SV product + + Args: + body (BuyServicePrivateCloudSvRequest): + + 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: BuyServicePrivateCloudSvRequest, +) -> ApiError | OrderListResponse | None: + """Buy Private Cloud SV + + Buy a new Private Cloud SV product + + Args: + body (BuyServicePrivateCloudSvRequest): + + 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: BuyServicePrivateCloudSvRequest, +) -> Response[ApiError | OrderListResponse]: + """Buy Private Cloud SV + + Buy a new Private Cloud SV product + + Args: + body (BuyServicePrivateCloudSvRequest): + + 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: BuyServicePrivateCloudSvRequest, +) -> ApiError | OrderListResponse | None: + """Buy Private Cloud SV + + Buy a new Private Cloud SV product + + Args: + body (BuyServicePrivateCloudSvRequest): + + 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.py b/src/shellrent_sdk/client/api/shop/buy_secure_mail.py new file mode 100644 index 0000000..036aede --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/buy_secure_mail.py @@ -0,0 +1,194 @@ +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 new file mode 100644 index 0000000..9e75dde --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/buy_secure_mail_for_google_workspace.py @@ -0,0 +1,196 @@ +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 new file mode 100644 index 0000000..b322e53 --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/buy_secure_mail_for_microsoft_365.py @@ -0,0 +1,196 @@ +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 new file mode 100644 index 0000000..fbf1ad8 --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/buy_sms_topup.py @@ -0,0 +1,194 @@ +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_sms_request import BuyServiceSmsRequest +from ...models.order_list_response import OrderListResponse +from ...types import Response + + +def _get_kwargs( + *, + body: BuyServiceSmsRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/shop/sms-topup", + } + + _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: BuyServiceSmsRequest, +) -> Response[ApiError | OrderListResponse]: + """Buy SMS topup + + Buy a new SMS topup product + + Args: + body (BuyServiceSmsRequest): + + 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: BuyServiceSmsRequest, +) -> ApiError | OrderListResponse | None: + """Buy SMS topup + + Buy a new SMS topup product + + Args: + body (BuyServiceSmsRequest): + + 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: BuyServiceSmsRequest, +) -> Response[ApiError | OrderListResponse]: + """Buy SMS topup + + Buy a new SMS topup product + + Args: + body (BuyServiceSmsRequest): + + 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: BuyServiceSmsRequest, +) -> ApiError | OrderListResponse | None: + """Buy SMS topup + + Buy a new SMS topup product + + Args: + body (BuyServiceSmsRequest): + + 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_ssl_certificate.py b/src/shellrent_sdk/client/api/shop/buy_ssl_certificate.py new file mode 100644 index 0000000..a8a6ce1 --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/buy_ssl_certificate.py @@ -0,0 +1,194 @@ +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_ssl_certificate_request import BuyServiceSslCertificateRequest +from ...models.order_list_response import OrderListResponse +from ...types import Response + + +def _get_kwargs( + *, + body: BuyServiceSslCertificateRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/shop/ssl-certificate", + } + + _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: BuyServiceSslCertificateRequest, +) -> Response[ApiError | OrderListResponse]: + """Buy SSL/TLS Certificate + + Buy a new SSL/TLS Certificate product + + Args: + body (BuyServiceSslCertificateRequest): + + 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: BuyServiceSslCertificateRequest, +) -> ApiError | OrderListResponse | None: + """Buy SSL/TLS Certificate + + Buy a new SSL/TLS Certificate product + + Args: + body (BuyServiceSslCertificateRequest): + + 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: BuyServiceSslCertificateRequest, +) -> Response[ApiError | OrderListResponse]: + """Buy SSL/TLS Certificate + + Buy a new SSL/TLS Certificate product + + Args: + body (BuyServiceSslCertificateRequest): + + 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: BuyServiceSslCertificateRequest, +) -> ApiError | OrderListResponse | None: + """Buy SSL/TLS Certificate + + Buy a new SSL/TLS Certificate product + + Args: + body (BuyServiceSslCertificateRequest): + + 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_veeam_baas.py b/src/shellrent_sdk/client/api/shop/buy_veeam_baas.py new file mode 100644 index 0000000..432b0c7 --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/buy_veeam_baas.py @@ -0,0 +1,194 @@ +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_veeam_baas_request import BuyServiceVeeamBaasRequest +from ...models.order_list_response import OrderListResponse +from ...types import Response + + +def _get_kwargs( + *, + body: BuyServiceVeeamBaasRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/shop/veeam-baas", + } + + _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: BuyServiceVeeamBaasRequest, +) -> Response[ApiError | OrderListResponse]: + """Buy Veeam BaaS + + Buy a new Veeam Backup as a Service product + + Args: + body (BuyServiceVeeamBaasRequest): + + 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: BuyServiceVeeamBaasRequest, +) -> ApiError | OrderListResponse | None: + """Buy Veeam BaaS + + Buy a new Veeam Backup as a Service product + + Args: + body (BuyServiceVeeamBaasRequest): + + 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: BuyServiceVeeamBaasRequest, +) -> Response[ApiError | OrderListResponse]: + """Buy Veeam BaaS + + Buy a new Veeam Backup as a Service product + + Args: + body (BuyServiceVeeamBaasRequest): + + 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: BuyServiceVeeamBaasRequest, +) -> ApiError | OrderListResponse | None: + """Buy Veeam BaaS + + Buy a new Veeam Backup as a Service product + + Args: + body (BuyServiceVeeamBaasRequest): + + 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/can_cancel_order.py b/src/shellrent_sdk/client/api/shop/can_cancel_order.py new file mode 100644 index 0000000..d84e9be --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/can_cancel_order.py @@ -0,0 +1,189 @@ +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_can_cancel_response import OrderCanCancelResponse +from ...types import Response + + +def _get_kwargs( + order_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/orders/{order_id}/can-cancel".format( + order_id=quote(str(order_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | OrderCanCancelResponse | None: + if response.status_code == 200: + response_200 = OrderCanCancelResponse.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 | OrderCanCancelResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + order_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | OrderCanCancelResponse]: + """Can cancel order + + Know if it's possible to cancel an Order + + Args: + order_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 | OrderCanCancelResponse] + """ + + kwargs = _get_kwargs( + order_id=order_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + order_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | OrderCanCancelResponse | None: + """Can cancel order + + Know if it's possible to cancel an Order + + Args: + order_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 | OrderCanCancelResponse + """ + + return sync_detailed( + order_id=order_id, + client=client, + ).parsed + + +async def asyncio_detailed( + order_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | OrderCanCancelResponse]: + """Can cancel order + + Know if it's possible to cancel an Order + + Args: + order_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 | OrderCanCancelResponse] + """ + + kwargs = _get_kwargs( + order_id=order_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + order_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | OrderCanCancelResponse | None: + """Can cancel order + + Know if it's possible to cancel an Order + + Args: + order_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 | OrderCanCancelResponse + """ + + return ( + await asyncio_detailed( + order_id=order_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/shop/can_pay_order.py b/src/shellrent_sdk/client/api/shop/can_pay_order.py new file mode 100644 index 0000000..4dd165f --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/can_pay_order.py @@ -0,0 +1,189 @@ +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_can_pay_response import OrderCanPayResponse +from ...types import Response + + +def _get_kwargs( + order_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/orders/{order_id}/can-pay".format( + order_id=quote(str(order_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | OrderCanPayResponse | None: + if response.status_code == 200: + response_200 = OrderCanPayResponse.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 | OrderCanPayResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + order_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | OrderCanPayResponse]: + """Can pay Order + + Know if it's possible to complete the payment for an Order + + Args: + order_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 | OrderCanPayResponse] + """ + + kwargs = _get_kwargs( + order_id=order_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + order_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | OrderCanPayResponse | None: + """Can pay Order + + Know if it's possible to complete the payment for an Order + + Args: + order_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 | OrderCanPayResponse + """ + + return sync_detailed( + order_id=order_id, + client=client, + ).parsed + + +async def asyncio_detailed( + order_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | OrderCanPayResponse]: + """Can pay Order + + Know if it's possible to complete the payment for an Order + + Args: + order_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 | OrderCanPayResponse] + """ + + kwargs = _get_kwargs( + order_id=order_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + order_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | OrderCanPayResponse | None: + """Can pay Order + + Know if it's possible to complete the payment for an Order + + Args: + order_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 | OrderCanPayResponse + """ + + return ( + await asyncio_detailed( + order_id=order_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/shop/cancel_order.py b/src/shellrent_sdk/client/api/shop/cancel_order.py new file mode 100644 index 0000000..1867907 --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/cancel_order.py @@ -0,0 +1,189 @@ +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.empty_response import EmptyResponse +from ...types import Response + + +def _get_kwargs( + order_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/api/v3/orders/{order_id}".format( + order_id=quote(str(order_id), safe=""), + ), + } + + return _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 + + 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 | EmptyResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + order_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Cancel order + + Cancel an Order + + Args: + order_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] + """ + + kwargs = _get_kwargs( + order_id=order_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + order_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Cancel order + + Cancel an Order + + Args: + order_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 + """ + + return sync_detailed( + order_id=order_id, + client=client, + ).parsed + + +async def asyncio_detailed( + order_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Cancel order + + Cancel an Order + + Args: + order_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] + """ + + kwargs = _get_kwargs( + order_id=order_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + order_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Cancel order + + Cancel an Order + + Args: + order_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 + """ + + return ( + await asyncio_detailed( + order_id=order_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..fadd4ae --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/check_microsoft_365_domain_availability.py @@ -0,0 +1,194 @@ +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.microsoft_365_domain_available_response import Microsoft365DomainAvailableResponse +from ...types import UNSET, Response + + +def _get_kwargs( + *, + domain_prefix: str, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["domain_prefix"] = domain_prefix + + 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/shop/microsoft-365/domain-available", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | Microsoft365DomainAvailableResponse | None: + if response.status_code == 200: + response_200 = Microsoft365DomainAvailableResponse.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 | Microsoft365DomainAvailableResponse]: + 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, + domain_prefix: str, +) -> Response[ApiError | Microsoft365DomainAvailableResponse]: + """Check Microsoft 365 domain availability + + Check if a new Microsoft 365 tenant domain is available + + Args: + domain_prefix (str): Prefix to search for (for ".onmicrosoft.com" tenant domains) + + 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 | Microsoft365DomainAvailableResponse] + """ + + kwargs = _get_kwargs( + domain_prefix=domain_prefix, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + domain_prefix: str, +) -> ApiError | Microsoft365DomainAvailableResponse | None: + """Check Microsoft 365 domain availability + + Check if a new Microsoft 365 tenant domain is available + + Args: + domain_prefix (str): Prefix to search for (for ".onmicrosoft.com" tenant domains) + + 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 | Microsoft365DomainAvailableResponse + """ + + return sync_detailed( + client=client, + domain_prefix=domain_prefix, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + domain_prefix: str, +) -> Response[ApiError | Microsoft365DomainAvailableResponse]: + """Check Microsoft 365 domain availability + + Check if a new Microsoft 365 tenant domain is available + + Args: + domain_prefix (str): Prefix to search for (for ".onmicrosoft.com" tenant domains) + + 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 | Microsoft365DomainAvailableResponse] + """ + + kwargs = _get_kwargs( + domain_prefix=domain_prefix, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + domain_prefix: str, +) -> ApiError | Microsoft365DomainAvailableResponse | None: + """Check Microsoft 365 domain availability + + Check if a new Microsoft 365 tenant domain is available + + Args: + domain_prefix (str): Prefix to search for (for ".onmicrosoft.com" tenant domains) + + 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 | Microsoft365DomainAvailableResponse + """ + + return ( + await asyncio_detailed( + client=client, + domain_prefix=domain_prefix, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/shop/get_order.py b/src/shellrent_sdk/client/api/shop/get_order.py new file mode 100644 index 0000000..5d8c62b --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/get_order.py @@ -0,0 +1,189 @@ +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 ...types import Response + + +def _get_kwargs( + order_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/orders/{order_id}".format( + order_id=quote(str(order_id), safe=""), + ), + } + + 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( + order_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | OrderResponse]: + """Get an order + + Get details of an order + + Args: + order_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 | OrderResponse] + """ + + kwargs = _get_kwargs( + order_id=order_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + order_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | OrderResponse | None: + """Get an order + + Get details of an order + + Args: + order_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 | OrderResponse + """ + + return sync_detailed( + order_id=order_id, + client=client, + ).parsed + + +async def asyncio_detailed( + order_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | OrderResponse]: + """Get an order + + Get details of an order + + Args: + order_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 | OrderResponse] + """ + + kwargs = _get_kwargs( + order_id=order_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + order_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | OrderResponse | None: + """Get an order + + Get details of an order + + Args: + order_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 | OrderResponse + """ + + return ( + await asyncio_detailed( + order_id=order_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/shop/get_order_row.py b/src/shellrent_sdk/client/api/shop/get_order_row.py new file mode 100644 index 0000000..298b437 --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/get_order_row.py @@ -0,0 +1,203 @@ +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_row_response import OrderRowResponse +from ...types import Response + + +def _get_kwargs( + order_id: int, + row_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/orders/{order_id}/rows/{row_id}".format( + order_id=quote(str(order_id), safe=""), + row_id=quote(str(row_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | OrderRowResponse | None: + if response.status_code == 200: + response_200 = OrderRowResponse.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 | OrderRowResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + order_id: int, + row_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | OrderRowResponse]: + """Get an order row + + Get details of an Order row + + Args: + order_id (int): + row_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 | OrderRowResponse] + """ + + kwargs = _get_kwargs( + order_id=order_id, + row_id=row_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + order_id: int, + row_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | OrderRowResponse | None: + """Get an order row + + Get details of an Order row + + Args: + order_id (int): + row_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 | OrderRowResponse + """ + + return sync_detailed( + order_id=order_id, + row_id=row_id, + client=client, + ).parsed + + +async def asyncio_detailed( + order_id: int, + row_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | OrderRowResponse]: + """Get an order row + + Get details of an Order row + + Args: + order_id (int): + row_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 | OrderRowResponse] + """ + + kwargs = _get_kwargs( + order_id=order_id, + row_id=row_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + order_id: int, + row_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | OrderRowResponse | None: + """Get an order row + + Get details of an Order row + + Args: + order_id (int): + row_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 | OrderRowResponse + """ + + return ( + await asyncio_detailed( + order_id=order_id, + row_id=row_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/shop/get_tld.py b/src/shellrent_sdk/client/api/shop/get_tld.py new file mode 100644 index 0000000..54ace59 --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/get_tld.py @@ -0,0 +1,189 @@ +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.tld_response import TldResponse +from ...types import Response + + +def _get_kwargs( + tld_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/tlds/{tld_id}".format( + tld_id=quote(str(tld_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | TldResponse | None: + if response.status_code == 200: + response_200 = TldResponse.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 | TldResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + tld_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | TldResponse]: + """Get a TLD + + Get details of a TLD extension + + Args: + tld_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 | TldResponse] + """ + + kwargs = _get_kwargs( + tld_id=tld_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + tld_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | TldResponse | None: + """Get a TLD + + Get details of a TLD extension + + Args: + tld_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 | TldResponse + """ + + return sync_detailed( + tld_id=tld_id, + client=client, + ).parsed + + +async def asyncio_detailed( + tld_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | TldResponse]: + """Get a TLD + + Get details of a TLD extension + + Args: + tld_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 | TldResponse] + """ + + kwargs = _get_kwargs( + tld_id=tld_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + tld_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | TldResponse | None: + """Get a TLD + + Get details of a TLD extension + + Args: + tld_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 | TldResponse + """ + + return ( + await asyncio_detailed( + tld_id=tld_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..4c22ba4 --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/list_active_monitoring_products.py @@ -0,0 +1,209 @@ +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.service_list_response import ServiceListResponse +from ...types import UNSET, Response, Unset + + +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/shop/active-monitoring", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | ServiceListResponse | None: + if response.status_code == 200: + response_200 = ServiceListResponse.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 | ServiceListResponse]: + 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 = 20, +) -> Response[ApiError | ServiceListResponse]: + """Active Monitoring products + + Get a list of all Active Monitoring products that can be ordered + + 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. + + Returns: + Response[ApiError | ServiceListResponse] + """ + + 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 = 20, +) -> ApiError | ServiceListResponse | None: + """Active Monitoring products + + Get a list of all Active Monitoring products that can be ordered + + 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. + + Returns: + ApiError | ServiceListResponse + """ + + 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 | ServiceListResponse]: + """Active Monitoring products + + Get a list of all Active Monitoring products that can be ordered + + 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. + + Returns: + Response[ApiError | ServiceListResponse] + """ + + 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 = 20, +) -> ApiError | ServiceListResponse | None: + """Active Monitoring products + + Get a list of all Active Monitoring products that can be ordered + + 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. + + Returns: + ApiError | ServiceListResponse + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + per_page=per_page, + ) + ).parsed 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 new file mode 100644 index 0000000..bf4ebbd --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/list_cloud_storage_products.py @@ -0,0 +1,209 @@ +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.service_paginated_list_response import ServicePaginatedListResponse +from ...types import UNSET, Response, Unset + + +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/shop/cloud-storage", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | ServicePaginatedListResponse | None: + if response.status_code == 200: + response_200 = ServicePaginatedListResponse.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 | ServicePaginatedListResponse]: + 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 = 20, +) -> Response[ApiError | ServicePaginatedListResponse]: + """Cloud Storage products + + Get a list of all Cloud Storage products that can be ordered + + 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. + + Returns: + Response[ApiError | ServicePaginatedListResponse] + """ + + 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 = 20, +) -> ApiError | ServicePaginatedListResponse | None: + """Cloud Storage products + + Get a list of all Cloud Storage products that can be ordered + + 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. + + Returns: + ApiError | ServicePaginatedListResponse + """ + + 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 | ServicePaginatedListResponse]: + """Cloud Storage products + + Get a list of all Cloud Storage products that can be ordered + + 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. + + Returns: + Response[ApiError | ServicePaginatedListResponse] + """ + + 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 = 20, +) -> ApiError | ServicePaginatedListResponse | None: + """Cloud Storage products + + Get a list of all Cloud Storage products that can be ordered + + 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. + + Returns: + ApiError | ServicePaginatedListResponse + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + per_page=per_page, + ) + ).parsed 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 new file mode 100644 index 0000000..1838fd9 --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/list_cloud_vps_products.py @@ -0,0 +1,209 @@ +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.service_server_list_response import ServiceServerListResponse +from ...types import UNSET, Response, Unset + + +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/shop/cloud-vps", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | ServiceServerListResponse | None: + if response.status_code == 200: + response_200 = ServiceServerListResponse.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 | ServiceServerListResponse]: + 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 = 20, +) -> Response[ApiError | ServiceServerListResponse]: + """Cloud VPS products + + Get a list of all Cloud VPS products that can be ordered + + 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. + + Returns: + Response[ApiError | ServiceServerListResponse] + """ + + 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 = 20, +) -> ApiError | ServiceServerListResponse | None: + """Cloud VPS products + + Get a list of all Cloud VPS products that can be ordered + + 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. + + Returns: + ApiError | ServiceServerListResponse + """ + + 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 | ServiceServerListResponse]: + """Cloud VPS products + + Get a list of all Cloud VPS products that can be ordered + + 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. + + Returns: + Response[ApiError | ServiceServerListResponse] + """ + + 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 = 20, +) -> ApiError | ServiceServerListResponse | None: + """Cloud VPS products + + Get a list of all Cloud VPS products that can be ordered + + 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. + + Returns: + ApiError | ServiceServerListResponse + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + per_page=per_page, + ) + ).parsed 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 new file mode 100644 index 0000000..1e15f65 --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/list_cpanel_license_products.py @@ -0,0 +1,209 @@ +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.service_paginated_list_response import ServicePaginatedListResponse +from ...types import UNSET, Response, Unset + + +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/shop/cpanel-license", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | ServicePaginatedListResponse | None: + if response.status_code == 200: + response_200 = ServicePaginatedListResponse.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 | ServicePaginatedListResponse]: + 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 = 20, +) -> Response[ApiError | ServicePaginatedListResponse]: + """cPanel licenses products + + Get a list of all cPanel license products that can be ordered + + 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. + + Returns: + Response[ApiError | ServicePaginatedListResponse] + """ + + 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 = 20, +) -> ApiError | ServicePaginatedListResponse | None: + """cPanel licenses products + + Get a list of all cPanel license products that can be ordered + + 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. + + Returns: + ApiError | ServicePaginatedListResponse + """ + + 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 | ServicePaginatedListResponse]: + """cPanel licenses products + + Get a list of all cPanel license products that can be ordered + + 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. + + Returns: + Response[ApiError | ServicePaginatedListResponse] + """ + + 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 = 20, +) -> ApiError | ServicePaginatedListResponse | None: + """cPanel licenses products + + Get a list of all cPanel license products that can be ordered + + 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. + + Returns: + ApiError | ServicePaginatedListResponse + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + per_page=per_page, + ) + ).parsed 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 new file mode 100644 index 0000000..90ce4a2 --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/list_dedicated_server_products.py @@ -0,0 +1,209 @@ +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.service_server_list_response import ServiceServerListResponse +from ...types import UNSET, Response, Unset + + +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/shop/dedicated-server", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | ServiceServerListResponse | None: + if response.status_code == 200: + response_200 = ServiceServerListResponse.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 | ServiceServerListResponse]: + 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 = 20, +) -> Response[ApiError | ServiceServerListResponse]: + """Dedicated Servers products + + Get a list of all Dedicated Server products that can be ordered + + 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. + + Returns: + Response[ApiError | ServiceServerListResponse] + """ + + 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 = 20, +) -> ApiError | ServiceServerListResponse | None: + """Dedicated Servers products + + Get a list of all Dedicated Server products that can be ordered + + 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. + + Returns: + ApiError | ServiceServerListResponse + """ + + 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 | ServiceServerListResponse]: + """Dedicated Servers products + + Get a list of all Dedicated Server products that can be ordered + + 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. + + Returns: + Response[ApiError | ServiceServerListResponse] + """ + + 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 = 20, +) -> ApiError | ServiceServerListResponse | None: + """Dedicated Servers products + + Get a list of all Dedicated Server products that can be ordered + + 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. + + Returns: + ApiError | ServiceServerListResponse + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + per_page=per_page, + ) + ).parsed 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 new file mode 100644 index 0000000..89fb43e --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/list_microsoft_365_products.py @@ -0,0 +1,209 @@ +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.service_paginated_list_response import ServicePaginatedListResponse +from ...types import UNSET, Response, Unset + + +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/shop/microsoft-365/services", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | ServicePaginatedListResponse | None: + if response.status_code == 200: + response_200 = ServicePaginatedListResponse.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 | ServicePaginatedListResponse]: + 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 = 20, +) -> Response[ApiError | ServicePaginatedListResponse]: + """Microsoft 365 subscriptions + + Get a list of all Microsoft 365 subscriptions that can be ordered + + 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. + + Returns: + Response[ApiError | ServicePaginatedListResponse] + """ + + 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 = 20, +) -> ApiError | ServicePaginatedListResponse | None: + """Microsoft 365 subscriptions + + Get a list of all Microsoft 365 subscriptions that can be ordered + + 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. + + Returns: + ApiError | ServicePaginatedListResponse + """ + + 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 | ServicePaginatedListResponse]: + """Microsoft 365 subscriptions + + Get a list of all Microsoft 365 subscriptions that can be ordered + + 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. + + Returns: + Response[ApiError | ServicePaginatedListResponse] + """ + + 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 = 20, +) -> ApiError | ServicePaginatedListResponse | None: + """Microsoft 365 subscriptions + + Get a list of all Microsoft 365 subscriptions that can be ordered + + 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. + + Returns: + ApiError | ServicePaginatedListResponse + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + per_page=per_page, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/shop/list_order_rows.py b/src/shellrent_sdk/client/api/shop/list_order_rows.py new file mode 100644 index 0000000..23d9769 --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/list_order_rows.py @@ -0,0 +1,189 @@ +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_row_list_response import OrderRowListResponse +from ...types import Response + + +def _get_kwargs( + order_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/orders/{order_id}/rows".format( + order_id=quote(str(order_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | OrderRowListResponse | None: + if response.status_code == 200: + response_200 = OrderRowListResponse.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 | OrderRowListResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + order_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | OrderRowListResponse]: + """List all Order rows + + Get the list of all the rows of an Order + + Args: + order_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 | OrderRowListResponse] + """ + + kwargs = _get_kwargs( + order_id=order_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + order_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | OrderRowListResponse | None: + """List all Order rows + + Get the list of all the rows of an Order + + Args: + order_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 | OrderRowListResponse + """ + + return sync_detailed( + order_id=order_id, + client=client, + ).parsed + + +async def asyncio_detailed( + order_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | OrderRowListResponse]: + """List all Order rows + + Get the list of all the rows of an Order + + Args: + order_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 | OrderRowListResponse] + """ + + kwargs = _get_kwargs( + order_id=order_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + order_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | OrderRowListResponse | None: + """List all Order rows + + Get the list of all the rows of an Order + + Args: + order_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 | OrderRowListResponse + """ + + return ( + await asyncio_detailed( + order_id=order_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/shop/list_orders.py b/src/shellrent_sdk/client/api/shop/list_orders.py new file mode 100644 index 0000000..245654e --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/list_orders.py @@ -0,0 +1,326 @@ +import datetime +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.list_orders_type import ListOrdersType +from ...models.order_paginated_list_response import OrderPaginatedListResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + order_status: str | Unset = UNSET, + type_: ListOrdersType | Unset = UNSET, + invoice_id: int | Unset = UNSET, + purchase_id: int | Unset = UNSET, + payed: bool | Unset = UNSET, + date_created_from: datetime.datetime | Unset = UNSET, + date_created_to: datetime.datetime | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["order_status"] = order_status + + json_type_: str | Unset = UNSET + if not isinstance(type_, Unset): + json_type_ = type_.value + + params["type"] = json_type_ + + params["invoice_id"] = invoice_id + + params["purchase_id"] = purchase_id + + params["payed"] = payed + + json_date_created_from: str | Unset = UNSET + if not isinstance(date_created_from, Unset): + json_date_created_from = date_created_from.isoformat() + params["date_created_from"] = json_date_created_from + + json_date_created_to: str | Unset = UNSET + if not isinstance(date_created_to, Unset): + json_date_created_to = date_created_to.isoformat() + params["date_created_to"] = json_date_created_to + + 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/orders", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | OrderPaginatedListResponse | None: + if response.status_code == 200: + response_200 = OrderPaginatedListResponse.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 | OrderPaginatedListResponse]: + 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, + order_status: str | Unset = UNSET, + type_: ListOrdersType | Unset = UNSET, + invoice_id: int | Unset = UNSET, + purchase_id: int | Unset = UNSET, + payed: bool | Unset = UNSET, + date_created_from: datetime.datetime | Unset = UNSET, + date_created_to: datetime.datetime | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | OrderPaginatedListResponse]: + """List all Orders + + Get a list of all Orders + + Args: + order_status (str | Unset): + type_ (ListOrdersType | Unset): + invoice_id (int | Unset): + purchase_id (int | Unset): + payed (bool | Unset): + date_created_from (datetime.datetime | Unset): + date_created_to (datetime.datetime | Unset): + 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. + + Returns: + Response[ApiError | OrderPaginatedListResponse] + """ + + kwargs = _get_kwargs( + order_status=order_status, + type_=type_, + invoice_id=invoice_id, + purchase_id=purchase_id, + payed=payed, + date_created_from=date_created_from, + date_created_to=date_created_to, + page=page, + per_page=per_page, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + order_status: str | Unset = UNSET, + type_: ListOrdersType | Unset = UNSET, + invoice_id: int | Unset = UNSET, + purchase_id: int | Unset = UNSET, + payed: bool | Unset = UNSET, + date_created_from: datetime.datetime | Unset = UNSET, + date_created_to: datetime.datetime | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | OrderPaginatedListResponse | None: + """List all Orders + + Get a list of all Orders + + Args: + order_status (str | Unset): + type_ (ListOrdersType | Unset): + invoice_id (int | Unset): + purchase_id (int | Unset): + payed (bool | Unset): + date_created_from (datetime.datetime | Unset): + date_created_to (datetime.datetime | Unset): + 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. + + Returns: + ApiError | OrderPaginatedListResponse + """ + + return sync_detailed( + client=client, + order_status=order_status, + type_=type_, + invoice_id=invoice_id, + purchase_id=purchase_id, + payed=payed, + date_created_from=date_created_from, + date_created_to=date_created_to, + page=page, + per_page=per_page, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + order_status: str | Unset = UNSET, + type_: ListOrdersType | Unset = UNSET, + invoice_id: int | Unset = UNSET, + purchase_id: int | Unset = UNSET, + payed: bool | Unset = UNSET, + date_created_from: datetime.datetime | Unset = UNSET, + date_created_to: datetime.datetime | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | OrderPaginatedListResponse]: + """List all Orders + + Get a list of all Orders + + Args: + order_status (str | Unset): + type_ (ListOrdersType | Unset): + invoice_id (int | Unset): + purchase_id (int | Unset): + payed (bool | Unset): + date_created_from (datetime.datetime | Unset): + date_created_to (datetime.datetime | Unset): + 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. + + Returns: + Response[ApiError | OrderPaginatedListResponse] + """ + + kwargs = _get_kwargs( + order_status=order_status, + type_=type_, + invoice_id=invoice_id, + purchase_id=purchase_id, + payed=payed, + date_created_from=date_created_from, + date_created_to=date_created_to, + 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, + order_status: str | Unset = UNSET, + type_: ListOrdersType | Unset = UNSET, + invoice_id: int | Unset = UNSET, + purchase_id: int | Unset = UNSET, + payed: bool | Unset = UNSET, + date_created_from: datetime.datetime | Unset = UNSET, + date_created_to: datetime.datetime | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | OrderPaginatedListResponse | None: + """List all Orders + + Get a list of all Orders + + Args: + order_status (str | Unset): + type_ (ListOrdersType | Unset): + invoice_id (int | Unset): + purchase_id (int | Unset): + payed (bool | Unset): + date_created_from (datetime.datetime | Unset): + date_created_to (datetime.datetime | Unset): + 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. + + Returns: + ApiError | OrderPaginatedListResponse + """ + + return ( + await asyncio_detailed( + client=client, + order_status=order_status, + type_=type_, + invoice_id=invoice_id, + purchase_id=purchase_id, + payed=payed, + date_created_from=date_created_from, + date_created_to=date_created_to, + page=page, + per_page=per_page, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/shop/list_pec_products.py b/src/shellrent_sdk/client/api/shop/list_pec_products.py new file mode 100644 index 0000000..9d7e6cc --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/list_pec_products.py @@ -0,0 +1,209 @@ +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.service_paginated_list_response import ServicePaginatedListResponse +from ...types import UNSET, Response, Unset + + +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/shop/pec", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | ServicePaginatedListResponse | None: + if response.status_code == 200: + response_200 = ServicePaginatedListResponse.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 | ServicePaginatedListResponse]: + 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 = 20, +) -> Response[ApiError | ServicePaginatedListResponse]: + """PEC products + + Get a list of all PEC products that can be ordered + + 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. + + Returns: + Response[ApiError | ServicePaginatedListResponse] + """ + + 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 = 20, +) -> ApiError | ServicePaginatedListResponse | None: + """PEC products + + Get a list of all PEC products that can be ordered + + 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. + + Returns: + ApiError | ServicePaginatedListResponse + """ + + 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 | ServicePaginatedListResponse]: + """PEC products + + Get a list of all PEC products that can be ordered + + 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. + + Returns: + Response[ApiError | ServicePaginatedListResponse] + """ + + 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 = 20, +) -> ApiError | ServicePaginatedListResponse | None: + """PEC products + + Get a list of all PEC products that can be ordered + + 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. + + Returns: + ApiError | ServicePaginatedListResponse + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + per_page=per_page, + ) + ).parsed 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 new file mode 100644 index 0000000..e18356a --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/list_plesk_license_products.py @@ -0,0 +1,209 @@ +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.service_paginated_list_response import ServicePaginatedListResponse +from ...types import UNSET, Response, Unset + + +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/shop/plesk-license", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | ServicePaginatedListResponse | None: + if response.status_code == 200: + response_200 = ServicePaginatedListResponse.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 | ServicePaginatedListResponse]: + 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 = 20, +) -> Response[ApiError | ServicePaginatedListResponse]: + """Plesk licenses products + + Get a list of all Plesk license products that can be ordered + + 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. + + Returns: + Response[ApiError | ServicePaginatedListResponse] + """ + + 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 = 20, +) -> ApiError | ServicePaginatedListResponse | None: + """Plesk licenses products + + Get a list of all Plesk license products that can be ordered + + 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. + + Returns: + ApiError | ServicePaginatedListResponse + """ + + 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 | ServicePaginatedListResponse]: + """Plesk licenses products + + Get a list of all Plesk license products that can be ordered + + 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. + + Returns: + Response[ApiError | ServicePaginatedListResponse] + """ + + 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 = 20, +) -> ApiError | ServicePaginatedListResponse | None: + """Plesk licenses products + + Get a list of all Plesk license products that can be ordered + + 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. + + Returns: + ApiError | ServicePaginatedListResponse + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + per_page=per_page, + ) + ).parsed 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 new file mode 100644 index 0000000..3f47dec --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/list_private_cloud_sv_products.py @@ -0,0 +1,209 @@ +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.service_list_response import ServiceListResponse +from ...types import UNSET, Response, Unset + + +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/shop/private-cloud-sv", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | ServiceListResponse | None: + if response.status_code == 200: + response_200 = ServiceListResponse.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 | ServiceListResponse]: + 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 = 20, +) -> Response[ApiError | ServiceListResponse]: + """Private Cloud SV products + + Get a list of all Private Cloud SV products that can be ordered + + 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. + + Returns: + Response[ApiError | ServiceListResponse] + """ + + 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 = 20, +) -> ApiError | ServiceListResponse | None: + """Private Cloud SV products + + Get a list of all Private Cloud SV products that can be ordered + + 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. + + Returns: + ApiError | ServiceListResponse + """ + + 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 | ServiceListResponse]: + """Private Cloud SV products + + Get a list of all Private Cloud SV products that can be ordered + + 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. + + Returns: + Response[ApiError | ServiceListResponse] + """ + + 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 = 20, +) -> ApiError | ServiceListResponse | None: + """Private Cloud SV products + + Get a list of all Private Cloud SV products that can be ordered + + 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. + + Returns: + ApiError | ServiceListResponse + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + per_page=per_page, + ) + ).parsed 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 new file mode 100644 index 0000000..efe6a16 --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/list_shop_microsoft_365_tenants.py @@ -0,0 +1,230 @@ +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.microsoft_365_tenant_paginated_list_response import ( + Microsoft365TenantPaginatedListResponse, +) +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + account_id: int | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["account_id"] = account_id + + 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/shop/microsoft-365/tenants", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | Microsoft365TenantPaginatedListResponse | None: + if response.status_code == 200: + response_200 = Microsoft365TenantPaginatedListResponse.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 | Microsoft365TenantPaginatedListResponse]: + 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, + account_id: int | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | Microsoft365TenantPaginatedListResponse]: + """Microsoft 365 tenants + + Get a list of all Microsoft 365 already existing tenants + + 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. + 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. + + Returns: + Response[ApiError | Microsoft365TenantPaginatedListResponse] + """ + + kwargs = _get_kwargs( + account_id=account_id, + page=page, + per_page=per_page, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + account_id: int | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | Microsoft365TenantPaginatedListResponse | None: + """Microsoft 365 tenants + + Get a list of all Microsoft 365 already existing tenants + + 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. + 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. + + Returns: + ApiError | Microsoft365TenantPaginatedListResponse + """ + + return sync_detailed( + client=client, + account_id=account_id, + page=page, + per_page=per_page, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + account_id: int | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | Microsoft365TenantPaginatedListResponse]: + """Microsoft 365 tenants + + Get a list of all Microsoft 365 already existing tenants + + 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. + 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. + + Returns: + Response[ApiError | Microsoft365TenantPaginatedListResponse] + """ + + kwargs = _get_kwargs( + account_id=account_id, + 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, + account_id: int | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | Microsoft365TenantPaginatedListResponse | None: + """Microsoft 365 tenants + + Get a list of all Microsoft 365 already existing tenants + + 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. + 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. + + Returns: + ApiError | Microsoft365TenantPaginatedListResponse + """ + + return ( + await asyncio_detailed( + client=client, + account_id=account_id, + page=page, + per_page=per_page, + ) + ).parsed 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 new file mode 100644 index 0000000..b08595f --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/list_sms_topup_products.py @@ -0,0 +1,209 @@ +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.service_paginated_list_response import ServicePaginatedListResponse +from ...types import UNSET, Response, Unset + + +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/shop/sms-topup", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | ServicePaginatedListResponse | None: + if response.status_code == 200: + response_200 = ServicePaginatedListResponse.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 | ServicePaginatedListResponse]: + 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 = 20, +) -> Response[ApiError | ServicePaginatedListResponse]: + """SMS topups products + + Get a list of all SMS topup products that can be ordered + + 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. + + Returns: + Response[ApiError | ServicePaginatedListResponse] + """ + + 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 = 20, +) -> ApiError | ServicePaginatedListResponse | None: + """SMS topups products + + Get a list of all SMS topup products that can be ordered + + 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. + + Returns: + ApiError | ServicePaginatedListResponse + """ + + 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 | ServicePaginatedListResponse]: + """SMS topups products + + Get a list of all SMS topup products that can be ordered + + 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. + + Returns: + Response[ApiError | ServicePaginatedListResponse] + """ + + 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 = 20, +) -> ApiError | ServicePaginatedListResponse | None: + """SMS topups products + + Get a list of all SMS topup products that can be ordered + + 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. + + Returns: + ApiError | ServicePaginatedListResponse + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + per_page=per_page, + ) + ).parsed 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 new file mode 100644 index 0000000..de430a4 --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/list_ssl_certificate_products.py @@ -0,0 +1,209 @@ +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.service_paginated_list_response import ServicePaginatedListResponse +from ...types import UNSET, Response, Unset + + +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/shop/ssl-certificate", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | ServicePaginatedListResponse | None: + if response.status_code == 200: + response_200 = ServicePaginatedListResponse.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 | ServicePaginatedListResponse]: + 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 = 20, +) -> Response[ApiError | ServicePaginatedListResponse]: + """SSL/TLS Certificates products + + Get a list of all SSL/TLS Certificate products that can be ordered + + 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. + + Returns: + Response[ApiError | ServicePaginatedListResponse] + """ + + 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 = 20, +) -> ApiError | ServicePaginatedListResponse | None: + """SSL/TLS Certificates products + + Get a list of all SSL/TLS Certificate products that can be ordered + + 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. + + Returns: + ApiError | ServicePaginatedListResponse + """ + + 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 | ServicePaginatedListResponse]: + """SSL/TLS Certificates products + + Get a list of all SSL/TLS Certificate products that can be ordered + + 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. + + Returns: + Response[ApiError | ServicePaginatedListResponse] + """ + + 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 = 20, +) -> ApiError | ServicePaginatedListResponse | None: + """SSL/TLS Certificates products + + Get a list of all SSL/TLS Certificate products that can be ordered + + 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. + + Returns: + ApiError | ServicePaginatedListResponse + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + per_page=per_page, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/shop/list_tlds.py b/src/shellrent_sdk/client/api/shop/list_tlds.py new file mode 100644 index 0000000..da4b3ce --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/list_tlds.py @@ -0,0 +1,269 @@ +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.tld_paginated_list_response import TldPaginatedListResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + extension: str | Unset = UNSET, + extension_exact: str | Unset = UNSET, + is_it: bool | Unset = UNSET, + country: str | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["extension"] = extension + + params["extension_exact"] = extension_exact + + params["is_it"] = is_it + + params["country"] = country + + 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/tlds", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | TldPaginatedListResponse | None: + if response.status_code == 200: + response_200 = TldPaginatedListResponse.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 | TldPaginatedListResponse]: + 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, + extension: str | Unset = UNSET, + extension_exact: str | Unset = UNSET, + is_it: bool | Unset = UNSET, + country: str | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | TldPaginatedListResponse]: + """List all TLDs + + Get a list of all TLD extensions for domains + + 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: 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 | TldPaginatedListResponse] + """ + + kwargs = _get_kwargs( + extension=extension, + extension_exact=extension_exact, + is_it=is_it, + country=country, + page=page, + per_page=per_page, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + extension: str | Unset = UNSET, + extension_exact: str | Unset = UNSET, + is_it: bool | Unset = UNSET, + country: str | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | TldPaginatedListResponse | None: + """List all TLDs + + Get a list of all TLD extensions for domains + + 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: 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 | TldPaginatedListResponse + """ + + return sync_detailed( + client=client, + extension=extension, + extension_exact=extension_exact, + is_it=is_it, + country=country, + page=page, + per_page=per_page, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + extension: str | Unset = UNSET, + extension_exact: str | Unset = UNSET, + is_it: bool | Unset = UNSET, + country: str | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | TldPaginatedListResponse]: + """List all TLDs + + Get a list of all TLD extensions for domains + + 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: 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 | TldPaginatedListResponse] + """ + + kwargs = _get_kwargs( + extension=extension, + extension_exact=extension_exact, + is_it=is_it, + country=country, + 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, + extension: str | Unset = UNSET, + extension_exact: str | Unset = UNSET, + is_it: bool | Unset = UNSET, + country: str | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | TldPaginatedListResponse | None: + """List all TLDs + + Get a list of all TLD extensions for domains + + 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: 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 | TldPaginatedListResponse + """ + + return ( + await asyncio_detailed( + client=client, + extension=extension, + extension_exact=extension_exact, + is_it=is_it, + country=country, + page=page, + per_page=per_page, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/shop/pay_orders.py b/src/shellrent_sdk/client/api/shop/pay_orders.py new file mode 100644 index 0000000..3d4cf52 --- /dev/null +++ b/src/shellrent_sdk/client/api/shop/pay_orders.py @@ -0,0 +1,222 @@ +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/__init__.py b/src/shellrent_sdk/client/api/sms/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/src/shellrent_sdk/client/api/sms/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" 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 new file mode 100644 index 0000000..bab6f97 --- /dev/null +++ b/src/shellrent_sdk/client/api/sms/add_sms_phonebook_contacts.py @@ -0,0 +1,210 @@ +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.sms_phonebook_add_contacts_request import SmsPhonebookAddContactsRequest +from ...models.sms_phonebook_response import SmsPhonebookResponse +from ...types import Response + + +def _get_kwargs( + phonebook_id: int, + *, + body: SmsPhonebookAddContactsRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/sms/phonebooks/{phonebook_id}/contacts".format( + phonebook_id=quote(str(phonebook_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 | SmsPhonebookResponse | None: + if response.status_code == 200: + response_200 = SmsPhonebookResponse.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 | SmsPhonebookResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + phonebook_id: int, + *, + client: AuthenticatedClient, + body: SmsPhonebookAddContactsRequest, +) -> Response[ApiError | SmsPhonebookResponse]: + """Add contacts to Phonebook + + Add one or more contacts to a Phonebook + + Args: + phonebook_id (int): + body (SmsPhonebookAddContactsRequest): + + 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 | SmsPhonebookResponse] + """ + + kwargs = _get_kwargs( + phonebook_id=phonebook_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + phonebook_id: int, + *, + client: AuthenticatedClient, + body: SmsPhonebookAddContactsRequest, +) -> ApiError | SmsPhonebookResponse | None: + """Add contacts to Phonebook + + Add one or more contacts to a Phonebook + + Args: + phonebook_id (int): + body (SmsPhonebookAddContactsRequest): + + 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 | SmsPhonebookResponse + """ + + return sync_detailed( + phonebook_id=phonebook_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + phonebook_id: int, + *, + client: AuthenticatedClient, + body: SmsPhonebookAddContactsRequest, +) -> Response[ApiError | SmsPhonebookResponse]: + """Add contacts to Phonebook + + Add one or more contacts to a Phonebook + + Args: + phonebook_id (int): + body (SmsPhonebookAddContactsRequest): + + 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 | SmsPhonebookResponse] + """ + + kwargs = _get_kwargs( + phonebook_id=phonebook_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + phonebook_id: int, + *, + client: AuthenticatedClient, + body: SmsPhonebookAddContactsRequest, +) -> ApiError | SmsPhonebookResponse | None: + """Add contacts to Phonebook + + Add one or more contacts to a Phonebook + + Args: + phonebook_id (int): + body (SmsPhonebookAddContactsRequest): + + 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 | SmsPhonebookResponse + """ + + return ( + await asyncio_detailed( + phonebook_id=phonebook_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/sms/can_cancel_sms.py b/src/shellrent_sdk/client/api/sms/can_cancel_sms.py new file mode 100644 index 0000000..0782fed --- /dev/null +++ b/src/shellrent_sdk/client/api/sms/can_cancel_sms.py @@ -0,0 +1,189 @@ +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.sms_can_cancel_response import SmsCanCancelResponse +from ...types import Response + + +def _get_kwargs( + sms_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/sms/{sms_id}/can-cancel".format( + sms_id=quote(str(sms_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | SmsCanCancelResponse | None: + if response.status_code == 200: + response_200 = SmsCanCancelResponse.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 | SmsCanCancelResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + sms_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | SmsCanCancelResponse]: + """Can cancel SMS + + Know if it's possible to cancel the sending of an SMS + + Args: + sms_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 | SmsCanCancelResponse] + """ + + kwargs = _get_kwargs( + sms_id=sms_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + sms_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | SmsCanCancelResponse | None: + """Can cancel SMS + + Know if it's possible to cancel the sending of an SMS + + Args: + sms_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 | SmsCanCancelResponse + """ + + return sync_detailed( + sms_id=sms_id, + client=client, + ).parsed + + +async def asyncio_detailed( + sms_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | SmsCanCancelResponse]: + """Can cancel SMS + + Know if it's possible to cancel the sending of an SMS + + Args: + sms_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 | SmsCanCancelResponse] + """ + + kwargs = _get_kwargs( + sms_id=sms_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + sms_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | SmsCanCancelResponse | None: + """Can cancel SMS + + Know if it's possible to cancel the sending of an SMS + + Args: + sms_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 | SmsCanCancelResponse + """ + + return ( + await asyncio_detailed( + sms_id=sms_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/sms/can_delete_sms.py b/src/shellrent_sdk/client/api/sms/can_delete_sms.py new file mode 100644 index 0000000..0b4cabe --- /dev/null +++ b/src/shellrent_sdk/client/api/sms/can_delete_sms.py @@ -0,0 +1,189 @@ +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.sms_can_delete_response import SmsCanDeleteResponse +from ...types import Response + + +def _get_kwargs( + sms_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/sms/{sms_id}/can-delete".format( + sms_id=quote(str(sms_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | SmsCanDeleteResponse | None: + if response.status_code == 200: + response_200 = SmsCanDeleteResponse.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 | SmsCanDeleteResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + sms_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | SmsCanDeleteResponse]: + """Can delete SMS + + Know if it's possible to permanently delete an SMS + + Args: + sms_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 | SmsCanDeleteResponse] + """ + + kwargs = _get_kwargs( + sms_id=sms_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + sms_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | SmsCanDeleteResponse | None: + """Can delete SMS + + Know if it's possible to permanently delete an SMS + + Args: + sms_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 | SmsCanDeleteResponse + """ + + return sync_detailed( + sms_id=sms_id, + client=client, + ).parsed + + +async def asyncio_detailed( + sms_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | SmsCanDeleteResponse]: + """Can delete SMS + + Know if it's possible to permanently delete an SMS + + Args: + sms_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 | SmsCanDeleteResponse] + """ + + kwargs = _get_kwargs( + sms_id=sms_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + sms_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | SmsCanDeleteResponse | None: + """Can delete SMS + + Know if it's possible to permanently delete an SMS + + Args: + sms_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 | SmsCanDeleteResponse + """ + + return ( + await asyncio_detailed( + sms_id=sms_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/sms/cancel_sms.py b/src/shellrent_sdk/client/api/sms/cancel_sms.py new file mode 100644 index 0000000..fd32ae1 --- /dev/null +++ b/src/shellrent_sdk/client/api/sms/cancel_sms.py @@ -0,0 +1,189 @@ +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.sms_response import SmsResponse +from ...types import Response + + +def _get_kwargs( + sms_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/api/v3/sms/{sms_id}/cancel".format( + sms_id=quote(str(sms_id), safe=""), + ), + } + + return _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()) + + 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 | SmsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + sms_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | SmsResponse]: + """Cancel SMS sending + + Cancel the sending of an SMS + + Args: + sms_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 | SmsResponse] + """ + + kwargs = _get_kwargs( + sms_id=sms_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + sms_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | SmsResponse | None: + """Cancel SMS sending + + Cancel the sending of an SMS + + Args: + sms_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 | SmsResponse + """ + + return sync_detailed( + sms_id=sms_id, + client=client, + ).parsed + + +async def asyncio_detailed( + sms_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | SmsResponse]: + """Cancel SMS sending + + Cancel the sending of an SMS + + Args: + sms_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 | SmsResponse] + """ + + kwargs = _get_kwargs( + sms_id=sms_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + sms_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | SmsResponse | None: + """Cancel SMS sending + + Cancel the sending of an SMS + + Args: + sms_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 | SmsResponse + """ + + return ( + await asyncio_detailed( + sms_id=sms_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/sms/create_sms_phonebook.py b/src/shellrent_sdk/client/api/sms/create_sms_phonebook.py new file mode 100644 index 0000000..11f3e40 --- /dev/null +++ b/src/shellrent_sdk/client/api/sms/create_sms_phonebook.py @@ -0,0 +1,194 @@ +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.sms_phonebook_create_request import SmsPhonebookCreateRequest +from ...models.sms_phonebook_response import SmsPhonebookResponse +from ...types import Response + + +def _get_kwargs( + *, + body: SmsPhonebookCreateRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/sms/phonebooks", + } + + _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 | SmsPhonebookResponse | None: + if response.status_code == 200: + response_200 = SmsPhonebookResponse.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 | SmsPhonebookResponse]: + 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: SmsPhonebookCreateRequest, +) -> Response[ApiError | SmsPhonebookResponse]: + """Create a Phonebook + + Create a new Phonebook + + Args: + body (SmsPhonebookCreateRequest): + + 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 | SmsPhonebookResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: SmsPhonebookCreateRequest, +) -> ApiError | SmsPhonebookResponse | None: + """Create a Phonebook + + Create a new Phonebook + + Args: + body (SmsPhonebookCreateRequest): + + 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 | SmsPhonebookResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: SmsPhonebookCreateRequest, +) -> Response[ApiError | SmsPhonebookResponse]: + """Create a Phonebook + + Create a new Phonebook + + Args: + body (SmsPhonebookCreateRequest): + + 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 | SmsPhonebookResponse] + """ + + 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: SmsPhonebookCreateRequest, +) -> ApiError | SmsPhonebookResponse | None: + """Create a Phonebook + + Create a new Phonebook + + Args: + body (SmsPhonebookCreateRequest): + + 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 | SmsPhonebookResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed 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 new file mode 100644 index 0000000..f319166 --- /dev/null +++ b/src/shellrent_sdk/client/api/sms/delete_all_sms_phonebook_contacts.py @@ -0,0 +1,189 @@ +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.empty_response import EmptyResponse +from ...types import Response + + +def _get_kwargs( + phonebook_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/api/v3/sms/phonebooks/{phonebook_id}/contacts".format( + phonebook_id=quote(str(phonebook_id), safe=""), + ), + } + + return _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 + + 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 | EmptyResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + phonebook_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Remove all Contacts from Phonebook + + Removes all the Contacts from an existing Phonebook + + Args: + phonebook_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] + """ + + kwargs = _get_kwargs( + phonebook_id=phonebook_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + phonebook_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Remove all Contacts from Phonebook + + Removes all the Contacts from an existing Phonebook + + Args: + phonebook_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 + """ + + return sync_detailed( + phonebook_id=phonebook_id, + client=client, + ).parsed + + +async def asyncio_detailed( + phonebook_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Remove all Contacts from Phonebook + + Removes all the Contacts from an existing Phonebook + + Args: + phonebook_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] + """ + + kwargs = _get_kwargs( + phonebook_id=phonebook_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + phonebook_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Remove all Contacts from Phonebook + + Removes all the Contacts from an existing Phonebook + + Args: + phonebook_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 + """ + + return ( + await asyncio_detailed( + phonebook_id=phonebook_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/sms/delete_sms.py b/src/shellrent_sdk/client/api/sms/delete_sms.py new file mode 100644 index 0000000..18ad456 --- /dev/null +++ b/src/shellrent_sdk/client/api/sms/delete_sms.py @@ -0,0 +1,189 @@ +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.empty_response import EmptyResponse +from ...types import Response + + +def _get_kwargs( + sms_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/api/v3/sms/{sms_id}".format( + sms_id=quote(str(sms_id), safe=""), + ), + } + + return _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 + + 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 | EmptyResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + sms_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Delete SMS + + Permanently delete an SMS + + Args: + sms_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] + """ + + kwargs = _get_kwargs( + sms_id=sms_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + sms_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Delete SMS + + Permanently delete an SMS + + Args: + sms_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 + """ + + return sync_detailed( + sms_id=sms_id, + client=client, + ).parsed + + +async def asyncio_detailed( + sms_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Delete SMS + + Permanently delete an SMS + + Args: + sms_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] + """ + + kwargs = _get_kwargs( + sms_id=sms_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + sms_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Delete SMS + + Permanently delete an SMS + + Args: + sms_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 + """ + + return ( + await asyncio_detailed( + sms_id=sms_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/sms/delete_sms_phonebook.py b/src/shellrent_sdk/client/api/sms/delete_sms_phonebook.py new file mode 100644 index 0000000..9f7a0e2 --- /dev/null +++ b/src/shellrent_sdk/client/api/sms/delete_sms_phonebook.py @@ -0,0 +1,189 @@ +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.empty_response import EmptyResponse +from ...types import Response + + +def _get_kwargs( + phonebook_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/api/v3/sms/phonebooks/{phonebook_id}".format( + phonebook_id=quote(str(phonebook_id), safe=""), + ), + } + + return _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 + + 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 | EmptyResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + phonebook_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Delete a Phonebook + + Delete a Phonebook + + Args: + phonebook_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] + """ + + kwargs = _get_kwargs( + phonebook_id=phonebook_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + phonebook_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Delete a Phonebook + + Delete a Phonebook + + Args: + phonebook_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 + """ + + return sync_detailed( + phonebook_id=phonebook_id, + client=client, + ).parsed + + +async def asyncio_detailed( + phonebook_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Delete a Phonebook + + Delete a Phonebook + + Args: + phonebook_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] + """ + + kwargs = _get_kwargs( + phonebook_id=phonebook_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + phonebook_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Delete a Phonebook + + Delete a Phonebook + + Args: + phonebook_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 + """ + + return ( + await asyncio_detailed( + phonebook_id=phonebook_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..9d65f20 --- /dev/null +++ b/src/shellrent_sdk/client/api/sms/delete_sms_phonebook_contact.py @@ -0,0 +1,203 @@ +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.empty_response import EmptyResponse +from ...types import Response + + +def _get_kwargs( + phonebook_id: int, + contact_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "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=""), + ), + } + + return _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 + + 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 | EmptyResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + phonebook_id: int, + contact_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Remove a Contact from a Phonebook + + Remove a Contact from a Phonebook + + Args: + phonebook_id (int): + contact_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] + """ + + kwargs = _get_kwargs( + phonebook_id=phonebook_id, + contact_id=contact_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + phonebook_id: int, + contact_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Remove a Contact from a Phonebook + + Remove a Contact from a Phonebook + + Args: + phonebook_id (int): + contact_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 + """ + + return sync_detailed( + phonebook_id=phonebook_id, + contact_id=contact_id, + client=client, + ).parsed + + +async def asyncio_detailed( + phonebook_id: int, + contact_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Remove a Contact from a Phonebook + + Remove a Contact from a Phonebook + + Args: + phonebook_id (int): + contact_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] + """ + + kwargs = _get_kwargs( + phonebook_id=phonebook_id, + contact_id=contact_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + phonebook_id: int, + contact_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Remove a Contact from a Phonebook + + Remove a Contact from a Phonebook + + Args: + phonebook_id (int): + contact_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 + """ + + return ( + await asyncio_detailed( + phonebook_id=phonebook_id, + contact_id=contact_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/sms/get_sms.py b/src/shellrent_sdk/client/api/sms/get_sms.py new file mode 100644 index 0000000..93545f0 --- /dev/null +++ b/src/shellrent_sdk/client/api/sms/get_sms.py @@ -0,0 +1,189 @@ +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.sms_response import SmsResponse +from ...types import Response + + +def _get_kwargs( + sms_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/sms/{sms_id}".format( + sms_id=quote(str(sms_id), safe=""), + ), + } + + return _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()) + + 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 | SmsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + sms_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | SmsResponse]: + """Get an SMS + + Get details of an SMS + + Args: + sms_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 | SmsResponse] + """ + + kwargs = _get_kwargs( + sms_id=sms_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + sms_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | SmsResponse | None: + """Get an SMS + + Get details of an SMS + + Args: + sms_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 | SmsResponse + """ + + return sync_detailed( + sms_id=sms_id, + client=client, + ).parsed + + +async def asyncio_detailed( + sms_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | SmsResponse]: + """Get an SMS + + Get details of an SMS + + Args: + sms_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 | SmsResponse] + """ + + kwargs = _get_kwargs( + sms_id=sms_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + sms_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | SmsResponse | None: + """Get an SMS + + Get details of an SMS + + Args: + sms_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 | SmsResponse + """ + + return ( + await asyncio_detailed( + sms_id=sms_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/sms/get_sms_credit.py b/src/shellrent_sdk/client/api/sms/get_sms_credit.py new file mode 100644 index 0000000..65cdb50 --- /dev/null +++ b/src/shellrent_sdk/client/api/sms/get_sms_credit.py @@ -0,0 +1,162 @@ +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.sms_account_response import SmsAccountResponse +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/sms/account", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | SmsAccountResponse | None: + if response.status_code == 200: + response_200 = SmsAccountResponse.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 | SmsAccountResponse]: + 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, +) -> Response[ApiError | SmsAccountResponse]: + """SMS credit + + Get SMS account credit details + + 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 | SmsAccountResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> ApiError | SmsAccountResponse | None: + """SMS credit + + Get SMS account credit details + + 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 | SmsAccountResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[ApiError | SmsAccountResponse]: + """SMS credit + + Get SMS account credit details + + 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 | SmsAccountResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> ApiError | SmsAccountResponse | None: + """SMS credit + + Get SMS account credit details + + 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 | SmsAccountResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/sms/get_sms_message.py b/src/shellrent_sdk/client/api/sms/get_sms_message.py new file mode 100644 index 0000000..c48e47e --- /dev/null +++ b/src/shellrent_sdk/client/api/sms/get_sms_message.py @@ -0,0 +1,203 @@ +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.sms_message_response import SmsMessageResponse +from ...types import Response + + +def _get_kwargs( + sms_id: int, + message_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/sms/{sms_id}/messages/{message_id}".format( + sms_id=quote(str(sms_id), safe=""), + message_id=quote(str(message_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | SmsMessageResponse | None: + if response.status_code == 200: + response_200 = SmsMessageResponse.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 | SmsMessageResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + sms_id: int, + message_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | SmsMessageResponse]: + """Get an SMS message + + Get an SMS message details + + Args: + sms_id (int): + message_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 | SmsMessageResponse] + """ + + kwargs = _get_kwargs( + sms_id=sms_id, + message_id=message_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + sms_id: int, + message_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | SmsMessageResponse | None: + """Get an SMS message + + Get an SMS message details + + Args: + sms_id (int): + message_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 | SmsMessageResponse + """ + + return sync_detailed( + sms_id=sms_id, + message_id=message_id, + client=client, + ).parsed + + +async def asyncio_detailed( + sms_id: int, + message_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | SmsMessageResponse]: + """Get an SMS message + + Get an SMS message details + + Args: + sms_id (int): + message_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 | SmsMessageResponse] + """ + + kwargs = _get_kwargs( + sms_id=sms_id, + message_id=message_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + sms_id: int, + message_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | SmsMessageResponse | None: + """Get an SMS message + + Get an SMS message details + + Args: + sms_id (int): + message_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 | SmsMessageResponse + """ + + return ( + await asyncio_detailed( + sms_id=sms_id, + message_id=message_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/sms/get_sms_phonebook.py b/src/shellrent_sdk/client/api/sms/get_sms_phonebook.py new file mode 100644 index 0000000..16bdbd0 --- /dev/null +++ b/src/shellrent_sdk/client/api/sms/get_sms_phonebook.py @@ -0,0 +1,189 @@ +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.sms_phonebook_response import SmsPhonebookResponse +from ...types import Response + + +def _get_kwargs( + phonebook_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/sms/phonebooks/{phonebook_id}".format( + phonebook_id=quote(str(phonebook_id), safe=""), + ), + } + + return _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()) + + 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 | SmsPhonebookResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + phonebook_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | SmsPhonebookResponse]: + """Get a Phonebook + + Get details of a Phonebook + + Args: + phonebook_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 | SmsPhonebookResponse] + """ + + kwargs = _get_kwargs( + phonebook_id=phonebook_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + phonebook_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | SmsPhonebookResponse | None: + """Get a Phonebook + + Get details of a Phonebook + + Args: + phonebook_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 | SmsPhonebookResponse + """ + + return sync_detailed( + phonebook_id=phonebook_id, + client=client, + ).parsed + + +async def asyncio_detailed( + phonebook_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | SmsPhonebookResponse]: + """Get a Phonebook + + Get details of a Phonebook + + Args: + phonebook_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 | SmsPhonebookResponse] + """ + + kwargs = _get_kwargs( + phonebook_id=phonebook_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + phonebook_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | SmsPhonebookResponse | None: + """Get a Phonebook + + Get details of a Phonebook + + Args: + phonebook_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 | SmsPhonebookResponse + """ + + return ( + await asyncio_detailed( + phonebook_id=phonebook_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/sms/get_sms_price.py b/src/shellrent_sdk/client/api/sms/get_sms_price.py new file mode 100644 index 0000000..1d4d2b0 --- /dev/null +++ b/src/shellrent_sdk/client/api/sms/get_sms_price.py @@ -0,0 +1,189 @@ +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.sms_price_response import SmsPriceResponse +from ...types import Response + + +def _get_kwargs( + country_code: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/sms/countries/{country_code}".format( + country_code=quote(str(country_code), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | SmsPriceResponse | None: + if response.status_code == 200: + response_200 = SmsPriceResponse.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 | SmsPriceResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + country_code: str, + *, + client: AuthenticatedClient, +) -> Response[ApiError | SmsPriceResponse]: + """Get SMS price + + Get the SMS price for a specific Country + + Args: + country_code (str): + + 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 | SmsPriceResponse] + """ + + kwargs = _get_kwargs( + country_code=country_code, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + country_code: str, + *, + client: AuthenticatedClient, +) -> ApiError | SmsPriceResponse | None: + """Get SMS price + + Get the SMS price for a specific Country + + Args: + country_code (str): + + 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 | SmsPriceResponse + """ + + return sync_detailed( + country_code=country_code, + client=client, + ).parsed + + +async def asyncio_detailed( + country_code: str, + *, + client: AuthenticatedClient, +) -> Response[ApiError | SmsPriceResponse]: + """Get SMS price + + Get the SMS price for a specific Country + + Args: + country_code (str): + + 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 | SmsPriceResponse] + """ + + kwargs = _get_kwargs( + country_code=country_code, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + country_code: str, + *, + client: AuthenticatedClient, +) -> ApiError | SmsPriceResponse | None: + """Get SMS price + + Get the SMS price for a specific Country + + Args: + country_code (str): + + 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 | SmsPriceResponse + """ + + return ( + await asyncio_detailed( + country_code=country_code, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/sms/list_sms.py b/src/shellrent_sdk/client/api/sms/list_sms.py new file mode 100644 index 0000000..2408ee4 --- /dev/null +++ b/src/shellrent_sdk/client/api/sms/list_sms.py @@ -0,0 +1,266 @@ +import datetime +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.list_sms_sms_status import ListSmsSmsStatus +from ...models.sms_paginated_list_response import SmsPaginatedListResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + sms_status: ListSmsSmsStatus | Unset = UNSET, + date_created_from: datetime.datetime | Unset = UNSET, + date_created_to: datetime.datetime | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + json_sms_status: str | Unset = UNSET + if not isinstance(sms_status, Unset): + json_sms_status = sms_status.value + + params["sms_status"] = json_sms_status + + json_date_created_from: str | Unset = UNSET + if not isinstance(date_created_from, Unset): + json_date_created_from = date_created_from.isoformat() + params["date_created_from"] = json_date_created_from + + json_date_created_to: str | Unset = UNSET + if not isinstance(date_created_to, Unset): + json_date_created_to = date_created_to.isoformat() + params["date_created_to"] = json_date_created_to + + 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", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | SmsPaginatedListResponse | None: + if response.status_code == 200: + response_200 = SmsPaginatedListResponse.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 | SmsPaginatedListResponse]: + 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, + sms_status: ListSmsSmsStatus | Unset = UNSET, + date_created_from: datetime.datetime | Unset = UNSET, + date_created_to: datetime.datetime | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | SmsPaginatedListResponse]: + """List all SMS + + Get a list of all SMS + + Args: + sms_status (ListSmsSmsStatus | Unset): + date_created_from (datetime.datetime | Unset): + date_created_to (datetime.datetime | Unset): + 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. + + Returns: + Response[ApiError | SmsPaginatedListResponse] + """ + + kwargs = _get_kwargs( + sms_status=sms_status, + date_created_from=date_created_from, + date_created_to=date_created_to, + page=page, + per_page=per_page, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + sms_status: ListSmsSmsStatus | Unset = UNSET, + date_created_from: datetime.datetime | Unset = UNSET, + date_created_to: datetime.datetime | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | SmsPaginatedListResponse | None: + """List all SMS + + Get a list of all SMS + + Args: + sms_status (ListSmsSmsStatus | Unset): + date_created_from (datetime.datetime | Unset): + date_created_to (datetime.datetime | Unset): + 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. + + Returns: + ApiError | SmsPaginatedListResponse + """ + + return sync_detailed( + client=client, + sms_status=sms_status, + date_created_from=date_created_from, + date_created_to=date_created_to, + page=page, + per_page=per_page, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + sms_status: ListSmsSmsStatus | Unset = UNSET, + date_created_from: datetime.datetime | Unset = UNSET, + date_created_to: datetime.datetime | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | SmsPaginatedListResponse]: + """List all SMS + + Get a list of all SMS + + Args: + sms_status (ListSmsSmsStatus | Unset): + date_created_from (datetime.datetime | Unset): + date_created_to (datetime.datetime | Unset): + 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. + + Returns: + Response[ApiError | SmsPaginatedListResponse] + """ + + kwargs = _get_kwargs( + sms_status=sms_status, + date_created_from=date_created_from, + date_created_to=date_created_to, + 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, + sms_status: ListSmsSmsStatus | Unset = UNSET, + date_created_from: datetime.datetime | Unset = UNSET, + date_created_to: datetime.datetime | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | SmsPaginatedListResponse | None: + """List all SMS + + Get a list of all SMS + + Args: + sms_status (ListSmsSmsStatus | Unset): + date_created_from (datetime.datetime | Unset): + date_created_to (datetime.datetime | Unset): + 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. + + Returns: + ApiError | SmsPaginatedListResponse + """ + + return ( + await asyncio_detailed( + client=client, + sms_status=sms_status, + date_created_from=date_created_from, + date_created_to=date_created_to, + page=page, + per_page=per_page, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/sms/list_sms_messages.py b/src/shellrent_sdk/client/api/sms/list_sms_messages.py new file mode 100644 index 0000000..dc0f027 --- /dev/null +++ b/src/shellrent_sdk/client/api/sms/list_sms_messages.py @@ -0,0 +1,189 @@ +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.sms_message_paginated_list_response import SmsMessagePaginatedListResponse +from ...types import Response + + +def _get_kwargs( + sms_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/sms/{sms_id}/messages".format( + sms_id=quote(str(sms_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | SmsMessagePaginatedListResponse | None: + if response.status_code == 200: + response_200 = SmsMessagePaginatedListResponse.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 | SmsMessagePaginatedListResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + sms_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | SmsMessagePaginatedListResponse]: + """List all messages of an SMS + + Get a list of all messages of an SMS + + Args: + sms_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 | SmsMessagePaginatedListResponse] + """ + + kwargs = _get_kwargs( + sms_id=sms_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + sms_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | SmsMessagePaginatedListResponse | None: + """List all messages of an SMS + + Get a list of all messages of an SMS + + Args: + sms_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 | SmsMessagePaginatedListResponse + """ + + return sync_detailed( + sms_id=sms_id, + client=client, + ).parsed + + +async def asyncio_detailed( + sms_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | SmsMessagePaginatedListResponse]: + """List all messages of an SMS + + Get a list of all messages of an SMS + + Args: + sms_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 | SmsMessagePaginatedListResponse] + """ + + kwargs = _get_kwargs( + sms_id=sms_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + sms_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | SmsMessagePaginatedListResponse | None: + """List all messages of an SMS + + Get a list of all messages of an SMS + + Args: + sms_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 | SmsMessagePaginatedListResponse + """ + + return ( + await asyncio_detailed( + sms_id=sms_id, + client=client, + ) + ).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 new file mode 100644 index 0000000..b30aad9 --- /dev/null +++ b/src/shellrent_sdk/client/api/sms/list_sms_phonebook_contacts.py @@ -0,0 +1,227 @@ +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.sms_phonebook_contact_paginated_list_response import ( + SmsPhonebookContactPaginatedListResponse, +) +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + phonebook_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/phonebooks/{phonebook_id}/contacts".format( + phonebook_id=quote(str(phonebook_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | SmsPhonebookContactPaginatedListResponse | None: + if response.status_code == 200: + response_200 = SmsPhonebookContactPaginatedListResponse.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 | SmsPhonebookContactPaginatedListResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + phonebook_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | SmsPhonebookContactPaginatedListResponse]: + """Phonebook Contacts + + Get a list of all Contacts of a Phonebook + + Args: + phonebook_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ApiError | SmsPhonebookContactPaginatedListResponse] + """ + + kwargs = _get_kwargs( + phonebook_id=phonebook_id, + page=page, + per_page=per_page, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + phonebook_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | SmsPhonebookContactPaginatedListResponse | None: + """Phonebook Contacts + + Get a list of all Contacts of a Phonebook + + Args: + phonebook_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ApiError | SmsPhonebookContactPaginatedListResponse + """ + + return sync_detailed( + phonebook_id=phonebook_id, + client=client, + page=page, + per_page=per_page, + ).parsed + + +async def asyncio_detailed( + phonebook_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | SmsPhonebookContactPaginatedListResponse]: + """Phonebook Contacts + + Get a list of all Contacts of a Phonebook + + Args: + phonebook_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ApiError | SmsPhonebookContactPaginatedListResponse] + """ + + kwargs = _get_kwargs( + phonebook_id=phonebook_id, + 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( + phonebook_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | SmsPhonebookContactPaginatedListResponse | None: + """Phonebook Contacts + + Get a list of all Contacts of a Phonebook + + Args: + phonebook_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ApiError | SmsPhonebookContactPaginatedListResponse + """ + + return ( + await asyncio_detailed( + phonebook_id=phonebook_id, + client=client, + page=page, + per_page=per_page, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/sms/list_sms_phonebooks.py b/src/shellrent_sdk/client/api/sms/list_sms_phonebooks.py new file mode 100644 index 0000000..bf9c85f --- /dev/null +++ b/src/shellrent_sdk/client/api/sms/list_sms_phonebooks.py @@ -0,0 +1,209 @@ +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.sms_phonebook_paginated_list_response import SmsPhonebookPaginatedListResponse +from ...types import UNSET, Response, Unset + + +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/phonebooks", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | SmsPhonebookPaginatedListResponse | None: + if response.status_code == 200: + response_200 = SmsPhonebookPaginatedListResponse.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 | SmsPhonebookPaginatedListResponse]: + 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 = 20, +) -> Response[ApiError | SmsPhonebookPaginatedListResponse]: + """List all Phonebooks + + Get a list of all Phonebooks + + 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. + + Returns: + Response[ApiError | SmsPhonebookPaginatedListResponse] + """ + + 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 = 20, +) -> ApiError | SmsPhonebookPaginatedListResponse | None: + """List all Phonebooks + + Get a list of all Phonebooks + + 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. + + Returns: + ApiError | SmsPhonebookPaginatedListResponse + """ + + 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 | SmsPhonebookPaginatedListResponse]: + """List all Phonebooks + + Get a list of all Phonebooks + + 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. + + Returns: + Response[ApiError | SmsPhonebookPaginatedListResponse] + """ + + 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 = 20, +) -> ApiError | SmsPhonebookPaginatedListResponse | None: + """List all Phonebooks + + Get a list of all Phonebooks + + 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. + + Returns: + ApiError | SmsPhonebookPaginatedListResponse + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + per_page=per_page, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/sms/list_sms_prices.py b/src/shellrent_sdk/client/api/sms/list_sms_prices.py new file mode 100644 index 0000000..fc99d15 --- /dev/null +++ b/src/shellrent_sdk/client/api/sms/list_sms_prices.py @@ -0,0 +1,162 @@ +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.sms_price_paginated_list_response import SmsPricePaginatedListResponse +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/sms/countries", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | SmsPricePaginatedListResponse | None: + if response.status_code == 200: + response_200 = SmsPricePaginatedListResponse.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 | SmsPricePaginatedListResponse]: + 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, +) -> Response[ApiError | SmsPricePaginatedListResponse]: + """List SMS prices + + Get a list of all SMS prices for all supported Countries + + 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 | SmsPricePaginatedListResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> ApiError | SmsPricePaginatedListResponse | None: + """List SMS prices + + Get a list of all SMS prices for all supported Countries + + 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 | SmsPricePaginatedListResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[ApiError | SmsPricePaginatedListResponse]: + """List SMS prices + + Get a list of all SMS prices for all supported Countries + + 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 | SmsPricePaginatedListResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> ApiError | SmsPricePaginatedListResponse | None: + """List SMS prices + + Get a list of all SMS prices for all supported Countries + + 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 | SmsPricePaginatedListResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).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 new file mode 100644 index 0000000..be405a5 --- /dev/null +++ b/src/shellrent_sdk/client/api/sms/replace_sms_phonebook_contacts.py @@ -0,0 +1,210 @@ +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.sms_phonebook_add_contacts_request import SmsPhonebookAddContactsRequest +from ...models.sms_phonebook_response import SmsPhonebookResponse +from ...types import Response + + +def _get_kwargs( + phonebook_id: int, + *, + body: SmsPhonebookAddContactsRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/api/v3/sms/phonebooks/{phonebook_id}/contacts".format( + phonebook_id=quote(str(phonebook_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 | SmsPhonebookResponse | None: + if response.status_code == 200: + response_200 = SmsPhonebookResponse.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 | SmsPhonebookResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + phonebook_id: int, + *, + client: AuthenticatedClient, + body: SmsPhonebookAddContactsRequest, +) -> Response[ApiError | SmsPhonebookResponse]: + """Replace all Contacts in Phonebook + + Replaces all the Contacts in a Phonebook + + Args: + phonebook_id (int): + body (SmsPhonebookAddContactsRequest): + + 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 | SmsPhonebookResponse] + """ + + kwargs = _get_kwargs( + phonebook_id=phonebook_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + phonebook_id: int, + *, + client: AuthenticatedClient, + body: SmsPhonebookAddContactsRequest, +) -> ApiError | SmsPhonebookResponse | None: + """Replace all Contacts in Phonebook + + Replaces all the Contacts in a Phonebook + + Args: + phonebook_id (int): + body (SmsPhonebookAddContactsRequest): + + 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 | SmsPhonebookResponse + """ + + return sync_detailed( + phonebook_id=phonebook_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + phonebook_id: int, + *, + client: AuthenticatedClient, + body: SmsPhonebookAddContactsRequest, +) -> Response[ApiError | SmsPhonebookResponse]: + """Replace all Contacts in Phonebook + + Replaces all the Contacts in a Phonebook + + Args: + phonebook_id (int): + body (SmsPhonebookAddContactsRequest): + + 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 | SmsPhonebookResponse] + """ + + kwargs = _get_kwargs( + phonebook_id=phonebook_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + phonebook_id: int, + *, + client: AuthenticatedClient, + body: SmsPhonebookAddContactsRequest, +) -> ApiError | SmsPhonebookResponse | None: + """Replace all Contacts in Phonebook + + Replaces all the Contacts in a Phonebook + + Args: + phonebook_id (int): + body (SmsPhonebookAddContactsRequest): + + 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 | SmsPhonebookResponse + """ + + return ( + await asyncio_detailed( + phonebook_id=phonebook_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/sms/send_sms.py b/src/shellrent_sdk/client/api/sms/send_sms.py new file mode 100644 index 0000000..2a14f9b --- /dev/null +++ b/src/shellrent_sdk/client/api/sms/send_sms.py @@ -0,0 +1,202 @@ +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.sms_create_request import SmsCreateRequest +from ...models.sms_response import SmsResponse +from ...types import Response + + +def _get_kwargs( + *, + body: SmsCreateRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/sms", + } + + _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 | SmsResponse | None: + if response.status_code == 200: + response_200 = SmsResponse.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 | SmsResponse]: + 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: SmsCreateRequest, +) -> Response[ApiError | SmsResponse]: + """Send an SMS + + Send a new SMS + + Args: + body (SmsCreateRequest): Sends an SMS. Recipients: provide exactly one of phone_numbers or + phonebooks, not both. Sender: required when quality is PREMIUM (from 2 to 11 characters), + ignored when quality is STANDARD. + + 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 | SmsResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: SmsCreateRequest, +) -> ApiError | SmsResponse | None: + """Send an SMS + + Send a new SMS + + Args: + body (SmsCreateRequest): Sends an SMS. Recipients: provide exactly one of phone_numbers or + phonebooks, not both. Sender: required when quality is PREMIUM (from 2 to 11 characters), + ignored when quality is STANDARD. + + 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 | SmsResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: SmsCreateRequest, +) -> Response[ApiError | SmsResponse]: + """Send an SMS + + Send a new SMS + + Args: + body (SmsCreateRequest): Sends an SMS. Recipients: provide exactly one of phone_numbers or + phonebooks, not both. Sender: required when quality is PREMIUM (from 2 to 11 characters), + ignored when quality is STANDARD. + + 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 | SmsResponse] + """ + + 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: SmsCreateRequest, +) -> ApiError | SmsResponse | None: + """Send an SMS + + Send a new SMS + + Args: + body (SmsCreateRequest): Sends an SMS. Recipients: provide exactly one of phone_numbers or + phonebooks, not both. Sender: required when quality is PREMIUM (from 2 to 11 characters), + ignored when quality is STANDARD. + + 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 | SmsResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/sms/update_sms_phonebook.py b/src/shellrent_sdk/client/api/sms/update_sms_phonebook.py new file mode 100644 index 0000000..0f94d4a --- /dev/null +++ b/src/shellrent_sdk/client/api/sms/update_sms_phonebook.py @@ -0,0 +1,210 @@ +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.sms_phonebook_edit_request import SmsPhonebookEditRequest +from ...models.sms_phonebook_response import SmsPhonebookResponse +from ...types import Response + + +def _get_kwargs( + phonebook_id: int, + *, + body: SmsPhonebookEditRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/api/v3/sms/phonebooks/{phonebook_id}".format( + phonebook_id=quote(str(phonebook_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 | SmsPhonebookResponse | None: + if response.status_code == 200: + response_200 = SmsPhonebookResponse.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 | SmsPhonebookResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + phonebook_id: int, + *, + client: AuthenticatedClient, + body: SmsPhonebookEditRequest, +) -> Response[ApiError | SmsPhonebookResponse]: + """Edit a Phonebook + + Edit a Phonebook details + + Args: + phonebook_id (int): + body (SmsPhonebookEditRequest): + + 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 | SmsPhonebookResponse] + """ + + kwargs = _get_kwargs( + phonebook_id=phonebook_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + phonebook_id: int, + *, + client: AuthenticatedClient, + body: SmsPhonebookEditRequest, +) -> ApiError | SmsPhonebookResponse | None: + """Edit a Phonebook + + Edit a Phonebook details + + Args: + phonebook_id (int): + body (SmsPhonebookEditRequest): + + 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 | SmsPhonebookResponse + """ + + return sync_detailed( + phonebook_id=phonebook_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + phonebook_id: int, + *, + client: AuthenticatedClient, + body: SmsPhonebookEditRequest, +) -> Response[ApiError | SmsPhonebookResponse]: + """Edit a Phonebook + + Edit a Phonebook details + + Args: + phonebook_id (int): + body (SmsPhonebookEditRequest): + + 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 | SmsPhonebookResponse] + """ + + kwargs = _get_kwargs( + phonebook_id=phonebook_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + phonebook_id: int, + *, + client: AuthenticatedClient, + body: SmsPhonebookEditRequest, +) -> ApiError | SmsPhonebookResponse | None: + """Edit a Phonebook + + Edit a Phonebook details + + Args: + phonebook_id (int): + body (SmsPhonebookEditRequest): + + 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 | SmsPhonebookResponse + """ + + return ( + await asyncio_detailed( + phonebook_id=phonebook_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/ssl/__init__.py b/src/shellrent_sdk/client/api/ssl/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/src/shellrent_sdk/client/api/ssl/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/src/shellrent_sdk/client/api/ssl/can_reemit_ssl_certificate.py b/src/shellrent_sdk/client/api/ssl/can_reemit_ssl_certificate.py new file mode 100644 index 0000000..4fafdf7 --- /dev/null +++ b/src/shellrent_sdk/client/api/ssl/can_reemit_ssl_certificate.py @@ -0,0 +1,189 @@ +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.ssl_certificate_can_reemit_response import SslCertificateCanReemitResponse +from ...types import Response + + +def _get_kwargs( + ssl_certificate_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/ssl-certificates/{ssl_certificate_id}/can-reemit".format( + ssl_certificate_id=quote(str(ssl_certificate_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | SslCertificateCanReemitResponse | None: + if response.status_code == 200: + response_200 = SslCertificateCanReemitResponse.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 | SslCertificateCanReemitResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + ssl_certificate_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | SslCertificateCanReemitResponse]: + """Can re-emit certificate + + Know if it's possible to re-emit the SSL Certificate + + Args: + ssl_certificate_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 | SslCertificateCanReemitResponse] + """ + + kwargs = _get_kwargs( + ssl_certificate_id=ssl_certificate_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + ssl_certificate_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | SslCertificateCanReemitResponse | None: + """Can re-emit certificate + + Know if it's possible to re-emit the SSL Certificate + + Args: + ssl_certificate_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 | SslCertificateCanReemitResponse + """ + + return sync_detailed( + ssl_certificate_id=ssl_certificate_id, + client=client, + ).parsed + + +async def asyncio_detailed( + ssl_certificate_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | SslCertificateCanReemitResponse]: + """Can re-emit certificate + + Know if it's possible to re-emit the SSL Certificate + + Args: + ssl_certificate_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 | SslCertificateCanReemitResponse] + """ + + kwargs = _get_kwargs( + ssl_certificate_id=ssl_certificate_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + ssl_certificate_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | SslCertificateCanReemitResponse | None: + """Can re-emit certificate + + Know if it's possible to re-emit the SSL Certificate + + Args: + ssl_certificate_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 | SslCertificateCanReemitResponse + """ + + return ( + await asyncio_detailed( + ssl_certificate_id=ssl_certificate_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/ssl/export_ssl_certificate.py b/src/shellrent_sdk/client/api/ssl/export_ssl_certificate.py new file mode 100644 index 0000000..84a8302 --- /dev/null +++ b/src/shellrent_sdk/client/api/ssl/export_ssl_certificate.py @@ -0,0 +1,203 @@ +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.ssl_certificate_export_response import SslCertificateExportResponse +from ...types import Response + + +def _get_kwargs( + ssl_certificate_id: int, + format_: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/ssl-certificates/{ssl_certificate_id}/export_format/{format_}".format( + ssl_certificate_id=quote(str(ssl_certificate_id), safe=""), + format_=quote(str(format_), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | SslCertificateExportResponse | None: + if response.status_code == 200: + response_200 = SslCertificateExportResponse.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 | SslCertificateExportResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + ssl_certificate_id: int, + format_: str, + *, + client: AuthenticatedClient, +) -> Response[ApiError | SslCertificateExportResponse]: + """Export SSL certificate keys + + Export SSL certificate keys + + Args: + ssl_certificate_id (int): + format_ (str): + + 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 | SslCertificateExportResponse] + """ + + kwargs = _get_kwargs( + ssl_certificate_id=ssl_certificate_id, + format_=format_, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + ssl_certificate_id: int, + format_: str, + *, + client: AuthenticatedClient, +) -> ApiError | SslCertificateExportResponse | None: + """Export SSL certificate keys + + Export SSL certificate keys + + Args: + ssl_certificate_id (int): + format_ (str): + + 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 | SslCertificateExportResponse + """ + + return sync_detailed( + ssl_certificate_id=ssl_certificate_id, + format_=format_, + client=client, + ).parsed + + +async def asyncio_detailed( + ssl_certificate_id: int, + format_: str, + *, + client: AuthenticatedClient, +) -> Response[ApiError | SslCertificateExportResponse]: + """Export SSL certificate keys + + Export SSL certificate keys + + Args: + ssl_certificate_id (int): + format_ (str): + + 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 | SslCertificateExportResponse] + """ + + kwargs = _get_kwargs( + ssl_certificate_id=ssl_certificate_id, + format_=format_, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + ssl_certificate_id: int, + format_: str, + *, + client: AuthenticatedClient, +) -> ApiError | SslCertificateExportResponse | None: + """Export SSL certificate keys + + Export SSL certificate keys + + Args: + ssl_certificate_id (int): + format_ (str): + + 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 | SslCertificateExportResponse + """ + + return ( + await asyncio_detailed( + ssl_certificate_id=ssl_certificate_id, + format_=format_, + client=client, + ) + ).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 new file mode 100644 index 0000000..ec5f294 --- /dev/null +++ b/src/shellrent_sdk/client/api/ssl/get_ssl_certificate.py @@ -0,0 +1,189 @@ +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.ssl_certificate_response import SslCertificateResponse +from ...types import Response + + +def _get_kwargs( + ssl_certificate_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/ssl-certificates/{ssl_certificate_id}".format( + ssl_certificate_id=quote(str(ssl_certificate_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | SslCertificateResponse | None: + if response.status_code == 200: + response_200 = SslCertificateResponse.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 | SslCertificateResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + ssl_certificate_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | SslCertificateResponse]: + """Get SSL certificate + + Get details of an SSL Certificate + + Args: + ssl_certificate_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 | SslCertificateResponse] + """ + + kwargs = _get_kwargs( + ssl_certificate_id=ssl_certificate_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + ssl_certificate_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | SslCertificateResponse | None: + """Get SSL certificate + + Get details of an SSL Certificate + + Args: + ssl_certificate_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 | SslCertificateResponse + """ + + return sync_detailed( + ssl_certificate_id=ssl_certificate_id, + client=client, + ).parsed + + +async def asyncio_detailed( + ssl_certificate_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | SslCertificateResponse]: + """Get SSL certificate + + Get details of an SSL Certificate + + Args: + ssl_certificate_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 | SslCertificateResponse] + """ + + kwargs = _get_kwargs( + ssl_certificate_id=ssl_certificate_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + ssl_certificate_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | SslCertificateResponse | None: + """Get SSL certificate + + Get details of an SSL Certificate + + Args: + ssl_certificate_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 | SslCertificateResponse + """ + + return ( + await asyncio_detailed( + ssl_certificate_id=ssl_certificate_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..ced4c34 --- /dev/null +++ b/src/shellrent_sdk/client/api/ssl/get_ssl_certificate_keys.py @@ -0,0 +1,189 @@ +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.ssl_certificate_keys_response import SslCertificateKeysResponse +from ...types import Response + + +def _get_kwargs( + ssl_certificate_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/ssl-certificates/{ssl_certificate_id}/keys".format( + ssl_certificate_id=quote(str(ssl_certificate_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | SslCertificateKeysResponse | None: + if response.status_code == 200: + response_200 = SslCertificateKeysResponse.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 | SslCertificateKeysResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + ssl_certificate_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | SslCertificateKeysResponse]: + """Get SSL certificate keys + + Get the keys of an SSL Certificate + + Args: + ssl_certificate_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 | SslCertificateKeysResponse] + """ + + kwargs = _get_kwargs( + ssl_certificate_id=ssl_certificate_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + ssl_certificate_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | SslCertificateKeysResponse | None: + """Get SSL certificate keys + + Get the keys of an SSL Certificate + + Args: + ssl_certificate_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 | SslCertificateKeysResponse + """ + + return sync_detailed( + ssl_certificate_id=ssl_certificate_id, + client=client, + ).parsed + + +async def asyncio_detailed( + ssl_certificate_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | SslCertificateKeysResponse]: + """Get SSL certificate keys + + Get the keys of an SSL Certificate + + Args: + ssl_certificate_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 | SslCertificateKeysResponse] + """ + + kwargs = _get_kwargs( + ssl_certificate_id=ssl_certificate_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + ssl_certificate_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | SslCertificateKeysResponse | None: + """Get SSL certificate keys + + Get the keys of an SSL Certificate + + Args: + ssl_certificate_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 | SslCertificateKeysResponse + """ + + return ( + await asyncio_detailed( + ssl_certificate_id=ssl_certificate_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..7925189 --- /dev/null +++ b/src/shellrent_sdk/client/api/ssl/list_ssl_approver_emails.py @@ -0,0 +1,189 @@ +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.ssl_certificate_approver_emails_response import SslCertificateApproverEmailsResponse +from ...types import Response + + +def _get_kwargs( + domain_name: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/ssl-certificates/approver-emails/{domain_name}".format( + domain_name=quote(str(domain_name), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | SslCertificateApproverEmailsResponse | None: + if response.status_code == 200: + response_200 = SslCertificateApproverEmailsResponse.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 | SslCertificateApproverEmailsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + domain_name: str, + *, + client: AuthenticatedClient, +) -> Response[ApiError | SslCertificateApproverEmailsResponse]: + """Get approver emails list + + Get a list of all acceptable approver emails for a domain name + + Args: + domain_name (str): + + 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 | SslCertificateApproverEmailsResponse] + """ + + kwargs = _get_kwargs( + domain_name=domain_name, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + domain_name: str, + *, + client: AuthenticatedClient, +) -> ApiError | SslCertificateApproverEmailsResponse | None: + """Get approver emails list + + Get a list of all acceptable approver emails for a domain name + + Args: + domain_name (str): + + 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 | SslCertificateApproverEmailsResponse + """ + + return sync_detailed( + domain_name=domain_name, + client=client, + ).parsed + + +async def asyncio_detailed( + domain_name: str, + *, + client: AuthenticatedClient, +) -> Response[ApiError | SslCertificateApproverEmailsResponse]: + """Get approver emails list + + Get a list of all acceptable approver emails for a domain name + + Args: + domain_name (str): + + 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 | SslCertificateApproverEmailsResponse] + """ + + kwargs = _get_kwargs( + domain_name=domain_name, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + domain_name: str, + *, + client: AuthenticatedClient, +) -> ApiError | SslCertificateApproverEmailsResponse | None: + """Get approver emails list + + Get a list of all acceptable approver emails for a domain name + + Args: + domain_name (str): + + 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 | SslCertificateApproverEmailsResponse + """ + + return ( + await asyncio_detailed( + domain_name=domain_name, + client=client, + ) + ).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 new file mode 100644 index 0000000..764cd90 --- /dev/null +++ b/src/shellrent_sdk/client/api/ssl/list_ssl_certificate_export_formats.py @@ -0,0 +1,191 @@ +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.ssl_certificate_export_format_list_response import ( + SslCertificateExportFormatListResponse, +) +from ...types import Response + + +def _get_kwargs( + ssl_certificate_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/ssl-certificates/{ssl_certificate_id}/export_formats".format( + ssl_certificate_id=quote(str(ssl_certificate_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | SslCertificateExportFormatListResponse | None: + if response.status_code == 200: + response_200 = SslCertificateExportFormatListResponse.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 | SslCertificateExportFormatListResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + ssl_certificate_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | SslCertificateExportFormatListResponse]: + """Get export formats + + Get a list of all export formats available for SSL Certificate keys + + Args: + ssl_certificate_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 | SslCertificateExportFormatListResponse] + """ + + kwargs = _get_kwargs( + ssl_certificate_id=ssl_certificate_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + ssl_certificate_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | SslCertificateExportFormatListResponse | None: + """Get export formats + + Get a list of all export formats available for SSL Certificate keys + + Args: + ssl_certificate_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 | SslCertificateExportFormatListResponse + """ + + return sync_detailed( + ssl_certificate_id=ssl_certificate_id, + client=client, + ).parsed + + +async def asyncio_detailed( + ssl_certificate_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | SslCertificateExportFormatListResponse]: + """Get export formats + + Get a list of all export formats available for SSL Certificate keys + + Args: + ssl_certificate_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 | SslCertificateExportFormatListResponse] + """ + + kwargs = _get_kwargs( + ssl_certificate_id=ssl_certificate_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + ssl_certificate_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | SslCertificateExportFormatListResponse | None: + """Get export formats + + Get a list of all export formats available for SSL Certificate keys + + Args: + ssl_certificate_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 | SslCertificateExportFormatListResponse + """ + + return ( + await asyncio_detailed( + ssl_certificate_id=ssl_certificate_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/ssl/list_ssl_certificates.py b/src/shellrent_sdk/client/api/ssl/list_ssl_certificates.py new file mode 100644 index 0000000..5121249 --- /dev/null +++ b/src/shellrent_sdk/client/api/ssl/list_ssl_certificates.py @@ -0,0 +1,239 @@ +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.ssl_certificate_paginated_list_response import SslCertificatePaginatedListResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + domain_name: str | Unset = UNSET, + san_domain_name: str | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["domain_name"] = domain_name + + params["san_domain_name"] = san_domain_name + + 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/ssl-certificates", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | SslCertificatePaginatedListResponse | None: + if response.status_code == 200: + response_200 = SslCertificatePaginatedListResponse.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 | SslCertificatePaginatedListResponse]: + 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, + domain_name: str | Unset = UNSET, + san_domain_name: str | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | SslCertificatePaginatedListResponse]: + """List all SSL Certificates + + Get a list of all SSL Certificates + + Args: + domain_name (str | Unset): + san_domain_name (str | Unset): + 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. + + Returns: + Response[ApiError | SslCertificatePaginatedListResponse] + """ + + kwargs = _get_kwargs( + domain_name=domain_name, + san_domain_name=san_domain_name, + page=page, + per_page=per_page, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + domain_name: str | Unset = UNSET, + san_domain_name: str | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | SslCertificatePaginatedListResponse | None: + """List all SSL Certificates + + Get a list of all SSL Certificates + + Args: + domain_name (str | Unset): + san_domain_name (str | Unset): + 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. + + Returns: + ApiError | SslCertificatePaginatedListResponse + """ + + return sync_detailed( + client=client, + domain_name=domain_name, + san_domain_name=san_domain_name, + page=page, + per_page=per_page, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + domain_name: str | Unset = UNSET, + san_domain_name: str | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | SslCertificatePaginatedListResponse]: + """List all SSL Certificates + + Get a list of all SSL Certificates + + Args: + domain_name (str | Unset): + san_domain_name (str | Unset): + 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. + + Returns: + Response[ApiError | SslCertificatePaginatedListResponse] + """ + + kwargs = _get_kwargs( + domain_name=domain_name, + san_domain_name=san_domain_name, + 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, + domain_name: str | Unset = UNSET, + san_domain_name: str | Unset = UNSET, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | SslCertificatePaginatedListResponse | None: + """List all SSL Certificates + + Get a list of all SSL Certificates + + Args: + domain_name (str | Unset): + san_domain_name (str | Unset): + 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. + + Returns: + ApiError | SslCertificatePaginatedListResponse + """ + + return ( + await asyncio_detailed( + client=client, + domain_name=domain_name, + san_domain_name=san_domain_name, + page=page, + per_page=per_page, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/ssl/reemit_ssl_certificate.py b/src/shellrent_sdk/client/api/ssl/reemit_ssl_certificate.py new file mode 100644 index 0000000..25693ef --- /dev/null +++ b/src/shellrent_sdk/client/api/ssl/reemit_ssl_certificate.py @@ -0,0 +1,210 @@ +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.ssl_certificate_reemit_request import SslCertificateReemitRequest +from ...models.task_response import TaskResponse +from ...types import Response + + +def _get_kwargs( + ssl_certificate_id: int, + *, + body: SslCertificateReemitRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/ssl-certificates/{ssl_certificate_id}/reemit".format( + ssl_certificate_id=quote(str(ssl_certificate_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( + ssl_certificate_id: int, + *, + client: AuthenticatedClient, + body: SslCertificateReemitRequest, +) -> Response[ApiError | TaskResponse]: + """Re-emit certificate + + Ask for the SSL Certificate to be re-emitted + + Args: + ssl_certificate_id (int): + body (SslCertificateReemitRequest): + + 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( + ssl_certificate_id=ssl_certificate_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + ssl_certificate_id: int, + *, + client: AuthenticatedClient, + body: SslCertificateReemitRequest, +) -> ApiError | TaskResponse | None: + """Re-emit certificate + + Ask for the SSL Certificate to be re-emitted + + Args: + ssl_certificate_id (int): + body (SslCertificateReemitRequest): + + 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( + ssl_certificate_id=ssl_certificate_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + ssl_certificate_id: int, + *, + client: AuthenticatedClient, + body: SslCertificateReemitRequest, +) -> Response[ApiError | TaskResponse]: + """Re-emit certificate + + Ask for the SSL Certificate to be re-emitted + + Args: + ssl_certificate_id (int): + body (SslCertificateReemitRequest): + + 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( + ssl_certificate_id=ssl_certificate_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + ssl_certificate_id: int, + *, + client: AuthenticatedClient, + body: SslCertificateReemitRequest, +) -> ApiError | TaskResponse | None: + """Re-emit certificate + + Ask for the SSL Certificate to be re-emitted + + Args: + ssl_certificate_id (int): + body (SslCertificateReemitRequest): + + 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( + ssl_certificate_id=ssl_certificate_id, + client=client, + body=body, + ) + ).parsed 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 new file mode 100644 index 0000000..0f9fdab --- /dev/null +++ b/src/shellrent_sdk/client/api/ssl/update_ssl_certificate_csr.py @@ -0,0 +1,210 @@ +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.ssl_certificate_change_csr_request import SslCertificateChangeCsrRequest +from ...models.ssl_certificate_key_response import SslCertificateKeyResponse +from ...types import Response + + +def _get_kwargs( + ssl_certificate_id: int, + *, + body: SslCertificateChangeCsrRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/api/v3/ssl-certificates/{ssl_certificate_id}/csr".format( + ssl_certificate_id=quote(str(ssl_certificate_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 | SslCertificateKeyResponse | None: + if response.status_code == 200: + response_200 = SslCertificateKeyResponse.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 | SslCertificateKeyResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + ssl_certificate_id: int, + *, + client: AuthenticatedClient, + body: SslCertificateChangeCsrRequest, +) -> Response[ApiError | SslCertificateKeyResponse]: + """Change SSL certificate CSR + + Change SSL certificate CSR + + Args: + ssl_certificate_id (int): + body (SslCertificateChangeCsrRequest): + + 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 | SslCertificateKeyResponse] + """ + + kwargs = _get_kwargs( + ssl_certificate_id=ssl_certificate_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + ssl_certificate_id: int, + *, + client: AuthenticatedClient, + body: SslCertificateChangeCsrRequest, +) -> ApiError | SslCertificateKeyResponse | None: + """Change SSL certificate CSR + + Change SSL certificate CSR + + Args: + ssl_certificate_id (int): + body (SslCertificateChangeCsrRequest): + + 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 | SslCertificateKeyResponse + """ + + return sync_detailed( + ssl_certificate_id=ssl_certificate_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + ssl_certificate_id: int, + *, + client: AuthenticatedClient, + body: SslCertificateChangeCsrRequest, +) -> Response[ApiError | SslCertificateKeyResponse]: + """Change SSL certificate CSR + + Change SSL certificate CSR + + Args: + ssl_certificate_id (int): + body (SslCertificateChangeCsrRequest): + + 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 | SslCertificateKeyResponse] + """ + + kwargs = _get_kwargs( + ssl_certificate_id=ssl_certificate_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + ssl_certificate_id: int, + *, + client: AuthenticatedClient, + body: SslCertificateChangeCsrRequest, +) -> ApiError | SslCertificateKeyResponse | None: + """Change SSL certificate CSR + + Change SSL certificate CSR + + Args: + ssl_certificate_id (int): + body (SslCertificateChangeCsrRequest): + + 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 | SslCertificateKeyResponse + """ + + return ( + await asyncio_detailed( + ssl_certificate_id=ssl_certificate_id, + client=client, + body=body, + ) + ).parsed 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 new file mode 100644 index 0000000..6f4662f --- /dev/null +++ b/src/shellrent_sdk/client/api/ssl/update_ssl_certificate_owner.py @@ -0,0 +1,210 @@ +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.ssl_certificate_owner_request import SslCertificateOwnerRequest +from ...models.ssl_certificate_response import SslCertificateResponse +from ...types import Response + + +def _get_kwargs( + ssl_certificate_id: int, + *, + body: SslCertificateOwnerRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/api/v3/ssl-certificates/{ssl_certificate_id}".format( + ssl_certificate_id=quote(str(ssl_certificate_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 | SslCertificateResponse | None: + if response.status_code == 200: + response_200 = SslCertificateResponse.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 | SslCertificateResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + ssl_certificate_id: int, + *, + client: AuthenticatedClient, + body: SslCertificateOwnerRequest, +) -> Response[ApiError | SslCertificateResponse]: + """Edit SSL certificate owner + + Edit SSL certificate owner + + Args: + ssl_certificate_id (int): + body (SslCertificateOwnerRequest): + + 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 | SslCertificateResponse] + """ + + kwargs = _get_kwargs( + ssl_certificate_id=ssl_certificate_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + ssl_certificate_id: int, + *, + client: AuthenticatedClient, + body: SslCertificateOwnerRequest, +) -> ApiError | SslCertificateResponse | None: + """Edit SSL certificate owner + + Edit SSL certificate owner + + Args: + ssl_certificate_id (int): + body (SslCertificateOwnerRequest): + + 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 | SslCertificateResponse + """ + + return sync_detailed( + ssl_certificate_id=ssl_certificate_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + ssl_certificate_id: int, + *, + client: AuthenticatedClient, + body: SslCertificateOwnerRequest, +) -> Response[ApiError | SslCertificateResponse]: + """Edit SSL certificate owner + + Edit SSL certificate owner + + Args: + ssl_certificate_id (int): + body (SslCertificateOwnerRequest): + + 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 | SslCertificateResponse] + """ + + kwargs = _get_kwargs( + ssl_certificate_id=ssl_certificate_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + ssl_certificate_id: int, + *, + client: AuthenticatedClient, + body: SslCertificateOwnerRequest, +) -> ApiError | SslCertificateResponse | None: + """Edit SSL certificate owner + + Edit SSL certificate owner + + Args: + ssl_certificate_id (int): + body (SslCertificateOwnerRequest): + + 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 | SslCertificateResponse + """ + + return ( + await asyncio_detailed( + ssl_certificate_id=ssl_certificate_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/storage/__init__.py b/src/shellrent_sdk/client/api/storage/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/src/shellrent_sdk/client/api/storage/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" 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 new file mode 100644 index 0000000..f435aed --- /dev/null +++ b/src/shellrent_sdk/client/api/storage/create_cloud_storage_access.py @@ -0,0 +1,210 @@ +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.cloud_storage_access_create_request import CloudStorageAccessCreateRequest +from ...models.cloud_storage_access_response import CloudStorageAccessResponse +from ...types import Response + + +def _get_kwargs( + cloud_storage_id: int, + *, + body: CloudStorageAccessCreateRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/cloud-storages/{cloud_storage_id}/accesses".format( + cloud_storage_id=quote(str(cloud_storage_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 | CloudStorageAccessResponse | None: + if response.status_code == 200: + response_200 = CloudStorageAccessResponse.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 | CloudStorageAccessResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + cloud_storage_id: int, + *, + client: AuthenticatedClient, + body: CloudStorageAccessCreateRequest, +) -> Response[ApiError | CloudStorageAccessResponse]: + """Create cloud storage access + + Create a new cloud storage NFS access + + Args: + cloud_storage_id (int): + body (CloudStorageAccessCreateRequest): + + 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 | CloudStorageAccessResponse] + """ + + kwargs = _get_kwargs( + cloud_storage_id=cloud_storage_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + cloud_storage_id: int, + *, + client: AuthenticatedClient, + body: CloudStorageAccessCreateRequest, +) -> ApiError | CloudStorageAccessResponse | None: + """Create cloud storage access + + Create a new cloud storage NFS access + + Args: + cloud_storage_id (int): + body (CloudStorageAccessCreateRequest): + + 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 | CloudStorageAccessResponse + """ + + return sync_detailed( + cloud_storage_id=cloud_storage_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + cloud_storage_id: int, + *, + client: AuthenticatedClient, + body: CloudStorageAccessCreateRequest, +) -> Response[ApiError | CloudStorageAccessResponse]: + """Create cloud storage access + + Create a new cloud storage NFS access + + Args: + cloud_storage_id (int): + body (CloudStorageAccessCreateRequest): + + 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 | CloudStorageAccessResponse] + """ + + kwargs = _get_kwargs( + cloud_storage_id=cloud_storage_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + cloud_storage_id: int, + *, + client: AuthenticatedClient, + body: CloudStorageAccessCreateRequest, +) -> ApiError | CloudStorageAccessResponse | None: + """Create cloud storage access + + Create a new cloud storage NFS access + + Args: + cloud_storage_id (int): + body (CloudStorageAccessCreateRequest): + + 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 | CloudStorageAccessResponse + """ + + return ( + await asyncio_detailed( + cloud_storage_id=cloud_storage_id, + client=client, + body=body, + ) + ).parsed 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 new file mode 100644 index 0000000..73d7814 --- /dev/null +++ b/src/shellrent_sdk/client/api/storage/create_object_storage_bucket_firewall_entry.py @@ -0,0 +1,228 @@ +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.object_storage_bucket_firewall_entry_create_request import ( + ObjectStorageBucketFirewallEntryCreateRequest, +) +from ...models.object_storage_bucket_firewall_entry_response import ( + ObjectStorageBucketFirewallEntryResponse, +) +from ...types import Response + + +def _get_kwargs( + object_storage_id: int, + bucket_id: int, + *, + body: ObjectStorageBucketFirewallEntryCreateRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/object-storages/{object_storage_id}/buckets/{bucket_id}/firewall-entries".format( + object_storage_id=quote(str(object_storage_id), safe=""), + bucket_id=quote(str(bucket_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 | ObjectStorageBucketFirewallEntryResponse | None: + if response.status_code == 200: + response_200 = ObjectStorageBucketFirewallEntryResponse.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 | ObjectStorageBucketFirewallEntryResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + object_storage_id: int, + bucket_id: int, + *, + client: AuthenticatedClient, + body: ObjectStorageBucketFirewallEntryCreateRequest, +) -> Response[ApiError | ObjectStorageBucketFirewallEntryResponse]: + """Create object storage bucket firewall entry + + Create object storage bucket firewall entry + + Args: + object_storage_id (int): + bucket_id (int): + body (ObjectStorageBucketFirewallEntryCreateRequest): + + 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] + """ + + kwargs = _get_kwargs( + object_storage_id=object_storage_id, + bucket_id=bucket_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + object_storage_id: int, + bucket_id: int, + *, + client: AuthenticatedClient, + body: ObjectStorageBucketFirewallEntryCreateRequest, +) -> ApiError | ObjectStorageBucketFirewallEntryResponse | None: + """Create object storage bucket firewall entry + + Create object storage bucket firewall entry + + Args: + object_storage_id (int): + bucket_id (int): + body (ObjectStorageBucketFirewallEntryCreateRequest): + + 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 + """ + + return sync_detailed( + object_storage_id=object_storage_id, + bucket_id=bucket_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + object_storage_id: int, + bucket_id: int, + *, + client: AuthenticatedClient, + body: ObjectStorageBucketFirewallEntryCreateRequest, +) -> Response[ApiError | ObjectStorageBucketFirewallEntryResponse]: + """Create object storage bucket firewall entry + + Create object storage bucket firewall entry + + Args: + object_storage_id (int): + bucket_id (int): + body (ObjectStorageBucketFirewallEntryCreateRequest): + + 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] + """ + + kwargs = _get_kwargs( + object_storage_id=object_storage_id, + bucket_id=bucket_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + object_storage_id: int, + bucket_id: int, + *, + client: AuthenticatedClient, + body: ObjectStorageBucketFirewallEntryCreateRequest, +) -> ApiError | ObjectStorageBucketFirewallEntryResponse | None: + """Create object storage bucket firewall entry + + Create object storage bucket firewall entry + + Args: + object_storage_id (int): + bucket_id (int): + body (ObjectStorageBucketFirewallEntryCreateRequest): + + 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 + """ + + return ( + await asyncio_detailed( + object_storage_id=object_storage_id, + bucket_id=bucket_id, + client=client, + body=body, + ) + ).parsed 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 new file mode 100644 index 0000000..891d3dc --- /dev/null +++ b/src/shellrent_sdk/client/api/storage/create_object_storage_iam_user.py @@ -0,0 +1,189 @@ +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.object_storage_iam_user_response import ObjectStorageIamUserResponse +from ...types import Response + + +def _get_kwargs( + object_storage_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/object-storages/{object_storage_id}/iam-users".format( + object_storage_id=quote(str(object_storage_id), safe=""), + ), + } + + return _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()) + + 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 | ObjectStorageIamUserResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + object_storage_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ObjectStorageIamUserResponse]: + """Create object storage IAM user + + Create a new object storage IAM user + + Args: + object_storage_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 | ObjectStorageIamUserResponse] + """ + + kwargs = _get_kwargs( + object_storage_id=object_storage_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + object_storage_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | ObjectStorageIamUserResponse | None: + """Create object storage IAM user + + Create a new object storage IAM user + + Args: + object_storage_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 | ObjectStorageIamUserResponse + """ + + return sync_detailed( + object_storage_id=object_storage_id, + client=client, + ).parsed + + +async def asyncio_detailed( + object_storage_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ObjectStorageIamUserResponse]: + """Create object storage IAM user + + Create a new object storage IAM user + + Args: + object_storage_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 | ObjectStorageIamUserResponse] + """ + + kwargs = _get_kwargs( + object_storage_id=object_storage_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + object_storage_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | ObjectStorageIamUserResponse | None: + """Create object storage IAM user + + Create a new object storage IAM user + + Args: + object_storage_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 | ObjectStorageIamUserResponse + """ + + return ( + await asyncio_detailed( + object_storage_id=object_storage_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..3283ebc --- /dev/null +++ b/src/shellrent_sdk/client/api/storage/create_object_storage_iam_user_s3_key.py @@ -0,0 +1,203 @@ +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.object_storage_iam_user_s3_key_response import ObjectStorageIamUserS3KeyResponse +from ...types import Response + + +def _get_kwargs( + object_storage_id: int, + iam_user_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/object-storages/{object_storage_id}/iam-users/{iam_user_id}/s3-keys".format( + object_storage_id=quote(str(object_storage_id), safe=""), + iam_user_id=quote(str(iam_user_id), safe=""), + ), + } + + return _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()) + + 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 | ObjectStorageIamUserS3KeyResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + object_storage_id: int, + iam_user_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ObjectStorageIamUserS3KeyResponse]: + """Create object storage IAM user S3 key + + Create object storage IAM user S3 key + + Args: + object_storage_id (int): + iam_user_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 | ObjectStorageIamUserS3KeyResponse] + """ + + kwargs = _get_kwargs( + object_storage_id=object_storage_id, + iam_user_id=iam_user_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + object_storage_id: int, + iam_user_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | ObjectStorageIamUserS3KeyResponse | None: + """Create object storage IAM user S3 key + + Create object storage IAM user S3 key + + Args: + object_storage_id (int): + iam_user_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 | ObjectStorageIamUserS3KeyResponse + """ + + return sync_detailed( + object_storage_id=object_storage_id, + iam_user_id=iam_user_id, + client=client, + ).parsed + + +async def asyncio_detailed( + object_storage_id: int, + iam_user_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ObjectStorageIamUserS3KeyResponse]: + """Create object storage IAM user S3 key + + Create object storage IAM user S3 key + + Args: + object_storage_id (int): + iam_user_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 | ObjectStorageIamUserS3KeyResponse] + """ + + kwargs = _get_kwargs( + object_storage_id=object_storage_id, + iam_user_id=iam_user_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + object_storage_id: int, + iam_user_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | ObjectStorageIamUserS3KeyResponse | None: + """Create object storage IAM user S3 key + + Create object storage IAM user S3 key + + Args: + object_storage_id (int): + iam_user_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 | ObjectStorageIamUserS3KeyResponse + """ + + return ( + await asyncio_detailed( + object_storage_id=object_storage_id, + iam_user_id=iam_user_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..def34bd --- /dev/null +++ b/src/shellrent_sdk/client/api/storage/delete_cloud_storage_access.py @@ -0,0 +1,203 @@ +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.empty_response import EmptyResponse +from ...types import Response + + +def _get_kwargs( + cloud_storage_id: int, + access_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/api/v3/cloud-storages/{cloud_storage_id}/accesses/{access_id}".format( + cloud_storage_id=quote(str(cloud_storage_id), safe=""), + access_id=quote(str(access_id), safe=""), + ), + } + + return _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 + + 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 | EmptyResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + cloud_storage_id: int, + access_id: str, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Delete cloud storage access + + Delete a cloud storage NFS access + + Args: + cloud_storage_id (int): + access_id (str): + + 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] + """ + + kwargs = _get_kwargs( + cloud_storage_id=cloud_storage_id, + access_id=access_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + cloud_storage_id: int, + access_id: str, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Delete cloud storage access + + Delete a cloud storage NFS access + + Args: + cloud_storage_id (int): + access_id (str): + + 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 + """ + + return sync_detailed( + cloud_storage_id=cloud_storage_id, + access_id=access_id, + client=client, + ).parsed + + +async def asyncio_detailed( + cloud_storage_id: int, + access_id: str, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Delete cloud storage access + + Delete a cloud storage NFS access + + Args: + cloud_storage_id (int): + access_id (str): + + 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] + """ + + kwargs = _get_kwargs( + cloud_storage_id=cloud_storage_id, + access_id=access_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + cloud_storage_id: int, + access_id: str, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Delete cloud storage access + + Delete a cloud storage NFS access + + Args: + cloud_storage_id (int): + access_id (str): + + 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 + """ + + return ( + await asyncio_detailed( + cloud_storage_id=cloud_storage_id, + access_id=access_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..c21dd55 --- /dev/null +++ b/src/shellrent_sdk/client/api/storage/delete_cloud_storage_user.py @@ -0,0 +1,203 @@ +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.empty_response import EmptyResponse +from ...types import Response + + +def _get_kwargs( + cloud_storage_id: int, + cloud_storage_user_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "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=""), + ), + } + + return _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 + + 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 | EmptyResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + cloud_storage_id: int, + cloud_storage_user_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Delete cloud storage user + + Suspend a cloud storage user + + Args: + cloud_storage_id (int): + cloud_storage_user_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] + """ + + kwargs = _get_kwargs( + cloud_storage_id=cloud_storage_id, + cloud_storage_user_id=cloud_storage_user_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + cloud_storage_id: int, + cloud_storage_user_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Delete cloud storage user + + Suspend a cloud storage user + + Args: + cloud_storage_id (int): + cloud_storage_user_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 + """ + + return sync_detailed( + cloud_storage_id=cloud_storage_id, + cloud_storage_user_id=cloud_storage_user_id, + client=client, + ).parsed + + +async def asyncio_detailed( + cloud_storage_id: int, + cloud_storage_user_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Delete cloud storage user + + Suspend a cloud storage user + + Args: + cloud_storage_id (int): + cloud_storage_user_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] + """ + + kwargs = _get_kwargs( + cloud_storage_id=cloud_storage_id, + cloud_storage_user_id=cloud_storage_user_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + cloud_storage_id: int, + cloud_storage_user_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Delete cloud storage user + + Suspend a cloud storage user + + Args: + cloud_storage_id (int): + cloud_storage_user_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 + """ + + return ( + await asyncio_detailed( + cloud_storage_id=cloud_storage_id, + cloud_storage_user_id=cloud_storage_user_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..44442a9 --- /dev/null +++ b/src/shellrent_sdk/client/api/storage/delete_object_storage_bucket_firewall_entry.py @@ -0,0 +1,219 @@ +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.object_storage_bucket_firewall_entry_response import ( + ObjectStorageBucketFirewallEntryResponse, +) +from ...types import Response + + +def _get_kwargs( + object_storage_id: int, + bucket_id: int, + entry_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/api/v3/object-storages/{object_storage_id}/buckets/{bucket_id}/firewall-entries/{entry_id}".format( + object_storage_id=quote(str(object_storage_id), safe=""), + bucket_id=quote(str(bucket_id), safe=""), + entry_id=quote(str(entry_id), safe=""), + ), + } + + return _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()) + + 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 | ObjectStorageBucketFirewallEntryResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + object_storage_id: int, + bucket_id: int, + entry_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ObjectStorageBucketFirewallEntryResponse]: + """Delete object storage bucket firewall entry + + Delete object storage bucket firewall entry + + Args: + object_storage_id (int): + bucket_id (int): + entry_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 | ObjectStorageBucketFirewallEntryResponse] + """ + + kwargs = _get_kwargs( + object_storage_id=object_storage_id, + bucket_id=bucket_id, + entry_id=entry_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + object_storage_id: int, + bucket_id: int, + entry_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | ObjectStorageBucketFirewallEntryResponse | None: + """Delete object storage bucket firewall entry + + Delete object storage bucket firewall entry + + Args: + object_storage_id (int): + bucket_id (int): + entry_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 | ObjectStorageBucketFirewallEntryResponse + """ + + return sync_detailed( + object_storage_id=object_storage_id, + bucket_id=bucket_id, + entry_id=entry_id, + client=client, + ).parsed + + +async def asyncio_detailed( + object_storage_id: int, + bucket_id: int, + entry_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ObjectStorageBucketFirewallEntryResponse]: + """Delete object storage bucket firewall entry + + Delete object storage bucket firewall entry + + Args: + object_storage_id (int): + bucket_id (int): + entry_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 | ObjectStorageBucketFirewallEntryResponse] + """ + + kwargs = _get_kwargs( + object_storage_id=object_storage_id, + bucket_id=bucket_id, + entry_id=entry_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + object_storage_id: int, + bucket_id: int, + entry_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | ObjectStorageBucketFirewallEntryResponse | None: + """Delete object storage bucket firewall entry + + Delete object storage bucket firewall entry + + Args: + object_storage_id (int): + bucket_id (int): + entry_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 | ObjectStorageBucketFirewallEntryResponse + """ + + return ( + await asyncio_detailed( + object_storage_id=object_storage_id, + bucket_id=bucket_id, + entry_id=entry_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..8a0ff2b --- /dev/null +++ b/src/shellrent_sdk/client/api/storage/delete_object_storage_iam_user.py @@ -0,0 +1,203 @@ +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.empty_response import EmptyResponse +from ...types import Response + + +def _get_kwargs( + object_storage_id: int, + iam_user_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/api/v3/object-storages/{object_storage_id}/iam-users/{iam_user_id}".format( + object_storage_id=quote(str(object_storage_id), safe=""), + iam_user_id=quote(str(iam_user_id), safe=""), + ), + } + + return _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 + + 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 | EmptyResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + object_storage_id: int, + iam_user_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Delete object storage IAM user + + Delete an object storage IAM user + + Args: + object_storage_id (int): + iam_user_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] + """ + + kwargs = _get_kwargs( + object_storage_id=object_storage_id, + iam_user_id=iam_user_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + object_storage_id: int, + iam_user_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Delete object storage IAM user + + Delete an object storage IAM user + + Args: + object_storage_id (int): + iam_user_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 + """ + + return sync_detailed( + object_storage_id=object_storage_id, + iam_user_id=iam_user_id, + client=client, + ).parsed + + +async def asyncio_detailed( + object_storage_id: int, + iam_user_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Delete object storage IAM user + + Delete an object storage IAM user + + Args: + object_storage_id (int): + iam_user_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] + """ + + kwargs = _get_kwargs( + object_storage_id=object_storage_id, + iam_user_id=iam_user_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + object_storage_id: int, + iam_user_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Delete object storage IAM user + + Delete an object storage IAM user + + Args: + object_storage_id (int): + iam_user_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 + """ + + return ( + await asyncio_detailed( + object_storage_id=object_storage_id, + iam_user_id=iam_user_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..a9099b5 --- /dev/null +++ b/src/shellrent_sdk/client/api/storage/delete_object_storage_iam_user_s3_key.py @@ -0,0 +1,217 @@ +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.empty_response import EmptyResponse +from ...types import Response + + +def _get_kwargs( + object_storage_id: int, + iam_user_id: int, + s3_key_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/api/v3/object-storages/{object_storage_id}/iam-users/{iam_user_id}/s3-keys/{s3_key_id}".format( + object_storage_id=quote(str(object_storage_id), safe=""), + iam_user_id=quote(str(iam_user_id), safe=""), + s3_key_id=quote(str(s3_key_id), safe=""), + ), + } + + return _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 + + 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 | EmptyResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + object_storage_id: int, + iam_user_id: int, + s3_key_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Delete object storage IAM user S3 key + + Delete object storage IAM user S3 key + + Args: + object_storage_id (int): + iam_user_id (int): + s3_key_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] + """ + + kwargs = _get_kwargs( + object_storage_id=object_storage_id, + iam_user_id=iam_user_id, + s3_key_id=s3_key_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + object_storage_id: int, + iam_user_id: int, + s3_key_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Delete object storage IAM user S3 key + + Delete object storage IAM user S3 key + + Args: + object_storage_id (int): + iam_user_id (int): + s3_key_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 + """ + + return sync_detailed( + object_storage_id=object_storage_id, + iam_user_id=iam_user_id, + s3_key_id=s3_key_id, + client=client, + ).parsed + + +async def asyncio_detailed( + object_storage_id: int, + iam_user_id: int, + s3_key_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | EmptyResponse]: + """Delete object storage IAM user S3 key + + Delete object storage IAM user S3 key + + Args: + object_storage_id (int): + iam_user_id (int): + s3_key_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] + """ + + kwargs = _get_kwargs( + object_storage_id=object_storage_id, + iam_user_id=iam_user_id, + s3_key_id=s3_key_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + object_storage_id: int, + iam_user_id: int, + s3_key_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | EmptyResponse | None: + """Delete object storage IAM user S3 key + + Delete object storage IAM user S3 key + + Args: + object_storage_id (int): + iam_user_id (int): + s3_key_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 + """ + + return ( + await asyncio_detailed( + object_storage_id=object_storage_id, + iam_user_id=iam_user_id, + s3_key_id=s3_key_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..18e7cc5 --- /dev/null +++ b/src/shellrent_sdk/client/api/storage/downgrade_cloud_storage_size.py @@ -0,0 +1,189 @@ +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( + cloud_storage_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/api/v3/cloud-storages/{cloud_storage_id}/size-downgrade".format( + cloud_storage_id=quote(str(cloud_storage_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( + cloud_storage_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | TaskResponse]: + """Downgrade cloud storage size + + Downgrade the cloud storage size. Returns the background Task created for the downgrade. + + Args: + cloud_storage_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( + cloud_storage_id=cloud_storage_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + cloud_storage_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | TaskResponse | None: + """Downgrade cloud storage size + + Downgrade the cloud storage size. Returns the background Task created for the downgrade. + + Args: + cloud_storage_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( + cloud_storage_id=cloud_storage_id, + client=client, + ).parsed + + +async def asyncio_detailed( + cloud_storage_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | TaskResponse]: + """Downgrade cloud storage size + + Downgrade the cloud storage size. Returns the background Task created for the downgrade. + + Args: + cloud_storage_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( + cloud_storage_id=cloud_storage_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + cloud_storage_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | TaskResponse | None: + """Downgrade cloud storage size + + Downgrade the cloud storage size. Returns the background Task created for the downgrade. + + Args: + cloud_storage_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( + cloud_storage_id=cloud_storage_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/storage/get_cloud_storage.py b/src/shellrent_sdk/client/api/storage/get_cloud_storage.py new file mode 100644 index 0000000..f6b359b --- /dev/null +++ b/src/shellrent_sdk/client/api/storage/get_cloud_storage.py @@ -0,0 +1,189 @@ +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.cloud_storage_response import CloudStorageResponse +from ...types import Response + + +def _get_kwargs( + cloud_storage_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/cloud-storages/{cloud_storage_id}".format( + cloud_storage_id=quote(str(cloud_storage_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | CloudStorageResponse | None: + if response.status_code == 200: + response_200 = CloudStorageResponse.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 | CloudStorageResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + cloud_storage_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | CloudStorageResponse]: + """Get cloud storage + + Get cloud storage details + + Args: + cloud_storage_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 | CloudStorageResponse] + """ + + kwargs = _get_kwargs( + cloud_storage_id=cloud_storage_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + cloud_storage_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | CloudStorageResponse | None: + """Get cloud storage + + Get cloud storage details + + Args: + cloud_storage_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 | CloudStorageResponse + """ + + return sync_detailed( + cloud_storage_id=cloud_storage_id, + client=client, + ).parsed + + +async def asyncio_detailed( + cloud_storage_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | CloudStorageResponse]: + """Get cloud storage + + Get cloud storage details + + Args: + cloud_storage_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 | CloudStorageResponse] + """ + + kwargs = _get_kwargs( + cloud_storage_id=cloud_storage_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + cloud_storage_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | CloudStorageResponse | None: + """Get cloud storage + + Get cloud storage details + + Args: + cloud_storage_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 | CloudStorageResponse + """ + + return ( + await asyncio_detailed( + cloud_storage_id=cloud_storage_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..bf179e5 --- /dev/null +++ b/src/shellrent_sdk/client/api/storage/get_cloud_storage_access.py @@ -0,0 +1,203 @@ +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.cloud_storage_access_response import CloudStorageAccessResponse +from ...types import Response + + +def _get_kwargs( + cloud_storage_id: int, + access_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/cloud-storages/{cloud_storage_id}/accesses/{access_id}".format( + cloud_storage_id=quote(str(cloud_storage_id), safe=""), + access_id=quote(str(access_id), safe=""), + ), + } + + return _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()) + + 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 | CloudStorageAccessResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + cloud_storage_id: int, + access_id: str, + *, + client: AuthenticatedClient, +) -> Response[ApiError | CloudStorageAccessResponse]: + """Get cloud storage access + + Get details of a cloud storage NFS access + + Args: + cloud_storage_id (int): + access_id (str): + + 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 | CloudStorageAccessResponse] + """ + + kwargs = _get_kwargs( + cloud_storage_id=cloud_storage_id, + access_id=access_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + cloud_storage_id: int, + access_id: str, + *, + client: AuthenticatedClient, +) -> ApiError | CloudStorageAccessResponse | None: + """Get cloud storage access + + Get details of a cloud storage NFS access + + Args: + cloud_storage_id (int): + access_id (str): + + 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 | CloudStorageAccessResponse + """ + + return sync_detailed( + cloud_storage_id=cloud_storage_id, + access_id=access_id, + client=client, + ).parsed + + +async def asyncio_detailed( + cloud_storage_id: int, + access_id: str, + *, + client: AuthenticatedClient, +) -> Response[ApiError | CloudStorageAccessResponse]: + """Get cloud storage access + + Get details of a cloud storage NFS access + + Args: + cloud_storage_id (int): + access_id (str): + + 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 | CloudStorageAccessResponse] + """ + + kwargs = _get_kwargs( + cloud_storage_id=cloud_storage_id, + access_id=access_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + cloud_storage_id: int, + access_id: str, + *, + client: AuthenticatedClient, +) -> ApiError | CloudStorageAccessResponse | None: + """Get cloud storage access + + Get details of a cloud storage NFS access + + Args: + cloud_storage_id (int): + access_id (str): + + 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 | CloudStorageAccessResponse + """ + + return ( + await asyncio_detailed( + cloud_storage_id=cloud_storage_id, + access_id=access_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..a0775a0 --- /dev/null +++ b/src/shellrent_sdk/client/api/storage/get_cloud_storage_user.py @@ -0,0 +1,203 @@ +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.cloud_storage_user_response import CloudStorageUserResponse +from ...types import Response + + +def _get_kwargs( + cloud_storage_id: int, + cloud_storage_user_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "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=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | CloudStorageUserResponse | None: + if response.status_code == 200: + response_200 = CloudStorageUserResponse.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 | CloudStorageUserResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + cloud_storage_id: int, + cloud_storage_user_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | CloudStorageUserResponse]: + """Get cloud storage user + + Get cloud storage user details + + Args: + cloud_storage_id (int): + cloud_storage_user_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 | CloudStorageUserResponse] + """ + + kwargs = _get_kwargs( + cloud_storage_id=cloud_storage_id, + cloud_storage_user_id=cloud_storage_user_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + cloud_storage_id: int, + cloud_storage_user_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | CloudStorageUserResponse | None: + """Get cloud storage user + + Get cloud storage user details + + Args: + cloud_storage_id (int): + cloud_storage_user_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 | CloudStorageUserResponse + """ + + return sync_detailed( + cloud_storage_id=cloud_storage_id, + cloud_storage_user_id=cloud_storage_user_id, + client=client, + ).parsed + + +async def asyncio_detailed( + cloud_storage_id: int, + cloud_storage_user_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | CloudStorageUserResponse]: + """Get cloud storage user + + Get cloud storage user details + + Args: + cloud_storage_id (int): + cloud_storage_user_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 | CloudStorageUserResponse] + """ + + kwargs = _get_kwargs( + cloud_storage_id=cloud_storage_id, + cloud_storage_user_id=cloud_storage_user_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + cloud_storage_id: int, + cloud_storage_user_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | CloudStorageUserResponse | None: + """Get cloud storage user + + Get cloud storage user details + + Args: + cloud_storage_id (int): + cloud_storage_user_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 | CloudStorageUserResponse + """ + + return ( + await asyncio_detailed( + cloud_storage_id=cloud_storage_id, + cloud_storage_user_id=cloud_storage_user_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/storage/get_object_storage.py b/src/shellrent_sdk/client/api/storage/get_object_storage.py new file mode 100644 index 0000000..c800101 --- /dev/null +++ b/src/shellrent_sdk/client/api/storage/get_object_storage.py @@ -0,0 +1,189 @@ +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.object_storage_response import ObjectStorageResponse +from ...types import Response + + +def _get_kwargs( + object_storage_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/object-storages/{object_storage_id}".format( + object_storage_id=quote(str(object_storage_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | ObjectStorageResponse | None: + if response.status_code == 200: + response_200 = ObjectStorageResponse.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 | ObjectStorageResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + object_storage_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ObjectStorageResponse]: + """Get object storage + + Get object storage details + + Args: + object_storage_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 | ObjectStorageResponse] + """ + + kwargs = _get_kwargs( + object_storage_id=object_storage_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + object_storage_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | ObjectStorageResponse | None: + """Get object storage + + Get object storage details + + Args: + object_storage_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 | ObjectStorageResponse + """ + + return sync_detailed( + object_storage_id=object_storage_id, + client=client, + ).parsed + + +async def asyncio_detailed( + object_storage_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ObjectStorageResponse]: + """Get object storage + + Get object storage details + + Args: + object_storage_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 | ObjectStorageResponse] + """ + + kwargs = _get_kwargs( + object_storage_id=object_storage_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + object_storage_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | ObjectStorageResponse | None: + """Get object storage + + Get object storage details + + Args: + object_storage_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 | ObjectStorageResponse + """ + + return ( + await asyncio_detailed( + object_storage_id=object_storage_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..79eb484 --- /dev/null +++ b/src/shellrent_sdk/client/api/storage/get_object_storage_bucket.py @@ -0,0 +1,203 @@ +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.object_storage_bucket_response import ObjectStorageBucketResponse +from ...types import Response + + +def _get_kwargs( + object_storage_id: int, + bucket_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/object-storages/{object_storage_id}/buckets/{bucket_id}".format( + object_storage_id=quote(str(object_storage_id), safe=""), + bucket_id=quote(str(bucket_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | ObjectStorageBucketResponse | None: + if response.status_code == 200: + response_200 = ObjectStorageBucketResponse.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 | ObjectStorageBucketResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + object_storage_id: int, + bucket_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ObjectStorageBucketResponse]: + """Get object storage bucket + + Get object storage bucket details + + Args: + object_storage_id (int): + bucket_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 | ObjectStorageBucketResponse] + """ + + kwargs = _get_kwargs( + object_storage_id=object_storage_id, + bucket_id=bucket_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + object_storage_id: int, + bucket_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | ObjectStorageBucketResponse | None: + """Get object storage bucket + + Get object storage bucket details + + Args: + object_storage_id (int): + bucket_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 | ObjectStorageBucketResponse + """ + + return sync_detailed( + object_storage_id=object_storage_id, + bucket_id=bucket_id, + client=client, + ).parsed + + +async def asyncio_detailed( + object_storage_id: int, + bucket_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ObjectStorageBucketResponse]: + """Get object storage bucket + + Get object storage bucket details + + Args: + object_storage_id (int): + bucket_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 | ObjectStorageBucketResponse] + """ + + kwargs = _get_kwargs( + object_storage_id=object_storage_id, + bucket_id=bucket_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + object_storage_id: int, + bucket_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | ObjectStorageBucketResponse | None: + """Get object storage bucket + + Get object storage bucket details + + Args: + object_storage_id (int): + bucket_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 | ObjectStorageBucketResponse + """ + + return ( + await asyncio_detailed( + object_storage_id=object_storage_id, + bucket_id=bucket_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..0e81e14 --- /dev/null +++ b/src/shellrent_sdk/client/api/storage/get_object_storage_bucket_chart.py @@ -0,0 +1,203 @@ +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.object_storage_bucket_chart_response import ObjectStorageBucketChartResponse +from ...types import Response + + +def _get_kwargs( + object_storage_id: int, + bucket_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/object-storages/{object_storage_id}/buckets/{bucket_id}/chart".format( + object_storage_id=quote(str(object_storage_id), safe=""), + bucket_id=quote(str(bucket_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | ObjectStorageBucketChartResponse | None: + if response.status_code == 200: + response_200 = ObjectStorageBucketChartResponse.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 | ObjectStorageBucketChartResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + object_storage_id: int, + bucket_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ObjectStorageBucketChartResponse]: + """Get object storage bucket chart + + Get object storage bucket chart data + + Args: + object_storage_id (int): + bucket_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 | ObjectStorageBucketChartResponse] + """ + + kwargs = _get_kwargs( + object_storage_id=object_storage_id, + bucket_id=bucket_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + object_storage_id: int, + bucket_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | ObjectStorageBucketChartResponse | None: + """Get object storage bucket chart + + Get object storage bucket chart data + + Args: + object_storage_id (int): + bucket_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 | ObjectStorageBucketChartResponse + """ + + return sync_detailed( + object_storage_id=object_storage_id, + bucket_id=bucket_id, + client=client, + ).parsed + + +async def asyncio_detailed( + object_storage_id: int, + bucket_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ObjectStorageBucketChartResponse]: + """Get object storage bucket chart + + Get object storage bucket chart data + + Args: + object_storage_id (int): + bucket_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 | ObjectStorageBucketChartResponse] + """ + + kwargs = _get_kwargs( + object_storage_id=object_storage_id, + bucket_id=bucket_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + object_storage_id: int, + bucket_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | ObjectStorageBucketChartResponse | None: + """Get object storage bucket chart + + Get object storage bucket chart data + + Args: + object_storage_id (int): + bucket_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 | ObjectStorageBucketChartResponse + """ + + return ( + await asyncio_detailed( + object_storage_id=object_storage_id, + bucket_id=bucket_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..7ba50b6 --- /dev/null +++ b/src/shellrent_sdk/client/api/storage/get_object_storage_bucket_firewall_entry.py @@ -0,0 +1,219 @@ +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.object_storage_bucket_firewall_entry_response import ( + ObjectStorageBucketFirewallEntryResponse, +) +from ...types import Response + + +def _get_kwargs( + object_storage_id: int, + bucket_id: int, + entry_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/object-storages/{object_storage_id}/buckets/{bucket_id}/firewall-entries/{entry_id}".format( + object_storage_id=quote(str(object_storage_id), safe=""), + bucket_id=quote(str(bucket_id), safe=""), + entry_id=quote(str(entry_id), safe=""), + ), + } + + return _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()) + + 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 | ObjectStorageBucketFirewallEntryResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + object_storage_id: int, + bucket_id: int, + entry_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ObjectStorageBucketFirewallEntryResponse]: + """Get object storage bucket firewall entry + + Get object storage bucket firewall entry details + + Args: + object_storage_id (int): + bucket_id (int): + entry_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 | ObjectStorageBucketFirewallEntryResponse] + """ + + kwargs = _get_kwargs( + object_storage_id=object_storage_id, + bucket_id=bucket_id, + entry_id=entry_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + object_storage_id: int, + bucket_id: int, + entry_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | ObjectStorageBucketFirewallEntryResponse | None: + """Get object storage bucket firewall entry + + Get object storage bucket firewall entry details + + Args: + object_storage_id (int): + bucket_id (int): + entry_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 | ObjectStorageBucketFirewallEntryResponse + """ + + return sync_detailed( + object_storage_id=object_storage_id, + bucket_id=bucket_id, + entry_id=entry_id, + client=client, + ).parsed + + +async def asyncio_detailed( + object_storage_id: int, + bucket_id: int, + entry_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ObjectStorageBucketFirewallEntryResponse]: + """Get object storage bucket firewall entry + + Get object storage bucket firewall entry details + + Args: + object_storage_id (int): + bucket_id (int): + entry_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 | ObjectStorageBucketFirewallEntryResponse] + """ + + kwargs = _get_kwargs( + object_storage_id=object_storage_id, + bucket_id=bucket_id, + entry_id=entry_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + object_storage_id: int, + bucket_id: int, + entry_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | ObjectStorageBucketFirewallEntryResponse | None: + """Get object storage bucket firewall entry + + Get object storage bucket firewall entry details + + Args: + object_storage_id (int): + bucket_id (int): + entry_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 | ObjectStorageBucketFirewallEntryResponse + """ + + return ( + await asyncio_detailed( + object_storage_id=object_storage_id, + bucket_id=bucket_id, + entry_id=entry_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..4bb9ddf --- /dev/null +++ b/src/shellrent_sdk/client/api/storage/get_object_storage_iam_user.py @@ -0,0 +1,203 @@ +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.object_storage_iam_user_response import ObjectStorageIamUserResponse +from ...types import Response + + +def _get_kwargs( + object_storage_id: int, + iam_user_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/object-storages/{object_storage_id}/iam-users/{iam_user_id}".format( + object_storage_id=quote(str(object_storage_id), safe=""), + iam_user_id=quote(str(iam_user_id), safe=""), + ), + } + + return _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()) + + 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 | ObjectStorageIamUserResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + object_storage_id: int, + iam_user_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ObjectStorageIamUserResponse]: + """Get object storage IAM user + + Get object storage IAM user details + + Args: + object_storage_id (int): + iam_user_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 | ObjectStorageIamUserResponse] + """ + + kwargs = _get_kwargs( + object_storage_id=object_storage_id, + iam_user_id=iam_user_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + object_storage_id: int, + iam_user_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | ObjectStorageIamUserResponse | None: + """Get object storage IAM user + + Get object storage IAM user details + + Args: + object_storage_id (int): + iam_user_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 | ObjectStorageIamUserResponse + """ + + return sync_detailed( + object_storage_id=object_storage_id, + iam_user_id=iam_user_id, + client=client, + ).parsed + + +async def asyncio_detailed( + object_storage_id: int, + iam_user_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ObjectStorageIamUserResponse]: + """Get object storage IAM user + + Get object storage IAM user details + + Args: + object_storage_id (int): + iam_user_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 | ObjectStorageIamUserResponse] + """ + + kwargs = _get_kwargs( + object_storage_id=object_storage_id, + iam_user_id=iam_user_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + object_storage_id: int, + iam_user_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | ObjectStorageIamUserResponse | None: + """Get object storage IAM user + + Get object storage IAM user details + + Args: + object_storage_id (int): + iam_user_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 | ObjectStorageIamUserResponse + """ + + return ( + await asyncio_detailed( + object_storage_id=object_storage_id, + iam_user_id=iam_user_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..69fdaaa --- /dev/null +++ b/src/shellrent_sdk/client/api/storage/get_object_storage_iam_user_s3_key.py @@ -0,0 +1,217 @@ +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.object_storage_iam_user_s3_key_response import ObjectStorageIamUserS3KeyResponse +from ...types import Response + + +def _get_kwargs( + object_storage_id: int, + iam_user_id: int, + s3_key_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/object-storages/{object_storage_id}/iam-users/{iam_user_id}/s3-keys/{s3_key_id}".format( + object_storage_id=quote(str(object_storage_id), safe=""), + iam_user_id=quote(str(iam_user_id), safe=""), + s3_key_id=quote(str(s3_key_id), safe=""), + ), + } + + return _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()) + + 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 | ObjectStorageIamUserS3KeyResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + object_storage_id: int, + iam_user_id: int, + s3_key_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ObjectStorageIamUserS3KeyResponse]: + """Get object storage IAM user S3 key + + Get object storage IAM user S3 key details + + Args: + object_storage_id (int): + iam_user_id (int): + s3_key_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 | ObjectStorageIamUserS3KeyResponse] + """ + + kwargs = _get_kwargs( + object_storage_id=object_storage_id, + iam_user_id=iam_user_id, + s3_key_id=s3_key_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + object_storage_id: int, + iam_user_id: int, + s3_key_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | ObjectStorageIamUserS3KeyResponse | None: + """Get object storage IAM user S3 key + + Get object storage IAM user S3 key details + + Args: + object_storage_id (int): + iam_user_id (int): + s3_key_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 | ObjectStorageIamUserS3KeyResponse + """ + + return sync_detailed( + object_storage_id=object_storage_id, + iam_user_id=iam_user_id, + s3_key_id=s3_key_id, + client=client, + ).parsed + + +async def asyncio_detailed( + object_storage_id: int, + iam_user_id: int, + s3_key_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ObjectStorageIamUserS3KeyResponse]: + """Get object storage IAM user S3 key + + Get object storage IAM user S3 key details + + Args: + object_storage_id (int): + iam_user_id (int): + s3_key_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 | ObjectStorageIamUserS3KeyResponse] + """ + + kwargs = _get_kwargs( + object_storage_id=object_storage_id, + iam_user_id=iam_user_id, + s3_key_id=s3_key_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + object_storage_id: int, + iam_user_id: int, + s3_key_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | ObjectStorageIamUserS3KeyResponse | None: + """Get object storage IAM user S3 key + + Get object storage IAM user S3 key details + + Args: + object_storage_id (int): + iam_user_id (int): + s3_key_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 | ObjectStorageIamUserS3KeyResponse + """ + + return ( + await asyncio_detailed( + object_storage_id=object_storage_id, + iam_user_id=iam_user_id, + s3_key_id=s3_key_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..1822284 --- /dev/null +++ b/src/shellrent_sdk/client/api/storage/get_object_storage_s3_key.py @@ -0,0 +1,189 @@ +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.object_storage_s3_key_response import ObjectStorageS3KeyResponse +from ...types import Response + + +def _get_kwargs( + object_storage_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/object-storages/{object_storage_id}/s3-key".format( + object_storage_id=quote(str(object_storage_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | ObjectStorageS3KeyResponse | None: + if response.status_code == 200: + response_200 = ObjectStorageS3KeyResponse.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 | ObjectStorageS3KeyResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + object_storage_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ObjectStorageS3KeyResponse]: + """Get object storage S3 key + + Get S3 access key and secret for object storage + + Args: + object_storage_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 | ObjectStorageS3KeyResponse] + """ + + kwargs = _get_kwargs( + object_storage_id=object_storage_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + object_storage_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | ObjectStorageS3KeyResponse | None: + """Get object storage S3 key + + Get S3 access key and secret for object storage + + Args: + object_storage_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 | ObjectStorageS3KeyResponse + """ + + return sync_detailed( + object_storage_id=object_storage_id, + client=client, + ).parsed + + +async def asyncio_detailed( + object_storage_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ObjectStorageS3KeyResponse]: + """Get object storage S3 key + + Get S3 access key and secret for object storage + + Args: + object_storage_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 | ObjectStorageS3KeyResponse] + """ + + kwargs = _get_kwargs( + object_storage_id=object_storage_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + object_storage_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | ObjectStorageS3KeyResponse | None: + """Get object storage S3 key + + Get S3 access key and secret for object storage + + Args: + object_storage_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 | ObjectStorageS3KeyResponse + """ + + return ( + await asyncio_detailed( + object_storage_id=object_storage_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..42fde4a --- /dev/null +++ b/src/shellrent_sdk/client/api/storage/list_cloud_storage_accesses.py @@ -0,0 +1,227 @@ +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.cloud_storage_access_paginated_list_response import ( + CloudStorageAccessPaginatedListResponse, +) +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + cloud_storage_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/cloud-storages/{cloud_storage_id}/accesses".format( + cloud_storage_id=quote(str(cloud_storage_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | CloudStorageAccessPaginatedListResponse | None: + if response.status_code == 200: + response_200 = CloudStorageAccessPaginatedListResponse.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 | CloudStorageAccessPaginatedListResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + cloud_storage_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | CloudStorageAccessPaginatedListResponse]: + """List cloud storage accesses + + Get list of cloud storage NFS accesses + + Args: + cloud_storage_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ApiError | CloudStorageAccessPaginatedListResponse] + """ + + kwargs = _get_kwargs( + cloud_storage_id=cloud_storage_id, + page=page, + per_page=per_page, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + cloud_storage_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | CloudStorageAccessPaginatedListResponse | None: + """List cloud storage accesses + + Get list of cloud storage NFS accesses + + Args: + cloud_storage_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ApiError | CloudStorageAccessPaginatedListResponse + """ + + return sync_detailed( + cloud_storage_id=cloud_storage_id, + client=client, + page=page, + per_page=per_page, + ).parsed + + +async def asyncio_detailed( + cloud_storage_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | CloudStorageAccessPaginatedListResponse]: + """List cloud storage accesses + + Get list of cloud storage NFS accesses + + Args: + cloud_storage_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ApiError | CloudStorageAccessPaginatedListResponse] + """ + + kwargs = _get_kwargs( + cloud_storage_id=cloud_storage_id, + 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( + cloud_storage_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | CloudStorageAccessPaginatedListResponse | None: + """List cloud storage accesses + + Get list of cloud storage NFS accesses + + Args: + cloud_storage_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ApiError | CloudStorageAccessPaginatedListResponse + """ + + return ( + await asyncio_detailed( + cloud_storage_id=cloud_storage_id, + client=client, + page=page, + per_page=per_page, + ) + ).parsed 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 new file mode 100644 index 0000000..49a3e8f --- /dev/null +++ b/src/shellrent_sdk/client/api/storage/list_cloud_storage_users.py @@ -0,0 +1,189 @@ +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.cloud_storage_user_list_response import CloudStorageUserListResponse +from ...types import Response + + +def _get_kwargs( + cloud_storage_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/cloud-storages/{cloud_storage_id}/users".format( + cloud_storage_id=quote(str(cloud_storage_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | CloudStorageUserListResponse | None: + if response.status_code == 200: + response_200 = CloudStorageUserListResponse.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 | CloudStorageUserListResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + cloud_storage_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | CloudStorageUserListResponse]: + """List cloud storage users + + Get list of cloud storage users + + Args: + cloud_storage_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 | CloudStorageUserListResponse] + """ + + kwargs = _get_kwargs( + cloud_storage_id=cloud_storage_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + cloud_storage_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | CloudStorageUserListResponse | None: + """List cloud storage users + + Get list of cloud storage users + + Args: + cloud_storage_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 | CloudStorageUserListResponse + """ + + return sync_detailed( + cloud_storage_id=cloud_storage_id, + client=client, + ).parsed + + +async def asyncio_detailed( + cloud_storage_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | CloudStorageUserListResponse]: + """List cloud storage users + + Get list of cloud storage users + + Args: + cloud_storage_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 | CloudStorageUserListResponse] + """ + + kwargs = _get_kwargs( + cloud_storage_id=cloud_storage_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + cloud_storage_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | CloudStorageUserListResponse | None: + """List cloud storage users + + Get list of cloud storage users + + Args: + cloud_storage_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 | CloudStorageUserListResponse + """ + + return ( + await asyncio_detailed( + cloud_storage_id=cloud_storage_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/storage/list_cloud_storages.py b/src/shellrent_sdk/client/api/storage/list_cloud_storages.py new file mode 100644 index 0000000..a30bc00 --- /dev/null +++ b/src/shellrent_sdk/client/api/storage/list_cloud_storages.py @@ -0,0 +1,209 @@ +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.cloud_storage_paginated_list_response import CloudStoragePaginatedListResponse +from ...types import UNSET, Response, Unset + + +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/cloud-storages", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | CloudStoragePaginatedListResponse | None: + if response.status_code == 200: + response_200 = CloudStoragePaginatedListResponse.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 | CloudStoragePaginatedListResponse]: + 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 = 20, +) -> Response[ApiError | CloudStoragePaginatedListResponse]: + """List cloud storages + + Get a list of all cloud storages + + 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. + + Returns: + Response[ApiError | CloudStoragePaginatedListResponse] + """ + + 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 = 20, +) -> ApiError | CloudStoragePaginatedListResponse | None: + """List cloud storages + + Get a list of all cloud storages + + 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. + + Returns: + ApiError | CloudStoragePaginatedListResponse + """ + + 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 | CloudStoragePaginatedListResponse]: + """List cloud storages + + Get a list of all cloud storages + + 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. + + Returns: + Response[ApiError | CloudStoragePaginatedListResponse] + """ + + 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 = 20, +) -> ApiError | CloudStoragePaginatedListResponse | None: + """List cloud storages + + Get a list of all cloud storages + + 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. + + Returns: + ApiError | CloudStoragePaginatedListResponse + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + per_page=per_page, + ) + ).parsed 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 new file mode 100644 index 0000000..d0ba5eb --- /dev/null +++ b/src/shellrent_sdk/client/api/storage/list_object_storage_bucket_firewall_entries.py @@ -0,0 +1,243 @@ +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.object_storage_bucket_firewall_entry_paginated_list_response import ( + ObjectStorageBucketFirewallEntryPaginatedListResponse, +) +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + object_storage_id: int, + bucket_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/object-storages/{object_storage_id}/buckets/{bucket_id}/firewall-entries".format( + object_storage_id=quote(str(object_storage_id), safe=""), + bucket_id=quote(str(bucket_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | ObjectStorageBucketFirewallEntryPaginatedListResponse | None: + if response.status_code == 200: + response_200 = ObjectStorageBucketFirewallEntryPaginatedListResponse.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 | ObjectStorageBucketFirewallEntryPaginatedListResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + object_storage_id: int, + bucket_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | ObjectStorageBucketFirewallEntryPaginatedListResponse]: + """List object storage bucket firewall entries + + Get list of object storage bucket firewall entries + + Args: + object_storage_id (int): + bucket_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ApiError | ObjectStorageBucketFirewallEntryPaginatedListResponse] + """ + + kwargs = _get_kwargs( + object_storage_id=object_storage_id, + bucket_id=bucket_id, + page=page, + per_page=per_page, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + object_storage_id: int, + bucket_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | ObjectStorageBucketFirewallEntryPaginatedListResponse | None: + """List object storage bucket firewall entries + + Get list of object storage bucket firewall entries + + Args: + object_storage_id (int): + bucket_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ApiError | ObjectStorageBucketFirewallEntryPaginatedListResponse + """ + + return sync_detailed( + object_storage_id=object_storage_id, + bucket_id=bucket_id, + client=client, + page=page, + per_page=per_page, + ).parsed + + +async def asyncio_detailed( + object_storage_id: int, + bucket_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | ObjectStorageBucketFirewallEntryPaginatedListResponse]: + """List object storage bucket firewall entries + + Get list of object storage bucket firewall entries + + Args: + object_storage_id (int): + bucket_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ApiError | ObjectStorageBucketFirewallEntryPaginatedListResponse] + """ + + kwargs = _get_kwargs( + object_storage_id=object_storage_id, + bucket_id=bucket_id, + 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( + object_storage_id: int, + bucket_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | ObjectStorageBucketFirewallEntryPaginatedListResponse | None: + """List object storage bucket firewall entries + + Get list of object storage bucket firewall entries + + Args: + object_storage_id (int): + bucket_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ApiError | ObjectStorageBucketFirewallEntryPaginatedListResponse + """ + + return ( + await asyncio_detailed( + object_storage_id=object_storage_id, + bucket_id=bucket_id, + client=client, + page=page, + per_page=per_page, + ) + ).parsed 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 new file mode 100644 index 0000000..9db380e --- /dev/null +++ b/src/shellrent_sdk/client/api/storage/list_object_storage_buckets.py @@ -0,0 +1,227 @@ +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.object_storage_bucket_paginated_list_response import ( + ObjectStorageBucketPaginatedListResponse, +) +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + object_storage_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/object-storages/{object_storage_id}/buckets".format( + object_storage_id=quote(str(object_storage_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | ObjectStorageBucketPaginatedListResponse | None: + if response.status_code == 200: + response_200 = ObjectStorageBucketPaginatedListResponse.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 | ObjectStorageBucketPaginatedListResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + object_storage_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | ObjectStorageBucketPaginatedListResponse]: + """List object storage buckets + + Get list of object storage buckets + + Args: + object_storage_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ApiError | ObjectStorageBucketPaginatedListResponse] + """ + + kwargs = _get_kwargs( + object_storage_id=object_storage_id, + page=page, + per_page=per_page, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + object_storage_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | ObjectStorageBucketPaginatedListResponse | None: + """List object storage buckets + + Get list of object storage buckets + + Args: + object_storage_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ApiError | ObjectStorageBucketPaginatedListResponse + """ + + return sync_detailed( + object_storage_id=object_storage_id, + client=client, + page=page, + per_page=per_page, + ).parsed + + +async def asyncio_detailed( + object_storage_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | ObjectStorageBucketPaginatedListResponse]: + """List object storage buckets + + Get list of object storage buckets + + Args: + object_storage_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ApiError | ObjectStorageBucketPaginatedListResponse] + """ + + kwargs = _get_kwargs( + object_storage_id=object_storage_id, + 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( + object_storage_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | ObjectStorageBucketPaginatedListResponse | None: + """List object storage buckets + + Get list of object storage buckets + + Args: + object_storage_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ApiError | ObjectStorageBucketPaginatedListResponse + """ + + return ( + await asyncio_detailed( + object_storage_id=object_storage_id, + client=client, + page=page, + per_page=per_page, + ) + ).parsed 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 new file mode 100644 index 0000000..1ff0e77 --- /dev/null +++ b/src/shellrent_sdk/client/api/storage/list_object_storage_iam_user_s3_keys.py @@ -0,0 +1,205 @@ +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.object_storage_iam_user_s3_key_list_response import ( + ObjectStorageIamUserS3KeyListResponse, +) +from ...types import Response + + +def _get_kwargs( + object_storage_id: int, + iam_user_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/v3/object-storages/{object_storage_id}/iam-users/{iam_user_id}/s3-keys".format( + object_storage_id=quote(str(object_storage_id), safe=""), + iam_user_id=quote(str(iam_user_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | ObjectStorageIamUserS3KeyListResponse | None: + if response.status_code == 200: + response_200 = ObjectStorageIamUserS3KeyListResponse.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 | ObjectStorageIamUserS3KeyListResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + object_storage_id: int, + iam_user_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ObjectStorageIamUserS3KeyListResponse]: + """List object storage IAM user S3 keys + + Get list of object storage IAM user S3 keys + + Args: + object_storage_id (int): + iam_user_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 | ObjectStorageIamUserS3KeyListResponse] + """ + + kwargs = _get_kwargs( + object_storage_id=object_storage_id, + iam_user_id=iam_user_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + object_storage_id: int, + iam_user_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | ObjectStorageIamUserS3KeyListResponse | None: + """List object storage IAM user S3 keys + + Get list of object storage IAM user S3 keys + + Args: + object_storage_id (int): + iam_user_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 | ObjectStorageIamUserS3KeyListResponse + """ + + return sync_detailed( + object_storage_id=object_storage_id, + iam_user_id=iam_user_id, + client=client, + ).parsed + + +async def asyncio_detailed( + object_storage_id: int, + iam_user_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | ObjectStorageIamUserS3KeyListResponse]: + """List object storage IAM user S3 keys + + Get list of object storage IAM user S3 keys + + Args: + object_storage_id (int): + iam_user_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 | ObjectStorageIamUserS3KeyListResponse] + """ + + kwargs = _get_kwargs( + object_storage_id=object_storage_id, + iam_user_id=iam_user_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + object_storage_id: int, + iam_user_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | ObjectStorageIamUserS3KeyListResponse | None: + """List object storage IAM user S3 keys + + Get list of object storage IAM user S3 keys + + Args: + object_storage_id (int): + iam_user_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 | ObjectStorageIamUserS3KeyListResponse + """ + + return ( + await asyncio_detailed( + object_storage_id=object_storage_id, + iam_user_id=iam_user_id, + client=client, + ) + ).parsed 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 new file mode 100644 index 0000000..3964b79 --- /dev/null +++ b/src/shellrent_sdk/client/api/storage/list_object_storage_iam_users.py @@ -0,0 +1,227 @@ +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.object_storage_iam_user_paginated_list_response import ( + ObjectStorageIamUserPaginatedListResponse, +) +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + object_storage_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/object-storages/{object_storage_id}/iam-users".format( + object_storage_id=quote(str(object_storage_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | ObjectStorageIamUserPaginatedListResponse | None: + if response.status_code == 200: + response_200 = ObjectStorageIamUserPaginatedListResponse.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 | ObjectStorageIamUserPaginatedListResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + object_storage_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | ObjectStorageIamUserPaginatedListResponse]: + """List object storage IAM users + + Get list of object storage IAM users + + Args: + object_storage_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ApiError | ObjectStorageIamUserPaginatedListResponse] + """ + + kwargs = _get_kwargs( + object_storage_id=object_storage_id, + page=page, + per_page=per_page, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + object_storage_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | ObjectStorageIamUserPaginatedListResponse | None: + """List object storage IAM users + + Get list of object storage IAM users + + Args: + object_storage_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ApiError | ObjectStorageIamUserPaginatedListResponse + """ + + return sync_detailed( + object_storage_id=object_storage_id, + client=client, + page=page, + per_page=per_page, + ).parsed + + +async def asyncio_detailed( + object_storage_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> Response[ApiError | ObjectStorageIamUserPaginatedListResponse]: + """List object storage IAM users + + Get list of object storage IAM users + + Args: + object_storage_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ApiError | ObjectStorageIamUserPaginatedListResponse] + """ + + kwargs = _get_kwargs( + object_storage_id=object_storage_id, + 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( + object_storage_id: int, + *, + client: AuthenticatedClient, + page: int | Unset = 1, + per_page: int | Unset = 20, +) -> ApiError | ObjectStorageIamUserPaginatedListResponse | None: + """List object storage IAM users + + Get list of object storage IAM users + + Args: + object_storage_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. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ApiError | ObjectStorageIamUserPaginatedListResponse + """ + + return ( + await asyncio_detailed( + object_storage_id=object_storage_id, + client=client, + page=page, + per_page=per_page, + ) + ).parsed diff --git a/src/shellrent_sdk/client/api/storage/list_object_storages.py b/src/shellrent_sdk/client/api/storage/list_object_storages.py new file mode 100644 index 0000000..9a13182 --- /dev/null +++ b/src/shellrent_sdk/client/api/storage/list_object_storages.py @@ -0,0 +1,209 @@ +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.object_storage_paginated_list_response import ObjectStoragePaginatedListResponse +from ...types import UNSET, Response, Unset + + +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/object-storages", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ApiError | ObjectStoragePaginatedListResponse | None: + if response.status_code == 200: + response_200 = ObjectStoragePaginatedListResponse.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 | ObjectStoragePaginatedListResponse]: + 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 = 20, +) -> Response[ApiError | ObjectStoragePaginatedListResponse]: + """List object storages + + Get a list of all object storages + + 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. + + Returns: + Response[ApiError | ObjectStoragePaginatedListResponse] + """ + + 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 = 20, +) -> ApiError | ObjectStoragePaginatedListResponse | None: + """List object storages + + Get a list of all object storages + + 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. + + Returns: + ApiError | ObjectStoragePaginatedListResponse + """ + + 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 | ObjectStoragePaginatedListResponse]: + """List object storages + + Get a list of all object storages + + 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. + + Returns: + Response[ApiError | ObjectStoragePaginatedListResponse] + """ + + 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 = 20, +) -> ApiError | ObjectStoragePaginatedListResponse | None: + """List object storages + + Get a list of all object storages + + 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. + + Returns: + ApiError | ObjectStoragePaginatedListResponse + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + per_page=per_page, + ) + ).parsed 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 new file mode 100644 index 0000000..5565d2a --- /dev/null +++ b/src/shellrent_sdk/client/api/storage/update_cloud_storage_user_size.py @@ -0,0 +1,224 @@ +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.cloud_storage_user_response import CloudStorageUserResponse +from ...models.cloud_storage_user_size_update_request import CloudStorageUserSizeUpdateRequest +from ...types import Response + + +def _get_kwargs( + cloud_storage_id: int, + cloud_storage_user_id: int, + *, + body: CloudStorageUserSizeUpdateRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/api/v3/cloud-storages/{cloud_storage_id}/users/{cloud_storage_user_id}/size".format( + cloud_storage_id=quote(str(cloud_storage_id), safe=""), + cloud_storage_user_id=quote(str(cloud_storage_user_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 | CloudStorageUserResponse | None: + if response.status_code == 200: + response_200 = CloudStorageUserResponse.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 | CloudStorageUserResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + cloud_storage_id: int, + cloud_storage_user_id: int, + *, + client: AuthenticatedClient, + body: CloudStorageUserSizeUpdateRequest, +) -> Response[ApiError | CloudStorageUserResponse]: + """Update cloud storage user size + + Update cloud storage user quota + + Args: + cloud_storage_id (int): + cloud_storage_user_id (int): + body (CloudStorageUserSizeUpdateRequest): + + 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 | CloudStorageUserResponse] + """ + + kwargs = _get_kwargs( + cloud_storage_id=cloud_storage_id, + cloud_storage_user_id=cloud_storage_user_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + cloud_storage_id: int, + cloud_storage_user_id: int, + *, + client: AuthenticatedClient, + body: CloudStorageUserSizeUpdateRequest, +) -> ApiError | CloudStorageUserResponse | None: + """Update cloud storage user size + + Update cloud storage user quota + + Args: + cloud_storage_id (int): + cloud_storage_user_id (int): + body (CloudStorageUserSizeUpdateRequest): + + 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 | CloudStorageUserResponse + """ + + return sync_detailed( + cloud_storage_id=cloud_storage_id, + cloud_storage_user_id=cloud_storage_user_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + cloud_storage_id: int, + cloud_storage_user_id: int, + *, + client: AuthenticatedClient, + body: CloudStorageUserSizeUpdateRequest, +) -> Response[ApiError | CloudStorageUserResponse]: + """Update cloud storage user size + + Update cloud storage user quota + + Args: + cloud_storage_id (int): + cloud_storage_user_id (int): + body (CloudStorageUserSizeUpdateRequest): + + 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 | CloudStorageUserResponse] + """ + + kwargs = _get_kwargs( + cloud_storage_id=cloud_storage_id, + cloud_storage_user_id=cloud_storage_user_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + cloud_storage_id: int, + cloud_storage_user_id: int, + *, + client: AuthenticatedClient, + body: CloudStorageUserSizeUpdateRequest, +) -> ApiError | CloudStorageUserResponse | None: + """Update cloud storage user size + + Update cloud storage user quota + + Args: + cloud_storage_id (int): + cloud_storage_user_id (int): + body (CloudStorageUserSizeUpdateRequest): + + 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 | CloudStorageUserResponse + """ + + return ( + await asyncio_detailed( + cloud_storage_id=cloud_storage_id, + cloud_storage_user_id=cloud_storage_user_id, + client=client, + body=body, + ) + ).parsed 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 new file mode 100644 index 0000000..3a79f0d --- /dev/null +++ b/src/shellrent_sdk/client/api/storage/upgrade_cloud_storage_size.py @@ -0,0 +1,189 @@ +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 ...types import Response + + +def _get_kwargs( + cloud_storage_id: int, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v3/cloud-storages/{cloud_storage_id}/size-upgrade".format( + cloud_storage_id=quote(str(cloud_storage_id), safe=""), + ), + } + + 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( + cloud_storage_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | OrderResponse]: + """Upgrade cloud storage size + + Upgrade the cloud storage size. Returns the generated Order to pay the additional size. + + Args: + cloud_storage_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 | OrderResponse] + """ + + kwargs = _get_kwargs( + cloud_storage_id=cloud_storage_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + cloud_storage_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | OrderResponse | None: + """Upgrade cloud storage size + + Upgrade the cloud storage size. Returns the generated Order to pay the additional size. + + Args: + cloud_storage_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 | OrderResponse + """ + + return sync_detailed( + cloud_storage_id=cloud_storage_id, + client=client, + ).parsed + + +async def asyncio_detailed( + cloud_storage_id: int, + *, + client: AuthenticatedClient, +) -> Response[ApiError | OrderResponse]: + """Upgrade cloud storage size + + Upgrade the cloud storage size. Returns the generated Order to pay the additional size. + + Args: + cloud_storage_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 | OrderResponse] + """ + + kwargs = _get_kwargs( + cloud_storage_id=cloud_storage_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + cloud_storage_id: int, + *, + client: AuthenticatedClient, +) -> ApiError | OrderResponse | None: + """Upgrade cloud storage size + + Upgrade the cloud storage size. Returns the generated Order to pay the additional size. + + Args: + cloud_storage_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 | OrderResponse + """ + + return ( + await asyncio_detailed( + cloud_storage_id=cloud_storage_id, + client=client, + ) + ).parsed diff --git a/src/shellrent_sdk/client/client.py b/src/shellrent_sdk/client/client.py new file mode 100644 index 0000000..518686c --- /dev/null +++ b/src/shellrent_sdk/client/client.py @@ -0,0 +1,264 @@ +import ssl +from typing import Any, Self + +import httpx +from attrs import define, evolve, field + + +@define +class Client: + """A class for keeping track of data related to the API + + The following are accepted as keyword arguments and will be used to construct httpx Clients internally: + + ``base_url``: The base URL for the API, all requests are made to a relative path to this URL + + ``cookies``: A dictionary of cookies to be sent with every request + + ``headers``: A dictionary of headers to be sent with every request + + ``timeout``: The maximum amount of a time a request can take. API functions will raise + httpx.TimeoutException if this is exceeded. + + ``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production, + but can be set to False for testing purposes. + + ``follow_redirects``: Whether or not to follow redirects. Default value is False. + + ``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor. + + """ + + raise_on_unexpected_status: bool = field(default=False, kw_only=True) + """Whether or not to raise an errors.UnexpectedStatus if the API returns a status code that was not documented in the source OpenAPI document. Can also be provided as a keyword argument to the constructor.""" + _base_url: str = field(alias="base_url") + _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") + _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") + _timeout: httpx.Timeout | None = field(default=None, kw_only=True, alias="timeout") + _verify_ssl: str | bool | ssl.SSLContext = field(default=True, kw_only=True, alias="verify_ssl") + _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects") + _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") + _client: httpx.Client | None = field(default=None, init=False) + _async_client: httpx.AsyncClient | None = field(default=None, init=False) + + def with_headers(self, headers: dict[str, str]) -> "Client": + """Get a new client matching this one with additional headers""" + if self._client is not None: + self._client.headers.update(headers) + if self._async_client is not None: + self._async_client.headers.update(headers) + return evolve(self, headers={**self._headers, **headers}) + + def with_cookies(self, cookies: dict[str, str]) -> "Client": + """Get a new client matching this one with additional cookies""" + if self._client is not None: + self._client.cookies.update(cookies) + if self._async_client is not None: + self._async_client.cookies.update(cookies) + return evolve(self, cookies={**self._cookies, **cookies}) + + def with_timeout(self, timeout: httpx.Timeout) -> "Client": + """Get a new client matching this one with a new timeout configuration""" + if self._client is not None: + self._client.timeout = timeout + if self._async_client is not None: + self._async_client.timeout = timeout + return evolve(self, timeout=timeout) + + def set_httpx_client(self, client: httpx.Client) -> Self: + """Manually set the underlying httpx.Client + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._client = client + return self + + def get_httpx_client(self) -> httpx.Client: + """Get the underlying httpx.Client, constructing a new one if not previously set""" + if self._client is None: + self._client = httpx.Client( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._client + + def __enter__(self) -> Self: + """Enter a context manager for self.client—you cannot enter twice (see httpx docs)""" + self.get_httpx_client().__enter__() + return self + + def __exit__(self, *args: object, **kwargs: Any) -> None: + """Exit a context manager for internal httpx.Client (see httpx docs)""" + self.get_httpx_client().__exit__(*args, **kwargs) + + def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> Self: + """Manually set the underlying httpx.AsyncClient + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._async_client = async_client + return self + + def get_async_httpx_client(self) -> httpx.AsyncClient: + """Get the underlying httpx.AsyncClient, constructing a new one if not previously set""" + if self._async_client is None: + self._async_client = httpx.AsyncClient( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._async_client + + async def __aenter__(self) -> Self: + """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)""" + await self.get_async_httpx_client().__aenter__() + return self + + async def __aexit__(self, *args: object, **kwargs: Any) -> None: + """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)""" + await self.get_async_httpx_client().__aexit__(*args, **kwargs) + + +@define +class AuthenticatedClient: + """A Client which has been authenticated for use on secured endpoints + + The following are accepted as keyword arguments and will be used to construct httpx Clients internally: + + ``base_url``: The base URL for the API, all requests are made to a relative path to this URL + + ``cookies``: A dictionary of cookies to be sent with every request + + ``headers``: A dictionary of headers to be sent with every request + + ``timeout``: The maximum amount of a time a request can take. API functions will raise + httpx.TimeoutException if this is exceeded. + + ``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production, + but can be set to False for testing purposes. + + ``follow_redirects``: Whether or not to follow redirects. Default value is False. + + ``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor. + + """ + + raise_on_unexpected_status: bool = field(default=False, kw_only=True) + """Whether or not to raise an errors.UnexpectedStatus if the API returns a status code that was not documented in the source OpenAPI document. Can also be provided as a keyword argument to the constructor.""" + _base_url: str = field(alias="base_url") + _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") + _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") + _timeout: httpx.Timeout | None = field(default=None, kw_only=True, alias="timeout") + _verify_ssl: str | bool | ssl.SSLContext = field(default=True, kw_only=True, alias="verify_ssl") + _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects") + _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") + _client: httpx.Client | None = field(default=None, init=False) + _async_client: httpx.AsyncClient | None = field(default=None, init=False) + + token: str + """The token to use for authentication""" + prefix: str = "Bearer" + """The prefix to use for the Authorization header""" + auth_header_name: str = "Authorization" + """The name of the Authorization header""" + + def with_headers(self, headers: dict[str, str]) -> "AuthenticatedClient": + """Get a new client matching this one with additional headers""" + if self._client is not None: + self._client.headers.update(headers) + if self._async_client is not None: + self._async_client.headers.update(headers) + return evolve(self, headers={**self._headers, **headers}) + + def with_cookies(self, cookies: dict[str, str]) -> "AuthenticatedClient": + """Get a new client matching this one with additional cookies""" + if self._client is not None: + self._client.cookies.update(cookies) + if self._async_client is not None: + self._async_client.cookies.update(cookies) + return evolve(self, cookies={**self._cookies, **cookies}) + + def with_timeout(self, timeout: httpx.Timeout) -> "AuthenticatedClient": + """Get a new client matching this one with a new timeout configuration""" + if self._client is not None: + self._client.timeout = timeout + if self._async_client is not None: + self._async_client.timeout = timeout + return evolve(self, timeout=timeout) + + def set_httpx_client(self, client: httpx.Client) -> Self: + """Manually set the underlying httpx.Client + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._client = client + return self + + def get_httpx_client(self) -> httpx.Client: + """Get the underlying httpx.Client, constructing a new one if not previously set""" + if self._client is None: + self._headers[self.auth_header_name] = ( + f"{self.prefix} {self.token}" if self.prefix else self.token + ) + self._client = httpx.Client( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._client + + def __enter__(self) -> Self: + """Enter a context manager for self.client—you cannot enter twice (see httpx docs)""" + self.get_httpx_client().__enter__() + return self + + def __exit__(self, *args: object, **kwargs: Any) -> None: + """Exit a context manager for internal httpx.Client (see httpx docs)""" + self.get_httpx_client().__exit__(*args, **kwargs) + + def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> Self: + """Manually set the underlying httpx.AsyncClient + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._async_client = async_client + return self + + def get_async_httpx_client(self) -> httpx.AsyncClient: + """Get the underlying httpx.AsyncClient, constructing a new one if not previously set""" + if self._async_client is None: + self._headers[self.auth_header_name] = ( + f"{self.prefix} {self.token}" if self.prefix else self.token + ) + self._async_client = httpx.AsyncClient( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._async_client + + async def __aenter__(self) -> Self: + """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)""" + await self.get_async_httpx_client().__aenter__() + return self + + async def __aexit__(self, *args: object, **kwargs: Any) -> None: + """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)""" + await self.get_async_httpx_client().__aexit__(*args, **kwargs) diff --git a/src/shellrent_sdk/client/errors.py b/src/shellrent_sdk/client/errors.py new file mode 100644 index 0000000..5f92e76 --- /dev/null +++ b/src/shellrent_sdk/client/errors.py @@ -0,0 +1,16 @@ +"""Contains shared errors types that can be raised from API functions""" + + +class UnexpectedStatus(Exception): + """Raised by api functions when the response status an undocumented status and Client.raise_on_unexpected_status is True""" + + def __init__(self, status_code: int, content: bytes): + self.status_code = status_code + self.content = content + + super().__init__( + f"Unexpected status code: {status_code}\n\nResponse content:\n{content.decode(errors='ignore')}" + ) + + +__all__ = ["UnexpectedStatus"] diff --git a/src/shellrent_sdk/client/models/__init__.py b/src/shellrent_sdk/client/models/__init__.py new file mode 100644 index 0000000..3f93e6c --- /dev/null +++ b/src/shellrent_sdk/client/models/__init__.py @@ -0,0 +1,1289 @@ +"""Contains all the data models used in inputs/outputs""" + +from .account import Account +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_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 +from .buy_service_active_monitoring_request import BuyServiceActiveMonitoringRequest +from .buy_service_active_monitoring_request_data import BuyServiceActiveMonitoringRequestData +from .buy_service_cloud_storage_request import BuyServiceCloudStorageRequest +from .buy_service_cloud_vps_request import BuyServiceCloudVpsRequest +from .buy_service_cloud_vps_request_data import BuyServiceCloudVpsRequestData +from .buy_service_cloud_vps_request_data_diskquantity import ( + BuyServiceCloudVpsRequestDataDISKQUANTITY, +) +from .buy_service_cpanel_license_request import BuyServiceCpanelLicenseRequest +from .buy_service_cpanel_license_request_data import BuyServiceCpanelLicenseRequestData +from .buy_service_cpanel_license_request_data_installation_type import ( + BuyServiceCpanelLicenseRequestDataInstallationType, +) +from .buy_service_dedicated_server_request import BuyServiceDedicatedServerRequest +from .buy_service_dedicated_server_request_data import BuyServiceDedicatedServerRequestData +from .buy_service_domain_request import BuyServiceDomainRequest +from .buy_service_domain_request_configuration import BuyServiceDomainRequestConfiguration +from .buy_service_domain_request_data import BuyServiceDomainRequestData +from .buy_service_domain_request_data_contact_data import BuyServiceDomainRequestDataContactData +from .buy_service_microsoft_365_request import BuyServiceMicrosoft365Request +from .buy_service_microsoft_365_request_data import BuyServiceMicrosoft365RequestData +from .buy_service_microsoft_365_request_data_locale import BuyServiceMicrosoft365RequestDataLocale +from .buy_service_microsoft_365_request_data_tenant_choice import ( + BuyServiceMicrosoft365RequestDataTenantChoice, +) +from .buy_service_object_storage_request import BuyServiceObjectStorageRequest +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 ( + BuyServicePecDomainRequestDataLegalEntity, +) +from .buy_service_pec_request import BuyServicePecRequest +from .buy_service_pec_request_data import BuyServicePecRequestData +from .buy_service_pec_request_data_legal_entity import BuyServicePecRequestDataLegalEntity +from .buy_service_plesk_license_request import BuyServicePleskLicenseRequest +from .buy_service_plesk_license_request_data import BuyServicePleskLicenseRequestData +from .buy_service_plesk_license_request_data_installation_type import ( + BuyServicePleskLicenseRequestDataInstallationType, +) +from .buy_service_private_cloud_sv_request import BuyServicePrivateCloudSvRequest +from .buy_service_private_cloud_sv_request_data import BuyServicePrivateCloudSvRequestData +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 +from .buy_service_ssl_certificate_request_data_admin_role import ( + BuyServiceSslCertificateRequestDataAdminRole, +) +from .buy_service_ssl_certificate_request_data_admin_title import ( + BuyServiceSslCertificateRequestDataAdminTitle, +) +from .buy_service_veeam_baas_request import BuyServiceVeeamBaasRequest +from .buy_service_veeam_baas_request_configuration import BuyServiceVeeamBaasRequestConfiguration +from .cloud_storage import CloudStorage +from .cloud_storage_access import CloudStorageAccess +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_dns_nameservers_change_request import DomainDnsNameserversChangeRequest +from .domain_dns_nameservers_cloudflare_request import DomainDnsNameserversCloudflareRequest +from .domain_dns_record_change_request import DomainDnsRecordChangeRequest +from .domain_dns_record_change_request_caa_data import DomainDnsRecordChangeRequestCaaData +from .domain_dns_record_change_request_tlsa_data import DomainDnsRecordChangeRequestTlsaData +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_zone_request import DomainDnsZoneRequest +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 +from .domain_dnssec_request_ds_data_2 import DomainDnssecRequestDsData2 +from .domain_dnssec_request_ds_data_2_digest_type import DomainDnssecRequestDsData2DigestType +from .domain_dnssec_request_key_data_256_item import DomainDnssecRequestKeyData256Item +from .domain_dnssec_request_key_data_256_item_algorithm import ( + DomainDnssecRequestKeyData256ItemAlgorithm, +) +from .domain_dnssec_request_key_data_257_item import DomainDnssecRequestKeyData257Item +from .domain_dnssec_request_key_data_257_item_algorithm import ( + DomainDnssecRequestKeyData257ItemAlgorithm, +) +from .domain_dnssec_response import DomainDnssecResponse +from .domain_dnssec_response_meta_type_0 import DomainDnssecResponseMetaType0 +from .domain_name import DomainName +from .domain_paginated_list_response import DomainPaginatedListResponse +from .domain_response import DomainResponse +from .domain_response_meta_type_0 import DomainResponseMetaType0 +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_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_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_bloc_list_response import HostingEmailBlocListResponse +from .hosting_email_bloc_list_response_meta_type_0 import HostingEmailBlocListResponseMetaType0 +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_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_settings_update_request import HostingPhpSettingsUpdateRequest +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_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_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 .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 +from .object_storage import ObjectStorage +from .object_storage_bucket import ObjectStorageBucket +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, +) +from .object_storage_bucket_firewall_entry_paginated_list_response import ( + 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_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_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_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 +from .purchase import Purchase +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 +from .purchase_provisioning_status import PurchaseProvisioningStatus +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 +from .request_access_token_body import RequestAccessTokenBody +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 +from .server_monitoring_probe import ServerMonitoringProbe +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_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 +from .service_change import ServiceChange +from .service_list_response import ServiceListResponse +from .service_list_response_meta_type_0 import ServiceListResponseMetaType0 +from .service_paginated_list_response import ServicePaginatedListResponse +from .service_server import ServiceServer +from .service_server_list_response import ServiceServerListResponse +from .service_server_list_response_meta_type_0 import ServiceServerListResponseMetaType0 +from .simple_pagination_meta import SimplePaginationMeta +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 +from .sms_phonebook_add_contacts_request_phone_numbers_item import ( + SmsPhonebookAddContactsRequestPhoneNumbersItem, +) +from .sms_phonebook_contact import SmsPhonebookContact +from .sms_phonebook_contact_paginated_list_response import SmsPhonebookContactPaginatedListResponse +from .sms_phonebook_create_request import SmsPhonebookCreateRequest +from .sms_phonebook_create_request_phone_numbers_item import ( + SmsPhonebookCreateRequestPhoneNumbersItem, +) +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_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_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", + "ApiUpload", + "ApiUploadResponse", + "ApiUploadResponseMetaType0", + "BillingData", + "BuyPrepaidCreditTopupRequest", + "BuyPrepaidCreditTopupRequestAmount", + "BuyServiceActiveMonitoringRequest", + "BuyServiceActiveMonitoringRequestData", + "BuyServiceCloudStorageRequest", + "BuyServiceCloudVpsRequest", + "BuyServiceCloudVpsRequestData", + "BuyServiceCloudVpsRequestDataDISKQUANTITY", + "BuyServiceCpanelLicenseRequest", + "BuyServiceCpanelLicenseRequestData", + "BuyServiceCpanelLicenseRequestDataInstallationType", + "BuyServiceDedicatedServerRequest", + "BuyServiceDedicatedServerRequestData", + "BuyServiceDomainRequest", + "BuyServiceDomainRequestConfiguration", + "BuyServiceDomainRequestData", + "BuyServiceDomainRequestDataContactData", + "BuyServiceMicrosoft365Request", + "BuyServiceMicrosoft365RequestData", + "BuyServiceMicrosoft365RequestDataLocale", + "BuyServiceMicrosoft365RequestDataTenantChoice", + "BuyServiceObjectStorageRequest", + "BuyServiceObjectStorageRequestConfiguration", + "BuyServiceObjectStorageRequestConfigurationTbSize", + "BuyServicePecDomainRequest", + "BuyServicePecDomainRequestData", + "BuyServicePecDomainRequestDataLegalEntity", + "BuyServicePecRequest", + "BuyServicePecRequestData", + "BuyServicePecRequestDataLegalEntity", + "BuyServicePleskLicenseRequest", + "BuyServicePleskLicenseRequestData", + "BuyServicePleskLicenseRequestDataInstallationType", + "BuyServicePrivateCloudSvRequest", + "BuyServicePrivateCloudSvRequestData", + "BuyServicePrivateCloudSvRequestDataADDITIONALBACKUPDISKSERVICEQUANTITY", + "BuyServiceSecuremailForGoogleWorkspaceRequest", + "BuyServiceSecuremailForGoogleWorkspaceRequestConfiguration", + "BuyServiceSecuremailForGoogleWorkspaceRequestData", + "BuyServiceSecuremailForMicrosoft365Request", + "BuyServiceSecuremailForMicrosoft365RequestConfiguration", + "BuyServiceSecuremailForMicrosoft365RequestData", + "BuyServiceSecuremailRequest", + "BuyServiceSecuremailRequestConfiguration", + "BuyServiceSmsRequest", + "BuyServiceSslCertificateRequest", + "BuyServiceSslCertificateRequestData", + "BuyServiceSslCertificateRequestDataAdminRole", + "BuyServiceSslCertificateRequestDataAdminTitle", + "BuyServiceVeeamBaasRequest", + "BuyServiceVeeamBaasRequestConfiguration", + "CloudStorage", + "CloudStorageAccess", + "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", + "DomainDnsNameserversChangeRequest", + "DomainDnsNameserversCloudflareRequest", + "DomainDnsRecordChangeRequest", + "DomainDnsRecordChangeRequestCaaData", + "DomainDnsRecordChangeRequestTlsaData", + "DomainDnsRecordRequest", + "DomainDnsRecordRequestCaaData", + "DomainDnsRecordRequestTlsaData", + "DomainDnsZoneRequest", + "DomainDnssec", + "DomainDnssecCanActivate", + "DomainDnssecCanActivateResponse", + "DomainDnssecCanActivateResponseMetaType0", + "DomainDnssecCanDeactivate", + "DomainDnssecCanDeactivateResponse", + "DomainDnssecCanDeactivateResponseMetaType0", + "DomainDnssecRequest", + "DomainDnssecRequestDsData1", + "DomainDnssecRequestDsData1DigestType", + "DomainDnssecRequestDsData2", + "DomainDnssecRequestDsData2DigestType", + "DomainDnssecRequestKeyData256Item", + "DomainDnssecRequestKeyData256ItemAlgorithm", + "DomainDnssecRequestKeyData257Item", + "DomainDnssecRequestKeyData257ItemAlgorithm", + "DomainDnssecResponse", + "DomainDnssecResponseMetaType0", + "DomainName", + "DomainPaginatedListResponse", + "DomainResponse", + "DomainResponseMetaType0", + "EmptyResponse", + "EmptyResponseDataType0", + "EmptyResponseMetaType0", + "GetHostingAntivirusResponse200", + "GetHostingAntivirusResponse200MetaType0", + "HealthStatus", + "HealthStatusResponse", + "HealthStatusResponseMetaType0", + "Hosting", + "HostingAntivirus", + "HostingAntivirusRemovalScan", + "HostingAntivirusRemovalScanPaginatedListResponse", + "HostingAntivirusRemovalScanResponse", + "HostingAntivirusRemovalScanResponseMetaType0", + "HostingAntivirusScan", + "HostingAntivirusScanPaginatedListResponse", + "HostingAntivirusScanResponse", + "HostingAntivirusScanResponseMetaType0", + "HostingBackup", + "HostingBackupExposeRequest", + "HostingBackupListResponse", + "HostingBackupListResponseMetaType0", + "HostingBackupResponse", + "HostingBackupResponseMetaType0", + "HostingCredential", + "HostingCredentialListResponse", + "HostingCredentialListResponseMetaType0", + "HostingCronjob", + "HostingCronjobCreateRequest", + "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", + "HostingEmailCatchAll", + "HostingEmailCatchAllRequest", + "HostingEmailCatchAllResponse", + "HostingEmailCatchAllResponseMetaType0", + "HostingEmailWblistRequest", + "HostingFileProtectionUpdateRequest", + "HostingHttpVersionUpdateRequest", + "HostingModSecurity", + "HostingModSecurityResponse", + "HostingModSecurityResponseMetaType0", + "HostingModSecurityRule", + "HostingModSecurityRuleBulkRequest", + "HostingModSecurityRuleCreateRequest", + "HostingModSecurityRuleListResponse", + "HostingModSecurityRuleListResponseMetaType0", + "HostingModSecurityRuleResponse", + "HostingModSecurityRuleResponseMetaType0", + "HostingModSecurityScan", + "HostingModSecurityScanPaginatedListResponse", + "HostingModSecurityScanResponse", + "HostingModSecurityScanResponseMetaType0", + "HostingModSecurityUpdateRequest", + "HostingPaginatedListResponse", + "HostingPhpSettingsUpdateRequest", + "HostingPhpVersion", + "HostingPhpVersionListResponse", + "HostingPhpVersionListResponseMetaType0", + "HostingPhpVersionUpdateRequest", + "HostingResponse", + "HostingResponseMetaType0", + "HostingSslCertificate", + "HostingSslCertificateInstallRequest", + "HostingSslCertificateListResponse", + "HostingSslCertificateListResponseMetaType0", + "HostingSslCertificateResponse", + "HostingSslCertificateResponseMetaType0", + "HostingSubdomainCreateRequest", + "Invoice", + "InvoicePaginatedListResponse", + "InvoiceResponse", + "InvoiceResponseMetaType0", + "InvoiceRow", + "InvoiceRowListResponse", + "InvoiceRowListResponseMetaType0", + "InvoiceRowResponse", + "InvoiceRowResponseMetaType0", + "IpAddress", + "IpAddressListResponse", + "IpAddressListResponseMetaType0", + "IpAddressResponse", + "IpAddressResponseMetaType0", + "JwkKey", + "JwksResponse", + "LegalEntity", + "LegalEntityGroup", + "ListOrdersType", + "ListSmsSmsStatus", + "Microsoft365", + "Microsoft365DomainAvailable", + "Microsoft365DomainAvailableResponse", + "Microsoft365DomainAvailableResponseMetaType0", + "Microsoft365PaginatedListResponse", + "Microsoft365PartnerLink", + "Microsoft365PartnerLinkResponse", + "Microsoft365PartnerLinkResponseMetaType0", + "Microsoft365Response", + "Microsoft365ResponseMetaType0", + "Microsoft365SubscriptionQuantityRequest", + "Microsoft365Tenant", + "Microsoft365TenantPaginatedListResponse", + "Microsoft365TenantResponse", + "Microsoft365TenantResponseMetaType0", + "OAuthAudience", + "OAuthError", + "OAuthTokenResponse", + "ObjectStorage", + "ObjectStorageBucket", + "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", + "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", + "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", + "PrepaidCreditResponse", + "PrepaidCreditResponseMetaType0", + "PrepaidCreditTopup", + "PrepaidCreditTopupPaginatedListResponse", + "PrepaidCreditTopupResponse", + "PrepaidCreditTopupResponseMetaType0", + "PrivateCloud", + "PrivateCloudResponse", + "PrivateCloudResponseMetaType0", + "PrivateCloudVmCreateRequest", + "PrivateCloudVmUpdateRequest", + "Promotion", + "Purchase", + "PurchaseBillingInfoChangeRequest", + "PurchaseCanAddAdditional", + "PurchaseCanAddAdditionalResponse", + "PurchaseCanAddAdditionalResponseMetaType0", + "PurchaseCanCancel", + "PurchaseCanCancelResponse", + "PurchaseCanCancelResponseMetaType0", + "PurchaseCanChangeRecurrence", + "PurchaseCanChangeRecurrenceResponse", + "PurchaseCanChangeRecurrenceResponseMetaType0", + "PurchaseCanChangeRenewStatus", + "PurchaseCanChangeRenewStatusResponse", + "PurchaseCanChangeRenewStatusResponseMetaType0", + "PurchaseCanChangeService", + "PurchaseCanChangeServiceResponse", + "PurchaseCanChangeServiceResponseMetaType0", + "PurchaseCanRenew", + "PurchaseCanRenewResponse", + "PurchaseCanRenewResponseMetaType0", + "PurchaseCommentChangeRequest", + "PurchaseName", + "PurchasePaginatedListResponse", + "PurchaseProvisioningStatus", + "PurchaseRecurrenceChangeRequest", + "PurchaseRenewStatusChangeRequest", + "PurchaseResponse", + "PurchaseResponseMetaType0", + "PurchaseStatus", + "Recurrence", + "RecurrenceFrequency", + "RequestAccessTokenBody", + "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", + "ServerMonitoringProbe", + "ServerMonitoringProbeChart", + "ServerMonitoringProbeChartPointsItem", + "ServerMonitoringProbeChartResponse", + "ServerMonitoringProbeChartResponseMetaType0", + "ServerMonitoringProbeCreateRequest", + "ServerMonitoringProbeCreateRequestParameters", + "ServerMonitoringProbeListResponse", + "ServerMonitoringProbeListResponseMetaType0", + "ServerMonitoringProbeResponse", + "ServerMonitoringProbeResponseMetaType0", + "ServerMonitoringProbeUpdateRequest", + "ServerMonitoringResponse", + "ServerMonitoringResponseMetaType0", + "ServerNetworkInterface", + "ServerNetworkInterfaceCreateRequest", + "ServerNetworkInterfaceListResponse", + "ServerNetworkInterfaceListResponseMetaType0", + "ServerNetworkInterfaceResponse", + "ServerNetworkInterfaceResponseMetaType0", + "ServerOs", + "ServerPaginatedListResponse", + "ServerReinstallRequest", + "ServerResponse", + "ServerResponseMetaType0", + "ServerSnapshot", + "ServerSnapshotPaginatedListResponse", + "ServerSnapshotResponse", + "ServerSnapshotResponseMetaType0", + "ServerTemplate", + "Service", + "ServiceCategory", + "ServiceChange", + "ServiceListResponse", + "ServiceListResponseMetaType0", + "ServicePaginatedListResponse", + "ServiceServer", + "ServiceServerListResponse", + "ServiceServerListResponseMetaType0", + "SimplePaginationMeta", + "Sms", + "SmsAccount", + "SmsAccountResponse", + "SmsAccountResponseMetaType0", + "SmsCanCancel", + "SmsCanCancelResponse", + "SmsCanCancelResponseMetaType0", + "SmsCanDelete", + "SmsCanDeleteResponse", + "SmsCanDeleteResponseMetaType0", + "SmsCreateRequest", + "SmsCreateRequestQuality", + "SmsMessage", + "SmsMessagePaginatedListResponse", + "SmsMessageResponse", + "SmsMessageResponseMetaType0", + "SmsPaginatedListResponse", + "SmsPhonebook", + "SmsPhonebookAddContactsRequest", + "SmsPhonebookAddContactsRequestPhoneNumbersItem", + "SmsPhonebookContact", + "SmsPhonebookContactPaginatedListResponse", + "SmsPhonebookCreateRequest", + "SmsPhonebookCreateRequestPhoneNumbersItem", + "SmsPhonebookEditRequest", + "SmsPhonebookPaginatedListResponse", + "SmsPhonebookResponse", + "SmsPhonebookResponseMetaType0", + "SmsPrice", + "SmsPricePaginatedListResponse", + "SmsPriceResponse", + "SmsPriceResponseMetaType0", + "SmsResponse", + "SmsResponseMetaType0", + "SslCertificate", + "SslCertificateApproverEmails", + "SslCertificateApproverEmailsResponse", + "SslCertificateApproverEmailsResponseMetaType0", + "SslCertificateCanReemit", + "SslCertificateCanReemitResponse", + "SslCertificateCanReemitResponseMetaType0", + "SslCertificateChangeCsrRequest", + "SslCertificateExport", + "SslCertificateExportFormat", + "SslCertificateExportFormatListResponse", + "SslCertificateExportFormatListResponseMetaType0", + "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 new file mode 100644 index 0000000..9f9dc3d --- /dev/null +++ b/src/shellrent_sdk/client/models/account.py @@ -0,0 +1,208 @@ +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.country import Country + + +T = TypeVar("T", bound="Account") + + +@_attrs_define +class Account: + account_id: int + username: str + username_alias: None | str + account_name: str + name: None | str + surname: None | str + email: None | str + phone: None | str + address: None | str + city: None | str + state: None | str + postal_code: None | str + country: Country + date_created: datetime.datetime + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + username = self.username + + username_alias: None | str + username_alias = self.username_alias + + account_name = self.account_name + + name: None | str + name = self.name + + surname: None | str + surname = self.surname + + email: None | str + email = self.email + + phone: None | str + phone = self.phone + + address: None | str + address = self.address + + city: None | str + city = self.city + + state: None | str + state = self.state + + postal_code: None | str + postal_code = self.postal_code + + country = self.country.to_dict() + + date_created = self.date_created.isoformat() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "account_id": account_id, + "username": username, + "username_alias": username_alias, + "account_name": account_name, + "name": name, + "surname": surname, + "email": email, + "phone": phone, + "address": address, + "city": city, + "state": state, + "postal_code": postal_code, + "country": country, + "date_created": date_created, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.country import Country + + d = dict(src_dict) + account_id = d.pop("account_id") + + username = d.pop("username") + + def _parse_username_alias(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + username_alias = _parse_username_alias(d.pop("username_alias")) + + account_name = d.pop("account_name") + + def _parse_name(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + name = _parse_name(d.pop("name")) + + def _parse_surname(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + surname = _parse_surname(d.pop("surname")) + + def _parse_email(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + email = _parse_email(d.pop("email")) + + 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_address(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + address = _parse_address(d.pop("address")) + + def _parse_city(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + city = _parse_city(d.pop("city")) + + def _parse_state(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + state = _parse_state(d.pop("state")) + + def _parse_postal_code(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + postal_code = _parse_postal_code(d.pop("postal_code")) + + country = Country.from_dict(d.pop("country")) + + date_created = datetime.datetime.fromisoformat(d.pop("date_created")) + + account = cls( + account_id=account_id, + username=username, + username_alias=username_alias, + account_name=account_name, + name=name, + surname=surname, + email=email, + phone=phone, + address=address, + city=city, + state=state, + postal_code=postal_code, + country=country, + date_created=date_created, + ) + + account.additional_properties = d + return account + + @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/account_billing.py b/src/shellrent_sdk/client/models/account_billing.py new file mode 100644 index 0000000..d4ab105 --- /dev/null +++ b/src/shellrent_sdk/client/models/account_billing.py @@ -0,0 +1,333 @@ +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.country import Country + from ..models.legal_entity import LegalEntity + from ..models.tax_regime import TaxRegime + + +T = TypeVar("T", bound="AccountBilling") + + +@_attrs_define +class AccountBilling: + account_billing_id: int + legal_entity: LegalEntity + tax_regime: TaxRegime + organization: None | str + name: None | str + surname: None | str + address: str + city: str + state: str + postal_code: str + country: Country + gender: None | str + birth_date: datetime.date | None + birth_place: None | str + phone: str + vat_number: None | str + is_vat_group: bool + fiscal_code: str + edocument_pec: None | str + edocument_code: None | str + exporter_expiry: datetime.date | None + exporter_number: None | str + exporter_date: datetime.date | None + is_split_payment: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + account_billing_id = self.account_billing_id + + legal_entity = self.legal_entity.to_dict() + + tax_regime = self.tax_regime.to_dict() + + organization: None | str + organization = self.organization + + name: None | str + name = self.name + + surname: None | str + surname = self.surname + + address = self.address + + city = self.city + + state = self.state + + postal_code = self.postal_code + + country = self.country.to_dict() + + gender: None | str + gender = self.gender + + birth_date: None | str + if isinstance(self.birth_date, datetime.date): + birth_date = self.birth_date.isoformat() + else: + birth_date = self.birth_date + + birth_place: None | str + birth_place = self.birth_place + + phone = self.phone + + vat_number: None | str + vat_number = self.vat_number + + is_vat_group = self.is_vat_group + + fiscal_code = self.fiscal_code + + edocument_pec: None | str + edocument_pec = self.edocument_pec + + edocument_code: None | str + edocument_code = self.edocument_code + + exporter_expiry: None | str + if isinstance(self.exporter_expiry, datetime.date): + exporter_expiry = self.exporter_expiry.isoformat() + else: + exporter_expiry = self.exporter_expiry + + exporter_number: None | str + exporter_number = self.exporter_number + + exporter_date: None | str + if isinstance(self.exporter_date, datetime.date): + exporter_date = self.exporter_date.isoformat() + else: + exporter_date = self.exporter_date + + is_split_payment = self.is_split_payment + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "account_billing_id": account_billing_id, + "legal_entity": legal_entity, + "tax_regime": tax_regime, + "organization": organization, + "name": name, + "surname": surname, + "address": address, + "city": city, + "state": state, + "postal_code": postal_code, + "country": country, + "gender": gender, + "birth_date": birth_date, + "birth_place": birth_place, + "phone": phone, + "vat_number": vat_number, + "is_vat_group": is_vat_group, + "fiscal_code": fiscal_code, + "edocument_pec": edocument_pec, + "edocument_code": edocument_code, + "exporter_expiry": exporter_expiry, + "exporter_number": exporter_number, + "exporter_date": exporter_date, + "is_split_payment": is_split_payment, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.country import Country + from ..models.legal_entity import LegalEntity + from ..models.tax_regime import TaxRegime + + d = dict(src_dict) + account_billing_id = d.pop("account_billing_id") + + legal_entity = LegalEntity.from_dict(d.pop("legal_entity")) + + tax_regime = TaxRegime.from_dict(d.pop("tax_regime")) + + def _parse_organization(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + organization = _parse_organization(d.pop("organization")) + + def _parse_name(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + name = _parse_name(d.pop("name")) + + def _parse_surname(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + surname = _parse_surname(d.pop("surname")) + + address = d.pop("address") + + city = d.pop("city") + + state = d.pop("state") + + postal_code = d.pop("postal_code") + + country = Country.from_dict(d.pop("country")) + + def _parse_gender(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + gender = _parse_gender(d.pop("gender")) + + def _parse_birth_date(data: object) -> datetime.date | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + birth_date_type_0 = datetime.date.fromisoformat(data) + + return birth_date_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.date | None, data) + + birth_date = _parse_birth_date(d.pop("birth_date")) + + def _parse_birth_place(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + birth_place = _parse_birth_place(d.pop("birth_place")) + + phone = d.pop("phone") + + def _parse_vat_number(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + vat_number = _parse_vat_number(d.pop("vat_number")) + + is_vat_group = d.pop("is_vat_group") + + fiscal_code = d.pop("fiscal_code") + + def _parse_edocument_pec(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + edocument_pec = _parse_edocument_pec(d.pop("edocument_pec")) + + def _parse_edocument_code(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + edocument_code = _parse_edocument_code(d.pop("edocument_code")) + + def _parse_exporter_expiry(data: object) -> datetime.date | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + exporter_expiry_type_0 = datetime.date.fromisoformat(data) + + return exporter_expiry_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.date | None, data) + + exporter_expiry = _parse_exporter_expiry(d.pop("exporter_expiry")) + + def _parse_exporter_number(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + exporter_number = _parse_exporter_number(d.pop("exporter_number")) + + def _parse_exporter_date(data: object) -> datetime.date | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + exporter_date_type_0 = datetime.date.fromisoformat(data) + + return exporter_date_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.date | None, data) + + exporter_date = _parse_exporter_date(d.pop("exporter_date")) + + is_split_payment = d.pop("is_split_payment") + + account_billing = cls( + account_billing_id=account_billing_id, + legal_entity=legal_entity, + tax_regime=tax_regime, + organization=organization, + name=name, + surname=surname, + address=address, + city=city, + state=state, + postal_code=postal_code, + country=country, + gender=gender, + birth_date=birth_date, + birth_place=birth_place, + phone=phone, + vat_number=vat_number, + is_vat_group=is_vat_group, + fiscal_code=fiscal_code, + edocument_pec=edocument_pec, + edocument_code=edocument_code, + exporter_expiry=exporter_expiry, + exporter_number=exporter_number, + exporter_date=exporter_date, + is_split_payment=is_split_payment, + ) + + account_billing.additional_properties = d + return account_billing + + @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/account_paginated_list_response.py b/src/shellrent_sdk/client/models/account_paginated_list_response.py new file mode 100644 index 0000000..381ed46 --- /dev/null +++ b/src/shellrent_sdk/client/models/account_paginated_list_response.py @@ -0,0 +1,99 @@ +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.account import Account + from ..models.pagination_meta import PaginationMeta + + +T = TypeVar("T", bound="AccountPaginatedListResponse") + + +@_attrs_define +class AccountPaginatedListResponse: + error: int + message: None | str + data: list[Account] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.account import Account + from ..models.pagination_meta import PaginationMeta + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = Account.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + account_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + account_paginated_list_response.additional_properties = d + return account_paginated_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/account_response.py b/src/shellrent_sdk/client/models/account_response.py new file mode 100644 index 0000000..1349e31 --- /dev/null +++ b/src/shellrent_sdk/client/models/account_response.py @@ -0,0 +1,110 @@ +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.account import Account + from ..models.account_response_meta_type_0 import AccountResponseMetaType0 + + +T = TypeVar("T", bound="AccountResponse") + + +@_attrs_define +class AccountResponse: + error: int + message: None | str + data: Account + meta: AccountResponseMetaType0 | None + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, AccountResponseMetaType0): + 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.account import Account + from ..models.account_response_meta_type_0 import AccountResponseMetaType0 + + 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 = 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")) + + account_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + account_response.additional_properties = d + return account_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/account_response_meta_type_0.py b/src/shellrent_sdk/client/models/account_response_meta_type_0.py new file mode 100644 index 0000000..bc26c3f --- /dev/null +++ b/src/shellrent_sdk/client/models/account_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..5c2f05d --- /dev/null +++ b/src/shellrent_sdk/client/models/amount.py @@ -0,0 +1,114 @@ +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="Amount") + + +@_attrs_define +class Amount: + amount: float | None + """ Taxable amount """ + currency: str + """ Currency (EUR, USD, GBP, ...) """ + tax_rate: float | None + """ VAT rate in cents (iva/vat) """ + tax: float | None + """ VAT (tax) amount """ + total: float | None + """ Total amount """ + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + amount: float | None + amount = self.amount + + currency = self.currency + + tax_rate: float | None + tax_rate = self.tax_rate + + tax: float | None + tax = self.tax + + total: float | None + total = self.total + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "amount": amount, + "currency": currency, + "tax_rate": tax_rate, + "tax": tax, + "total": total, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + + def _parse_amount(data: object) -> float | None: + if data is None: + return data + return cast(float | None, data) + + amount = _parse_amount(d.pop("amount")) + + currency = d.pop("currency") + + def _parse_tax_rate(data: object) -> float | None: + if data is None: + return data + return cast(float | None, data) + + tax_rate = _parse_tax_rate(d.pop("tax_rate")) + + def _parse_tax(data: object) -> float | None: + if data is None: + return data + return cast(float | None, data) + + tax = _parse_tax(d.pop("tax")) + + def _parse_total(data: object) -> float | None: + if data is None: + return data + return cast(float | None, data) + + total = _parse_total(d.pop("total")) + + amount = cls( + amount=amount, + currency=currency, + tax_rate=tax_rate, + tax=tax, + total=total, + ) + + amount.additional_properties = d + return amount + + @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_simple.py b/src/shellrent_sdk/client/models/amount_simple.py new file mode 100644 index 0000000..1903a1c --- /dev/null +++ b/src/shellrent_sdk/client/models/amount_simple.py @@ -0,0 +1,63 @@ +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="AmountSimple") + + +@_attrs_define +class AmountSimple: + amount: float + currency: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + amount = self.amount + + currency = self.currency + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "amount": amount, + "currency": currency, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + amount = d.pop("amount") + + currency = d.pop("currency") + + amount_simple = cls( + amount=amount, + currency=currency, + ) + + amount_simple.additional_properties = d + return amount_simple + + @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.py b/src/shellrent_sdk/client/models/api_error.py new file mode 100644 index 0000000..0127bbb --- /dev/null +++ b/src/shellrent_sdk/client/models/api_error.py @@ -0,0 +1,125 @@ +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.api_error_data_type_0 import ApiErrorDataType0 + from ..models.api_error_meta_type_0 import ApiErrorMetaType0 + + +T = TypeVar("T", bound="ApiError") + + +@_attrs_define +class ApiError: + error: int + """ Codice d'errore maggiore di zero """ + message: str + data: ApiErrorDataType0 | None + """ Null nelle risposte d'errore """ + meta: ApiErrorMetaType0 | None + """ Null nelle risposte d'errore """ + 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 + + meta: dict[str, Any] | None + if isinstance(self.meta, ApiErrorMetaType0): + 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.api_error_data_type_0 import ApiErrorDataType0 + from ..models.api_error_meta_type_0 import ApiErrorMetaType0 + + d = dict(src_dict) + error = d.pop("error") + + 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")) + + def _parse_meta(data: object) -> ApiErrorMetaType0 | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + meta_type_0 = ApiErrorMetaType0.from_dict(data) + + return meta_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(ApiErrorMetaType0 | None, data) + + meta = _parse_meta(d.pop("meta")) + + api_error = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + api_error.additional_properties = d + return api_error + + @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_data_type_0.py b/src/shellrent_sdk/client/models/api_error_data_type_0.py new file mode 100644 index 0000000..1eea53e --- /dev/null +++ b/src/shellrent_sdk/client/models/api_error_data_type_0.py @@ -0,0 +1,47 @@ +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 new file mode 100644 index 0000000..8a68d8b --- /dev/null +++ b/src/shellrent_sdk/client/models/api_error_meta_type_0.py @@ -0,0 +1,47 @@ +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="ApiErrorMetaType0") + + +@_attrs_define +class ApiErrorMetaType0: + """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_meta_type_0 = cls() + + api_error_meta_type_0.additional_properties = d + return api_error_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/api_upload.py b/src/shellrent_sdk/client/models/api_upload.py new file mode 100644 index 0000000..ed4641f --- /dev/null +++ b/src/shellrent_sdk/client/models/api_upload.py @@ -0,0 +1,107 @@ +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 + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ApiUpload") + + +@_attrs_define +class ApiUpload: + upload_id: int + filename: str + original_filename: None | str + file_extension: None | str + upload_date: datetime.date + mimetype: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + upload_id = self.upload_id + + filename = self.filename + + original_filename: None | str + original_filename = self.original_filename + + file_extension: None | str + file_extension = self.file_extension + + 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, + "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 + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + upload_id = d.pop("upload_id") + + filename = d.pop("filename") + + def _parse_original_filename(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + original_filename = _parse_original_filename(d.pop("original_filename")) + + def _parse_file_extension(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + file_extension = _parse_file_extension(d.pop("file_extension")) + + upload_date = datetime.date.fromisoformat(d.pop("upload_date")) + + mimetype = d.pop("mimetype", UNSET) + + api_upload = cls( + upload_id=upload_id, + filename=filename, + original_filename=original_filename, + file_extension=file_extension, + upload_date=upload_date, + mimetype=mimetype, + ) + + api_upload.additional_properties = d + return api_upload + + @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_upload_response.py b/src/shellrent_sdk/client/models/api_upload_response.py new file mode 100644 index 0000000..97a4988 --- /dev/null +++ b/src/shellrent_sdk/client/models/api_upload_response.py @@ -0,0 +1,112 @@ +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.api_upload import ApiUpload + from ..models.api_upload_response_meta_type_0 import ApiUploadResponseMetaType0 + + +T = TypeVar("T", bound="ApiUploadResponse") + + +@_attrs_define +class ApiUploadResponse: + error: int + message: None | str + data: ApiUpload + meta: ApiUploadResponseMetaType0 | None + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, ApiUploadResponseMetaType0): + 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.api_upload import ApiUpload + from ..models.api_upload_response_meta_type_0 import ( + ApiUploadResponseMetaType0, + ) + + 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 = 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")) + + api_upload_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + api_upload_response.additional_properties = d + return api_upload_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/api_upload_response_meta_type_0.py b/src/shellrent_sdk/client/models/api_upload_response_meta_type_0.py new file mode 100644 index 0000000..e1bd083 --- /dev/null +++ b/src/shellrent_sdk/client/models/api_upload_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..9a76c4e --- /dev/null +++ b/src/shellrent_sdk/client/models/billing_data.py @@ -0,0 +1,89 @@ +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="BillingData") + + +@_attrs_define +class BillingData: + cig_value: None | str + cup_value: None | str + oda_value: None | str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + cig_value: None | str + cig_value = self.cig_value + + cup_value: None | str + cup_value = self.cup_value + + oda_value: None | str + oda_value = self.oda_value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "cig_value": cig_value, + "cup_value": cup_value, + "oda_value": oda_value, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + + def _parse_cig_value(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + cig_value = _parse_cig_value(d.pop("cig_value")) + + def _parse_cup_value(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + cup_value = _parse_cup_value(d.pop("cup_value")) + + def _parse_oda_value(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + oda_value = _parse_oda_value(d.pop("oda_value")) + + billing_data = cls( + cig_value=cig_value, + cup_value=cup_value, + oda_value=oda_value, + ) + + billing_data.additional_properties = d + return billing_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/buy_prepaid_credit_topup_request.py b/src/shellrent_sdk/client/models/buy_prepaid_credit_topup_request.py new file mode 100644 index 0000000..9316ff8 --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_prepaid_credit_topup_request.py @@ -0,0 +1,59 @@ +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 + +from ..models.buy_prepaid_credit_topup_request_amount import BuyPrepaidCreditTopupRequestAmount + +T = TypeVar("T", bound="BuyPrepaidCreditTopupRequest") + + +@_attrs_define +class BuyPrepaidCreditTopupRequest: + amount: BuyPrepaidCreditTopupRequestAmount + """ Topup amount. """ + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + 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, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + amount = BuyPrepaidCreditTopupRequestAmount(d.pop("amount")) + + buy_prepaid_credit_topup_request = cls( + 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_prepaid_credit_topup_request_amount.py b/src/shellrent_sdk/client/models/buy_prepaid_credit_topup_request_amount.py new file mode 100644 index 0000000..0e1fb86 --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_prepaid_credit_topup_request_amount.py @@ -0,0 +1,17 @@ +from enum import IntEnum + + +class BuyPrepaidCreditTopupRequestAmount(IntEnum): + VALUE_50 = 50 + VALUE_100 = 100 + VALUE_150 = 150 + VALUE_200 = 200 + VALUE_300 = 300 + VALUE_500 = 500 + VALUE_800 = 800 + VALUE_1000 = 1000 + VALUE_1500 = 1500 + VALUE_2000 = 2000 + + def __str__(self) -> str: + return str(self.value) 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 new file mode 100644 index 0000000..6bbf05c --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_active_monitoring_request.py @@ -0,0 +1,94 @@ +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_active_monitoring_request_data import ( + BuyServiceActiveMonitoringRequestData, + ) + + +T = TypeVar("T", bound="BuyServiceActiveMonitoringRequest") + + +@_attrs_define +class BuyServiceActiveMonitoringRequest: + service_id: int + """ 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) """ + 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 + + account_id = self.account_id + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "service_id": service_id, + } + ) + if account_id is not UNSET: + field_dict["account_id"] = account_id + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.buy_service_active_monitoring_request_data import ( + BuyServiceActiveMonitoringRequestData, + ) + + d = dict(src_dict) + service_id = d.pop("service_id") + + account_id = d.pop("account_id", UNSET) + + _data = d.pop("data", UNSET) + data: BuyServiceActiveMonitoringRequestData | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = BuyServiceActiveMonitoringRequestData.from_dict(_data) + + buy_service_active_monitoring_request = cls( + service_id=service_id, + account_id=account_id, + 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_active_monitoring_request_data.py b/src/shellrent_sdk/client/models/buy_service_active_monitoring_request_data.py new file mode 100644 index 0000000..23d3425 --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_active_monitoring_request_data.py @@ -0,0 +1,85 @@ +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="BuyServiceActiveMonitoringRequestData") + + +@_attrs_define +class BuyServiceActiveMonitoringRequestData: + """Target to monitor with the Active Monitoring service""" + + purchase_id_server: int | Unset = UNSET + """ Use this to activate Active Monitoring on an already active Server by specifying the server_id """ + ip_address: str | Unset = UNSET + """ Use this to activate Active Monitoring on an additional IP address of an already active Server """ + vswitch_ip_addess: str | Unset = UNSET + """ Use this to activate Active Monitoring on an IP address of an already active vSwitch service """ + external_hostname: str | Unset = UNSET + """ Specify the hostname of an external host or server """ + external_ip_address: str | Unset = UNSET + """ Specify the IP address of an external host or server to monitor """ + external_ip_address_description: str | Unset = UNSET + """ Specify a description for the external IP address (e.g. the corresponding hostname) """ + + def to_dict(self) -> dict[str, Any]: + purchase_id_server = self.purchase_id_server + + ip_address = self.ip_address + + vswitch_ip_addess = self.vswitch_ip_addess + + external_hostname = self.external_hostname + + external_ip_address = self.external_ip_address + + external_ip_address_description = self.external_ip_address_description + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if purchase_id_server is not UNSET: + field_dict["purchase_id_server"] = purchase_id_server + if ip_address is not UNSET: + field_dict["ip_address"] = ip_address + if vswitch_ip_addess is not UNSET: + field_dict["vswitch_ip_addess"] = vswitch_ip_addess + if external_hostname is not UNSET: + field_dict["external_hostname"] = external_hostname + if external_ip_address is not UNSET: + field_dict["external_ip_address"] = external_ip_address + if external_ip_address_description is not UNSET: + field_dict["external_ip_address_description"] = external_ip_address_description + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + purchase_id_server = d.pop("purchase_id_server", UNSET) + + ip_address = d.pop("ip_address", UNSET) + + vswitch_ip_addess = d.pop("vswitch_ip_addess", UNSET) + + external_hostname = d.pop("external_hostname", UNSET) + + external_ip_address = d.pop("external_ip_address", UNSET) + + external_ip_address_description = d.pop("external_ip_address_description", UNSET) + + buy_service_active_monitoring_request_data = cls( + purchase_id_server=purchase_id_server, + ip_address=ip_address, + vswitch_ip_addess=vswitch_ip_addess, + external_hostname=external_hostname, + external_ip_address=external_ip_address, + external_ip_address_description=external_ip_address_description, + ) + + return buy_service_active_monitoring_request_data 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 new file mode 100644 index 0000000..e6409a1 --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_cloud_storage_request.py @@ -0,0 +1,77 @@ +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 + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="BuyServiceCloudStorageRequest") + + +@_attrs_define +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 """ + 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 + + recurrence_id = self.recurrence_id + + account_id = self.account_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "service_id": service_id, + } + ) + if recurrence_id is not UNSET: + field_dict["recurrence_id"] = recurrence_id + 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: + d = dict(src_dict) + service_id = d.pop("service_id") + + recurrence_id = d.pop("recurrence_id", UNSET) + + account_id = d.pop("account_id", UNSET) + + buy_service_cloud_storage_request = cls( + service_id=service_id, + recurrence_id=recurrence_id, + 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 new file mode 100644 index 0000000..1153a66 --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_cloud_vps_request.py @@ -0,0 +1,95 @@ +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_dedicated_server_request_data import ( + BuyServiceDedicatedServerRequestData, + ) + + +T = TypeVar("T", bound="BuyServiceCloudVpsRequest") + + +@_attrs_define +class BuyServiceCloudVpsRequest: + service_id: int + """ ID of the Service to buy """ + data: BuyServiceDedicatedServerRequestData + """ Cloud VPS configuration details """ + recurrence_id: int | Unset = UNSET + """ ID of the Recurrence to assign to the purchased service """ + 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 + + data = self.data.to_dict() + + recurrence_id = self.recurrence_id + + account_id = self.account_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "service_id": service_id, + "data": data, + } + ) + if recurrence_id is not UNSET: + field_dict["recurrence_id"] = recurrence_id + 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_dedicated_server_request_data import ( + BuyServiceDedicatedServerRequestData, + ) + + d = dict(src_dict) + service_id = d.pop("service_id") + + data = BuyServiceDedicatedServerRequestData.from_dict(d.pop("data")) + + recurrence_id = d.pop("recurrence_id", UNSET) + + account_id = d.pop("account_id", UNSET) + + buy_service_cloud_vps_request = cls( + service_id=service_id, + data=data, + recurrence_id=recurrence_id, + 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_cloud_vps_request_data.py b/src/shellrent_sdk/client/models/buy_service_cloud_vps_request_data.py new file mode 100644 index 0000000..167e557 --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_cloud_vps_request_data.py @@ -0,0 +1,77 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Self, TypeVar + +from attrs import define as _attrs_define + +from ..models.buy_service_cloud_vps_request_data_diskquantity import ( + BuyServiceCloudVpsRequestDataDISKQUANTITY, +) + +T = TypeVar("T", bound="BuyServiceCloudVpsRequestData") + + +@_attrs_define +class BuyServiceCloudVpsRequestData: + """Cloud VPS configuration details""" + + server_configuration_code: str + """ One of the server Templates compatible with the "Cloud VPS Server" service to buy """ + server_template_code: str + """ One of the server Operative Systems (OS) compatible with the "Cloud VPS Server" service to buy and with the + chosen server Template """ + ram_quantity: int + """ RAM in GB. Min value may change depending on chosen server configuration or template. """ + disk_quantity: BuyServiceCloudVpsRequestDataDISKQUANTITY + """ Disk size in GB. Min value may change depending on chosen server configuration or template. """ + vcpu_quantity: int + """ Number of vCPU. Min value may change depending on chosen server configuration or template. """ + + def to_dict(self) -> dict[str, Any]: + server_configuration_code = self.server_configuration_code + + server_template_code = self.server_template_code + + ram_quantity = self.ram_quantity + + disk_quantity = self.disk_quantity.value + + vcpu_quantity = self.vcpu_quantity + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "SERVER_CONFIGURATION_CODE": server_configuration_code, + "SERVER_TEMPLATE_CODE": server_template_code, + "RAM_QUANTITY": ram_quantity, + "DISK_QUANTITY": disk_quantity, + "VCPU_QUANTITY": vcpu_quantity, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + server_configuration_code = d.pop("SERVER_CONFIGURATION_CODE") + + server_template_code = d.pop("SERVER_TEMPLATE_CODE") + + ram_quantity = d.pop("RAM_QUANTITY") + + disk_quantity = BuyServiceCloudVpsRequestDataDISKQUANTITY(d.pop("DISK_QUANTITY")) + + vcpu_quantity = d.pop("VCPU_QUANTITY") + + buy_service_cloud_vps_request_data = cls( + server_configuration_code=server_configuration_code, + server_template_code=server_template_code, + ram_quantity=ram_quantity, + disk_quantity=disk_quantity, + vcpu_quantity=vcpu_quantity, + ) + + return buy_service_cloud_vps_request_data diff --git a/src/shellrent_sdk/client/models/buy_service_cloud_vps_request_data_diskquantity.py b/src/shellrent_sdk/client/models/buy_service_cloud_vps_request_data_diskquantity.py new file mode 100644 index 0000000..43d65b2 --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_cloud_vps_request_data_diskquantity.py @@ -0,0 +1,24 @@ +from enum import IntEnum + + +class BuyServiceCloudVpsRequestDataDISKQUANTITY(IntEnum): + VALUE_20 = 20 + VALUE_25 = 25 + VALUE_30 = 30 + VALUE_35 = 35 + VALUE_40 = 40 + VALUE_45 = 45 + VALUE_50 = 50 + VALUE_55 = 55 + VALUE_60 = 60 + VALUE_65 = 65 + VALUE_70 = 70 + VALUE_75 = 75 + VALUE_80 = 80 + VALUE_85 = 85 + VALUE_90 = 90 + VALUE_95 = 95 + VALUE_100 = 100 + + def __str__(self) -> str: + return str(self.value) 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 new file mode 100644 index 0000000..f0d5da9 --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_cpanel_license_request.py @@ -0,0 +1,84 @@ +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_plesk_license_request_data import BuyServicePleskLicenseRequestData + + +T = TypeVar("T", bound="BuyServiceCpanelLicenseRequest") + + +@_attrs_define +class BuyServiceCpanelLicenseRequest: + service_id: int + """ ID of the Service to buy """ + data: BuyServicePleskLicenseRequestData + """ 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 + + data = self.data.to_dict() + + account_id = self.account_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "service_id": service_id, + "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_plesk_license_request_data import ( + BuyServicePleskLicenseRequestData, + ) + + d = dict(src_dict) + service_id = d.pop("service_id") + + data = BuyServicePleskLicenseRequestData.from_dict(d.pop("data")) + + account_id = d.pop("account_id", UNSET) + + buy_service_cpanel_license_request = cls( + service_id=service_id, + data=data, + 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 new file mode 100644 index 0000000..9585496 --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_cpanel_license_request_data.py @@ -0,0 +1,72 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Self, TypeVar + +from attrs import define as _attrs_define + +from ..models.buy_service_cpanel_license_request_data_installation_type import ( + BuyServiceCpanelLicenseRequestDataInstallationType, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="BuyServiceCpanelLicenseRequestData") + + +@_attrs_define +class BuyServiceCpanelLicenseRequestData: + """Details about where to install the license""" + + installation_type: BuyServiceCpanelLicenseRequestDataInstallationType | Unset = UNSET + """ 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 + "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 + + purchase_server = self.purchase_server + + ip_address = self.ip_address + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if installation_type is not UNSET: + field_dict["installation_type"] = installation_type + if purchase_server is not UNSET: + field_dict["purchase_server"] = purchase_server + if ip_address is not UNSET: + field_dict["ip_address"] = ip_address + + return field_dict + + @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 + ) + + purchase_server = d.pop("purchase_server", UNSET) + + ip_address = d.pop("ip_address", UNSET) + + buy_service_cpanel_license_request_data = cls( + installation_type=installation_type, + purchase_server=purchase_server, + ip_address=ip_address, + ) + + return buy_service_cpanel_license_request_data diff --git a/src/shellrent_sdk/client/models/buy_service_cpanel_license_request_data_installation_type.py b/src/shellrent_sdk/client/models/buy_service_cpanel_license_request_data_installation_type.py new file mode 100644 index 0000000..4df7944 --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_cpanel_license_request_data_installation_type.py @@ -0,0 +1,9 @@ +from enum import StrEnum + + +class BuyServiceCpanelLicenseRequestDataInstallationType(StrEnum): + EXTERNAL_INSTALLATION_TYPE = "external_installation_type" + INTERNAL_INSTALLATION_TYPE = "internal_installation_type" + + def __str__(self) -> str: + return str(self.value) 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 new file mode 100644 index 0000000..99f4f28 --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_dedicated_server_request.py @@ -0,0 +1,95 @@ +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_dedicated_server_request_data import ( + BuyServiceDedicatedServerRequestData, + ) + + +T = TypeVar("T", bound="BuyServiceDedicatedServerRequest") + + +@_attrs_define +class BuyServiceDedicatedServerRequest: + service_id: int + """ ID of the Service to buy """ + data: BuyServiceDedicatedServerRequestData + """ Dedicated Server configuration and template selection """ + recurrence_id: int | Unset = UNSET + """ ID of the Recurrence to assign to the purchased service """ + 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 + + data = self.data.to_dict() + + recurrence_id = self.recurrence_id + + account_id = self.account_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "service_id": service_id, + "data": data, + } + ) + if recurrence_id is not UNSET: + field_dict["recurrence_id"] = recurrence_id + 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_dedicated_server_request_data import ( + BuyServiceDedicatedServerRequestData, + ) + + d = dict(src_dict) + service_id = d.pop("service_id") + + data = BuyServiceDedicatedServerRequestData.from_dict(d.pop("data")) + + recurrence_id = d.pop("recurrence_id", UNSET) + + account_id = d.pop("account_id", UNSET) + + buy_service_dedicated_server_request = cls( + service_id=service_id, + data=data, + recurrence_id=recurrence_id, + 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_dedicated_server_request_data.py b/src/shellrent_sdk/client/models/buy_service_dedicated_server_request_data.py new file mode 100644 index 0000000..28e2843 --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_dedicated_server_request_data.py @@ -0,0 +1,49 @@ +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="BuyServiceDedicatedServerRequestData") + + +@_attrs_define +class BuyServiceDedicatedServerRequestData: + """Dedicated Server configuration and template selection""" + + server_configuration_code: str + """ One of the server Templates compatible with the "Dedicated Server" service to buy """ + server_template_code: str + """ One of the server Operative Systems (OS) compatible with the "Dedicated Server" service to buy and with the + chosen server Template """ + + def to_dict(self) -> dict[str, Any]: + server_configuration_code = self.server_configuration_code + + server_template_code = self.server_template_code + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "SERVER_CONFIGURATION_CODE": server_configuration_code, + "SERVER_TEMPLATE_CODE": server_template_code, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + server_configuration_code = d.pop("SERVER_CONFIGURATION_CODE") + + server_template_code = d.pop("SERVER_TEMPLATE_CODE") + + buy_service_dedicated_server_request_data = cls( + server_configuration_code=server_configuration_code, + server_template_code=server_template_code, + ) + + return buy_service_dedicated_server_request_data diff --git a/src/shellrent_sdk/client/models/buy_service_domain_request.py b/src/shellrent_sdk/client/models/buy_service_domain_request.py new file mode 100644 index 0000000..799adce --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_domain_request.py @@ -0,0 +1,89 @@ +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_domain_request_configuration import ( + BuyServiceDomainRequestConfiguration, + ) + from ..models.buy_service_domain_request_data import BuyServiceDomainRequestData + + +T = TypeVar("T", bound="BuyServiceDomainRequest") + + +@_attrs_define +class BuyServiceDomainRequest: + configuration: BuyServiceDomainRequestConfiguration + """ Domain purchase configuration options """ + data: BuyServiceDomainRequestData + 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_domain_request_configuration import ( + BuyServiceDomainRequestConfiguration, + ) + from ..models.buy_service_domain_request_data import ( + BuyServiceDomainRequestData, + ) + + d = dict(src_dict) + configuration = BuyServiceDomainRequestConfiguration.from_dict(d.pop("configuration")) + + data = BuyServiceDomainRequestData.from_dict(d.pop("data")) + + account_id = d.pop("account_id", UNSET) + + buy_service_domain_request = cls( + configuration=configuration, + data=data, + 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 new file mode 100644 index 0000000..f52791e --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_domain_request_configuration.py @@ -0,0 +1,49 @@ +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="BuyServiceDomainRequestConfiguration") + + +@_attrs_define +class BuyServiceDomainRequestConfiguration: + """Domain purchase configuration options""" + + domain_name: str | Unset = UNSET + """ Domain complete name (with TLD extension), for example: "example.com" or "example.co.uk" """ + extension: str | Unset = UNSET + """ TLD extension of the domain, for example: "com" or "co.uk" """ + + def to_dict(self) -> dict[str, Any]: + domain_name = self.domain_name + + extension = self.extension + + 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 + + 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) + + extension = d.pop("extension", UNSET) + + buy_service_domain_request_configuration = cls( + domain_name=domain_name, + extension=extension, + ) + + return buy_service_domain_request_configuration 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 new file mode 100644 index 0000000..9132843 --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_domain_request_data.py @@ -0,0 +1,70 @@ +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 ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.buy_service_domain_request_data_contact_data import ( + BuyServiceDomainRequestDataContactData, + ) + + +T = TypeVar("T", bound="BuyServiceDomainRequestData") + + +@_attrs_define +class BuyServiceDomainRequestData: + contact_data: BuyServiceDomainRequestDataContactData + """ Domain contact data. Values depend on the TLD requirements. """ + domain_authcode: None | 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 + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "contact_data": contact_data, + } + ) + if domain_authcode is not UNSET: + field_dict["domain_authcode"] = domain_authcode + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.buy_service_domain_request_data_contact_data import ( + BuyServiceDomainRequestDataContactData, + ) + + 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)) + + buy_service_domain_request_data = cls( + contact_data=contact_data, + domain_authcode=domain_authcode, + ) + + return buy_service_domain_request_data diff --git a/src/shellrent_sdk/client/models/buy_service_domain_request_data_contact_data.py b/src/shellrent_sdk/client/models/buy_service_domain_request_data_contact_data.py new file mode 100644 index 0000000..ab00107 --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_domain_request_data_contact_data.py @@ -0,0 +1,47 @@ +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="BuyServiceDomainRequestDataContactData") + + +@_attrs_define +class BuyServiceDomainRequestDataContactData: + """Domain contact data. Values depend on the TLD requirements.""" + + 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) + buy_service_domain_request_data_contact_data = cls() + + buy_service_domain_request_data_contact_data.additional_properties = d + return buy_service_domain_request_data_contact_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/buy_service_microsoft_365_request.py b/src/shellrent_sdk/client/models/buy_service_microsoft_365_request.py new file mode 100644 index 0000000..17b4259 --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_microsoft_365_request.py @@ -0,0 +1,93 @@ +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_microsoft_365_request_data import BuyServiceMicrosoft365RequestData + + +T = TypeVar("T", bound="BuyServiceMicrosoft365Request") + + +@_attrs_define +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 """ + 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 + + data = self.data.to_dict() + + quantity = self.quantity + + account_id = self.account_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "service_id": service_id, + "data": data, + } + ) + if quantity is not UNSET: + field_dict["quantity"] = quantity + 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_microsoft_365_request_data import ( + BuyServiceMicrosoft365RequestData, + ) + + d = dict(src_dict) + service_id = d.pop("service_id") + + data = BuyServiceMicrosoft365RequestData.from_dict(d.pop("data")) + + quantity = d.pop("quantity", UNSET) + + account_id = d.pop("account_id", UNSET) + + buy_service_microsoft_365_request = cls( + service_id=service_id, + data=data, + quantity=quantity, + 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 new file mode 100644 index 0000000..14a5774 --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_microsoft_365_request_data.py @@ -0,0 +1,325 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Self, TypeVar, cast + +from attrs import define as _attrs_define + +from ..models.buy_service_microsoft_365_request_data_locale import ( + BuyServiceMicrosoft365RequestDataLocale, +) +from ..models.buy_service_microsoft_365_request_data_tenant_choice import ( + BuyServiceMicrosoft365RequestDataTenantChoice, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="BuyServiceMicrosoft365RequestData") + + +@_attrs_define +class BuyServiceMicrosoft365RequestData: + """Information about the Microsoft 365 tenant to associate to the subscription""" + + 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 """ + locale: BuyServiceMicrosoft365RequestDataLocale | Unset = UNSET + """ Locale to use for the tenant when not selecting an existing tenant """ + + 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 + + domain_prefix: None | str | Unset + if isinstance(self.domain_prefix, Unset): + domain_prefix = UNSET + else: + 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 + + last_name: None | str | Unset + if isinstance(self.last_name, Unset): + last_name = UNSET + else: + 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 + + address: None | str | Unset + if isinstance(self.address, Unset): + address = UNSET + else: + address = self.address + + city: None | str | Unset + if isinstance(self.city, Unset): + city = UNSET + else: + city = self.city + + state: None | str | Unset + if isinstance(self.state, Unset): + state = UNSET + else: + state = self.state + + postal_code: None | str | Unset + if isinstance(self.postal_code, Unset): + postal_code = UNSET + else: + postal_code = self.postal_code + + country: None | str | Unset + if isinstance(self.country, Unset): + country = UNSET + else: + country = self.country + + email_address: None | str | Unset + if isinstance(self.email_address, Unset): + email_address = UNSET + else: + 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_number: None | str | Unset + if isinstance(self.phone_number, Unset): + phone_number = UNSET + else: + phone_number = self.phone_number + + locale: str | Unset = UNSET + if not isinstance(self.locale, Unset): + locale = self.locale.value + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "tenant_choice": tenant_choice, + } + ) + if tenant_select is not UNSET: + field_dict["tenant_select"] = tenant_select + if domain_prefix is not UNSET: + field_dict["domain_prefix"] = domain_prefix + if first_name is not UNSET: + field_dict["first_name"] = first_name + if last_name is not UNSET: + field_dict["last_name"] = last_name + if company_name is not UNSET: + field_dict["company_name"] = company_name + if address is not UNSET: + field_dict["address"] = address + if city is not UNSET: + field_dict["city"] = city + if state is not UNSET: + field_dict["state"] = state + if postal_code is not UNSET: + field_dict["postal_code"] = postal_code + if country is not UNSET: + field_dict["country"] = country + if email_address is not UNSET: + field_dict["email_address"] = email_address + if phone_prefix is not UNSET: + field_dict["phone_prefix"] = phone_prefix + if phone_number is not UNSET: + field_dict["phone_number"] = phone_number + if locale is not UNSET: + field_dict["locale"] = locale + + return field_dict + + @classmethod + 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)) + + _locale = d.pop("locale", UNSET) + locale: BuyServiceMicrosoft365RequestDataLocale | Unset + if isinstance(_locale, Unset): + locale = UNSET + else: + locale = BuyServiceMicrosoft365RequestDataLocale(_locale) + + buy_service_microsoft_365_request_data = cls( + tenant_choice=tenant_choice, + tenant_select=tenant_select, + domain_prefix=domain_prefix, + first_name=first_name, + last_name=last_name, + company_name=company_name, + address=address, + city=city, + state=state, + postal_code=postal_code, + country=country, + email_address=email_address, + phone_prefix=phone_prefix, + phone_number=phone_number, + locale=locale, + ) + + return buy_service_microsoft_365_request_data diff --git a/src/shellrent_sdk/client/models/buy_service_microsoft_365_request_data_locale.py b/src/shellrent_sdk/client/models/buy_service_microsoft_365_request_data_locale.py new file mode 100644 index 0000000..ab5fd5f --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_microsoft_365_request_data_locale.py @@ -0,0 +1,10 @@ +from enum import StrEnum + + +class BuyServiceMicrosoft365RequestDataLocale(StrEnum): + EN_GB = "en_GB" + EN_US = "en_US" + IT_IT = "it_IT" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/shellrent_sdk/client/models/buy_service_microsoft_365_request_data_tenant_choice.py b/src/shellrent_sdk/client/models/buy_service_microsoft_365_request_data_tenant_choice.py new file mode 100644 index 0000000..c62a40b --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_microsoft_365_request_data_tenant_choice.py @@ -0,0 +1,10 @@ +from enum import StrEnum + + +class BuyServiceMicrosoft365RequestDataTenantChoice(StrEnum): + NEW = "new" + SELECT = "select" + TRANSFER = "transfer" + + def __str__(self) -> str: + return str(self.value) 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 new file mode 100644 index 0000000..620e533 --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_object_storage_request.py @@ -0,0 +1,80 @@ +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_object_storage_request_configuration import ( + BuyServiceObjectStorageRequestConfiguration, + ) + + +T = TypeVar("T", bound="BuyServiceObjectStorageRequest") + + +@_attrs_define +class BuyServiceObjectStorageRequest: + configuration: BuyServiceObjectStorageRequestConfiguration + """ Object Storage 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_object_storage_request_configuration import ( + BuyServiceObjectStorageRequestConfiguration, + ) + + d = dict(src_dict) + configuration = BuyServiceObjectStorageRequestConfiguration.from_dict( + d.pop("configuration") + ) + + account_id = d.pop("account_id", UNSET) + + buy_service_object_storage_request = cls( + configuration=configuration, + 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 new file mode 100644 index 0000000..249f3c8 --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_object_storage_request_configuration.py @@ -0,0 +1,52 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Self, TypeVar + +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") + + +@_attrs_define +class BuyServiceObjectStorageRequestConfiguration: + """Object Storage configuration options""" + + tb_size: BuyServiceObjectStorageRequestConfigurationTbSize | Unset = ( + BuyServiceObjectStorageRequestConfigurationTbSize.VALUE_1 + ) + """ Number of TB to allocate """ + + 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 + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if tb_size is not UNSET: + field_dict["tb_size"] = tb_size + + return field_dict + + @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) + + buy_service_object_storage_request_configuration = cls( + tb_size=tb_size, + ) + + return buy_service_object_storage_request_configuration 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 new file mode 100644 index 0000000..34b474f --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_object_storage_request_configuration_tb_size.py @@ -0,0 +1,21 @@ +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 new file mode 100644 index 0000000..501b42c --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_pec_domain_request.py @@ -0,0 +1,75 @@ +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_pec_domain_request_data import BuyServicePecDomainRequestData + + +T = TypeVar("T", bound="BuyServicePecDomainRequest") + + +@_attrs_define +class BuyServicePecDomainRequest: + data: BuyServicePecDomainRequestData + 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() + + account_id = self.account_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "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_pec_domain_request_data import ( + BuyServicePecDomainRequestData, + ) + + d = dict(src_dict) + data = BuyServicePecDomainRequestData.from_dict(d.pop("data")) + + account_id = d.pop("account_id", UNSET) + + buy_service_pec_domain_request = cls( + data=data, + 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 new file mode 100644 index 0000000..e216166 --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_pec_domain_request_data.py @@ -0,0 +1,282 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Self, TypeVar + +from attrs import define as _attrs_define + +from ..models.buy_service_pec_domain_request_data_legal_entity import ( + BuyServicePecDomainRequestDataLegalEntity, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="BuyServicePecDomainRequestData") + + +@_attrs_define +class BuyServicePecDomainRequestData: + domain_name: str | Unset = UNSET + """ 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 """ + owner: int | Unset = UNSET + """ Id of the PEC owner, if it already exists """ + admin_first_name: str | Unset = UNSET + """ First name of the PEC owner """ + admin_last_name: str | Unset = UNSET + """ Last name of the PEC owner """ + admin_email: str | Unset = UNSET + """ Email of the PEC owner """ + admin_fiscal_code: str | Unset = UNSET + """ Fiscal code of the PEC owner """ + admin_post_code: str | Unset = UNSET + """ Post code of the PEC owner """ + admin_address: str | Unset = UNSET + """ Address of the PEC owner """ + admin_city: str | Unset = UNSET + """ City of the PEC owner """ + admin_province: str | Unset = UNSET + """ Province of the PEC owner """ + admin_phone: str | Unset = UNSET + """ Phone of the PEC owner """ + cellphone: str | Unset = UNSET + """ Cellphone of the PEC owner """ + admin_pec_country: str | Unset = UNSET + """ Country of the PEC owner """ + company_name: str | Unset = UNSET + """ Name of the company """ + company_fiscal_code: str | Unset = UNSET + """ Fiscal code of the company """ + admin_vat_number: str | Unset = UNSET + """ Vat number of the company """ + company_email: str | Unset = UNSET + """ Email of the company """ + company_address: str | Unset = UNSET + """ Address of the company """ + company_post_code: str | Unset = UNSET + """ Post code of the company """ + company_city: str | Unset = UNSET + """ City of the company """ + company_province: str | Unset = UNSET + """ Province of the company """ + company_phone: str | Unset = UNSET + """ Phone of the company """ + company_pec_country: str | Unset = UNSET + """ Country of the company """ + transferin_document: int | Unset = UNSET + """ ID of the uploaded file (first file, extension: "pdf") Required only for transfer """ + transferin_contract: int | Unset = UNSET + """ ID of the uploaded file (first file, extension: "pdf") Required only for transfer """ + transferin_identity_document: int | Unset = UNSET + """ ID of the uploaded file (first file, extension: "pdf") Required only for transfer """ + + def to_dict(self) -> dict[str, Any]: + domain_name = self.domain_name + + legal_entity: str | Unset = UNSET + if not isinstance(self.legal_entity, Unset): + legal_entity = self.legal_entity.value + + owner = self.owner + + admin_first_name = self.admin_first_name + + admin_last_name = self.admin_last_name + + admin_email = self.admin_email + + admin_fiscal_code = self.admin_fiscal_code + + admin_post_code = self.admin_post_code + + admin_address = self.admin_address + + admin_city = self.admin_city + + admin_province = self.admin_province + + admin_phone = self.admin_phone + + cellphone = self.cellphone + + admin_pec_country = self.admin_pec_country + + company_name = self.company_name + + company_fiscal_code = self.company_fiscal_code + + admin_vat_number = self.admin_vat_number + + company_email = self.company_email + + company_address = self.company_address + + company_post_code = self.company_post_code + + company_city = self.company_city + + company_province = self.company_province + + company_phone = self.company_phone + + company_pec_country = self.company_pec_country + + transferin_document = self.transferin_document + + transferin_contract = self.transferin_contract + + transferin_identity_document = self.transferin_identity_document + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if domain_name is not UNSET: + field_dict["domain_name"] = domain_name + if legal_entity is not UNSET: + field_dict["legal_entity"] = legal_entity + if owner is not UNSET: + field_dict["owner"] = owner + if admin_first_name is not UNSET: + field_dict["admin_first_name"] = admin_first_name + if admin_last_name is not UNSET: + field_dict["admin_last_name"] = admin_last_name + if admin_email is not UNSET: + field_dict["admin_email"] = admin_email + if admin_fiscal_code is not UNSET: + field_dict["admin_fiscal_code"] = admin_fiscal_code + if admin_post_code is not UNSET: + field_dict["admin_post_code"] = admin_post_code + if admin_address is not UNSET: + field_dict["admin_address"] = admin_address + if admin_city is not UNSET: + field_dict["admin_city"] = admin_city + if admin_province is not UNSET: + field_dict["admin_province"] = admin_province + if admin_phone is not UNSET: + field_dict["admin_phone"] = admin_phone + if cellphone is not UNSET: + field_dict["cellphone"] = cellphone + if admin_pec_country is not UNSET: + field_dict["admin_pec_country"] = admin_pec_country + if company_name is not UNSET: + field_dict["company_name"] = company_name + if company_fiscal_code is not UNSET: + field_dict["company_fiscal_code"] = company_fiscal_code + if admin_vat_number is not UNSET: + field_dict["admin_vat_number"] = admin_vat_number + if company_email is not UNSET: + field_dict["company_email"] = company_email + if company_address is not UNSET: + field_dict["company_address"] = company_address + if company_post_code is not UNSET: + field_dict["company_post_code"] = company_post_code + if company_city is not UNSET: + field_dict["company_city"] = company_city + if company_province is not UNSET: + field_dict["company_province"] = company_province + if company_phone is not UNSET: + field_dict["company_phone"] = company_phone + if company_pec_country is not UNSET: + field_dict["company_pec_country"] = company_pec_country + if transferin_document is not UNSET: + field_dict["transferin_document"] = transferin_document + if transferin_contract is not UNSET: + field_dict["transferin_contract"] = transferin_contract + if transferin_identity_document is not UNSET: + field_dict["transferin_identity_document"] = transferin_identity_document + + 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) + + _legal_entity = d.pop("legal_entity", UNSET) + legal_entity: BuyServicePecDomainRequestDataLegalEntity | Unset + if isinstance(_legal_entity, Unset): + legal_entity = UNSET + else: + legal_entity = BuyServicePecDomainRequestDataLegalEntity(_legal_entity) + + owner = d.pop("owner", UNSET) + + admin_first_name = d.pop("admin_first_name", UNSET) + + admin_last_name = d.pop("admin_last_name", UNSET) + + admin_email = d.pop("admin_email", UNSET) + + admin_fiscal_code = d.pop("admin_fiscal_code", UNSET) + + admin_post_code = d.pop("admin_post_code", UNSET) + + admin_address = d.pop("admin_address", UNSET) + + admin_city = d.pop("admin_city", UNSET) + + admin_province = d.pop("admin_province", UNSET) + + admin_phone = d.pop("admin_phone", UNSET) + + cellphone = d.pop("cellphone", UNSET) + + admin_pec_country = d.pop("admin_pec_country", UNSET) + + company_name = d.pop("company_name", UNSET) + + company_fiscal_code = d.pop("company_fiscal_code", UNSET) + + admin_vat_number = d.pop("admin_vat_number", UNSET) + + company_email = d.pop("company_email", UNSET) + + company_address = d.pop("company_address", UNSET) + + company_post_code = d.pop("company_post_code", UNSET) + + company_city = d.pop("company_city", UNSET) + + company_province = d.pop("company_province", UNSET) + + company_phone = d.pop("company_phone", UNSET) + + company_pec_country = d.pop("company_pec_country", UNSET) + + transferin_document = d.pop("transferin_document", UNSET) + + transferin_contract = d.pop("transferin_contract", UNSET) + + transferin_identity_document = d.pop("transferin_identity_document", UNSET) + + buy_service_pec_domain_request_data = cls( + domain_name=domain_name, + legal_entity=legal_entity, + owner=owner, + admin_first_name=admin_first_name, + admin_last_name=admin_last_name, + admin_email=admin_email, + admin_fiscal_code=admin_fiscal_code, + admin_post_code=admin_post_code, + admin_address=admin_address, + admin_city=admin_city, + admin_province=admin_province, + admin_phone=admin_phone, + cellphone=cellphone, + admin_pec_country=admin_pec_country, + company_name=company_name, + company_fiscal_code=company_fiscal_code, + admin_vat_number=admin_vat_number, + company_email=company_email, + company_address=company_address, + company_post_code=company_post_code, + company_city=company_city, + company_province=company_province, + company_phone=company_phone, + company_pec_country=company_pec_country, + transferin_document=transferin_document, + transferin_contract=transferin_contract, + transferin_identity_document=transferin_identity_document, + ) + + return buy_service_pec_domain_request_data diff --git a/src/shellrent_sdk/client/models/buy_service_pec_domain_request_data_legal_entity.py b/src/shellrent_sdk/client/models/buy_service_pec_domain_request_data_legal_entity.py new file mode 100644 index 0000000..5a28bad --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_pec_domain_request_data_legal_entity.py @@ -0,0 +1,13 @@ +from enum import StrEnum + + +class BuyServicePecDomainRequestDataLegalEntity(StrEnum): + AZIENDA = "AZIENDA" + DITTA_INDIVIDUALE = "DITTA_INDIVIDUALE" + LIBERO_PROFESSIONISTA = "LIBERO_PROFESSIONISTA" + NO_PROFIT = "NO_PROFIT" + PRIVATO = "PRIVATO" + PUBBLICA_AMMINISTRAZIONE = "PUBBLICA_AMMINISTRAZIONE" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/shellrent_sdk/client/models/buy_service_pec_request.py b/src/shellrent_sdk/client/models/buy_service_pec_request.py new file mode 100644 index 0000000..18a67ed --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_pec_request.py @@ -0,0 +1,81 @@ +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_pec_request_data import BuyServicePecRequestData + + +T = TypeVar("T", bound="BuyServicePecRequest") + + +@_attrs_define +class BuyServicePecRequest: + service_id: int + """ ID of the Service to buy """ + data: BuyServicePecRequestData + 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 + + data = self.data.to_dict() + + account_id = self.account_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "service_id": service_id, + "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_pec_request_data import BuyServicePecRequestData + + d = dict(src_dict) + service_id = d.pop("service_id") + + data = BuyServicePecRequestData.from_dict(d.pop("data")) + + account_id = d.pop("account_id", UNSET) + + buy_service_pec_request = cls( + service_id=service_id, + data=data, + 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 new file mode 100644 index 0000000..e8b7a27 --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_pec_request_data.py @@ -0,0 +1,298 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Self, TypeVar + +from attrs import define as _attrs_define + +from ..models.buy_service_pec_request_data_legal_entity import BuyServicePecRequestDataLegalEntity +from ..types import UNSET, Unset + +T = TypeVar("T", bound="BuyServicePecRequestData") + + +@_attrs_define +class BuyServicePecRequestData: + box_name: str + """ PEC mailbox local part, before the @ symbol """ + domain_select: int + """ ID of the PEC domain to associate to the mailbox """ + password_recovery_email: str + """ Email used for PEC password recovery """ + legal_entity: BuyServicePecRequestDataLegalEntity | Unset = UNSET + """ Legal entity of the PEC owner """ + owner: int | Unset = UNSET + """ Id of the PEC owner, if it already exists """ + admin_first_name: str | Unset = UNSET + """ First name of the PEC owner """ + admin_last_name: str | Unset = UNSET + """ Last name of the PEC owner """ + admin_email: str | Unset = UNSET + """ Email of the PEC owner """ + admin_fiscal_code: str | Unset = UNSET + """ Fiscal code of the PEC owner """ + admin_post_code: str | Unset = UNSET + """ Post code of the PEC owner """ + admin_address: str | Unset = UNSET + """ Address of the PEC owner """ + admin_city: str | Unset = UNSET + """ City of the PEC owner """ + admin_province: str | Unset = UNSET + """ Province of the PEC owner """ + admin_phone: str | Unset = UNSET + """ Phone of the PEC owner """ + cellphone: str | Unset = UNSET + """ Cellphone of the PEC owner """ + admin_pec_country: str | Unset = UNSET + """ Country of the PEC owner """ + company_name: str | Unset = UNSET + """ Name of the company """ + company_fiscal_code: str | Unset = UNSET + """ Fiscal code of the company """ + admin_vat_number: str | Unset = UNSET + """ Vat number of the company """ + company_email: str | Unset = UNSET + """ Email of the company """ + company_address: str | Unset = UNSET + """ Address of the company """ + company_post_code: str | Unset = UNSET + """ Post code of the company """ + company_city: str | Unset = UNSET + """ City of the company """ + company_province: str | Unset = UNSET + """ Province of the company """ + company_phone: str | Unset = UNSET + """ Phone of the company """ + company_pec_country: str | Unset = UNSET + """ Country of the company """ + transferin_document: int | Unset = UNSET + """ ID of the uploaded file (first file, extension: "pdf") Required only for transfer """ + transferin_contract: int | Unset = UNSET + """ ID of the uploaded file (first file, extension: "pdf") Required only for transfer """ + transferin_identity_document: int | Unset = UNSET + """ ID of the uploaded file (first file, extension: "pdf") Required only for transfer """ + + def to_dict(self) -> dict[str, Any]: + box_name = self.box_name + + domain_select = self.domain_select + + password_recovery_email = self.password_recovery_email + + legal_entity: str | Unset = UNSET + if not isinstance(self.legal_entity, Unset): + legal_entity = self.legal_entity.value + + owner = self.owner + + admin_first_name = self.admin_first_name + + admin_last_name = self.admin_last_name + + admin_email = self.admin_email + + admin_fiscal_code = self.admin_fiscal_code + + admin_post_code = self.admin_post_code + + admin_address = self.admin_address + + admin_city = self.admin_city + + admin_province = self.admin_province + + admin_phone = self.admin_phone + + cellphone = self.cellphone + + admin_pec_country = self.admin_pec_country + + company_name = self.company_name + + company_fiscal_code = self.company_fiscal_code + + admin_vat_number = self.admin_vat_number + + company_email = self.company_email + + company_address = self.company_address + + company_post_code = self.company_post_code + + company_city = self.company_city + + company_province = self.company_province + + company_phone = self.company_phone + + company_pec_country = self.company_pec_country + + transferin_document = self.transferin_document + + transferin_contract = self.transferin_contract + + transferin_identity_document = self.transferin_identity_document + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "box_name": box_name, + "domain_select": domain_select, + "password_recovery_email": password_recovery_email, + } + ) + if legal_entity is not UNSET: + field_dict["legal_entity"] = legal_entity + if owner is not UNSET: + field_dict["owner"] = owner + if admin_first_name is not UNSET: + field_dict["admin_first_name"] = admin_first_name + if admin_last_name is not UNSET: + field_dict["admin_last_name"] = admin_last_name + if admin_email is not UNSET: + field_dict["admin_email"] = admin_email + if admin_fiscal_code is not UNSET: + field_dict["admin_fiscal_code"] = admin_fiscal_code + if admin_post_code is not UNSET: + field_dict["admin_post_code"] = admin_post_code + if admin_address is not UNSET: + field_dict["admin_address"] = admin_address + if admin_city is not UNSET: + field_dict["admin_city"] = admin_city + if admin_province is not UNSET: + field_dict["admin_province"] = admin_province + if admin_phone is not UNSET: + field_dict["admin_phone"] = admin_phone + if cellphone is not UNSET: + field_dict["cellphone"] = cellphone + if admin_pec_country is not UNSET: + field_dict["admin_pec_country"] = admin_pec_country + if company_name is not UNSET: + field_dict["company_name"] = company_name + if company_fiscal_code is not UNSET: + field_dict["company_fiscal_code"] = company_fiscal_code + if admin_vat_number is not UNSET: + field_dict["admin_vat_number"] = admin_vat_number + if company_email is not UNSET: + field_dict["company_email"] = company_email + if company_address is not UNSET: + field_dict["company_address"] = company_address + if company_post_code is not UNSET: + field_dict["company_post_code"] = company_post_code + if company_city is not UNSET: + field_dict["company_city"] = company_city + if company_province is not UNSET: + field_dict["company_province"] = company_province + if company_phone is not UNSET: + field_dict["company_phone"] = company_phone + if company_pec_country is not UNSET: + field_dict["company_pec_country"] = company_pec_country + if transferin_document is not UNSET: + field_dict["transferin_document"] = transferin_document + if transferin_contract is not UNSET: + field_dict["transferin_contract"] = transferin_contract + if transferin_identity_document is not UNSET: + field_dict["transferin_identity_document"] = transferin_identity_document + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + box_name = d.pop("box_name") + + domain_select = d.pop("domain_select") + + password_recovery_email = d.pop("password_recovery_email") + + _legal_entity = d.pop("legal_entity", UNSET) + legal_entity: BuyServicePecRequestDataLegalEntity | Unset + if isinstance(_legal_entity, Unset): + legal_entity = UNSET + else: + legal_entity = BuyServicePecRequestDataLegalEntity(_legal_entity) + + owner = d.pop("owner", UNSET) + + admin_first_name = d.pop("admin_first_name", UNSET) + + admin_last_name = d.pop("admin_last_name", UNSET) + + admin_email = d.pop("admin_email", UNSET) + + admin_fiscal_code = d.pop("admin_fiscal_code", UNSET) + + admin_post_code = d.pop("admin_post_code", UNSET) + + admin_address = d.pop("admin_address", UNSET) + + admin_city = d.pop("admin_city", UNSET) + + admin_province = d.pop("admin_province", UNSET) + + admin_phone = d.pop("admin_phone", UNSET) + + cellphone = d.pop("cellphone", UNSET) + + admin_pec_country = d.pop("admin_pec_country", UNSET) + + company_name = d.pop("company_name", UNSET) + + company_fiscal_code = d.pop("company_fiscal_code", UNSET) + + admin_vat_number = d.pop("admin_vat_number", UNSET) + + company_email = d.pop("company_email", UNSET) + + company_address = d.pop("company_address", UNSET) + + company_post_code = d.pop("company_post_code", UNSET) + + company_city = d.pop("company_city", UNSET) + + company_province = d.pop("company_province", UNSET) + + company_phone = d.pop("company_phone", UNSET) + + company_pec_country = d.pop("company_pec_country", UNSET) + + transferin_document = d.pop("transferin_document", UNSET) + + transferin_contract = d.pop("transferin_contract", UNSET) + + transferin_identity_document = d.pop("transferin_identity_document", UNSET) + + buy_service_pec_request_data = cls( + box_name=box_name, + domain_select=domain_select, + password_recovery_email=password_recovery_email, + legal_entity=legal_entity, + owner=owner, + admin_first_name=admin_first_name, + admin_last_name=admin_last_name, + admin_email=admin_email, + admin_fiscal_code=admin_fiscal_code, + admin_post_code=admin_post_code, + admin_address=admin_address, + admin_city=admin_city, + admin_province=admin_province, + admin_phone=admin_phone, + cellphone=cellphone, + admin_pec_country=admin_pec_country, + company_name=company_name, + company_fiscal_code=company_fiscal_code, + admin_vat_number=admin_vat_number, + company_email=company_email, + company_address=company_address, + company_post_code=company_post_code, + company_city=company_city, + company_province=company_province, + company_phone=company_phone, + company_pec_country=company_pec_country, + transferin_document=transferin_document, + transferin_contract=transferin_contract, + transferin_identity_document=transferin_identity_document, + ) + + return buy_service_pec_request_data diff --git a/src/shellrent_sdk/client/models/buy_service_pec_request_data_legal_entity.py b/src/shellrent_sdk/client/models/buy_service_pec_request_data_legal_entity.py new file mode 100644 index 0000000..5204935 --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_pec_request_data_legal_entity.py @@ -0,0 +1,13 @@ +from enum import StrEnum + + +class BuyServicePecRequestDataLegalEntity(StrEnum): + AZIENDA = "AZIENDA" + DITTA_INDIVIDUALE = "DITTA_INDIVIDUALE" + LIBERO_PROFESSIONISTA = "LIBERO_PROFESSIONISTA" + NO_PROFIT = "NO_PROFIT" + PRIVATO = "PRIVATO" + PUBBLICA_AMMINISTRAZIONE = "PUBBLICA_AMMINISTRAZIONE" + + def __str__(self) -> str: + return str(self.value) 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 new file mode 100644 index 0000000..1ac073d --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_plesk_license_request.py @@ -0,0 +1,84 @@ +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_plesk_license_request_data import BuyServicePleskLicenseRequestData + + +T = TypeVar("T", bound="BuyServicePleskLicenseRequest") + + +@_attrs_define +class BuyServicePleskLicenseRequest: + service_id: int + """ ID of the Service to buy """ + data: BuyServicePleskLicenseRequestData + """ 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 + + data = self.data.to_dict() + + account_id = self.account_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "service_id": service_id, + "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_plesk_license_request_data import ( + BuyServicePleskLicenseRequestData, + ) + + d = dict(src_dict) + service_id = d.pop("service_id") + + data = BuyServicePleskLicenseRequestData.from_dict(d.pop("data")) + + account_id = d.pop("account_id", UNSET) + + buy_service_plesk_license_request = cls( + service_id=service_id, + data=data, + 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 new file mode 100644 index 0000000..9351dbf --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_plesk_license_request_data.py @@ -0,0 +1,72 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Self, TypeVar + +from attrs import define as _attrs_define + +from ..models.buy_service_plesk_license_request_data_installation_type import ( + BuyServicePleskLicenseRequestDataInstallationType, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="BuyServicePleskLicenseRequestData") + + +@_attrs_define +class BuyServicePleskLicenseRequestData: + """Details about where to install the license""" + + installation_type: BuyServicePleskLicenseRequestDataInstallationType | Unset = UNSET + """ 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 + "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 + + purchase_server = self.purchase_server + + ip_address = self.ip_address + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if installation_type is not UNSET: + field_dict["installation_type"] = installation_type + if purchase_server is not UNSET: + field_dict["purchase_server"] = purchase_server + if ip_address is not UNSET: + field_dict["ip_address"] = ip_address + + return field_dict + + @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 + ) + + purchase_server = d.pop("purchase_server", UNSET) + + ip_address = d.pop("ip_address", UNSET) + + buy_service_plesk_license_request_data = cls( + installation_type=installation_type, + purchase_server=purchase_server, + ip_address=ip_address, + ) + + return buy_service_plesk_license_request_data diff --git a/src/shellrent_sdk/client/models/buy_service_plesk_license_request_data_installation_type.py b/src/shellrent_sdk/client/models/buy_service_plesk_license_request_data_installation_type.py new file mode 100644 index 0000000..7d05360 --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_plesk_license_request_data_installation_type.py @@ -0,0 +1,9 @@ +from enum import StrEnum + + +class BuyServicePleskLicenseRequestDataInstallationType(StrEnum): + EXTERNAL_INSTALLATION_TYPE = "external_installation_type" + INTERNAL_INSTALLATION_TYPE = "internal_installation_type" + + def __str__(self) -> str: + return str(self.value) 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 new file mode 100644 index 0000000..a3d8727 --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_private_cloud_sv_request.py @@ -0,0 +1,94 @@ +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_private_cloud_sv_request_data import ( + BuyServicePrivateCloudSvRequestData, + ) + + +T = TypeVar("T", bound="BuyServicePrivateCloudSvRequest") + + +@_attrs_define +class BuyServicePrivateCloudSvRequest: + service_id: int + """ 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) """ + 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 + + account_id = self.account_id + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "service_id": service_id, + } + ) + if account_id is not UNSET: + field_dict["account_id"] = account_id + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.buy_service_private_cloud_sv_request_data import ( + BuyServicePrivateCloudSvRequestData, + ) + + d = dict(src_dict) + service_id = d.pop("service_id") + + account_id = d.pop("account_id", UNSET) + + _data = d.pop("data", UNSET) + data: BuyServicePrivateCloudSvRequestData | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = BuyServicePrivateCloudSvRequestData.from_dict(_data) + + buy_service_private_cloud_sv_request = cls( + service_id=service_id, + account_id=account_id, + 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 new file mode 100644 index 0000000..41d8299 --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_private_cloud_sv_request_data.py @@ -0,0 +1,64 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Self, TypeVar + +from attrs import define as _attrs_define + +from ..models.buy_service_private_cloud_sv_request_data_additionalbackupdiskservicequantity import ( + BuyServicePrivateCloudSvRequestDataADDITIONALBACKUPDISKSERVICEQUANTITY, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="BuyServicePrivateCloudSvRequestData") + + +@_attrs_define +class BuyServicePrivateCloudSvRequestData: + """Private Cloud SV configuration options""" + + additional_backup_disk_service_quantity: ( + BuyServicePrivateCloudSvRequestDataADDITIONALBACKUPDISKSERVICEQUANTITY | Unset + ) = BuyServicePrivateCloudSvRequestDataADDITIONALBACKUPDISKSERVICEQUANTITY.VALUE_1 + """ Choose to configure the Private Cloud with or without additional backup disk """ + + def to_dict(self) -> dict[str, Any]: + additional_backup_disk_service_quantity: int | Unset = UNSET + if not isinstance(self.additional_backup_disk_service_quantity, Unset): + additional_backup_disk_service_quantity = ( + self.additional_backup_disk_service_quantity.value + ) + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if additional_backup_disk_service_quantity is not UNSET: + field_dict["ADDITIONAL_BACKUP_DISK_SERVICE_QUANTITY"] = ( + additional_backup_disk_service_quantity + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + _additional_backup_disk_service_quantity = d.pop( + "ADDITIONAL_BACKUP_DISK_SERVICE_QUANTITY", UNSET + ) + additional_backup_disk_service_quantity: ( + BuyServicePrivateCloudSvRequestDataADDITIONALBACKUPDISKSERVICEQUANTITY | Unset + ) + if isinstance(_additional_backup_disk_service_quantity, Unset): + additional_backup_disk_service_quantity = UNSET + else: + additional_backup_disk_service_quantity = ( + BuyServicePrivateCloudSvRequestDataADDITIONALBACKUPDISKSERVICEQUANTITY( + _additional_backup_disk_service_quantity + ) + ) + + buy_service_private_cloud_sv_request_data = cls( + additional_backup_disk_service_quantity=additional_backup_disk_service_quantity, + ) + + return buy_service_private_cloud_sv_request_data diff --git a/src/shellrent_sdk/client/models/buy_service_private_cloud_sv_request_data_additionalbackupdiskservicequantity.py b/src/shellrent_sdk/client/models/buy_service_private_cloud_sv_request_data_additionalbackupdiskservicequantity.py new file mode 100644 index 0000000..2f732dc --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_private_cloud_sv_request_data_additionalbackupdiskservicequantity.py @@ -0,0 +1,9 @@ +from enum import IntEnum + + +class BuyServicePrivateCloudSvRequestDataADDITIONALBACKUPDISKSERVICEQUANTITY(IntEnum): + VALUE_0 = 0 + VALUE_1 = 1 + + def __str__(self) -> str: + return str(self.value) 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 new file mode 100644 index 0000000..2afdb51 --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_securemail_for_google_workspace_request.py @@ -0,0 +1,93 @@ +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 new file mode 100644 index 0000000..696f792 --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_securemail_for_google_workspace_request_configuration.py @@ -0,0 +1,40 @@ +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 new file mode 100644 index 0000000..2b49c99 --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_securemail_for_google_workspace_request_data.py @@ -0,0 +1,62 @@ +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 new file mode 100644 index 0000000..32ceae5 --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_securemail_for_microsoft_365_request.py @@ -0,0 +1,93 @@ +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 new file mode 100644 index 0000000..c196a3b --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_securemail_for_microsoft_365_request_configuration.py @@ -0,0 +1,40 @@ +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 new file mode 100644 index 0000000..c93f21d --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_securemail_for_microsoft_365_request_data.py @@ -0,0 +1,70 @@ +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 new file mode 100644 index 0000000..9dc92b7 --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_securemail_request.py @@ -0,0 +1,78 @@ +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 new file mode 100644 index 0000000..6bfa17d --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_securemail_request_configuration.py @@ -0,0 +1,40 @@ +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 new file mode 100644 index 0000000..7c4e1df --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_sms_request.py @@ -0,0 +1,68 @@ +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 + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="BuyServiceSmsRequest") + + +@_attrs_define +class BuyServiceSmsRequest: + service_id: int + """ 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 + + account_id = self.account_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "service_id": service_id, + } + ) + 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: + d = dict(src_dict) + service_id = d.pop("service_id") + + account_id = d.pop("account_id", UNSET) + + buy_service_sms_request = cls( + service_id=service_id, + 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 new file mode 100644 index 0000000..817db9e --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_ssl_certificate_request.py @@ -0,0 +1,86 @@ +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_ssl_certificate_request_data import ( + BuyServiceSslCertificateRequestData, + ) + + +T = TypeVar("T", bound="BuyServiceSslCertificateRequest") + + +@_attrs_define +class BuyServiceSslCertificateRequest: + service_id: int + """ ID of the Service to buy """ + data: BuyServiceSslCertificateRequestData + """ 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 + + data = self.data.to_dict() + + account_id = self.account_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "service_id": service_id, + "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_ssl_certificate_request_data import ( + BuyServiceSslCertificateRequestData, + ) + + d = dict(src_dict) + service_id = d.pop("service_id") + + data = BuyServiceSslCertificateRequestData.from_dict(d.pop("data")) + + account_id = d.pop("account_id", UNSET) + + buy_service_ssl_certificate_request = cls( + service_id=service_id, + data=data, + 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 new file mode 100644 index 0000000..58bb213 --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_ssl_certificate_request_data.py @@ -0,0 +1,194 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Self, TypeVar, cast + +from attrs import define as _attrs_define + +from ..models.buy_service_ssl_certificate_request_data_admin_role import ( + BuyServiceSslCertificateRequestDataAdminRole, +) +from ..models.buy_service_ssl_certificate_request_data_admin_title import ( + BuyServiceSslCertificateRequestDataAdminTitle, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="BuyServiceSslCertificateRequestData") + + +@_attrs_define +class BuyServiceSslCertificateRequestData: + """Details required to issue the SSL/TLS Certificate""" + + domain: str + """ Main domain for the SSL Certificate """ + approver_email: str + """ One of the email addresses accepted as "approver" email for the SSL Certificate validation """ + admin_role: BuyServiceSslCertificateRequestDataAdminRole + admin_title: BuyServiceSslCertificateRequestDataAdminTitle + admin_first_name: str + admin_last_name: str + admin_email: str + admin_organization: str + admin_phone_cc: str + """ Country code phone prefix without leading "0" and without leading "+" sign; ie. "44" for UK or "39" for + Italy """ + admin_phone_n: str + """ Phone number without country code phone prefix """ + admin_address: str + admin_city: str + admin_state: str + """ State/Province """ + admin_postcode: str + admin_country: str + """ ISO country code with 2 letters; ie. "IT" for Italy, "ES" for Spain """ + csr: None | 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 + """ 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. """ + + def to_dict(self) -> dict[str, Any]: + domain = self.domain + + approver_email = self.approver_email + + admin_role = self.admin_role.value + + admin_title = self.admin_title.value + + 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_n = self.admin_phone_n + + admin_address = self.admin_address + + admin_city = self.admin_city + + admin_state = self.admin_state + + admin_postcode = self.admin_postcode + + admin_country = self.admin_country + + csr: None | str | Unset + if isinstance(self.csr, Unset): + csr = UNSET + else: + csr = self.csr + + private_key: None | str | Unset + if isinstance(self.private_key, Unset): + private_key = UNSET + else: + private_key = self.private_key + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "domain": domain, + "approver_email": approver_email, + "admin_role": admin_role, + "admin_title": admin_title, + "admin_first_name": admin_first_name, + "admin_last_name": admin_last_name, + "admin_email": admin_email, + "admin_organization": admin_organization, + "admin_phone_cc": admin_phone_cc, + "admin_phone_n": admin_phone_n, + "admin_address": admin_address, + "admin_city": admin_city, + "admin_state": admin_state, + "admin_postcode": admin_postcode, + "admin_country": admin_country, + } + ) + if csr is not UNSET: + field_dict["csr"] = csr + if private_key is not UNSET: + field_dict["private_key"] = private_key + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + domain = d.pop("domain") + + approver_email = d.pop("approver_email") + + admin_role = BuyServiceSslCertificateRequestDataAdminRole(d.pop("admin_role")) + + admin_title = BuyServiceSslCertificateRequestDataAdminTitle(d.pop("admin_title")) + + admin_first_name = d.pop("admin_first_name") + + admin_last_name = d.pop("admin_last_name") + + admin_email = d.pop("admin_email") + + admin_organization = d.pop("admin_organization") + + admin_phone_cc = d.pop("admin_phone_cc") + + admin_phone_n = d.pop("admin_phone_n") + + admin_address = d.pop("admin_address") + + admin_city = d.pop("admin_city") + + admin_state = d.pop("admin_state") + + admin_postcode = d.pop("admin_postcode") + + 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 = _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)) + + buy_service_ssl_certificate_request_data = cls( + domain=domain, + approver_email=approver_email, + admin_role=admin_role, + admin_title=admin_title, + admin_first_name=admin_first_name, + admin_last_name=admin_last_name, + admin_email=admin_email, + admin_organization=admin_organization, + admin_phone_cc=admin_phone_cc, + admin_phone_n=admin_phone_n, + admin_address=admin_address, + admin_city=admin_city, + admin_state=admin_state, + admin_postcode=admin_postcode, + admin_country=admin_country, + csr=csr, + private_key=private_key, + ) + + return buy_service_ssl_certificate_request_data diff --git a/src/shellrent_sdk/client/models/buy_service_ssl_certificate_request_data_admin_role.py b/src/shellrent_sdk/client/models/buy_service_ssl_certificate_request_data_admin_role.py new file mode 100644 index 0000000..0763479 --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_ssl_certificate_request_data_admin_role.py @@ -0,0 +1,11 @@ +from enum import StrEnum + + +class BuyServiceSslCertificateRequestDataAdminRole(StrEnum): + BUSINESS_OWNER = "Business Owner" + COMPANY_DIRECTOR = "Company Director" + PRESIDENT = "President" + WEBSITE_OWNER = "Website Owner" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/shellrent_sdk/client/models/buy_service_ssl_certificate_request_data_admin_title.py b/src/shellrent_sdk/client/models/buy_service_ssl_certificate_request_data_admin_title.py new file mode 100644 index 0000000..8574133 --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_ssl_certificate_request_data_admin_title.py @@ -0,0 +1,13 @@ +from enum import StrEnum + + +class BuyServiceSslCertificateRequestDataAdminTitle(StrEnum): + DR = "Dr" + MISS = "Miss" + MR = "Mr" + MRS = "Mrs" + MS = "Ms" + REV = "Rev" + + def __str__(self) -> str: + return str(self.value) 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 new file mode 100644 index 0000000..a256080 --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_veeam_baas_request.py @@ -0,0 +1,78 @@ +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_veeam_baas_request_configuration import ( + BuyServiceVeeamBaasRequestConfiguration, + ) + + +T = TypeVar("T", bound="BuyServiceVeeamBaasRequest") + + +@_attrs_define +class BuyServiceVeeamBaasRequest: + configuration: BuyServiceVeeamBaasRequestConfiguration + """ Veeam BaaS 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_veeam_baas_request_configuration import ( + BuyServiceVeeamBaasRequestConfiguration, + ) + + d = dict(src_dict) + configuration = BuyServiceVeeamBaasRequestConfiguration.from_dict(d.pop("configuration")) + + account_id = d.pop("account_id", UNSET) + + buy_service_veeam_baas_request = cls( + configuration=configuration, + 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 new file mode 100644 index 0000000..9b5fbc1 --- /dev/null +++ b/src/shellrent_sdk/client/models/buy_service_veeam_baas_request_configuration.py @@ -0,0 +1,149 @@ +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="BuyServiceVeeamBaasRequestConfiguration") + + +@_attrs_define +class BuyServiceVeeamBaasRequestConfiguration: + """Veeam BaaS configuration options""" + + cloud_connect_gb: int | Unset = UNSET + """ Veeam Cloud Connect storage: quantity (in GB) of storage. """ + agent_server: int | Unset = UNSET + """ Veeam Agent: number of "Server" workloads. """ + agent_workstation: int | Unset = UNSET + """ Veeam Agent: number of "Workstation" workloads. """ + vbr_entplus_vm: int | Unset = UNSET + """ Veeam Backup & Replication (VBR) Enterprise Plus: number of "VM in VMware/Hyper-V" workloads. """ + vbr_entplus_server: int | Unset = UNSET + """ Veeam Backup & Replication (VBR) Enterprise Plus: number of "Server" workloads. """ + 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. """ + 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 + """ Veeam Backup & Replication (VBR) Standard: number of "Server" workloads. """ + 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. """ + cc_license_vm: int | Unset = UNSET + """ Veeam Cloud Connect license: number of "VM in VMware/Hyper-V" workloads. """ + cc_license_server: int | Unset = UNSET + """ Veeam Cloud Connect license: number of "Server" workloads. """ + + def to_dict(self) -> dict[str, Any]: + cloud_connect_gb = self.cloud_connect_gb + + agent_server = self.agent_server + + agent_workstation = self.agent_workstation + + vbr_entplus_vm = self.vbr_entplus_vm + + vbr_entplus_server = self.vbr_entplus_server + + vbr_entplus_workstation = self.vbr_entplus_workstation + + vbr_entplus_gb = self.vbr_entplus_gb + + vbr_standard_vm = self.vbr_standard_vm + + vbr_standard_server = self.vbr_standard_server + + vbr_standard_workstation = self.vbr_standard_workstation + + vb365_users = self.vb365_users + + cc_license_vm = self.cc_license_vm + + cc_license_server = self.cc_license_server + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if cloud_connect_gb is not UNSET: + field_dict["cloud_connect_gb"] = cloud_connect_gb + if agent_server is not UNSET: + field_dict["agent_server"] = agent_server + if agent_workstation is not UNSET: + field_dict["agent_workstation"] = agent_workstation + if vbr_entplus_vm is not UNSET: + field_dict["vbr_entplus_vm"] = vbr_entplus_vm + if vbr_entplus_server is not UNSET: + field_dict["vbr_entplus_server"] = vbr_entplus_server + if vbr_entplus_workstation is not UNSET: + field_dict["vbr_entplus_workstation"] = vbr_entplus_workstation + if vbr_entplus_gb is not UNSET: + field_dict["vbr_entplus_gb"] = vbr_entplus_gb + if vbr_standard_vm is not UNSET: + field_dict["vbr_standard_vm"] = vbr_standard_vm + if vbr_standard_server is not UNSET: + field_dict["vbr_standard_server"] = vbr_standard_server + if vbr_standard_workstation is not UNSET: + field_dict["vbr_standard_workstation"] = vbr_standard_workstation + if vb365_users is not UNSET: + field_dict["vb365_users"] = vb365_users + if cc_license_vm is not UNSET: + field_dict["cc_license_vm"] = cc_license_vm + if cc_license_server is not UNSET: + field_dict["cc_license_server"] = cc_license_server + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + cloud_connect_gb = d.pop("cloud_connect_gb", UNSET) + + agent_server = d.pop("agent_server", UNSET) + + agent_workstation = d.pop("agent_workstation", UNSET) + + vbr_entplus_vm = d.pop("vbr_entplus_vm", UNSET) + + vbr_entplus_server = d.pop("vbr_entplus_server", UNSET) + + vbr_entplus_workstation = d.pop("vbr_entplus_workstation", UNSET) + + vbr_entplus_gb = d.pop("vbr_entplus_gb", UNSET) + + vbr_standard_vm = d.pop("vbr_standard_vm", UNSET) + + vbr_standard_server = d.pop("vbr_standard_server", UNSET) + + vbr_standard_workstation = d.pop("vbr_standard_workstation", UNSET) + + vb365_users = d.pop("vb365_users", UNSET) + + cc_license_vm = d.pop("cc_license_vm", UNSET) + + cc_license_server = d.pop("cc_license_server", UNSET) + + buy_service_veeam_baas_request_configuration = cls( + cloud_connect_gb=cloud_connect_gb, + agent_server=agent_server, + agent_workstation=agent_workstation, + vbr_entplus_vm=vbr_entplus_vm, + vbr_entplus_server=vbr_entplus_server, + vbr_entplus_workstation=vbr_entplus_workstation, + vbr_entplus_gb=vbr_entplus_gb, + vbr_standard_vm=vbr_standard_vm, + vbr_standard_server=vbr_standard_server, + vbr_standard_workstation=vbr_standard_workstation, + vb365_users=vb365_users, + cc_license_vm=cc_license_vm, + cc_license_server=cc_license_server, + ) + + return buy_service_veeam_baas_request_configuration diff --git a/src/shellrent_sdk/client/models/cloud_storage.py b/src/shellrent_sdk/client/models/cloud_storage.py new file mode 100644 index 0000000..6a2c9c1 --- /dev/null +++ b/src/shellrent_sdk/client/models/cloud_storage.py @@ -0,0 +1,159 @@ +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="CloudStorage") + + +@_attrs_define +class CloudStorage: + cloud_storage_id: int + purchase_id: int | None + name: None | str + read_write_host: None | str + read_only_host: None | str + app_host: None | str + group_disk_used_bytes: int | None + date_sync: datetime.datetime | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + cloud_storage_id = self.cloud_storage_id + + purchase_id: int | None + purchase_id = self.purchase_id + + name: None | str + name = self.name + + read_write_host: None | str + read_write_host = self.read_write_host + + read_only_host: None | str + read_only_host = self.read_only_host + + app_host: None | str + app_host = self.app_host + + group_disk_used_bytes: int | None + group_disk_used_bytes = self.group_disk_used_bytes + + date_sync: None | str + if isinstance(self.date_sync, datetime.datetime): + date_sync = self.date_sync.isoformat() + else: + date_sync = self.date_sync + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "cloud_storage_id": cloud_storage_id, + "purchase_id": purchase_id, + "name": name, + "read_write_host": read_write_host, + "read_only_host": read_only_host, + "app_host": app_host, + "group_disk_used_bytes": group_disk_used_bytes, + "date_sync": date_sync, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + cloud_storage_id = d.pop("cloud_storage_id") + + def _parse_purchase_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + purchase_id = _parse_purchase_id(d.pop("purchase_id")) + + def _parse_name(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + name = _parse_name(d.pop("name")) + + def _parse_read_write_host(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + read_write_host = _parse_read_write_host(d.pop("read_write_host")) + + def _parse_read_only_host(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + read_only_host = _parse_read_only_host(d.pop("read_only_host")) + + def _parse_app_host(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + app_host = _parse_app_host(d.pop("app_host")) + + def _parse_group_disk_used_bytes(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + group_disk_used_bytes = _parse_group_disk_used_bytes(d.pop("group_disk_used_bytes")) + + def _parse_date_sync(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + date_sync_type_0 = datetime.datetime.fromisoformat(data) + + return date_sync_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + date_sync = _parse_date_sync(d.pop("date_sync")) + + cloud_storage = cls( + cloud_storage_id=cloud_storage_id, + purchase_id=purchase_id, + name=name, + read_write_host=read_write_host, + read_only_host=read_only_host, + app_host=app_host, + group_disk_used_bytes=group_disk_used_bytes, + date_sync=date_sync, + ) + + cloud_storage.additional_properties = d + return cloud_storage + + @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.py b/src/shellrent_sdk/client/models/cloud_storage_access.py new file mode 100644 index 0000000..8ad0390 --- /dev/null +++ b/src/shellrent_sdk/client/models/cloud_storage_access.py @@ -0,0 +1,89 @@ +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="CloudStorageAccess") + + +@_attrs_define +class CloudStorageAccess: + access_id: str + cloud_storage_id: int + hostname: None | str + username: None | str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + access_id = self.access_id + + cloud_storage_id = self.cloud_storage_id + + hostname: None | str + hostname = self.hostname + + username: None | str + username = self.username + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "access_id": access_id, + "cloud_storage_id": cloud_storage_id, + "hostname": hostname, + "username": username, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + access_id = d.pop("access_id") + + cloud_storage_id = d.pop("cloud_storage_id") + + def _parse_hostname(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + hostname = _parse_hostname(d.pop("hostname")) + + def _parse_username(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + username = _parse_username(d.pop("username")) + + cloud_storage_access = cls( + access_id=access_id, + cloud_storage_id=cloud_storage_id, + hostname=hostname, + username=username, + ) + + cloud_storage_access.additional_properties = d + return cloud_storage_access + + @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_create_request.py b/src/shellrent_sdk/client/models/cloud_storage_access_create_request.py new file mode 100644 index 0000000..b876c75 --- /dev/null +++ b/src/shellrent_sdk/client/models/cloud_storage_access_create_request.py @@ -0,0 +1,64 @@ +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 + +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) + + def to_dict(self) -> dict[str, Any]: + hostname = self.hostname + + 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 + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + hostname = d.pop("hostname", UNSET) + + username = d.pop("username", UNSET) + + 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 new file mode 100644 index 0000000..67383d0 --- /dev/null +++ b/src/shellrent_sdk/client/models/cloud_storage_access_paginated_list_response.py @@ -0,0 +1,99 @@ +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.cloud_storage_access import CloudStorageAccess + from ..models.pagination_meta import PaginationMeta + + +T = TypeVar("T", bound="CloudStorageAccessPaginatedListResponse") + + +@_attrs_define +class CloudStorageAccessPaginatedListResponse: + error: int + message: None | str + data: list[CloudStorageAccess] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.cloud_storage_access import CloudStorageAccess + from ..models.pagination_meta import PaginationMeta + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = CloudStorageAccess.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + cloud_storage_access_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + cloud_storage_access_paginated_list_response.additional_properties = d + return cloud_storage_access_paginated_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/cloud_storage_access_response.py b/src/shellrent_sdk/client/models/cloud_storage_access_response.py new file mode 100644 index 0000000..da2eae6 --- /dev/null +++ b/src/shellrent_sdk/client/models/cloud_storage_access_response.py @@ -0,0 +1,116 @@ +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.cloud_storage_access import CloudStorageAccess + from ..models.cloud_storage_access_response_meta_type_0 import ( + CloudStorageAccessResponseMetaType0, + ) + + +T = TypeVar("T", bound="CloudStorageAccessResponse") + + +@_attrs_define +class CloudStorageAccessResponse: + error: int + message: None | str + data: CloudStorageAccess + meta: CloudStorageAccessResponseMetaType0 | None + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, CloudStorageAccessResponseMetaType0): + 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.cloud_storage_access import CloudStorageAccess + from ..models.cloud_storage_access_response_meta_type_0 import ( + CloudStorageAccessResponseMetaType0, + ) + + 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 = 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")) + + cloud_storage_access_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + cloud_storage_access_response.additional_properties = d + return cloud_storage_access_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/cloud_storage_access_response_meta_type_0.py b/src/shellrent_sdk/client/models/cloud_storage_access_response_meta_type_0.py new file mode 100644 index 0000000..0fb2d25 --- /dev/null +++ b/src/shellrent_sdk/client/models/cloud_storage_access_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..b4bdbc1 --- /dev/null +++ b/src/shellrent_sdk/client/models/cloud_storage_paginated_list_response.py @@ -0,0 +1,99 @@ +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.cloud_storage import CloudStorage + from ..models.pagination_meta import PaginationMeta + + +T = TypeVar("T", bound="CloudStoragePaginatedListResponse") + + +@_attrs_define +class CloudStoragePaginatedListResponse: + error: int + message: None | str + data: list[CloudStorage] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.cloud_storage import CloudStorage + from ..models.pagination_meta import PaginationMeta + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = CloudStorage.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + cloud_storage_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + cloud_storage_paginated_list_response.additional_properties = d + return cloud_storage_paginated_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/cloud_storage_response.py b/src/shellrent_sdk/client/models/cloud_storage_response.py new file mode 100644 index 0000000..f365298 --- /dev/null +++ b/src/shellrent_sdk/client/models/cloud_storage_response.py @@ -0,0 +1,112 @@ +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.cloud_storage import CloudStorage + from ..models.cloud_storage_response_meta_type_0 import CloudStorageResponseMetaType0 + + +T = TypeVar("T", bound="CloudStorageResponse") + + +@_attrs_define +class CloudStorageResponse: + error: int + message: None | str + data: CloudStorage + meta: CloudStorageResponseMetaType0 | None + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, CloudStorageResponseMetaType0): + 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.cloud_storage import CloudStorage + from ..models.cloud_storage_response_meta_type_0 import ( + CloudStorageResponseMetaType0, + ) + + 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 = 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")) + + cloud_storage_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + cloud_storage_response.additional_properties = d + return cloud_storage_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/cloud_storage_response_meta_type_0.py b/src/shellrent_sdk/client/models/cloud_storage_response_meta_type_0.py new file mode 100644 index 0000000..073c24f --- /dev/null +++ b/src/shellrent_sdk/client/models/cloud_storage_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..cd259c2 --- /dev/null +++ b/src/shellrent_sdk/client/models/cloud_storage_user.py @@ -0,0 +1,231 @@ +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="CloudStorageUser") + + +@_attrs_define +class CloudStorageUser: + cloud_storage_user_id: int + cloud_storage_id: int + purchase_id: int | None + type_: None | str + username: None | str + password: None | str + path: None | str + soft_quota_gb: float | None + hard_quota_gb: float | None + used_space_bytes: int | None + allocated_space_bytes: int | None + grace_period_seconds: int | None + last_alert: datetime.datetime | None + active: bool | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + cloud_storage_user_id = self.cloud_storage_user_id + + cloud_storage_id = self.cloud_storage_id + + purchase_id: int | None + purchase_id = self.purchase_id + + type_: None | str + type_ = self.type_ + + username: None | str + username = self.username + + password: None | str + password = self.password + + path: None | str + path = self.path + + soft_quota_gb: float | None + soft_quota_gb = self.soft_quota_gb + + hard_quota_gb: float | None + hard_quota_gb = self.hard_quota_gb + + used_space_bytes: int | None + used_space_bytes = self.used_space_bytes + + allocated_space_bytes: int | None + allocated_space_bytes = self.allocated_space_bytes + + grace_period_seconds: int | None + grace_period_seconds = self.grace_period_seconds + + last_alert: None | str + if isinstance(self.last_alert, datetime.datetime): + last_alert = self.last_alert.isoformat() + else: + last_alert = self.last_alert + + active: bool | None + active = self.active + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "cloud_storage_user_id": cloud_storage_user_id, + "cloud_storage_id": cloud_storage_id, + "purchase_id": purchase_id, + "type": type_, + "username": username, + "password": password, + "path": path, + "soft_quota_gb": soft_quota_gb, + "hard_quota_gb": hard_quota_gb, + "used_space_bytes": used_space_bytes, + "allocated_space_bytes": allocated_space_bytes, + "grace_period_seconds": grace_period_seconds, + "last_alert": last_alert, + "active": active, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + cloud_storage_user_id = d.pop("cloud_storage_user_id") + + cloud_storage_id = d.pop("cloud_storage_id") + + def _parse_purchase_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + purchase_id = _parse_purchase_id(d.pop("purchase_id")) + + def _parse_type_(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + type_ = _parse_type_(d.pop("type")) + + 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_password(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + password = _parse_password(d.pop("password")) + + def _parse_path(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + path = _parse_path(d.pop("path")) + + def _parse_soft_quota_gb(data: object) -> float | None: + if data is None: + return data + return cast(float | None, data) + + soft_quota_gb = _parse_soft_quota_gb(d.pop("soft_quota_gb")) + + def _parse_hard_quota_gb(data: object) -> float | None: + if data is None: + return data + return cast(float | None, data) + + hard_quota_gb = _parse_hard_quota_gb(d.pop("hard_quota_gb")) + + def _parse_used_space_bytes(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + used_space_bytes = _parse_used_space_bytes(d.pop("used_space_bytes")) + + def _parse_allocated_space_bytes(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + allocated_space_bytes = _parse_allocated_space_bytes(d.pop("allocated_space_bytes")) + + def _parse_grace_period_seconds(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + grace_period_seconds = _parse_grace_period_seconds(d.pop("grace_period_seconds")) + + def _parse_last_alert(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + last_alert_type_0 = datetime.datetime.fromisoformat(data) + + return last_alert_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + last_alert = _parse_last_alert(d.pop("last_alert")) + + def _parse_active(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) + + active = _parse_active(d.pop("active")) + + cloud_storage_user = cls( + cloud_storage_user_id=cloud_storage_user_id, + cloud_storage_id=cloud_storage_id, + purchase_id=purchase_id, + type_=type_, + username=username, + password=password, + path=path, + soft_quota_gb=soft_quota_gb, + hard_quota_gb=hard_quota_gb, + used_space_bytes=used_space_bytes, + allocated_space_bytes=allocated_space_bytes, + grace_period_seconds=grace_period_seconds, + last_alert=last_alert, + active=active, + ) + + cloud_storage_user.additional_properties = d + return cloud_storage_user + + @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_list_response.py b/src/shellrent_sdk/client/models/cloud_storage_user_list_response.py new file mode 100644 index 0000000..907f762 --- /dev/null +++ b/src/shellrent_sdk/client/models/cloud_storage_user_list_response.py @@ -0,0 +1,124 @@ +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.cloud_storage_user import CloudStorageUser + from ..models.cloud_storage_user_list_response_meta_type_0 import ( + CloudStorageUserListResponseMetaType0, + ) + + +T = TypeVar("T", bound="CloudStorageUserListResponse") + + +@_attrs_define +class CloudStorageUserListResponse: + error: int + message: None | str + data: list[CloudStorageUser] + meta: CloudStorageUserListResponseMetaType0 | None + 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 + message = self.message + + data = [] + for data_item_data in self.data: + 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 + + 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.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") + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = CloudStorageUser.from_dict(data_item_data) + + 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")) + + cloud_storage_user_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + cloud_storage_user_list_response.additional_properties = d + return cloud_storage_user_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/cloud_storage_user_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/cloud_storage_user_list_response_meta_type_0.py new file mode 100644 index 0000000..70bc396 --- /dev/null +++ b/src/shellrent_sdk/client/models/cloud_storage_user_list_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..7c2d679 --- /dev/null +++ b/src/shellrent_sdk/client/models/cloud_storage_user_response.py @@ -0,0 +1,114 @@ +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.cloud_storage_user import CloudStorageUser + from ..models.cloud_storage_user_response_meta_type_0 import CloudStorageUserResponseMetaType0 + + +T = TypeVar("T", bound="CloudStorageUserResponse") + + +@_attrs_define +class CloudStorageUserResponse: + error: int + message: None | str + data: CloudStorageUser + meta: CloudStorageUserResponseMetaType0 | None + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, CloudStorageUserResponseMetaType0): + 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.cloud_storage_user import CloudStorageUser + from ..models.cloud_storage_user_response_meta_type_0 import ( + CloudStorageUserResponseMetaType0, + ) + + 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 = 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")) + + cloud_storage_user_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + cloud_storage_user_response.additional_properties = d + return cloud_storage_user_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/cloud_storage_user_response_meta_type_0.py b/src/shellrent_sdk/client/models/cloud_storage_user_response_meta_type_0.py new file mode 100644 index 0000000..375e872 --- /dev/null +++ b/src/shellrent_sdk/client/models/cloud_storage_user_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..5595e68 --- /dev/null +++ b/src/shellrent_sdk/client/models/cloud_storage_user_size_update_request.py @@ -0,0 +1,56 @@ +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 + +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) + + 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 + + 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) + + 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/complete_task_data_body.py b/src/shellrent_sdk/client/models/complete_task_data_body.py new file mode 100644 index 0000000..407f836 --- /dev/null +++ b/src/shellrent_sdk/client/models/complete_task_data_body.py @@ -0,0 +1,62 @@ +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 + +if TYPE_CHECKING: + from ..models.complete_task_data_body_data import CompleteTaskDataBodyData + + +T = TypeVar("T", bound="CompleteTaskDataBody") + + +@_attrs_define +class CompleteTaskDataBody: + data: CompleteTaskDataBodyData + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + 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( + { + "data": data, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.complete_task_data_body_data import CompleteTaskDataBodyData + + d = dict(src_dict) + data = CompleteTaskDataBodyData.from_dict(d.pop("data")) + + complete_task_data_body = cls( + data=data, + ) + + complete_task_data_body.additional_properties = d + return complete_task_data_body + + @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/complete_task_data_body_data.py b/src/shellrent_sdk/client/models/complete_task_data_body_data.py new file mode 100644 index 0000000..8155f23 --- /dev/null +++ b/src/shellrent_sdk/client/models/complete_task_data_body_data.py @@ -0,0 +1,45 @@ +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="CompleteTaskDataBodyData") + + +@_attrs_define +class CompleteTaskDataBodyData: + 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) + complete_task_data_body_data = cls() + + complete_task_data_body_data.additional_properties = d + return complete_task_data_body_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/country.py b/src/shellrent_sdk/client/models/country.py new file mode 100644 index 0000000..eefd8fa --- /dev/null +++ b/src/shellrent_sdk/client/models/country.py @@ -0,0 +1,103 @@ +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="Country") + + +@_attrs_define +class Country: + iso_code_2: str + """ ie. IT """ + iso_code_3: str + """ ie. ITA """ + country_name: str + local_name: str + phone_code: str + """ +39, +44, ... """ + continent: str + """ Europe, America, ... """ + region: str + """ Macro region """ + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + iso_code_2 = self.iso_code_2 + + iso_code_3 = self.iso_code_3 + + country_name = self.country_name + + local_name = self.local_name + + phone_code = self.phone_code + + continent = self.continent + + region = self.region + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "iso_code_2": iso_code_2, + "iso_code_3": iso_code_3, + "country_name": country_name, + "local_name": local_name, + "phone_code": phone_code, + "continent": continent, + "region": region, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + iso_code_2 = d.pop("iso_code_2") + + iso_code_3 = d.pop("iso_code_3") + + country_name = d.pop("country_name") + + local_name = d.pop("local_name") + + phone_code = d.pop("phone_code") + + continent = d.pop("continent") + + region = d.pop("region") + + country = cls( + iso_code_2=iso_code_2, + iso_code_3=iso_code_3, + country_name=country_name, + local_name=local_name, + phone_code=phone_code, + continent=continent, + region=region, + ) + + country.additional_properties = d + return country + + @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.py b/src/shellrent_sdk/client/models/cpanel_license.py new file mode 100644 index 0000000..538795a --- /dev/null +++ b/src/shellrent_sdk/client/models/cpanel_license.py @@ -0,0 +1,223 @@ +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="CpanelLicense") + + +@_attrs_define +class CpanelLicense: + 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")) + + cpanel_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, + ) + + cpanel_license.additional_properties = d + return cpanel_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/cpanel_license_paginated_list_response.py b/src/shellrent_sdk/client/models/cpanel_license_paginated_list_response.py new file mode 100644 index 0000000..a9ff21c --- /dev/null +++ b/src/shellrent_sdk/client/models/cpanel_license_paginated_list_response.py @@ -0,0 +1,99 @@ +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.pagination_meta import PaginationMeta + + +T = TypeVar("T", bound="CpanelLicensePaginatedListResponse") + + +@_attrs_define +class CpanelLicensePaginatedListResponse: + error: int + message: None | str + data: list[CpanelLicense] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.pagination_meta import PaginationMeta + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = CpanelLicense.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + cpanel_license_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 + + @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.py b/src/shellrent_sdk/client/models/cpanel_license_response.py new file mode 100644 index 0000000..00d5722 --- /dev/null +++ b/src/shellrent_sdk/client/models/cpanel_license_response.py @@ -0,0 +1,112 @@ +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 new file mode 100644 index 0000000..b08dd30 --- /dev/null +++ b/src/shellrent_sdk/client/models/cpanel_license_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..201a82d --- /dev/null +++ b/src/shellrent_sdk/client/models/creditnote.py @@ -0,0 +1,212 @@ +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.account_billing import AccountBilling + from ..models.amount import Amount + from ..models.sdi_document_status import SdiDocumentStatus + from ..models.sdi_document_type import SdiDocumentType + from ..models.tax_regime import TaxRegime + + +T = TypeVar("T", bound="Creditnote") + + +@_attrs_define +class Creditnote: + creditnote_id: int + invoice_id: int + billing: AccountBilling + sdi_document_status: None | SdiDocumentStatus + sdi_document_type: SdiDocumentType + tax_regime: None | TaxRegime + date_emitted: datetime.date + creditnote_year: str + creditnote_number: str + creditnote_caption: None | str + sdi_identifier: str + sdi_filename: str + total_amount: Amount + rows_count: int + date_created: datetime.datetime + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.sdi_document_status import SdiDocumentStatus + from ..models.tax_regime import TaxRegime + + creditnote_id = self.creditnote_id + + invoice_id = self.invoice_id + + billing = self.billing.to_dict() + + sdi_document_status: dict[str, Any] | None + if isinstance(self.sdi_document_status, SdiDocumentStatus): + sdi_document_status = self.sdi_document_status.to_dict() + else: + sdi_document_status = self.sdi_document_status + + sdi_document_type = self.sdi_document_type.to_dict() + + tax_regime: dict[str, Any] | None + if isinstance(self.tax_regime, TaxRegime): + tax_regime = self.tax_regime.to_dict() + else: + tax_regime = self.tax_regime + + date_emitted = self.date_emitted.isoformat() + + creditnote_year = self.creditnote_year + + creditnote_number = self.creditnote_number + + creditnote_caption: None | str + creditnote_caption = self.creditnote_caption + + sdi_identifier = self.sdi_identifier + + sdi_filename = self.sdi_filename + + total_amount = self.total_amount.to_dict() + + rows_count = self.rows_count + + date_created = self.date_created.isoformat() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "creditnote_id": creditnote_id, + "invoice_id": invoice_id, + "billing": billing, + "sdi_document_status": sdi_document_status, + "sdi_document_type": sdi_document_type, + "tax_regime": tax_regime, + "date_emitted": date_emitted, + "creditnote_year": creditnote_year, + "creditnote_number": creditnote_number, + "creditnote_caption": creditnote_caption, + "sdi_identifier": sdi_identifier, + "sdi_filename": sdi_filename, + "total_amount": total_amount, + "rows_count": rows_count, + "date_created": date_created, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.account_billing import AccountBilling + from ..models.amount import Amount + from ..models.sdi_document_status import SdiDocumentStatus + from ..models.sdi_document_type import SdiDocumentType + from ..models.tax_regime import TaxRegime + + d = dict(src_dict) + creditnote_id = d.pop("creditnote_id") + + invoice_id = d.pop("invoice_id") + + billing = AccountBilling.from_dict(d.pop("billing")) + + def _parse_sdi_document_status(data: object) -> None | SdiDocumentStatus: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + sdi_document_status_type_0 = SdiDocumentStatus.from_dict(data) + + return sdi_document_status_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | SdiDocumentStatus, data) + + sdi_document_status = _parse_sdi_document_status(d.pop("sdi_document_status")) + + sdi_document_type = SdiDocumentType.from_dict(d.pop("sdi_document_type")) + + def _parse_tax_regime(data: object) -> None | TaxRegime: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + tax_regime_type_0 = TaxRegime.from_dict(data) + + return tax_regime_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | TaxRegime, data) + + tax_regime = _parse_tax_regime(d.pop("tax_regime")) + + date_emitted = datetime.date.fromisoformat(d.pop("date_emitted")) + + creditnote_year = d.pop("creditnote_year") + + creditnote_number = d.pop("creditnote_number") + + def _parse_creditnote_caption(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + creditnote_caption = _parse_creditnote_caption(d.pop("creditnote_caption")) + + sdi_identifier = d.pop("sdi_identifier") + + sdi_filename = d.pop("sdi_filename") + + total_amount = Amount.from_dict(d.pop("total_amount")) + + rows_count = d.pop("rows_count") + + date_created = datetime.datetime.fromisoformat(d.pop("date_created")) + + creditnote = cls( + creditnote_id=creditnote_id, + invoice_id=invoice_id, + billing=billing, + sdi_document_status=sdi_document_status, + sdi_document_type=sdi_document_type, + tax_regime=tax_regime, + date_emitted=date_emitted, + creditnote_year=creditnote_year, + creditnote_number=creditnote_number, + creditnote_caption=creditnote_caption, + sdi_identifier=sdi_identifier, + sdi_filename=sdi_filename, + total_amount=total_amount, + rows_count=rows_count, + date_created=date_created, + ) + + creditnote.additional_properties = d + return creditnote + + @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_paginated_list_response.py b/src/shellrent_sdk/client/models/creditnote_paginated_list_response.py new file mode 100644 index 0000000..ed717ac --- /dev/null +++ b/src/shellrent_sdk/client/models/creditnote_paginated_list_response.py @@ -0,0 +1,99 @@ +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.creditnote import Creditnote + from ..models.pagination_meta import PaginationMeta + + +T = TypeVar("T", bound="CreditnotePaginatedListResponse") + + +@_attrs_define +class CreditnotePaginatedListResponse: + error: int + message: None | str + data: list[Creditnote] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.creditnote import Creditnote + from ..models.pagination_meta import PaginationMeta + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = Creditnote.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + creditnote_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + creditnote_paginated_list_response.additional_properties = d + return creditnote_paginated_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/creditnote_response.py b/src/shellrent_sdk/client/models/creditnote_response.py new file mode 100644 index 0000000..8525299 --- /dev/null +++ b/src/shellrent_sdk/client/models/creditnote_response.py @@ -0,0 +1,112 @@ +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.creditnote import Creditnote + from ..models.creditnote_response_meta_type_0 import CreditnoteResponseMetaType0 + + +T = TypeVar("T", bound="CreditnoteResponse") + + +@_attrs_define +class CreditnoteResponse: + error: int + message: None | str + data: Creditnote + meta: CreditnoteResponseMetaType0 | None + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, CreditnoteResponseMetaType0): + 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.creditnote import Creditnote + from ..models.creditnote_response_meta_type_0 import ( + CreditnoteResponseMetaType0, + ) + + 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 = 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")) + + creditnote_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + creditnote_response.additional_properties = d + return creditnote_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/creditnote_response_meta_type_0.py b/src/shellrent_sdk/client/models/creditnote_response_meta_type_0.py new file mode 100644 index 0000000..fd17590 --- /dev/null +++ b/src/shellrent_sdk/client/models/creditnote_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..79364c7 --- /dev/null +++ b/src/shellrent_sdk/client/models/creditnote_row.py @@ -0,0 +1,161 @@ +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.amount import Amount + from ..models.billing_data import BillingData + + +T = TypeVar("T", bound="CreditnoteRow") + + +@_attrs_define +class CreditnoteRow: + creditnote_row_id: int + creditnote_id: int + invoice_row_id: int + reason: None | str + description: str + amount: Amount + billing_data: BillingData + date_start: datetime.date | None + date_end: datetime.date | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + creditnote_row_id = self.creditnote_row_id + + creditnote_id = self.creditnote_id + + invoice_row_id = self.invoice_row_id + + reason: None | str + reason = self.reason + + description = self.description + + amount = self.amount.to_dict() + + billing_data = self.billing_data.to_dict() + + date_start: None | str + if isinstance(self.date_start, datetime.date): + date_start = self.date_start.isoformat() + else: + date_start = self.date_start + + date_end: None | str + if isinstance(self.date_end, datetime.date): + date_end = self.date_end.isoformat() + else: + date_end = self.date_end + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "creditnote_row_id": creditnote_row_id, + "creditnote_id": creditnote_id, + "invoice_row_id": invoice_row_id, + "reason": reason, + "description": description, + "amount": amount, + "billing_data": billing_data, + "date_start": date_start, + "date_end": date_end, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.amount import Amount + from ..models.billing_data import BillingData + + d = dict(src_dict) + creditnote_row_id = d.pop("creditnote_row_id") + + creditnote_id = d.pop("creditnote_id") + + invoice_row_id = d.pop("invoice_row_id") + + def _parse_reason(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + reason = _parse_reason(d.pop("reason")) + + description = d.pop("description") + + amount = Amount.from_dict(d.pop("amount")) + + billing_data = BillingData.from_dict(d.pop("billing_data")) + + def _parse_date_start(data: object) -> datetime.date | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + date_start_type_0 = datetime.date.fromisoformat(data) + + return date_start_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.date | None, data) + + date_start = _parse_date_start(d.pop("date_start")) + + def _parse_date_end(data: object) -> datetime.date | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + date_end_type_0 = datetime.date.fromisoformat(data) + + return date_end_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.date | None, data) + + date_end = _parse_date_end(d.pop("date_end")) + + creditnote_row = cls( + creditnote_row_id=creditnote_row_id, + creditnote_id=creditnote_id, + invoice_row_id=invoice_row_id, + reason=reason, + description=description, + amount=amount, + billing_data=billing_data, + date_start=date_start, + date_end=date_end, + ) + + creditnote_row.additional_properties = d + return creditnote_row + + @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_list_response.py b/src/shellrent_sdk/client/models/creditnote_row_list_response.py new file mode 100644 index 0000000..5c93f4e --- /dev/null +++ b/src/shellrent_sdk/client/models/creditnote_row_list_response.py @@ -0,0 +1,122 @@ +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.creditnote_row import CreditnoteRow + from ..models.creditnote_row_list_response_meta_type_0 import CreditnoteRowListResponseMetaType0 + + +T = TypeVar("T", bound="CreditnoteRowListResponse") + + +@_attrs_define +class CreditnoteRowListResponse: + error: int + message: None | str + data: list[CreditnoteRow] + meta: CreditnoteRowListResponseMetaType0 | None + 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 + message = self.message + + data = [] + for data_item_data in self.data: + 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 + + 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.creditnote_row import CreditnoteRow + from ..models.creditnote_row_list_response_meta_type_0 import ( + CreditnoteRowListResponseMetaType0, + ) + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = CreditnoteRow.from_dict(data_item_data) + + 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")) + + creditnote_row_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + creditnote_row_list_response.additional_properties = d + return creditnote_row_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/creditnote_row_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/creditnote_row_list_response_meta_type_0.py new file mode 100644 index 0000000..e156cf5 --- /dev/null +++ b/src/shellrent_sdk/client/models/creditnote_row_list_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..60e0775 --- /dev/null +++ b/src/shellrent_sdk/client/models/creditnote_row_response.py @@ -0,0 +1,112 @@ +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.creditnote_row import CreditnoteRow + from ..models.creditnote_row_response_meta_type_0 import CreditnoteRowResponseMetaType0 + + +T = TypeVar("T", bound="CreditnoteRowResponse") + + +@_attrs_define +class CreditnoteRowResponse: + error: int + message: None | str + data: CreditnoteRow + meta: CreditnoteRowResponseMetaType0 | None + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, CreditnoteRowResponseMetaType0): + 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.creditnote_row import CreditnoteRow + from ..models.creditnote_row_response_meta_type_0 import ( + CreditnoteRowResponseMetaType0, + ) + + 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 = 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")) + + creditnote_row_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + creditnote_row_response.additional_properties = d + return creditnote_row_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/creditnote_row_response_meta_type_0.py b/src/shellrent_sdk/client/models/creditnote_row_response_meta_type_0.py new file mode 100644 index 0000000..fb55c93 --- /dev/null +++ b/src/shellrent_sdk/client/models/creditnote_row_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..d739c8e --- /dev/null +++ b/src/shellrent_sdk/client/models/dns_record.py @@ -0,0 +1,215 @@ +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.dns_record_caa_data import DnsRecordCaaData + from ..models.dns_record_tlsa_data import DnsRecordTlsaData + + +T = TypeVar("T", bound="DnsRecord") + + +@_attrs_define +class DnsRecord: + record_id: str + type_: str + host: str + service: None | str + protocol: None | str + destination: str + port: str + weight: int | None + priority: int | None + ttl: int | None + proxied: bool + caa_data: DnsRecordCaaData | None + tlsa_data: DnsRecordTlsaData | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.dns_record_caa_data import DnsRecordCaaData + from ..models.dns_record_tlsa_data import DnsRecordTlsaData + + record_id = self.record_id + + type_ = self.type_ + + host = self.host + + service: None | str + service = self.service + + protocol: None | str + protocol = self.protocol + + destination = self.destination + + port = self.port + + weight: int | None + weight = self.weight + + priority: int | None + priority = self.priority + + ttl: int | None + ttl = self.ttl + + proxied = self.proxied + + caa_data: dict[str, Any] | None + if isinstance(self.caa_data, DnsRecordCaaData): + caa_data = self.caa_data.to_dict() + else: + caa_data = self.caa_data + + tlsa_data: dict[str, Any] | None + if isinstance(self.tlsa_data, DnsRecordTlsaData): + tlsa_data = self.tlsa_data.to_dict() + else: + tlsa_data = self.tlsa_data + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "record_id": record_id, + "type": type_, + "host": host, + "service": service, + "protocol": protocol, + "destination": destination, + "port": port, + "weight": weight, + "priority": priority, + "ttl": ttl, + "proxied": proxied, + "caa_data": caa_data, + "tlsa_data": tlsa_data, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.dns_record_caa_data import DnsRecordCaaData + from ..models.dns_record_tlsa_data import DnsRecordTlsaData + + d = dict(src_dict) + record_id = d.pop("record_id") + + type_ = d.pop("type") + + host = d.pop("host") + + def _parse_service(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + service = _parse_service(d.pop("service")) + + def _parse_protocol(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + protocol = _parse_protocol(d.pop("protocol")) + + destination = d.pop("destination") + + port = d.pop("port") + + def _parse_weight(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + weight = _parse_weight(d.pop("weight")) + + def _parse_priority(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + priority = _parse_priority(d.pop("priority")) + + def _parse_ttl(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + ttl = _parse_ttl(d.pop("ttl")) + + proxied = d.pop("proxied") + + def _parse_caa_data(data: object) -> DnsRecordCaaData | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + caa_data_type_0 = DnsRecordCaaData.from_dict(data) + + return caa_data_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(DnsRecordCaaData | None, data) + + caa_data = _parse_caa_data(d.pop("caa_data")) + + def _parse_tlsa_data(data: object) -> DnsRecordTlsaData | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + tlsa_data_type_0 = DnsRecordTlsaData.from_dict(data) + + return tlsa_data_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(DnsRecordTlsaData | None, data) + + tlsa_data = _parse_tlsa_data(d.pop("tlsa_data")) + + dns_record = cls( + record_id=record_id, + type_=type_, + host=host, + service=service, + protocol=protocol, + destination=destination, + port=port, + weight=weight, + priority=priority, + ttl=ttl, + proxied=proxied, + caa_data=caa_data, + tlsa_data=tlsa_data, + ) + + dns_record.additional_properties = d + return dns_record + + @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_caa_data.py b/src/shellrent_sdk/client/models/dns_record_caa_data.py new file mode 100644 index 0000000..a766054 --- /dev/null +++ b/src/shellrent_sdk/client/models/dns_record_caa_data.py @@ -0,0 +1,89 @@ +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="DnsRecordCaaData") + + +@_attrs_define +class DnsRecordCaaData: + flag: int | None + tag_value: None | str + can_sign_http_exchanges: bool | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + flag: int | None + flag = self.flag + + tag_value: None | str + tag_value = self.tag_value + + can_sign_http_exchanges: bool | None + can_sign_http_exchanges = self.can_sign_http_exchanges + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "flag": flag, + "tag_value": tag_value, + "can_sign_http_exchanges": can_sign_http_exchanges, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + + def _parse_flag(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + flag = _parse_flag(d.pop("flag")) + + def _parse_tag_value(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + tag_value = _parse_tag_value(d.pop("tag_value")) + + def _parse_can_sign_http_exchanges(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) + + can_sign_http_exchanges = _parse_can_sign_http_exchanges(d.pop("can_sign_http_exchanges")) + + dns_record_caa_data = cls( + flag=flag, + tag_value=tag_value, + can_sign_http_exchanges=can_sign_http_exchanges, + ) + + dns_record_caa_data.additional_properties = d + return dns_record_caa_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/dns_record_paginated_list_response.py b/src/shellrent_sdk/client/models/dns_record_paginated_list_response.py new file mode 100644 index 0000000..13b6aa9 --- /dev/null +++ b/src/shellrent_sdk/client/models/dns_record_paginated_list_response.py @@ -0,0 +1,99 @@ +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.dns_record import DnsRecord + from ..models.simple_pagination_meta import SimplePaginationMeta + + +T = TypeVar("T", bound="DnsRecordPaginatedListResponse") + + +@_attrs_define +class DnsRecordPaginatedListResponse: + error: int + message: None | str + data: list[DnsRecord] + meta: SimplePaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.dns_record import DnsRecord + from ..models.simple_pagination_meta import SimplePaginationMeta + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = DnsRecord.from_dict(data_item_data) + + data.append(data_item) + + meta = SimplePaginationMeta.from_dict(d.pop("meta")) + + dns_record_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + dns_record_paginated_list_response.additional_properties = d + return dns_record_paginated_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/dns_record_response.py b/src/shellrent_sdk/client/models/dns_record_response.py new file mode 100644 index 0000000..b81b79c --- /dev/null +++ b/src/shellrent_sdk/client/models/dns_record_response.py @@ -0,0 +1,112 @@ +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.dns_record import DnsRecord + from ..models.dns_record_response_meta_type_0 import DnsRecordResponseMetaType0 + + +T = TypeVar("T", bound="DnsRecordResponse") + + +@_attrs_define +class DnsRecordResponse: + error: int + message: None | str + data: DnsRecord + meta: DnsRecordResponseMetaType0 | None + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, DnsRecordResponseMetaType0): + 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.dns_record import DnsRecord + from ..models.dns_record_response_meta_type_0 import ( + DnsRecordResponseMetaType0, + ) + + 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 = 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")) + + dns_record_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + dns_record_response.additional_properties = d + return dns_record_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/dns_record_response_meta_type_0.py b/src/shellrent_sdk/client/models/dns_record_response_meta_type_0.py new file mode 100644 index 0000000..041f650 --- /dev/null +++ b/src/shellrent_sdk/client/models/dns_record_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..f41c21f --- /dev/null +++ b/src/shellrent_sdk/client/models/dns_record_tlsa_data.py @@ -0,0 +1,89 @@ +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="DnsRecordTlsaData") + + +@_attrs_define +class DnsRecordTlsaData: + usage: None | str + selector: None | str + matching_type: None | str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + usage: None | str + usage = self.usage + + selector: None | str + selector = self.selector + + matching_type: None | str + matching_type = self.matching_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "usage": usage, + "selector": selector, + "matching_type": matching_type, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + + def _parse_usage(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + usage = _parse_usage(d.pop("usage")) + + def _parse_selector(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + selector = _parse_selector(d.pop("selector")) + + def _parse_matching_type(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + matching_type = _parse_matching_type(d.pop("matching_type")) + + dns_record_tlsa_data = cls( + usage=usage, + selector=selector, + matching_type=matching_type, + ) + + dns_record_tlsa_data.additional_properties = d + return dns_record_tlsa_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/dns_type.py b/src/shellrent_sdk/client/models/dns_type.py new file mode 100644 index 0000000..b16f7c8 --- /dev/null +++ b/src/shellrent_sdk/client/models/dns_type.py @@ -0,0 +1,63 @@ +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="DnsType") + + +@_attrs_define +class DnsType: + type_code: str + type_name: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + type_code = self.type_code + + type_name = self.type_name + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "type_code": type_code, + "type_name": type_name, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + type_code = d.pop("type_code") + + type_name = d.pop("type_name") + + dns_type = cls( + type_code=type_code, + type_name=type_name, + ) + + dns_type.additional_properties = d + return dns_type + + @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_zone.py b/src/shellrent_sdk/client/models/dns_zone.py new file mode 100644 index 0000000..c5e2490 --- /dev/null +++ b/src/shellrent_sdk/client/models/dns_zone.py @@ -0,0 +1,77 @@ +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="DnsZone") + + +@_attrs_define +class DnsZone: + zone_id: str + zone_name: str + nameservers: list[str] + ttl: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + zone_id = self.zone_id + + zone_name = self.zone_name + + nameservers = self.nameservers + + ttl = self.ttl + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "zone_id": zone_id, + "zone_name": zone_name, + "nameservers": nameservers, + "ttl": ttl, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + zone_id = d.pop("zone_id") + + zone_name = d.pop("zone_name") + + nameservers = cast(list[str], d.pop("nameservers")) + + ttl = d.pop("ttl") + + dns_zone = cls( + zone_id=zone_id, + zone_name=zone_name, + nameservers=nameservers, + ttl=ttl, + ) + + dns_zone.additional_properties = d + return dns_zone + + @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_zone_response.py b/src/shellrent_sdk/client/models/dns_zone_response.py new file mode 100644 index 0000000..ff4dcd2 --- /dev/null +++ b/src/shellrent_sdk/client/models/dns_zone_response.py @@ -0,0 +1,110 @@ +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.dns_zone import DnsZone + from ..models.dns_zone_response_meta_type_0 import DnsZoneResponseMetaType0 + + +T = TypeVar("T", bound="DnsZoneResponse") + + +@_attrs_define +class DnsZoneResponse: + error: int + message: None | str + data: DnsZone + meta: DnsZoneResponseMetaType0 | None + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, DnsZoneResponseMetaType0): + 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.dns_zone import DnsZone + from ..models.dns_zone_response_meta_type_0 import DnsZoneResponseMetaType0 + + 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 = 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")) + + dns_zone_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + dns_zone_response.additional_properties = d + return dns_zone_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/dns_zone_response_meta_type_0.py b/src/shellrent_sdk/client/models/dns_zone_response_meta_type_0.py new file mode 100644 index 0000000..3ad891a --- /dev/null +++ b/src/shellrent_sdk/client/models/dns_zone_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..2e2a14c --- /dev/null +++ b/src/shellrent_sdk/client/models/dnssec_ds_data.py @@ -0,0 +1,84 @@ +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="DnssecDsData") + + +@_attrs_define +class DnssecDsData: + zone_ttl: int + key_tag: int + key_algorithm: int + digest_type: int + digest_value: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + zone_ttl = self.zone_ttl + + key_tag = self.key_tag + + key_algorithm = self.key_algorithm + + digest_type = self.digest_type + + digest_value = self.digest_value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "zone_ttl": zone_ttl, + "key_tag": key_tag, + "key_algorithm": key_algorithm, + "digest_type": digest_type, + "digest_value": digest_value, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + zone_ttl = d.pop("zone_ttl") + + key_tag = d.pop("key_tag") + + key_algorithm = d.pop("key_algorithm") + + digest_type = d.pop("digest_type") + + digest_value = d.pop("digest_value") + + dnssec_ds_data = cls( + zone_ttl=zone_ttl, + key_tag=key_tag, + key_algorithm=key_algorithm, + digest_type=digest_type, + digest_value=digest_value, + ) + + dnssec_ds_data.additional_properties = d + return dnssec_ds_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/dnssec_key_data.py b/src/shellrent_sdk/client/models/dnssec_key_data.py new file mode 100644 index 0000000..1fbee76 --- /dev/null +++ b/src/shellrent_sdk/client/models/dnssec_key_data.py @@ -0,0 +1,84 @@ +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="DnssecKeyData") + + +@_attrs_define +class DnssecKeyData: + zone_ttl: int + flags: int + key_protocol: int + key_algorithm: int + public_key: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + zone_ttl = self.zone_ttl + + flags = self.flags + + key_protocol = self.key_protocol + + key_algorithm = self.key_algorithm + + public_key = self.public_key + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "zone_ttl": zone_ttl, + "flags": flags, + "key_protocol": key_protocol, + "key_algorithm": key_algorithm, + "public_key": public_key, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + zone_ttl = d.pop("zone_ttl") + + flags = d.pop("flags") + + key_protocol = d.pop("key_protocol") + + key_algorithm = d.pop("key_algorithm") + + public_key = d.pop("public_key") + + dnssec_key_data = cls( + zone_ttl=zone_ttl, + flags=flags, + key_protocol=key_protocol, + key_algorithm=key_algorithm, + public_key=public_key, + ) + + dnssec_key_data.additional_properties = d + return dnssec_key_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/domain.py b/src/shellrent_sdk/client/models/domain.py new file mode 100644 index 0000000..52379e4 --- /dev/null +++ b/src/shellrent_sdk/client/models/domain.py @@ -0,0 +1,203 @@ +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 + + +T = TypeVar("T", bound="Domain") + + +@_attrs_define +class Domain: + domain_id: int + tld_id: int + domain_name: DomainName + dns_type: DnsType + dns_account: None | str + nameservers: list[str] + domain_data: DomainData | None + contacts_count: int + dnssec_enabled: bool + date_info_last: datetime.datetime | None + date_dns_check: datetime.datetime | None + vanity_nameserver_enabled: bool + 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 = self.nameservers + + 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 + + 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 = cast(list[str], d.pop("nameservers")) + + 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 = 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.additional_properties = d + return domain + + @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_availability.py b/src/shellrent_sdk/client/models/domain_availability.py new file mode 100644 index 0000000..1a67a7a --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_availability.py @@ -0,0 +1,69 @@ +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 + +if TYPE_CHECKING: + from ..models.domain_name import DomainName + + +T = TypeVar("T", bound="DomainAvailability") + + +@_attrs_define +class DomainAvailability: + domain_name: DomainName + availability: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + domain_name = self.domain_name.to_dict() + + availability = self.availability + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "domain_name": domain_name, + "availability": availability, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.domain_name import DomainName + + d = dict(src_dict) + domain_name = DomainName.from_dict(d.pop("domain_name")) + + availability = d.pop("availability") + + domain_availability = cls( + domain_name=domain_name, + availability=availability, + ) + + domain_availability.additional_properties = d + return domain_availability + + @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_availability_response.py b/src/shellrent_sdk/client/models/domain_availability_response.py new file mode 100644 index 0000000..e2d3224 --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_availability_response.py @@ -0,0 +1,116 @@ +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_availability import DomainAvailability + from ..models.domain_availability_response_meta_type_0 import ( + DomainAvailabilityResponseMetaType0, + ) + + +T = TypeVar("T", bound="DomainAvailabilityResponse") + + +@_attrs_define +class DomainAvailabilityResponse: + error: int + message: None | str + data: DomainAvailability + meta: DomainAvailabilityResponseMetaType0 | None + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, DomainAvailabilityResponseMetaType0): + 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_availability import DomainAvailability + from ..models.domain_availability_response_meta_type_0 import ( + DomainAvailabilityResponseMetaType0, + ) + + 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 = 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")) + + domain_availability_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + domain_availability_response.additional_properties = d + return domain_availability_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_availability_response_meta_type_0.py b/src/shellrent_sdk/client/models/domain_availability_response_meta_type_0.py new file mode 100644 index 0000000..7fd6843 --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_availability_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..c6a40f7 --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_can_change_nameservers.py @@ -0,0 +1,77 @@ +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="DomainCanChangeNameservers") + + +@_attrs_define +class DomainCanChangeNameservers: + domain_id: int + can_activate_standard: bool + can_activate_cloudflare: bool + can_activate_external: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + domain_id = self.domain_id + + can_activate_standard = self.can_activate_standard + + can_activate_cloudflare = self.can_activate_cloudflare + + can_activate_external = self.can_activate_external + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "domain_id": domain_id, + "can_activate_standard": can_activate_standard, + "can_activate_cloudflare": can_activate_cloudflare, + "can_activate_external": can_activate_external, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + domain_id = d.pop("domain_id") + + can_activate_standard = d.pop("can_activate_standard") + + can_activate_cloudflare = d.pop("can_activate_cloudflare") + + can_activate_external = d.pop("can_activate_external") + + domain_can_change_nameservers = cls( + domain_id=domain_id, + can_activate_standard=can_activate_standard, + can_activate_cloudflare=can_activate_cloudflare, + can_activate_external=can_activate_external, + ) + + domain_can_change_nameservers.additional_properties = d + return domain_can_change_nameservers + + @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_response.py b/src/shellrent_sdk/client/models/domain_can_change_nameservers_response.py new file mode 100644 index 0000000..3f355b8 --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_can_change_nameservers_response.py @@ -0,0 +1,118 @@ +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_can_change_nameservers import DomainCanChangeNameservers + from ..models.domain_can_change_nameservers_response_meta_type_0 import ( + DomainCanChangeNameserversResponseMetaType0, + ) + + +T = TypeVar("T", bound="DomainCanChangeNameserversResponse") + + +@_attrs_define +class DomainCanChangeNameserversResponse: + error: int + message: None | str + data: DomainCanChangeNameservers + meta: DomainCanChangeNameserversResponseMetaType0 | None + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, DomainCanChangeNameserversResponseMetaType0): + 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_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") + + 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 = 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")) + + domain_can_change_nameservers_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + domain_can_change_nameservers_response.additional_properties = d + return domain_can_change_nameservers_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_can_change_nameservers_response_meta_type_0.py b/src/shellrent_sdk/client/models/domain_can_change_nameservers_response_meta_type_0.py new file mode 100644 index 0000000..4874ebf --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_can_change_nameservers_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..2684229 --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_contact.py @@ -0,0 +1,98 @@ +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 + +if TYPE_CHECKING: + from ..models.domain_contact_data import DomainContactData + + +T = TypeVar("T", bound="DomainContact") + + +@_attrs_define +class DomainContact: + domain_contact_id: int + domain_id: int + type_: str + to_sync: bool + contact_data: list[DomainContactData] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + domain_contact_id = self.domain_contact_id + + domain_id = self.domain_id + + type_ = self.type_ + + to_sync = self.to_sync + + contact_data = [] + for contact_data_item_data in self.contact_data: + contact_data_item = contact_data_item_data.to_dict() + contact_data.append(contact_data_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "domain_contact_id": domain_contact_id, + "domain_id": domain_id, + "type": type_, + "to_sync": to_sync, + "contact_data": contact_data, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.domain_contact_data import DomainContactData + + d = dict(src_dict) + domain_contact_id = d.pop("domain_contact_id") + + domain_id = d.pop("domain_id") + + type_ = d.pop("type") + + to_sync = d.pop("to_sync") + + contact_data = [] + _contact_data = d.pop("contact_data") + for contact_data_item_data in _contact_data: + contact_data_item = DomainContactData.from_dict(contact_data_item_data) + + contact_data.append(contact_data_item) + + domain_contact = cls( + domain_contact_id=domain_contact_id, + domain_id=domain_id, + type_=type_, + to_sync=to_sync, + contact_data=contact_data, + ) + + domain_contact.additional_properties = d + return domain_contact + + @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_data.py b/src/shellrent_sdk/client/models/domain_contact_data.py new file mode 100644 index 0000000..a2b173c --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_contact_data.py @@ -0,0 +1,63 @@ +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="DomainContactData") + + +@_attrs_define +class DomainContactData: + data_field: str + data_value: str + 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 = self.data_value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data_field": data_field, + "data_value": data_value, + } + ) + + return field_dict + + @classmethod + 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") + + domain_contact_data = cls( + data_field=data_field, + data_value=data_value, + ) + + domain_contact_data.additional_properties = d + return domain_contact_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/domain_contact_list_response.py b/src/shellrent_sdk/client/models/domain_contact_list_response.py new file mode 100644 index 0000000..c6e9038 --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_contact_list_response.py @@ -0,0 +1,122 @@ +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_contact import DomainContact + from ..models.domain_contact_list_response_meta_type_0 import DomainContactListResponseMetaType0 + + +T = TypeVar("T", bound="DomainContactListResponse") + + +@_attrs_define +class DomainContactListResponse: + error: int + message: None | str + data: list[DomainContact] + meta: DomainContactListResponseMetaType0 | None + 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 + message = self.message + + data = [] + for data_item_data in self.data: + 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 + + 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_contact import DomainContact + from ..models.domain_contact_list_response_meta_type_0 import ( + DomainContactListResponseMetaType0, + ) + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = DomainContact.from_dict(data_item_data) + + 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")) + + domain_contact_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + domain_contact_list_response.additional_properties = d + return domain_contact_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/domain_contact_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/domain_contact_list_response_meta_type_0.py new file mode 100644 index 0000000..ecfba79 --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_contact_list_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..669a4d1 --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_contact_request.py @@ -0,0 +1,76 @@ +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 + +if TYPE_CHECKING: + from ..models.domain_contact_request_contact_data_item import ( + DomainContactRequestContactDataItem, + ) + + +T = TypeVar("T", bound="DomainContactRequest") + + +@_attrs_define +class DomainContactRequest: + contact_data: list[DomainContactRequestContactDataItem] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + contact_data = [] + for contact_data_item_data in self.contact_data: + contact_data_item = contact_data_item_data.to_dict() + contact_data.append(contact_data_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "contact_data": contact_data, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.domain_contact_request_contact_data_item import ( + DomainContactRequestContactDataItem, + ) + + d = dict(src_dict) + contact_data = [] + _contact_data = d.pop("contact_data") + for contact_data_item_data in _contact_data: + contact_data_item = DomainContactRequestContactDataItem.from_dict( + contact_data_item_data + ) + + contact_data.append(contact_data_item) + + domain_contact_request = cls( + 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 new file mode 100644 index 0000000..58b9a92 --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_contact_request_contact_data_item.py @@ -0,0 +1,63 @@ +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="DomainContactRequestContactDataItem") + + +@_attrs_define +class DomainContactRequestContactDataItem: + data_field: str + data_value: str + 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 = self.data_value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data_field": data_field, + "data_value": data_value, + } + ) + + return field_dict + + @classmethod + 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") + + domain_contact_request_contact_data_item = cls( + data_field=data_field, + data_value=data_value, + ) + + domain_contact_request_contact_data_item.additional_properties = d + return domain_contact_request_contact_data_item + + @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_response.py b/src/shellrent_sdk/client/models/domain_contact_response.py new file mode 100644 index 0000000..3c2ac37 --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_contact_response.py @@ -0,0 +1,112 @@ +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_contact import DomainContact + from ..models.domain_contact_response_meta_type_0 import DomainContactResponseMetaType0 + + +T = TypeVar("T", bound="DomainContactResponse") + + +@_attrs_define +class DomainContactResponse: + error: int + message: None | str + data: DomainContact + meta: DomainContactResponseMetaType0 | None + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, DomainContactResponseMetaType0): + 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_contact import DomainContact + from ..models.domain_contact_response_meta_type_0 import ( + DomainContactResponseMetaType0, + ) + + 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 = 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")) + + domain_contact_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + domain_contact_response.additional_properties = d + return domain_contact_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_contact_response_meta_type_0.py b/src/shellrent_sdk/client/models/domain_contact_response_meta_type_0.py new file mode 100644 index 0000000..78fdc19 --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_contact_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..9e1b153 --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_data.py @@ -0,0 +1,266 @@ +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="DomainData") + + +@_attrs_define +class DomainData: + registry_status: None | str + incoming_authcode: None | str + outgoing_authcode: None | str + registry_nameservers: None | str + registry_expiry: datetime.datetime | None + registry_created: datetime.datetime | None + registry_updated: datetime.datetime | None + registry_deletion: datetime.datetime | None + date_deactivation: datetime.datetime | None + identity_validation_status: None | str + is_on_hold: bool + transfer_wrong_authcode: bool + transfer_locked: bool + date_created: datetime.datetime + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + registry_status: None | str + registry_status = self.registry_status + + incoming_authcode: None | str + incoming_authcode = self.incoming_authcode + + outgoing_authcode: None | str + outgoing_authcode = self.outgoing_authcode + + registry_nameservers: None | str + registry_nameservers = self.registry_nameservers + + registry_expiry: None | str + if isinstance(self.registry_expiry, datetime.datetime): + registry_expiry = self.registry_expiry.isoformat() + else: + registry_expiry = self.registry_expiry + + registry_created: None | str + if isinstance(self.registry_created, datetime.datetime): + registry_created = self.registry_created.isoformat() + else: + registry_created = self.registry_created + + registry_updated: None | str + if isinstance(self.registry_updated, datetime.datetime): + registry_updated = self.registry_updated.isoformat() + else: + registry_updated = self.registry_updated + + registry_deletion: None | str + if isinstance(self.registry_deletion, datetime.datetime): + registry_deletion = self.registry_deletion.isoformat() + else: + registry_deletion = self.registry_deletion + + date_deactivation: None | str + if isinstance(self.date_deactivation, datetime.datetime): + date_deactivation = self.date_deactivation.isoformat() + else: + date_deactivation = self.date_deactivation + + identity_validation_status: None | str + identity_validation_status = self.identity_validation_status + + is_on_hold = self.is_on_hold + + transfer_wrong_authcode = self.transfer_wrong_authcode + + transfer_locked = self.transfer_locked + + date_created = self.date_created.isoformat() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "registry_status": registry_status, + "incoming_authcode": incoming_authcode, + "outgoing_authcode": outgoing_authcode, + "registry_nameservers": registry_nameservers, + "registry_expiry": registry_expiry, + "registry_created": registry_created, + "registry_updated": registry_updated, + "registry_deletion": registry_deletion, + "date_deactivation": date_deactivation, + "identity_validation_status": identity_validation_status, + "is_on_hold": is_on_hold, + "transfer_wrong_authcode": transfer_wrong_authcode, + "transfer_locked": transfer_locked, + "date_created": date_created, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + + def _parse_registry_status(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + registry_status = _parse_registry_status(d.pop("registry_status")) + + def _parse_incoming_authcode(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + incoming_authcode = _parse_incoming_authcode(d.pop("incoming_authcode")) + + def _parse_outgoing_authcode(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + outgoing_authcode = _parse_outgoing_authcode(d.pop("outgoing_authcode")) + + def _parse_registry_nameservers(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + registry_nameservers = _parse_registry_nameservers(d.pop("registry_nameservers")) + + def _parse_registry_expiry(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + registry_expiry_type_0 = datetime.datetime.fromisoformat(data) + + return registry_expiry_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + registry_expiry = _parse_registry_expiry(d.pop("registry_expiry")) + + def _parse_registry_created(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + registry_created_type_0 = datetime.datetime.fromisoformat(data) + + return registry_created_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + registry_created = _parse_registry_created(d.pop("registry_created")) + + def _parse_registry_updated(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + registry_updated_type_0 = datetime.datetime.fromisoformat(data) + + return registry_updated_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + registry_updated = _parse_registry_updated(d.pop("registry_updated")) + + def _parse_registry_deletion(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + registry_deletion_type_0 = datetime.datetime.fromisoformat(data) + + return registry_deletion_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + registry_deletion = _parse_registry_deletion(d.pop("registry_deletion")) + + def _parse_date_deactivation(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + date_deactivation_type_0 = datetime.datetime.fromisoformat(data) + + return date_deactivation_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + date_deactivation = _parse_date_deactivation(d.pop("date_deactivation")) + + def _parse_identity_validation_status(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + identity_validation_status = _parse_identity_validation_status( + d.pop("identity_validation_status") + ) + + is_on_hold = d.pop("is_on_hold") + + transfer_wrong_authcode = d.pop("transfer_wrong_authcode") + + transfer_locked = d.pop("transfer_locked") + + date_created = datetime.datetime.fromisoformat(d.pop("date_created")) + + domain_data = cls( + registry_status=registry_status, + incoming_authcode=incoming_authcode, + outgoing_authcode=outgoing_authcode, + registry_nameservers=registry_nameservers, + registry_expiry=registry_expiry, + registry_created=registry_created, + registry_updated=registry_updated, + registry_deletion=registry_deletion, + date_deactivation=date_deactivation, + identity_validation_status=identity_validation_status, + is_on_hold=is_on_hold, + transfer_wrong_authcode=transfer_wrong_authcode, + transfer_locked=transfer_locked, + date_created=date_created, + ) + + domain_data.additional_properties = d + return domain_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/domain_dns_nameservers_change_request.py b/src/shellrent_sdk/client/models/domain_dns_nameservers_change_request.py new file mode 100644 index 0000000..ec346a3 --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_dns_nameservers_change_request.py @@ -0,0 +1,121 @@ +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 + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DomainDnsNameserversChangeRequest") + + +@_attrs_define +class DomainDnsNameserversChangeRequest: + ns_1_hostname: str + """ Hostname of first nameserver """ + 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 """ + ns_3_hostname: str | Unset = UNSET + """ Hostname of third nameserver """ + ns_3_ip: str | Unset = UNSET + """ IP address of third nameserver """ + 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) + + 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 + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + ns_1_hostname = d.pop("ns_1_hostname") + + 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 new file mode 100644 index 0000000..d85e995 --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_dns_nameservers_cloudflare_request.py @@ -0,0 +1,63 @@ +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="DomainDnsNameserversCloudflareRequest") + + +@_attrs_define +class DomainDnsNameserversCloudflareRequest: + account_email: str + api_token: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + account_email = self.account_email + + api_token = self.api_token + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "account_email": account_email, + "api_token": api_token, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + account_email = d.pop("account_email") + + api_token = d.pop("api_token") + + domain_dns_nameservers_cloudflare_request = cls( + account_email=account_email, + 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 new file mode 100644 index 0000000..985f1b3 --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_dns_record_change_request.py @@ -0,0 +1,169 @@ +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.domain_dns_record_change_request_caa_data import ( + DomainDnsRecordChangeRequestCaaData, + ) + from ..models.domain_dns_record_change_request_tlsa_data import ( + DomainDnsRecordChangeRequestTlsaData, + ) + + +T = TypeVar("T", bound="DomainDnsRecordChangeRequest") + + +@_attrs_define +class DomainDnsRecordChangeRequest: + host: str + destination: str + service: str | Unset = UNSET + protocol: str | Unset = UNSET + port: str | Unset = UNSET + weight: str | Unset = UNSET + priority: str | Unset = UNSET + ttl: int | Unset = UNSET + proxied: bool | Unset = UNSET + 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 + + destination = self.destination + + service = self.service + + protocol = self.protocol + + port = self.port + + weight = self.weight + + priority = self.priority + + ttl = self.ttl + + proxied = self.proxied + + caa_data: dict[str, Any] | Unset = UNSET + if not isinstance(self.caa_data, Unset): + caa_data = self.caa_data.to_dict() + + tlsa_data: dict[str, Any] | Unset = UNSET + if not isinstance(self.tlsa_data, Unset): + tlsa_data = self.tlsa_data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "host": host, + "destination": destination, + } + ) + if service is not UNSET: + field_dict["service"] = service + if protocol is not UNSET: + field_dict["protocol"] = protocol + if port is not UNSET: + field_dict["port"] = port + if weight is not UNSET: + field_dict["weight"] = weight + if priority is not UNSET: + field_dict["priority"] = priority + if ttl is not UNSET: + field_dict["ttl"] = ttl + if proxied is not UNSET: + field_dict["proxied"] = proxied + if caa_data is not UNSET: + field_dict["caa_data"] = caa_data + if tlsa_data is not UNSET: + field_dict["tlsa_data"] = tlsa_data + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.domain_dns_record_change_request_caa_data import ( + DomainDnsRecordChangeRequestCaaData, + ) + from ..models.domain_dns_record_change_request_tlsa_data import ( + DomainDnsRecordChangeRequestTlsaData, + ) + + d = dict(src_dict) + host = d.pop("host") + + destination = d.pop("destination") + + service = d.pop("service", UNSET) + + protocol = d.pop("protocol", UNSET) + + port = d.pop("port", UNSET) + + weight = d.pop("weight", UNSET) + + priority = d.pop("priority", UNSET) + + ttl = d.pop("ttl", UNSET) + + proxied = d.pop("proxied", UNSET) + + _caa_data = d.pop("caa_data", UNSET) + caa_data: DomainDnsRecordChangeRequestCaaData | Unset + if isinstance(_caa_data, Unset): + caa_data = UNSET + else: + caa_data = DomainDnsRecordChangeRequestCaaData.from_dict(_caa_data) + + _tlsa_data = d.pop("tlsa_data", UNSET) + tlsa_data: DomainDnsRecordChangeRequestTlsaData | Unset + if isinstance(_tlsa_data, Unset): + tlsa_data = UNSET + else: + tlsa_data = DomainDnsRecordChangeRequestTlsaData.from_dict(_tlsa_data) + + domain_dns_record_change_request = cls( + host=host, + destination=destination, + service=service, + protocol=protocol, + port=port, + weight=weight, + priority=priority, + ttl=ttl, + proxied=proxied, + caa_data=caa_data, + 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 new file mode 100644 index 0000000..c0f0951 --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_dns_record_change_request_caa_data.py @@ -0,0 +1,72 @@ +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="DomainDnsRecordChangeRequestCaaData") + + +@_attrs_define +class DomainDnsRecordChangeRequestCaaData: + """Use this for CAA type record only""" + + flag: int + tag_value: str + can_sign_http_exchanges: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + flag = self.flag + + tag_value = self.tag_value + + can_sign_http_exchanges = self.can_sign_http_exchanges + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "flag": flag, + "tag_value": tag_value, + "can_sign_http_exchanges": can_sign_http_exchanges, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + flag = d.pop("flag") + + tag_value = d.pop("tag_value") + + can_sign_http_exchanges = d.pop("can_sign_http_exchanges") + + domain_dns_record_change_request_caa_data = cls( + flag=flag, + tag_value=tag_value, + can_sign_http_exchanges=can_sign_http_exchanges, + ) + + domain_dns_record_change_request_caa_data.additional_properties = d + return domain_dns_record_change_request_caa_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/domain_dns_record_change_request_tlsa_data.py b/src/shellrent_sdk/client/models/domain_dns_record_change_request_tlsa_data.py new file mode 100644 index 0000000..cb49a36 --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_dns_record_change_request_tlsa_data.py @@ -0,0 +1,72 @@ +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="DomainDnsRecordChangeRequestTlsaData") + + +@_attrs_define +class DomainDnsRecordChangeRequestTlsaData: + """Use this for TLSA type record only""" + + usage: str + selector: str + matching_type: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + usage = self.usage + + selector = self.selector + + matching_type = self.matching_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "usage": usage, + "selector": selector, + "matching_type": matching_type, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + usage = d.pop("usage") + + selector = d.pop("selector") + + matching_type = d.pop("matching_type") + + domain_dns_record_change_request_tlsa_data = cls( + usage=usage, + selector=selector, + matching_type=matching_type, + ) + + domain_dns_record_change_request_tlsa_data.additional_properties = d + return domain_dns_record_change_request_tlsa_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/domain_dns_record_request.py b/src/shellrent_sdk/client/models/domain_dns_record_request.py new file mode 100644 index 0000000..14965d3 --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_dns_record_request.py @@ -0,0 +1,172 @@ +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.domain_dns_record_request_caa_data import DomainDnsRecordRequestCaaData + from ..models.domain_dns_record_request_tlsa_data import DomainDnsRecordRequestTlsaData + + +T = TypeVar("T", bound="DomainDnsRecordRequest") + + +@_attrs_define +class DomainDnsRecordRequest: + type_: str + host: str + destination: str + service: str | Unset = UNSET + protocol: str | Unset = UNSET + port: str | Unset = UNSET + weight: str | Unset = UNSET + priority: str | Unset = UNSET + ttl: int | Unset = UNSET + proxied: bool | Unset = UNSET + 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_ + + host = self.host + + destination = self.destination + + service = self.service + + protocol = self.protocol + + port = self.port + + weight = self.weight + + priority = self.priority + + ttl = self.ttl + + proxied = self.proxied + + caa_data: dict[str, Any] | Unset = UNSET + if not isinstance(self.caa_data, Unset): + caa_data = self.caa_data.to_dict() + + tlsa_data: dict[str, Any] | Unset = UNSET + if not isinstance(self.tlsa_data, Unset): + tlsa_data = self.tlsa_data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "type": type_, + "host": host, + "destination": destination, + } + ) + if service is not UNSET: + field_dict["service"] = service + if protocol is not UNSET: + field_dict["protocol"] = protocol + if port is not UNSET: + field_dict["port"] = port + if weight is not UNSET: + field_dict["weight"] = weight + if priority is not UNSET: + field_dict["priority"] = priority + if ttl is not UNSET: + field_dict["ttl"] = ttl + if proxied is not UNSET: + field_dict["proxied"] = proxied + if caa_data is not UNSET: + field_dict["caa_data"] = caa_data + if tlsa_data is not UNSET: + field_dict["tlsa_data"] = tlsa_data + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.domain_dns_record_request_caa_data import ( + DomainDnsRecordRequestCaaData, + ) + from ..models.domain_dns_record_request_tlsa_data import ( + DomainDnsRecordRequestTlsaData, + ) + + d = dict(src_dict) + type_ = d.pop("type") + + host = d.pop("host") + + destination = d.pop("destination") + + service = d.pop("service", UNSET) + + protocol = d.pop("protocol", UNSET) + + port = d.pop("port", UNSET) + + weight = d.pop("weight", UNSET) + + priority = d.pop("priority", UNSET) + + ttl = d.pop("ttl", UNSET) + + proxied = d.pop("proxied", UNSET) + + _caa_data = d.pop("caa_data", UNSET) + caa_data: DomainDnsRecordRequestCaaData | Unset + if isinstance(_caa_data, Unset): + caa_data = UNSET + else: + caa_data = DomainDnsRecordRequestCaaData.from_dict(_caa_data) + + _tlsa_data = d.pop("tlsa_data", UNSET) + tlsa_data: DomainDnsRecordRequestTlsaData | Unset + if isinstance(_tlsa_data, Unset): + tlsa_data = UNSET + else: + tlsa_data = DomainDnsRecordRequestTlsaData.from_dict(_tlsa_data) + + domain_dns_record_request = cls( + type_=type_, + host=host, + destination=destination, + service=service, + protocol=protocol, + port=port, + weight=weight, + priority=priority, + ttl=ttl, + proxied=proxied, + caa_data=caa_data, + 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 new file mode 100644 index 0000000..01dc94d --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_dns_record_request_caa_data.py @@ -0,0 +1,72 @@ +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="DomainDnsRecordRequestCaaData") + + +@_attrs_define +class DomainDnsRecordRequestCaaData: + """Use this for CAA type record only""" + + flag: int + tag_value: str + can_sign_http_exchanges: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + flag = self.flag + + tag_value = self.tag_value + + can_sign_http_exchanges = self.can_sign_http_exchanges + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "flag": flag, + "tag_value": tag_value, + "can_sign_http_exchanges": can_sign_http_exchanges, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + flag = d.pop("flag") + + tag_value = d.pop("tag_value") + + can_sign_http_exchanges = d.pop("can_sign_http_exchanges") + + domain_dns_record_request_caa_data = cls( + flag=flag, + tag_value=tag_value, + can_sign_http_exchanges=can_sign_http_exchanges, + ) + + domain_dns_record_request_caa_data.additional_properties = d + return domain_dns_record_request_caa_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/domain_dns_record_request_tlsa_data.py b/src/shellrent_sdk/client/models/domain_dns_record_request_tlsa_data.py new file mode 100644 index 0000000..28ae20d --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_dns_record_request_tlsa_data.py @@ -0,0 +1,72 @@ +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="DomainDnsRecordRequestTlsaData") + + +@_attrs_define +class DomainDnsRecordRequestTlsaData: + """Use this for TLSA type record only""" + + usage: str + selector: str + matching_type: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + usage = self.usage + + selector = self.selector + + matching_type = self.matching_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "usage": usage, + "selector": selector, + "matching_type": matching_type, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + usage = d.pop("usage") + + selector = d.pop("selector") + + matching_type = d.pop("matching_type") + + domain_dns_record_request_tlsa_data = cls( + usage=usage, + selector=selector, + matching_type=matching_type, + ) + + domain_dns_record_request_tlsa_data.additional_properties = d + return domain_dns_record_request_tlsa_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/domain_dns_zone_request.py b/src/shellrent_sdk/client/models/domain_dns_zone_request.py new file mode 100644 index 0000000..42f348a --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_dns_zone_request.py @@ -0,0 +1,56 @@ +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="DomainDnsZoneRequest") + + +@_attrs_define +class DomainDnsZoneRequest: + zone_ttl: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + zone_ttl = self.zone_ttl + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "zone_ttl": zone_ttl, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + zone_ttl = 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_dnssec.py b/src/shellrent_sdk/client/models/domain_dnssec.py new file mode 100644 index 0000000..6ddae78 --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_dnssec.py @@ -0,0 +1,87 @@ +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 + +if TYPE_CHECKING: + from ..models.dnssec_ds_data import DnssecDsData + from ..models.dnssec_key_data import DnssecKeyData + + +T = TypeVar("T", bound="DomainDnssec") + + +@_attrs_define +class DomainDnssec: + ds_data: list[DnssecDsData] + key_data: list[DnssecKeyData] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + ds_data = [] + for ds_data_item_data in self.ds_data: + ds_data_item = ds_data_item_data.to_dict() + ds_data.append(ds_data_item) + + key_data = [] + for key_data_item_data in self.key_data: + key_data_item = key_data_item_data.to_dict() + key_data.append(key_data_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "ds_data": ds_data, + "key_data": key_data, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.dnssec_ds_data import DnssecDsData + from ..models.dnssec_key_data import DnssecKeyData + + d = dict(src_dict) + ds_data = [] + _ds_data = d.pop("ds_data") + for ds_data_item_data in _ds_data: + ds_data_item = DnssecDsData.from_dict(ds_data_item_data) + + ds_data.append(ds_data_item) + + key_data = [] + _key_data = d.pop("key_data") + for key_data_item_data in _key_data: + key_data_item = DnssecKeyData.from_dict(key_data_item_data) + + key_data.append(key_data_item) + + domain_dnssec = cls( + ds_data=ds_data, + key_data=key_data, + ) + + domain_dnssec.additional_properties = d + return domain_dnssec + + @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_activate.py b/src/shellrent_sdk/client/models/domain_dnssec_can_activate.py new file mode 100644 index 0000000..f589ea7 --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_dnssec_can_activate.py @@ -0,0 +1,63 @@ +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="DomainDnssecCanActivate") + + +@_attrs_define +class DomainDnssecCanActivate: + domain_id: int + can_active: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + domain_id = self.domain_id + + can_active = self.can_active + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "domain_id": domain_id, + "can_active": can_active, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + domain_id = d.pop("domain_id") + + can_active = d.pop("can_active") + + domain_dnssec_can_activate = cls( + domain_id=domain_id, + can_active=can_active, + ) + + domain_dnssec_can_activate.additional_properties = d + return domain_dnssec_can_activate + + @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_activate_response.py b/src/shellrent_sdk/client/models/domain_dnssec_can_activate_response.py new file mode 100644 index 0000000..1f85f85 --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_dnssec_can_activate_response.py @@ -0,0 +1,116 @@ +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_dnssec_can_activate import DomainDnssecCanActivate + from ..models.domain_dnssec_can_activate_response_meta_type_0 import ( + DomainDnssecCanActivateResponseMetaType0, + ) + + +T = TypeVar("T", bound="DomainDnssecCanActivateResponse") + + +@_attrs_define +class DomainDnssecCanActivateResponse: + error: int + message: None | str + data: DomainDnssecCanActivate + meta: DomainDnssecCanActivateResponseMetaType0 | None + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, DomainDnssecCanActivateResponseMetaType0): + 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_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") + + 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 = 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")) + + domain_dnssec_can_activate_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + domain_dnssec_can_activate_response.additional_properties = d + return domain_dnssec_can_activate_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_dnssec_can_activate_response_meta_type_0.py b/src/shellrent_sdk/client/models/domain_dnssec_can_activate_response_meta_type_0.py new file mode 100644 index 0000000..8d9f292 --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_dnssec_can_activate_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..bb65b79 --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_dnssec_can_deactivate.py @@ -0,0 +1,63 @@ +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="DomainDnssecCanDeactivate") + + +@_attrs_define +class DomainDnssecCanDeactivate: + domain_id: int + can_deactivate: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + domain_id = self.domain_id + + can_deactivate = self.can_deactivate + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "domain_id": domain_id, + "can_deactivate": can_deactivate, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + domain_id = d.pop("domain_id") + + can_deactivate = d.pop("can_deactivate") + + domain_dnssec_can_deactivate = cls( + domain_id=domain_id, + can_deactivate=can_deactivate, + ) + + domain_dnssec_can_deactivate.additional_properties = d + return domain_dnssec_can_deactivate + + @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_response.py b/src/shellrent_sdk/client/models/domain_dnssec_can_deactivate_response.py new file mode 100644 index 0000000..e8c7cd3 --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_dnssec_can_deactivate_response.py @@ -0,0 +1,116 @@ +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_dnssec_can_deactivate import DomainDnssecCanDeactivate + from ..models.domain_dnssec_can_deactivate_response_meta_type_0 import ( + DomainDnssecCanDeactivateResponseMetaType0, + ) + + +T = TypeVar("T", bound="DomainDnssecCanDeactivateResponse") + + +@_attrs_define +class DomainDnssecCanDeactivateResponse: + error: int + message: None | str + data: DomainDnssecCanDeactivate + meta: DomainDnssecCanDeactivateResponseMetaType0 | None + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, DomainDnssecCanDeactivateResponseMetaType0): + 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_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") + + 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 = 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")) + + domain_dnssec_can_deactivate_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + domain_dnssec_can_deactivate_response.additional_properties = d + return domain_dnssec_can_deactivate_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_dnssec_can_deactivate_response_meta_type_0.py b/src/shellrent_sdk/client/models/domain_dnssec_can_deactivate_response_meta_type_0.py new file mode 100644 index 0000000..16c6f2b --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_dnssec_can_deactivate_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..53ad9e4 --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_dnssec_request.py @@ -0,0 +1,140 @@ +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.domain_dnssec_request_ds_data_1 import DomainDnssecRequestDsData1 + from ..models.domain_dnssec_request_ds_data_2 import DomainDnssecRequestDsData2 + from ..models.domain_dnssec_request_key_data_256_item import DomainDnssecRequestKeyData256Item + from ..models.domain_dnssec_request_key_data_257_item import DomainDnssecRequestKeyData257Item + + +T = TypeVar("T", bound="DomainDnssecRequest") + + +@_attrs_define +class DomainDnssecRequest: + zone_ttl: int + ds_data_1: DomainDnssecRequestDsData1 + """ DS DATA first record """ + ds_data_2: DomainDnssecRequestDsData2 + """ DS DATA second record """ + key_data_256: list[DomainDnssecRequestKeyData256Item] | Unset = UNSET + """ 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 + + ds_data_1 = self.ds_data_1.to_dict() + + ds_data_2 = self.ds_data_2.to_dict() + + key_data_256: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.key_data_256, Unset): + key_data_256 = [] + for key_data_256_item_data in self.key_data_256: + key_data_256_item = key_data_256_item_data.to_dict() + key_data_256.append(key_data_256_item) + + key_data_257: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.key_data_257, Unset): + key_data_257 = [] + for key_data_257_item_data in self.key_data_257: + key_data_257_item = key_data_257_item_data.to_dict() + 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, + "ds_data_1": ds_data_1, + "ds_data_2": ds_data_2, + } + ) + if key_data_256 is not UNSET: + field_dict["key_data_256"] = key_data_256 + if key_data_257 is not UNSET: + field_dict["key_data_257"] = key_data_257 + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.domain_dnssec_request_ds_data_1 import ( + DomainDnssecRequestDsData1, + ) + from ..models.domain_dnssec_request_ds_data_2 import ( + DomainDnssecRequestDsData2, + ) + from ..models.domain_dnssec_request_key_data_256_item import ( + DomainDnssecRequestKeyData256Item, + ) + from ..models.domain_dnssec_request_key_data_257_item import ( + DomainDnssecRequestKeyData257Item, + ) + + d = dict(src_dict) + zone_ttl = d.pop("zone_ttl") + + ds_data_1 = DomainDnssecRequestDsData1.from_dict(d.pop("ds_data_1")) + + ds_data_2 = DomainDnssecRequestDsData2.from_dict(d.pop("ds_data_2")) + + _key_data_256 = d.pop("key_data_256", UNSET) + key_data_256: list[DomainDnssecRequestKeyData256Item] | Unset = UNSET + if _key_data_256 is not UNSET: + key_data_256 = [] + for key_data_256_item_data in _key_data_256: + key_data_256_item = DomainDnssecRequestKeyData256Item.from_dict( + key_data_256_item_data + ) + + key_data_256.append(key_data_256_item) + + _key_data_257 = d.pop("key_data_257", UNSET) + key_data_257: list[DomainDnssecRequestKeyData257Item] | Unset = UNSET + if _key_data_257 is not UNSET: + key_data_257 = [] + for key_data_257_item_data in _key_data_257: + key_data_257_item = DomainDnssecRequestKeyData257Item.from_dict( + key_data_257_item_data + ) + + key_data_257.append(key_data_257_item) + + domain_dnssec_request = cls( + zone_ttl=zone_ttl, + ds_data_1=ds_data_1, + ds_data_2=ds_data_2, + key_data_256=key_data_256, + 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 new file mode 100644 index 0000000..3a69429 --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_dnssec_request_ds_data_1.py @@ -0,0 +1,83 @@ +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 + +from ..models.domain_dnssec_request_ds_data_1_digest_type import ( + DomainDnssecRequestDsData1DigestType, +) + +T = TypeVar("T", bound="DomainDnssecRequestDsData1") + + +@_attrs_define +class DomainDnssecRequestDsData1: + """DS DATA first record""" + + key_tag: int + algorithm: int + digest_type: DomainDnssecRequestDsData1DigestType + digest: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + key_tag = self.key_tag + + algorithm = self.algorithm + + digest_type = self.digest_type.value + + digest = self.digest + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "key_tag": key_tag, + "algorithm": algorithm, + "digest_type": digest_type, + "digest": digest, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + key_tag = d.pop("key_tag") + + algorithm = d.pop("algorithm") + + digest_type = DomainDnssecRequestDsData1DigestType(d.pop("digest_type")) + + digest = d.pop("digest") + + domain_dnssec_request_ds_data_1 = cls( + key_tag=key_tag, + algorithm=algorithm, + digest_type=digest_type, + digest=digest, + ) + + domain_dnssec_request_ds_data_1.additional_properties = d + return domain_dnssec_request_ds_data_1 + + @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_digest_type.py b/src/shellrent_sdk/client/models/domain_dnssec_request_ds_data_1_digest_type.py new file mode 100644 index 0000000..32916bc --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_dnssec_request_ds_data_1_digest_type.py @@ -0,0 +1,10 @@ +from enum import IntEnum + + +class DomainDnssecRequestDsData1DigestType(IntEnum): + VALUE_1 = 1 + VALUE_2 = 2 + VALUE_4 = 4 + + def __str__(self) -> str: + return str(self.value) 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 new file mode 100644 index 0000000..09ffd5b --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_dnssec_request_ds_data_2.py @@ -0,0 +1,83 @@ +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 + +from ..models.domain_dnssec_request_ds_data_2_digest_type import ( + DomainDnssecRequestDsData2DigestType, +) + +T = TypeVar("T", bound="DomainDnssecRequestDsData2") + + +@_attrs_define +class DomainDnssecRequestDsData2: + """DS DATA second record""" + + key_tag: int + algorithm: int + digest_type: DomainDnssecRequestDsData2DigestType + digest: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + key_tag = self.key_tag + + algorithm = self.algorithm + + digest_type = self.digest_type.value + + digest = self.digest + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "key_tag": key_tag, + "algorithm": algorithm, + "digest_type": digest_type, + "digest": digest, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + key_tag = d.pop("key_tag") + + algorithm = d.pop("algorithm") + + digest_type = DomainDnssecRequestDsData2DigestType(d.pop("digest_type")) + + digest = d.pop("digest") + + domain_dnssec_request_ds_data_2 = cls( + key_tag=key_tag, + algorithm=algorithm, + digest_type=digest_type, + digest=digest, + ) + + domain_dnssec_request_ds_data_2.additional_properties = d + return domain_dnssec_request_ds_data_2 + + @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_2_digest_type.py b/src/shellrent_sdk/client/models/domain_dnssec_request_ds_data_2_digest_type.py new file mode 100644 index 0000000..d53bb72 --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_dnssec_request_ds_data_2_digest_type.py @@ -0,0 +1,10 @@ +from enum import IntEnum + + +class DomainDnssecRequestDsData2DigestType(IntEnum): + VALUE_1 = 1 + VALUE_2 = 2 + VALUE_4 = 4 + + def __str__(self) -> str: + return str(self.value) 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 new file mode 100644 index 0000000..681ba4f --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_dnssec_request_key_data_256_item.py @@ -0,0 +1,74 @@ +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 + +from ..models.domain_dnssec_request_key_data_256_item_algorithm import ( + DomainDnssecRequestKeyData256ItemAlgorithm, +) + +T = TypeVar("T", bound="DomainDnssecRequestKeyData256Item") + + +@_attrs_define +class DomainDnssecRequestKeyData256Item: + protocol: int + algorithm: DomainDnssecRequestKeyData256ItemAlgorithm + public_key: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + protocol = self.protocol + + algorithm = self.algorithm.value + + public_key = self.public_key + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "protocol": protocol, + "algorithm": algorithm, + "public_key": public_key, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + protocol = d.pop("protocol") + + algorithm = DomainDnssecRequestKeyData256ItemAlgorithm(d.pop("algorithm")) + + public_key = d.pop("public_key") + + domain_dnssec_request_key_data_256_item = cls( + protocol=protocol, + algorithm=algorithm, + public_key=public_key, + ) + + domain_dnssec_request_key_data_256_item.additional_properties = d + return domain_dnssec_request_key_data_256_item + + @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_key_data_256_item_algorithm.py b/src/shellrent_sdk/client/models/domain_dnssec_request_key_data_256_item_algorithm.py new file mode 100644 index 0000000..7d7b944 --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_dnssec_request_key_data_256_item_algorithm.py @@ -0,0 +1,9 @@ +from enum import IntEnum + + +class DomainDnssecRequestKeyData256ItemAlgorithm(IntEnum): + VALUE_8 = 8 + VALUE_13 = 13 + + def __str__(self) -> str: + return str(self.value) 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 new file mode 100644 index 0000000..c1d88d2 --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_dnssec_request_key_data_257_item.py @@ -0,0 +1,74 @@ +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 + +from ..models.domain_dnssec_request_key_data_257_item_algorithm import ( + DomainDnssecRequestKeyData257ItemAlgorithm, +) + +T = TypeVar("T", bound="DomainDnssecRequestKeyData257Item") + + +@_attrs_define +class DomainDnssecRequestKeyData257Item: + protocol: int + algorithm: DomainDnssecRequestKeyData257ItemAlgorithm + public_key: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + protocol = self.protocol + + algorithm = self.algorithm.value + + public_key = self.public_key + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "protocol": protocol, + "algorithm": algorithm, + "public_key": public_key, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + protocol = d.pop("protocol") + + algorithm = DomainDnssecRequestKeyData257ItemAlgorithm(d.pop("algorithm")) + + public_key = d.pop("public_key") + + domain_dnssec_request_key_data_257_item = cls( + protocol=protocol, + algorithm=algorithm, + public_key=public_key, + ) + + domain_dnssec_request_key_data_257_item.additional_properties = d + return domain_dnssec_request_key_data_257_item + + @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_key_data_257_item_algorithm.py b/src/shellrent_sdk/client/models/domain_dnssec_request_key_data_257_item_algorithm.py new file mode 100644 index 0000000..0bc9eaf --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_dnssec_request_key_data_257_item_algorithm.py @@ -0,0 +1,9 @@ +from enum import IntEnum + + +class DomainDnssecRequestKeyData257ItemAlgorithm(IntEnum): + VALUE_8 = 8 + VALUE_13 = 13 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/shellrent_sdk/client/models/domain_dnssec_response.py b/src/shellrent_sdk/client/models/domain_dnssec_response.py new file mode 100644 index 0000000..0189769 --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_dnssec_response.py @@ -0,0 +1,112 @@ +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_dnssec import DomainDnssec + from ..models.domain_dnssec_response_meta_type_0 import DomainDnssecResponseMetaType0 + + +T = TypeVar("T", bound="DomainDnssecResponse") + + +@_attrs_define +class DomainDnssecResponse: + error: int + message: None | str + data: DomainDnssec + meta: DomainDnssecResponseMetaType0 | None + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, DomainDnssecResponseMetaType0): + 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_dnssec import DomainDnssec + from ..models.domain_dnssec_response_meta_type_0 import ( + DomainDnssecResponseMetaType0, + ) + + 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 = 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")) + + domain_dnssec_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + domain_dnssec_response.additional_properties = d + return domain_dnssec_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_dnssec_response_meta_type_0.py b/src/shellrent_sdk/client/models/domain_dnssec_response_meta_type_0.py new file mode 100644 index 0000000..056c52c --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_dnssec_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..7785d09 --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_name.py @@ -0,0 +1,128 @@ +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="DomainName") + + +@_attrs_define +class DomainName: + unicode: None | str + punycode: None | str + unicode_name: None | str + punycode_name: None | str + unicode_tld: None | str + punycode_tld: None | str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + unicode: None | str + unicode = self.unicode + + punycode: None | str + punycode = self.punycode + + unicode_name: None | str + unicode_name = self.unicode_name + + punycode_name: None | str + punycode_name = self.punycode_name + + unicode_tld: None | str + unicode_tld = self.unicode_tld + + punycode_tld: None | str + punycode_tld = self.punycode_tld + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "unicode": unicode, + "punycode": punycode, + "unicode_name": unicode_name, + "punycode_name": punycode_name, + "unicode_tld": unicode_tld, + "punycode_tld": punycode_tld, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + + def _parse_unicode(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + unicode = _parse_unicode(d.pop("unicode")) + + def _parse_punycode(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + punycode = _parse_punycode(d.pop("punycode")) + + def _parse_unicode_name(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + unicode_name = _parse_unicode_name(d.pop("unicode_name")) + + def _parse_punycode_name(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + punycode_name = _parse_punycode_name(d.pop("punycode_name")) + + def _parse_unicode_tld(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + unicode_tld = _parse_unicode_tld(d.pop("unicode_tld")) + + def _parse_punycode_tld(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + punycode_tld = _parse_punycode_tld(d.pop("punycode_tld")) + + domain_name = cls( + unicode=unicode, + punycode=punycode, + unicode_name=unicode_name, + punycode_name=punycode_name, + unicode_tld=unicode_tld, + punycode_tld=punycode_tld, + ) + + domain_name.additional_properties = d + return domain_name + + @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 new file mode 100644 index 0000000..aa6d1f5 --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_paginated_list_response.py @@ -0,0 +1,99 @@ +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.pagination_meta import PaginationMeta + + +T = TypeVar("T", bound="DomainPaginatedListResponse") + + +@_attrs_define +class DomainPaginatedListResponse: + error: int + message: None | str + data: list[Domain] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.pagination_meta import PaginationMeta + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = Domain.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + domain_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + domain_paginated_list_response.additional_properties = d + return domain_paginated_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/domain_response.py b/src/shellrent_sdk/client/models/domain_response.py new file mode 100644 index 0000000..e8b36ab --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_response.py @@ -0,0 +1,110 @@ +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 new file mode 100644 index 0000000..5cb7b2c --- /dev/null +++ b/src/shellrent_sdk/client/models/domain_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..6585adb --- /dev/null +++ b/src/shellrent_sdk/client/models/empty_response.py @@ -0,0 +1,128 @@ +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.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 + message: None | str + data: EmptyResponseDataType0 | None + meta: EmptyResponseMetaType0 | None + 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 + + meta: dict[str, Any] | None + if isinstance(self.meta, EmptyResponseMetaType0): + 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.empty_response_data_type_0 import EmptyResponseDataType0 + from ..models.empty_response_meta_type_0 import EmptyResponseMetaType0 + + 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) -> 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) + + meta = _parse_meta(d.pop("meta")) + + empty_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + empty_response.additional_properties = d + return empty_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/empty_response_data_type_0.py b/src/shellrent_sdk/client/models/empty_response_data_type_0.py new file mode 100644 index 0000000..9916089 --- /dev/null +++ b/src/shellrent_sdk/client/models/empty_response_data_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..66e3065 --- /dev/null +++ b/src/shellrent_sdk/client/models/empty_response_meta_type_0.py @@ -0,0 +1,45 @@ +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.py b/src/shellrent_sdk/client/models/get_hosting_antivirus_response_200.py new file mode 100644 index 0000000..fd08f0e --- /dev/null +++ b/src/shellrent_sdk/client/models/get_hosting_antivirus_response_200.py @@ -0,0 +1,134 @@ +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.get_hosting_antivirus_response_200_meta_type_0 import ( + GetHostingAntivirusResponse200MetaType0, + ) + from ..models.hosting_antivirus import HostingAntivirus + + +T = TypeVar("T", bound="GetHostingAntivirusResponse200") + + +@_attrs_define +class GetHostingAntivirusResponse200: + error: int + message: None | str + data: HostingAntivirus | None + meta: GetHostingAntivirusResponse200MetaType0 | None + 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 + + message: None | str + message = self.message + + data: dict[str, Any] | None + if isinstance(self.data, HostingAntivirus): + data = self.data.to_dict() + else: + data = self.data + + meta: dict[str, Any] | None + if isinstance(self.meta, GetHostingAntivirusResponse200MetaType0): + 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.get_hosting_antivirus_response_200_meta_type_0 import ( + GetHostingAntivirusResponse200MetaType0, + ) + from ..models.hosting_antivirus import HostingAntivirus + + 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) -> HostingAntivirus | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + data_type_0 = HostingAntivirus.from_dict(data) + + return data_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(HostingAntivirus | None, data) + + 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")) + + get_hosting_antivirus_response_200 = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + get_hosting_antivirus_response_200.additional_properties = d + return get_hosting_antivirus_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/get_hosting_antivirus_response_200_meta_type_0.py b/src/shellrent_sdk/client/models/get_hosting_antivirus_response_200_meta_type_0.py new file mode 100644 index 0000000..4e1e993 --- /dev/null +++ b/src/shellrent_sdk/client/models/get_hosting_antivirus_response_200_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..6348e7d --- /dev/null +++ b/src/shellrent_sdk/client/models/health_status.py @@ -0,0 +1,56 @@ +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="HealthStatus") + + +@_attrs_define +class HealthStatus: + status: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + status = self.status + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "status": status, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + status = d.pop("status") + + health_status = cls( + status=status, + ) + + health_status.additional_properties = d + return health_status + + @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_response.py b/src/shellrent_sdk/client/models/health_status_response.py new file mode 100644 index 0000000..d738a7d --- /dev/null +++ b/src/shellrent_sdk/client/models/health_status_response.py @@ -0,0 +1,112 @@ +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.health_status import HealthStatus + from ..models.health_status_response_meta_type_0 import HealthStatusResponseMetaType0 + + +T = TypeVar("T", bound="HealthStatusResponse") + + +@_attrs_define +class HealthStatusResponse: + error: int + message: None | str + data: HealthStatus + meta: HealthStatusResponseMetaType0 | None + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, HealthStatusResponseMetaType0): + 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.health_status import HealthStatus + from ..models.health_status_response_meta_type_0 import ( + HealthStatusResponseMetaType0, + ) + + 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 = 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")) + + health_status_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + health_status_response.additional_properties = d + return health_status_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/health_status_response_meta_type_0.py b/src/shellrent_sdk/client/models/health_status_response_meta_type_0.py new file mode 100644 index 0000000..f3d8965 --- /dev/null +++ b/src/shellrent_sdk/client/models/health_status_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..7528181 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting.py @@ -0,0 +1,187 @@ +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="Hosting") + + +@_attrs_define +class Hosting: + hosting_id: int + purchase_id: int | None + parent_hosting_id: int | None + is_primary: bool + host_name: None | str + host_name_idna: None | str + full_name: None | str + full_name_idna: None | str + domain_full_name: None | str + domain_full_name_idna: None | str + php_version: None | str + is_active: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + hosting_id = self.hosting_id + + purchase_id: int | None + purchase_id = self.purchase_id + + parent_hosting_id: int | None + parent_hosting_id = self.parent_hosting_id + + is_primary = self.is_primary + + host_name: None | str + host_name = self.host_name + + host_name_idna: None | str + host_name_idna = self.host_name_idna + + full_name: None | str + full_name = self.full_name + + full_name_idna: None | str + full_name_idna = self.full_name_idna + + domain_full_name: None | str + domain_full_name = self.domain_full_name + + domain_full_name_idna: None | str + domain_full_name_idna = self.domain_full_name_idna + + php_version: None | str + php_version = self.php_version + + is_active = self.is_active + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "hosting_id": hosting_id, + "purchase_id": purchase_id, + "parent_hosting_id": parent_hosting_id, + "is_primary": is_primary, + "host_name": host_name, + "host_name_idna": host_name_idna, + "full_name": full_name, + "full_name_idna": full_name_idna, + "domain_full_name": domain_full_name, + "domain_full_name_idna": domain_full_name_idna, + "php_version": php_version, + "is_active": is_active, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + hosting_id = d.pop("hosting_id") + + def _parse_purchase_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + purchase_id = _parse_purchase_id(d.pop("purchase_id")) + + def _parse_parent_hosting_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + parent_hosting_id = _parse_parent_hosting_id(d.pop("parent_hosting_id")) + + is_primary = d.pop("is_primary") + + def _parse_host_name(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + host_name = _parse_host_name(d.pop("host_name")) + + def _parse_host_name_idna(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + host_name_idna = _parse_host_name_idna(d.pop("host_name_idna")) + + def _parse_full_name(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + full_name = _parse_full_name(d.pop("full_name")) + + def _parse_full_name_idna(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + full_name_idna = _parse_full_name_idna(d.pop("full_name_idna")) + + def _parse_domain_full_name(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + domain_full_name = _parse_domain_full_name(d.pop("domain_full_name")) + + def _parse_domain_full_name_idna(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + domain_full_name_idna = _parse_domain_full_name_idna(d.pop("domain_full_name_idna")) + + def _parse_php_version(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + php_version = _parse_php_version(d.pop("php_version")) + + is_active = d.pop("is_active") + + hosting = cls( + hosting_id=hosting_id, + purchase_id=purchase_id, + parent_hosting_id=parent_hosting_id, + is_primary=is_primary, + host_name=host_name, + host_name_idna=host_name_idna, + full_name=full_name, + full_name_idna=full_name_idna, + domain_full_name=domain_full_name, + domain_full_name_idna=domain_full_name_idna, + php_version=php_version, + is_active=is_active, + ) + + hosting.additional_properties = d + return hosting + + @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.py b/src/shellrent_sdk/client/models/hosting_antivirus.py new file mode 100644 index 0000000..268e66f --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_antivirus.py @@ -0,0 +1,221 @@ +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="HostingAntivirus") + + +@_attrs_define +class HostingAntivirus: + antivirus_id: int + hosting_id: int + status_code: None | str + status_name: None | str + status_color: None | str + antivirus_type: str + date_started: datetime.datetime | None + date_completed: datetime.datetime | None + date_timeout: datetime.datetime | None + total_files: int | None + total_infected: int | None + total_cleaned: int | None + 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 = self.hosting_id + + status_code: None | str + status_code = self.status_code + + status_name: None | str + status_name = self.status_name + + status_color: None | str + status_color = self.status_color + + antivirus_type = self.antivirus_type + + date_started: None | str + if isinstance(self.date_started, datetime.datetime): + date_started = self.date_started.isoformat() + else: + date_started = self.date_started + + date_completed: None | str + if isinstance(self.date_completed, datetime.datetime): + date_completed = self.date_completed.isoformat() + else: + date_completed = self.date_completed + + date_timeout: None | str + if isinstance(self.date_timeout, datetime.datetime): + date_timeout = self.date_timeout.isoformat() + else: + date_timeout = self.date_timeout + + total_files: int | None + total_files = self.total_files + + total_infected: int | None + total_infected = self.total_infected + + total_cleaned: int | None + total_cleaned = self.total_cleaned + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "antivirus_id": antivirus_id, + "hosting_id": hosting_id, + "status_code": status_code, + "status_name": status_name, + "status_color": status_color, + "antivirus_type": antivirus_type, + "date_started": date_started, + "date_completed": date_completed, + "date_timeout": date_timeout, + "total_files": total_files, + "total_infected": total_infected, + "total_cleaned": total_cleaned, + } + ) + + return field_dict + + @classmethod + 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_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_status_name(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + status_name = _parse_status_name(d.pop("status_name")) + + def _parse_status_color(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + status_color = _parse_status_color(d.pop("status_color")) + + antivirus_type = d.pop("antivirus_type") + + def _parse_date_started(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + date_started_type_0 = datetime.datetime.fromisoformat(data) + + return date_started_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + date_started = _parse_date_started(d.pop("date_started")) + + def _parse_date_completed(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + date_completed_type_0 = datetime.datetime.fromisoformat(data) + + return date_completed_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + date_completed = _parse_date_completed(d.pop("date_completed")) + + def _parse_date_timeout(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + date_timeout_type_0 = datetime.datetime.fromisoformat(data) + + return date_timeout_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + date_timeout = _parse_date_timeout(d.pop("date_timeout")) + + def _parse_total_files(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + total_files = _parse_total_files(d.pop("total_files")) + + def _parse_total_infected(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + total_infected = _parse_total_infected(d.pop("total_infected")) + + def _parse_total_cleaned(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + total_cleaned = _parse_total_cleaned(d.pop("total_cleaned")) + + hosting_antivirus = cls( + antivirus_id=antivirus_id, + hosting_id=hosting_id, + status_code=status_code, + status_name=status_name, + status_color=status_color, + antivirus_type=antivirus_type, + date_started=date_started, + date_completed=date_completed, + date_timeout=date_timeout, + total_files=total_files, + total_infected=total_infected, + total_cleaned=total_cleaned, + ) + + hosting_antivirus.additional_properties = d + return hosting_antivirus + + @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_removal_scan.py b/src/shellrent_sdk/client/models/hosting_antivirus_removal_scan.py new file mode 100644 index 0000000..2661e45 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_antivirus_removal_scan.py @@ -0,0 +1,110 @@ +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="HostingAntivirusRemovalScan") + + +@_attrs_define +class HostingAntivirusRemovalScan: + removal_scan_id: int + hosting_id: int + task_id: int | None + status: bool | None + error: None | str + date_created: datetime.datetime + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + removal_scan_id = self.removal_scan_id + + hosting_id = self.hosting_id + + task_id: int | None + task_id = self.task_id + + status: bool | None + status = self.status + + error: None | str + error = self.error + + date_created = self.date_created.isoformat() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "removal_scan_id": removal_scan_id, + "hosting_id": hosting_id, + "task_id": task_id, + "status": status, + "error": error, + "date_created": date_created, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + removal_scan_id = d.pop("removal_scan_id") + + hosting_id = d.pop("hosting_id") + + def _parse_task_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + task_id = _parse_task_id(d.pop("task_id")) + + def _parse_status(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) + + status = _parse_status(d.pop("status")) + + def _parse_error(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + error = _parse_error(d.pop("error")) + + date_created = datetime.datetime.fromisoformat(d.pop("date_created")) + + hosting_antivirus_removal_scan = cls( + removal_scan_id=removal_scan_id, + hosting_id=hosting_id, + task_id=task_id, + status=status, + error=error, + date_created=date_created, + ) + + hosting_antivirus_removal_scan.additional_properties = d + return hosting_antivirus_removal_scan + + @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_removal_scan_paginated_list_response.py b/src/shellrent_sdk/client/models/hosting_antivirus_removal_scan_paginated_list_response.py new file mode 100644 index 0000000..9615b89 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_antivirus_removal_scan_paginated_list_response.py @@ -0,0 +1,101 @@ +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_antivirus_removal_scan import HostingAntivirusRemovalScan + from ..models.pagination_meta import PaginationMeta + + +T = TypeVar("T", bound="HostingAntivirusRemovalScanPaginatedListResponse") + + +@_attrs_define +class HostingAntivirusRemovalScanPaginatedListResponse: + error: int + message: None | str + data: list[HostingAntivirusRemovalScan] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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_antivirus_removal_scan import ( + HostingAntivirusRemovalScan, + ) + from ..models.pagination_meta import PaginationMeta + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = HostingAntivirusRemovalScan.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + hosting_antivirus_removal_scan_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + hosting_antivirus_removal_scan_paginated_list_response.additional_properties = d + return hosting_antivirus_removal_scan_paginated_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_antivirus_removal_scan_response.py b/src/shellrent_sdk/client/models/hosting_antivirus_removal_scan_response.py new file mode 100644 index 0000000..23ff9b5 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_antivirus_removal_scan_response.py @@ -0,0 +1,118 @@ +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_antivirus_removal_scan import HostingAntivirusRemovalScan + from ..models.hosting_antivirus_removal_scan_response_meta_type_0 import ( + HostingAntivirusRemovalScanResponseMetaType0, + ) + + +T = TypeVar("T", bound="HostingAntivirusRemovalScanResponse") + + +@_attrs_define +class HostingAntivirusRemovalScanResponse: + error: int + message: None | str + data: HostingAntivirusRemovalScan + meta: HostingAntivirusRemovalScanResponseMetaType0 | None + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, HostingAntivirusRemovalScanResponseMetaType0): + 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_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") + + 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 = 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")) + + hosting_antivirus_removal_scan_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + hosting_antivirus_removal_scan_response.additional_properties = d + return hosting_antivirus_removal_scan_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_antivirus_removal_scan_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_antivirus_removal_scan_response_meta_type_0.py new file mode 100644 index 0000000..3618b37 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_antivirus_removal_scan_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..da79233 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_antivirus_scan.py @@ -0,0 +1,241 @@ +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="HostingAntivirusScan") + + +@_attrs_define +class HostingAntivirusScan: + antivirus_id: int + hosting_id: int + status_code: None | str + status_name: None | str + status_color: None | str + antivirus_type: str + scan_id: None | str + date_started: datetime.datetime | None + date_completed: datetime.datetime | None + date_timeout: datetime.datetime | None + date_created: datetime.datetime + total_files: int | None + total_infected: int | None + total_cleaned: int | None + 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 = self.hosting_id + + status_code: None | str + status_code = self.status_code + + status_name: None | str + status_name = self.status_name + + status_color: None | str + status_color = self.status_color + + antivirus_type = self.antivirus_type + + scan_id: None | str + scan_id = self.scan_id + + date_started: None | str + if isinstance(self.date_started, datetime.datetime): + date_started = self.date_started.isoformat() + else: + date_started = self.date_started + + date_completed: None | str + if isinstance(self.date_completed, datetime.datetime): + date_completed = self.date_completed.isoformat() + else: + date_completed = self.date_completed + + date_timeout: None | str + if isinstance(self.date_timeout, datetime.datetime): + date_timeout = self.date_timeout.isoformat() + else: + date_timeout = self.date_timeout + + date_created = self.date_created.isoformat() + + total_files: int | None + total_files = self.total_files + + total_infected: int | None + total_infected = self.total_infected + + total_cleaned: int | None + total_cleaned = self.total_cleaned + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "antivirus_id": antivirus_id, + "hosting_id": hosting_id, + "status_code": status_code, + "status_name": status_name, + "status_color": status_color, + "antivirus_type": antivirus_type, + "scan_id": scan_id, + "date_started": date_started, + "date_completed": date_completed, + "date_timeout": date_timeout, + "date_created": date_created, + "total_files": total_files, + "total_infected": total_infected, + "total_cleaned": total_cleaned, + } + ) + + return field_dict + + @classmethod + 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_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_status_name(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + status_name = _parse_status_name(d.pop("status_name")) + + def _parse_status_color(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + status_color = _parse_status_color(d.pop("status_color")) + + antivirus_type = d.pop("antivirus_type") + + def _parse_scan_id(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + scan_id = _parse_scan_id(d.pop("scan_id")) + + def _parse_date_started(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + date_started_type_0 = datetime.datetime.fromisoformat(data) + + return date_started_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + date_started = _parse_date_started(d.pop("date_started")) + + def _parse_date_completed(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + date_completed_type_0 = datetime.datetime.fromisoformat(data) + + return date_completed_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + date_completed = _parse_date_completed(d.pop("date_completed")) + + def _parse_date_timeout(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + date_timeout_type_0 = datetime.datetime.fromisoformat(data) + + return date_timeout_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + date_timeout = _parse_date_timeout(d.pop("date_timeout")) + + date_created = datetime.datetime.fromisoformat(d.pop("date_created")) + + def _parse_total_files(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + total_files = _parse_total_files(d.pop("total_files")) + + def _parse_total_infected(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + total_infected = _parse_total_infected(d.pop("total_infected")) + + def _parse_total_cleaned(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + total_cleaned = _parse_total_cleaned(d.pop("total_cleaned")) + + hosting_antivirus_scan = cls( + antivirus_id=antivirus_id, + hosting_id=hosting_id, + status_code=status_code, + status_name=status_name, + status_color=status_color, + antivirus_type=antivirus_type, + scan_id=scan_id, + date_started=date_started, + date_completed=date_completed, + date_timeout=date_timeout, + date_created=date_created, + total_files=total_files, + total_infected=total_infected, + total_cleaned=total_cleaned, + ) + + hosting_antivirus_scan.additional_properties = d + return hosting_antivirus_scan + + @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_paginated_list_response.py b/src/shellrent_sdk/client/models/hosting_antivirus_scan_paginated_list_response.py new file mode 100644 index 0000000..78e4aa4 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_antivirus_scan_paginated_list_response.py @@ -0,0 +1,99 @@ +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_antivirus_scan import HostingAntivirusScan + from ..models.pagination_meta import PaginationMeta + + +T = TypeVar("T", bound="HostingAntivirusScanPaginatedListResponse") + + +@_attrs_define +class HostingAntivirusScanPaginatedListResponse: + error: int + message: None | str + data: list[HostingAntivirusScan] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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_antivirus_scan import HostingAntivirusScan + from ..models.pagination_meta import PaginationMeta + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = HostingAntivirusScan.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + hosting_antivirus_scan_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + hosting_antivirus_scan_paginated_list_response.additional_properties = d + return hosting_antivirus_scan_paginated_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_antivirus_scan_response.py b/src/shellrent_sdk/client/models/hosting_antivirus_scan_response.py new file mode 100644 index 0000000..dffd410 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_antivirus_scan_response.py @@ -0,0 +1,116 @@ +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_antivirus_scan import HostingAntivirusScan + from ..models.hosting_antivirus_scan_response_meta_type_0 import ( + HostingAntivirusScanResponseMetaType0, + ) + + +T = TypeVar("T", bound="HostingAntivirusScanResponse") + + +@_attrs_define +class HostingAntivirusScanResponse: + error: int + message: None | str + data: HostingAntivirusScan + meta: HostingAntivirusScanResponseMetaType0 | None + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, HostingAntivirusScanResponseMetaType0): + 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_antivirus_scan import HostingAntivirusScan + from ..models.hosting_antivirus_scan_response_meta_type_0 import ( + HostingAntivirusScanResponseMetaType0, + ) + + 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 = 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")) + + hosting_antivirus_scan_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + hosting_antivirus_scan_response.additional_properties = d + return hosting_antivirus_scan_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_antivirus_scan_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_antivirus_scan_response_meta_type_0.py new file mode 100644 index 0000000..4fa73f2 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_antivirus_scan_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..fca4354 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_backup.py @@ -0,0 +1,236 @@ +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="HostingBackup") + + +@_attrs_define +class HostingBackup: + hosting_backup_id: int + hosting_id: int + backup_id: int + category: None | str + backup_type_code: None | str + backup_frequency_code: None | str + backup_date: datetime.datetime | None + backup_size: int | None + backup_duration: None | str + exit_status: int | None + error_type: None | str + mailbox_name: None | str + database_name: None | str + date_created: datetime.datetime | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + hosting_backup_id = self.hosting_backup_id + + hosting_id = self.hosting_id + + backup_id = self.backup_id + + category: None | str + category = self.category + + backup_type_code: None | str + backup_type_code = self.backup_type_code + + backup_frequency_code: None | str + backup_frequency_code = self.backup_frequency_code + + backup_date: None | str + if isinstance(self.backup_date, datetime.datetime): + backup_date = self.backup_date.isoformat() + else: + backup_date = self.backup_date + + backup_size: int | None + backup_size = self.backup_size + + backup_duration: None | str + backup_duration = self.backup_duration + + exit_status: int | None + exit_status = self.exit_status + + error_type: None | str + error_type = self.error_type + + mailbox_name: None | str + mailbox_name = self.mailbox_name + + database_name: None | str + database_name = self.database_name + + date_created: None | str + if isinstance(self.date_created, datetime.datetime): + date_created = self.date_created.isoformat() + else: + date_created = self.date_created + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "hosting_backup_id": hosting_backup_id, + "hosting_id": hosting_id, + "backup_id": backup_id, + "category": category, + "backup_type_code": backup_type_code, + "backup_frequency_code": backup_frequency_code, + "backup_date": backup_date, + "backup_size": backup_size, + "backup_duration": backup_duration, + "exit_status": exit_status, + "error_type": error_type, + "mailbox_name": mailbox_name, + "database_name": database_name, + "date_created": date_created, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + hosting_backup_id = d.pop("hosting_backup_id") + + hosting_id = d.pop("hosting_id") + + backup_id = d.pop("backup_id") + + def _parse_category(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + category = _parse_category(d.pop("category")) + + def _parse_backup_type_code(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + backup_type_code = _parse_backup_type_code(d.pop("backup_type_code")) + + def _parse_backup_frequency_code(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + backup_frequency_code = _parse_backup_frequency_code(d.pop("backup_frequency_code")) + + def _parse_backup_date(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + backup_date_type_0 = datetime.datetime.fromisoformat(data) + + return backup_date_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + backup_date = _parse_backup_date(d.pop("backup_date")) + + def _parse_backup_size(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + backup_size = _parse_backup_size(d.pop("backup_size")) + + def _parse_backup_duration(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + backup_duration = _parse_backup_duration(d.pop("backup_duration")) + + def _parse_exit_status(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + exit_status = _parse_exit_status(d.pop("exit_status")) + + def _parse_error_type(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + error_type = _parse_error_type(d.pop("error_type")) + + def _parse_mailbox_name(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + mailbox_name = _parse_mailbox_name(d.pop("mailbox_name")) + + def _parse_database_name(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + database_name = _parse_database_name(d.pop("database_name")) + + def _parse_date_created(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + date_created_type_0 = datetime.datetime.fromisoformat(data) + + return date_created_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + date_created = _parse_date_created(d.pop("date_created")) + + hosting_backup = cls( + hosting_backup_id=hosting_backup_id, + hosting_id=hosting_id, + backup_id=backup_id, + category=category, + backup_type_code=backup_type_code, + backup_frequency_code=backup_frequency_code, + backup_date=backup_date, + backup_size=backup_size, + backup_duration=backup_duration, + exit_status=exit_status, + error_type=error_type, + mailbox_name=mailbox_name, + database_name=database_name, + date_created=date_created, + ) + + hosting_backup.additional_properties = d + return hosting_backup + + @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_expose_request.py b/src/shellrent_sdk/client/models/hosting_backup_expose_request.py new file mode 100644 index 0000000..bac3b1b --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_backup_expose_request.py @@ -0,0 +1,87 @@ +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="HostingBackupExposeRequest") + + +@_attrs_define +class HostingBackupExposeRequest: + web_backup_id: int | None | Unset = UNSET + db_backup_id: int | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + web_backup_id: int | None | Unset + if isinstance(self.web_backup_id, Unset): + web_backup_id = UNSET + else: + web_backup_id = self.web_backup_id + + db_backup_id: int | None | Unset + if isinstance(self.db_backup_id, Unset): + db_backup_id = UNSET + else: + 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 + if db_backup_id is not UNSET: + field_dict["db_backup_id"] = db_backup_id + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + + def _parse_web_backup_id(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + web_backup_id = _parse_web_backup_id(d.pop("web_backup_id", UNSET)) + + def _parse_db_backup_id(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + db_backup_id = _parse_db_backup_id(d.pop("db_backup_id", UNSET)) + + hosting_backup_expose_request = cls( + web_backup_id=web_backup_id, + 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 new file mode 100644 index 0000000..62cb949 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_backup_list_response.py @@ -0,0 +1,122 @@ +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_backup import HostingBackup + from ..models.hosting_backup_list_response_meta_type_0 import HostingBackupListResponseMetaType0 + + +T = TypeVar("T", bound="HostingBackupListResponse") + + +@_attrs_define +class HostingBackupListResponse: + error: int + message: None | str + data: list[HostingBackup] + meta: HostingBackupListResponseMetaType0 | None + 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 + message = self.message + + data = [] + for data_item_data in self.data: + 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 + + 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_backup import HostingBackup + from ..models.hosting_backup_list_response_meta_type_0 import ( + HostingBackupListResponseMetaType0, + ) + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = HostingBackup.from_dict(data_item_data) + + 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")) + + hosting_backup_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + hosting_backup_list_response.additional_properties = d + return hosting_backup_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_backup_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_backup_list_response_meta_type_0.py new file mode 100644 index 0000000..0331f33 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_backup_list_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..1d02ed1 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_backup_response.py @@ -0,0 +1,112 @@ +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_backup import HostingBackup + from ..models.hosting_backup_response_meta_type_0 import HostingBackupResponseMetaType0 + + +T = TypeVar("T", bound="HostingBackupResponse") + + +@_attrs_define +class HostingBackupResponse: + error: int + message: None | str + data: HostingBackup + meta: HostingBackupResponseMetaType0 | None + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, HostingBackupResponseMetaType0): + 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_backup import HostingBackup + from ..models.hosting_backup_response_meta_type_0 import ( + HostingBackupResponseMetaType0, + ) + + 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 = 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")) + + hosting_backup_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + hosting_backup_response.additional_properties = d + return hosting_backup_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_backup_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_backup_response_meta_type_0.py new file mode 100644 index 0000000..229c3c3 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_backup_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..0ab9cd5 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_credential.py @@ -0,0 +1,97 @@ +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="HostingCredential") + + +@_attrs_define +class HostingCredential: + credential_id: int + type_: str + username: str + password: str + root_path: None | str + is_active: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + credential_id = self.credential_id + + type_ = self.type_ + + username = self.username + + password = self.password + + root_path: None | str + root_path = self.root_path + + is_active = self.is_active + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "credential_id": credential_id, + "type": type_, + "username": username, + "password": password, + "root_path": root_path, + "is_active": is_active, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + credential_id = d.pop("credential_id") + + type_ = d.pop("type") + + username = d.pop("username") + + password = d.pop("password") + + def _parse_root_path(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + root_path = _parse_root_path(d.pop("root_path")) + + is_active = d.pop("is_active") + + hosting_credential = cls( + credential_id=credential_id, + type_=type_, + username=username, + password=password, + root_path=root_path, + is_active=is_active, + ) + + hosting_credential.additional_properties = d + return hosting_credential + + @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_list_response.py b/src/shellrent_sdk/client/models/hosting_credential_list_response.py new file mode 100644 index 0000000..b4c7add --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_credential_list_response.py @@ -0,0 +1,124 @@ +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_credential import HostingCredential + from ..models.hosting_credential_list_response_meta_type_0 import ( + HostingCredentialListResponseMetaType0, + ) + + +T = TypeVar("T", bound="HostingCredentialListResponse") + + +@_attrs_define +class HostingCredentialListResponse: + error: int + message: None | str + data: list[HostingCredential] + meta: HostingCredentialListResponseMetaType0 | None + 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 + message = self.message + + data = [] + for data_item_data in self.data: + 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 + + 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_credential import HostingCredential + from ..models.hosting_credential_list_response_meta_type_0 import ( + HostingCredentialListResponseMetaType0, + ) + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = HostingCredential.from_dict(data_item_data) + + 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")) + + hosting_credential_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + hosting_credential_list_response.additional_properties = d + return hosting_credential_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_credential_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_credential_list_response_meta_type_0.py new file mode 100644 index 0000000..e5c53a4 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_credential_list_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..1f2db5b --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_cronjob.py @@ -0,0 +1,211 @@ +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="HostingCronjob") + + +@_attrs_define +class HostingCronjob: + cronjob_id: int + hosting_id: int + purchase_id: int + request_url: str + http_request_method: None | str + plan_month: None | str + plan_monthday: None | str + plan_weekday: None | str + plan_hour: None | str + plan_minute: None | str + active: bool + date_created: datetime.datetime | None + date_disabled: datetime.datetime | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + cronjob_id = self.cronjob_id + + hosting_id = self.hosting_id + + purchase_id = self.purchase_id + + request_url = self.request_url + + http_request_method: None | str + http_request_method = self.http_request_method + + plan_month: None | str + plan_month = self.plan_month + + plan_monthday: None | str + plan_monthday = self.plan_monthday + + plan_weekday: None | str + plan_weekday = self.plan_weekday + + plan_hour: None | str + plan_hour = self.plan_hour + + plan_minute: None | str + plan_minute = self.plan_minute + + active = self.active + + date_created: None | str + if isinstance(self.date_created, datetime.datetime): + date_created = self.date_created.isoformat() + else: + date_created = self.date_created + + date_disabled: None | str + if isinstance(self.date_disabled, datetime.datetime): + date_disabled = self.date_disabled.isoformat() + else: + date_disabled = self.date_disabled + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "cronjob_id": cronjob_id, + "hosting_id": hosting_id, + "purchase_id": purchase_id, + "request_url": request_url, + "http_request_method": http_request_method, + "plan_month": plan_month, + "plan_monthday": plan_monthday, + "plan_weekday": plan_weekday, + "plan_hour": plan_hour, + "plan_minute": plan_minute, + "active": active, + "date_created": date_created, + "date_disabled": date_disabled, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + cronjob_id = d.pop("cronjob_id") + + hosting_id = d.pop("hosting_id") + + purchase_id = d.pop("purchase_id") + + request_url = d.pop("request_url") + + def _parse_http_request_method(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + http_request_method = _parse_http_request_method(d.pop("http_request_method")) + + def _parse_plan_month(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + plan_month = _parse_plan_month(d.pop("plan_month")) + + def _parse_plan_monthday(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + plan_monthday = _parse_plan_monthday(d.pop("plan_monthday")) + + def _parse_plan_weekday(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + plan_weekday = _parse_plan_weekday(d.pop("plan_weekday")) + + def _parse_plan_hour(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + plan_hour = _parse_plan_hour(d.pop("plan_hour")) + + def _parse_plan_minute(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + plan_minute = _parse_plan_minute(d.pop("plan_minute")) + + active = d.pop("active") + + def _parse_date_created(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + date_created_type_0 = datetime.datetime.fromisoformat(data) + + return date_created_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + date_created = _parse_date_created(d.pop("date_created")) + + def _parse_date_disabled(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + date_disabled_type_0 = datetime.datetime.fromisoformat(data) + + return date_disabled_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + date_disabled = _parse_date_disabled(d.pop("date_disabled")) + + hosting_cronjob = cls( + cronjob_id=cronjob_id, + hosting_id=hosting_id, + purchase_id=purchase_id, + request_url=request_url, + http_request_method=http_request_method, + plan_month=plan_month, + plan_monthday=plan_monthday, + plan_weekday=plan_weekday, + plan_hour=plan_hour, + plan_minute=plan_minute, + active=active, + date_created=date_created, + date_disabled=date_disabled, + ) + + hosting_cronjob.additional_properties = d + return hosting_cronjob + + @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.py b/src/shellrent_sdk/client/models/hosting_cronjob_create_request.py new file mode 100644 index 0000000..26c9d85 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_cronjob_create_request.py @@ -0,0 +1,169 @@ +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="HostingCronjobCreateRequest") + + +@_attrs_define +class HostingCronjobCreateRequest: + request_protocol: str | Unset = UNSET + """ http or https """ + request_url: str | Unset = UNSET + """ URL without protocol """ + http_request_method: str | Unset = "GET" + plan_month: None | str | Unset = UNSET + plan_monthday: None | str | Unset = UNSET + plan_weekday: None | str | Unset = UNSET + plan_hour: None | str | Unset = UNSET + plan_minute: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + request_protocol = self.request_protocol + + request_url = self.request_url + + http_request_method = self.http_request_method + + plan_month: None | str | Unset + if isinstance(self.plan_month, Unset): + plan_month = UNSET + else: + plan_month = self.plan_month + + plan_monthday: None | str | Unset + if isinstance(self.plan_monthday, Unset): + plan_monthday = UNSET + else: + plan_monthday = self.plan_monthday + + plan_weekday: None | str | Unset + if isinstance(self.plan_weekday, Unset): + plan_weekday = UNSET + else: + plan_weekday = self.plan_weekday + + plan_hour: None | str | Unset + if isinstance(self.plan_hour, Unset): + plan_hour = UNSET + else: + plan_hour = self.plan_hour + + plan_minute: None | str | Unset + if isinstance(self.plan_minute, Unset): + plan_minute = UNSET + else: + 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 + if http_request_method is not UNSET: + field_dict["http_request_method"] = http_request_method + if plan_month is not UNSET: + field_dict["plan_month"] = plan_month + if plan_monthday is not UNSET: + field_dict["plan_monthday"] = plan_monthday + if plan_weekday is not UNSET: + field_dict["plan_weekday"] = plan_weekday + if plan_hour is not UNSET: + field_dict["plan_hour"] = plan_hour + if plan_minute is not UNSET: + field_dict["plan_minute"] = plan_minute + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + request_protocol = d.pop("request_protocol", UNSET) + + request_url = d.pop("request_url", UNSET) + + http_request_method = d.pop("http_request_method", UNSET) + + def _parse_plan_month(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + plan_month = _parse_plan_month(d.pop("plan_month", UNSET)) + + def _parse_plan_monthday(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + plan_monthday = _parse_plan_monthday(d.pop("plan_monthday", UNSET)) + + def _parse_plan_weekday(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + plan_weekday = _parse_plan_weekday(d.pop("plan_weekday", UNSET)) + + def _parse_plan_hour(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + plan_hour = _parse_plan_hour(d.pop("plan_hour", UNSET)) + + def _parse_plan_minute(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + plan_minute = _parse_plan_minute(d.pop("plan_minute", UNSET)) + + hosting_cronjob_create_request = cls( + request_protocol=request_protocol, + request_url=request_url, + http_request_method=http_request_method, + plan_month=plan_month, + plan_monthday=plan_monthday, + plan_weekday=plan_weekday, + plan_hour=plan_hour, + 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_paginated_list_response.py b/src/shellrent_sdk/client/models/hosting_cronjob_paginated_list_response.py new file mode 100644 index 0000000..ed257b3 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_cronjob_paginated_list_response.py @@ -0,0 +1,99 @@ +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_cronjob import HostingCronjob + from ..models.pagination_meta import PaginationMeta + + +T = TypeVar("T", bound="HostingCronjobPaginatedListResponse") + + +@_attrs_define +class HostingCronjobPaginatedListResponse: + error: int + message: None | str + data: list[HostingCronjob] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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_cronjob import HostingCronjob + from ..models.pagination_meta import PaginationMeta + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = HostingCronjob.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + hosting_cronjob_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + hosting_cronjob_paginated_list_response.additional_properties = d + return hosting_cronjob_paginated_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_cronjob_response.py b/src/shellrent_sdk/client/models/hosting_cronjob_response.py new file mode 100644 index 0000000..844af4e --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_cronjob_response.py @@ -0,0 +1,112 @@ +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_cronjob import HostingCronjob + from ..models.hosting_cronjob_response_meta_type_0 import HostingCronjobResponseMetaType0 + + +T = TypeVar("T", bound="HostingCronjobResponse") + + +@_attrs_define +class HostingCronjobResponse: + error: int + message: None | str + data: HostingCronjob + meta: HostingCronjobResponseMetaType0 | None + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, HostingCronjobResponseMetaType0): + 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_cronjob import HostingCronjob + from ..models.hosting_cronjob_response_meta_type_0 import ( + HostingCronjobResponseMetaType0, + ) + + 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 = 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")) + + hosting_cronjob_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + hosting_cronjob_response.additional_properties = d + return hosting_cronjob_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_cronjob_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_cronjob_response_meta_type_0.py new file mode 100644 index 0000000..42b18a4 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_cronjob_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..67c2c83 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_database.py @@ -0,0 +1,122 @@ +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="HostingDatabase") + + +@_attrs_define +class HostingDatabase: + database_id: str + name: str + type_: str + credential_id: int | None + username: None | str + supplier_code: None | str + table_count: int | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + database_id = self.database_id + + name = self.name + + type_ = self.type_ + + credential_id: int | None + credential_id = self.credential_id + + username: None | str + username = self.username + + supplier_code: None | str + supplier_code = self.supplier_code + + table_count: int | None + table_count = self.table_count + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "database_id": database_id, + "name": name, + "type": type_, + "credential_id": credential_id, + "username": username, + "supplier_code": supplier_code, + "table_count": table_count, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + database_id = d.pop("database_id") + + name = d.pop("name") + + type_ = d.pop("type") + + def _parse_credential_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + credential_id = _parse_credential_id(d.pop("credential_id")) + + 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_supplier_code(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + supplier_code = _parse_supplier_code(d.pop("supplier_code")) + + def _parse_table_count(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + table_count = _parse_table_count(d.pop("table_count")) + + hosting_database = cls( + database_id=database_id, + name=name, + type_=type_, + credential_id=credential_id, + username=username, + supplier_code=supplier_code, + table_count=table_count, + ) + + hosting_database.additional_properties = d + return hosting_database + + @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_create_request.py b/src/shellrent_sdk/client/models/hosting_database_create_request.py new file mode 100644 index 0000000..554d40f --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_database_create_request.py @@ -0,0 +1,89 @@ +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 new file mode 100644 index 0000000..79feee4 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_database_list_response.py @@ -0,0 +1,124 @@ +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_database import HostingDatabase + from ..models.hosting_database_list_response_meta_type_0 import ( + HostingDatabaseListResponseMetaType0, + ) + + +T = TypeVar("T", bound="HostingDatabaseListResponse") + + +@_attrs_define +class HostingDatabaseListResponse: + error: int + message: None | str + data: list[HostingDatabase] + meta: HostingDatabaseListResponseMetaType0 | None + 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 + message = self.message + + data = [] + for data_item_data in self.data: + 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 + + 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_database import HostingDatabase + from ..models.hosting_database_list_response_meta_type_0 import ( + HostingDatabaseListResponseMetaType0, + ) + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = HostingDatabase.from_dict(data_item_data) + + 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")) + + hosting_database_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + hosting_database_list_response.additional_properties = d + return hosting_database_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_database_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_database_list_response_meta_type_0.py new file mode 100644 index 0000000..502a38a --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_database_list_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..0d93fd9 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_database_response.py @@ -0,0 +1,112 @@ +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_database import HostingDatabase + from ..models.hosting_database_response_meta_type_0 import HostingDatabaseResponseMetaType0 + + +T = TypeVar("T", bound="HostingDatabaseResponse") + + +@_attrs_define +class HostingDatabaseResponse: + error: int + message: None | str + data: HostingDatabase + meta: HostingDatabaseResponseMetaType0 | None + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, HostingDatabaseResponseMetaType0): + 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_database import HostingDatabase + from ..models.hosting_database_response_meta_type_0 import ( + HostingDatabaseResponseMetaType0, + ) + + 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 = 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")) + + hosting_database_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + hosting_database_response.additional_properties = d + return hosting_database_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_database_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_database_response_meta_type_0.py new file mode 100644 index 0000000..174a57a --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_database_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..5888911 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_dns_record.py @@ -0,0 +1,222 @@ +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="HostingDnsRecord") + + +@_attrs_define +class HostingDnsRecord: + dns_record_id: int + type_: str + host: str + destination: str + priority: int | None + weight: int | None + port: int | None + service: None | str + protocol: None | str + caa_flag: int | None + caa_tag: None | str + caa_can_sign_http_exchanges: bool | None + tlsa_usage: None | str + tlsa_selector: None | str + tlsa_matching_type: None | str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + dns_record_id = self.dns_record_id + + type_ = self.type_ + + host = self.host + + destination = self.destination + + priority: int | None + priority = self.priority + + weight: int | None + weight = self.weight + + port: int | None + port = self.port + + service: None | str + service = self.service + + protocol: None | str + protocol = self.protocol + + caa_flag: int | None + caa_flag = self.caa_flag + + caa_tag: None | str + caa_tag = self.caa_tag + + caa_can_sign_http_exchanges: bool | None + caa_can_sign_http_exchanges = self.caa_can_sign_http_exchanges + + tlsa_usage: None | str + tlsa_usage = self.tlsa_usage + + tlsa_selector: None | str + tlsa_selector = self.tlsa_selector + + tlsa_matching_type: None | str + tlsa_matching_type = self.tlsa_matching_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "dns_record_id": dns_record_id, + "type": type_, + "host": host, + "destination": destination, + "priority": priority, + "weight": weight, + "port": port, + "service": service, + "protocol": protocol, + "caa_flag": caa_flag, + "caa_tag": caa_tag, + "caa_can_sign_http_exchanges": caa_can_sign_http_exchanges, + "tlsa_usage": tlsa_usage, + "tlsa_selector": tlsa_selector, + "tlsa_matching_type": tlsa_matching_type, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + dns_record_id = d.pop("dns_record_id") + + type_ = d.pop("type") + + host = d.pop("host") + + destination = d.pop("destination") + + def _parse_priority(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + priority = _parse_priority(d.pop("priority")) + + def _parse_weight(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + weight = _parse_weight(d.pop("weight")) + + def _parse_port(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + port = _parse_port(d.pop("port")) + + def _parse_service(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + service = _parse_service(d.pop("service")) + + def _parse_protocol(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + protocol = _parse_protocol(d.pop("protocol")) + + def _parse_caa_flag(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + caa_flag = _parse_caa_flag(d.pop("caa_flag")) + + def _parse_caa_tag(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + caa_tag = _parse_caa_tag(d.pop("caa_tag")) + + def _parse_caa_can_sign_http_exchanges(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) + + caa_can_sign_http_exchanges = _parse_caa_can_sign_http_exchanges( + d.pop("caa_can_sign_http_exchanges") + ) + + def _parse_tlsa_usage(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + tlsa_usage = _parse_tlsa_usage(d.pop("tlsa_usage")) + + def _parse_tlsa_selector(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + tlsa_selector = _parse_tlsa_selector(d.pop("tlsa_selector")) + + def _parse_tlsa_matching_type(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + tlsa_matching_type = _parse_tlsa_matching_type(d.pop("tlsa_matching_type")) + + hosting_dns_record = cls( + dns_record_id=dns_record_id, + type_=type_, + host=host, + destination=destination, + priority=priority, + weight=weight, + port=port, + service=service, + protocol=protocol, + caa_flag=caa_flag, + caa_tag=caa_tag, + caa_can_sign_http_exchanges=caa_can_sign_http_exchanges, + tlsa_usage=tlsa_usage, + tlsa_selector=tlsa_selector, + tlsa_matching_type=tlsa_matching_type, + ) + + hosting_dns_record.additional_properties = d + return hosting_dns_record + + @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_list_response.py b/src/shellrent_sdk/client/models/hosting_dns_record_list_response.py new file mode 100644 index 0000000..2c13b0f --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_dns_record_list_response.py @@ -0,0 +1,124 @@ +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_dns_record import HostingDnsRecord + from ..models.hosting_dns_record_list_response_meta_type_0 import ( + HostingDnsRecordListResponseMetaType0, + ) + + +T = TypeVar("T", bound="HostingDnsRecordListResponse") + + +@_attrs_define +class HostingDnsRecordListResponse: + error: int + message: None | str + data: list[HostingDnsRecord] + meta: HostingDnsRecordListResponseMetaType0 | None + 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 + message = self.message + + data = [] + for data_item_data in self.data: + 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 + + 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_dns_record import HostingDnsRecord + from ..models.hosting_dns_record_list_response_meta_type_0 import ( + HostingDnsRecordListResponseMetaType0, + ) + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = HostingDnsRecord.from_dict(data_item_data) + + 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")) + + hosting_dns_record_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + hosting_dns_record_list_response.additional_properties = d + return hosting_dns_record_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_dns_record_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_dns_record_list_response_meta_type_0.py new file mode 100644 index 0000000..6fb9f7f --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_dns_record_list_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..160a183 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_email_alias.py @@ -0,0 +1,124 @@ +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="HostingEmailAlias") + + +@_attrs_define +class HostingEmailAlias: + alias_id: str + address: str + address_idna: str + goto: None | str + goto_idna: None | str + domain: str + domain_idna: str + is_active: bool + does_exist: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + alias_id = self.alias_id + + address = self.address + + address_idna = self.address_idna + + goto: None | str + goto = self.goto + + goto_idna: None | str + goto_idna = self.goto_idna + + domain = self.domain + + domain_idna = self.domain_idna + + is_active = self.is_active + + does_exist = self.does_exist + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "alias_id": alias_id, + "address": address, + "address_idna": address_idna, + "goto": goto, + "goto_idna": goto_idna, + "domain": domain, + "domain_idna": domain_idna, + "is_active": is_active, + "does_exist": does_exist, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + alias_id = d.pop("alias_id") + + address = d.pop("address") + + address_idna = d.pop("address_idna") + + def _parse_goto(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + goto = _parse_goto(d.pop("goto")) + + def _parse_goto_idna(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + goto_idna = _parse_goto_idna(d.pop("goto_idna")) + + domain = d.pop("domain") + + domain_idna = d.pop("domain_idna") + + is_active = d.pop("is_active") + + does_exist = d.pop("does_exist") + + hosting_email_alias = cls( + alias_id=alias_id, + address=address, + address_idna=address_idna, + goto=goto, + goto_idna=goto_idna, + domain=domain, + domain_idna=domain_idna, + is_active=is_active, + does_exist=does_exist, + ) + + hosting_email_alias.additional_properties = d + return hosting_email_alias + + @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_create_request.py b/src/shellrent_sdk/client/models/hosting_email_alias_create_request.py new file mode 100644 index 0000000..6dce7a7 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_email_alias_create_request.py @@ -0,0 +1,67 @@ +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="HostingEmailAliasCreateRequest") + + +@_attrs_define +class HostingEmailAliasCreateRequest: + alias_name: str | Unset = UNSET + """ Alias local-part without domain. """ + goto: list[str] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + 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 + + 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 + + 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) + + goto = cast(list[str], d.pop("goto", UNSET)) + + 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 new file mode 100644 index 0000000..66e980d --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_email_alias_list_response.py @@ -0,0 +1,124 @@ +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_alias import HostingEmailAlias + from ..models.hosting_email_alias_list_response_meta_type_0 import ( + HostingEmailAliasListResponseMetaType0, + ) + + +T = TypeVar("T", bound="HostingEmailAliasListResponse") + + +@_attrs_define +class HostingEmailAliasListResponse: + error: int + message: None | str + data: list[HostingEmailAlias] + meta: HostingEmailAliasListResponseMetaType0 | None + 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 + message = self.message + + data = [] + for data_item_data in self.data: + 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 + + 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_alias import HostingEmailAlias + from ..models.hosting_email_alias_list_response_meta_type_0 import ( + HostingEmailAliasListResponseMetaType0, + ) + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = HostingEmailAlias.from_dict(data_item_data) + + 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")) + + hosting_email_alias_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + hosting_email_alias_list_response.additional_properties = d + return hosting_email_alias_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_alias_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_email_alias_list_response_meta_type_0.py new file mode 100644 index 0000000..bccb398 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_email_alias_list_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..672fa4b --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_email_alias_response.py @@ -0,0 +1,114 @@ +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_alias import HostingEmailAlias + from ..models.hosting_email_alias_response_meta_type_0 import HostingEmailAliasResponseMetaType0 + + +T = TypeVar("T", bound="HostingEmailAliasResponse") + + +@_attrs_define +class HostingEmailAliasResponse: + error: int + message: None | str + data: HostingEmailAlias + meta: HostingEmailAliasResponseMetaType0 | None + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, HostingEmailAliasResponseMetaType0): + 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_alias import HostingEmailAlias + from ..models.hosting_email_alias_response_meta_type_0 import ( + HostingEmailAliasResponseMetaType0, + ) + + 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 = 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")) + + hosting_email_alias_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + hosting_email_alias_response.additional_properties = d + return hosting_email_alias_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_alias_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_email_alias_response_meta_type_0.py new file mode 100644 index 0000000..5ad8563 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_email_alias_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..ece973c --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_email_allow_list.py @@ -0,0 +1,96 @@ +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="HostingEmailAllowList") + + +@_attrs_define +class HostingEmailAllowList: + allow_list_id: int + hosting_id: int + sender: str + domain: None | str + mailbox: None | str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + allow_list_id = self.allow_list_id + + hosting_id = self.hosting_id + + sender = self.sender + + domain: None | str + domain = self.domain + + mailbox: None | str + mailbox = self.mailbox + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "allow_list_id": allow_list_id, + "hosting_id": hosting_id, + "sender": sender, + "domain": domain, + "mailbox": mailbox, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + allow_list_id = d.pop("allow_list_id") + + hosting_id = d.pop("hosting_id") + + sender = d.pop("sender") + + 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_mailbox(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + mailbox = _parse_mailbox(d.pop("mailbox")) + + hosting_email_allow_list = cls( + allow_list_id=allow_list_id, + hosting_id=hosting_id, + sender=sender, + domain=domain, + mailbox=mailbox, + ) + + hosting_email_allow_list.additional_properties = d + return hosting_email_allow_list + + @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_paginated_list_response.py b/src/shellrent_sdk/client/models/hosting_email_allow_list_paginated_list_response.py new file mode 100644 index 0000000..1a4f320 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_email_allow_list_paginated_list_response.py @@ -0,0 +1,99 @@ +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_allow_list import HostingEmailAllowList + from ..models.pagination_meta import PaginationMeta + + +T = TypeVar("T", bound="HostingEmailAllowListPaginatedListResponse") + + +@_attrs_define +class HostingEmailAllowListPaginatedListResponse: + error: int + message: None | str + data: list[HostingEmailAllowList] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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_allow_list import HostingEmailAllowList + from ..models.pagination_meta import PaginationMeta + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = HostingEmailAllowList.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + hosting_email_allow_list_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + hosting_email_allow_list_paginated_list_response.additional_properties = d + return hosting_email_allow_list_paginated_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_allow_list_response.py b/src/shellrent_sdk/client/models/hosting_email_allow_list_response.py new file mode 100644 index 0000000..86e5e9d --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_email_allow_list_response.py @@ -0,0 +1,116 @@ +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_allow_list import HostingEmailAllowList + from ..models.hosting_email_allow_list_response_meta_type_0 import ( + HostingEmailAllowListResponseMetaType0, + ) + + +T = TypeVar("T", bound="HostingEmailAllowListResponse") + + +@_attrs_define +class HostingEmailAllowListResponse: + error: int + message: None | str + data: HostingEmailAllowList + meta: HostingEmailAllowListResponseMetaType0 | None + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, HostingEmailAllowListResponseMetaType0): + 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_allow_list import HostingEmailAllowList + from ..models.hosting_email_allow_list_response_meta_type_0 import ( + HostingEmailAllowListResponseMetaType0, + ) + + 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 = 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")) + + hosting_email_allow_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + hosting_email_allow_list_response.additional_properties = d + return hosting_email_allow_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_allow_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_email_allow_list_response_meta_type_0.py new file mode 100644 index 0000000..182d18d --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_email_allow_list_response_meta_type_0.py @@ -0,0 +1,45 @@ +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.py b/src/shellrent_sdk/client/models/hosting_email_bloc_list.py new file mode 100644 index 0000000..b1b312f --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_email_bloc_list.py @@ -0,0 +1,96 @@ +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="HostingEmailBlocList") + + +@_attrs_define +class HostingEmailBlocList: + block_list_id: int + hosting_id: int + sender: str + domain: None | str + mailbox: None | str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + block_list_id = self.block_list_id + + hosting_id = self.hosting_id + + sender = self.sender + + domain: None | str + domain = self.domain + + mailbox: None | str + mailbox = self.mailbox + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "block_list_id": block_list_id, + "hosting_id": hosting_id, + "sender": sender, + "domain": domain, + "mailbox": mailbox, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + block_list_id = d.pop("block_list_id") + + hosting_id = d.pop("hosting_id") + + sender = d.pop("sender") + + 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_mailbox(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + mailbox = _parse_mailbox(d.pop("mailbox")) + + hosting_email_bloc_list = cls( + block_list_id=block_list_id, + hosting_id=hosting_id, + sender=sender, + domain=domain, + mailbox=mailbox, + ) + + hosting_email_bloc_list.additional_properties = d + return hosting_email_bloc_list + + @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_paginated_list_response.py b/src/shellrent_sdk/client/models/hosting_email_bloc_list_paginated_list_response.py new file mode 100644 index 0000000..79af455 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_email_bloc_list_paginated_list_response.py @@ -0,0 +1,99 @@ +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.pagination_meta import PaginationMeta + + +T = TypeVar("T", bound="HostingEmailBlocListPaginatedListResponse") + + +@_attrs_define +class HostingEmailBlocListPaginatedListResponse: + error: int + message: None | str + data: list[HostingEmailBlocList] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.pagination_meta import PaginationMeta + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = HostingEmailBlocList.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + hosting_email_bloc_list_paginated_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 + + @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 new file mode 100644 index 0000000..220fe82 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_email_bloc_list_response.py @@ -0,0 +1,116 @@ +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 new file mode 100644 index 0000000..eb39241 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_email_bloc_list_response_meta_type_0.py @@ -0,0 +1,45 @@ +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_catch_all.py b/src/shellrent_sdk/client/models/hosting_email_catch_all.py new file mode 100644 index 0000000..2d1f1bb --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_email_catch_all.py @@ -0,0 +1,77 @@ +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="HostingEmailCatchAll") + + +@_attrs_define +class HostingEmailCatchAll: + is_active: bool + address: str + address_idna: str + destinations: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + is_active = self.is_active + + address = self.address + + address_idna = self.address_idna + + destinations = self.destinations + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "is_active": is_active, + "address": address, + "address_idna": address_idna, + "destinations": destinations, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + is_active = d.pop("is_active") + + address = d.pop("address") + + address_idna = d.pop("address_idna") + + destinations = cast(list[str], d.pop("destinations")) + + hosting_email_catch_all = cls( + is_active=is_active, + address=address, + address_idna=address_idna, + destinations=destinations, + ) + + hosting_email_catch_all.additional_properties = d + return hosting_email_catch_all + + @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_request.py b/src/shellrent_sdk/client/models/hosting_email_catch_all_request.py new file mode 100644 index 0000000..b2c753b --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_email_catch_all_request.py @@ -0,0 +1,58 @@ +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="HostingEmailCatchAllRequest") + + +@_attrs_define +class HostingEmailCatchAllRequest: + goto: list[str] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + goto: list[str] | Unset = UNSET + if not isinstance(self.goto, Unset): + 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 + + 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)) + + 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 new file mode 100644 index 0000000..42158d7 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_email_catch_all_response.py @@ -0,0 +1,116 @@ +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_catch_all import HostingEmailCatchAll + from ..models.hosting_email_catch_all_response_meta_type_0 import ( + HostingEmailCatchAllResponseMetaType0, + ) + + +T = TypeVar("T", bound="HostingEmailCatchAllResponse") + + +@_attrs_define +class HostingEmailCatchAllResponse: + error: int + message: None | str + data: HostingEmailCatchAll + meta: HostingEmailCatchAllResponseMetaType0 | None + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, HostingEmailCatchAllResponseMetaType0): + 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_catch_all import HostingEmailCatchAll + from ..models.hosting_email_catch_all_response_meta_type_0 import ( + HostingEmailCatchAllResponseMetaType0, + ) + + 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 = 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")) + + hosting_email_catch_all_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + hosting_email_catch_all_response.additional_properties = d + return hosting_email_catch_all_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_catch_all_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_email_catch_all_response_meta_type_0.py new file mode 100644 index 0000000..88d4d51 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_email_catch_all_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..c5ba644 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_email_wblist_request.py @@ -0,0 +1,87 @@ +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="HostingEmailWblistRequest") + + +@_attrs_define +class HostingEmailWblistRequest: + domain: None | str | Unset = UNSET + mailbox: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + domain: None | str | Unset + if isinstance(self.domain, Unset): + domain = UNSET + else: + domain = self.domain + + mailbox: None | str | Unset + if isinstance(self.mailbox, Unset): + mailbox = UNSET + else: + 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 + if mailbox is not UNSET: + field_dict["mailbox"] = mailbox + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + + def _parse_domain(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + domain = _parse_domain(d.pop("domain", UNSET)) + + def _parse_mailbox(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + mailbox = _parse_mailbox(d.pop("mailbox", UNSET)) + + hosting_email_wblist_request = cls( + domain=domain, + 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 new file mode 100644 index 0000000..c673bf2 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_file_protection_update_request.py @@ -0,0 +1,56 @@ +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 + +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) + + 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 + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + enable = d.pop("enable", UNSET) + + 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 new file mode 100644 index 0000000..59a9993 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_http_version_update_request.py @@ -0,0 +1,57 @@ +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 + +from ..types import UNSET, Unset + +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) + + 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 + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + version = d.pop("version", UNSET) + + 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_mod_security.py b/src/shellrent_sdk/client/models/hosting_mod_security.py new file mode 100644 index 0000000..fccdc79 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_mod_security.py @@ -0,0 +1,140 @@ +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="HostingModSecurity") + + +@_attrs_define +class HostingModSecurity: + hosting_id: int + is_available: bool + is_active: bool + firewall_compatible: bool + full_strict: bool | None + custom_rules: list[str] | None + custom_set: list[str] | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + hosting_id = self.hosting_id + + is_available = self.is_available + + is_active = self.is_active + + firewall_compatible = self.firewall_compatible + + full_strict: bool | None + full_strict = self.full_strict + + custom_rules: list[str] | None + if isinstance(self.custom_rules, list): + custom_rules = self.custom_rules + + else: + custom_rules = self.custom_rules + + custom_set: list[str] | None + if isinstance(self.custom_set, list): + custom_set = self.custom_set + + else: + custom_set = self.custom_set + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "hosting_id": hosting_id, + "is_available": is_available, + "is_active": is_active, + "firewall_compatible": firewall_compatible, + "full_strict": full_strict, + "custom_rules": custom_rules, + "custom_set": custom_set, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + hosting_id = d.pop("hosting_id") + + is_available = d.pop("is_available") + + is_active = d.pop("is_active") + + firewall_compatible = d.pop("firewall_compatible") + + def _parse_full_strict(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) + + full_strict = _parse_full_strict(d.pop("full_strict")) + + def _parse_custom_rules(data: object) -> list[str] | None: + if data is None: + return data + try: + if not isinstance(data, list): + raise TypeError() + custom_rules_type_0 = cast(list[str], data) + + return custom_rules_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[str] | None, data) + + custom_rules = _parse_custom_rules(d.pop("custom_rules")) + + def _parse_custom_set(data: object) -> list[str] | None: + if data is None: + return data + try: + if not isinstance(data, list): + raise TypeError() + custom_set_type_0 = cast(list[str], data) + + return custom_set_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[str] | None, data) + + custom_set = _parse_custom_set(d.pop("custom_set")) + + hosting_mod_security = cls( + hosting_id=hosting_id, + is_available=is_available, + is_active=is_active, + firewall_compatible=firewall_compatible, + full_strict=full_strict, + custom_rules=custom_rules, + custom_set=custom_set, + ) + + hosting_mod_security.additional_properties = d + return hosting_mod_security + + @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_response.py b/src/shellrent_sdk/client/models/hosting_mod_security_response.py new file mode 100644 index 0000000..6591eb3 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_mod_security_response.py @@ -0,0 +1,116 @@ +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_mod_security import HostingModSecurity + from ..models.hosting_mod_security_response_meta_type_0 import ( + HostingModSecurityResponseMetaType0, + ) + + +T = TypeVar("T", bound="HostingModSecurityResponse") + + +@_attrs_define +class HostingModSecurityResponse: + error: int + message: None | str + data: HostingModSecurity + meta: HostingModSecurityResponseMetaType0 | None + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, HostingModSecurityResponseMetaType0): + 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_mod_security import HostingModSecurity + from ..models.hosting_mod_security_response_meta_type_0 import ( + HostingModSecurityResponseMetaType0, + ) + + 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 = 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")) + + hosting_mod_security_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + hosting_mod_security_response.additional_properties = d + return hosting_mod_security_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_mod_security_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_mod_security_response_meta_type_0.py new file mode 100644 index 0000000..ac2cb5d --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_mod_security_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..433c83f --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_mod_security_rule.py @@ -0,0 +1,90 @@ +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="HostingModSecurityRule") + + +@_attrs_define +class HostingModSecurityRule: + rule_id: int + hosting_id: int + rule_number: str + description: None | str + included: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + rule_id = self.rule_id + + hosting_id = self.hosting_id + + rule_number = self.rule_number + + description: None | str + description = self.description + + included = self.included + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "rule_id": rule_id, + "hosting_id": hosting_id, + "rule_number": rule_number, + "description": description, + "included": included, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + rule_id = d.pop("rule_id") + + hosting_id = d.pop("hosting_id") + + rule_number = d.pop("rule_number") + + def _parse_description(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + description = _parse_description(d.pop("description")) + + included = d.pop("included") + + hosting_mod_security_rule = cls( + rule_id=rule_id, + hosting_id=hosting_id, + rule_number=rule_number, + description=description, + included=included, + ) + + hosting_mod_security_rule.additional_properties = d + return hosting_mod_security_rule + + @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_bulk_request.py b/src/shellrent_sdk/client/models/hosting_mod_security_rule_bulk_request.py new file mode 100644 index 0000000..e8a2046 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_mod_security_rule_bulk_request.py @@ -0,0 +1,58 @@ +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="HostingModSecurityRuleBulkRequest") + + +@_attrs_define +class HostingModSecurityRuleBulkRequest: + rule_ids: list[int] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + 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 + + 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 + + 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)) + + 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 new file mode 100644 index 0000000..e4aede7 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_mod_security_rule_create_request.py @@ -0,0 +1,75 @@ +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="HostingModSecurityRuleCreateRequest") + + +@_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) + + 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 + + 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 + if description is not UNSET: + field_dict["description"] = description + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + rule_number = d.pop("rule_number", UNSET) + + 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)) + + 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 new file mode 100644 index 0000000..d7774fd --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_mod_security_rule_list_response.py @@ -0,0 +1,124 @@ +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_mod_security_rule import HostingModSecurityRule + from ..models.hosting_mod_security_rule_list_response_meta_type_0 import ( + HostingModSecurityRuleListResponseMetaType0, + ) + + +T = TypeVar("T", bound="HostingModSecurityRuleListResponse") + + +@_attrs_define +class HostingModSecurityRuleListResponse: + error: int + message: None | str + data: list[HostingModSecurityRule] + meta: HostingModSecurityRuleListResponseMetaType0 | None + 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 + message = self.message + + data = [] + for data_item_data in self.data: + 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 + + 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_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") + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = HostingModSecurityRule.from_dict(data_item_data) + + 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")) + + hosting_mod_security_rule_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + hosting_mod_security_rule_list_response.additional_properties = d + return hosting_mod_security_rule_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_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 new file mode 100644 index 0000000..9d5ba0e --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_mod_security_rule_list_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..694891e --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_mod_security_rule_response.py @@ -0,0 +1,116 @@ +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_mod_security_rule import HostingModSecurityRule + from ..models.hosting_mod_security_rule_response_meta_type_0 import ( + HostingModSecurityRuleResponseMetaType0, + ) + + +T = TypeVar("T", bound="HostingModSecurityRuleResponse") + + +@_attrs_define +class HostingModSecurityRuleResponse: + error: int + message: None | str + data: HostingModSecurityRule + meta: HostingModSecurityRuleResponseMetaType0 | None + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, HostingModSecurityRuleResponseMetaType0): + 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_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") + + 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 = 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")) + + hosting_mod_security_rule_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + hosting_mod_security_rule_response.additional_properties = d + return hosting_mod_security_rule_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_mod_security_rule_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_mod_security_rule_response_meta_type_0.py new file mode 100644 index 0000000..af914ba --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_mod_security_rule_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..74d6198 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_mod_security_scan.py @@ -0,0 +1,98 @@ +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="HostingModSecurityScan") + + +@_attrs_define +class HostingModSecurityScan: + scan_id: int + hosting_id: int + date_created: datetime.datetime + error: None | str + rules_found: int + rules_excluded: int + 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 = self.hosting_id + + date_created = self.date_created.isoformat() + + error: None | str + error = self.error + + rules_found = self.rules_found + + rules_excluded = self.rules_excluded + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "scan_id": scan_id, + "hosting_id": hosting_id, + "date_created": date_created, + "error": error, + "rules_found": rules_found, + "rules_excluded": rules_excluded, + } + ) + + return field_dict + + @classmethod + 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") + + date_created = datetime.datetime.fromisoformat(d.pop("date_created")) + + def _parse_error(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + error = _parse_error(d.pop("error")) + + rules_found = d.pop("rules_found") + + rules_excluded = d.pop("rules_excluded") + + hosting_mod_security_scan = cls( + scan_id=scan_id, + hosting_id=hosting_id, + date_created=date_created, + error=error, + rules_found=rules_found, + rules_excluded=rules_excluded, + ) + + hosting_mod_security_scan.additional_properties = d + return hosting_mod_security_scan + + @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_paginated_list_response.py b/src/shellrent_sdk/client/models/hosting_mod_security_scan_paginated_list_response.py new file mode 100644 index 0000000..31d0840 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_mod_security_scan_paginated_list_response.py @@ -0,0 +1,99 @@ +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_mod_security_scan import HostingModSecurityScan + from ..models.pagination_meta import PaginationMeta + + +T = TypeVar("T", bound="HostingModSecurityScanPaginatedListResponse") + + +@_attrs_define +class HostingModSecurityScanPaginatedListResponse: + error: int + message: None | str + data: list[HostingModSecurityScan] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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_mod_security_scan import HostingModSecurityScan + from ..models.pagination_meta import PaginationMeta + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = HostingModSecurityScan.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + hosting_mod_security_scan_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + hosting_mod_security_scan_paginated_list_response.additional_properties = d + return hosting_mod_security_scan_paginated_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_mod_security_scan_response.py b/src/shellrent_sdk/client/models/hosting_mod_security_scan_response.py new file mode 100644 index 0000000..832771c --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_mod_security_scan_response.py @@ -0,0 +1,116 @@ +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_mod_security_scan import HostingModSecurityScan + from ..models.hosting_mod_security_scan_response_meta_type_0 import ( + HostingModSecurityScanResponseMetaType0, + ) + + +T = TypeVar("T", bound="HostingModSecurityScanResponse") + + +@_attrs_define +class HostingModSecurityScanResponse: + error: int + message: None | str + data: HostingModSecurityScan + meta: HostingModSecurityScanResponseMetaType0 | None + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, HostingModSecurityScanResponseMetaType0): + 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_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") + + 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 = 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")) + + hosting_mod_security_scan_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + hosting_mod_security_scan_response.additional_properties = d + return hosting_mod_security_scan_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_mod_security_scan_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_mod_security_scan_response_meta_type_0.py new file mode 100644 index 0000000..06edfa6 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_mod_security_scan_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..4e7fb6d --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_mod_security_update_request.py @@ -0,0 +1,56 @@ +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 + +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) + + 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 + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + enable = d.pop("enable", UNSET) + + 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 new file mode 100644 index 0000000..3c84af8 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_paginated_list_response.py @@ -0,0 +1,99 @@ +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 import Hosting + from ..models.pagination_meta import PaginationMeta + + +T = TypeVar("T", bound="HostingPaginatedListResponse") + + +@_attrs_define +class HostingPaginatedListResponse: + error: int + message: None | str + data: list[Hosting] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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 import Hosting + from ..models.pagination_meta import PaginationMeta + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = Hosting.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + hosting_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + hosting_paginated_list_response.additional_properties = d + return hosting_paginated_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_php_settings_update_request.py b/src/shellrent_sdk/client/models/hosting_php_settings_update_request.py new file mode 100644 index 0000000..065163e --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_php_settings_update_request.py @@ -0,0 +1,66 @@ +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 + +from ..types import UNSET, Unset + +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) + + def to_dict(self) -> dict[str, Any]: + setting = self.setting + + 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 + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + setting = d.pop("setting", UNSET) + + value = d.pop("value", UNSET) + + 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_version.py b/src/shellrent_sdk/client/models/hosting_php_version.py new file mode 100644 index 0000000..c257bda --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_php_version.py @@ -0,0 +1,70 @@ +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="HostingPhpVersion") + + +@_attrs_define +class HostingPhpVersion: + version: str + is_current: bool + is_default: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + version = self.version + + is_current = self.is_current + + is_default = self.is_default + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "version": version, + "is_current": is_current, + "is_default": is_default, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + version = d.pop("version") + + is_current = d.pop("is_current") + + is_default = d.pop("is_default") + + hosting_php_version = cls( + version=version, + is_current=is_current, + is_default=is_default, + ) + + hosting_php_version.additional_properties = d + return hosting_php_version + + @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_list_response.py b/src/shellrent_sdk/client/models/hosting_php_version_list_response.py new file mode 100644 index 0000000..9b3dd7a --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_php_version_list_response.py @@ -0,0 +1,124 @@ +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_php_version import HostingPhpVersion + from ..models.hosting_php_version_list_response_meta_type_0 import ( + HostingPhpVersionListResponseMetaType0, + ) + + +T = TypeVar("T", bound="HostingPhpVersionListResponse") + + +@_attrs_define +class HostingPhpVersionListResponse: + error: int + message: None | str + data: list[HostingPhpVersion] + meta: HostingPhpVersionListResponseMetaType0 | None + 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 + message = self.message + + data = [] + for data_item_data in self.data: + 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 + + 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_php_version import HostingPhpVersion + from ..models.hosting_php_version_list_response_meta_type_0 import ( + HostingPhpVersionListResponseMetaType0, + ) + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = HostingPhpVersion.from_dict(data_item_data) + + 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")) + + hosting_php_version_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + hosting_php_version_list_response.additional_properties = d + return hosting_php_version_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_php_version_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_php_version_list_response_meta_type_0.py new file mode 100644 index 0000000..bc69cf2 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_php_version_list_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..772159b --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_php_version_update_request.py @@ -0,0 +1,57 @@ +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 + +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) + + 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 + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + version = d.pop("version", UNSET) + + 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 new file mode 100644 index 0000000..82e3370 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_response.py @@ -0,0 +1,110 @@ +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 import Hosting + from ..models.hosting_response_meta_type_0 import HostingResponseMetaType0 + + +T = TypeVar("T", bound="HostingResponse") + + +@_attrs_define +class HostingResponse: + error: int + message: None | str + data: Hosting + meta: HostingResponseMetaType0 | None + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, HostingResponseMetaType0): + 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 import Hosting + from ..models.hosting_response_meta_type_0 import HostingResponseMetaType0 + + 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 = 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")) + + hosting_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + hosting_response.additional_properties = d + return hosting_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_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_response_meta_type_0.py new file mode 100644 index 0000000..60725de --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..6f832ec --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_ssl_certificate.py @@ -0,0 +1,166 @@ +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="HostingSslCertificate") + + +@_attrs_define +class HostingSslCertificate: + hosting_ssl_certificate_id: int + hosting_id: int + ssl_certificate_id: int | None + lets_encrypt_id: int | None + external_certificate_id: int | None + cn_type: None | str + installation_date: datetime.datetime | None + https_rewrite: bool | None + destination_type: None | str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + hosting_ssl_certificate_id = self.hosting_ssl_certificate_id + + hosting_id = self.hosting_id + + ssl_certificate_id: int | None + ssl_certificate_id = self.ssl_certificate_id + + lets_encrypt_id: int | None + lets_encrypt_id = self.lets_encrypt_id + + external_certificate_id: int | None + external_certificate_id = self.external_certificate_id + + cn_type: None | str + cn_type = self.cn_type + + installation_date: None | str + if isinstance(self.installation_date, datetime.datetime): + installation_date = self.installation_date.isoformat() + else: + installation_date = self.installation_date + + https_rewrite: bool | None + https_rewrite = self.https_rewrite + + destination_type: None | str + destination_type = self.destination_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "hosting_ssl_certificate_id": hosting_ssl_certificate_id, + "hosting_id": hosting_id, + "ssl_certificate_id": ssl_certificate_id, + "lets_encrypt_id": lets_encrypt_id, + "external_certificate_id": external_certificate_id, + "cn_type": cn_type, + "installation_date": installation_date, + "https_rewrite": https_rewrite, + "destination_type": destination_type, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + hosting_ssl_certificate_id = d.pop("hosting_ssl_certificate_id") + + hosting_id = d.pop("hosting_id") + + def _parse_ssl_certificate_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + ssl_certificate_id = _parse_ssl_certificate_id(d.pop("ssl_certificate_id")) + + def _parse_lets_encrypt_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + lets_encrypt_id = _parse_lets_encrypt_id(d.pop("lets_encrypt_id")) + + def _parse_external_certificate_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + external_certificate_id = _parse_external_certificate_id(d.pop("external_certificate_id")) + + def _parse_cn_type(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + cn_type = _parse_cn_type(d.pop("cn_type")) + + def _parse_installation_date(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + installation_date_type_0 = datetime.datetime.fromisoformat(data) + + return installation_date_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + installation_date = _parse_installation_date(d.pop("installation_date")) + + def _parse_https_rewrite(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) + + https_rewrite = _parse_https_rewrite(d.pop("https_rewrite")) + + def _parse_destination_type(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + destination_type = _parse_destination_type(d.pop("destination_type")) + + hosting_ssl_certificate = cls( + hosting_ssl_certificate_id=hosting_ssl_certificate_id, + hosting_id=hosting_id, + ssl_certificate_id=ssl_certificate_id, + lets_encrypt_id=lets_encrypt_id, + external_certificate_id=external_certificate_id, + cn_type=cn_type, + installation_date=installation_date, + https_rewrite=https_rewrite, + destination_type=destination_type, + ) + + hosting_ssl_certificate.additional_properties = d + return hosting_ssl_certificate + + @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.py b/src/shellrent_sdk/client/models/hosting_ssl_certificate_install_request.py new file mode 100644 index 0000000..f61e88f --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_ssl_certificate_install_request.py @@ -0,0 +1,84 @@ +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="HostingSslCertificateInstallRequest") + + +@_attrs_define +class HostingSslCertificateInstallRequest: + 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) + + def to_dict(self) -> dict[str, Any]: + ssl_certificate_id: int | None | Unset + if isinstance(self.ssl_certificate_id, Unset): + ssl_certificate_id = UNSET + else: + ssl_certificate_id = self.ssl_certificate_id + + destination_type = self.destination_type + + cn_type = self.cn_type + + 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 + if destination_type is not UNSET: + field_dict["destination_type"] = destination_type + if cn_type is not UNSET: + field_dict["cn_type"] = cn_type + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + + def _parse_ssl_certificate_id(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + ssl_certificate_id = _parse_ssl_certificate_id(d.pop("ssl_certificate_id", UNSET)) + + destination_type = d.pop("destination_type", UNSET) + + cn_type = d.pop("cn_type", UNSET) + + hosting_ssl_certificate_install_request = cls( + ssl_certificate_id=ssl_certificate_id, + destination_type=destination_type, + 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_list_response.py b/src/shellrent_sdk/client/models/hosting_ssl_certificate_list_response.py new file mode 100644 index 0000000..9e163e5 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_ssl_certificate_list_response.py @@ -0,0 +1,124 @@ +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_ssl_certificate import HostingSslCertificate + from ..models.hosting_ssl_certificate_list_response_meta_type_0 import ( + HostingSslCertificateListResponseMetaType0, + ) + + +T = TypeVar("T", bound="HostingSslCertificateListResponse") + + +@_attrs_define +class HostingSslCertificateListResponse: + error: int + message: None | str + data: list[HostingSslCertificate] + meta: HostingSslCertificateListResponseMetaType0 | None + 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 + message = self.message + + data = [] + for data_item_data in self.data: + 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 + + 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_ssl_certificate import HostingSslCertificate + from ..models.hosting_ssl_certificate_list_response_meta_type_0 import ( + HostingSslCertificateListResponseMetaType0, + ) + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = HostingSslCertificate.from_dict(data_item_data) + + 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")) + + hosting_ssl_certificate_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + hosting_ssl_certificate_list_response.additional_properties = d + return hosting_ssl_certificate_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_ssl_certificate_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_ssl_certificate_list_response_meta_type_0.py new file mode 100644 index 0000000..d945c47 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_ssl_certificate_list_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..65c41e9 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_ssl_certificate_response.py @@ -0,0 +1,116 @@ +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_ssl_certificate import HostingSslCertificate + from ..models.hosting_ssl_certificate_response_meta_type_0 import ( + HostingSslCertificateResponseMetaType0, + ) + + +T = TypeVar("T", bound="HostingSslCertificateResponse") + + +@_attrs_define +class HostingSslCertificateResponse: + error: int + message: None | str + data: HostingSslCertificate + meta: HostingSslCertificateResponseMetaType0 | None + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, HostingSslCertificateResponseMetaType0): + 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_ssl_certificate import HostingSslCertificate + from ..models.hosting_ssl_certificate_response_meta_type_0 import ( + HostingSslCertificateResponseMetaType0, + ) + + 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 = 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")) + + hosting_ssl_certificate_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + hosting_ssl_certificate_response.additional_properties = d + return hosting_ssl_certificate_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_ssl_certificate_response_meta_type_0.py b/src/shellrent_sdk/client/models/hosting_ssl_certificate_response_meta_type_0.py new file mode 100644 index 0000000..10712e0 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_ssl_certificate_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..b409856 --- /dev/null +++ b/src/shellrent_sdk/client/models/hosting_subdomain_create_request.py @@ -0,0 +1,68 @@ +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 + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="HostingSubdomainCreateRequest") + + +@_attrs_define +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 + + @classmethod + 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 new file mode 100644 index 0000000..e056b7e --- /dev/null +++ b/src/shellrent_sdk/client/models/invoice.py @@ -0,0 +1,264 @@ +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.account_billing import AccountBilling + from ..models.amount import Amount + from ..models.sdi_document_status import SdiDocumentStatus + from ..models.sdi_document_type import SdiDocumentType + + +T = TypeVar("T", bound="Invoice") + + +@_attrs_define +class Invoice: + invoice_id: int + billing: AccountBilling + type_: None | str + sdi_document_status: None | SdiDocumentStatus + sdi_document_type: None | SdiDocumentType + date_emitted: datetime.date + invoice_year: int + invoice_number: str + invoice_caption: None | str + invoice_caption_additional: None | str + payed: bool + sdi_identifier: None | str + sdi_filename: None | str + total_amount: Amount + amount_no_balance: Amount + payment_amount: Amount + orders: list[int] + rows_count: int + date_created: datetime.datetime + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.sdi_document_status import SdiDocumentStatus + from ..models.sdi_document_type import SdiDocumentType + + invoice_id = self.invoice_id + + billing = self.billing.to_dict() + + type_: None | str + type_ = self.type_ + + sdi_document_status: dict[str, Any] | None + if isinstance(self.sdi_document_status, SdiDocumentStatus): + sdi_document_status = self.sdi_document_status.to_dict() + else: + sdi_document_status = self.sdi_document_status + + sdi_document_type: dict[str, Any] | None + if isinstance(self.sdi_document_type, SdiDocumentType): + sdi_document_type = self.sdi_document_type.to_dict() + else: + sdi_document_type = self.sdi_document_type + + date_emitted = self.date_emitted.isoformat() + + invoice_year = self.invoice_year + + invoice_number = self.invoice_number + + invoice_caption: None | str + invoice_caption = self.invoice_caption + + invoice_caption_additional: None | str + invoice_caption_additional = self.invoice_caption_additional + + payed = self.payed + + 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() + + amount_no_balance = self.amount_no_balance.to_dict() + + payment_amount = self.payment_amount.to_dict() + + orders = self.orders + + rows_count = self.rows_count + + date_created = self.date_created.isoformat() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "invoice_id": invoice_id, + "billing": billing, + "type": type_, + "sdi_document_status": sdi_document_status, + "sdi_document_type": sdi_document_type, + "date_emitted": date_emitted, + "invoice_year": invoice_year, + "invoice_number": invoice_number, + "invoice_caption": invoice_caption, + "invoice_caption_additional": invoice_caption_additional, + "payed": payed, + "sdi_identifier": sdi_identifier, + "sdi_filename": sdi_filename, + "total_amount": total_amount, + "amount_no_balance": amount_no_balance, + "payment_amount": payment_amount, + "orders": orders, + "rows_count": rows_count, + "date_created": date_created, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.account_billing import AccountBilling + from ..models.amount import Amount + from ..models.sdi_document_status import SdiDocumentStatus + from ..models.sdi_document_type import SdiDocumentType + + d = dict(src_dict) + invoice_id = d.pop("invoice_id") + + billing = AccountBilling.from_dict(d.pop("billing")) + + def _parse_type_(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + type_ = _parse_type_(d.pop("type")) + + def _parse_sdi_document_status(data: object) -> None | SdiDocumentStatus: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + sdi_document_status_type_0 = SdiDocumentStatus.from_dict(data) + + return sdi_document_status_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | SdiDocumentStatus, data) + + sdi_document_status = _parse_sdi_document_status(d.pop("sdi_document_status")) + + def _parse_sdi_document_type(data: object) -> None | SdiDocumentType: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + sdi_document_type_type_0 = SdiDocumentType.from_dict(data) + + return sdi_document_type_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | SdiDocumentType, data) + + sdi_document_type = _parse_sdi_document_type(d.pop("sdi_document_type")) + + date_emitted = datetime.date.fromisoformat(d.pop("date_emitted")) + + invoice_year = d.pop("invoice_year") + + invoice_number = d.pop("invoice_number") + + def _parse_invoice_caption(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + invoice_caption = _parse_invoice_caption(d.pop("invoice_caption")) + + def _parse_invoice_caption_additional(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + invoice_caption_additional = _parse_invoice_caption_additional( + d.pop("invoice_caption_additional") + ) + + payed = d.pop("payed") + + 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 = _parse_sdi_filename(d.pop("sdi_filename")) + + total_amount = Amount.from_dict(d.pop("total_amount")) + + amount_no_balance = Amount.from_dict(d.pop("amount_no_balance")) + + payment_amount = Amount.from_dict(d.pop("payment_amount")) + + orders = cast(list[int], d.pop("orders")) + + rows_count = d.pop("rows_count") + + date_created = datetime.datetime.fromisoformat(d.pop("date_created")) + + invoice = cls( + invoice_id=invoice_id, + billing=billing, + type_=type_, + sdi_document_status=sdi_document_status, + sdi_document_type=sdi_document_type, + date_emitted=date_emitted, + invoice_year=invoice_year, + invoice_number=invoice_number, + invoice_caption=invoice_caption, + invoice_caption_additional=invoice_caption_additional, + payed=payed, + sdi_identifier=sdi_identifier, + sdi_filename=sdi_filename, + total_amount=total_amount, + amount_no_balance=amount_no_balance, + payment_amount=payment_amount, + orders=orders, + rows_count=rows_count, + date_created=date_created, + ) + + invoice.additional_properties = d + return invoice + + @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_paginated_list_response.py b/src/shellrent_sdk/client/models/invoice_paginated_list_response.py new file mode 100644 index 0000000..0a27b47 --- /dev/null +++ b/src/shellrent_sdk/client/models/invoice_paginated_list_response.py @@ -0,0 +1,99 @@ +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.invoice import Invoice + from ..models.pagination_meta import PaginationMeta + + +T = TypeVar("T", bound="InvoicePaginatedListResponse") + + +@_attrs_define +class InvoicePaginatedListResponse: + error: int + message: None | str + data: list[Invoice] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.invoice import Invoice + from ..models.pagination_meta import PaginationMeta + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = Invoice.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + invoice_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + invoice_paginated_list_response.additional_properties = d + return invoice_paginated_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/invoice_response.py b/src/shellrent_sdk/client/models/invoice_response.py new file mode 100644 index 0000000..4bcdecd --- /dev/null +++ b/src/shellrent_sdk/client/models/invoice_response.py @@ -0,0 +1,110 @@ +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.invoice import Invoice + from ..models.invoice_response_meta_type_0 import InvoiceResponseMetaType0 + + +T = TypeVar("T", bound="InvoiceResponse") + + +@_attrs_define +class InvoiceResponse: + error: int + message: None | str + data: Invoice + meta: InvoiceResponseMetaType0 | None + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, InvoiceResponseMetaType0): + 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.invoice import Invoice + from ..models.invoice_response_meta_type_0 import InvoiceResponseMetaType0 + + 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 = 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")) + + invoice_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + invoice_response.additional_properties = d + return invoice_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/invoice_response_meta_type_0.py b/src/shellrent_sdk/client/models/invoice_response_meta_type_0.py new file mode 100644 index 0000000..f98649c --- /dev/null +++ b/src/shellrent_sdk/client/models/invoice_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..cd20f15 --- /dev/null +++ b/src/shellrent_sdk/client/models/invoice_row.py @@ -0,0 +1,249 @@ +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.amount import Amount + from ..models.billing_data import BillingData + from ..models.purchase import Purchase + from ..models.service import Service + + +T = TypeVar("T", bound="InvoiceRow") + + +@_attrs_define +class InvoiceRow: + invoice_row_id: int + invoice_id: int + invoice_id_deposit: int | None + service: None | Service + purchase: None | Purchase + description: str + unit_description: None | str + unit_quantity: float | None + unit_amount: Amount + amount: Amount + billing_data: BillingData + is_recurring: bool + date_start: datetime.date | None + date_end: datetime.date | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.purchase import Purchase + from ..models.service import Service + + invoice_row_id = self.invoice_row_id + + invoice_id = self.invoice_id + + invoice_id_deposit: int | None + invoice_id_deposit = self.invoice_id_deposit + + service: dict[str, Any] | None + if isinstance(self.service, Service): + service = self.service.to_dict() + else: + service = self.service + + purchase: dict[str, Any] | None + if isinstance(self.purchase, Purchase): + purchase = self.purchase.to_dict() + else: + purchase = self.purchase + + description = self.description + + unit_description: None | str + unit_description = self.unit_description + + unit_quantity: float | None + unit_quantity = self.unit_quantity + + unit_amount = self.unit_amount.to_dict() + + amount = self.amount.to_dict() + + billing_data = self.billing_data.to_dict() + + is_recurring = self.is_recurring + + date_start: None | str + if isinstance(self.date_start, datetime.date): + date_start = self.date_start.isoformat() + else: + date_start = self.date_start + + date_end: None | str + if isinstance(self.date_end, datetime.date): + date_end = self.date_end.isoformat() + else: + date_end = self.date_end + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "invoice_row_id": invoice_row_id, + "invoice_id": invoice_id, + "invoice_id_deposit": invoice_id_deposit, + "service": service, + "purchase": purchase, + "description": description, + "unit_description": unit_description, + "unit_quantity": unit_quantity, + "unit_amount": unit_amount, + "amount": amount, + "billing_data": billing_data, + "is_recurring": is_recurring, + "date_start": date_start, + "date_end": date_end, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.amount import Amount + from ..models.billing_data import BillingData + from ..models.purchase import Purchase + from ..models.service import Service + + d = dict(src_dict) + invoice_row_id = d.pop("invoice_row_id") + + invoice_id = d.pop("invoice_id") + + def _parse_invoice_id_deposit(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + invoice_id_deposit = _parse_invoice_id_deposit(d.pop("invoice_id_deposit")) + + def _parse_service(data: object) -> None | Service: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + service_type_0 = Service.from_dict(data) + + return service_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | Service, data) + + service = _parse_service(d.pop("service")) + + def _parse_purchase(data: object) -> None | Purchase: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + purchase_type_0 = Purchase.from_dict(data) + + return purchase_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | Purchase, data) + + purchase = _parse_purchase(d.pop("purchase")) + + description = d.pop("description") + + def _parse_unit_description(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + unit_description = _parse_unit_description(d.pop("unit_description")) + + def _parse_unit_quantity(data: object) -> float | None: + if data is None: + return data + return cast(float | None, data) + + unit_quantity = _parse_unit_quantity(d.pop("unit_quantity")) + + unit_amount = Amount.from_dict(d.pop("unit_amount")) + + amount = Amount.from_dict(d.pop("amount")) + + billing_data = BillingData.from_dict(d.pop("billing_data")) + + is_recurring = d.pop("is_recurring") + + def _parse_date_start(data: object) -> datetime.date | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + date_start_type_0 = datetime.date.fromisoformat(data) + + return date_start_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.date | None, data) + + date_start = _parse_date_start(d.pop("date_start")) + + def _parse_date_end(data: object) -> datetime.date | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + date_end_type_0 = datetime.date.fromisoformat(data) + + return date_end_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.date | None, data) + + date_end = _parse_date_end(d.pop("date_end")) + + invoice_row = cls( + invoice_row_id=invoice_row_id, + invoice_id=invoice_id, + invoice_id_deposit=invoice_id_deposit, + service=service, + purchase=purchase, + description=description, + unit_description=unit_description, + unit_quantity=unit_quantity, + unit_amount=unit_amount, + amount=amount, + billing_data=billing_data, + is_recurring=is_recurring, + date_start=date_start, + date_end=date_end, + ) + + invoice_row.additional_properties = d + return invoice_row + + @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_list_response.py b/src/shellrent_sdk/client/models/invoice_row_list_response.py new file mode 100644 index 0000000..5d22799 --- /dev/null +++ b/src/shellrent_sdk/client/models/invoice_row_list_response.py @@ -0,0 +1,120 @@ +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.invoice_row import InvoiceRow + from ..models.invoice_row_list_response_meta_type_0 import InvoiceRowListResponseMetaType0 + + +T = TypeVar("T", bound="InvoiceRowListResponse") + + +@_attrs_define +class InvoiceRowListResponse: + error: int + message: None | str + data: list[InvoiceRow] + meta: InvoiceRowListResponseMetaType0 | None + 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 + message = self.message + + data = [] + for data_item_data in self.data: + 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 + + 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.invoice_row import InvoiceRow + from ..models.invoice_row_list_response_meta_type_0 import ( + InvoiceRowListResponseMetaType0, + ) + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = InvoiceRow.from_dict(data_item_data) + + 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")) + + invoice_row_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + invoice_row_list_response.additional_properties = d + return invoice_row_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/invoice_row_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/invoice_row_list_response_meta_type_0.py new file mode 100644 index 0000000..183e92d --- /dev/null +++ b/src/shellrent_sdk/client/models/invoice_row_list_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..d284822 --- /dev/null +++ b/src/shellrent_sdk/client/models/invoice_row_response.py @@ -0,0 +1,112 @@ +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.invoice_row import InvoiceRow + from ..models.invoice_row_response_meta_type_0 import InvoiceRowResponseMetaType0 + + +T = TypeVar("T", bound="InvoiceRowResponse") + + +@_attrs_define +class InvoiceRowResponse: + error: int + message: None | str + data: InvoiceRow + meta: InvoiceRowResponseMetaType0 | None + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, InvoiceRowResponseMetaType0): + 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.invoice_row import InvoiceRow + from ..models.invoice_row_response_meta_type_0 import ( + InvoiceRowResponseMetaType0, + ) + + 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 = 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")) + + invoice_row_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + invoice_row_response.additional_properties = d + return invoice_row_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/invoice_row_response_meta_type_0.py b/src/shellrent_sdk/client/models/invoice_row_response_meta_type_0.py new file mode 100644 index 0000000..6435f93 --- /dev/null +++ b/src/shellrent_sdk/client/models/invoice_row_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..408553f --- /dev/null +++ b/src/shellrent_sdk/client/models/ip_address.py @@ -0,0 +1,161 @@ +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="IpAddress") + + +@_attrs_define +class IpAddress: + ip_address_id: int + server_id: int | None + ip_address: str + reverse_dns: None | str + reverse_dns_external: None | str + mac_address: None | str + blocked_for_spam: bool + active: bool + available: bool + date_created: datetime.datetime | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + ip_address_id = self.ip_address_id + + server_id: int | None + server_id = self.server_id + + ip_address = self.ip_address + + reverse_dns: None | str + reverse_dns = self.reverse_dns + + reverse_dns_external: None | str + reverse_dns_external = self.reverse_dns_external + + mac_address: None | str + mac_address = self.mac_address + + blocked_for_spam = self.blocked_for_spam + + active = self.active + + available = self.available + + date_created: None | str + if isinstance(self.date_created, datetime.datetime): + date_created = self.date_created.isoformat() + else: + date_created = self.date_created + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "ip_address_id": ip_address_id, + "server_id": server_id, + "ip_address": ip_address, + "reverse_dns": reverse_dns, + "reverse_dns_external": reverse_dns_external, + "mac_address": mac_address, + "blocked_for_spam": blocked_for_spam, + "active": active, + "available": available, + "date_created": date_created, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + ip_address_id = d.pop("ip_address_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")) + + ip_address = d.pop("ip_address") + + def _parse_reverse_dns(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + reverse_dns = _parse_reverse_dns(d.pop("reverse_dns")) + + def _parse_reverse_dns_external(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + reverse_dns_external = _parse_reverse_dns_external(d.pop("reverse_dns_external")) + + def _parse_mac_address(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + mac_address = _parse_mac_address(d.pop("mac_address")) + + blocked_for_spam = d.pop("blocked_for_spam") + + active = d.pop("active") + + available = d.pop("available") + + def _parse_date_created(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + date_created_type_0 = datetime.datetime.fromisoformat(data) + + return date_created_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + date_created = _parse_date_created(d.pop("date_created")) + + ip_address = cls( + ip_address_id=ip_address_id, + server_id=server_id, + ip_address=ip_address, + reverse_dns=reverse_dns, + reverse_dns_external=reverse_dns_external, + mac_address=mac_address, + blocked_for_spam=blocked_for_spam, + active=active, + available=available, + date_created=date_created, + ) + + ip_address.additional_properties = d + return ip_address + + @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_list_response.py b/src/shellrent_sdk/client/models/ip_address_list_response.py new file mode 100644 index 0000000..edbe5d3 --- /dev/null +++ b/src/shellrent_sdk/client/models/ip_address_list_response.py @@ -0,0 +1,120 @@ +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.ip_address import IpAddress + from ..models.ip_address_list_response_meta_type_0 import IpAddressListResponseMetaType0 + + +T = TypeVar("T", bound="IpAddressListResponse") + + +@_attrs_define +class IpAddressListResponse: + error: int + message: None | str + data: list[IpAddress] + meta: IpAddressListResponseMetaType0 | None + 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 + message = self.message + + data = [] + for data_item_data in self.data: + 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 + + 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.ip_address import IpAddress + from ..models.ip_address_list_response_meta_type_0 import ( + IpAddressListResponseMetaType0, + ) + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = IpAddress.from_dict(data_item_data) + + 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")) + + ip_address_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + ip_address_list_response.additional_properties = d + return ip_address_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/ip_address_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/ip_address_list_response_meta_type_0.py new file mode 100644 index 0000000..9753de9 --- /dev/null +++ b/src/shellrent_sdk/client/models/ip_address_list_response_meta_type_0.py @@ -0,0 +1,45 @@ +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/ip_address_response.py b/src/shellrent_sdk/client/models/ip_address_response.py new file mode 100644 index 0000000..e271de4 --- /dev/null +++ b/src/shellrent_sdk/client/models/ip_address_response.py @@ -0,0 +1,112 @@ +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.ip_address import IpAddress + from ..models.ip_address_response_meta_type_0 import IpAddressResponseMetaType0 + + +T = TypeVar("T", bound="IpAddressResponse") + + +@_attrs_define +class IpAddressResponse: + error: int + message: None | str + data: IpAddress + meta: IpAddressResponseMetaType0 | None + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, IpAddressResponseMetaType0): + 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.ip_address import IpAddress + from ..models.ip_address_response_meta_type_0 import ( + IpAddressResponseMetaType0, + ) + + 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 = 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")) + + ip_address_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + ip_address_response.additional_properties = d + return ip_address_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/ip_address_response_meta_type_0.py b/src/shellrent_sdk/client/models/ip_address_response_meta_type_0.py new file mode 100644 index 0000000..7e3386a --- /dev/null +++ b/src/shellrent_sdk/client/models/ip_address_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..77574b9 --- /dev/null +++ b/src/shellrent_sdk/client/models/jwk_key.py @@ -0,0 +1,114 @@ +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="JwkKey") + + +@_attrs_define +class JwkKey: + kid: str + kty: str + alg: str + use: str + n: str + """ Modulo base64url """ + e: str + """ Esponente base64url """ + status: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + kid = self.kid + + kty = self.kty + + alg = self.alg + + use = self.use + + n = self.n + + e = self.e + + status: None | str | Unset + if isinstance(self.status, Unset): + status = UNSET + else: + status = self.status + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "kid": kid, + "kty": kty, + "alg": alg, + "use": use, + "n": n, + "e": e, + } + ) + if status is not UNSET: + field_dict["status"] = status + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + kid = d.pop("kid") + + kty = d.pop("kty") + + alg = d.pop("alg") + + use = d.pop("use") + + n = d.pop("n") + + e = d.pop("e") + + def _parse_status(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + status = _parse_status(d.pop("status", UNSET)) + + jwk_key = cls( + kid=kid, + kty=kty, + alg=alg, + use=use, + n=n, + e=e, + status=status, + ) + + jwk_key.additional_properties = d + return jwk_key + + @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/jwks_response.py b/src/shellrent_sdk/client/models/jwks_response.py new file mode 100644 index 0000000..88db55a --- /dev/null +++ b/src/shellrent_sdk/client/models/jwks_response.py @@ -0,0 +1,70 @@ +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 + +if TYPE_CHECKING: + from ..models.jwk_key import JwkKey + + +T = TypeVar("T", bound="JwksResponse") + + +@_attrs_define +class JwksResponse: + keys: list[JwkKey] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + keys = [] + for keys_item_data in self.keys: + keys_item = keys_item_data.to_dict() + keys.append(keys_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "keys": keys, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.jwk_key import JwkKey + + d = dict(src_dict) + keys = [] + _keys = d.pop("keys") + for keys_item_data in _keys: + keys_item = JwkKey.from_dict(keys_item_data) + + keys.append(keys_item) + + jwks_response = cls( + keys=keys, + ) + + jwks_response.additional_properties = d + return jwks_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/legal_entity.py b/src/shellrent_sdk/client/models/legal_entity.py new file mode 100644 index 0000000..aa712dc --- /dev/null +++ b/src/shellrent_sdk/client/models/legal_entity.py @@ -0,0 +1,85 @@ +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 + +if TYPE_CHECKING: + from ..models.legal_entity_group import LegalEntityGroup + from ..models.tax_regime import TaxRegime + + +T = TypeVar("T", bound="LegalEntity") + + +@_attrs_define +class LegalEntity: + legal_entity_group: LegalEntityGroup + tax_regime: TaxRegime + entity_code: str + entity_name: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + legal_entity_group = self.legal_entity_group.to_dict() + + tax_regime = self.tax_regime.to_dict() + + entity_code = self.entity_code + + entity_name = self.entity_name + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "legal_entity_group": legal_entity_group, + "tax_regime": tax_regime, + "entity_code": entity_code, + "entity_name": entity_name, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.legal_entity_group import LegalEntityGroup + from ..models.tax_regime import TaxRegime + + d = dict(src_dict) + legal_entity_group = LegalEntityGroup.from_dict(d.pop("legal_entity_group")) + + tax_regime = TaxRegime.from_dict(d.pop("tax_regime")) + + entity_code = d.pop("entity_code") + + entity_name = d.pop("entity_name") + + legal_entity = cls( + legal_entity_group=legal_entity_group, + tax_regime=tax_regime, + entity_code=entity_code, + entity_name=entity_name, + ) + + legal_entity.additional_properties = d + return legal_entity + + @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/legal_entity_group.py b/src/shellrent_sdk/client/models/legal_entity_group.py new file mode 100644 index 0000000..3c56e5a --- /dev/null +++ b/src/shellrent_sdk/client/models/legal_entity_group.py @@ -0,0 +1,63 @@ +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="LegalEntityGroup") + + +@_attrs_define +class LegalEntityGroup: + group_code: str + group_name: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + group_code = self.group_code + + group_name = self.group_name + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "group_code": group_code, + "group_name": group_name, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + group_code = d.pop("group_code") + + group_name = d.pop("group_name") + + legal_entity_group = cls( + group_code=group_code, + group_name=group_name, + ) + + legal_entity_group.additional_properties = d + return legal_entity_group + + @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/list_orders_type.py b/src/shellrent_sdk/client/models/list_orders_type.py new file mode 100644 index 0000000..38e4b2e --- /dev/null +++ b/src/shellrent_sdk/client/models/list_orders_type.py @@ -0,0 +1,9 @@ +from enum import StrEnum + + +class ListOrdersType(StrEnum): + P = "P" + R = "R" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/shellrent_sdk/client/models/list_sms_sms_status.py b/src/shellrent_sdk/client/models/list_sms_sms_status.py new file mode 100644 index 0000000..dfa9ea9 --- /dev/null +++ b/src/shellrent_sdk/client/models/list_sms_sms_status.py @@ -0,0 +1,11 @@ +from enum import StrEnum + + +class ListSmsSmsStatus(StrEnum): + ACCOMPLISHED = "ACCOMPLISHED" + CANCELLED = "CANCELLED" + DRAFT = "DRAFT" + PROCESSING = "PROCESSING" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/shellrent_sdk/client/models/microsoft_365.py b/src/shellrent_sdk/client/models/microsoft_365.py new file mode 100644 index 0000000..b988002 --- /dev/null +++ b/src/shellrent_sdk/client/models/microsoft_365.py @@ -0,0 +1,273 @@ +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.microsoft_365_tenant import Microsoft365Tenant + + +T = TypeVar("T", bound="Microsoft365") + + +@_attrs_define +class Microsoft365: + microsoft365_id: int + purchase_id: int + tenant_id: int | None + service_name: None | str + purchase_name: None | str + supplier_code: None | str + supplier_status: None | str + order_code: None | str + order_reference: None | str + order_status: None | str + order_need_submit: bool + autorenew_enabled: bool + is_trial: bool + subscription_activation_date: datetime.date | None + subscription_expiry_date: datetime.date | None + tenant: Microsoft365Tenant | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.microsoft_365_tenant import Microsoft365Tenant + + microsoft365_id = self.microsoft365_id + + purchase_id = self.purchase_id + + tenant_id: int | None + tenant_id = self.tenant_id + + service_name: None | str + service_name = self.service_name + + purchase_name: None | str + purchase_name = self.purchase_name + + supplier_code: None | str + supplier_code = self.supplier_code + + supplier_status: None | str + supplier_status = self.supplier_status + + order_code: None | str + order_code = self.order_code + + order_reference: None | str + order_reference = self.order_reference + + order_status: None | str + order_status = self.order_status + + order_need_submit = self.order_need_submit + + autorenew_enabled = self.autorenew_enabled + + is_trial = self.is_trial + + subscription_activation_date: None | str + if isinstance(self.subscription_activation_date, datetime.date): + subscription_activation_date = self.subscription_activation_date.isoformat() + else: + subscription_activation_date = self.subscription_activation_date + + subscription_expiry_date: None | str + if isinstance(self.subscription_expiry_date, datetime.date): + subscription_expiry_date = self.subscription_expiry_date.isoformat() + else: + subscription_expiry_date = self.subscription_expiry_date + + tenant: dict[str, Any] | None + if isinstance(self.tenant, Microsoft365Tenant): + tenant = self.tenant.to_dict() + else: + tenant = self.tenant + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "microsoft365_id": microsoft365_id, + "purchase_id": purchase_id, + "tenant_id": tenant_id, + "service_name": service_name, + "purchase_name": purchase_name, + "supplier_code": supplier_code, + "supplier_status": supplier_status, + "order_code": order_code, + "order_reference": order_reference, + "order_status": order_status, + "order_need_submit": order_need_submit, + "autorenew_enabled": autorenew_enabled, + "is_trial": is_trial, + "subscription_activation_date": subscription_activation_date, + "subscription_expiry_date": subscription_expiry_date, + "tenant": tenant, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.microsoft_365_tenant import Microsoft365Tenant + + d = dict(src_dict) + microsoft365_id = d.pop("microsoft365_id") + + purchase_id = d.pop("purchase_id") + + def _parse_tenant_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + tenant_id = _parse_tenant_id(d.pop("tenant_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_supplier_code(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + supplier_code = _parse_supplier_code(d.pop("supplier_code")) + + def _parse_supplier_status(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + supplier_status = _parse_supplier_status(d.pop("supplier_status")) + + def _parse_order_code(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + order_code = _parse_order_code(d.pop("order_code")) + + def _parse_order_reference(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + order_reference = _parse_order_reference(d.pop("order_reference")) + + def _parse_order_status(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + order_status = _parse_order_status(d.pop("order_status")) + + order_need_submit = d.pop("order_need_submit") + + autorenew_enabled = d.pop("autorenew_enabled") + + is_trial = d.pop("is_trial") + + def _parse_subscription_activation_date(data: object) -> datetime.date | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + subscription_activation_date_type_0 = datetime.date.fromisoformat(data) + + return subscription_activation_date_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.date | None, data) + + subscription_activation_date = _parse_subscription_activation_date( + d.pop("subscription_activation_date") + ) + + def _parse_subscription_expiry_date(data: object) -> datetime.date | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + subscription_expiry_date_type_0 = datetime.date.fromisoformat(data) + + return subscription_expiry_date_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.date | None, data) + + subscription_expiry_date = _parse_subscription_expiry_date( + d.pop("subscription_expiry_date") + ) + + def _parse_tenant(data: object) -> Microsoft365Tenant | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + tenant_type_0 = Microsoft365Tenant.from_dict(data) + + return tenant_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(Microsoft365Tenant | None, data) + + tenant = _parse_tenant(d.pop("tenant")) + + microsoft_365 = cls( + microsoft365_id=microsoft365_id, + purchase_id=purchase_id, + tenant_id=tenant_id, + service_name=service_name, + purchase_name=purchase_name, + supplier_code=supplier_code, + supplier_status=supplier_status, + order_code=order_code, + order_reference=order_reference, + order_status=order_status, + order_need_submit=order_need_submit, + autorenew_enabled=autorenew_enabled, + is_trial=is_trial, + subscription_activation_date=subscription_activation_date, + subscription_expiry_date=subscription_expiry_date, + tenant=tenant, + ) + + microsoft_365.additional_properties = d + return microsoft_365 + + @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_domain_available.py b/src/shellrent_sdk/client/models/microsoft_365_domain_available.py new file mode 100644 index 0000000..e6bd9d6 --- /dev/null +++ b/src/shellrent_sdk/client/models/microsoft_365_domain_available.py @@ -0,0 +1,87 @@ +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="Microsoft365DomainAvailable") + + +@_attrs_define +class Microsoft365DomainAvailable: + 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 """ + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + domain_prefix = self.domain_prefix + + microsoft_domain = self.microsoft_domain + + 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( + { + "domain_prefix": domain_prefix, + "microsoft_domain": microsoft_domain, + "available": available, + "microsoft_uuid": microsoft_uuid, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + domain_prefix = d.pop("domain_prefix") + + microsoft_domain = d.pop("microsoft_domain") + + 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 + return microsoft_365_domain_available + + @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_domain_available_response.py b/src/shellrent_sdk/client/models/microsoft_365_domain_available_response.py new file mode 100644 index 0000000..006fb40 --- /dev/null +++ b/src/shellrent_sdk/client/models/microsoft_365_domain_available_response.py @@ -0,0 +1,118 @@ +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.microsoft_365_domain_available import Microsoft365DomainAvailable + from ..models.microsoft_365_domain_available_response_meta_type_0 import ( + Microsoft365DomainAvailableResponseMetaType0, + ) + + +T = TypeVar("T", bound="Microsoft365DomainAvailableResponse") + + +@_attrs_define +class Microsoft365DomainAvailableResponse: + error: int + message: None | str + data: Microsoft365DomainAvailable + meta: Microsoft365DomainAvailableResponseMetaType0 | None + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, Microsoft365DomainAvailableResponseMetaType0): + 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.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") + + 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 = 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")) + + microsoft_365_domain_available_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + microsoft_365_domain_available_response.additional_properties = d + return microsoft_365_domain_available_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_domain_available_response_meta_type_0.py b/src/shellrent_sdk/client/models/microsoft_365_domain_available_response_meta_type_0.py new file mode 100644 index 0000000..9e48c20 --- /dev/null +++ b/src/shellrent_sdk/client/models/microsoft_365_domain_available_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..c1fd44c --- /dev/null +++ b/src/shellrent_sdk/client/models/microsoft_365_paginated_list_response.py @@ -0,0 +1,99 @@ +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.microsoft_365 import Microsoft365 + from ..models.pagination_meta import PaginationMeta + + +T = TypeVar("T", bound="Microsoft365PaginatedListResponse") + + +@_attrs_define +class Microsoft365PaginatedListResponse: + error: int + message: None | str + data: list[Microsoft365] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.microsoft_365 import Microsoft365 + from ..models.pagination_meta import PaginationMeta + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = Microsoft365.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + microsoft_365_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + microsoft_365_paginated_list_response.additional_properties = d + return microsoft_365_paginated_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/microsoft_365_partner_link.py b/src/shellrent_sdk/client/models/microsoft_365_partner_link.py new file mode 100644 index 0000000..e3ce8b0 --- /dev/null +++ b/src/shellrent_sdk/client/models/microsoft_365_partner_link.py @@ -0,0 +1,56 @@ +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="Microsoft365PartnerLink") + + +@_attrs_define +class Microsoft365PartnerLink: + partner_link: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + partner_link = self.partner_link + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "partner_link": partner_link, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + partner_link = d.pop("partner_link") + + microsoft_365_partner_link = cls( + partner_link=partner_link, + ) + + microsoft_365_partner_link.additional_properties = d + return microsoft_365_partner_link + + @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_partner_link_response.py b/src/shellrent_sdk/client/models/microsoft_365_partner_link_response.py new file mode 100644 index 0000000..129d3b2 --- /dev/null +++ b/src/shellrent_sdk/client/models/microsoft_365_partner_link_response.py @@ -0,0 +1,116 @@ +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.microsoft_365_partner_link import Microsoft365PartnerLink + from ..models.microsoft_365_partner_link_response_meta_type_0 import ( + Microsoft365PartnerLinkResponseMetaType0, + ) + + +T = TypeVar("T", bound="Microsoft365PartnerLinkResponse") + + +@_attrs_define +class Microsoft365PartnerLinkResponse: + error: int + message: None | str + data: Microsoft365PartnerLink + meta: Microsoft365PartnerLinkResponseMetaType0 | None + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, Microsoft365PartnerLinkResponseMetaType0): + 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.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") + + 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 = 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")) + + microsoft_365_partner_link_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + microsoft_365_partner_link_response.additional_properties = d + return microsoft_365_partner_link_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_partner_link_response_meta_type_0.py b/src/shellrent_sdk/client/models/microsoft_365_partner_link_response_meta_type_0.py new file mode 100644 index 0000000..643fbc0 --- /dev/null +++ b/src/shellrent_sdk/client/models/microsoft_365_partner_link_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..d15c927 --- /dev/null +++ b/src/shellrent_sdk/client/models/microsoft_365_response.py @@ -0,0 +1,112 @@ +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.microsoft_365 import Microsoft365 + from ..models.microsoft_365_response_meta_type_0 import Microsoft365ResponseMetaType0 + + +T = TypeVar("T", bound="Microsoft365Response") + + +@_attrs_define +class Microsoft365Response: + error: int + message: None | str + data: Microsoft365 + meta: Microsoft365ResponseMetaType0 | None + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, Microsoft365ResponseMetaType0): + 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.microsoft_365 import Microsoft365 + from ..models.microsoft_365_response_meta_type_0 import ( + Microsoft365ResponseMetaType0, + ) + + 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 = 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")) + + microsoft_365_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + microsoft_365_response.additional_properties = d + return microsoft_365_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_response_meta_type_0.py b/src/shellrent_sdk/client/models/microsoft_365_response_meta_type_0.py new file mode 100644 index 0000000..cc279bc --- /dev/null +++ b/src/shellrent_sdk/client/models/microsoft_365_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..fb615d0 --- /dev/null +++ b/src/shellrent_sdk/client/models/microsoft_365_subscription_quantity_request.py @@ -0,0 +1,57 @@ +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="Microsoft365SubscriptionQuantityRequest") + + +@_attrs_define +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, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + quantity = d.pop("quantity") + + microsoft_365_subscription_quantity_request = cls( + 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 new file mode 100644 index 0000000..9ef529e --- /dev/null +++ b/src/shellrent_sdk/client/models/microsoft_365_tenant.py @@ -0,0 +1,329 @@ +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="Microsoft365Tenant") + + +@_attrs_define +class Microsoft365Tenant: + tenant_id: int + microsoft_uuid: None | str + domain_prefix: None | str + microsoft_domain: None | str + imported: bool + first_name: None | str + last_name: None | str + country: None | str + company_name: None | str + address: None | str + city: None | str + state: None | str + postal_code: None | str + email_address: None | str + phone_prefix: None | str + phone_number: None | str + locale: None | str + account_login: None | str + mca_compliant: bool + mca_sign_date: datetime.datetime | None + mca_template_id: None | str + mca_error: None | str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + tenant_id = self.tenant_id + + microsoft_uuid: None | str + microsoft_uuid = self.microsoft_uuid + + domain_prefix: None | str + domain_prefix = self.domain_prefix + + microsoft_domain: None | str + microsoft_domain = self.microsoft_domain + + imported = self.imported + + first_name: None | str + first_name = self.first_name + + last_name: None | str + last_name = self.last_name + + country: None | str + country = self.country + + company_name: None | str + company_name = self.company_name + + address: None | str + address = self.address + + city: None | str + city = self.city + + state: None | str + state = self.state + + postal_code: None | str + postal_code = self.postal_code + + email_address: None | str + email_address = self.email_address + + phone_prefix: None | str + phone_prefix = self.phone_prefix + + phone_number: None | str + phone_number = self.phone_number + + locale: None | str + locale = self.locale + + account_login: None | str + account_login = self.account_login + + mca_compliant = self.mca_compliant + + mca_sign_date: None | str + if isinstance(self.mca_sign_date, datetime.datetime): + mca_sign_date = self.mca_sign_date.isoformat() + else: + mca_sign_date = self.mca_sign_date + + mca_template_id: None | str + mca_template_id = self.mca_template_id + + mca_error: None | str + mca_error = self.mca_error + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "tenant_id": tenant_id, + "microsoft_uuid": microsoft_uuid, + "domain_prefix": domain_prefix, + "microsoft_domain": microsoft_domain, + "imported": imported, + "first_name": first_name, + "last_name": last_name, + "country": country, + "company_name": company_name, + "address": address, + "city": city, + "state": state, + "postal_code": postal_code, + "email_address": email_address, + "phone_prefix": phone_prefix, + "phone_number": phone_number, + "locale": locale, + "account_login": account_login, + "mca_compliant": mca_compliant, + "mca_sign_date": mca_sign_date, + "mca_template_id": mca_template_id, + "mca_error": mca_error, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + tenant_id = d.pop("tenant_id") + + 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")) + + def _parse_domain_prefix(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + domain_prefix = _parse_domain_prefix(d.pop("domain_prefix")) + + def _parse_microsoft_domain(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + microsoft_domain = _parse_microsoft_domain(d.pop("microsoft_domain")) + + imported = d.pop("imported") + + def _parse_first_name(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + first_name = _parse_first_name(d.pop("first_name")) + + def _parse_last_name(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + last_name = _parse_last_name(d.pop("last_name")) + + def _parse_country(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + country = _parse_country(d.pop("country")) + + def _parse_company_name(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + company_name = _parse_company_name(d.pop("company_name")) + + def _parse_address(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + address = _parse_address(d.pop("address")) + + def _parse_city(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + city = _parse_city(d.pop("city")) + + def _parse_state(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + state = _parse_state(d.pop("state")) + + def _parse_postal_code(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + postal_code = _parse_postal_code(d.pop("postal_code")) + + 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_phone_prefix(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + phone_prefix = _parse_phone_prefix(d.pop("phone_prefix")) + + def _parse_phone_number(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + phone_number = _parse_phone_number(d.pop("phone_number")) + + def _parse_locale(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + locale = _parse_locale(d.pop("locale")) + + def _parse_account_login(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + account_login = _parse_account_login(d.pop("account_login")) + + mca_compliant = d.pop("mca_compliant") + + def _parse_mca_sign_date(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + mca_sign_date_type_0 = datetime.datetime.fromisoformat(data) + + return mca_sign_date_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + mca_sign_date = _parse_mca_sign_date(d.pop("mca_sign_date")) + + def _parse_mca_template_id(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + mca_template_id = _parse_mca_template_id(d.pop("mca_template_id")) + + def _parse_mca_error(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + mca_error = _parse_mca_error(d.pop("mca_error")) + + microsoft_365_tenant = cls( + tenant_id=tenant_id, + microsoft_uuid=microsoft_uuid, + domain_prefix=domain_prefix, + microsoft_domain=microsoft_domain, + imported=imported, + first_name=first_name, + last_name=last_name, + country=country, + company_name=company_name, + address=address, + city=city, + state=state, + postal_code=postal_code, + email_address=email_address, + phone_prefix=phone_prefix, + phone_number=phone_number, + locale=locale, + account_login=account_login, + mca_compliant=mca_compliant, + mca_sign_date=mca_sign_date, + mca_template_id=mca_template_id, + mca_error=mca_error, + ) + + microsoft_365_tenant.additional_properties = d + return microsoft_365_tenant + + @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_paginated_list_response.py b/src/shellrent_sdk/client/models/microsoft_365_tenant_paginated_list_response.py new file mode 100644 index 0000000..b408360 --- /dev/null +++ b/src/shellrent_sdk/client/models/microsoft_365_tenant_paginated_list_response.py @@ -0,0 +1,99 @@ +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.microsoft_365_tenant import Microsoft365Tenant + from ..models.pagination_meta import PaginationMeta + + +T = TypeVar("T", bound="Microsoft365TenantPaginatedListResponse") + + +@_attrs_define +class Microsoft365TenantPaginatedListResponse: + error: int + message: None | str + data: list[Microsoft365Tenant] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.microsoft_365_tenant import Microsoft365Tenant + from ..models.pagination_meta import PaginationMeta + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = Microsoft365Tenant.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + microsoft_365_tenant_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + microsoft_365_tenant_paginated_list_response.additional_properties = d + return microsoft_365_tenant_paginated_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/microsoft_365_tenant_response.py b/src/shellrent_sdk/client/models/microsoft_365_tenant_response.py new file mode 100644 index 0000000..29e5ecf --- /dev/null +++ b/src/shellrent_sdk/client/models/microsoft_365_tenant_response.py @@ -0,0 +1,116 @@ +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.microsoft_365_tenant import Microsoft365Tenant + from ..models.microsoft_365_tenant_response_meta_type_0 import ( + Microsoft365TenantResponseMetaType0, + ) + + +T = TypeVar("T", bound="Microsoft365TenantResponse") + + +@_attrs_define +class Microsoft365TenantResponse: + error: int + message: None | str + data: Microsoft365Tenant + meta: Microsoft365TenantResponseMetaType0 | None + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, Microsoft365TenantResponseMetaType0): + 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.microsoft_365_tenant import Microsoft365Tenant + from ..models.microsoft_365_tenant_response_meta_type_0 import ( + Microsoft365TenantResponseMetaType0, + ) + + 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 = 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")) + + microsoft_365_tenant_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + microsoft_365_tenant_response.additional_properties = d + return microsoft_365_tenant_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_tenant_response_meta_type_0.py b/src/shellrent_sdk/client/models/microsoft_365_tenant_response_meta_type_0.py new file mode 100644 index 0000000..4298344 --- /dev/null +++ b/src/shellrent_sdk/client/models/microsoft_365_tenant_response_meta_type_0.py @@ -0,0 +1,45 @@ +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_audience.py b/src/shellrent_sdk/client/models/o_auth_audience.py new file mode 100644 index 0000000..e3654c4 --- /dev/null +++ b/src/shellrent_sdk/client/models/o_auth_audience.py @@ -0,0 +1,9 @@ +from enum import StrEnum + + +class OAuthAudience(StrEnum): + API_INTERNAL = "api-internal" + API_PUBLIC = "api-public" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/shellrent_sdk/client/models/o_auth_error.py b/src/shellrent_sdk/client/models/o_auth_error.py new file mode 100644 index 0000000..88d14d5 --- /dev/null +++ b/src/shellrent_sdk/client/models/o_auth_error.py @@ -0,0 +1,96 @@ +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="OAuthError") + + +@_attrs_define +class OAuthError: + error: str + error_description: None | str | Unset = UNSET + error_uri: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + error = self.error + + error_description: None | str | Unset + if isinstance(self.error_description, Unset): + error_description = UNSET + else: + error_description = self.error_description + + error_uri: None | str | Unset + if isinstance(self.error_uri, Unset): + error_uri = UNSET + else: + error_uri = self.error_uri + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "error": error, + } + ) + if error_description is not UNSET: + field_dict["error_description"] = error_description + if error_uri is not UNSET: + field_dict["error_uri"] = error_uri + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + error = d.pop("error") + + def _parse_error_description(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + error_description = _parse_error_description(d.pop("error_description", UNSET)) + + def _parse_error_uri(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + error_uri = _parse_error_uri(d.pop("error_uri", UNSET)) + + o_auth_error = cls( + error=error, + error_description=error_description, + error_uri=error_uri, + ) + + o_auth_error.additional_properties = d + return o_auth_error + + @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_token_response.py b/src/shellrent_sdk/client/models/o_auth_token_response.py new file mode 100644 index 0000000..319d407 --- /dev/null +++ b/src/shellrent_sdk/client/models/o_auth_token_response.py @@ -0,0 +1,86 @@ +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="OAuthTokenResponse") + + +@_attrs_define +class OAuthTokenResponse: + token_type: str + expires_in: int + access_token: str + scope: str + """ Elenco degli scope concessi separati da spazio """ + audience: str + """ Audience associata al token """ + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + token_type = self.token_type + + expires_in = self.expires_in + + access_token = self.access_token + + scope = self.scope + + audience = self.audience + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "token_type": token_type, + "expires_in": expires_in, + "access_token": access_token, + "scope": scope, + "audience": audience, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + token_type = d.pop("token_type") + + expires_in = d.pop("expires_in") + + access_token = d.pop("access_token") + + scope = d.pop("scope") + + audience = d.pop("audience") + + o_auth_token_response = cls( + token_type=token_type, + expires_in=expires_in, + access_token=access_token, + scope=scope, + audience=audience, + ) + + o_auth_token_response.additional_properties = d + return o_auth_token_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/object_storage.py b/src/shellrent_sdk/client/models/object_storage.py new file mode 100644 index 0000000..bfe3fcb --- /dev/null +++ b/src/shellrent_sdk/client/models/object_storage.py @@ -0,0 +1,276 @@ +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="ObjectStorage") + + +@_attrs_define +class ObjectStorage: + object_storage_id: int + purchase_id: int | None + name: None | str + email: None | str + code: None | str + code_full: None | str + active: bool | None + active_storage_bytes: int | None + deleted_storage_bytes: int | None + active_objects: int | None + deleted_objects: int | None + api_calls_count: int | None + storage_wrote_bytes: int | None + storage_read_bytes: int | None + egress_traffic_bytes: int | None + ingress_traffic_bytes: int | None + reference_date: datetime.date | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + object_storage_id = self.object_storage_id + + purchase_id: int | None + purchase_id = self.purchase_id + + name: None | str + name = self.name + + email: None | str + email = self.email + + code: None | str + code = self.code + + code_full: None | str + code_full = self.code_full + + active: bool | None + active = self.active + + active_storage_bytes: int | None + active_storage_bytes = self.active_storage_bytes + + deleted_storage_bytes: int | None + deleted_storage_bytes = self.deleted_storage_bytes + + active_objects: int | None + active_objects = self.active_objects + + deleted_objects: int | None + deleted_objects = self.deleted_objects + + api_calls_count: int | None + api_calls_count = self.api_calls_count + + storage_wrote_bytes: int | None + storage_wrote_bytes = self.storage_wrote_bytes + + storage_read_bytes: int | None + storage_read_bytes = self.storage_read_bytes + + egress_traffic_bytes: int | None + egress_traffic_bytes = self.egress_traffic_bytes + + ingress_traffic_bytes: int | None + ingress_traffic_bytes = self.ingress_traffic_bytes + + reference_date: None | str + if isinstance(self.reference_date, datetime.date): + reference_date = self.reference_date.isoformat() + else: + reference_date = self.reference_date + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "object_storage_id": object_storage_id, + "purchase_id": purchase_id, + "name": name, + "email": email, + "code": code, + "code_full": code_full, + "active": active, + "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, + "egress_traffic_bytes": egress_traffic_bytes, + "ingress_traffic_bytes": ingress_traffic_bytes, + "reference_date": reference_date, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + object_storage_id = d.pop("object_storage_id") + + def _parse_purchase_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + purchase_id = _parse_purchase_id(d.pop("purchase_id")) + + def _parse_name(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + name = _parse_name(d.pop("name")) + + def _parse_email(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + email = _parse_email(d.pop("email")) + + def _parse_code(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + code = _parse_code(d.pop("code")) + + def _parse_code_full(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + code_full = _parse_code_full(d.pop("code_full")) + + def _parse_active(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) + + active = _parse_active(d.pop("active")) + + def _parse_active_storage_bytes(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + active_storage_bytes = _parse_active_storage_bytes(d.pop("active_storage_bytes")) + + def _parse_deleted_storage_bytes(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + deleted_storage_bytes = _parse_deleted_storage_bytes(d.pop("deleted_storage_bytes")) + + def _parse_active_objects(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + active_objects = _parse_active_objects(d.pop("active_objects")) + + def _parse_deleted_objects(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + deleted_objects = _parse_deleted_objects(d.pop("deleted_objects")) + + def _parse_api_calls_count(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + api_calls_count = _parse_api_calls_count(d.pop("api_calls_count")) + + def _parse_storage_wrote_bytes(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + storage_wrote_bytes = _parse_storage_wrote_bytes(d.pop("storage_wrote_bytes")) + + def _parse_storage_read_bytes(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + storage_read_bytes = _parse_storage_read_bytes(d.pop("storage_read_bytes")) + + def _parse_egress_traffic_bytes(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + egress_traffic_bytes = _parse_egress_traffic_bytes(d.pop("egress_traffic_bytes")) + + def _parse_ingress_traffic_bytes(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + ingress_traffic_bytes = _parse_ingress_traffic_bytes(d.pop("ingress_traffic_bytes")) + + def _parse_reference_date(data: object) -> datetime.date | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + reference_date_type_0 = datetime.date.fromisoformat(data) + + return reference_date_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.date | None, data) + + reference_date = _parse_reference_date(d.pop("reference_date")) + + object_storage = cls( + object_storage_id=object_storage_id, + purchase_id=purchase_id, + name=name, + email=email, + code=code, + code_full=code_full, + active=active, + 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, + egress_traffic_bytes=egress_traffic_bytes, + ingress_traffic_bytes=ingress_traffic_bytes, + reference_date=reference_date, + ) + + object_storage.additional_properties = d + return object_storage + + @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.py b/src/shellrent_sdk/client/models/object_storage_bucket.py new file mode 100644 index 0000000..3e50a91 --- /dev/null +++ b/src/shellrent_sdk/client/models/object_storage_bucket.py @@ -0,0 +1,359 @@ +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="ObjectStorageBucket") + + +@_attrs_define +class ObjectStorageBucket: + bucket_id: int + object_storage_id: int + sub_account_id: int | None + region_id: int | None + bucket_remote_id: int | None + code: None | str + code_full: None | str + bucket_number: None | str + name: None | str + versioning: None | str + creation_date: datetime.datetime | None + arn: None | str + policy_json: None | str + active_storage_bytes: int | None + deleted_storage_bytes: int | None + active_objects: int | None + deleted_objects: int | None + api_calls_count: int | None + storage_wrote_bytes: int | None + storage_read_bytes: int | None + egress_traffic_bytes: int | None + ingress_traffic_bytes: int | None + reference_date: datetime.date | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + bucket_id = self.bucket_id + + object_storage_id = self.object_storage_id + + sub_account_id: int | None + sub_account_id = self.sub_account_id + + region_id: int | None + region_id = self.region_id + + bucket_remote_id: int | None + bucket_remote_id = self.bucket_remote_id + + code: None | str + code = self.code + + code_full: None | str + code_full = self.code_full + + bucket_number: None | str + bucket_number = self.bucket_number + + name: None | str + name = self.name + + versioning: None | str + versioning = self.versioning + + creation_date: None | str + if isinstance(self.creation_date, datetime.datetime): + creation_date = self.creation_date.isoformat() + else: + creation_date = self.creation_date + + arn: None | str + arn = self.arn + + policy_json: None | str + policy_json = self.policy_json + + active_storage_bytes: int | None + active_storage_bytes = self.active_storage_bytes + + deleted_storage_bytes: int | None + deleted_storage_bytes = self.deleted_storage_bytes + + active_objects: int | None + active_objects = self.active_objects + + deleted_objects: int | None + deleted_objects = self.deleted_objects + + api_calls_count: int | None + api_calls_count = self.api_calls_count + + storage_wrote_bytes: int | None + storage_wrote_bytes = self.storage_wrote_bytes + + storage_read_bytes: int | None + storage_read_bytes = self.storage_read_bytes + + egress_traffic_bytes: int | None + egress_traffic_bytes = self.egress_traffic_bytes + + ingress_traffic_bytes: int | None + ingress_traffic_bytes = self.ingress_traffic_bytes + + reference_date: None | str + if isinstance(self.reference_date, datetime.date): + reference_date = self.reference_date.isoformat() + else: + reference_date = self.reference_date + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "bucket_id": bucket_id, + "object_storage_id": object_storage_id, + "sub_account_id": sub_account_id, + "region_id": region_id, + "bucket_remote_id": bucket_remote_id, + "code": code, + "code_full": code_full, + "bucket_number": bucket_number, + "name": name, + "versioning": versioning, + "creation_date": creation_date, + "arn": arn, + "policy_json": policy_json, + "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, + "egress_traffic_bytes": egress_traffic_bytes, + "ingress_traffic_bytes": ingress_traffic_bytes, + "reference_date": reference_date, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + bucket_id = d.pop("bucket_id") + + object_storage_id = d.pop("object_storage_id") + + def _parse_sub_account_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + sub_account_id = _parse_sub_account_id(d.pop("sub_account_id")) + + def _parse_region_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + region_id = _parse_region_id(d.pop("region_id")) + + def _parse_bucket_remote_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + bucket_remote_id = _parse_bucket_remote_id(d.pop("bucket_remote_id")) + + def _parse_code(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + code = _parse_code(d.pop("code")) + + def _parse_code_full(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + code_full = _parse_code_full(d.pop("code_full")) + + def _parse_bucket_number(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + bucket_number = _parse_bucket_number(d.pop("bucket_number")) + + def _parse_name(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + name = _parse_name(d.pop("name")) + + def _parse_versioning(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + versioning = _parse_versioning(d.pop("versioning")) + + def _parse_creation_date(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + creation_date_type_0 = datetime.datetime.fromisoformat(data) + + return creation_date_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + creation_date = _parse_creation_date(d.pop("creation_date")) + + def _parse_arn(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + arn = _parse_arn(d.pop("arn")) + + def _parse_policy_json(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + policy_json = _parse_policy_json(d.pop("policy_json")) + + def _parse_active_storage_bytes(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + active_storage_bytes = _parse_active_storage_bytes(d.pop("active_storage_bytes")) + + def _parse_deleted_storage_bytes(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + deleted_storage_bytes = _parse_deleted_storage_bytes(d.pop("deleted_storage_bytes")) + + def _parse_active_objects(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + active_objects = _parse_active_objects(d.pop("active_objects")) + + def _parse_deleted_objects(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + deleted_objects = _parse_deleted_objects(d.pop("deleted_objects")) + + def _parse_api_calls_count(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + api_calls_count = _parse_api_calls_count(d.pop("api_calls_count")) + + def _parse_storage_wrote_bytes(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + storage_wrote_bytes = _parse_storage_wrote_bytes(d.pop("storage_wrote_bytes")) + + def _parse_storage_read_bytes(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + storage_read_bytes = _parse_storage_read_bytes(d.pop("storage_read_bytes")) + + def _parse_egress_traffic_bytes(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + egress_traffic_bytes = _parse_egress_traffic_bytes(d.pop("egress_traffic_bytes")) + + def _parse_ingress_traffic_bytes(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + ingress_traffic_bytes = _parse_ingress_traffic_bytes(d.pop("ingress_traffic_bytes")) + + def _parse_reference_date(data: object) -> datetime.date | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + reference_date_type_0 = datetime.date.fromisoformat(data) + + return reference_date_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.date | None, data) + + reference_date = _parse_reference_date(d.pop("reference_date")) + + object_storage_bucket = cls( + bucket_id=bucket_id, + object_storage_id=object_storage_id, + sub_account_id=sub_account_id, + region_id=region_id, + bucket_remote_id=bucket_remote_id, + code=code, + code_full=code_full, + bucket_number=bucket_number, + name=name, + versioning=versioning, + creation_date=creation_date, + arn=arn, + policy_json=policy_json, + 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, + egress_traffic_bytes=egress_traffic_bytes, + ingress_traffic_bytes=ingress_traffic_bytes, + reference_date=reference_date, + ) + + object_storage_bucket.additional_properties = d + return object_storage_bucket + + @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_chart.py b/src/shellrent_sdk/client/models/object_storage_bucket_chart.py new file mode 100644 index 0000000..bb6c0c5 --- /dev/null +++ b/src/shellrent_sdk/client/models/object_storage_bucket_chart.py @@ -0,0 +1,93 @@ +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 + +if TYPE_CHECKING: + from ..models.object_storage_bucket_chart_points_item import ObjectStorageBucketChartPointsItem + + +T = TypeVar("T", bound="ObjectStorageBucketChart") + + +@_attrs_define +class ObjectStorageBucketChart: + object_storage_id: int + bucket_id: int + interval: str + points: list[ObjectStorageBucketChartPointsItem] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + object_storage_id = self.object_storage_id + + bucket_id = self.bucket_id + + interval = self.interval + + points = [] + for points_item_data in self.points: + points_item = points_item_data.to_dict() + points.append(points_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "object_storage_id": object_storage_id, + "bucket_id": bucket_id, + "interval": interval, + "points": points, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.object_storage_bucket_chart_points_item import ( + ObjectStorageBucketChartPointsItem, + ) + + d = dict(src_dict) + object_storage_id = d.pop("object_storage_id") + + bucket_id = d.pop("bucket_id") + + interval = d.pop("interval") + + points = [] + _points = d.pop("points") + for points_item_data in _points: + points_item = ObjectStorageBucketChartPointsItem.from_dict(points_item_data) + + points.append(points_item) + + object_storage_bucket_chart = cls( + object_storage_id=object_storage_id, + bucket_id=bucket_id, + interval=interval, + points=points, + ) + + object_storage_bucket_chart.additional_properties = d + return object_storage_bucket_chart + + @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_chart_points_item.py b/src/shellrent_sdk/client/models/object_storage_bucket_chart_points_item.py new file mode 100644 index 0000000..f9457d9 --- /dev/null +++ b/src/shellrent_sdk/client/models/object_storage_bucket_chart_points_item.py @@ -0,0 +1,129 @@ +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 + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ObjectStorageBucketChartPointsItem") + + +@_attrs_define +class ObjectStorageBucketChartPointsItem: + x: float | Unset = UNSET + """ 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 + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + x = self.x + + active_storage_bytes = self.active_storage_bytes + + deleted_storage_bytes = self.deleted_storage_bytes + + active_objects = self.active_objects + + deleted_objects = self.deleted_objects + + api_calls_count = self.api_calls_count + + storage_wrote_bytes = self.storage_wrote_bytes + + storage_read_bytes = self.storage_read_bytes + + ingress_traffic_bytes = self.ingress_traffic_bytes + + egress_traffic_bytes = self.egress_traffic_bytes + + 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 + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + x = d.pop("x", UNSET) + + active_storage_bytes = d.pop("active_storage_bytes", UNSET) + + deleted_storage_bytes = d.pop("deleted_storage_bytes", UNSET) + + active_objects = d.pop("active_objects", UNSET) + + deleted_objects = d.pop("deleted_objects", UNSET) + + api_calls_count = d.pop("api_calls_count", UNSET) + + storage_wrote_bytes = d.pop("storage_wrote_bytes", UNSET) + + storage_read_bytes = d.pop("storage_read_bytes", UNSET) + + ingress_traffic_bytes = d.pop("ingress_traffic_bytes", UNSET) + + egress_traffic_bytes = d.pop("egress_traffic_bytes", UNSET) + + object_storage_bucket_chart_points_item = cls( + 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, + ) + + object_storage_bucket_chart_points_item.additional_properties = d + return object_storage_bucket_chart_points_item + + @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_chart_response.py b/src/shellrent_sdk/client/models/object_storage_bucket_chart_response.py new file mode 100644 index 0000000..583c818 --- /dev/null +++ b/src/shellrent_sdk/client/models/object_storage_bucket_chart_response.py @@ -0,0 +1,116 @@ +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.object_storage_bucket_chart import ObjectStorageBucketChart + from ..models.object_storage_bucket_chart_response_meta_type_0 import ( + ObjectStorageBucketChartResponseMetaType0, + ) + + +T = TypeVar("T", bound="ObjectStorageBucketChartResponse") + + +@_attrs_define +class ObjectStorageBucketChartResponse: + error: int + message: None | str + data: ObjectStorageBucketChart + meta: None | ObjectStorageBucketChartResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, ObjectStorageBucketChartResponseMetaType0): + 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.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") + + 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 = 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")) + + object_storage_bucket_chart_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + object_storage_bucket_chart_response.additional_properties = d + return object_storage_bucket_chart_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/object_storage_bucket_chart_response_meta_type_0.py b/src/shellrent_sdk/client/models/object_storage_bucket_chart_response_meta_type_0.py new file mode 100644 index 0000000..d2bc8a8 --- /dev/null +++ b/src/shellrent_sdk/client/models/object_storage_bucket_chart_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..9f75bfb --- /dev/null +++ b/src/shellrent_sdk/client/models/object_storage_bucket_firewall_entry.py @@ -0,0 +1,121 @@ +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="ObjectStorageBucketFirewallEntry") + + +@_attrs_define +class ObjectStorageBucketFirewallEntry: + entry_id: int + object_storage_id: int + bucket_id: int + ip: None | str + active: bool | None + date_created: datetime.datetime | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + entry_id = self.entry_id + + object_storage_id = self.object_storage_id + + bucket_id = self.bucket_id + + ip: None | str + ip = self.ip + + active: bool | None + active = self.active + + date_created: None | str + if isinstance(self.date_created, datetime.datetime): + date_created = self.date_created.isoformat() + else: + date_created = self.date_created + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "entry_id": entry_id, + "object_storage_id": object_storage_id, + "bucket_id": bucket_id, + "ip": ip, + "active": active, + "date_created": date_created, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + entry_id = d.pop("entry_id") + + object_storage_id = d.pop("object_storage_id") + + bucket_id = d.pop("bucket_id") + + def _parse_ip(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + ip = _parse_ip(d.pop("ip")) + + def _parse_active(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) + + active = _parse_active(d.pop("active")) + + def _parse_date_created(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + date_created_type_0 = datetime.datetime.fromisoformat(data) + + return date_created_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + date_created = _parse_date_created(d.pop("date_created")) + + object_storage_bucket_firewall_entry = cls( + entry_id=entry_id, + object_storage_id=object_storage_id, + bucket_id=bucket_id, + ip=ip, + active=active, + date_created=date_created, + ) + + object_storage_bucket_firewall_entry.additional_properties = d + return object_storage_bucket_firewall_entry + + @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_create_request.py b/src/shellrent_sdk/client/models/object_storage_bucket_firewall_entry_create_request.py new file mode 100644 index 0000000..a633045 --- /dev/null +++ b/src/shellrent_sdk/client/models/object_storage_bucket_firewall_entry_create_request.py @@ -0,0 +1,56 @@ +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 + +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) + + 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 + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + ip = d.pop("ip", UNSET) + + 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 new file mode 100644 index 0000000..f8c777c --- /dev/null +++ b/src/shellrent_sdk/client/models/object_storage_bucket_firewall_entry_paginated_list_response.py @@ -0,0 +1,101 @@ +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.object_storage_bucket_firewall_entry import ObjectStorageBucketFirewallEntry + from ..models.pagination_meta import PaginationMeta + + +T = TypeVar("T", bound="ObjectStorageBucketFirewallEntryPaginatedListResponse") + + +@_attrs_define +class ObjectStorageBucketFirewallEntryPaginatedListResponse: + error: int + message: None | str + data: list[ObjectStorageBucketFirewallEntry] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.object_storage_bucket_firewall_entry import ( + ObjectStorageBucketFirewallEntry, + ) + from ..models.pagination_meta import PaginationMeta + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = ObjectStorageBucketFirewallEntry.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + object_storage_bucket_firewall_entry_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + object_storage_bucket_firewall_entry_paginated_list_response.additional_properties = d + return object_storage_bucket_firewall_entry_paginated_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/object_storage_bucket_firewall_entry_response.py b/src/shellrent_sdk/client/models/object_storage_bucket_firewall_entry_response.py new file mode 100644 index 0000000..d7ef2f8 --- /dev/null +++ b/src/shellrent_sdk/client/models/object_storage_bucket_firewall_entry_response.py @@ -0,0 +1,118 @@ +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.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") + + +@_attrs_define +class ObjectStorageBucketFirewallEntryResponse: + error: int + message: None | str + data: ObjectStorageBucketFirewallEntry + meta: None | ObjectStorageBucketFirewallEntryResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, ObjectStorageBucketFirewallEntryResponseMetaType0): + 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.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") + + 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 = 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")) + + object_storage_bucket_firewall_entry_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + object_storage_bucket_firewall_entry_response.additional_properties = d + return object_storage_bucket_firewall_entry_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/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 new file mode 100644 index 0000000..4c13212 --- /dev/null +++ b/src/shellrent_sdk/client/models/object_storage_bucket_firewall_entry_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..0078d4e --- /dev/null +++ b/src/shellrent_sdk/client/models/object_storage_bucket_paginated_list_response.py @@ -0,0 +1,99 @@ +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.object_storage_bucket import ObjectStorageBucket + from ..models.pagination_meta import PaginationMeta + + +T = TypeVar("T", bound="ObjectStorageBucketPaginatedListResponse") + + +@_attrs_define +class ObjectStorageBucketPaginatedListResponse: + error: int + message: None | str + data: list[ObjectStorageBucket] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.object_storage_bucket import ObjectStorageBucket + from ..models.pagination_meta import PaginationMeta + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = ObjectStorageBucket.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + object_storage_bucket_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + object_storage_bucket_paginated_list_response.additional_properties = d + return object_storage_bucket_paginated_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/object_storage_bucket_response.py b/src/shellrent_sdk/client/models/object_storage_bucket_response.py new file mode 100644 index 0000000..940ea7b --- /dev/null +++ b/src/shellrent_sdk/client/models/object_storage_bucket_response.py @@ -0,0 +1,116 @@ +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.object_storage_bucket import ObjectStorageBucket + from ..models.object_storage_bucket_response_meta_type_0 import ( + ObjectStorageBucketResponseMetaType0, + ) + + +T = TypeVar("T", bound="ObjectStorageBucketResponse") + + +@_attrs_define +class ObjectStorageBucketResponse: + error: int + message: None | str + data: ObjectStorageBucket + meta: None | ObjectStorageBucketResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, ObjectStorageBucketResponseMetaType0): + 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.object_storage_bucket import ObjectStorageBucket + from ..models.object_storage_bucket_response_meta_type_0 import ( + ObjectStorageBucketResponseMetaType0, + ) + + 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 = 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")) + + object_storage_bucket_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + object_storage_bucket_response.additional_properties = d + return object_storage_bucket_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/object_storage_bucket_response_meta_type_0.py b/src/shellrent_sdk/client/models/object_storage_bucket_response_meta_type_0.py new file mode 100644 index 0000000..4723861 --- /dev/null +++ b/src/shellrent_sdk/client/models/object_storage_bucket_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..9cfe054 --- /dev/null +++ b/src/shellrent_sdk/client/models/object_storage_iam_user.py @@ -0,0 +1,173 @@ +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="ObjectStorageIamUser") + + +@_attrs_define +class ObjectStorageIamUser: + iam_user_id: int + object_storage_id: int + sub_account_id: int + code: None | str + code_full: None | str + iam_id: None | str + arn: None | str + active: bool | None + firewall_policy: None | str + date_created: datetime.datetime | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + iam_user_id = self.iam_user_id + + object_storage_id = self.object_storage_id + + sub_account_id = self.sub_account_id + + code: None | str + code = self.code + + code_full: None | str + code_full = self.code_full + + iam_id: None | str + iam_id = self.iam_id + + arn: None | str + arn = self.arn + + 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() + else: + date_created = self.date_created + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "iam_user_id": iam_user_id, + "object_storage_id": object_storage_id, + "sub_account_id": sub_account_id, + "code": code, + "code_full": code_full, + "iam_id": iam_id, + "arn": arn, + "active": active, + "firewall_policy": firewall_policy, + "date_created": date_created, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + iam_user_id = d.pop("iam_user_id") + + object_storage_id = d.pop("object_storage_id") + + sub_account_id = d.pop("sub_account_id") + + def _parse_code(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + code = _parse_code(d.pop("code")) + + def _parse_code_full(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + code_full = _parse_code_full(d.pop("code_full")) + + def _parse_iam_id(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + iam_id = _parse_iam_id(d.pop("iam_id")) + + def _parse_arn(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + arn = _parse_arn(d.pop("arn")) + + def _parse_active(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) + + 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 + try: + if not isinstance(data, str): + raise TypeError() + date_created_type_0 = datetime.datetime.fromisoformat(data) + + return date_created_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + date_created = _parse_date_created(d.pop("date_created")) + + object_storage_iam_user = cls( + iam_user_id=iam_user_id, + object_storage_id=object_storage_id, + sub_account_id=sub_account_id, + code=code, + code_full=code_full, + iam_id=iam_id, + arn=arn, + active=active, + firewall_policy=firewall_policy, + date_created=date_created, + ) + + object_storage_iam_user.additional_properties = d + return object_storage_iam_user + + @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_paginated_list_response.py b/src/shellrent_sdk/client/models/object_storage_iam_user_paginated_list_response.py new file mode 100644 index 0000000..66eedf8 --- /dev/null +++ b/src/shellrent_sdk/client/models/object_storage_iam_user_paginated_list_response.py @@ -0,0 +1,99 @@ +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.object_storage_iam_user import ObjectStorageIamUser + from ..models.pagination_meta import PaginationMeta + + +T = TypeVar("T", bound="ObjectStorageIamUserPaginatedListResponse") + + +@_attrs_define +class ObjectStorageIamUserPaginatedListResponse: + error: int + message: None | str + data: list[ObjectStorageIamUser] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.object_storage_iam_user import ObjectStorageIamUser + from ..models.pagination_meta import PaginationMeta + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = ObjectStorageIamUser.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + object_storage_iam_user_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + object_storage_iam_user_paginated_list_response.additional_properties = d + return object_storage_iam_user_paginated_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/object_storage_iam_user_response.py b/src/shellrent_sdk/client/models/object_storage_iam_user_response.py new file mode 100644 index 0000000..8f59501 --- /dev/null +++ b/src/shellrent_sdk/client/models/object_storage_iam_user_response.py @@ -0,0 +1,116 @@ +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.object_storage_iam_user import ObjectStorageIamUser + from ..models.object_storage_iam_user_response_meta_type_0 import ( + ObjectStorageIamUserResponseMetaType0, + ) + + +T = TypeVar("T", bound="ObjectStorageIamUserResponse") + + +@_attrs_define +class ObjectStorageIamUserResponse: + error: int + message: None | str + data: ObjectStorageIamUser + meta: None | ObjectStorageIamUserResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, ObjectStorageIamUserResponseMetaType0): + 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.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") + + 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 = 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")) + + object_storage_iam_user_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + object_storage_iam_user_response.additional_properties = d + return object_storage_iam_user_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/object_storage_iam_user_response_meta_type_0.py b/src/shellrent_sdk/client/models/object_storage_iam_user_response_meta_type_0.py new file mode 100644 index 0000000..992dd95 --- /dev/null +++ b/src/shellrent_sdk/client/models/object_storage_iam_user_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..7f4959c --- /dev/null +++ b/src/shellrent_sdk/client/models/object_storage_iam_user_s3_key.py @@ -0,0 +1,147 @@ +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="ObjectStorageIamUserS3Key") + + +@_attrs_define +class ObjectStorageIamUserS3Key: + s3_key_id: int + object_storage_id: int + iam_user_id: int + access_key: None | str + secret_key: None | str + status: None | str + active: bool | None + date_created: datetime.datetime | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + s3_key_id = self.s3_key_id + + object_storage_id = self.object_storage_id + + iam_user_id = self.iam_user_id + + access_key: None | str + access_key = self.access_key + + secret_key: None | str + secret_key = self.secret_key + + status: None | str + status = self.status + + active: bool | None + active = self.active + + date_created: None | str + if isinstance(self.date_created, datetime.datetime): + date_created = self.date_created.isoformat() + else: + date_created = self.date_created + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "s3_key_id": s3_key_id, + "object_storage_id": object_storage_id, + "iam_user_id": iam_user_id, + "access_key": access_key, + "secret_key": secret_key, + "status": status, + "active": active, + "date_created": date_created, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + s3_key_id = d.pop("s3_key_id") + + object_storage_id = d.pop("object_storage_id") + + iam_user_id = d.pop("iam_user_id") + + def _parse_access_key(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + access_key = _parse_access_key(d.pop("access_key")) + + def _parse_secret_key(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + secret_key = _parse_secret_key(d.pop("secret_key")) + + 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_active(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) + + active = _parse_active(d.pop("active")) + + def _parse_date_created(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + date_created_type_0 = datetime.datetime.fromisoformat(data) + + return date_created_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + date_created = _parse_date_created(d.pop("date_created")) + + object_storage_iam_user_s3_key = cls( + s3_key_id=s3_key_id, + object_storage_id=object_storage_id, + iam_user_id=iam_user_id, + access_key=access_key, + secret_key=secret_key, + status=status, + active=active, + date_created=date_created, + ) + + object_storage_iam_user_s3_key.additional_properties = d + return object_storage_iam_user_s3_key + + @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_list_response.py b/src/shellrent_sdk/client/models/object_storage_iam_user_s3_key_list_response.py new file mode 100644 index 0000000..e93276b --- /dev/null +++ b/src/shellrent_sdk/client/models/object_storage_iam_user_s3_key_list_response.py @@ -0,0 +1,126 @@ +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.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") + + +@_attrs_define +class ObjectStorageIamUserS3KeyListResponse: + error: int + message: None | str + data: list[ObjectStorageIamUserS3Key] + meta: None | ObjectStorageIamUserS3KeyListResponseMetaType0 + 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 + message = self.message + + data = [] + for data_item_data in self.data: + 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 + + 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.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") + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = ObjectStorageIamUserS3Key.from_dict(data_item_data) + + 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")) + + object_storage_iam_user_s3_key_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + object_storage_iam_user_s3_key_list_response.additional_properties = d + return object_storage_iam_user_s3_key_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/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 new file mode 100644 index 0000000..2922e3e --- /dev/null +++ b/src/shellrent_sdk/client/models/object_storage_iam_user_s3_key_list_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..15485bd --- /dev/null +++ b/src/shellrent_sdk/client/models/object_storage_iam_user_s3_key_response.py @@ -0,0 +1,118 @@ +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.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") + + +@_attrs_define +class ObjectStorageIamUserS3KeyResponse: + error: int + message: None | str + data: ObjectStorageIamUserS3Key + meta: None | ObjectStorageIamUserS3KeyResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, ObjectStorageIamUserS3KeyResponseMetaType0): + 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.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") + + 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 = 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")) + + object_storage_iam_user_s3_key_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + object_storage_iam_user_s3_key_response.additional_properties = d + return object_storage_iam_user_s3_key_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/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 new file mode 100644 index 0000000..fb8a26d --- /dev/null +++ b/src/shellrent_sdk/client/models/object_storage_iam_user_s3_key_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..5a3bef5 --- /dev/null +++ b/src/shellrent_sdk/client/models/object_storage_paginated_list_response.py @@ -0,0 +1,99 @@ +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.object_storage import ObjectStorage + from ..models.pagination_meta import PaginationMeta + + +T = TypeVar("T", bound="ObjectStoragePaginatedListResponse") + + +@_attrs_define +class ObjectStoragePaginatedListResponse: + error: int + message: None | str + data: list[ObjectStorage] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.object_storage import ObjectStorage + from ..models.pagination_meta import PaginationMeta + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = ObjectStorage.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + object_storage_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + object_storage_paginated_list_response.additional_properties = d + return object_storage_paginated_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/object_storage_response.py b/src/shellrent_sdk/client/models/object_storage_response.py new file mode 100644 index 0000000..975ebac --- /dev/null +++ b/src/shellrent_sdk/client/models/object_storage_response.py @@ -0,0 +1,112 @@ +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.object_storage import ObjectStorage + from ..models.object_storage_response_meta_type_0 import ObjectStorageResponseMetaType0 + + +T = TypeVar("T", bound="ObjectStorageResponse") + + +@_attrs_define +class ObjectStorageResponse: + error: int + message: None | str + data: ObjectStorage + meta: None | ObjectStorageResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, ObjectStorageResponseMetaType0): + 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.object_storage import ObjectStorage + from ..models.object_storage_response_meta_type_0 import ( + ObjectStorageResponseMetaType0, + ) + + 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 = 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")) + + object_storage_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + object_storage_response.additional_properties = d + return object_storage_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/object_storage_response_meta_type_0.py b/src/shellrent_sdk/client/models/object_storage_response_meta_type_0.py new file mode 100644 index 0000000..158adb5 --- /dev/null +++ b/src/shellrent_sdk/client/models/object_storage_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..ee22eb4 --- /dev/null +++ b/src/shellrent_sdk/client/models/object_storage_s3_key.py @@ -0,0 +1,128 @@ +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="ObjectStorageS3Key") + + +@_attrs_define +class ObjectStorageS3Key: + object_storage_id: int + sub_account_id: int + username: None | str + user_id: None | str + arn: None | str + access_key: None | str + secret_key: None | str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + object_storage_id = self.object_storage_id + + sub_account_id = self.sub_account_id + + username: None | str + username = self.username + + user_id: None | str + user_id = self.user_id + + arn: None | str + arn = self.arn + + access_key: None | str + access_key = self.access_key + + secret_key: None | str + secret_key = self.secret_key + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "object_storage_id": object_storage_id, + "sub_account_id": sub_account_id, + "username": username, + "user_id": user_id, + "arn": arn, + "access_key": access_key, + "secret_key": secret_key, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + object_storage_id = d.pop("object_storage_id") + + sub_account_id = d.pop("sub_account_id") + + 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_user_id(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + user_id = _parse_user_id(d.pop("user_id")) + + def _parse_arn(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + arn = _parse_arn(d.pop("arn")) + + def _parse_access_key(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + access_key = _parse_access_key(d.pop("access_key")) + + def _parse_secret_key(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + secret_key = _parse_secret_key(d.pop("secret_key")) + + object_storage_s3_key = cls( + object_storage_id=object_storage_id, + sub_account_id=sub_account_id, + username=username, + user_id=user_id, + arn=arn, + access_key=access_key, + secret_key=secret_key, + ) + + object_storage_s3_key.additional_properties = d + return object_storage_s3_key + + @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_response.py b/src/shellrent_sdk/client/models/object_storage_s3_key_response.py new file mode 100644 index 0000000..3e4f804 --- /dev/null +++ b/src/shellrent_sdk/client/models/object_storage_s3_key_response.py @@ -0,0 +1,116 @@ +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.object_storage_s3_key import ObjectStorageS3Key + from ..models.object_storage_s3_key_response_meta_type_0 import ( + ObjectStorageS3KeyResponseMetaType0, + ) + + +T = TypeVar("T", bound="ObjectStorageS3KeyResponse") + + +@_attrs_define +class ObjectStorageS3KeyResponse: + error: int + message: None | str + data: ObjectStorageS3Key + meta: None | ObjectStorageS3KeyResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, ObjectStorageS3KeyResponseMetaType0): + 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.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") + + 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 = 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")) + + object_storage_s3_key_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + object_storage_s3_key_response.additional_properties = d + return object_storage_s3_key_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/object_storage_s3_key_response_meta_type_0.py b/src/shellrent_sdk/client/models/object_storage_s3_key_response_meta_type_0.py new file mode 100644 index 0000000..d123335 --- /dev/null +++ b/src/shellrent_sdk/client/models/object_storage_s3_key_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..10c4f08 --- /dev/null +++ b/src/shellrent_sdk/client/models/one_click.py @@ -0,0 +1,150 @@ +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 + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="OneClick") + + +@_attrs_define +class OneClick: + one_click_id: int + payment_method: str + description: str + method_type: None | str + creditcard_pan: None | str + date_expiry: datetime.date | None + 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]: + one_click_id = self.one_click_id + + payment_method = self.payment_method + + description = self.description + + method_type: None | str + method_type = self.method_type + + creditcard_pan: None | str + creditcard_pan = self.creditcard_pan + + date_expiry: None | str + if isinstance(self.date_expiry, datetime.date): + date_expiry = self.date_expiry.isoformat() + else: + date_expiry = self.date_expiry + + 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( + { + "one_click_id": one_click_id, + "payment_method": payment_method, + "description": description, + "method_type": method_type, + "creditcard_pan": creditcard_pan, + "date_expiry": date_expiry, + "date_created": date_created, + } + ) + if one_click_preference is not UNSET: + field_dict["one_click_preference"] = one_click_preference + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + one_click_id = d.pop("one_click_id") + + payment_method = d.pop("payment_method") + + description = d.pop("description") + + def _parse_method_type(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + method_type = _parse_method_type(d.pop("method_type")) + + 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_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")) + + 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, + description=description, + method_type=method_type, + creditcard_pan=creditcard_pan, + date_expiry=date_expiry, + date_created=date_created, + one_click_preference=one_click_preference, + ) + + one_click.additional_properties = d + return one_click + + @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_autorenew.py b/src/shellrent_sdk/client/models/one_click_autorenew.py new file mode 100644 index 0000000..59b877a --- /dev/null +++ b/src/shellrent_sdk/client/models/one_click_autorenew.py @@ -0,0 +1,70 @@ +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 + +if TYPE_CHECKING: + from ..models.one_click import OneClick + + +T = TypeVar("T", bound="OneClickAutorenew") + + +@_attrs_define +class OneClickAutorenew: + one_click_preference: list[OneClick] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + 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( + { + "one_click_preference": one_click_preference, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.one_click import OneClick + + d = dict(src_dict) + one_click_preference = [] + _one_click_preference = d.pop("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_autorenew = cls( + one_click_preference=one_click_preference, + ) + + one_click_autorenew.additional_properties = d + return one_click_autorenew + + @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_autorenew_response.py b/src/shellrent_sdk/client/models/one_click_autorenew_response.py new file mode 100644 index 0000000..a3db0cf --- /dev/null +++ b/src/shellrent_sdk/client/models/one_click_autorenew_response.py @@ -0,0 +1,114 @@ +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.one_click_autorenew import OneClickAutorenew + from ..models.one_click_autorenew_response_meta_type_0 import OneClickAutorenewResponseMetaType0 + + +T = TypeVar("T", bound="OneClickAutorenewResponse") + + +@_attrs_define +class OneClickAutorenewResponse: + error: int + message: None | str + data: OneClickAutorenew + meta: None | OneClickAutorenewResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, OneClickAutorenewResponseMetaType0): + 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.one_click_autorenew import OneClickAutorenew + from ..models.one_click_autorenew_response_meta_type_0 import ( + OneClickAutorenewResponseMetaType0, + ) + + 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 = 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")) + + one_click_autorenew_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + one_click_autorenew_response.additional_properties = d + return one_click_autorenew_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/one_click_autorenew_response_meta_type_0.py b/src/shellrent_sdk/client/models/one_click_autorenew_response_meta_type_0.py new file mode 100644 index 0000000..e9c9f77 --- /dev/null +++ b/src/shellrent_sdk/client/models/one_click_autorenew_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..c948292 --- /dev/null +++ b/src/shellrent_sdk/client/models/one_click_paginated_list_response.py @@ -0,0 +1,99 @@ +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.one_click import OneClick + from ..models.pagination_meta import PaginationMeta + + +T = TypeVar("T", bound="OneClickPaginatedListResponse") + + +@_attrs_define +class OneClickPaginatedListResponse: + error: int + message: None | str + data: list[OneClick] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.one_click import OneClick + from ..models.pagination_meta import PaginationMeta + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = OneClick.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + one_click_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + one_click_paginated_list_response.additional_properties = d + return one_click_paginated_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/one_click_response.py b/src/shellrent_sdk/client/models/one_click_response.py new file mode 100644 index 0000000..2e8ddef --- /dev/null +++ b/src/shellrent_sdk/client/models/one_click_response.py @@ -0,0 +1,112 @@ +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.one_click import OneClick + from ..models.one_click_response_meta_type_0 import OneClickResponseMetaType0 + + +T = TypeVar("T", bound="OneClickResponse") + + +@_attrs_define +class OneClickResponse: + error: int + message: None | str + data: OneClick + meta: None | OneClickResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, OneClickResponseMetaType0): + 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.one_click import OneClick + from ..models.one_click_response_meta_type_0 import ( + OneClickResponseMetaType0, + ) + + 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 = 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")) + + one_click_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + one_click_response.additional_properties = d + return one_click_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/one_click_response_meta_type_0.py b/src/shellrent_sdk/client/models/one_click_response_meta_type_0.py new file mode 100644 index 0000000..db8a1e4 --- /dev/null +++ b/src/shellrent_sdk/client/models/one_click_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..5364f91 --- /dev/null +++ b/src/shellrent_sdk/client/models/order.py @@ -0,0 +1,248 @@ +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.account_billing import AccountBilling + from ..models.amount import Amount + from ..models.invoice import Invoice + from ..models.order_invoice_status import OrderInvoiceStatus + from ..models.order_payment_status import OrderPaymentStatus + from ..models.order_status import OrderStatus + from ..models.promotion import Promotion + + +T = TypeVar("T", bound="Order") + + +@_attrs_define +class Order: + order_id: int + type_: str + status: OrderStatus + payment_status: OrderPaymentStatus + invoice_status: OrderInvoiceStatus + invoice: Invoice | None + billing: AccountBilling + intent_type: str + date_payed: datetime.date | None + date_confirmed: datetime.datetime | None + payed: bool + total_amount: Amount + payment_amount: Amount + origin: str + promotions: list[Promotion] + rows_count: int + date_created: datetime.datetime + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.invoice import Invoice + + order_id = self.order_id + + type_ = self.type_ + + status = self.status.to_dict() + + payment_status = self.payment_status.to_dict() + + invoice_status = self.invoice_status.to_dict() + + invoice: dict[str, Any] | None + if isinstance(self.invoice, Invoice): + invoice = self.invoice.to_dict() + else: + invoice = self.invoice + + billing = self.billing.to_dict() + + intent_type = self.intent_type + + date_payed: None | str + if isinstance(self.date_payed, datetime.date): + date_payed = self.date_payed.isoformat() + else: + date_payed = self.date_payed + + date_confirmed: None | str + if isinstance(self.date_confirmed, datetime.datetime): + date_confirmed = self.date_confirmed.isoformat() + else: + date_confirmed = self.date_confirmed + + payed = self.payed + + total_amount = self.total_amount.to_dict() + + payment_amount = self.payment_amount.to_dict() + + origin = self.origin + + promotions = [] + for promotions_item_data in self.promotions: + promotions_item = promotions_item_data.to_dict() + promotions.append(promotions_item) + + rows_count = self.rows_count + + date_created = self.date_created.isoformat() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "order_id": order_id, + "type": type_, + "status": status, + "payment_status": payment_status, + "invoice_status": invoice_status, + "invoice": invoice, + "billing": billing, + "intent_type": intent_type, + "date_payed": date_payed, + "date_confirmed": date_confirmed, + "payed": payed, + "total_amount": total_amount, + "payment_amount": payment_amount, + "origin": origin, + "promotions": promotions, + "rows_count": rows_count, + "date_created": date_created, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.account_billing import AccountBilling + from ..models.amount import Amount + from ..models.invoice import Invoice + from ..models.order_invoice_status import OrderInvoiceStatus + from ..models.order_payment_status import OrderPaymentStatus + from ..models.order_status import OrderStatus + from ..models.promotion import Promotion + + d = dict(src_dict) + order_id = d.pop("order_id") + + type_ = d.pop("type") + + status = OrderStatus.from_dict(d.pop("status")) + + payment_status = OrderPaymentStatus.from_dict(d.pop("payment_status")) + + invoice_status = OrderInvoiceStatus.from_dict(d.pop("invoice_status")) + + def _parse_invoice(data: object) -> Invoice | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + invoice_type_0 = Invoice.from_dict(data) + + return invoice_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(Invoice | None, data) + + invoice = _parse_invoice(d.pop("invoice")) + + billing = AccountBilling.from_dict(d.pop("billing")) + + intent_type = d.pop("intent_type") + + def _parse_date_payed(data: object) -> datetime.date | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + date_payed_type_0 = datetime.date.fromisoformat(data) + + return date_payed_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.date | None, data) + + date_payed = _parse_date_payed(d.pop("date_payed")) + + def _parse_date_confirmed(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + date_confirmed_type_0 = datetime.datetime.fromisoformat(data) + + return date_confirmed_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + date_confirmed = _parse_date_confirmed(d.pop("date_confirmed")) + + payed = d.pop("payed") + + total_amount = Amount.from_dict(d.pop("total_amount")) + + payment_amount = Amount.from_dict(d.pop("payment_amount")) + + origin = d.pop("origin") + + promotions = [] + _promotions = d.pop("promotions") + for promotions_item_data in _promotions: + promotions_item = Promotion.from_dict(promotions_item_data) + + promotions.append(promotions_item) + + rows_count = d.pop("rows_count") + + date_created = datetime.datetime.fromisoformat(d.pop("date_created")) + + order = cls( + order_id=order_id, + type_=type_, + status=status, + payment_status=payment_status, + invoice_status=invoice_status, + invoice=invoice, + billing=billing, + intent_type=intent_type, + date_payed=date_payed, + date_confirmed=date_confirmed, + payed=payed, + total_amount=total_amount, + payment_amount=payment_amount, + origin=origin, + promotions=promotions, + rows_count=rows_count, + date_created=date_created, + ) + + order.additional_properties = d + return order + + @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_cancel.py b/src/shellrent_sdk/client/models/order_can_cancel.py new file mode 100644 index 0000000..8f47354 --- /dev/null +++ b/src/shellrent_sdk/client/models/order_can_cancel.py @@ -0,0 +1,63 @@ +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="OrderCanCancel") + + +@_attrs_define +class OrderCanCancel: + order_id: int + can_cancel: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + order_id = self.order_id + + can_cancel = self.can_cancel + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "order_id": order_id, + "can_cancel": can_cancel, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + order_id = d.pop("order_id") + + can_cancel = d.pop("can_cancel") + + order_can_cancel = cls( + order_id=order_id, + can_cancel=can_cancel, + ) + + order_can_cancel.additional_properties = d + return order_can_cancel + + @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_cancel_response.py b/src/shellrent_sdk/client/models/order_can_cancel_response.py new file mode 100644 index 0000000..91e6bee --- /dev/null +++ b/src/shellrent_sdk/client/models/order_can_cancel_response.py @@ -0,0 +1,112 @@ +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.order_can_cancel import OrderCanCancel + from ..models.order_can_cancel_response_meta_type_0 import OrderCanCancelResponseMetaType0 + + +T = TypeVar("T", bound="OrderCanCancelResponse") + + +@_attrs_define +class OrderCanCancelResponse: + error: int + message: None | str + data: OrderCanCancel + meta: None | OrderCanCancelResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, OrderCanCancelResponseMetaType0): + 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.order_can_cancel import OrderCanCancel + from ..models.order_can_cancel_response_meta_type_0 import ( + OrderCanCancelResponseMetaType0, + ) + + 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 = 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")) + + order_can_cancel_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + order_can_cancel_response.additional_properties = d + return order_can_cancel_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/order_can_cancel_response_meta_type_0.py b/src/shellrent_sdk/client/models/order_can_cancel_response_meta_type_0.py new file mode 100644 index 0000000..af87371 --- /dev/null +++ b/src/shellrent_sdk/client/models/order_can_cancel_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..a72978d --- /dev/null +++ b/src/shellrent_sdk/client/models/order_can_pay.py @@ -0,0 +1,108 @@ +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.amount_simple import AmountSimple + from ..models.order import Order + + +T = TypeVar("T", bound="OrderCanPay") + + +@_attrs_define +class OrderCanPay: + order_id: int + can_pay: bool + amount: AmountSimple | Unset = UNSET + orders: list[Order] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + order_id = self.order_id + + can_pay = self.can_pay + + amount: dict[str, Any] | Unset = UNSET + if not isinstance(self.amount, Unset): + amount = self.amount.to_dict() + + 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) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "order_id": order_id, + "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 + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.amount_simple import AmountSimple + from ..models.order import Order + + d = dict(src_dict) + order_id = d.pop("order_id") + + can_pay = d.pop("can_pay") + + _amount = d.pop("amount", UNSET) + amount: AmountSimple | Unset + if isinstance(_amount, Unset): + amount = UNSET + else: + amount = AmountSimple.from_dict(_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.append(orders_item) + + order_can_pay = cls( + order_id=order_id, + can_pay=can_pay, + amount=amount, + orders=orders, + ) + + order_can_pay.additional_properties = d + return order_can_pay + + @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_response.py b/src/shellrent_sdk/client/models/order_can_pay_response.py new file mode 100644 index 0000000..b6c46cc --- /dev/null +++ b/src/shellrent_sdk/client/models/order_can_pay_response.py @@ -0,0 +1,112 @@ +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.order_can_pay import OrderCanPay + from ..models.order_can_pay_response_meta_type_0 import OrderCanPayResponseMetaType0 + + +T = TypeVar("T", bound="OrderCanPayResponse") + + +@_attrs_define +class OrderCanPayResponse: + error: int + message: None | str + data: OrderCanPay + meta: None | OrderCanPayResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, OrderCanPayResponseMetaType0): + 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.order_can_pay import OrderCanPay + from ..models.order_can_pay_response_meta_type_0 import ( + OrderCanPayResponseMetaType0, + ) + + 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 = 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")) + + order_can_pay_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + order_can_pay_response.additional_properties = d + return order_can_pay_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/order_can_pay_response_meta_type_0.py b/src/shellrent_sdk/client/models/order_can_pay_response_meta_type_0.py new file mode 100644 index 0000000..5cdbf66 --- /dev/null +++ b/src/shellrent_sdk/client/models/order_can_pay_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..9cc53af --- /dev/null +++ b/src/shellrent_sdk/client/models/order_invoice_status.py @@ -0,0 +1,63 @@ +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="OrderInvoiceStatus") + + +@_attrs_define +class OrderInvoiceStatus: + status_code: str + status_name: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + status_code = self.status_code + + status_name = self.status_name + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "status_code": status_code, + "status_name": status_name, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + status_code = d.pop("status_code") + + status_name = d.pop("status_name") + + order_invoice_status = cls( + status_code=status_code, + status_name=status_name, + ) + + order_invoice_status.additional_properties = d + return order_invoice_status + + @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_list_response.py b/src/shellrent_sdk/client/models/order_list_response.py new file mode 100644 index 0000000..01a0c0a --- /dev/null +++ b/src/shellrent_sdk/client/models/order_list_response.py @@ -0,0 +1,120 @@ +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.order import Order + from ..models.order_list_response_meta_type_0 import OrderListResponseMetaType0 + + +T = TypeVar("T", bound="OrderListResponse") + + +@_attrs_define +class OrderListResponse: + error: int + message: None | str + data: list[Order] + meta: None | OrderListResponseMetaType0 + 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 + message = self.message + + data = [] + for data_item_data in self.data: + 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 + + 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.order import Order + from ..models.order_list_response_meta_type_0 import ( + OrderListResponseMetaType0, + ) + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = Order.from_dict(data_item_data) + + 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")) + + order_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + order_list_response.additional_properties = d + return order_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/order_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/order_list_response_meta_type_0.py new file mode 100644 index 0000000..e4649c1 --- /dev/null +++ b/src/shellrent_sdk/client/models/order_list_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..5baa4f1 --- /dev/null +++ b/src/shellrent_sdk/client/models/order_paginated_list_response.py @@ -0,0 +1,99 @@ +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.order import Order + from ..models.pagination_meta import PaginationMeta + + +T = TypeVar("T", bound="OrderPaginatedListResponse") + + +@_attrs_define +class OrderPaginatedListResponse: + error: int + message: None | str + data: list[Order] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.order import Order + from ..models.pagination_meta import PaginationMeta + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = Order.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + order_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + order_paginated_list_response.additional_properties = d + return order_paginated_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/order_pay_request.py b/src/shellrent_sdk/client/models/order_pay_request.py new file mode 100644 index 0000000..3301f8c --- /dev/null +++ b/src/shellrent_sdk/client/models/order_pay_request.py @@ -0,0 +1,98 @@ +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 new file mode 100644 index 0000000..18deb8b --- /dev/null +++ b/src/shellrent_sdk/client/models/order_payment_status.py @@ -0,0 +1,63 @@ +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="OrderPaymentStatus") + + +@_attrs_define +class OrderPaymentStatus: + status_code: str + status_name: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + status_code = self.status_code + + status_name = self.status_name + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "status_code": status_code, + "status_name": status_name, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + status_code = d.pop("status_code") + + status_name = d.pop("status_name") + + order_payment_status = cls( + status_code=status_code, + status_name=status_name, + ) + + order_payment_status.additional_properties = d + return order_payment_status + + @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_response.py b/src/shellrent_sdk/client/models/order_response.py new file mode 100644 index 0000000..dab83ba --- /dev/null +++ b/src/shellrent_sdk/client/models/order_response.py @@ -0,0 +1,110 @@ +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.order import Order + from ..models.order_response_meta_type_0 import OrderResponseMetaType0 + + +T = TypeVar("T", bound="OrderResponse") + + +@_attrs_define +class OrderResponse: + error: int + message: None | str + data: Order + meta: None | OrderResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, OrderResponseMetaType0): + 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.order import Order + from ..models.order_response_meta_type_0 import OrderResponseMetaType0 + + 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 = 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")) + + order_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + order_response.additional_properties = d + return order_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/order_response_meta_type_0.py b/src/shellrent_sdk/client/models/order_response_meta_type_0.py new file mode 100644 index 0000000..4844c0d --- /dev/null +++ b/src/shellrent_sdk/client/models/order_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..afb1b1d --- /dev/null +++ b/src/shellrent_sdk/client/models/order_row.py @@ -0,0 +1,122 @@ +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="OrderRow") + + +@_attrs_define +class OrderRow: + order_row_id: int + order_id: int + service: int | None + purchase: int | None + recurrence: int | None + price: Amount + base_price: Amount + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + order_row_id = self.order_row_id + + order_id = self.order_id + + service: int | None + service = self.service + + purchase: int | None + purchase = self.purchase + + recurrence: int | None + recurrence = self.recurrence + + price = self.price.to_dict() + + base_price = self.base_price.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "order_row_id": order_row_id, + "order_id": order_id, + "service": service, + "purchase": purchase, + "recurrence": recurrence, + "price": price, + "base_price": base_price, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.amount import Amount + + d = dict(src_dict) + order_row_id = d.pop("order_row_id") + + order_id = d.pop("order_id") + + def _parse_service(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + service = _parse_service(d.pop("service")) + + def _parse_purchase(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + purchase = _parse_purchase(d.pop("purchase")) + + def _parse_recurrence(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + recurrence = _parse_recurrence(d.pop("recurrence")) + + price = Amount.from_dict(d.pop("price")) + + base_price = Amount.from_dict(d.pop("base_price")) + + order_row = cls( + order_row_id=order_row_id, + order_id=order_id, + service=service, + purchase=purchase, + recurrence=recurrence, + price=price, + base_price=base_price, + ) + + order_row.additional_properties = d + return order_row + + @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_list_response.py b/src/shellrent_sdk/client/models/order_row_list_response.py new file mode 100644 index 0000000..26fd864 --- /dev/null +++ b/src/shellrent_sdk/client/models/order_row_list_response.py @@ -0,0 +1,120 @@ +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.order_row import OrderRow + from ..models.order_row_list_response_meta_type_0 import OrderRowListResponseMetaType0 + + +T = TypeVar("T", bound="OrderRowListResponse") + + +@_attrs_define +class OrderRowListResponse: + error: int + message: None | str + data: list[OrderRow] + meta: None | OrderRowListResponseMetaType0 + 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 + message = self.message + + data = [] + for data_item_data in self.data: + 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 + + 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.order_row import OrderRow + from ..models.order_row_list_response_meta_type_0 import ( + OrderRowListResponseMetaType0, + ) + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = OrderRow.from_dict(data_item_data) + + 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")) + + order_row_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + order_row_list_response.additional_properties = d + return order_row_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/order_row_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/order_row_list_response_meta_type_0.py new file mode 100644 index 0000000..fe8575f --- /dev/null +++ b/src/shellrent_sdk/client/models/order_row_list_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..f677a9b --- /dev/null +++ b/src/shellrent_sdk/client/models/order_row_response.py @@ -0,0 +1,112 @@ +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.order_row import OrderRow + from ..models.order_row_response_meta_type_0 import OrderRowResponseMetaType0 + + +T = TypeVar("T", bound="OrderRowResponse") + + +@_attrs_define +class OrderRowResponse: + error: int + message: None | str + data: OrderRow + meta: None | OrderRowResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, OrderRowResponseMetaType0): + 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.order_row import OrderRow + from ..models.order_row_response_meta_type_0 import ( + OrderRowResponseMetaType0, + ) + + 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 = 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")) + + order_row_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + order_row_response.additional_properties = d + return order_row_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/order_row_response_meta_type_0.py b/src/shellrent_sdk/client/models/order_row_response_meta_type_0.py new file mode 100644 index 0000000..591809a --- /dev/null +++ b/src/shellrent_sdk/client/models/order_row_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..8b22f80 --- /dev/null +++ b/src/shellrent_sdk/client/models/order_status.py @@ -0,0 +1,63 @@ +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="OrderStatus") + + +@_attrs_define +class OrderStatus: + status_code: str + status_name: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + status_code = self.status_code + + status_name = self.status_name + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "status_code": status_code, + "status_name": status_name, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + status_code = d.pop("status_code") + + status_name = d.pop("status_name") + + order_status = cls( + status_code=status_code, + status_name=status_name, + ) + + order_status.additional_properties = d + return order_status + + @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/pagination_meta.py b/src/shellrent_sdk/client/models/pagination_meta.py new file mode 100644 index 0000000..8bd57f4 --- /dev/null +++ b/src/shellrent_sdk/client/models/pagination_meta.py @@ -0,0 +1,84 @@ +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="PaginationMeta") + + +@_attrs_define +class PaginationMeta: + total: int + count: int + pages: int + page: int + per_page: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + total = self.total + + count = self.count + + pages = self.pages + + page = self.page + + per_page = self.per_page + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "total": total, + "count": count, + "pages": pages, + "page": page, + "per_page": per_page, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + total = d.pop("total") + + count = d.pop("count") + + pages = d.pop("pages") + + page = d.pop("page") + + per_page = d.pop("per_page") + + pagination_meta = cls( + total=total, + count=count, + pages=pages, + page=page, + per_page=per_page, + ) + + pagination_meta.additional_properties = d + return pagination_meta + + @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.py b/src/shellrent_sdk/client/models/pay_orders_response_200.py new file mode 100644 index 0000000..355df4a --- /dev/null +++ b/src/shellrent_sdk/client/models/pay_orders_response_200.py @@ -0,0 +1,133 @@ +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 new file mode 100644 index 0000000..ebfbcc4 --- /dev/null +++ b/src/shellrent_sdk/client/models/pay_orders_response_200_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..c190565 --- /dev/null +++ b/src/shellrent_sdk/client/models/payment.py @@ -0,0 +1,169 @@ +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.amount_simple import AmountSimple + from ..models.payment_provider_data_type_0 import PaymentProviderDataType0 + from ..models.prepaid_credit_operation import PrepaidCreditOperation + + +T = TypeVar("T", bound="Payment") + + +@_attrs_define +class Payment: + payment_id: int + payment_method: str + payment_code: str + amount_total: AmountSimple + amount_payed: AmountSimple + date_payment: datetime.datetime | None + payed: bool + prepaid_credit_operations: list[PrepaidCreditOperation] + provider_data: None | PaymentProviderDataType0 + 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 + + payment_id = self.payment_id + + payment_method = self.payment_method + + payment_code = self.payment_code + + amount_total = self.amount_total.to_dict() + + amount_payed = self.amount_payed.to_dict() + + date_payment: None | str + if isinstance(self.date_payment, datetime.datetime): + date_payment = self.date_payment.isoformat() + else: + date_payment = self.date_payment + + payed = self.payed + + prepaid_credit_operations = [] + for prepaid_credit_operations_item_data in self.prepaid_credit_operations: + prepaid_credit_operations_item = prepaid_credit_operations_item_data.to_dict() + prepaid_credit_operations.append(prepaid_credit_operations_item) + + provider_data: dict[str, Any] | None + if isinstance(self.provider_data, PaymentProviderDataType0): + provider_data = self.provider_data.to_dict() + else: + provider_data = self.provider_data + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "payment_id": payment_id, + "payment_method": payment_method, + "payment_code": payment_code, + "amount_total": amount_total, + "amount_payed": amount_payed, + "date_payment": date_payment, + "payed": payed, + "prepaid_credit_operations": prepaid_credit_operations, + "provider_data": provider_data, + } + ) + + return field_dict + + @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.prepaid_credit_operation import PrepaidCreditOperation + + d = dict(src_dict) + payment_id = d.pop("payment_id") + + payment_method = d.pop("payment_method") + + payment_code = d.pop("payment_code") + + amount_total = AmountSimple.from_dict(d.pop("amount_total")) + + amount_payed = AmountSimple.from_dict(d.pop("amount_payed")) + + def _parse_date_payment(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + date_payment_type_0 = datetime.datetime.fromisoformat(data) + + return date_payment_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + date_payment = _parse_date_payment(d.pop("date_payment")) + + payed = d.pop("payed") + + prepaid_credit_operations = [] + _prepaid_credit_operations = d.pop("prepaid_credit_operations") + for prepaid_credit_operations_item_data in _prepaid_credit_operations: + prepaid_credit_operations_item = PrepaidCreditOperation.from_dict( + prepaid_credit_operations_item_data + ) + + prepaid_credit_operations.append(prepaid_credit_operations_item) + + def _parse_provider_data(data: object) -> None | PaymentProviderDataType0: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + provider_data_type_0 = PaymentProviderDataType0.from_dict(data) + + return provider_data_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | PaymentProviderDataType0, data) + + provider_data = _parse_provider_data(d.pop("provider_data")) + + payment = cls( + payment_id=payment_id, + payment_method=payment_method, + payment_code=payment_code, + amount_total=amount_total, + amount_payed=amount_payed, + date_payment=date_payment, + payed=payed, + prepaid_credit_operations=prepaid_credit_operations, + provider_data=provider_data, + ) + + payment.additional_properties = d + return payment + + @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_paginated_list_response.py b/src/shellrent_sdk/client/models/payment_paginated_list_response.py new file mode 100644 index 0000000..bdb3047 --- /dev/null +++ b/src/shellrent_sdk/client/models/payment_paginated_list_response.py @@ -0,0 +1,99 @@ +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.pagination_meta import PaginationMeta + from ..models.payment import Payment + + +T = TypeVar("T", bound="PaymentPaginatedListResponse") + + +@_attrs_define +class PaymentPaginatedListResponse: + error: int + message: None | str + data: list[Payment] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.pagination_meta import PaginationMeta + 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")) + + data = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = Payment.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + payment_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + payment_paginated_list_response.additional_properties = d + return payment_paginated_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/payment_provider_data_type_0.py b/src/shellrent_sdk/client/models/payment_provider_data_type_0.py new file mode 100644 index 0000000..4dd9a7a --- /dev/null +++ b/src/shellrent_sdk/client/models/payment_provider_data_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..7038170 --- /dev/null +++ b/src/shellrent_sdk/client/models/payment_response.py @@ -0,0 +1,110 @@ +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.payment import Payment + from ..models.payment_response_meta_type_0 import PaymentResponseMetaType0 + + +T = TypeVar("T", bound="PaymentResponse") + + +@_attrs_define +class PaymentResponse: + error: int + message: None | str + data: Payment + meta: None | PaymentResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, PaymentResponseMetaType0): + 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.payment import Payment + from ..models.payment_response_meta_type_0 import PaymentResponseMetaType0 + + 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 = 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")) + + payment_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + payment_response.additional_properties = d + return payment_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/payment_response_meta_type_0.py b/src/shellrent_sdk/client/models/payment_response_meta_type_0.py new file mode 100644 index 0000000..1e2ce11 --- /dev/null +++ b/src/shellrent_sdk/client/models/payment_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..b68aeed --- /dev/null +++ b/src/shellrent_sdk/client/models/pec.py @@ -0,0 +1,246 @@ +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="Pec") + + +@_attrs_define +class Pec: + pec_id: int + purchase_id: int | None + purchase_name: None | str + purchase_status_code: None | str + box_name: None | str + full_box_name: None | str + domain: None | str + report_email: None | str + report_sms: None | str + password_recovery_email: None | str + inbox_usage: float | None + archive_usage: float | None + extra_inbox: int | None + extra_archive: int | None + transfer_in: bool + owner_not_assignable: bool + password_wrong: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + pec_id = self.pec_id + + purchase_id: int | None + purchase_id = self.purchase_id + + purchase_name: None | str + purchase_name = self.purchase_name + + purchase_status_code: None | str + purchase_status_code = self.purchase_status_code + + box_name: None | str + box_name = self.box_name + + full_box_name: None | str + full_box_name = self.full_box_name + + domain: None | str + domain = self.domain + + report_email: None | str + report_email = self.report_email + + report_sms: None | str + report_sms = self.report_sms + + password_recovery_email: None | str + password_recovery_email = self.password_recovery_email + + inbox_usage: float | None + inbox_usage = self.inbox_usage + + archive_usage: float | None + archive_usage = self.archive_usage + + extra_inbox: int | None + extra_inbox = self.extra_inbox + + extra_archive: int | None + extra_archive = self.extra_archive + + transfer_in = self.transfer_in + + owner_not_assignable = self.owner_not_assignable + + password_wrong = self.password_wrong + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "pec_id": pec_id, + "purchase_id": purchase_id, + "purchase_name": purchase_name, + "purchase_status_code": purchase_status_code, + "box_name": box_name, + "full_box_name": full_box_name, + "domain": domain, + "report_email": report_email, + "report_sms": report_sms, + "password_recovery_email": password_recovery_email, + "inbox_usage": inbox_usage, + "archive_usage": archive_usage, + "extra_inbox": extra_inbox, + "extra_archive": extra_archive, + "transfer_in": transfer_in, + "owner_not_assignable": owner_not_assignable, + "password_wrong": password_wrong, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + pec_id = d.pop("pec_id") + + def _parse_purchase_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + purchase_id = _parse_purchase_id(d.pop("purchase_id")) + + 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_box_name(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + box_name = _parse_box_name(d.pop("box_name")) + + def _parse_full_box_name(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + full_box_name = _parse_full_box_name(d.pop("full_box_name")) + + 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_report_email(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + report_email = _parse_report_email(d.pop("report_email")) + + def _parse_report_sms(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + report_sms = _parse_report_sms(d.pop("report_sms")) + + def _parse_password_recovery_email(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + password_recovery_email = _parse_password_recovery_email(d.pop("password_recovery_email")) + + def _parse_inbox_usage(data: object) -> float | None: + if data is None: + return data + return cast(float | None, data) + + inbox_usage = _parse_inbox_usage(d.pop("inbox_usage")) + + def _parse_archive_usage(data: object) -> float | None: + if data is None: + return data + return cast(float | None, data) + + archive_usage = _parse_archive_usage(d.pop("archive_usage")) + + def _parse_extra_inbox(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + extra_inbox = _parse_extra_inbox(d.pop("extra_inbox")) + + def _parse_extra_archive(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + extra_archive = _parse_extra_archive(d.pop("extra_archive")) + + transfer_in = d.pop("transfer_in") + + owner_not_assignable = d.pop("owner_not_assignable") + + password_wrong = d.pop("password_wrong") + + pec = cls( + pec_id=pec_id, + purchase_id=purchase_id, + purchase_name=purchase_name, + purchase_status_code=purchase_status_code, + box_name=box_name, + full_box_name=full_box_name, + domain=domain, + report_email=report_email, + report_sms=report_sms, + password_recovery_email=password_recovery_email, + inbox_usage=inbox_usage, + archive_usage=archive_usage, + extra_inbox=extra_inbox, + extra_archive=extra_archive, + transfer_in=transfer_in, + owner_not_assignable=owner_not_assignable, + password_wrong=password_wrong, + ) + + pec.additional_properties = d + return pec + + @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_domain.py b/src/shellrent_sdk/client/models/pec_domain.py new file mode 100644 index 0000000..ac8a475 --- /dev/null +++ b/src/shellrent_sdk/client/models/pec_domain.py @@ -0,0 +1,169 @@ +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="PecDomain") + + +@_attrs_define +class PecDomain: + pec_domain_id: int + purchase_id: int | None + purchase_name: None | str + purchase_status_code: None | str + purchase_pec_owner_id: int | None + domain: None | str + provider_domain_id: None | str + transfer_in: bool + force_decertify_domain: bool + aruba_public: bool + shellrent_public: bool + can_require_owner_change: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + pec_domain_id = self.pec_domain_id + + purchase_id: int | None + purchase_id = self.purchase_id + + purchase_name: None | str + purchase_name = self.purchase_name + + purchase_status_code: None | str + purchase_status_code = self.purchase_status_code + + purchase_pec_owner_id: int | None + purchase_pec_owner_id = self.purchase_pec_owner_id + + domain: None | str + domain = self.domain + + provider_domain_id: None | str + provider_domain_id = self.provider_domain_id + + transfer_in = self.transfer_in + + force_decertify_domain = self.force_decertify_domain + + aruba_public = self.aruba_public + + shellrent_public = self.shellrent_public + + can_require_owner_change = self.can_require_owner_change + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "pec_domain_id": pec_domain_id, + "purchase_id": purchase_id, + "purchase_name": purchase_name, + "purchase_status_code": purchase_status_code, + "purchase_pec_owner_id": purchase_pec_owner_id, + "domain": domain, + "provider_domain_id": provider_domain_id, + "transfer_in": transfer_in, + "force_decertify_domain": force_decertify_domain, + "aruba_public": aruba_public, + "shellrent_public": shellrent_public, + "can_require_owner_change": can_require_owner_change, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + pec_domain_id = d.pop("pec_domain_id") + + def _parse_purchase_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + purchase_id = _parse_purchase_id(d.pop("purchase_id")) + + 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_purchase_pec_owner_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + purchase_pec_owner_id = _parse_purchase_pec_owner_id(d.pop("purchase_pec_owner_id")) + + 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_provider_domain_id(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + provider_domain_id = _parse_provider_domain_id(d.pop("provider_domain_id")) + + transfer_in = d.pop("transfer_in") + + force_decertify_domain = d.pop("force_decertify_domain") + + aruba_public = d.pop("aruba_public") + + shellrent_public = d.pop("shellrent_public") + + can_require_owner_change = d.pop("can_require_owner_change") + + pec_domain = cls( + pec_domain_id=pec_domain_id, + purchase_id=purchase_id, + purchase_name=purchase_name, + purchase_status_code=purchase_status_code, + purchase_pec_owner_id=purchase_pec_owner_id, + domain=domain, + provider_domain_id=provider_domain_id, + transfer_in=transfer_in, + force_decertify_domain=force_decertify_domain, + aruba_public=aruba_public, + shellrent_public=shellrent_public, + can_require_owner_change=can_require_owner_change, + ) + + pec_domain.additional_properties = d + return pec_domain + + @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_domain_paginated_list_response.py b/src/shellrent_sdk/client/models/pec_domain_paginated_list_response.py new file mode 100644 index 0000000..d195c82 --- /dev/null +++ b/src/shellrent_sdk/client/models/pec_domain_paginated_list_response.py @@ -0,0 +1,99 @@ +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.pagination_meta import PaginationMeta + from ..models.pec_domain import PecDomain + + +T = TypeVar("T", bound="PecDomainPaginatedListResponse") + + +@_attrs_define +class PecDomainPaginatedListResponse: + error: int + message: None | str + data: list[PecDomain] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.pagination_meta import PaginationMeta + from ..models.pec_domain import PecDomain + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = PecDomain.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + pec_domain_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + pec_domain_paginated_list_response.additional_properties = d + return pec_domain_paginated_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/pec_domain_response.py b/src/shellrent_sdk/client/models/pec_domain_response.py new file mode 100644 index 0000000..8fe37d3 --- /dev/null +++ b/src/shellrent_sdk/client/models/pec_domain_response.py @@ -0,0 +1,112 @@ +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.pec_domain import PecDomain + from ..models.pec_domain_response_meta_type_0 import PecDomainResponseMetaType0 + + +T = TypeVar("T", bound="PecDomainResponse") + + +@_attrs_define +class PecDomainResponse: + error: int + message: None | str + data: PecDomain + meta: None | PecDomainResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, PecDomainResponseMetaType0): + 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.pec_domain import PecDomain + from ..models.pec_domain_response_meta_type_0 import ( + PecDomainResponseMetaType0, + ) + + 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 = 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")) + + pec_domain_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + pec_domain_response.additional_properties = d + return pec_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/pec_domain_response_meta_type_0.py b/src/shellrent_sdk/client/models/pec_domain_response_meta_type_0.py new file mode 100644 index 0000000..fe723af --- /dev/null +++ b/src/shellrent_sdk/client/models/pec_domain_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..fa4c494 --- /dev/null +++ b/src/shellrent_sdk/client/models/pec_mailbox_owner_change_create_request.py @@ -0,0 +1,81 @@ +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="PecMailboxOwnerChangeCreateRequest") + + +@_attrs_define +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 """ + identity_document_upload_id: int + """ ID of identity document uploaded with /api/v3/upload """ + 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) + + def to_dict(self) -> dict[str, Any]: + owner_id = self.owner_id + + contract_upload_id = self.contract_upload_id + + identity_document_upload_id = self.identity_document_upload_id + + 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, + "contract_upload_id": contract_upload_id, + "identity_document_upload_id": identity_document_upload_id, + "order_module_upload_id": order_module_upload_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + owner_id = d.pop("owner_id") + + contract_upload_id = d.pop("contract_upload_id") + + identity_document_upload_id = d.pop("identity_document_upload_id") + + order_module_upload_id = d.pop("order_module_upload_id") + + pec_mailbox_owner_change_create_request = cls( + owner_id=owner_id, + contract_upload_id=contract_upload_id, + identity_document_upload_id=identity_document_upload_id, + 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 new file mode 100644 index 0000000..615262c --- /dev/null +++ b/src/shellrent_sdk/client/models/pec_mailbox_update_request.py @@ -0,0 +1,75 @@ +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 + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PecMailboxUpdateRequest") + + +@_attrs_define +class PecMailboxUpdateRequest: + report_email: str | Unset = UNSET + """ Notification email for PEC reports. Use empty string to clear. """ + report_sms: str | Unset = UNSET + """ 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 + + report_sms = self.report_sms + + 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 + if report_sms is not UNSET: + field_dict["report_sms"] = report_sms + if password_recovery_email is not UNSET: + field_dict["password_recovery_email"] = password_recovery_email + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + report_email = d.pop("report_email", UNSET) + + report_sms = d.pop("report_sms", UNSET) + + password_recovery_email = d.pop("password_recovery_email", UNSET) + + pec_mailbox_update_request = cls( + report_email=report_email, + report_sms=report_sms, + 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 new file mode 100644 index 0000000..de7b56f --- /dev/null +++ b/src/shellrent_sdk/client/models/pec_owner_change.py @@ -0,0 +1,279 @@ +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.pec_owner_summary import PecOwnerSummary + + +T = TypeVar("T", bound="PecOwnerChange") + + +@_attrs_define +class PecOwnerChange: + owner_change_id: int | None + pec_id: int | None + pec_domain_id: int | None + status_code: None | str + rejection_reason: None | str + submission_date: datetime.datetime | None + acceptance_date: datetime.datetime | None + rejection_date: datetime.datetime | None + has_identity_document: bool + has_contract_document: bool + has_order_module_document: bool + person_id_accept: int | None + person_id_reject: int | None + owner_old: PecOwnerSummary + owner_new: PecOwnerSummary + date_created: datetime.datetime | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + owner_change_id: int | None + owner_change_id = self.owner_change_id + + pec_id: int | None + pec_id = self.pec_id + + pec_domain_id: int | None + pec_domain_id = self.pec_domain_id + + status_code: None | str + status_code = self.status_code + + rejection_reason: None | str + rejection_reason = self.rejection_reason + + submission_date: None | str + if isinstance(self.submission_date, datetime.datetime): + submission_date = self.submission_date.isoformat() + else: + submission_date = self.submission_date + + acceptance_date: None | str + if isinstance(self.acceptance_date, datetime.datetime): + acceptance_date = self.acceptance_date.isoformat() + else: + acceptance_date = self.acceptance_date + + rejection_date: None | str + if isinstance(self.rejection_date, datetime.datetime): + rejection_date = self.rejection_date.isoformat() + else: + rejection_date = self.rejection_date + + has_identity_document = self.has_identity_document + + has_contract_document = self.has_contract_document + + 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() + + date_created: None | str + if isinstance(self.date_created, datetime.datetime): + date_created = self.date_created.isoformat() + else: + date_created = self.date_created + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "owner_change_id": owner_change_id, + "pec_id": pec_id, + "pec_domain_id": pec_domain_id, + "status_code": status_code, + "rejection_reason": rejection_reason, + "submission_date": submission_date, + "acceptance_date": acceptance_date, + "rejection_date": rejection_date, + "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, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.pec_owner_summary import PecOwnerSummary + + d = dict(src_dict) + + def _parse_owner_change_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + owner_change_id = _parse_owner_change_id(d.pop("owner_change_id")) + + def _parse_pec_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + pec_id = _parse_pec_id(d.pop("pec_id")) + + def _parse_pec_domain_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + pec_domain_id = _parse_pec_domain_id(d.pop("pec_domain_id")) + + 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_rejection_reason(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + rejection_reason = _parse_rejection_reason(d.pop("rejection_reason")) + + def _parse_submission_date(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + submission_date_type_0 = datetime.datetime.fromisoformat(data) + + return submission_date_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + submission_date = _parse_submission_date(d.pop("submission_date")) + + def _parse_acceptance_date(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + acceptance_date_type_0 = datetime.datetime.fromisoformat(data) + + return acceptance_date_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + acceptance_date = _parse_acceptance_date(d.pop("acceptance_date")) + + def _parse_rejection_date(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + rejection_date_type_0 = datetime.datetime.fromisoformat(data) + + return rejection_date_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + rejection_date = _parse_rejection_date(d.pop("rejection_date")) + + has_identity_document = d.pop("has_identity_document") + + has_contract_document = d.pop("has_contract_document") + + 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")) + + def _parse_date_created(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + date_created_type_0 = datetime.datetime.fromisoformat(data) + + return date_created_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + date_created = _parse_date_created(d.pop("date_created")) + + pec_owner_change = cls( + owner_change_id=owner_change_id, + pec_id=pec_id, + pec_domain_id=pec_domain_id, + status_code=status_code, + rejection_reason=rejection_reason, + submission_date=submission_date, + acceptance_date=acceptance_date, + rejection_date=rejection_date, + 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, + ) + + pec_owner_change.additional_properties = d + return pec_owner_change + + @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_paginated_list_response.py b/src/shellrent_sdk/client/models/pec_owner_change_paginated_list_response.py new file mode 100644 index 0000000..7073fb5 --- /dev/null +++ b/src/shellrent_sdk/client/models/pec_owner_change_paginated_list_response.py @@ -0,0 +1,99 @@ +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.pagination_meta import PaginationMeta + from ..models.pec_owner_change import PecOwnerChange + + +T = TypeVar("T", bound="PecOwnerChangePaginatedListResponse") + + +@_attrs_define +class PecOwnerChangePaginatedListResponse: + error: int + message: None | str + data: list[PecOwnerChange] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.pagination_meta import PaginationMeta + from ..models.pec_owner_change import PecOwnerChange + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = PecOwnerChange.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + pec_owner_change_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + pec_owner_change_paginated_list_response.additional_properties = d + return pec_owner_change_paginated_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/pec_owner_change_response.py b/src/shellrent_sdk/client/models/pec_owner_change_response.py new file mode 100644 index 0000000..f18bb66 --- /dev/null +++ b/src/shellrent_sdk/client/models/pec_owner_change_response.py @@ -0,0 +1,112 @@ +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.pec_owner_change import PecOwnerChange + from ..models.pec_owner_change_response_meta_type_0 import PecOwnerChangeResponseMetaType0 + + +T = TypeVar("T", bound="PecOwnerChangeResponse") + + +@_attrs_define +class PecOwnerChangeResponse: + error: int + message: None | str + data: PecOwnerChange + meta: None | PecOwnerChangeResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, PecOwnerChangeResponseMetaType0): + 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.pec_owner_change import PecOwnerChange + from ..models.pec_owner_change_response_meta_type_0 import ( + PecOwnerChangeResponseMetaType0, + ) + + 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 = 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")) + + pec_owner_change_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + pec_owner_change_response.additional_properties = d + return pec_owner_change_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/pec_owner_change_response_meta_type_0.py b/src/shellrent_sdk/client/models/pec_owner_change_response_meta_type_0.py new file mode 100644 index 0000000..eaf3856 --- /dev/null +++ b/src/shellrent_sdk/client/models/pec_owner_change_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..f71215e --- /dev/null +++ b/src/shellrent_sdk/client/models/pec_owner_summary.py @@ -0,0 +1,180 @@ +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="PecOwnerSummary") + + +@_attrs_define +class PecOwnerSummary: + pec_owner_id: int | None + owner_legal_entity_type: None | str + admin_first_name: None | str + admin_last_name: None | str + admin_email: None | str + admin_fiscal_code: None | str + admin_vat_number: None | str + company_name: None | str + company_email: None | str + company_fiscal_code: None | str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + pec_owner_id: int | None + pec_owner_id = self.pec_owner_id + + owner_legal_entity_type: None | str + owner_legal_entity_type = self.owner_legal_entity_type + + admin_first_name: None | str + admin_first_name = self.admin_first_name + + admin_last_name: None | str + admin_last_name = self.admin_last_name + + admin_email: None | str + admin_email = self.admin_email + + admin_fiscal_code: None | str + admin_fiscal_code = self.admin_fiscal_code + + admin_vat_number: None | str + admin_vat_number = self.admin_vat_number + + company_name: None | str + company_name = self.company_name + + company_email: None | str + company_email = self.company_email + + company_fiscal_code: None | str + company_fiscal_code = self.company_fiscal_code + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "pec_owner_id": pec_owner_id, + "owner_legal_entity_type": owner_legal_entity_type, + "admin_first_name": admin_first_name, + "admin_last_name": admin_last_name, + "admin_email": admin_email, + "admin_fiscal_code": admin_fiscal_code, + "admin_vat_number": admin_vat_number, + "company_name": company_name, + "company_email": company_email, + "company_fiscal_code": company_fiscal_code, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + + def _parse_pec_owner_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + pec_owner_id = _parse_pec_owner_id(d.pop("pec_owner_id")) + + def _parse_owner_legal_entity_type(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + owner_legal_entity_type = _parse_owner_legal_entity_type(d.pop("owner_legal_entity_type")) + + def _parse_admin_first_name(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + admin_first_name = _parse_admin_first_name(d.pop("admin_first_name")) + + def _parse_admin_last_name(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + admin_last_name = _parse_admin_last_name(d.pop("admin_last_name")) + + def _parse_admin_email(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + admin_email = _parse_admin_email(d.pop("admin_email")) + + def _parse_admin_fiscal_code(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + admin_fiscal_code = _parse_admin_fiscal_code(d.pop("admin_fiscal_code")) + + def _parse_admin_vat_number(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + admin_vat_number = _parse_admin_vat_number(d.pop("admin_vat_number")) + + def _parse_company_name(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + company_name = _parse_company_name(d.pop("company_name")) + + def _parse_company_email(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + company_email = _parse_company_email(d.pop("company_email")) + + def _parse_company_fiscal_code(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + company_fiscal_code = _parse_company_fiscal_code(d.pop("company_fiscal_code")) + + pec_owner_summary = cls( + pec_owner_id=pec_owner_id, + owner_legal_entity_type=owner_legal_entity_type, + admin_first_name=admin_first_name, + admin_last_name=admin_last_name, + admin_email=admin_email, + admin_fiscal_code=admin_fiscal_code, + admin_vat_number=admin_vat_number, + company_name=company_name, + company_email=company_email, + company_fiscal_code=company_fiscal_code, + ) + + pec_owner_summary.additional_properties = d + return pec_owner_summary + + @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_paginated_list_response.py b/src/shellrent_sdk/client/models/pec_paginated_list_response.py new file mode 100644 index 0000000..f8a2885 --- /dev/null +++ b/src/shellrent_sdk/client/models/pec_paginated_list_response.py @@ -0,0 +1,99 @@ +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.pagination_meta import PaginationMeta + from ..models.pec import Pec + + +T = TypeVar("T", bound="PecPaginatedListResponse") + + +@_attrs_define +class PecPaginatedListResponse: + error: int + message: None | str + data: list[Pec] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.pagination_meta import PaginationMeta + from ..models.pec import Pec + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = Pec.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + pec_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + pec_paginated_list_response.additional_properties = d + return pec_paginated_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/pec_response.py b/src/shellrent_sdk/client/models/pec_response.py new file mode 100644 index 0000000..1047a67 --- /dev/null +++ b/src/shellrent_sdk/client/models/pec_response.py @@ -0,0 +1,110 @@ +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.pec import Pec + from ..models.pec_response_meta_type_0 import PecResponseMetaType0 + + +T = TypeVar("T", bound="PecResponse") + + +@_attrs_define +class PecResponse: + error: int + message: None | str + data: Pec + meta: None | PecResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, PecResponseMetaType0): + 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.pec import Pec + from ..models.pec_response_meta_type_0 import PecResponseMetaType0 + + 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 = 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")) + + pec_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + pec_response.additional_properties = d + return pec_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/pec_response_meta_type_0.py b/src/shellrent_sdk/client/models/pec_response_meta_type_0.py new file mode 100644 index 0000000..991c215 --- /dev/null +++ b/src/shellrent_sdk/client/models/pec_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..fd972db --- /dev/null +++ b/src/shellrent_sdk/client/models/plesk_license.py @@ -0,0 +1,223 @@ +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_paginated_list_response.py b/src/shellrent_sdk/client/models/plesk_license_paginated_list_response.py new file mode 100644 index 0000000..7b2d23a --- /dev/null +++ b/src/shellrent_sdk/client/models/plesk_license_paginated_list_response.py @@ -0,0 +1,99 @@ +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.pagination_meta import PaginationMeta + from ..models.plesk_license import PleskLicense + + +T = TypeVar("T", bound="PleskLicensePaginatedListResponse") + + +@_attrs_define +class PleskLicensePaginatedListResponse: + error: int + message: None | str + data: list[PleskLicense] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.pagination_meta import PaginationMeta + from ..models.plesk_license import PleskLicense + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = PleskLicense.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + plesk_license_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + plesk_license_paginated_list_response.additional_properties = d + return plesk_license_paginated_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/plesk_license_response.py b/src/shellrent_sdk/client/models/plesk_license_response.py new file mode 100644 index 0000000..d2c2442 --- /dev/null +++ b/src/shellrent_sdk/client/models/plesk_license_response.py @@ -0,0 +1,112 @@ +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 new file mode 100644 index 0000000..d1f59c6 --- /dev/null +++ b/src/shellrent_sdk/client/models/plesk_license_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..2fe8b3d --- /dev/null +++ b/src/shellrent_sdk/client/models/prepaid_credit.py @@ -0,0 +1,101 @@ +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_simple import AmountSimple + + +T = TypeVar("T", bound="PrepaidCredit") + + +@_attrs_define +class PrepaidCredit: + credit_amount: AmountSimple + credit_threshold: AmountSimple | None + threshold_exceeded: bool | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.amount_simple import AmountSimple + + credit_amount = self.credit_amount.to_dict() + + credit_threshold: dict[str, Any] | None + if isinstance(self.credit_threshold, AmountSimple): + credit_threshold = self.credit_threshold.to_dict() + else: + credit_threshold = self.credit_threshold + + threshold_exceeded: bool | None + threshold_exceeded = self.threshold_exceeded + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "credit_amount": credit_amount, + "credit_threshold": credit_threshold, + "threshold_exceeded": threshold_exceeded, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.amount_simple import AmountSimple + + d = dict(src_dict) + credit_amount = AmountSimple.from_dict(d.pop("credit_amount")) + + def _parse_credit_threshold(data: object) -> AmountSimple | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + credit_threshold_type_0 = AmountSimple.from_dict(data) + + return credit_threshold_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(AmountSimple | None, data) + + credit_threshold = _parse_credit_threshold(d.pop("credit_threshold")) + + def _parse_threshold_exceeded(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) + + threshold_exceeded = _parse_threshold_exceeded(d.pop("threshold_exceeded")) + + prepaid_credit = cls( + credit_amount=credit_amount, + credit_threshold=credit_threshold, + threshold_exceeded=threshold_exceeded, + ) + + prepaid_credit.additional_properties = d + return prepaid_credit + + @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.py b/src/shellrent_sdk/client/models/prepaid_credit_operation.py new file mode 100644 index 0000000..f101f2f --- /dev/null +++ b/src/shellrent_sdk/client/models/prepaid_credit_operation.py @@ -0,0 +1,129 @@ +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 + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.amount_simple import AmountSimple + from ..models.creditnote import Creditnote + from ..models.prepaid_credit_operation_type import PrepaidCreditOperationType + from ..models.prepaid_credit_topup import PrepaidCreditTopup + + +T = TypeVar("T", bound="PrepaidCreditOperation") + + +@_attrs_define +class PrepaidCreditOperation: + operation_id: int + operation_id_related: int | None + prepaid_credit_topup: PrepaidCreditTopup + operation_type: PrepaidCreditOperationType + amount: AmountSimple + 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]: + operation_id = self.operation_id + + operation_id_related: int | None + operation_id_related = self.operation_id_related + + prepaid_credit_topup = self.prepaid_credit_topup.to_dict() + + operation_type = self.operation_type.to_dict() + + 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( + { + "operation_id": operation_id, + "operation_id_related": operation_id_related, + "prepaid_credit_topup": prepaid_credit_topup, + "operation_type": operation_type, + "amount": amount, + "date_created": date_created, + } + ) + if creditnote is not UNSET: + field_dict["creditnote"] = creditnote + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.amount_simple import AmountSimple + from ..models.creditnote import Creditnote + from ..models.prepaid_credit_operation_type import ( + PrepaidCreditOperationType, + ) + from ..models.prepaid_credit_topup import PrepaidCreditTopup + + d = dict(src_dict) + operation_id = d.pop("operation_id") + + def _parse_operation_id_related(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + operation_id_related = _parse_operation_id_related(d.pop("operation_id_related")) + + prepaid_credit_topup = PrepaidCreditTopup.from_dict(d.pop("prepaid_credit_topup")) + + operation_type = PrepaidCreditOperationType.from_dict(d.pop("operation_type")) + + 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, + amount=amount, + date_created=date_created, + creditnote=creditnote, + ) + + prepaid_credit_operation.additional_properties = d + return prepaid_credit_operation + + @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_paginated_list_response.py b/src/shellrent_sdk/client/models/prepaid_credit_operation_paginated_list_response.py new file mode 100644 index 0000000..cd8d60a --- /dev/null +++ b/src/shellrent_sdk/client/models/prepaid_credit_operation_paginated_list_response.py @@ -0,0 +1,99 @@ +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.pagination_meta import PaginationMeta + from ..models.prepaid_credit_operation import PrepaidCreditOperation + + +T = TypeVar("T", bound="PrepaidCreditOperationPaginatedListResponse") + + +@_attrs_define +class PrepaidCreditOperationPaginatedListResponse: + error: int + message: None | str + data: list[PrepaidCreditOperation] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.pagination_meta import PaginationMeta + from ..models.prepaid_credit_operation import PrepaidCreditOperation + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = PrepaidCreditOperation.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + prepaid_credit_operation_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + prepaid_credit_operation_paginated_list_response.additional_properties = d + return prepaid_credit_operation_paginated_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/prepaid_credit_operation_response.py b/src/shellrent_sdk/client/models/prepaid_credit_operation_response.py new file mode 100644 index 0000000..16dc7cd --- /dev/null +++ b/src/shellrent_sdk/client/models/prepaid_credit_operation_response.py @@ -0,0 +1,116 @@ +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.prepaid_credit_operation import PrepaidCreditOperation + from ..models.prepaid_credit_operation_response_meta_type_0 import ( + PrepaidCreditOperationResponseMetaType0, + ) + + +T = TypeVar("T", bound="PrepaidCreditOperationResponse") + + +@_attrs_define +class PrepaidCreditOperationResponse: + error: int + message: None | str + data: PrepaidCreditOperation + meta: None | PrepaidCreditOperationResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, PrepaidCreditOperationResponseMetaType0): + 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.prepaid_credit_operation import PrepaidCreditOperation + from ..models.prepaid_credit_operation_response_meta_type_0 import ( + PrepaidCreditOperationResponseMetaType0, + ) + + 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 = 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")) + + prepaid_credit_operation_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + prepaid_credit_operation_response.additional_properties = d + return prepaid_credit_operation_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/prepaid_credit_operation_response_meta_type_0.py b/src/shellrent_sdk/client/models/prepaid_credit_operation_response_meta_type_0.py new file mode 100644 index 0000000..7d8858a --- /dev/null +++ b/src/shellrent_sdk/client/models/prepaid_credit_operation_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..bfb0677 --- /dev/null +++ b/src/shellrent_sdk/client/models/prepaid_credit_operation_type.py @@ -0,0 +1,63 @@ +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="PrepaidCreditOperationType") + + +@_attrs_define +class PrepaidCreditOperationType: + type_code: str + type_description: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + type_code = self.type_code + + type_description = self.type_description + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "type_code": type_code, + "type_description": type_description, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + type_code = d.pop("type_code") + + type_description = d.pop("type_description") + + prepaid_credit_operation_type = cls( + type_code=type_code, + type_description=type_description, + ) + + prepaid_credit_operation_type.additional_properties = d + return prepaid_credit_operation_type + + @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_response.py b/src/shellrent_sdk/client/models/prepaid_credit_response.py new file mode 100644 index 0000000..4a815f5 --- /dev/null +++ b/src/shellrent_sdk/client/models/prepaid_credit_response.py @@ -0,0 +1,112 @@ +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.prepaid_credit import PrepaidCredit + from ..models.prepaid_credit_response_meta_type_0 import PrepaidCreditResponseMetaType0 + + +T = TypeVar("T", bound="PrepaidCreditResponse") + + +@_attrs_define +class PrepaidCreditResponse: + error: int + message: None | str + data: PrepaidCredit + meta: None | PrepaidCreditResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, PrepaidCreditResponseMetaType0): + 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.prepaid_credit import PrepaidCredit + from ..models.prepaid_credit_response_meta_type_0 import ( + PrepaidCreditResponseMetaType0, + ) + + 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 = 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")) + + prepaid_credit_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + prepaid_credit_response.additional_properties = d + return prepaid_credit_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/prepaid_credit_response_meta_type_0.py b/src/shellrent_sdk/client/models/prepaid_credit_response_meta_type_0.py new file mode 100644 index 0000000..cd5672a --- /dev/null +++ b/src/shellrent_sdk/client/models/prepaid_credit_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..4bf8acb --- /dev/null +++ b/src/shellrent_sdk/client/models/prepaid_credit_topup.py @@ -0,0 +1,160 @@ +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.amount_simple import AmountSimple + from ..models.invoice import Invoice + + +T = TypeVar("T", bound="PrepaidCreditTopup") + + +@_attrs_define +class PrepaidCreditTopup: + topup_id: int + invoice: Invoice | None + initial_credit: AmountSimple + current_credit: AmountSimple + refund_expiry: datetime.date | None + credit_expiry: datetime.date | None + date_created: datetime.datetime + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.invoice import Invoice + + topup_id = self.topup_id + + invoice: dict[str, Any] | None + if isinstance(self.invoice, Invoice): + invoice = self.invoice.to_dict() + else: + invoice = self.invoice + + initial_credit = self.initial_credit.to_dict() + + current_credit = self.current_credit.to_dict() + + refund_expiry: None | str + if isinstance(self.refund_expiry, datetime.date): + refund_expiry = self.refund_expiry.isoformat() + else: + refund_expiry = self.refund_expiry + + credit_expiry: None | str + if isinstance(self.credit_expiry, datetime.date): + credit_expiry = self.credit_expiry.isoformat() + else: + credit_expiry = self.credit_expiry + + date_created = self.date_created.isoformat() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "topup_id": topup_id, + "invoice": invoice, + "initial_credit": initial_credit, + "current_credit": current_credit, + "refund_expiry": refund_expiry, + "credit_expiry": credit_expiry, + "date_created": date_created, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.amount_simple import AmountSimple + from ..models.invoice import Invoice + + d = dict(src_dict) + topup_id = d.pop("topup_id") + + def _parse_invoice(data: object) -> Invoice | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + invoice_type_0 = Invoice.from_dict(data) + + return invoice_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(Invoice | None, data) + + invoice = _parse_invoice(d.pop("invoice")) + + initial_credit = AmountSimple.from_dict(d.pop("initial_credit")) + + current_credit = AmountSimple.from_dict(d.pop("current_credit")) + + def _parse_refund_expiry(data: object) -> datetime.date | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + refund_expiry_type_0 = datetime.date.fromisoformat(data) + + return refund_expiry_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.date | None, data) + + refund_expiry = _parse_refund_expiry(d.pop("refund_expiry")) + + def _parse_credit_expiry(data: object) -> datetime.date | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + credit_expiry_type_0 = datetime.date.fromisoformat(data) + + return credit_expiry_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.date | None, data) + + credit_expiry = _parse_credit_expiry(d.pop("credit_expiry")) + + date_created = datetime.datetime.fromisoformat(d.pop("date_created")) + + prepaid_credit_topup = cls( + topup_id=topup_id, + invoice=invoice, + initial_credit=initial_credit, + current_credit=current_credit, + refund_expiry=refund_expiry, + credit_expiry=credit_expiry, + date_created=date_created, + ) + + prepaid_credit_topup.additional_properties = d + return prepaid_credit_topup + + @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_paginated_list_response.py b/src/shellrent_sdk/client/models/prepaid_credit_topup_paginated_list_response.py new file mode 100644 index 0000000..a0652eb --- /dev/null +++ b/src/shellrent_sdk/client/models/prepaid_credit_topup_paginated_list_response.py @@ -0,0 +1,99 @@ +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.pagination_meta import PaginationMeta + from ..models.prepaid_credit_topup import PrepaidCreditTopup + + +T = TypeVar("T", bound="PrepaidCreditTopupPaginatedListResponse") + + +@_attrs_define +class PrepaidCreditTopupPaginatedListResponse: + error: int + message: None | str + data: list[PrepaidCreditTopup] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.pagination_meta import PaginationMeta + from ..models.prepaid_credit_topup import PrepaidCreditTopup + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = PrepaidCreditTopup.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + prepaid_credit_topup_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + prepaid_credit_topup_paginated_list_response.additional_properties = d + return prepaid_credit_topup_paginated_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/prepaid_credit_topup_response.py b/src/shellrent_sdk/client/models/prepaid_credit_topup_response.py new file mode 100644 index 0000000..ef98137 --- /dev/null +++ b/src/shellrent_sdk/client/models/prepaid_credit_topup_response.py @@ -0,0 +1,116 @@ +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.prepaid_credit_topup import PrepaidCreditTopup + from ..models.prepaid_credit_topup_response_meta_type_0 import ( + PrepaidCreditTopupResponseMetaType0, + ) + + +T = TypeVar("T", bound="PrepaidCreditTopupResponse") + + +@_attrs_define +class PrepaidCreditTopupResponse: + error: int + message: None | str + data: PrepaidCreditTopup + meta: None | PrepaidCreditTopupResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, PrepaidCreditTopupResponseMetaType0): + 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.prepaid_credit_topup import PrepaidCreditTopup + from ..models.prepaid_credit_topup_response_meta_type_0 import ( + PrepaidCreditTopupResponseMetaType0, + ) + + 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 = 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")) + + prepaid_credit_topup_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + prepaid_credit_topup_response.additional_properties = d + return prepaid_credit_topup_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/prepaid_credit_topup_response_meta_type_0.py b/src/shellrent_sdk/client/models/prepaid_credit_topup_response_meta_type_0.py new file mode 100644 index 0000000..7289fbc --- /dev/null +++ b/src/shellrent_sdk/client/models/prepaid_credit_topup_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..c8c9a01 --- /dev/null +++ b/src/shellrent_sdk/client/models/private_cloud.py @@ -0,0 +1,251 @@ +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="PrivateCloud") + + +@_attrs_define +class PrivateCloud: + purchase_id: int + server_id: int | None + max_vm: int | None + available_vm: int | None + max_cpu: int | None + cpu_overallocation: int | None + min_vm_cpu: int | None + max_vm_cpu: int | None + max_ram: int | None + min_vm_ram: int | None + max_vm_ram: int | None + max_disk: int | None + min_vm_disk: int | None + max_vm_disk: int | None + max_backup: int | None + max_disk_backup: int | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + purchase_id = self.purchase_id + + server_id: int | None + server_id = self.server_id + + max_vm: int | None + max_vm = self.max_vm + + available_vm: int | None + available_vm = self.available_vm + + max_cpu: int | None + max_cpu = self.max_cpu + + cpu_overallocation: int | None + cpu_overallocation = self.cpu_overallocation + + min_vm_cpu: int | None + min_vm_cpu = self.min_vm_cpu + + max_vm_cpu: int | None + max_vm_cpu = self.max_vm_cpu + + max_ram: int | None + max_ram = self.max_ram + + min_vm_ram: int | None + min_vm_ram = self.min_vm_ram + + max_vm_ram: int | None + max_vm_ram = self.max_vm_ram + + max_disk: int | None + max_disk = self.max_disk + + min_vm_disk: int | None + min_vm_disk = self.min_vm_disk + + max_vm_disk: int | None + max_vm_disk = self.max_vm_disk + + max_backup: int | None + max_backup = self.max_backup + + max_disk_backup: int | None + max_disk_backup = self.max_disk_backup + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "purchase_id": purchase_id, + "server_id": server_id, + "max_vm": max_vm, + "available_vm": available_vm, + "max_cpu": max_cpu, + "cpu_overallocation": cpu_overallocation, + "min_vm_cpu": min_vm_cpu, + "max_vm_cpu": max_vm_cpu, + "max_ram": max_ram, + "min_vm_ram": min_vm_ram, + "max_vm_ram": max_vm_ram, + "max_disk": max_disk, + "min_vm_disk": min_vm_disk, + "max_vm_disk": max_vm_disk, + "max_backup": max_backup, + "max_disk_backup": max_disk_backup, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + purchase_id = d.pop("purchase_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_max_vm(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + max_vm = _parse_max_vm(d.pop("max_vm")) + + def _parse_available_vm(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + available_vm = _parse_available_vm(d.pop("available_vm")) + + def _parse_max_cpu(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + max_cpu = _parse_max_cpu(d.pop("max_cpu")) + + def _parse_cpu_overallocation(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + cpu_overallocation = _parse_cpu_overallocation(d.pop("cpu_overallocation")) + + def _parse_min_vm_cpu(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + min_vm_cpu = _parse_min_vm_cpu(d.pop("min_vm_cpu")) + + def _parse_max_vm_cpu(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + max_vm_cpu = _parse_max_vm_cpu(d.pop("max_vm_cpu")) + + def _parse_max_ram(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + max_ram = _parse_max_ram(d.pop("max_ram")) + + def _parse_min_vm_ram(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + min_vm_ram = _parse_min_vm_ram(d.pop("min_vm_ram")) + + def _parse_max_vm_ram(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + max_vm_ram = _parse_max_vm_ram(d.pop("max_vm_ram")) + + def _parse_max_disk(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + max_disk = _parse_max_disk(d.pop("max_disk")) + + def _parse_min_vm_disk(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + min_vm_disk = _parse_min_vm_disk(d.pop("min_vm_disk")) + + def _parse_max_vm_disk(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + max_vm_disk = _parse_max_vm_disk(d.pop("max_vm_disk")) + + def _parse_max_backup(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + max_backup = _parse_max_backup(d.pop("max_backup")) + + def _parse_max_disk_backup(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + max_disk_backup = _parse_max_disk_backup(d.pop("max_disk_backup")) + + private_cloud = cls( + purchase_id=purchase_id, + server_id=server_id, + max_vm=max_vm, + available_vm=available_vm, + max_cpu=max_cpu, + cpu_overallocation=cpu_overallocation, + min_vm_cpu=min_vm_cpu, + max_vm_cpu=max_vm_cpu, + max_ram=max_ram, + min_vm_ram=min_vm_ram, + max_vm_ram=max_vm_ram, + max_disk=max_disk, + min_vm_disk=min_vm_disk, + max_vm_disk=max_vm_disk, + max_backup=max_backup, + max_disk_backup=max_disk_backup, + ) + + private_cloud.additional_properties = d + return private_cloud + + @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_response.py b/src/shellrent_sdk/client/models/private_cloud_response.py new file mode 100644 index 0000000..1de9eaa --- /dev/null +++ b/src/shellrent_sdk/client/models/private_cloud_response.py @@ -0,0 +1,112 @@ +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.private_cloud import PrivateCloud + from ..models.private_cloud_response_meta_type_0 import PrivateCloudResponseMetaType0 + + +T = TypeVar("T", bound="PrivateCloudResponse") + + +@_attrs_define +class PrivateCloudResponse: + error: int + message: None | str + data: PrivateCloud + meta: None | PrivateCloudResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, PrivateCloudResponseMetaType0): + 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.private_cloud import PrivateCloud + from ..models.private_cloud_response_meta_type_0 import ( + PrivateCloudResponseMetaType0, + ) + + 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 = 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")) + + private_cloud_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + private_cloud_response.additional_properties = d + return private_cloud_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/private_cloud_response_meta_type_0.py b/src/shellrent_sdk/client/models/private_cloud_response_meta_type_0.py new file mode 100644 index 0000000..9d9c862 --- /dev/null +++ b/src/shellrent_sdk/client/models/private_cloud_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..79322b6 --- /dev/null +++ b/src/shellrent_sdk/client/models/private_cloud_vm_create_request.py @@ -0,0 +1,135 @@ +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 + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PrivateCloudVmCreateRequest") + + +@_attrs_define +class PrivateCloudVmCreateRequest: + cpu: int + ram: int + disk: int + server_configuration_id: int | Unset = UNSET + """ Server configuration ID """ + template_id: int | Unset = UNSET + """ Server template ID (OS) """ + template_vm_id: int | Unset = UNSET + """ 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 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 + + ram = self.ram + + disk = self.disk + + server_configuration_id = self.server_configuration_id + + template_id = self.template_id + + template_vm_id = self.template_vm_id + + ip_address_id = self.ip_address_id + + use_local_ip = self.use_local_ip + + ssh_key_id = self.ssh_key_id + + note = self.note + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "cpu": cpu, + "ram": ram, + "disk": disk, + } + ) + if server_configuration_id is not UNSET: + field_dict["server_configuration_id"] = server_configuration_id + if template_id is not UNSET: + field_dict["template_id"] = template_id + if template_vm_id is not UNSET: + field_dict["template_vm_id"] = template_vm_id + if ip_address_id is not UNSET: + field_dict["ip_address_id"] = ip_address_id + if use_local_ip is not UNSET: + field_dict["use_local_ip"] = use_local_ip + if ssh_key_id is not UNSET: + field_dict["ssh_key_id"] = ssh_key_id + if note is not UNSET: + field_dict["note"] = note + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + cpu = d.pop("cpu") + + ram = d.pop("ram") + + disk = d.pop("disk") + + server_configuration_id = d.pop("server_configuration_id", UNSET) + + template_id = d.pop("template_id", UNSET) + + template_vm_id = d.pop("template_vm_id", UNSET) + + ip_address_id = d.pop("ip_address_id", UNSET) + + use_local_ip = d.pop("use_local_ip", UNSET) + + ssh_key_id = d.pop("ssh_key_id", UNSET) + + note = d.pop("note", UNSET) + + private_cloud_vm_create_request = cls( + cpu=cpu, + ram=ram, + disk=disk, + server_configuration_id=server_configuration_id, + template_id=template_id, + template_vm_id=template_vm_id, + ip_address_id=ip_address_id, + use_local_ip=use_local_ip, + ssh_key_id=ssh_key_id, + 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 new file mode 100644 index 0000000..bded67d --- /dev/null +++ b/src/shellrent_sdk/client/models/private_cloud_vm_update_request.py @@ -0,0 +1,80 @@ +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 + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PrivateCloudVmUpdateRequest") + + +@_attrs_define +class PrivateCloudVmUpdateRequest: + cpu: int | Unset = UNSET + ram: int | Unset = UNSET + disk: int | Unset = UNSET + note: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + cpu = self.cpu + + ram = self.ram + + disk = self.disk + + 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 + if ram is not UNSET: + field_dict["ram"] = ram + if disk is not UNSET: + field_dict["disk"] = disk + if note is not UNSET: + field_dict["note"] = note + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + cpu = d.pop("cpu", UNSET) + + ram = d.pop("ram", UNSET) + + disk = d.pop("disk", UNSET) + + note = d.pop("note", UNSET) + + private_cloud_vm_update_request = cls( + cpu=cpu, + ram=ram, + disk=disk, + 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 new file mode 100644 index 0000000..4cd8727 --- /dev/null +++ b/src/shellrent_sdk/client/models/promotion.py @@ -0,0 +1,208 @@ +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.amount import Amount + + +T = TypeVar("T", bound="Promotion") + + +@_attrs_define +class Promotion: + promocode: None | str + description: str + percentage_increase: float | None + percentage_decrease: float | None + amount_increase: Amount | None + amount_decrease: Amount | None + amount_fixed: Amount | None + applied_amount: Amount | None + date_applied: datetime.datetime + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.amount import Amount + + promocode: None | str + promocode = self.promocode + + description = self.description + + percentage_increase: float | None + percentage_increase = self.percentage_increase + + percentage_decrease: float | None + percentage_decrease = self.percentage_decrease + + amount_increase: dict[str, Any] | None + if isinstance(self.amount_increase, Amount): + amount_increase = self.amount_increase.to_dict() + else: + amount_increase = self.amount_increase + + amount_decrease: dict[str, Any] | None + if isinstance(self.amount_decrease, Amount): + amount_decrease = self.amount_decrease.to_dict() + else: + amount_decrease = self.amount_decrease + + amount_fixed: dict[str, Any] | None + if isinstance(self.amount_fixed, Amount): + amount_fixed = self.amount_fixed.to_dict() + else: + amount_fixed = self.amount_fixed + + applied_amount: dict[str, Any] | None + if isinstance(self.applied_amount, Amount): + applied_amount = self.applied_amount.to_dict() + else: + applied_amount = self.applied_amount + + date_applied = self.date_applied.isoformat() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "promocode": promocode, + "description": description, + "percentage_increase": percentage_increase, + "percentage_decrease": percentage_decrease, + "amount_increase": amount_increase, + "amount_decrease": amount_decrease, + "amount_fixed": amount_fixed, + "applied_amount": applied_amount, + "date_applied": date_applied, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.amount import Amount + + d = dict(src_dict) + + def _parse_promocode(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + promocode = _parse_promocode(d.pop("promocode")) + + description = d.pop("description") + + def _parse_percentage_increase(data: object) -> float | None: + if data is None: + return data + return cast(float | None, data) + + percentage_increase = _parse_percentage_increase(d.pop("percentage_increase")) + + def _parse_percentage_decrease(data: object) -> float | None: + if data is None: + return data + return cast(float | None, data) + + percentage_decrease = _parse_percentage_decrease(d.pop("percentage_decrease")) + + def _parse_amount_increase(data: object) -> Amount | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + amount_increase_type_0 = Amount.from_dict(data) + + return amount_increase_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(Amount | None, data) + + amount_increase = _parse_amount_increase(d.pop("amount_increase")) + + def _parse_amount_decrease(data: object) -> Amount | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + amount_decrease_type_0 = Amount.from_dict(data) + + return amount_decrease_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(Amount | None, data) + + amount_decrease = _parse_amount_decrease(d.pop("amount_decrease")) + + def _parse_amount_fixed(data: object) -> Amount | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + amount_fixed_type_0 = Amount.from_dict(data) + + return amount_fixed_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(Amount | None, data) + + amount_fixed = _parse_amount_fixed(d.pop("amount_fixed")) + + def _parse_applied_amount(data: object) -> Amount | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + applied_amount_type_0 = Amount.from_dict(data) + + return applied_amount_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(Amount | None, data) + + applied_amount = _parse_applied_amount(d.pop("applied_amount")) + + date_applied = datetime.datetime.fromisoformat(d.pop("date_applied")) + + promotion = cls( + promocode=promocode, + description=description, + percentage_increase=percentage_increase, + percentage_decrease=percentage_decrease, + amount_increase=amount_increase, + amount_decrease=amount_decrease, + amount_fixed=amount_fixed, + applied_amount=applied_amount, + date_applied=date_applied, + ) + + promotion.additional_properties = d + return promotion + + @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.py b/src/shellrent_sdk/client/models/purchase.py new file mode 100644 index 0000000..97c9936 --- /dev/null +++ b/src/shellrent_sdk/client/models/purchase.py @@ -0,0 +1,595 @@ +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.account import Account + from ..models.account_billing import AccountBilling + from ..models.amount import Amount + from ..models.billing_data import BillingData + from ..models.purchase_name import PurchaseName + from ..models.purchase_provisioning_status import PurchaseProvisioningStatus + from ..models.purchase_status import PurchaseStatus + from ..models.recurrence import Recurrence + from ..models.service import Service + from ..models.task import Task + + +T = TypeVar("T", bound="Purchase") + + +@_attrs_define +class Purchase: + 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 + billing: AccountBilling + recurrence: Recurrence + recurrence_default: Recurrence + purchase_id_primary: int | None + """ ID of primary purchase if this is an additional purchase. """ + purchase_status: PurchaseStatus + purchase_provisioning_status: PurchaseProvisioningStatus + purchase_name: PurchaseName + activation_quantity: int + """ Quantity (instances) purchased. """ + quantity: int + """ Current purchase quantity (instances). """ + activation_price: Amount + renew_price: Amount | None + """ Renew price (applied on recurring purchases only). """ + restore_price: Amount | None + """ Restore/reactivation price (applied on domains only). """ + date_activation: datetime.date | None + """ Purchase date. """ + date_activation_start: datetime.date | None + """ Date when the activation started. """ + date_expiry: datetime.date | None + """ Purchase expiration date (applied on recurring purchases only). """ + date_dismission: datetime.date | None + """ Purchase dismission date. """ + do_not_renew: bool + """ Tells if purchase has to be renewed. """ + suspended: bool + """ Tells if purchase is currently suspended. """ + comment: str + """ User comment (will be included in invoice description). """ + billing_data: BillingData + tasks: list[Task] + """ Tasks currently running on the purchase. """ + purchase_additionals: list[int] + """ Collection of IDs of active additional purchases for this purchase. """ + domain_id: int | None + """ ID of the domain associated with this purchase. """ + server_id: int | None + """ ID of the server associated with this purchase. """ + ssl_certificate_id: int | None + """ ID of the SSL certificate associated with this purchase. """ + pec_id: int | None + """ ID of the PEC associated with this purchase. """ + pec_domain_id: int | None + """ ID of the PEC domain associated with this purchase. """ + hosting_id: int | None + """ ID of the web hosting associated with this purchase. """ + monitoring_id: int | None + """ ID of the monitoring service associated with this purchase. """ + license_id: int | None + """ 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 + """ ID of the object storage associated with this purchase. """ + veeam_baas_id: int | None + """ ID of the Veeam Backup as a Service associated with this purchase. """ + date_created: datetime.datetime + """ Datetime when the purchase was first created. """ + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.account import Account + from ..models.amount import Amount + + purchase_id = self.purchase_id + + account: dict[str, Any] | None + if isinstance(self.account, Account): + account = self.account.to_dict() + else: + account = self.account + + service = self.service.to_dict() + + billing = self.billing.to_dict() + + recurrence = self.recurrence.to_dict() + + recurrence_default = self.recurrence_default.to_dict() + + purchase_id_primary: int | None + purchase_id_primary = self.purchase_id_primary + + purchase_status = self.purchase_status.to_dict() + + purchase_provisioning_status = self.purchase_provisioning_status.to_dict() + + purchase_name = self.purchase_name.to_dict() + + activation_quantity = self.activation_quantity + + quantity = self.quantity + + activation_price = self.activation_price.to_dict() + + renew_price: dict[str, Any] | None + if isinstance(self.renew_price, Amount): + renew_price = self.renew_price.to_dict() + else: + renew_price = self.renew_price + + 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 + + date_activation: None | str + if isinstance(self.date_activation, datetime.date): + date_activation = self.date_activation.isoformat() + else: + date_activation = self.date_activation + + date_activation_start: None | str + if isinstance(self.date_activation_start, datetime.date): + date_activation_start = self.date_activation_start.isoformat() + else: + date_activation_start = self.date_activation_start + + date_expiry: None | str + if isinstance(self.date_expiry, datetime.date): + date_expiry = self.date_expiry.isoformat() + else: + date_expiry = self.date_expiry + + date_dismission: None | str + if isinstance(self.date_dismission, datetime.date): + date_dismission = self.date_dismission.isoformat() + else: + date_dismission = self.date_dismission + + do_not_renew = self.do_not_renew + + suspended = self.suspended + + comment = self.comment + + billing_data = self.billing_data.to_dict() + + tasks = [] + for tasks_item_data in self.tasks: + tasks_item = tasks_item_data.to_dict() + tasks.append(tasks_item) + + purchase_additionals = self.purchase_additionals + + domain_id: int | None + domain_id = self.domain_id + + server_id: int | None + server_id = self.server_id + + ssl_certificate_id: int | None + ssl_certificate_id = self.ssl_certificate_id + + pec_id: int | None + pec_id = self.pec_id + + pec_domain_id: int | None + pec_domain_id = self.pec_domain_id + + hosting_id: int | None + hosting_id = self.hosting_id + + monitoring_id: int | None + monitoring_id = self.monitoring_id + + license_id: int | None + license_id = self.license_id + + 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 + + object_storage_id: int | None + object_storage_id = self.object_storage_id + + veeam_baas_id: int | None + veeam_baas_id = self.veeam_baas_id + + date_created = self.date_created.isoformat() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "purchase_id": purchase_id, + "account": account, + "service": service, + "billing": billing, + "recurrence": recurrence, + "recurrence_default": recurrence_default, + "purchase_id_primary": purchase_id_primary, + "purchase_status": purchase_status, + "purchase_provisioning_status": purchase_provisioning_status, + "purchase_name": purchase_name, + "activation_quantity": activation_quantity, + "quantity": quantity, + "activation_price": activation_price, + "renew_price": renew_price, + "restore_price": restore_price, + "date_activation": date_activation, + "date_activation_start": date_activation_start, + "date_expiry": date_expiry, + "date_dismission": date_dismission, + "do_not_renew": do_not_renew, + "suspended": suspended, + "comment": comment, + "billing_data": billing_data, + "tasks": tasks, + "purchase_additionals": purchase_additionals, + "domain_id": domain_id, + "server_id": server_id, + "ssl_certificate_id": ssl_certificate_id, + "pec_id": pec_id, + "pec_domain_id": pec_domain_id, + "hosting_id": hosting_id, + "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, + "date_created": date_created, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.account import Account + from ..models.account_billing import AccountBilling + from ..models.amount import Amount + from ..models.billing_data import BillingData + from ..models.purchase_name import PurchaseName + from ..models.purchase_provisioning_status import ( + PurchaseProvisioningStatus, + ) + from ..models.purchase_status import PurchaseStatus + from ..models.recurrence import Recurrence + from ..models.service import Service + from ..models.task import Task + + d = dict(src_dict) + purchase_id = d.pop("purchase_id") + + def _parse_account(data: object) -> Account | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + account_type_0 = Account.from_dict(data) + + return account_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(Account | None, data) + + account = _parse_account(d.pop("account")) + + service = Service.from_dict(d.pop("service")) + + billing = AccountBilling.from_dict(d.pop("billing")) + + recurrence = Recurrence.from_dict(d.pop("recurrence")) + + recurrence_default = Recurrence.from_dict(d.pop("recurrence_default")) + + def _parse_purchase_id_primary(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + purchase_id_primary = _parse_purchase_id_primary(d.pop("purchase_id_primary")) + + purchase_status = PurchaseStatus.from_dict(d.pop("purchase_status")) + + purchase_provisioning_status = PurchaseProvisioningStatus.from_dict( + d.pop("purchase_provisioning_status") + ) + + purchase_name = PurchaseName.from_dict(d.pop("purchase_name")) + + activation_quantity = d.pop("activation_quantity") + + quantity = d.pop("quantity") + + activation_price = Amount.from_dict(d.pop("activation_price")) + + def _parse_renew_price(data: object) -> Amount | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + renew_price_type_0 = Amount.from_dict(data) + + return renew_price_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(Amount | None, data) + + renew_price = _parse_renew_price(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_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_activation_start(data: object) -> datetime.date | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + date_activation_start_type_0 = datetime.date.fromisoformat(data) + + return date_activation_start_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.date | None, data) + + date_activation_start = _parse_date_activation_start(d.pop("date_activation_start")) + + 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")) + + def _parse_date_dismission(data: object) -> datetime.date | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + date_dismission_type_0 = datetime.date.fromisoformat(data) + + return date_dismission_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.date | None, data) + + date_dismission = _parse_date_dismission(d.pop("date_dismission")) + + do_not_renew = d.pop("do_not_renew") + + suspended = d.pop("suspended") + + comment = d.pop("comment") + + billing_data = BillingData.from_dict(d.pop("billing_data")) + + tasks = [] + _tasks = d.pop("tasks") + for tasks_item_data in _tasks: + tasks_item = Task.from_dict(tasks_item_data) + + tasks.append(tasks_item) + + purchase_additionals = cast(list[int], d.pop("purchase_additionals")) + + def _parse_domain_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + domain_id = _parse_domain_id(d.pop("domain_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_ssl_certificate_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + ssl_certificate_id = _parse_ssl_certificate_id(d.pop("ssl_certificate_id")) + + def _parse_pec_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + pec_id = _parse_pec_id(d.pop("pec_id")) + + def _parse_pec_domain_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + pec_domain_id = _parse_pec_domain_id(d.pop("pec_domain_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_monitoring_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + monitoring_id = _parse_monitoring_id(d.pop("monitoring_id")) + + def _parse_license_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + license_id = _parse_license_id(d.pop("license_id")) + + def _parse_microsoft365_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + 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 + return cast(int | None, data) + + cloud_storage_id = _parse_cloud_storage_id(d.pop("cloud_storage_id")) + + def _parse_object_storage_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + object_storage_id = _parse_object_storage_id(d.pop("object_storage_id")) + + def _parse_veeam_baas_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + veeam_baas_id = _parse_veeam_baas_id(d.pop("veeam_baas_id")) + + date_created = datetime.datetime.fromisoformat(d.pop("date_created")) + + purchase = cls( + purchase_id=purchase_id, + account=account, + service=service, + billing=billing, + recurrence=recurrence, + recurrence_default=recurrence_default, + purchase_id_primary=purchase_id_primary, + purchase_status=purchase_status, + purchase_provisioning_status=purchase_provisioning_status, + purchase_name=purchase_name, + activation_quantity=activation_quantity, + quantity=quantity, + activation_price=activation_price, + renew_price=renew_price, + restore_price=restore_price, + date_activation=date_activation, + date_activation_start=date_activation_start, + date_expiry=date_expiry, + date_dismission=date_dismission, + do_not_renew=do_not_renew, + suspended=suspended, + comment=comment, + billing_data=billing_data, + tasks=tasks, + purchase_additionals=purchase_additionals, + domain_id=domain_id, + server_id=server_id, + ssl_certificate_id=ssl_certificate_id, + pec_id=pec_id, + pec_domain_id=pec_domain_id, + hosting_id=hosting_id, + 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, + date_created=date_created, + ) + + purchase.additional_properties = d + return purchase + + @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_billing_info_change_request.py b/src/shellrent_sdk/client/models/purchase_billing_info_change_request.py new file mode 100644 index 0000000..64bbb61 --- /dev/null +++ b/src/shellrent_sdk/client/models/purchase_billing_info_change_request.py @@ -0,0 +1,72 @@ +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 + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PurchaseBillingInfoChangeRequest") + + +@_attrs_define +class PurchaseBillingInfoChangeRequest: + oda: str | Unset = UNSET + cig: str | Unset = UNSET + cup: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + oda = self.oda + + cig = self.cig + + 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 + if cig is not UNSET: + field_dict["cig"] = cig + if cup is not UNSET: + field_dict["cup"] = cup + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + oda = d.pop("oda", UNSET) + + cig = d.pop("cig", UNSET) + + cup = d.pop("cup", UNSET) + + purchase_billing_info_change_request = cls( + oda=oda, + cig=cig, + 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 new file mode 100644 index 0000000..91e1c6b --- /dev/null +++ b/src/shellrent_sdk/client/models/purchase_can_add_additional.py @@ -0,0 +1,85 @@ +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 + +if TYPE_CHECKING: + from ..models.service import Service + + +T = TypeVar("T", bound="PurchaseCanAddAdditional") + + +@_attrs_define +class PurchaseCanAddAdditional: + purchase_id: int + can_add_additional: bool + services: list[Service] + """ Collection of Services to which it is possible to make the change. """ + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + purchase_id = self.purchase_id + + can_add_additional = self.can_add_additional + + services = [] + for services_item_data in self.services: + services_item = services_item_data.to_dict() + services.append(services_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "purchase_id": purchase_id, + "can_add_additional": can_add_additional, + "services": services, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.service import Service + + d = dict(src_dict) + purchase_id = d.pop("purchase_id") + + can_add_additional = d.pop("can_add_additional") + + services = [] + _services = d.pop("services") + for services_item_data in _services: + services_item = Service.from_dict(services_item_data) + + services.append(services_item) + + purchase_can_add_additional = cls( + purchase_id=purchase_id, + can_add_additional=can_add_additional, + services=services, + ) + + purchase_can_add_additional.additional_properties = d + return purchase_can_add_additional + + @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_response.py b/src/shellrent_sdk/client/models/purchase_can_add_additional_response.py new file mode 100644 index 0000000..6538342 --- /dev/null +++ b/src/shellrent_sdk/client/models/purchase_can_add_additional_response.py @@ -0,0 +1,116 @@ +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.purchase_can_add_additional import PurchaseCanAddAdditional + from ..models.purchase_can_add_additional_response_meta_type_0 import ( + PurchaseCanAddAdditionalResponseMetaType0, + ) + + +T = TypeVar("T", bound="PurchaseCanAddAdditionalResponse") + + +@_attrs_define +class PurchaseCanAddAdditionalResponse: + error: int + message: None | str + data: PurchaseCanAddAdditional + meta: None | PurchaseCanAddAdditionalResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, PurchaseCanAddAdditionalResponseMetaType0): + 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.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") + + 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 = 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")) + + purchase_can_add_additional_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + purchase_can_add_additional_response.additional_properties = d + return purchase_can_add_additional_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/purchase_can_add_additional_response_meta_type_0.py b/src/shellrent_sdk/client/models/purchase_can_add_additional_response_meta_type_0.py new file mode 100644 index 0000000..289892e --- /dev/null +++ b/src/shellrent_sdk/client/models/purchase_can_add_additional_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..9533392 --- /dev/null +++ b/src/shellrent_sdk/client/models/purchase_can_cancel.py @@ -0,0 +1,63 @@ +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="PurchaseCanCancel") + + +@_attrs_define +class PurchaseCanCancel: + purchase_id: int + can_cancel: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + purchase_id = self.purchase_id + + can_cancel = self.can_cancel + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "purchase_id": purchase_id, + "can_cancel": can_cancel, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + purchase_id = d.pop("purchase_id") + + can_cancel = d.pop("can_cancel") + + purchase_can_cancel = cls( + purchase_id=purchase_id, + can_cancel=can_cancel, + ) + + purchase_can_cancel.additional_properties = d + return purchase_can_cancel + + @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_response.py b/src/shellrent_sdk/client/models/purchase_can_cancel_response.py new file mode 100644 index 0000000..2b07719 --- /dev/null +++ b/src/shellrent_sdk/client/models/purchase_can_cancel_response.py @@ -0,0 +1,114 @@ +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.purchase_can_cancel import PurchaseCanCancel + from ..models.purchase_can_cancel_response_meta_type_0 import PurchaseCanCancelResponseMetaType0 + + +T = TypeVar("T", bound="PurchaseCanCancelResponse") + + +@_attrs_define +class PurchaseCanCancelResponse: + error: int + message: None | str + data: PurchaseCanCancel + meta: None | PurchaseCanCancelResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, PurchaseCanCancelResponseMetaType0): + 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.purchase_can_cancel import PurchaseCanCancel + from ..models.purchase_can_cancel_response_meta_type_0 import ( + PurchaseCanCancelResponseMetaType0, + ) + + 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 = 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")) + + purchase_can_cancel_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + purchase_can_cancel_response.additional_properties = d + return purchase_can_cancel_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/purchase_can_cancel_response_meta_type_0.py b/src/shellrent_sdk/client/models/purchase_can_cancel_response_meta_type_0.py new file mode 100644 index 0000000..4fec08d --- /dev/null +++ b/src/shellrent_sdk/client/models/purchase_can_cancel_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..9f860f1 --- /dev/null +++ b/src/shellrent_sdk/client/models/purchase_can_change_recurrence.py @@ -0,0 +1,63 @@ +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="PurchaseCanChangeRecurrence") + + +@_attrs_define +class PurchaseCanChangeRecurrence: + purchase_id: int + can_change_recurrence: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + purchase_id = self.purchase_id + + can_change_recurrence = self.can_change_recurrence + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "purchase_id": purchase_id, + "can_change_recurrence": can_change_recurrence, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + purchase_id = d.pop("purchase_id") + + can_change_recurrence = d.pop("can_change_recurrence") + + purchase_can_change_recurrence = cls( + purchase_id=purchase_id, + can_change_recurrence=can_change_recurrence, + ) + + purchase_can_change_recurrence.additional_properties = d + return purchase_can_change_recurrence + + @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_response.py b/src/shellrent_sdk/client/models/purchase_can_change_recurrence_response.py new file mode 100644 index 0000000..7f1607d --- /dev/null +++ b/src/shellrent_sdk/client/models/purchase_can_change_recurrence_response.py @@ -0,0 +1,118 @@ +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.purchase_can_change_recurrence import PurchaseCanChangeRecurrence + from ..models.purchase_can_change_recurrence_response_meta_type_0 import ( + PurchaseCanChangeRecurrenceResponseMetaType0, + ) + + +T = TypeVar("T", bound="PurchaseCanChangeRecurrenceResponse") + + +@_attrs_define +class PurchaseCanChangeRecurrenceResponse: + error: int + message: None | str + data: PurchaseCanChangeRecurrence + meta: None | PurchaseCanChangeRecurrenceResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, PurchaseCanChangeRecurrenceResponseMetaType0): + 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.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") + + 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 = 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")) + + purchase_can_change_recurrence_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + purchase_can_change_recurrence_response.additional_properties = d + return purchase_can_change_recurrence_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/purchase_can_change_recurrence_response_meta_type_0.py b/src/shellrent_sdk/client/models/purchase_can_change_recurrence_response_meta_type_0.py new file mode 100644 index 0000000..e1e2f42 --- /dev/null +++ b/src/shellrent_sdk/client/models/purchase_can_change_recurrence_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..5c06d45 --- /dev/null +++ b/src/shellrent_sdk/client/models/purchase_can_change_renew_status.py @@ -0,0 +1,63 @@ +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="PurchaseCanChangeRenewStatus") + + +@_attrs_define +class PurchaseCanChangeRenewStatus: + purchase_id: int + can_change_renew_status: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + purchase_id = self.purchase_id + + can_change_renew_status = self.can_change_renew_status + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "purchase_id": purchase_id, + "can_change_renew_status": can_change_renew_status, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + purchase_id = d.pop("purchase_id") + + can_change_renew_status = d.pop("can_change_renew_status") + + purchase_can_change_renew_status = cls( + purchase_id=purchase_id, + can_change_renew_status=can_change_renew_status, + ) + + purchase_can_change_renew_status.additional_properties = d + return purchase_can_change_renew_status + + @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_response.py b/src/shellrent_sdk/client/models/purchase_can_change_renew_status_response.py new file mode 100644 index 0000000..af9c9ae --- /dev/null +++ b/src/shellrent_sdk/client/models/purchase_can_change_renew_status_response.py @@ -0,0 +1,118 @@ +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.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") + + +@_attrs_define +class PurchaseCanChangeRenewStatusResponse: + error: int + message: None | str + data: PurchaseCanChangeRenewStatus + meta: None | PurchaseCanChangeRenewStatusResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, PurchaseCanChangeRenewStatusResponseMetaType0): + 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.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") + + 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 = 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")) + + purchase_can_change_renew_status_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + purchase_can_change_renew_status_response.additional_properties = d + return purchase_can_change_renew_status_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/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 new file mode 100644 index 0000000..291b11e --- /dev/null +++ b/src/shellrent_sdk/client/models/purchase_can_change_renew_status_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..ea8aa38 --- /dev/null +++ b/src/shellrent_sdk/client/models/purchase_can_change_service.py @@ -0,0 +1,85 @@ +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 + +if TYPE_CHECKING: + from ..models.service_change import ServiceChange + + +T = TypeVar("T", bound="PurchaseCanChangeService") + + +@_attrs_define +class PurchaseCanChangeService: + purchase_id: int + can_change_service: bool + 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) + + def to_dict(self) -> dict[str, Any]: + purchase_id = self.purchase_id + + can_change_service = self.can_change_service + + services = [] + for services_item_data in self.services: + services_item = services_item_data.to_dict() + services.append(services_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "purchase_id": purchase_id, + "can_change_service": can_change_service, + "services": services, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.service_change import ServiceChange + + d = dict(src_dict) + purchase_id = d.pop("purchase_id") + + can_change_service = d.pop("can_change_service") + + services = [] + _services = d.pop("services") + for services_item_data in _services: + services_item = ServiceChange.from_dict(services_item_data) + + services.append(services_item) + + purchase_can_change_service = cls( + purchase_id=purchase_id, + can_change_service=can_change_service, + services=services, + ) + + purchase_can_change_service.additional_properties = d + return purchase_can_change_service + + @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_response.py b/src/shellrent_sdk/client/models/purchase_can_change_service_response.py new file mode 100644 index 0000000..fd6c9b6 --- /dev/null +++ b/src/shellrent_sdk/client/models/purchase_can_change_service_response.py @@ -0,0 +1,116 @@ +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.purchase_can_change_service import PurchaseCanChangeService + from ..models.purchase_can_change_service_response_meta_type_0 import ( + PurchaseCanChangeServiceResponseMetaType0, + ) + + +T = TypeVar("T", bound="PurchaseCanChangeServiceResponse") + + +@_attrs_define +class PurchaseCanChangeServiceResponse: + error: int + message: None | str + data: PurchaseCanChangeService + meta: None | PurchaseCanChangeServiceResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, PurchaseCanChangeServiceResponseMetaType0): + 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.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") + + 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 = 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")) + + purchase_can_change_service_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + purchase_can_change_service_response.additional_properties = d + return purchase_can_change_service_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/purchase_can_change_service_response_meta_type_0.py b/src/shellrent_sdk/client/models/purchase_can_change_service_response_meta_type_0.py new file mode 100644 index 0000000..7f5e42e --- /dev/null +++ b/src/shellrent_sdk/client/models/purchase_can_change_service_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..9ad16ca --- /dev/null +++ b/src/shellrent_sdk/client/models/purchase_can_renew.py @@ -0,0 +1,63 @@ +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="PurchaseCanRenew") + + +@_attrs_define +class PurchaseCanRenew: + purchase_id: int + can_renew: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + purchase_id = self.purchase_id + + can_renew = self.can_renew + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "purchase_id": purchase_id, + "can_renew": can_renew, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + purchase_id = d.pop("purchase_id") + + can_renew = d.pop("can_renew") + + purchase_can_renew = cls( + purchase_id=purchase_id, + can_renew=can_renew, + ) + + purchase_can_renew.additional_properties = d + return purchase_can_renew + + @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_response.py b/src/shellrent_sdk/client/models/purchase_can_renew_response.py new file mode 100644 index 0000000..93337d6 --- /dev/null +++ b/src/shellrent_sdk/client/models/purchase_can_renew_response.py @@ -0,0 +1,114 @@ +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.purchase_can_renew import PurchaseCanRenew + from ..models.purchase_can_renew_response_meta_type_0 import PurchaseCanRenewResponseMetaType0 + + +T = TypeVar("T", bound="PurchaseCanRenewResponse") + + +@_attrs_define +class PurchaseCanRenewResponse: + error: int + message: None | str + data: PurchaseCanRenew + meta: None | PurchaseCanRenewResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, PurchaseCanRenewResponseMetaType0): + 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.purchase_can_renew import PurchaseCanRenew + from ..models.purchase_can_renew_response_meta_type_0 import ( + PurchaseCanRenewResponseMetaType0, + ) + + 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 = 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")) + + purchase_can_renew_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + purchase_can_renew_response.additional_properties = d + return purchase_can_renew_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/purchase_can_renew_response_meta_type_0.py b/src/shellrent_sdk/client/models/purchase_can_renew_response_meta_type_0.py new file mode 100644 index 0000000..c985e80 --- /dev/null +++ b/src/shellrent_sdk/client/models/purchase_can_renew_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..11ba227 --- /dev/null +++ b/src/shellrent_sdk/client/models/purchase_comment_change_request.py @@ -0,0 +1,56 @@ +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="PurchaseCommentChangeRequest") + + +@_attrs_define +class PurchaseCommentChangeRequest: + comment: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + 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, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + comment = d.pop("comment") + + purchase_comment_change_request = cls( + 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 new file mode 100644 index 0000000..76eecaa --- /dev/null +++ b/src/shellrent_sdk/client/models/purchase_name.py @@ -0,0 +1,73 @@ +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="PurchaseName") + + +@_attrs_define +class PurchaseName: + name: str + """ Service name """ + full_name: str + """ Complete name (Service and object name) """ + object_name: str + """ Name of the purchase object (ie. domain name, server hostname, etc.) """ + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + name = self.name + + full_name = self.full_name + + object_name = self.object_name + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "name": name, + "full_name": full_name, + "object_name": object_name, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + name = d.pop("name") + + full_name = d.pop("full_name") + + object_name = d.pop("object_name") + + purchase_name = cls( + name=name, + full_name=full_name, + object_name=object_name, + ) + + purchase_name.additional_properties = d + return purchase_name + + @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_paginated_list_response.py b/src/shellrent_sdk/client/models/purchase_paginated_list_response.py new file mode 100644 index 0000000..907ab38 --- /dev/null +++ b/src/shellrent_sdk/client/models/purchase_paginated_list_response.py @@ -0,0 +1,99 @@ +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.pagination_meta import PaginationMeta + from ..models.purchase import Purchase + + +T = TypeVar("T", bound="PurchasePaginatedListResponse") + + +@_attrs_define +class PurchasePaginatedListResponse: + error: int + message: None | str + data: list[Purchase] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.pagination_meta import PaginationMeta + from ..models.purchase import Purchase + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = Purchase.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + purchase_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + purchase_paginated_list_response.additional_properties = d + return purchase_paginated_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/purchase_provisioning_status.py b/src/shellrent_sdk/client/models/purchase_provisioning_status.py new file mode 100644 index 0000000..8e14ea5 --- /dev/null +++ b/src/shellrent_sdk/client/models/purchase_provisioning_status.py @@ -0,0 +1,63 @@ +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="PurchaseProvisioningStatus") + + +@_attrs_define +class PurchaseProvisioningStatus: + status_code: str + status_name: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + status_code = self.status_code + + status_name = self.status_name + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "status_code": status_code, + "status_name": status_name, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + status_code = d.pop("status_code") + + status_name = d.pop("status_name") + + purchase_provisioning_status = cls( + status_code=status_code, + status_name=status_name, + ) + + purchase_provisioning_status.additional_properties = d + return purchase_provisioning_status + + @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_recurrence_change_request.py b/src/shellrent_sdk/client/models/purchase_recurrence_change_request.py new file mode 100644 index 0000000..72db7d7 --- /dev/null +++ b/src/shellrent_sdk/client/models/purchase_recurrence_change_request.py @@ -0,0 +1,57 @@ +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="PurchaseRecurrenceChangeRequest") + + +@_attrs_define +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, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + recurrence_id = d.pop("recurrence_id") + + purchase_recurrence_change_request = cls( + 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 new file mode 100644 index 0000000..3a8b0a4 --- /dev/null +++ b/src/shellrent_sdk/client/models/purchase_renew_status_change_request.py @@ -0,0 +1,57 @@ +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="PurchaseRenewStatusChangeRequest") + + +@_attrs_define +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, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + do_not_renew = d.pop("do_not_renew") + + purchase_renew_status_change_request = cls( + 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 new file mode 100644 index 0000000..5af4349 --- /dev/null +++ b/src/shellrent_sdk/client/models/purchase_response.py @@ -0,0 +1,112 @@ +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.purchase import Purchase + from ..models.purchase_response_meta_type_0 import PurchaseResponseMetaType0 + + +T = TypeVar("T", bound="PurchaseResponse") + + +@_attrs_define +class PurchaseResponse: + error: int + message: None | str + data: Purchase + meta: None | PurchaseResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, PurchaseResponseMetaType0): + 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.purchase import Purchase + from ..models.purchase_response_meta_type_0 import ( + PurchaseResponseMetaType0, + ) + + 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 = 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")) + + purchase_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + purchase_response.additional_properties = d + return purchase_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/purchase_response_meta_type_0.py b/src/shellrent_sdk/client/models/purchase_response_meta_type_0.py new file mode 100644 index 0000000..a95bb03 --- /dev/null +++ b/src/shellrent_sdk/client/models/purchase_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..92ee388 --- /dev/null +++ b/src/shellrent_sdk/client/models/purchase_status.py @@ -0,0 +1,63 @@ +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="PurchaseStatus") + + +@_attrs_define +class PurchaseStatus: + status_code: str + status_name: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + status_code = self.status_code + + status_name = self.status_name + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "status_code": status_code, + "status_name": status_name, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + status_code = d.pop("status_code") + + status_name = d.pop("status_name") + + purchase_status = cls( + status_code=status_code, + status_name=status_name, + ) + + purchase_status.additional_properties = d + return purchase_status + + @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/recurrence.py b/src/shellrent_sdk/client/models/recurrence.py new file mode 100644 index 0000000..0122190 --- /dev/null +++ b/src/shellrent_sdk/client/models/recurrence.py @@ -0,0 +1,180 @@ +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.recurrence_frequency import RecurrenceFrequency + + +T = TypeVar("T", bound="Recurrence") + + +@_attrs_define +class Recurrence: + recurrence_id: int + frequency: RecurrenceFrequency + days_renew: int | None + days_autorenew: int | None + days_suspension: int | None + days_restore: int | None + days_dismission: int | None + days_cancel: int + days_renew_dismission: int | None + days_no_secondary: int | None + days_no_service_change: int | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + recurrence_id = self.recurrence_id + + frequency = self.frequency.to_dict() + + days_renew: int | None + days_renew = self.days_renew + + days_autorenew: int | None + days_autorenew = self.days_autorenew + + days_suspension: int | None + days_suspension = self.days_suspension + + days_restore: int | None + days_restore = self.days_restore + + days_dismission: int | None + days_dismission = self.days_dismission + + days_cancel = self.days_cancel + + days_renew_dismission: int | None + days_renew_dismission = self.days_renew_dismission + + days_no_secondary: int | None + days_no_secondary = self.days_no_secondary + + days_no_service_change: int | None + days_no_service_change = self.days_no_service_change + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "recurrence_id": recurrence_id, + "frequency": frequency, + "days_renew": days_renew, + "days_autorenew": days_autorenew, + "days_suspension": days_suspension, + "days_restore": days_restore, + "days_dismission": days_dismission, + "days_cancel": days_cancel, + "days_renew_dismission": days_renew_dismission, + "days_no_secondary": days_no_secondary, + "days_no_service_change": days_no_service_change, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.recurrence_frequency import RecurrenceFrequency + + d = dict(src_dict) + recurrence_id = d.pop("recurrence_id") + + frequency = RecurrenceFrequency.from_dict(d.pop("frequency")) + + def _parse_days_renew(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + days_renew = _parse_days_renew(d.pop("days_renew")) + + def _parse_days_autorenew(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + days_autorenew = _parse_days_autorenew(d.pop("days_autorenew")) + + def _parse_days_suspension(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + days_suspension = _parse_days_suspension(d.pop("days_suspension")) + + def _parse_days_restore(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + days_restore = _parse_days_restore(d.pop("days_restore")) + + def _parse_days_dismission(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + days_dismission = _parse_days_dismission(d.pop("days_dismission")) + + days_cancel = d.pop("days_cancel") + + def _parse_days_renew_dismission(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + days_renew_dismission = _parse_days_renew_dismission(d.pop("days_renew_dismission")) + + def _parse_days_no_secondary(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + days_no_secondary = _parse_days_no_secondary(d.pop("days_no_secondary")) + + def _parse_days_no_service_change(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + days_no_service_change = _parse_days_no_service_change(d.pop("days_no_service_change")) + + recurrence = cls( + recurrence_id=recurrence_id, + frequency=frequency, + days_renew=days_renew, + days_autorenew=days_autorenew, + days_suspension=days_suspension, + days_restore=days_restore, + days_dismission=days_dismission, + days_cancel=days_cancel, + days_renew_dismission=days_renew_dismission, + days_no_secondary=days_no_secondary, + days_no_service_change=days_no_service_change, + ) + + recurrence.additional_properties = d + return recurrence + + @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/recurrence_frequency.py b/src/shellrent_sdk/client/models/recurrence_frequency.py new file mode 100644 index 0000000..c337132 --- /dev/null +++ b/src/shellrent_sdk/client/models/recurrence_frequency.py @@ -0,0 +1,63 @@ +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="RecurrenceFrequency") + + +@_attrs_define +class RecurrenceFrequency: + family: str + value: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + family = self.family + + value = self.value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "family": family, + "value": value, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + family = d.pop("family") + + value = d.pop("value") + + recurrence_frequency = cls( + family=family, + value=value, + ) + + recurrence_frequency.additional_properties = d + return recurrence_frequency + + @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/request_access_token_body.py b/src/shellrent_sdk/client/models/request_access_token_body.py new file mode 100644 index 0000000..60b6af1 --- /dev/null +++ b/src/shellrent_sdk/client/models/request_access_token_body.py @@ -0,0 +1,150 @@ +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 ..models.o_auth_audience import OAuthAudience +from ..models.request_access_token_body_grant_type import RequestAccessTokenBodyGrantType +from ..types import UNSET, Unset + +T = TypeVar("T", bound="RequestAccessTokenBody") + + +@_attrs_define +class RequestAccessTokenBody: + grant_type: RequestAccessTokenBodyGrantType + client_id: None | str | Unset = UNSET + """ Client ID se non fornito tramite Authorization header Basic. """ + client_secret: None | str | Unset = UNSET + """ Client secret se non fornito tramite Authorization header Basic. """ + scope: None | str | Unset = UNSET + """ Scope separati da spazio. Se omesso: tutti gli scope assegnati al client. """ + audience: None | OAuthAudience | Unset = UNSET + """ Se omessa: l'unica audience del client. """ + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + grant_type = self.grant_type.value + + client_id: None | str | Unset + if isinstance(self.client_id, Unset): + client_id = UNSET + else: + client_id = self.client_id + + client_secret: None | str | Unset + if isinstance(self.client_secret, Unset): + client_secret = UNSET + else: + client_secret = self.client_secret + + scope: None | str | Unset + if isinstance(self.scope, Unset): + scope = UNSET + else: + scope = self.scope + + audience: None | str | Unset + if isinstance(self.audience, Unset): + audience = UNSET + elif isinstance(self.audience, OAuthAudience): + audience = self.audience.value + else: + audience = self.audience + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "grant_type": grant_type, + } + ) + if client_id is not UNSET: + field_dict["client_id"] = client_id + if client_secret is not UNSET: + field_dict["client_secret"] = client_secret + if scope is not UNSET: + field_dict["scope"] = scope + if audience is not UNSET: + field_dict["audience"] = audience + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + grant_type = RequestAccessTokenBodyGrantType(d.pop("grant_type")) + + def _parse_client_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + client_id = _parse_client_id(d.pop("client_id", UNSET)) + + def _parse_client_secret(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + client_secret = _parse_client_secret(d.pop("client_secret", UNSET)) + + def _parse_scope(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + scope = _parse_scope(d.pop("scope", UNSET)) + + def _parse_audience(data: object) -> None | OAuthAudience | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + audience_type_0 = OAuthAudience(data) + + return audience_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | OAuthAudience | Unset, data) + + audience = _parse_audience(d.pop("audience", UNSET)) + + request_access_token_body = cls( + grant_type=grant_type, + client_id=client_id, + client_secret=client_secret, + scope=scope, + audience=audience, + ) + + request_access_token_body.additional_properties = d + return request_access_token_body + + @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/request_access_token_body_grant_type.py b/src/shellrent_sdk/client/models/request_access_token_body_grant_type.py new file mode 100644 index 0000000..6303930 --- /dev/null +++ b/src/shellrent_sdk/client/models/request_access_token_body_grant_type.py @@ -0,0 +1,8 @@ +from enum import StrEnum + + +class RequestAccessTokenBodyGrantType(StrEnum): + CLIENT_CREDENTIALS = "client_credentials" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/shellrent_sdk/client/models/sdi_document_status.py b/src/shellrent_sdk/client/models/sdi_document_status.py new file mode 100644 index 0000000..fb50a49 --- /dev/null +++ b/src/shellrent_sdk/client/models/sdi_document_status.py @@ -0,0 +1,63 @@ +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="SdiDocumentStatus") + + +@_attrs_define +class SdiDocumentStatus: + status_code: str + status_name: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + status_code = self.status_code + + status_name = self.status_name + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "status_code": status_code, + "status_name": status_name, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + status_code = d.pop("status_code") + + status_name = d.pop("status_name") + + sdi_document_status = cls( + status_code=status_code, + status_name=status_name, + ) + + sdi_document_status.additional_properties = d + return sdi_document_status + + @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/sdi_document_type.py b/src/shellrent_sdk/client/models/sdi_document_type.py new file mode 100644 index 0000000..20c9caa --- /dev/null +++ b/src/shellrent_sdk/client/models/sdi_document_type.py @@ -0,0 +1,63 @@ +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="SdiDocumentType") + + +@_attrs_define +class SdiDocumentType: + type_code: str + type_description: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + type_code = self.type_code + + type_description = self.type_description + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "type_code": type_code, + "type_description": type_description, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + type_code = d.pop("type_code") + + type_description = d.pop("type_description") + + sdi_document_type = cls( + type_code=type_code, + type_description=type_description, + ) + + sdi_document_type.additional_properties = d + return sdi_document_type + + @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.py b/src/shellrent_sdk/client/models/securemail.py new file mode 100644 index 0000000..d94f267 --- /dev/null +++ b/src/shellrent_sdk/client/models/securemail.py @@ -0,0 +1,168 @@ +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 new file mode 100644 index 0000000..46edf94 --- /dev/null +++ b/src/shellrent_sdk/client/models/securemail_mailbox.py @@ -0,0 +1,109 @@ +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_mailbox_paginated_list_response.py b/src/shellrent_sdk/client/models/securemail_mailbox_paginated_list_response.py new file mode 100644 index 0000000..8864a04 --- /dev/null +++ b/src/shellrent_sdk/client/models/securemail_mailbox_paginated_list_response.py @@ -0,0 +1,99 @@ +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.pagination_meta import PaginationMeta + from ..models.securemail_mailbox import SecuremailMailbox + + +T = TypeVar("T", bound="SecuremailMailboxPaginatedListResponse") + + +@_attrs_define +class SecuremailMailboxPaginatedListResponse: + error: int + message: None | str + data: list[SecuremailMailbox] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.pagination_meta import PaginationMeta + from ..models.securemail_mailbox import SecuremailMailbox + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = SecuremailMailbox.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + securemail_mailbox_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 + + @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/securemail_paginated_list_response.py new file mode 100644 index 0000000..b0f7a8e --- /dev/null +++ b/src/shellrent_sdk/client/models/securemail_paginated_list_response.py @@ -0,0 +1,99 @@ +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.pagination_meta import PaginationMeta + from ..models.securemail import Securemail + + +T = TypeVar("T", bound="SecuremailPaginatedListResponse") + + +@_attrs_define +class SecuremailPaginatedListResponse: + error: int + message: None | str + data: list[Securemail] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.pagination_meta import PaginationMeta + from ..models.securemail import Securemail + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = Securemail.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + securemail_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + securemail_paginated_list_response.additional_properties = d + return securemail_paginated_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/securemail_quantity_request.py b/src/shellrent_sdk/client/models/securemail_quantity_request.py new file mode 100644 index 0000000..bd01023 --- /dev/null +++ b/src/shellrent_sdk/client/models/securemail_quantity_request.py @@ -0,0 +1,57 @@ +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="SecuremailQuantityRequest") + + +@_attrs_define +class SecuremailQuantityRequest: + quantity: int + """ Final number of protected mailboxes for the SecureMail 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, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + quantity = d.pop("quantity") + + securemail_quantity_request = cls( + quantity=quantity, + ) + + securemail_quantity_request.additional_properties = d + return securemail_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/securemail_response.py b/src/shellrent_sdk/client/models/securemail_response.py new file mode 100644 index 0000000..bcc3eb0 --- /dev/null +++ b/src/shellrent_sdk/client/models/securemail_response.py @@ -0,0 +1,112 @@ +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 new file mode 100644 index 0000000..57ca6c3 --- /dev/null +++ b/src/shellrent_sdk/client/models/securemail_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..ffc813d --- /dev/null +++ b/src/shellrent_sdk/client/models/securemail_statistics.py @@ -0,0 +1,91 @@ +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 new file mode 100644 index 0000000..ab9e756 --- /dev/null +++ b/src/shellrent_sdk/client/models/securemail_statistics_response.py @@ -0,0 +1,116 @@ +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 new file mode 100644 index 0000000..9d38e06 --- /dev/null +++ b/src/shellrent_sdk/client/models/securemail_statistics_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..aa414bc --- /dev/null +++ b/src/shellrent_sdk/client/models/server.py @@ -0,0 +1,173 @@ +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="Server") + + +@_attrs_define +class Server: + server_id: int + purchase_id: int | None + hostname: None | str + server_type: None | str + active: bool + consolidated: bool + ip_address_id: int | None + ip_address: None | str + service_category_code: None | str + date_created: datetime.datetime | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + server_id = self.server_id + + purchase_id: int | None + purchase_id = self.purchase_id + + hostname: None | str + hostname = self.hostname + + server_type: None | str + server_type = self.server_type + + active = self.active + + consolidated = self.consolidated + + ip_address_id: int | None + ip_address_id = self.ip_address_id + + ip_address: None | str + ip_address = self.ip_address + + service_category_code: None | str + service_category_code = self.service_category_code + + date_created: None | str + if isinstance(self.date_created, datetime.datetime): + date_created = self.date_created.isoformat() + else: + date_created = self.date_created + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "server_id": server_id, + "purchase_id": purchase_id, + "hostname": hostname, + "server_type": server_type, + "active": active, + "consolidated": consolidated, + "ip_address_id": ip_address_id, + "ip_address": ip_address, + "service_category_code": service_category_code, + "date_created": date_created, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + server_id = d.pop("server_id") + + def _parse_purchase_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + purchase_id = _parse_purchase_id(d.pop("purchase_id")) + + def _parse_hostname(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + hostname = _parse_hostname(d.pop("hostname")) + + def _parse_server_type(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + server_type = _parse_server_type(d.pop("server_type")) + + active = d.pop("active") + + consolidated = d.pop("consolidated") + + def _parse_ip_address_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + ip_address_id = _parse_ip_address_id(d.pop("ip_address_id")) + + 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")) + + def _parse_service_category_code(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + service_category_code = _parse_service_category_code(d.pop("service_category_code")) + + def _parse_date_created(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + date_created_type_0 = datetime.datetime.fromisoformat(data) + + return date_created_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + date_created = _parse_date_created(d.pop("date_created")) + + server = cls( + server_id=server_id, + purchase_id=purchase_id, + hostname=hostname, + server_type=server_type, + active=active, + consolidated=consolidated, + ip_address_id=ip_address_id, + ip_address=ip_address, + service_category_code=service_category_code, + date_created=date_created, + ) + + server.additional_properties = d + return server + + @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.py b/src/shellrent_sdk/client/models/server_automatic_snapshot.py new file mode 100644 index 0000000..ad587fc --- /dev/null +++ b/src/shellrent_sdk/client/models/server_automatic_snapshot.py @@ -0,0 +1,91 @@ +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="ServerAutomaticSnapshot") + + +@_attrs_define +class ServerAutomaticSnapshot: + snapshot_id: int + server_id: int + name: str + days_of_week: list[int] + hour_of_day: str + is_active: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + snapshot_id = self.snapshot_id + + server_id = self.server_id + + name = self.name + + days_of_week = self.days_of_week + + hour_of_day = self.hour_of_day + + is_active = self.is_active + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "snapshot_id": snapshot_id, + "server_id": server_id, + "name": name, + "days_of_week": days_of_week, + "hour_of_day": hour_of_day, + "is_active": is_active, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + snapshot_id = d.pop("snapshot_id") + + server_id = d.pop("server_id") + + name = d.pop("name") + + days_of_week = cast(list[int], d.pop("days_of_week")) + + hour_of_day = d.pop("hour_of_day") + + is_active = d.pop("is_active") + + server_automatic_snapshot = cls( + snapshot_id=snapshot_id, + server_id=server_id, + name=name, + days_of_week=days_of_week, + hour_of_day=hour_of_day, + is_active=is_active, + ) + + server_automatic_snapshot.additional_properties = d + return server_automatic_snapshot + + @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_request.py b/src/shellrent_sdk/client/models/server_automatic_snapshot_request.py new file mode 100644 index 0000000..f53f160 --- /dev/null +++ b/src/shellrent_sdk/client/models/server_automatic_snapshot_request.py @@ -0,0 +1,72 @@ +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="ServerAutomaticSnapshotRequest") + + +@_attrs_define +class ServerAutomaticSnapshotRequest: + name: str + 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) + + def to_dict(self) -> dict[str, Any]: + name = self.name + + day_of_week = self.day_of_week + + hour_of_day = self.hour_of_day + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "name": name, + "day_of_week": day_of_week, + "hour_of_day": hour_of_day, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + name = d.pop("name") + + day_of_week = cast(list[int], d.pop("day_of_week")) + + hour_of_day = d.pop("hour_of_day") + + server_automatic_snapshot_request = cls( + name=name, + day_of_week=day_of_week, + 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 new file mode 100644 index 0000000..d5be5f8 --- /dev/null +++ b/src/shellrent_sdk/client/models/server_automatic_snapshot_response.py @@ -0,0 +1,116 @@ +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.server_automatic_snapshot import ServerAutomaticSnapshot + from ..models.server_automatic_snapshot_response_meta_type_0 import ( + ServerAutomaticSnapshotResponseMetaType0, + ) + + +T = TypeVar("T", bound="ServerAutomaticSnapshotResponse") + + +@_attrs_define +class ServerAutomaticSnapshotResponse: + error: int + message: None | str + data: ServerAutomaticSnapshot + meta: None | ServerAutomaticSnapshotResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, ServerAutomaticSnapshotResponseMetaType0): + 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.server_automatic_snapshot import ServerAutomaticSnapshot + from ..models.server_automatic_snapshot_response_meta_type_0 import ( + ServerAutomaticSnapshotResponseMetaType0, + ) + + 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 = 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")) + + server_automatic_snapshot_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + server_automatic_snapshot_response.additional_properties = d + return server_automatic_snapshot_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/server_automatic_snapshot_response_meta_type_0.py b/src/shellrent_sdk/client/models/server_automatic_snapshot_response_meta_type_0.py new file mode 100644 index 0000000..d86c9c3 --- /dev/null +++ b/src/shellrent_sdk/client/models/server_automatic_snapshot_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..e648073 --- /dev/null +++ b/src/shellrent_sdk/client/models/server_backup.py @@ -0,0 +1,337 @@ +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="ServerBackup") + + +@_attrs_define +class ServerBackup: + server_backup_id: int + backup_recurrent_id: int | None + backup_server_id_parent: int | None + server_id: int + cluster_id_server_residence: int | None + cluster_id_backup_residence: int | None + backup_type_id: int | None + backup_mode: None | str + backup_frequency_id: int | None + backup_type_code: None | str + backup_frequency_code: None | str + backup_date: datetime.datetime | None + backup_size: int | None + backup_duration: None | str + exit_status: int | None + error_type: None | str + date_created: datetime.datetime | None + backup_path: None | str + checksum: None | str + backup_path_parent: None | str + backup_user_visibility: bool | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + server_backup_id = self.server_backup_id + + backup_recurrent_id: int | None + backup_recurrent_id = self.backup_recurrent_id + + backup_server_id_parent: int | None + backup_server_id_parent = self.backup_server_id_parent + + server_id = self.server_id + + cluster_id_server_residence: int | None + cluster_id_server_residence = self.cluster_id_server_residence + + cluster_id_backup_residence: int | None + cluster_id_backup_residence = self.cluster_id_backup_residence + + backup_type_id: int | None + backup_type_id = self.backup_type_id + + backup_mode: None | str + backup_mode = self.backup_mode + + backup_frequency_id: int | None + backup_frequency_id = self.backup_frequency_id + + backup_type_code: None | str + backup_type_code = self.backup_type_code + + backup_frequency_code: None | str + backup_frequency_code = self.backup_frequency_code + + backup_date: None | str + if isinstance(self.backup_date, datetime.datetime): + backup_date = self.backup_date.isoformat() + else: + backup_date = self.backup_date + + backup_size: int | None + backup_size = self.backup_size + + backup_duration: None | str + backup_duration = self.backup_duration + + exit_status: int | None + exit_status = self.exit_status + + error_type: None | str + error_type = self.error_type + + date_created: None | str + if isinstance(self.date_created, datetime.datetime): + date_created = self.date_created.isoformat() + 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 + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "server_backup_id": server_backup_id, + "backup_recurrent_id": backup_recurrent_id, + "backup_server_id_parent": backup_server_id_parent, + "server_id": server_id, + "cluster_id_server_residence": cluster_id_server_residence, + "cluster_id_backup_residence": cluster_id_backup_residence, + "backup_type_id": backup_type_id, + "backup_mode": backup_mode, + "backup_frequency_id": backup_frequency_id, + "backup_type_code": backup_type_code, + "backup_frequency_code": backup_frequency_code, + "backup_date": backup_date, + "backup_size": backup_size, + "backup_duration": backup_duration, + "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, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + server_backup_id = d.pop("server_backup_id") + + def _parse_backup_recurrent_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + backup_recurrent_id = _parse_backup_recurrent_id(d.pop("backup_recurrent_id")) + + def _parse_backup_server_id_parent(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + backup_server_id_parent = _parse_backup_server_id_parent(d.pop("backup_server_id_parent")) + + server_id = d.pop("server_id") + + def _parse_cluster_id_server_residence(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + cluster_id_server_residence = _parse_cluster_id_server_residence( + d.pop("cluster_id_server_residence") + ) + + def _parse_cluster_id_backup_residence(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + cluster_id_backup_residence = _parse_cluster_id_backup_residence( + d.pop("cluster_id_backup_residence") + ) + + def _parse_backup_type_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + backup_type_id = _parse_backup_type_id(d.pop("backup_type_id")) + + def _parse_backup_mode(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + backup_mode = _parse_backup_mode(d.pop("backup_mode")) + + def _parse_backup_frequency_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + backup_frequency_id = _parse_backup_frequency_id(d.pop("backup_frequency_id")) + + def _parse_backup_type_code(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + backup_type_code = _parse_backup_type_code(d.pop("backup_type_code")) + + def _parse_backup_frequency_code(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + backup_frequency_code = _parse_backup_frequency_code(d.pop("backup_frequency_code")) + + def _parse_backup_date(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + backup_date_type_0 = datetime.datetime.fromisoformat(data) + + return backup_date_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + backup_date = _parse_backup_date(d.pop("backup_date")) + + def _parse_backup_size(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + backup_size = _parse_backup_size(d.pop("backup_size")) + + def _parse_backup_duration(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + backup_duration = _parse_backup_duration(d.pop("backup_duration")) + + def _parse_exit_status(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + exit_status = _parse_exit_status(d.pop("exit_status")) + + def _parse_error_type(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + error_type = _parse_error_type(d.pop("error_type")) + + def _parse_date_created(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + date_created_type_0 = datetime.datetime.fromisoformat(data) + + return date_created_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + 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 + return cast(None | str, data) + + 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 + return cast(bool | None, data) + + backup_user_visibility = _parse_backup_user_visibility(d.pop("backup_user_visibility")) + + server_backup = cls( + server_backup_id=server_backup_id, + backup_recurrent_id=backup_recurrent_id, + backup_server_id_parent=backup_server_id_parent, + server_id=server_id, + cluster_id_server_residence=cluster_id_server_residence, + cluster_id_backup_residence=cluster_id_backup_residence, + backup_type_id=backup_type_id, + backup_mode=backup_mode, + backup_frequency_id=backup_frequency_id, + backup_type_code=backup_type_code, + backup_frequency_code=backup_frequency_code, + backup_date=backup_date, + backup_size=backup_size, + backup_duration=backup_duration, + 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, + ) + + server_backup.additional_properties = d + return server_backup + + @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_exhibit_request.py b/src/shellrent_sdk/client/models/server_backup_exhibit_request.py new file mode 100644 index 0000000..5eaf646 --- /dev/null +++ b/src/shellrent_sdk/client/models/server_backup_exhibit_request.py @@ -0,0 +1,57 @@ +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="ServerBackupExhibitRequest") + + +@_attrs_define +class ServerBackupExhibitRequest: + 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, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + backup_id = d.pop("backup_id") + + server_backup_exhibit_request = cls( + 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 new file mode 100644 index 0000000..96b006a --- /dev/null +++ b/src/shellrent_sdk/client/models/server_backup_list_response.py @@ -0,0 +1,122 @@ +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.server_backup import ServerBackup + from ..models.server_backup_list_response_meta_type_0 import ServerBackupListResponseMetaType0 + + +T = TypeVar("T", bound="ServerBackupListResponse") + + +@_attrs_define +class ServerBackupListResponse: + error: int + message: None | str + data: list[ServerBackup] + meta: None | ServerBackupListResponseMetaType0 + 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 + message = self.message + + data = [] + for data_item_data in self.data: + 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 + + 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.server_backup import ServerBackup + from ..models.server_backup_list_response_meta_type_0 import ( + ServerBackupListResponseMetaType0, + ) + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = ServerBackup.from_dict(data_item_data) + + 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")) + + server_backup_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + server_backup_list_response.additional_properties = d + return server_backup_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/server_backup_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/server_backup_list_response_meta_type_0.py new file mode 100644 index 0000000..90eb418 --- /dev/null +++ b/src/shellrent_sdk/client/models/server_backup_list_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..5bbe2de --- /dev/null +++ b/src/shellrent_sdk/client/models/server_backup_response.py @@ -0,0 +1,112 @@ +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.server_backup import ServerBackup + from ..models.server_backup_response_meta_type_0 import ServerBackupResponseMetaType0 + + +T = TypeVar("T", bound="ServerBackupResponse") + + +@_attrs_define +class ServerBackupResponse: + error: int + message: None | str + data: ServerBackup + meta: None | ServerBackupResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, ServerBackupResponseMetaType0): + 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.server_backup import ServerBackup + from ..models.server_backup_response_meta_type_0 import ( + ServerBackupResponseMetaType0, + ) + + 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 = 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")) + + server_backup_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + server_backup_response.additional_properties = d + return server_backup_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/server_backup_response_meta_type_0.py b/src/shellrent_sdk/client/models/server_backup_response_meta_type_0.py new file mode 100644 index 0000000..2bcbf63 --- /dev/null +++ b/src/shellrent_sdk/client/models/server_backup_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..20dd4d9 --- /dev/null +++ b/src/shellrent_sdk/client/models/server_can_action.py @@ -0,0 +1,63 @@ +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="ServerCanAction") + + +@_attrs_define +class ServerCanAction: + server_id: int + can_action: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + server_id = self.server_id + + can_action = self.can_action + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "server_id": server_id, + "can_action": can_action, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + server_id = d.pop("server_id") + + can_action = d.pop("can_action") + + server_can_action = cls( + server_id=server_id, + can_action=can_action, + ) + + server_can_action.additional_properties = d + return server_can_action + + @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_response.py b/src/shellrent_sdk/client/models/server_can_action_response.py new file mode 100644 index 0000000..431ba02 --- /dev/null +++ b/src/shellrent_sdk/client/models/server_can_action_response.py @@ -0,0 +1,112 @@ +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.server_can_action import ServerCanAction + from ..models.server_can_action_response_meta_type_0 import ServerCanActionResponseMetaType0 + + +T = TypeVar("T", bound="ServerCanActionResponse") + + +@_attrs_define +class ServerCanActionResponse: + error: int + message: None | str + data: ServerCanAction + meta: None | ServerCanActionResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, ServerCanActionResponseMetaType0): + 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.server_can_action import ServerCanAction + from ..models.server_can_action_response_meta_type_0 import ( + ServerCanActionResponseMetaType0, + ) + + 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 = 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")) + + server_can_action_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + server_can_action_response.additional_properties = d + return server_can_action_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/server_can_action_response_meta_type_0.py b/src/shellrent_sdk/client/models/server_can_action_response_meta_type_0.py new file mode 100644 index 0000000..27ebcba --- /dev/null +++ b/src/shellrent_sdk/client/models/server_can_action_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..94b82bf --- /dev/null +++ b/src/shellrent_sdk/client/models/server_credential.py @@ -0,0 +1,89 @@ +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="ServerCredential") + + +@_attrs_define +class ServerCredential: + type_: str + username: None | str + password: None | str + visible: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + type_ = self.type_ + + username: None | str + username = self.username + + password: None | str + password = self.password + + visible = self.visible + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "type": type_, + "username": username, + "password": password, + "visible": visible, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + type_ = d.pop("type") + + 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_password(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + password = _parse_password(d.pop("password")) + + visible = d.pop("visible") + + server_credential = cls( + type_=type_, + username=username, + password=password, + visible=visible, + ) + + server_credential.additional_properties = d + return server_credential + + @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_response.py b/src/shellrent_sdk/client/models/server_credential_response.py new file mode 100644 index 0000000..86a395c --- /dev/null +++ b/src/shellrent_sdk/client/models/server_credential_response.py @@ -0,0 +1,114 @@ +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.server_credential import ServerCredential + from ..models.server_credential_response_meta_type_0 import ServerCredentialResponseMetaType0 + + +T = TypeVar("T", bound="ServerCredentialResponse") + + +@_attrs_define +class ServerCredentialResponse: + error: int + message: None | str + data: ServerCredential + meta: None | ServerCredentialResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, ServerCredentialResponseMetaType0): + 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.server_credential import ServerCredential + from ..models.server_credential_response_meta_type_0 import ( + ServerCredentialResponseMetaType0, + ) + + 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 = 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")) + + server_credential_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + server_credential_response.additional_properties = d + return server_credential_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/server_credential_response_meta_type_0.py b/src/shellrent_sdk/client/models/server_credential_response_meta_type_0.py new file mode 100644 index 0000000..ac43435 --- /dev/null +++ b/src/shellrent_sdk/client/models/server_credential_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..2bc52a9 --- /dev/null +++ b/src/shellrent_sdk/client/models/server_ip_address_reverse_update_request.py @@ -0,0 +1,68 @@ +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="ServerIpAddressReverseUpdateRequest") + + +@_attrs_define +class ServerIpAddressReverseUpdateRequest: + reverse_dns: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + 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 + + 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 + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + + def _parse_reverse_dns(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + reverse_dns = _parse_reverse_dns(d.pop("reverse_dns", UNSET)) + + 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 new file mode 100644 index 0000000..4386b86 --- /dev/null +++ b/src/shellrent_sdk/client/models/server_monitoring.py @@ -0,0 +1,227 @@ +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="ServerMonitoring") + + +@_attrs_define +class ServerMonitoring: + server_monitoring_id: int + purchase_monitoring_id: int | None + purchase_server_id: int | None + service_name: None | str + purchase_name: None | str + purchase_status_code: None | str + monitoring_key: None | str + is_server_monitored: bool + is_ip_monitored: bool + is_external_device_monitored: bool + monitoring_host_enabled: bool + monitoring_type: None | str + probe_limit: int | None + severity_level: None | str + email_notification: None | str + sms_notification: None | str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + server_monitoring_id = self.server_monitoring_id + + purchase_monitoring_id: int | None + purchase_monitoring_id = self.purchase_monitoring_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 + + purchase_status_code: None | str + purchase_status_code = self.purchase_status_code + + monitoring_key: None | str + monitoring_key = self.monitoring_key + + is_server_monitored = self.is_server_monitored + + is_ip_monitored = self.is_ip_monitored + + is_external_device_monitored = self.is_external_device_monitored + + monitoring_host_enabled = self.monitoring_host_enabled + + monitoring_type: None | str + monitoring_type = self.monitoring_type + + probe_limit: int | None + probe_limit = self.probe_limit + + severity_level: None | str + severity_level = self.severity_level + + email_notification: None | str + email_notification = self.email_notification + + sms_notification: None | str + sms_notification = self.sms_notification + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "server_monitoring_id": server_monitoring_id, + "purchase_monitoring_id": purchase_monitoring_id, + "purchase_server_id": purchase_server_id, + "service_name": service_name, + "purchase_name": purchase_name, + "purchase_status_code": purchase_status_code, + "monitoring_key": monitoring_key, + "is_server_monitored": is_server_monitored, + "is_ip_monitored": is_ip_monitored, + "is_external_device_monitored": is_external_device_monitored, + "monitoring_host_enabled": monitoring_host_enabled, + "monitoring_type": monitoring_type, + "probe_limit": probe_limit, + "severity_level": severity_level, + "email_notification": email_notification, + "sms_notification": sms_notification, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + server_monitoring_id = d.pop("server_monitoring_id") + + def _parse_purchase_monitoring_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + purchase_monitoring_id = _parse_purchase_monitoring_id(d.pop("purchase_monitoring_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_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_monitoring_key(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + monitoring_key = _parse_monitoring_key(d.pop("monitoring_key")) + + is_server_monitored = d.pop("is_server_monitored") + + is_ip_monitored = d.pop("is_ip_monitored") + + is_external_device_monitored = d.pop("is_external_device_monitored") + + monitoring_host_enabled = d.pop("monitoring_host_enabled") + + def _parse_monitoring_type(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + monitoring_type = _parse_monitoring_type(d.pop("monitoring_type")) + + def _parse_probe_limit(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + probe_limit = _parse_probe_limit(d.pop("probe_limit")) + + def _parse_severity_level(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + severity_level = _parse_severity_level(d.pop("severity_level")) + + def _parse_email_notification(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + email_notification = _parse_email_notification(d.pop("email_notification")) + + def _parse_sms_notification(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + sms_notification = _parse_sms_notification(d.pop("sms_notification")) + + server_monitoring = cls( + server_monitoring_id=server_monitoring_id, + purchase_monitoring_id=purchase_monitoring_id, + purchase_server_id=purchase_server_id, + service_name=service_name, + purchase_name=purchase_name, + purchase_status_code=purchase_status_code, + monitoring_key=monitoring_key, + is_server_monitored=is_server_monitored, + is_ip_monitored=is_ip_monitored, + is_external_device_monitored=is_external_device_monitored, + monitoring_host_enabled=monitoring_host_enabled, + monitoring_type=monitoring_type, + probe_limit=probe_limit, + severity_level=severity_level, + email_notification=email_notification, + sms_notification=sms_notification, + ) + + server_monitoring.additional_properties = d + return server_monitoring + + @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_paginated_list_response.py b/src/shellrent_sdk/client/models/server_monitoring_paginated_list_response.py new file mode 100644 index 0000000..d24cd1f --- /dev/null +++ b/src/shellrent_sdk/client/models/server_monitoring_paginated_list_response.py @@ -0,0 +1,99 @@ +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.pagination_meta import PaginationMeta + from ..models.server_monitoring import ServerMonitoring + + +T = TypeVar("T", bound="ServerMonitoringPaginatedListResponse") + + +@_attrs_define +class ServerMonitoringPaginatedListResponse: + error: int + message: None | str + data: list[ServerMonitoring] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.pagination_meta import PaginationMeta + from ..models.server_monitoring import ServerMonitoring + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = ServerMonitoring.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + server_monitoring_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + server_monitoring_paginated_list_response.additional_properties = d + return server_monitoring_paginated_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/server_monitoring_probe.py b/src/shellrent_sdk/client/models/server_monitoring_probe.py new file mode 100644 index 0000000..0410aa5 --- /dev/null +++ b/src/shellrent_sdk/client/models/server_monitoring_probe.py @@ -0,0 +1,245 @@ +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="ServerMonitoringProbe") + + +@_attrs_define +class ServerMonitoringProbe: + probe_id: int + server_monitoring_id: int + template_id: int | None + template_code: None | str + template_name: None | str + monitoring_item_id: int | None + monitoring_trigger_id: int | None + is_default: bool + advanced_item: bool + is_error: bool + monitoring_item_disabled: bool + action_enabled: bool + notification_email: None | str + notification_sms: None | str + date_problem: datetime.datetime | None + date_last_notification: datetime.datetime | None + active: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + probe_id = self.probe_id + + server_monitoring_id = self.server_monitoring_id + + template_id: int | None + template_id = self.template_id + + template_code: None | str + template_code = self.template_code + + template_name: None | str + template_name = self.template_name + + monitoring_item_id: int | None + monitoring_item_id = self.monitoring_item_id + + monitoring_trigger_id: int | None + monitoring_trigger_id = self.monitoring_trigger_id + + is_default = self.is_default + + advanced_item = self.advanced_item + + is_error = self.is_error + + monitoring_item_disabled = self.monitoring_item_disabled + + action_enabled = self.action_enabled + + notification_email: None | str + notification_email = self.notification_email + + notification_sms: None | str + notification_sms = self.notification_sms + + date_problem: None | str + if isinstance(self.date_problem, datetime.datetime): + date_problem = self.date_problem.isoformat() + else: + date_problem = self.date_problem + + date_last_notification: None | str + if isinstance(self.date_last_notification, datetime.datetime): + date_last_notification = self.date_last_notification.isoformat() + else: + date_last_notification = self.date_last_notification + + active = self.active + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "probe_id": probe_id, + "server_monitoring_id": server_monitoring_id, + "template_id": template_id, + "template_code": template_code, + "template_name": template_name, + "monitoring_item_id": monitoring_item_id, + "monitoring_trigger_id": monitoring_trigger_id, + "is_default": is_default, + "advanced_item": advanced_item, + "is_error": is_error, + "monitoring_item_disabled": monitoring_item_disabled, + "action_enabled": action_enabled, + "notification_email": notification_email, + "notification_sms": notification_sms, + "date_problem": date_problem, + "date_last_notification": date_last_notification, + "active": active, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + probe_id = d.pop("probe_id") + + server_monitoring_id = d.pop("server_monitoring_id") + + def _parse_template_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + template_id = _parse_template_id(d.pop("template_id")) + + def _parse_template_code(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + template_code = _parse_template_code(d.pop("template_code")) + + def _parse_template_name(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + template_name = _parse_template_name(d.pop("template_name")) + + def _parse_monitoring_item_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + monitoring_item_id = _parse_monitoring_item_id(d.pop("monitoring_item_id")) + + def _parse_monitoring_trigger_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + monitoring_trigger_id = _parse_monitoring_trigger_id(d.pop("monitoring_trigger_id")) + + is_default = d.pop("is_default") + + advanced_item = d.pop("advanced_item") + + is_error = d.pop("is_error") + + monitoring_item_disabled = d.pop("monitoring_item_disabled") + + action_enabled = d.pop("action_enabled") + + def _parse_notification_email(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + notification_email = _parse_notification_email(d.pop("notification_email")) + + def _parse_notification_sms(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + notification_sms = _parse_notification_sms(d.pop("notification_sms")) + + def _parse_date_problem(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + date_problem_type_0 = datetime.datetime.fromisoformat(data) + + return date_problem_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + date_problem = _parse_date_problem(d.pop("date_problem")) + + def _parse_date_last_notification(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + date_last_notification_type_0 = datetime.datetime.fromisoformat(data) + + return date_last_notification_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + date_last_notification = _parse_date_last_notification(d.pop("date_last_notification")) + + active = d.pop("active") + + server_monitoring_probe = cls( + probe_id=probe_id, + server_monitoring_id=server_monitoring_id, + template_id=template_id, + template_code=template_code, + template_name=template_name, + monitoring_item_id=monitoring_item_id, + monitoring_trigger_id=monitoring_trigger_id, + is_default=is_default, + advanced_item=advanced_item, + is_error=is_error, + monitoring_item_disabled=monitoring_item_disabled, + action_enabled=action_enabled, + notification_email=notification_email, + notification_sms=notification_sms, + date_problem=date_problem, + date_last_notification=date_last_notification, + active=active, + ) + + server_monitoring_probe.additional_properties = d + return server_monitoring_probe + + @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_chart.py b/src/shellrent_sdk/client/models/server_monitoring_probe_chart.py new file mode 100644 index 0000000..149b124 --- /dev/null +++ b/src/shellrent_sdk/client/models/server_monitoring_probe_chart.py @@ -0,0 +1,95 @@ +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 + +if TYPE_CHECKING: + from ..models.server_monitoring_probe_chart_points_item import ( + ServerMonitoringProbeChartPointsItem, + ) + + +T = TypeVar("T", bound="ServerMonitoringProbeChart") + + +@_attrs_define +class ServerMonitoringProbeChart: + server_monitoring_id: int + probe_id: int + interval: str + points: list[ServerMonitoringProbeChartPointsItem] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + server_monitoring_id = self.server_monitoring_id + + probe_id = self.probe_id + + interval = self.interval + + points = [] + for points_item_data in self.points: + points_item = points_item_data.to_dict() + points.append(points_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "server_monitoring_id": server_monitoring_id, + "probe_id": probe_id, + "interval": interval, + "points": points, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.server_monitoring_probe_chart_points_item import ( + ServerMonitoringProbeChartPointsItem, + ) + + d = dict(src_dict) + server_monitoring_id = d.pop("server_monitoring_id") + + probe_id = d.pop("probe_id") + + interval = d.pop("interval") + + points = [] + _points = d.pop("points") + for points_item_data in _points: + points_item = ServerMonitoringProbeChartPointsItem.from_dict(points_item_data) + + points.append(points_item) + + server_monitoring_probe_chart = cls( + server_monitoring_id=server_monitoring_id, + probe_id=probe_id, + interval=interval, + points=points, + ) + + server_monitoring_probe_chart.additional_properties = d + return server_monitoring_probe_chart + + @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_chart_points_item.py b/src/shellrent_sdk/client/models/server_monitoring_probe_chart_points_item.py new file mode 100644 index 0000000..063fd78 --- /dev/null +++ b/src/shellrent_sdk/client/models/server_monitoring_probe_chart_points_item.py @@ -0,0 +1,66 @@ +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 + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ServerMonitoringProbeChartPointsItem") + + +@_attrs_define +class ServerMonitoringProbeChartPointsItem: + x: float | Unset = UNSET + """ UNIX timestamp in milliseconds """ + y: float | Unset = UNSET + """ Probe value """ + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + x = self.x + + y = self.y + + 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 + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + x = d.pop("x", UNSET) + + y = d.pop("y", UNSET) + + server_monitoring_probe_chart_points_item = cls( + x=x, + y=y, + ) + + server_monitoring_probe_chart_points_item.additional_properties = d + return server_monitoring_probe_chart_points_item + + @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_chart_response.py b/src/shellrent_sdk/client/models/server_monitoring_probe_chart_response.py new file mode 100644 index 0000000..ee41488 --- /dev/null +++ b/src/shellrent_sdk/client/models/server_monitoring_probe_chart_response.py @@ -0,0 +1,118 @@ +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.server_monitoring_probe_chart import ServerMonitoringProbeChart + from ..models.server_monitoring_probe_chart_response_meta_type_0 import ( + ServerMonitoringProbeChartResponseMetaType0, + ) + + +T = TypeVar("T", bound="ServerMonitoringProbeChartResponse") + + +@_attrs_define +class ServerMonitoringProbeChartResponse: + error: int + message: None | str + data: ServerMonitoringProbeChart + meta: None | ServerMonitoringProbeChartResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, ServerMonitoringProbeChartResponseMetaType0): + 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.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") + + 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 = 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")) + + server_monitoring_probe_chart_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + server_monitoring_probe_chart_response.additional_properties = d + return server_monitoring_probe_chart_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/server_monitoring_probe_chart_response_meta_type_0.py b/src/shellrent_sdk/client/models/server_monitoring_probe_chart_response_meta_type_0.py new file mode 100644 index 0000000..b147acc --- /dev/null +++ b/src/shellrent_sdk/client/models/server_monitoring_probe_chart_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..38645b0 --- /dev/null +++ b/src/shellrent_sdk/client/models/server_monitoring_probe_create_request.py @@ -0,0 +1,103 @@ +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.server_monitoring_probe_create_request_parameters import ( + ServerMonitoringProbeCreateRequestParameters, + ) + + +T = TypeVar("T", bound="ServerMonitoringProbeCreateRequest") + + +@_attrs_define +class ServerMonitoringProbeCreateRequest: + server_monitoring_item_template_id: int + """ Probe template identifier. """ + parameters: ServerMonitoringProbeCreateRequestParameters | Unset = UNSET + """ Template probe parameters as key-value map. """ + notification_email: str | Unset = UNSET + """ 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 + + parameters: dict[str, Any] | Unset = UNSET + if not isinstance(self.parameters, Unset): + parameters = self.parameters.to_dict() + + notification_email = self.notification_email + + 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, + } + ) + if parameters is not UNSET: + field_dict["parameters"] = parameters + if notification_email is not UNSET: + field_dict["notification_email"] = notification_email + if notification_sms is not UNSET: + field_dict["notification_sms"] = notification_sms + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.server_monitoring_probe_create_request_parameters import ( + ServerMonitoringProbeCreateRequestParameters, + ) + + d = dict(src_dict) + server_monitoring_item_template_id = d.pop("server_monitoring_item_template_id") + + _parameters = d.pop("parameters", UNSET) + parameters: ServerMonitoringProbeCreateRequestParameters | Unset + if isinstance(_parameters, Unset): + parameters = UNSET + else: + parameters = ServerMonitoringProbeCreateRequestParameters.from_dict(_parameters) + + notification_email = d.pop("notification_email", UNSET) + + notification_sms = d.pop("notification_sms", UNSET) + + server_monitoring_probe_create_request = cls( + server_monitoring_item_template_id=server_monitoring_item_template_id, + parameters=parameters, + notification_email=notification_email, + 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_create_request_parameters.py b/src/shellrent_sdk/client/models/server_monitoring_probe_create_request_parameters.py new file mode 100644 index 0000000..5b14951 --- /dev/null +++ b/src/shellrent_sdk/client/models/server_monitoring_probe_create_request_parameters.py @@ -0,0 +1,47 @@ +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="ServerMonitoringProbeCreateRequestParameters") + + +@_attrs_define +class ServerMonitoringProbeCreateRequestParameters: + """Template probe parameters as key-value map.""" + + 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_create_request_parameters = cls() + + server_monitoring_probe_create_request_parameters.additional_properties = d + return server_monitoring_probe_create_request_parameters + + @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 new file mode 100644 index 0000000..5f9b0e2 --- /dev/null +++ b/src/shellrent_sdk/client/models/server_monitoring_probe_list_response.py @@ -0,0 +1,124 @@ +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.server_monitoring_probe import ServerMonitoringProbe + from ..models.server_monitoring_probe_list_response_meta_type_0 import ( + ServerMonitoringProbeListResponseMetaType0, + ) + + +T = TypeVar("T", bound="ServerMonitoringProbeListResponse") + + +@_attrs_define +class ServerMonitoringProbeListResponse: + error: int + message: None | str + data: list[ServerMonitoringProbe] + meta: None | ServerMonitoringProbeListResponseMetaType0 + 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 + message = self.message + + data = [] + for data_item_data in self.data: + 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 + + 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.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") + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = ServerMonitoringProbe.from_dict(data_item_data) + + 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")) + + server_monitoring_probe_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + server_monitoring_probe_list_response.additional_properties = d + return server_monitoring_probe_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/server_monitoring_probe_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/server_monitoring_probe_list_response_meta_type_0.py new file mode 100644 index 0000000..de39053 --- /dev/null +++ b/src/shellrent_sdk/client/models/server_monitoring_probe_list_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..810d4f2 --- /dev/null +++ b/src/shellrent_sdk/client/models/server_monitoring_probe_response.py @@ -0,0 +1,116 @@ +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.server_monitoring_probe import ServerMonitoringProbe + from ..models.server_monitoring_probe_response_meta_type_0 import ( + ServerMonitoringProbeResponseMetaType0, + ) + + +T = TypeVar("T", bound="ServerMonitoringProbeResponse") + + +@_attrs_define +class ServerMonitoringProbeResponse: + error: int + message: None | str + data: ServerMonitoringProbe + meta: None | ServerMonitoringProbeResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, ServerMonitoringProbeResponseMetaType0): + 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.server_monitoring_probe import ServerMonitoringProbe + from ..models.server_monitoring_probe_response_meta_type_0 import ( + ServerMonitoringProbeResponseMetaType0, + ) + + 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 = 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")) + + server_monitoring_probe_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + server_monitoring_probe_response.additional_properties = d + return server_monitoring_probe_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/server_monitoring_probe_response_meta_type_0.py b/src/shellrent_sdk/client/models/server_monitoring_probe_response_meta_type_0.py new file mode 100644 index 0000000..d239d26 --- /dev/null +++ b/src/shellrent_sdk/client/models/server_monitoring_probe_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..24aa6fc --- /dev/null +++ b/src/shellrent_sdk/client/models/server_monitoring_probe_update_request.py @@ -0,0 +1,66 @@ +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 + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ServerMonitoringProbeUpdateRequest") + + +@_attrs_define +class ServerMonitoringProbeUpdateRequest: + notification_email: str | Unset = UNSET + """ 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 + + 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 + if notification_sms is not UNSET: + field_dict["notification_sms"] = notification_sms + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + notification_email = d.pop("notification_email", UNSET) + + notification_sms = d.pop("notification_sms", UNSET) + + server_monitoring_probe_update_request = cls( + notification_email=notification_email, + 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 new file mode 100644 index 0000000..1c9ee7b --- /dev/null +++ b/src/shellrent_sdk/client/models/server_monitoring_response.py @@ -0,0 +1,114 @@ +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.server_monitoring import ServerMonitoring + from ..models.server_monitoring_response_meta_type_0 import ServerMonitoringResponseMetaType0 + + +T = TypeVar("T", bound="ServerMonitoringResponse") + + +@_attrs_define +class ServerMonitoringResponse: + error: int + message: None | str + data: ServerMonitoring + meta: None | ServerMonitoringResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, ServerMonitoringResponseMetaType0): + 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.server_monitoring import ServerMonitoring + from ..models.server_monitoring_response_meta_type_0 import ( + ServerMonitoringResponseMetaType0, + ) + + 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 = 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")) + + server_monitoring_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + server_monitoring_response.additional_properties = d + return server_monitoring_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/server_monitoring_response_meta_type_0.py b/src/shellrent_sdk/client/models/server_monitoring_response_meta_type_0.py new file mode 100644 index 0000000..42ce9c3 --- /dev/null +++ b/src/shellrent_sdk/client/models/server_monitoring_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..3533537 --- /dev/null +++ b/src/shellrent_sdk/client/models/server_network_interface.py @@ -0,0 +1,231 @@ +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="ServerNetworkInterface") + + +@_attrs_define +class ServerNetworkInterface: + network_interface_id: int + server_id: int + network_id: int | None + ip_address_id: int | None + vif_uuid: None | str + device_name: None | str + mac_address: None | str + is_default: bool | None + is_active: bool | None + network_type: None | str + network_label: None | str + network_bridge: None | str + ip_address: None | str + date_created: datetime.datetime | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + network_interface_id = self.network_interface_id + + server_id = self.server_id + + network_id: int | None + network_id = self.network_id + + ip_address_id: int | None + ip_address_id = self.ip_address_id + + vif_uuid: None | str + vif_uuid = self.vif_uuid + + device_name: None | str + device_name = self.device_name + + mac_address: None | str + mac_address = self.mac_address + + is_default: bool | None + is_default = self.is_default + + is_active: bool | None + is_active = self.is_active + + network_type: None | str + network_type = self.network_type + + network_label: None | str + network_label = self.network_label + + network_bridge: None | str + network_bridge = self.network_bridge + + ip_address: None | str + ip_address = self.ip_address + + date_created: None | str + if isinstance(self.date_created, datetime.datetime): + date_created = self.date_created.isoformat() + else: + date_created = self.date_created + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "network_interface_id": network_interface_id, + "server_id": server_id, + "network_id": network_id, + "ip_address_id": ip_address_id, + "vif_uuid": vif_uuid, + "device_name": device_name, + "mac_address": mac_address, + "is_default": is_default, + "is_active": is_active, + "network_type": network_type, + "network_label": network_label, + "network_bridge": network_bridge, + "ip_address": ip_address, + "date_created": date_created, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + network_interface_id = d.pop("network_interface_id") + + server_id = d.pop("server_id") + + def _parse_network_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + network_id = _parse_network_id(d.pop("network_id")) + + def _parse_ip_address_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + ip_address_id = _parse_ip_address_id(d.pop("ip_address_id")) + + def _parse_vif_uuid(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + vif_uuid = _parse_vif_uuid(d.pop("vif_uuid")) + + def _parse_device_name(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + device_name = _parse_device_name(d.pop("device_name")) + + def _parse_mac_address(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + mac_address = _parse_mac_address(d.pop("mac_address")) + + def _parse_is_default(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) + + is_default = _parse_is_default(d.pop("is_default")) + + def _parse_is_active(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) + + is_active = _parse_is_active(d.pop("is_active")) + + def _parse_network_type(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + network_type = _parse_network_type(d.pop("network_type")) + + def _parse_network_label(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + network_label = _parse_network_label(d.pop("network_label")) + + def _parse_network_bridge(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + network_bridge = _parse_network_bridge(d.pop("network_bridge")) + + 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")) + + def _parse_date_created(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + date_created_type_0 = datetime.datetime.fromisoformat(data) + + return date_created_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + date_created = _parse_date_created(d.pop("date_created")) + + server_network_interface = cls( + network_interface_id=network_interface_id, + server_id=server_id, + network_id=network_id, + ip_address_id=ip_address_id, + vif_uuid=vif_uuid, + device_name=device_name, + mac_address=mac_address, + is_default=is_default, + is_active=is_active, + network_type=network_type, + network_label=network_label, + network_bridge=network_bridge, + ip_address=ip_address, + date_created=date_created, + ) + + server_network_interface.additional_properties = d + return server_network_interface + + @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_create_request.py b/src/shellrent_sdk/client/models/server_network_interface_create_request.py new file mode 100644 index 0000000..60dd1c6 --- /dev/null +++ b/src/shellrent_sdk/client/models/server_network_interface_create_request.py @@ -0,0 +1,66 @@ +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 + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ServerNetworkInterfaceCreateRequest") + + +@_attrs_define +class ServerNetworkInterfaceCreateRequest: + network_id: int | Unset = UNSET + """ Local network ID (for local VIF) """ + ip_address_id: int | Unset = UNSET + """ Server IP address ID (for public VIF) """ + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + network_id = self.network_id + + 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 + if ip_address_id is not UNSET: + field_dict["ip_address_id"] = ip_address_id + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + network_id = d.pop("network_id", UNSET) + + ip_address_id = d.pop("ip_address_id", UNSET) + + server_network_interface_create_request = cls( + network_id=network_id, + 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 new file mode 100644 index 0000000..4ae694f --- /dev/null +++ b/src/shellrent_sdk/client/models/server_network_interface_list_response.py @@ -0,0 +1,124 @@ +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.server_network_interface import ServerNetworkInterface + from ..models.server_network_interface_list_response_meta_type_0 import ( + ServerNetworkInterfaceListResponseMetaType0, + ) + + +T = TypeVar("T", bound="ServerNetworkInterfaceListResponse") + + +@_attrs_define +class ServerNetworkInterfaceListResponse: + error: int + message: None | str + data: list[ServerNetworkInterface] + meta: None | ServerNetworkInterfaceListResponseMetaType0 + 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 + message = self.message + + data = [] + for data_item_data in self.data: + 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 + + 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.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") + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = ServerNetworkInterface.from_dict(data_item_data) + + 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")) + + server_network_interface_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + server_network_interface_list_response.additional_properties = d + return server_network_interface_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/server_network_interface_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/server_network_interface_list_response_meta_type_0.py new file mode 100644 index 0000000..a6cd500 --- /dev/null +++ b/src/shellrent_sdk/client/models/server_network_interface_list_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..7f96f97 --- /dev/null +++ b/src/shellrent_sdk/client/models/server_network_interface_response.py @@ -0,0 +1,116 @@ +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.server_network_interface import ServerNetworkInterface + from ..models.server_network_interface_response_meta_type_0 import ( + ServerNetworkInterfaceResponseMetaType0, + ) + + +T = TypeVar("T", bound="ServerNetworkInterfaceResponse") + + +@_attrs_define +class ServerNetworkInterfaceResponse: + error: int + message: None | str + data: ServerNetworkInterface + meta: None | ServerNetworkInterfaceResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, ServerNetworkInterfaceResponseMetaType0): + 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.server_network_interface import ServerNetworkInterface + from ..models.server_network_interface_response_meta_type_0 import ( + ServerNetworkInterfaceResponseMetaType0, + ) + + 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 = 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")) + + server_network_interface_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + server_network_interface_response.additional_properties = d + return server_network_interface_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/server_network_interface_response_meta_type_0.py b/src/shellrent_sdk/client/models/server_network_interface_response_meta_type_0.py new file mode 100644 index 0000000..df45aec --- /dev/null +++ b/src/shellrent_sdk/client/models/server_network_interface_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..752ce33 --- /dev/null +++ b/src/shellrent_sdk/client/models/server_os.py @@ -0,0 +1,105 @@ +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="ServerOs") + + +@_attrs_define +class ServerOs: + os_code: str + os_name: str + min_ram: int | None + """ Min RAM (GB), for VPS/VM only """ + min_cpu: int | None + """ Min vCPU, for VPS/VM only """ + min_disk: int | None + """ Min disk (GB), for VPS/VM only """ + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + os_code = self.os_code + + os_name = self.os_name + + min_ram: int | None + min_ram = self.min_ram + + min_cpu: int | None + min_cpu = self.min_cpu + + min_disk: int | None + min_disk = self.min_disk + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "os_code": os_code, + "os_name": os_name, + "min_ram": min_ram, + "min_cpu": min_cpu, + "min_disk": min_disk, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + os_code = d.pop("os_code") + + os_name = d.pop("os_name") + + def _parse_min_ram(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + min_ram = _parse_min_ram(d.pop("min_ram")) + + def _parse_min_cpu(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + min_cpu = _parse_min_cpu(d.pop("min_cpu")) + + def _parse_min_disk(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + min_disk = _parse_min_disk(d.pop("min_disk")) + + server_os = cls( + os_code=os_code, + os_name=os_name, + min_ram=min_ram, + min_cpu=min_cpu, + min_disk=min_disk, + ) + + server_os.additional_properties = d + return server_os + + @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_paginated_list_response.py b/src/shellrent_sdk/client/models/server_paginated_list_response.py new file mode 100644 index 0000000..4fc56bd --- /dev/null +++ b/src/shellrent_sdk/client/models/server_paginated_list_response.py @@ -0,0 +1,99 @@ +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.pagination_meta import PaginationMeta + from ..models.server import Server + + +T = TypeVar("T", bound="ServerPaginatedListResponse") + + +@_attrs_define +class ServerPaginatedListResponse: + error: int + message: None | str + data: list[Server] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.pagination_meta import PaginationMeta + from ..models.server import Server + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = Server.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + server_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + server_paginated_list_response.additional_properties = d + return server_paginated_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/server_reinstall_request.py b/src/shellrent_sdk/client/models/server_reinstall_request.py new file mode 100644 index 0000000..5965308 --- /dev/null +++ b/src/shellrent_sdk/client/models/server_reinstall_request.py @@ -0,0 +1,57 @@ +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 + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ServerReinstallRequest") + + +@_attrs_define +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 + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + safety_backup_enabled = d.pop("safety_backup_enabled", UNSET) + + server_reinstall_request = cls( + 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 new file mode 100644 index 0000000..aeb3f1d --- /dev/null +++ b/src/shellrent_sdk/client/models/server_response.py @@ -0,0 +1,110 @@ +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.server import Server + from ..models.server_response_meta_type_0 import ServerResponseMetaType0 + + +T = TypeVar("T", bound="ServerResponse") + + +@_attrs_define +class ServerResponse: + error: int + message: None | str + data: Server + meta: None | ServerResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, ServerResponseMetaType0): + 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.server import Server + from ..models.server_response_meta_type_0 import ServerResponseMetaType0 + + 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 = 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")) + + server_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + server_response.additional_properties = d + return server_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/server_response_meta_type_0.py b/src/shellrent_sdk/client/models/server_response_meta_type_0.py new file mode 100644 index 0000000..78cd274 --- /dev/null +++ b/src/shellrent_sdk/client/models/server_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..5400cce --- /dev/null +++ b/src/shellrent_sdk/client/models/server_snapshot.py @@ -0,0 +1,145 @@ +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="ServerSnapshot") + + +@_attrs_define +class ServerSnapshot: + snapshot_id: int + server_id: int + snapshot_name: None | str + snapshot_reference: None | str + active: bool + date_expiry: datetime.datetime | None + date_created: datetime.datetime | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + snapshot_id = self.snapshot_id + + server_id = self.server_id + + snapshot_name: None | str + snapshot_name = self.snapshot_name + + snapshot_reference: None | str + snapshot_reference = self.snapshot_reference + + active = self.active + + date_expiry: None | str + if isinstance(self.date_expiry, datetime.datetime): + date_expiry = self.date_expiry.isoformat() + else: + date_expiry = self.date_expiry + + date_created: None | str + if isinstance(self.date_created, datetime.datetime): + date_created = self.date_created.isoformat() + else: + date_created = self.date_created + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "snapshot_id": snapshot_id, + "server_id": server_id, + "snapshot_name": snapshot_name, + "snapshot_reference": snapshot_reference, + "active": active, + "date_expiry": date_expiry, + "date_created": date_created, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + snapshot_id = d.pop("snapshot_id") + + server_id = d.pop("server_id") + + def _parse_snapshot_name(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + snapshot_name = _parse_snapshot_name(d.pop("snapshot_name")) + + def _parse_snapshot_reference(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + snapshot_reference = _parse_snapshot_reference(d.pop("snapshot_reference")) + + active = d.pop("active") + + def _parse_date_expiry(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + date_expiry_type_0 = datetime.datetime.fromisoformat(data) + + return date_expiry_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + date_expiry = _parse_date_expiry(d.pop("date_expiry")) + + def _parse_date_created(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + date_created_type_0 = datetime.datetime.fromisoformat(data) + + return date_created_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + date_created = _parse_date_created(d.pop("date_created")) + + server_snapshot = cls( + snapshot_id=snapshot_id, + server_id=server_id, + snapshot_name=snapshot_name, + snapshot_reference=snapshot_reference, + active=active, + date_expiry=date_expiry, + date_created=date_created, + ) + + server_snapshot.additional_properties = d + return server_snapshot + + @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_paginated_list_response.py b/src/shellrent_sdk/client/models/server_snapshot_paginated_list_response.py new file mode 100644 index 0000000..cc31f9c --- /dev/null +++ b/src/shellrent_sdk/client/models/server_snapshot_paginated_list_response.py @@ -0,0 +1,99 @@ +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.pagination_meta import PaginationMeta + from ..models.server_snapshot import ServerSnapshot + + +T = TypeVar("T", bound="ServerSnapshotPaginatedListResponse") + + +@_attrs_define +class ServerSnapshotPaginatedListResponse: + error: int + message: None | str + data: list[ServerSnapshot] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.pagination_meta import PaginationMeta + from ..models.server_snapshot import ServerSnapshot + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = ServerSnapshot.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + server_snapshot_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + server_snapshot_paginated_list_response.additional_properties = d + return server_snapshot_paginated_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/server_snapshot_response.py b/src/shellrent_sdk/client/models/server_snapshot_response.py new file mode 100644 index 0000000..29caf29 --- /dev/null +++ b/src/shellrent_sdk/client/models/server_snapshot_response.py @@ -0,0 +1,112 @@ +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.server_snapshot import ServerSnapshot + from ..models.server_snapshot_response_meta_type_0 import ServerSnapshotResponseMetaType0 + + +T = TypeVar("T", bound="ServerSnapshotResponse") + + +@_attrs_define +class ServerSnapshotResponse: + error: int + message: None | str + data: ServerSnapshot + meta: None | ServerSnapshotResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, ServerSnapshotResponseMetaType0): + 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.server_snapshot import ServerSnapshot + from ..models.server_snapshot_response_meta_type_0 import ( + ServerSnapshotResponseMetaType0, + ) + + 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 = 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")) + + server_snapshot_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + server_snapshot_response.additional_properties = d + return server_snapshot_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/server_snapshot_response_meta_type_0.py b/src/shellrent_sdk/client/models/server_snapshot_response_meta_type_0.py new file mode 100644 index 0000000..dcb5ddb --- /dev/null +++ b/src/shellrent_sdk/client/models/server_snapshot_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..7367ee5 --- /dev/null +++ b/src/shellrent_sdk/client/models/server_template.py @@ -0,0 +1,142 @@ +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.server_os import ServerOs + + +T = TypeVar("T", bound="ServerTemplate") + + +@_attrs_define +class ServerTemplate: + template_code: str + template_name: str + template_name_alternative: None | str + min_ram: int | None + """ Min RAM (GB), for VPS/VM only """ + min_cpu: int | None + """ Min vCPU, for VPS/VM only """ + min_disk: int | None + """ Min disk (GB), for VPS/VM only """ + operative_systems: list[ServerOs] + """ Compatible operative systems """ + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + template_code = self.template_code + + template_name = self.template_name + + template_name_alternative: None | str + template_name_alternative = self.template_name_alternative + + min_ram: int | None + min_ram = self.min_ram + + min_cpu: int | None + min_cpu = self.min_cpu + + min_disk: int | None + min_disk = self.min_disk + + operative_systems = [] + for operative_systems_item_data in self.operative_systems: + operative_systems_item = operative_systems_item_data.to_dict() + operative_systems.append(operative_systems_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "template_code": template_code, + "template_name": template_name, + "template_name_alternative": template_name_alternative, + "min_ram": min_ram, + "min_cpu": min_cpu, + "min_disk": min_disk, + "operative_systems": operative_systems, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.server_os import ServerOs + + d = dict(src_dict) + template_code = d.pop("template_code") + + template_name = d.pop("template_name") + + def _parse_template_name_alternative(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + template_name_alternative = _parse_template_name_alternative( + d.pop("template_name_alternative") + ) + + def _parse_min_ram(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + min_ram = _parse_min_ram(d.pop("min_ram")) + + def _parse_min_cpu(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + min_cpu = _parse_min_cpu(d.pop("min_cpu")) + + def _parse_min_disk(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + min_disk = _parse_min_disk(d.pop("min_disk")) + + operative_systems = [] + _operative_systems = d.pop("operative_systems") + for operative_systems_item_data in _operative_systems: + operative_systems_item = ServerOs.from_dict(operative_systems_item_data) + + operative_systems.append(operative_systems_item) + + server_template = cls( + template_code=template_code, + template_name=template_name, + template_name_alternative=template_name_alternative, + min_ram=min_ram, + min_cpu=min_cpu, + min_disk=min_disk, + operative_systems=operative_systems, + ) + + server_template.additional_properties = d + return server_template + + @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/service.py b/src/shellrent_sdk/client/models/service.py new file mode 100644 index 0000000..baa2455 --- /dev/null +++ b/src/shellrent_sdk/client/models/service.py @@ -0,0 +1,301 @@ +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 + from ..models.recurrence import Recurrence + from ..models.service_category import ServiceCategory + + +T = TypeVar("T", bound="Service") + + +@_attrs_define +class Service: + service_id: int + service_category: ServiceCategory + service_name: str + recurrence: Recurrence + recurrences_available: list[Recurrence] + tld_id: int | None + service_code: str + service_url: str + activation_price: Amount + renew_price: Amount | None + restore_price: Amount | None + transfer_price: Amount | None + is_primary: bool | None + is_secondary: bool | None + is_presale: bool | None + is_aftersale: bool | None + is_quantifiable: bool | None + quantity_min: int | None + quantity_max: int | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.amount import Amount + + service_id = self.service_id + + service_category = self.service_category.to_dict() + + service_name = self.service_name + + recurrence = self.recurrence.to_dict() + + recurrences_available = [] + for recurrences_available_item_data in self.recurrences_available: + recurrences_available_item = recurrences_available_item_data.to_dict() + recurrences_available.append(recurrences_available_item) + + tld_id: int | None + tld_id = self.tld_id + + service_code = self.service_code + + service_url = self.service_url + + activation_price = self.activation_price.to_dict() + + renew_price: dict[str, Any] | None + if isinstance(self.renew_price, Amount): + renew_price = self.renew_price.to_dict() + else: + renew_price = self.renew_price + + 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 + + is_primary: bool | None + is_primary = self.is_primary + + is_secondary: bool | None + is_secondary = self.is_secondary + + is_presale: bool | None + is_presale = self.is_presale + + is_aftersale: bool | None + is_aftersale = self.is_aftersale + + is_quantifiable: bool | None + is_quantifiable = self.is_quantifiable + + quantity_min: int | None + quantity_min = self.quantity_min + + quantity_max: int | None + quantity_max = self.quantity_max + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "service_id": service_id, + "service_category": service_category, + "service_name": service_name, + "recurrence": recurrence, + "recurrences_available": recurrences_available, + "tld_id": tld_id, + "service_code": service_code, + "service_url": service_url, + "activation_price": activation_price, + "renew_price": renew_price, + "restore_price": restore_price, + "transfer_price": transfer_price, + "is_primary": is_primary, + "is_secondary": is_secondary, + "is_presale": is_presale, + "is_aftersale": is_aftersale, + "is_quantifiable": is_quantifiable, + "quantity_min": quantity_min, + "quantity_max": quantity_max, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.amount import Amount + from ..models.recurrence import Recurrence + from ..models.service_category import ServiceCategory + + d = dict(src_dict) + service_id = d.pop("service_id") + + service_category = ServiceCategory.from_dict(d.pop("service_category")) + + service_name = d.pop("service_name") + + recurrence = Recurrence.from_dict(d.pop("recurrence")) + + recurrences_available = [] + _recurrences_available = d.pop("recurrences_available") + for recurrences_available_item_data in _recurrences_available: + recurrences_available_item = Recurrence.from_dict(recurrences_available_item_data) + + recurrences_available.append(recurrences_available_item) + + def _parse_tld_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + tld_id = _parse_tld_id(d.pop("tld_id")) + + service_code = d.pop("service_code") + + service_url = d.pop("service_url") + + activation_price = Amount.from_dict(d.pop("activation_price")) + + def _parse_renew_price(data: object) -> Amount | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + renew_price_type_0 = Amount.from_dict(data) + + return renew_price_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(Amount | None, data) + + renew_price = _parse_renew_price(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")) + + def _parse_is_primary(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) + + is_primary = _parse_is_primary(d.pop("is_primary")) + + def _parse_is_secondary(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) + + is_secondary = _parse_is_secondary(d.pop("is_secondary")) + + def _parse_is_presale(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) + + is_presale = _parse_is_presale(d.pop("is_presale")) + + def _parse_is_aftersale(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) + + is_aftersale = _parse_is_aftersale(d.pop("is_aftersale")) + + def _parse_is_quantifiable(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) + + is_quantifiable = _parse_is_quantifiable(d.pop("is_quantifiable")) + + def _parse_quantity_min(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + quantity_min = _parse_quantity_min(d.pop("quantity_min")) + + def _parse_quantity_max(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + quantity_max = _parse_quantity_max(d.pop("quantity_max")) + + service = cls( + service_id=service_id, + service_category=service_category, + service_name=service_name, + recurrence=recurrence, + recurrences_available=recurrences_available, + tld_id=tld_id, + service_code=service_code, + service_url=service_url, + activation_price=activation_price, + renew_price=renew_price, + restore_price=restore_price, + transfer_price=transfer_price, + is_primary=is_primary, + is_secondary=is_secondary, + is_presale=is_presale, + is_aftersale=is_aftersale, + is_quantifiable=is_quantifiable, + quantity_min=quantity_min, + quantity_max=quantity_max, + ) + + service.additional_properties = d + return service + + @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/service_category.py b/src/shellrent_sdk/client/models/service_category.py new file mode 100644 index 0000000..3bf845f --- /dev/null +++ b/src/shellrent_sdk/client/models/service_category.py @@ -0,0 +1,77 @@ +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="ServiceCategory") + + +@_attrs_define +class ServiceCategory: + category_code: str + category_name: str + area_code: str + area_name: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + category_code = self.category_code + + category_name = self.category_name + + area_code = self.area_code + + area_name = self.area_name + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "category_code": category_code, + "category_name": category_name, + "area_code": area_code, + "area_name": area_name, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + category_code = d.pop("category_code") + + category_name = d.pop("category_name") + + area_code = d.pop("area_code") + + area_name = d.pop("area_name") + + service_category = cls( + category_code=category_code, + category_name=category_name, + area_code=area_code, + area_name=area_name, + ) + + service_category.additional_properties = d + return service_category + + @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/service_change.py b/src/shellrent_sdk/client/models/service_change.py new file mode 100644 index 0000000..ea1f5a7 --- /dev/null +++ b/src/shellrent_sdk/client/models/service_change.py @@ -0,0 +1,71 @@ +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 + +if TYPE_CHECKING: + from ..models.amount import Amount + from ..models.service import Service + + +T = TypeVar("T", bound="ServiceChange") + + +@_attrs_define +class ServiceChange: + service: Service + activation_price: Amount + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + service = self.service.to_dict() + + activation_price = self.activation_price.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "service": service, + "activation_price": activation_price, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.amount import Amount + from ..models.service import Service + + d = dict(src_dict) + service = Service.from_dict(d.pop("service")) + + activation_price = Amount.from_dict(d.pop("activation_price")) + + service_change = cls( + service=service, + activation_price=activation_price, + ) + + service_change.additional_properties = d + return service_change + + @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/service_list_response.py b/src/shellrent_sdk/client/models/service_list_response.py new file mode 100644 index 0000000..dc5f439 --- /dev/null +++ b/src/shellrent_sdk/client/models/service_list_response.py @@ -0,0 +1,120 @@ +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.service import Service + from ..models.service_list_response_meta_type_0 import ServiceListResponseMetaType0 + + +T = TypeVar("T", bound="ServiceListResponse") + + +@_attrs_define +class ServiceListResponse: + error: int + message: None | str + data: list[Service] + meta: None | ServiceListResponseMetaType0 + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.service_list_response_meta_type_0 import ServiceListResponseMetaType0 + + error = self.error + + 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) + + meta: dict[str, Any] | None + if isinstance(self.meta, ServiceListResponseMetaType0): + 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.service import Service + from ..models.service_list_response_meta_type_0 import ( + ServiceListResponseMetaType0, + ) + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = Service.from_dict(data_item_data) + + data.append(data_item) + + def _parse_meta(data: object) -> None | ServiceListResponseMetaType0: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + meta_type_0 = ServiceListResponseMetaType0.from_dict(data) + + return meta_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | ServiceListResponseMetaType0, data) + + meta = _parse_meta(d.pop("meta")) + + service_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + service_list_response.additional_properties = d + return service_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/service_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/service_list_response_meta_type_0.py new file mode 100644 index 0000000..4581396 --- /dev/null +++ b/src/shellrent_sdk/client/models/service_list_response_meta_type_0.py @@ -0,0 +1,45 @@ +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="ServiceListResponseMetaType0") + + +@_attrs_define +class ServiceListResponseMetaType0: + 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) + service_list_response_meta_type_0 = cls() + + service_list_response_meta_type_0.additional_properties = d + return service_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/service_paginated_list_response.py b/src/shellrent_sdk/client/models/service_paginated_list_response.py new file mode 100644 index 0000000..f8a40f3 --- /dev/null +++ b/src/shellrent_sdk/client/models/service_paginated_list_response.py @@ -0,0 +1,99 @@ +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.pagination_meta import PaginationMeta + from ..models.service import Service + + +T = TypeVar("T", bound="ServicePaginatedListResponse") + + +@_attrs_define +class ServicePaginatedListResponse: + error: int + message: None | str + data: list[Service] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.pagination_meta import PaginationMeta + from ..models.service import Service + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = Service.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + service_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + service_paginated_list_response.additional_properties = d + return service_paginated_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/service_server.py b/src/shellrent_sdk/client/models/service_server.py new file mode 100644 index 0000000..308bbc5 --- /dev/null +++ b/src/shellrent_sdk/client/models/service_server.py @@ -0,0 +1,318 @@ +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 + from ..models.recurrence import Recurrence + from ..models.server_template import ServerTemplate + from ..models.service_category import ServiceCategory + + +T = TypeVar("T", bound="ServiceServer") + + +@_attrs_define +class ServiceServer: + service_id: int + service_category: ServiceCategory + service_name: str + recurrence: Recurrence + recurrences_available: list[Recurrence] + tld_id: int | None + service_code: str + service_url: str + activation_price: Amount + renew_price: Amount | None + restore_price: Amount | None + transfer_price: Amount | None + is_primary: bool | None + is_secondary: bool | None + is_presale: bool | None + is_aftersale: bool | None + is_quantifiable: bool | None + quantity_min: int | None + quantity_max: int | None + templates: list[ServerTemplate] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.amount import Amount + + service_id = self.service_id + + service_category = self.service_category.to_dict() + + service_name = self.service_name + + recurrence = self.recurrence.to_dict() + + recurrences_available = [] + for recurrences_available_item_data in self.recurrences_available: + recurrences_available_item = recurrences_available_item_data.to_dict() + recurrences_available.append(recurrences_available_item) + + tld_id: int | None + tld_id = self.tld_id + + service_code = self.service_code + + service_url = self.service_url + + activation_price = self.activation_price.to_dict() + + renew_price: dict[str, Any] | None + if isinstance(self.renew_price, Amount): + renew_price = self.renew_price.to_dict() + else: + renew_price = self.renew_price + + 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 + + is_primary: bool | None + is_primary = self.is_primary + + is_secondary: bool | None + is_secondary = self.is_secondary + + is_presale: bool | None + is_presale = self.is_presale + + is_aftersale: bool | None + is_aftersale = self.is_aftersale + + is_quantifiable: bool | None + is_quantifiable = self.is_quantifiable + + quantity_min: int | None + quantity_min = self.quantity_min + + quantity_max: int | None + quantity_max = self.quantity_max + + templates = [] + for templates_item_data in self.templates: + templates_item = templates_item_data.to_dict() + templates.append(templates_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "service_id": service_id, + "service_category": service_category, + "service_name": service_name, + "recurrence": recurrence, + "recurrences_available": recurrences_available, + "tld_id": tld_id, + "service_code": service_code, + "service_url": service_url, + "activation_price": activation_price, + "renew_price": renew_price, + "restore_price": restore_price, + "transfer_price": transfer_price, + "is_primary": is_primary, + "is_secondary": is_secondary, + "is_presale": is_presale, + "is_aftersale": is_aftersale, + "is_quantifiable": is_quantifiable, + "quantity_min": quantity_min, + "quantity_max": quantity_max, + "templates": templates, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.amount import Amount + from ..models.recurrence import Recurrence + from ..models.server_template import ServerTemplate + from ..models.service_category import ServiceCategory + + d = dict(src_dict) + service_id = d.pop("service_id") + + service_category = ServiceCategory.from_dict(d.pop("service_category")) + + service_name = d.pop("service_name") + + recurrence = Recurrence.from_dict(d.pop("recurrence")) + + recurrences_available = [] + _recurrences_available = d.pop("recurrences_available") + for recurrences_available_item_data in _recurrences_available: + recurrences_available_item = Recurrence.from_dict(recurrences_available_item_data) + + recurrences_available.append(recurrences_available_item) + + def _parse_tld_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + tld_id = _parse_tld_id(d.pop("tld_id")) + + service_code = d.pop("service_code") + + service_url = d.pop("service_url") + + activation_price = Amount.from_dict(d.pop("activation_price")) + + def _parse_renew_price(data: object) -> Amount | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + renew_price_type_0 = Amount.from_dict(data) + + return renew_price_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(Amount | None, data) + + renew_price = _parse_renew_price(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")) + + def _parse_is_primary(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) + + is_primary = _parse_is_primary(d.pop("is_primary")) + + def _parse_is_secondary(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) + + is_secondary = _parse_is_secondary(d.pop("is_secondary")) + + def _parse_is_presale(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) + + is_presale = _parse_is_presale(d.pop("is_presale")) + + def _parse_is_aftersale(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) + + is_aftersale = _parse_is_aftersale(d.pop("is_aftersale")) + + def _parse_is_quantifiable(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) + + is_quantifiable = _parse_is_quantifiable(d.pop("is_quantifiable")) + + def _parse_quantity_min(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + quantity_min = _parse_quantity_min(d.pop("quantity_min")) + + def _parse_quantity_max(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + quantity_max = _parse_quantity_max(d.pop("quantity_max")) + + templates = [] + _templates = d.pop("templates") + for templates_item_data in _templates: + templates_item = ServerTemplate.from_dict(templates_item_data) + + templates.append(templates_item) + + service_server = cls( + service_id=service_id, + service_category=service_category, + service_name=service_name, + recurrence=recurrence, + recurrences_available=recurrences_available, + tld_id=tld_id, + service_code=service_code, + service_url=service_url, + activation_price=activation_price, + renew_price=renew_price, + restore_price=restore_price, + transfer_price=transfer_price, + is_primary=is_primary, + is_secondary=is_secondary, + is_presale=is_presale, + is_aftersale=is_aftersale, + is_quantifiable=is_quantifiable, + quantity_min=quantity_min, + quantity_max=quantity_max, + templates=templates, + ) + + service_server.additional_properties = d + return service_server + + @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/service_server_list_response.py b/src/shellrent_sdk/client/models/service_server_list_response.py new file mode 100644 index 0000000..56ab149 --- /dev/null +++ b/src/shellrent_sdk/client/models/service_server_list_response.py @@ -0,0 +1,122 @@ +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.service_server import ServiceServer + from ..models.service_server_list_response_meta_type_0 import ServiceServerListResponseMetaType0 + + +T = TypeVar("T", bound="ServiceServerListResponse") + + +@_attrs_define +class ServiceServerListResponse: + error: int + message: None | str + data: list[ServiceServer] + meta: None | ServiceServerListResponseMetaType0 + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.service_server_list_response_meta_type_0 import ( + ServiceServerListResponseMetaType0, + ) + + error = self.error + + 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) + + meta: dict[str, Any] | None + if isinstance(self.meta, ServiceServerListResponseMetaType0): + 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.service_server import ServiceServer + from ..models.service_server_list_response_meta_type_0 import ( + ServiceServerListResponseMetaType0, + ) + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = ServiceServer.from_dict(data_item_data) + + data.append(data_item) + + def _parse_meta(data: object) -> None | ServiceServerListResponseMetaType0: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + meta_type_0 = ServiceServerListResponseMetaType0.from_dict(data) + + return meta_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | ServiceServerListResponseMetaType0, data) + + meta = _parse_meta(d.pop("meta")) + + service_server_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + service_server_list_response.additional_properties = d + return service_server_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/service_server_list_response_meta_type_0.py b/src/shellrent_sdk/client/models/service_server_list_response_meta_type_0.py new file mode 100644 index 0000000..4305e65 --- /dev/null +++ b/src/shellrent_sdk/client/models/service_server_list_response_meta_type_0.py @@ -0,0 +1,45 @@ +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="ServiceServerListResponseMetaType0") + + +@_attrs_define +class ServiceServerListResponseMetaType0: + 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) + service_server_list_response_meta_type_0 = cls() + + service_server_list_response_meta_type_0.additional_properties = d + return service_server_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/simple_pagination_meta.py b/src/shellrent_sdk/client/models/simple_pagination_meta.py new file mode 100644 index 0000000..d5dee6b --- /dev/null +++ b/src/shellrent_sdk/client/models/simple_pagination_meta.py @@ -0,0 +1,78 @@ +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="SimplePaginationMeta") + + +@_attrs_define +class SimplePaginationMeta: + count: int + page: int + per_page: int + next_: bool + """ Tells if there is another page after this one """ + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + page = self.page + + per_page = self.per_page + + next_ = self.next_ + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + "page": page, + "per_page": per_page, + "next": next_, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + count = d.pop("count") + + page = d.pop("page") + + per_page = d.pop("per_page") + + next_ = d.pop("next") + + simple_pagination_meta = cls( + count=count, + page=page, + per_page=per_page, + next_=next_, + ) + + simple_pagination_meta.additional_properties = d + return simple_pagination_meta + + @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.py b/src/shellrent_sdk/client/models/sms.py new file mode 100644 index 0000000..a172ced --- /dev/null +++ b/src/shellrent_sdk/client/models/sms.py @@ -0,0 +1,189 @@ +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="Sms") + + +@_attrs_define +class Sms: + id: int + quality: str + status: str + sender: None | str + message: None | str + send_from: datetime.datetime | None + date_approved: datetime.datetime | None + stop_date: datetime.datetime | None + sms_count: int | None + date_created: datetime.datetime + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + quality = self.quality + + status = self.status + + sender: None | str + sender = self.sender + + message: None | str + message = self.message + + send_from: None | str + if isinstance(self.send_from, datetime.datetime): + send_from = self.send_from.isoformat() + else: + send_from = self.send_from + + date_approved: None | str + if isinstance(self.date_approved, datetime.datetime): + date_approved = self.date_approved.isoformat() + else: + date_approved = self.date_approved + + stop_date: None | str + if isinstance(self.stop_date, datetime.datetime): + stop_date = self.stop_date.isoformat() + else: + stop_date = self.stop_date + + sms_count: int | None + sms_count = self.sms_count + + date_created = self.date_created.isoformat() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "quality": quality, + "status": status, + "sender": sender, + "message": message, + "send_from": send_from, + "date_approved": date_approved, + "stop_date": stop_date, + "sms_count": sms_count, + "date_created": date_created, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + id = d.pop("id") + + quality = d.pop("quality") + + status = d.pop("status") + + 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_message(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + message = _parse_message(d.pop("message")) + + def _parse_send_from(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + send_from_type_0 = datetime.datetime.fromisoformat(data) + + return send_from_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + send_from = _parse_send_from(d.pop("send_from")) + + def _parse_date_approved(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + date_approved_type_0 = datetime.datetime.fromisoformat(data) + + return date_approved_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + date_approved = _parse_date_approved(d.pop("date_approved")) + + def _parse_stop_date(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + stop_date_type_0 = datetime.datetime.fromisoformat(data) + + return stop_date_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + stop_date = _parse_stop_date(d.pop("stop_date")) + + def _parse_sms_count(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + sms_count = _parse_sms_count(d.pop("sms_count")) + + date_created = datetime.datetime.fromisoformat(d.pop("date_created")) + + sms = cls( + id=id, + quality=quality, + status=status, + sender=sender, + message=message, + send_from=send_from, + date_approved=date_approved, + stop_date=stop_date, + sms_count=sms_count, + date_created=date_created, + ) + + sms.additional_properties = d + return sms + + @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_account.py b/src/shellrent_sdk/client/models/sms_account.py new file mode 100644 index 0000000..b296422 --- /dev/null +++ b/src/shellrent_sdk/client/models/sms_account.py @@ -0,0 +1,78 @@ +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 + +if TYPE_CHECKING: + from ..models.amount_simple import AmountSimple + + +T = TypeVar("T", bound="SmsAccount") + + +@_attrs_define +class SmsAccount: + credit: AmountSimple + sms_standard: int + """ Estimated number of SMS messages available with "STANDARD" quality if sent to Italy """ + sms_premium: int + """ Estimated number of SMS messages available with "PREMIUM" quality if sent to Italy """ + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + credit = self.credit.to_dict() + + sms_standard = self.sms_standard + + sms_premium = self.sms_premium + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "credit": credit, + "sms_standard": sms_standard, + "sms_premium": sms_premium, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.amount_simple import AmountSimple + + d = dict(src_dict) + credit = AmountSimple.from_dict(d.pop("credit")) + + sms_standard = d.pop("sms_standard") + + sms_premium = d.pop("sms_premium") + + sms_account = cls( + credit=credit, + sms_standard=sms_standard, + sms_premium=sms_premium, + ) + + sms_account.additional_properties = d + return sms_account + + @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_account_response.py b/src/shellrent_sdk/client/models/sms_account_response.py new file mode 100644 index 0000000..037de6a --- /dev/null +++ b/src/shellrent_sdk/client/models/sms_account_response.py @@ -0,0 +1,112 @@ +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.sms_account import SmsAccount + from ..models.sms_account_response_meta_type_0 import SmsAccountResponseMetaType0 + + +T = TypeVar("T", bound="SmsAccountResponse") + + +@_attrs_define +class SmsAccountResponse: + error: int + message: None | str + data: SmsAccount + meta: None | SmsAccountResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, SmsAccountResponseMetaType0): + 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.sms_account import SmsAccount + from ..models.sms_account_response_meta_type_0 import ( + SmsAccountResponseMetaType0, + ) + + 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 = 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")) + + sms_account_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + sms_account_response.additional_properties = d + return sms_account_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/sms_account_response_meta_type_0.py b/src/shellrent_sdk/client/models/sms_account_response_meta_type_0.py new file mode 100644 index 0000000..2eacbf9 --- /dev/null +++ b/src/shellrent_sdk/client/models/sms_account_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..bea2925 --- /dev/null +++ b/src/shellrent_sdk/client/models/sms_can_cancel.py @@ -0,0 +1,63 @@ +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="SmsCanCancel") + + +@_attrs_define +class SmsCanCancel: + sms_id: int + can_cancel: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + sms_id = self.sms_id + + can_cancel = self.can_cancel + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "sms_id": sms_id, + "can_cancel": can_cancel, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + sms_id = d.pop("sms_id") + + can_cancel = d.pop("can_cancel") + + sms_can_cancel = cls( + sms_id=sms_id, + can_cancel=can_cancel, + ) + + sms_can_cancel.additional_properties = d + return sms_can_cancel + + @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_response.py b/src/shellrent_sdk/client/models/sms_can_cancel_response.py new file mode 100644 index 0000000..4f88aa5 --- /dev/null +++ b/src/shellrent_sdk/client/models/sms_can_cancel_response.py @@ -0,0 +1,112 @@ +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.sms_can_cancel import SmsCanCancel + from ..models.sms_can_cancel_response_meta_type_0 import SmsCanCancelResponseMetaType0 + + +T = TypeVar("T", bound="SmsCanCancelResponse") + + +@_attrs_define +class SmsCanCancelResponse: + error: int + message: None | str + data: SmsCanCancel + meta: None | SmsCanCancelResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, SmsCanCancelResponseMetaType0): + 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.sms_can_cancel import SmsCanCancel + from ..models.sms_can_cancel_response_meta_type_0 import ( + SmsCanCancelResponseMetaType0, + ) + + 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 = 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")) + + sms_can_cancel_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + sms_can_cancel_response.additional_properties = d + return sms_can_cancel_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/sms_can_cancel_response_meta_type_0.py b/src/shellrent_sdk/client/models/sms_can_cancel_response_meta_type_0.py new file mode 100644 index 0000000..bb5db98 --- /dev/null +++ b/src/shellrent_sdk/client/models/sms_can_cancel_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..370d4c6 --- /dev/null +++ b/src/shellrent_sdk/client/models/sms_can_delete.py @@ -0,0 +1,63 @@ +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="SmsCanDelete") + + +@_attrs_define +class SmsCanDelete: + sms_id: int + can_delete: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + sms_id = self.sms_id + + can_delete = self.can_delete + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "sms_id": sms_id, + "can_delete": can_delete, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + sms_id = d.pop("sms_id") + + can_delete = d.pop("can_delete") + + sms_can_delete = cls( + sms_id=sms_id, + can_delete=can_delete, + ) + + sms_can_delete.additional_properties = d + return sms_can_delete + + @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_response.py b/src/shellrent_sdk/client/models/sms_can_delete_response.py new file mode 100644 index 0000000..21ef22b --- /dev/null +++ b/src/shellrent_sdk/client/models/sms_can_delete_response.py @@ -0,0 +1,112 @@ +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.sms_can_delete import SmsCanDelete + from ..models.sms_can_delete_response_meta_type_0 import SmsCanDeleteResponseMetaType0 + + +T = TypeVar("T", bound="SmsCanDeleteResponse") + + +@_attrs_define +class SmsCanDeleteResponse: + error: int + message: None | str + data: SmsCanDelete + meta: None | SmsCanDeleteResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, SmsCanDeleteResponseMetaType0): + 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.sms_can_delete import SmsCanDelete + from ..models.sms_can_delete_response_meta_type_0 import ( + SmsCanDeleteResponseMetaType0, + ) + + 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 = 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")) + + sms_can_delete_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + sms_can_delete_response.additional_properties = d + return sms_can_delete_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/sms_can_delete_response_meta_type_0.py b/src/shellrent_sdk/client/models/sms_can_delete_response_meta_type_0.py new file mode 100644 index 0000000..d21b6df --- /dev/null +++ b/src/shellrent_sdk/client/models/sms_can_delete_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..45d2a8a --- /dev/null +++ b/src/shellrent_sdk/client/models/sms_create_request.py @@ -0,0 +1,127 @@ +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 + +from ..models.sms_create_request_quality import SmsCreateRequestQuality +from ..types import UNSET, Unset + +T = TypeVar("T", bound="SmsCreateRequest") + + +@_attrs_define +class SmsCreateRequest: + """Sends an SMS. Recipients: provide exactly one of phone_numbers or phonebooks, not both. Sender: required when + quality is PREMIUM (from 2 to 11 characters), ignored when quality is STANDARD. + + """ + + message: str + """ Text of the SMS you want to send. It can contain emojis, but keep in mind that emojis take up more + characters. GSM-7: max 160 chars (153 per part if concatenated). Unicode (UCS-2): max 70 chars (67 per part if + concatenated). """ + quality: SmsCreateRequestQuality + """ SMS delivery quality. PREMIUM requires sender. """ + phone_numbers: list[str] | Unset = UNSET + """ SMS recipients (mutually exclusive). Provide exactly one of: "phone_numbers" or "phonebooks". Collection of + one or more phone numbers in international format using the "00" prefix (digits only, no spaces/separators). + Example: 00393331122444. """ + phonebooks: list[int] | Unset = UNSET + """ SMS recipients (mutually exclusive). Provide exactly one of: "phone_numbers" or "phonebooks". Collection of + one or more phonebook IDs. """ + sender: str | Unset = UNSET + """ 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) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + quality = self.quality.value + + phone_numbers: list[str] | Unset = UNSET + if not isinstance(self.phone_numbers, Unset): + phone_numbers = self.phone_numbers + + phonebooks: list[int] | Unset = UNSET + if not isinstance(self.phonebooks, Unset): + phonebooks = self.phonebooks + + sender = self.sender + + send_date: str | Unset = UNSET + if not isinstance(self.send_date, Unset): + send_date = self.send_date.isoformat() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "message": message, + "quality": quality, + } + ) + if phone_numbers is not UNSET: + field_dict["phone_numbers"] = phone_numbers + if phonebooks is not UNSET: + field_dict["phonebooks"] = phonebooks + if sender is not UNSET: + field_dict["sender"] = sender + if send_date is not UNSET: + field_dict["send_date"] = send_date + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + message = d.pop("message") + + quality = SmsCreateRequestQuality(d.pop("quality")) + + phone_numbers = cast(list[str], d.pop("phone_numbers", UNSET)) + + phonebooks = cast(list[int], d.pop("phonebooks", UNSET)) + + sender = d.pop("sender", UNSET) + + _send_date = d.pop("send_date", UNSET) + send_date: datetime.datetime | Unset + if isinstance(_send_date, Unset): + send_date = UNSET + else: + send_date = datetime.datetime.fromisoformat(_send_date) + + sms_create_request = cls( + message=message, + quality=quality, + phone_numbers=phone_numbers, + phonebooks=phonebooks, + sender=sender, + 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_create_request_quality.py b/src/shellrent_sdk/client/models/sms_create_request_quality.py new file mode 100644 index 0000000..3313e01 --- /dev/null +++ b/src/shellrent_sdk/client/models/sms_create_request_quality.py @@ -0,0 +1,9 @@ +from enum import StrEnum + + +class SmsCreateRequestQuality(StrEnum): + PREMIUM = "PREMIUM" + STANDARD = "STANDARD" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/shellrent_sdk/client/models/sms_message.py b/src/shellrent_sdk/client/models/sms_message.py new file mode 100644 index 0000000..90668ee --- /dev/null +++ b/src/shellrent_sdk/client/models/sms_message.py @@ -0,0 +1,169 @@ +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 + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.sms_price import SmsPrice + + +T = TypeVar("T", bound="SmsMessage") + + +@_attrs_define +class SmsMessage: + id: int + sms_id: int + contact_name: None | str + phone_number: str + date_sent: datetime.datetime | None + date_delivered: datetime.datetime | None + 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]: + id = self.id + + sms_id = self.sms_id + + contact_name: None | str + contact_name = self.contact_name + + phone_number = self.phone_number + + date_sent: None | str + if isinstance(self.date_sent, datetime.datetime): + date_sent = self.date_sent.isoformat() + else: + date_sent = self.date_sent + + date_delivered: None | str + if isinstance(self.date_delivered, datetime.datetime): + date_delivered = self.date_delivered.isoformat() + else: + date_delivered = self.date_delivered + + 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, + "contact_name": contact_name, + "phone_number": phone_number, + "date_sent": date_sent, + "date_delivered": date_delivered, + "error": error, + } + ) + if sms_price is not UNSET: + field_dict["sms_price"] = sms_price + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.sms_price import SmsPrice + + d = dict(src_dict) + id = d.pop("id") + + sms_id = d.pop("sms_id") + + def _parse_contact_name(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + contact_name = _parse_contact_name(d.pop("contact_name")) + + phone_number = d.pop("phone_number") + + def _parse_date_sent(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + date_sent_type_0 = datetime.datetime.fromisoformat(data) + + return date_sent_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + date_sent = _parse_date_sent(d.pop("date_sent")) + + def _parse_date_delivered(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + date_delivered_type_0 = datetime.datetime.fromisoformat(data) + + return date_delivered_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + date_delivered = _parse_date_delivered(d.pop("date_delivered")) + + def _parse_error(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + 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, + 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 + return sms_message + + @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_paginated_list_response.py b/src/shellrent_sdk/client/models/sms_message_paginated_list_response.py new file mode 100644 index 0000000..ff76f77 --- /dev/null +++ b/src/shellrent_sdk/client/models/sms_message_paginated_list_response.py @@ -0,0 +1,99 @@ +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.pagination_meta import PaginationMeta + from ..models.sms_message import SmsMessage + + +T = TypeVar("T", bound="SmsMessagePaginatedListResponse") + + +@_attrs_define +class SmsMessagePaginatedListResponse: + error: int + message: None | str + data: list[SmsMessage] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.pagination_meta import PaginationMeta + from ..models.sms_message import SmsMessage + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = SmsMessage.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + sms_message_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + sms_message_paginated_list_response.additional_properties = d + return sms_message_paginated_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/sms_message_response.py b/src/shellrent_sdk/client/models/sms_message_response.py new file mode 100644 index 0000000..34932e9 --- /dev/null +++ b/src/shellrent_sdk/client/models/sms_message_response.py @@ -0,0 +1,112 @@ +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.sms_message import SmsMessage + from ..models.sms_message_response_meta_type_0 import SmsMessageResponseMetaType0 + + +T = TypeVar("T", bound="SmsMessageResponse") + + +@_attrs_define +class SmsMessageResponse: + error: int + message: None | str + data: SmsMessage + meta: None | SmsMessageResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, SmsMessageResponseMetaType0): + 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.sms_message import SmsMessage + from ..models.sms_message_response_meta_type_0 import ( + SmsMessageResponseMetaType0, + ) + + 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 = 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")) + + sms_message_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + sms_message_response.additional_properties = d + return sms_message_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/sms_message_response_meta_type_0.py b/src/shellrent_sdk/client/models/sms_message_response_meta_type_0.py new file mode 100644 index 0000000..9858fad --- /dev/null +++ b/src/shellrent_sdk/client/models/sms_message_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..8cd8923 --- /dev/null +++ b/src/shellrent_sdk/client/models/sms_paginated_list_response.py @@ -0,0 +1,99 @@ +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.pagination_meta import PaginationMeta + from ..models.sms import Sms + + +T = TypeVar("T", bound="SmsPaginatedListResponse") + + +@_attrs_define +class SmsPaginatedListResponse: + error: int + message: None | str + data: list[Sms] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.pagination_meta import PaginationMeta + from ..models.sms import Sms + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = Sms.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + sms_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + sms_paginated_list_response.additional_properties = d + return sms_paginated_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/sms_phonebook.py b/src/shellrent_sdk/client/models/sms_phonebook.py new file mode 100644 index 0000000..0a28cd8 --- /dev/null +++ b/src/shellrent_sdk/client/models/sms_phonebook.py @@ -0,0 +1,76 @@ +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="SmsPhonebook") + + +@_attrs_define +class SmsPhonebook: + id: int + name: None | str + contacts_count: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name: None | str + name = self.name + + contacts_count = self.contacts_count + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "name": name, + "contacts_count": contacts_count, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + id = d.pop("id") + + def _parse_name(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + name = _parse_name(d.pop("name")) + + contacts_count = d.pop("contacts_count") + + sms_phonebook = cls( + id=id, + name=name, + contacts_count=contacts_count, + ) + + sms_phonebook.additional_properties = d + return sms_phonebook + + @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_add_contacts_request.py b/src/shellrent_sdk/client/models/sms_phonebook_add_contacts_request.py new file mode 100644 index 0000000..50c3dbb --- /dev/null +++ b/src/shellrent_sdk/client/models/sms_phonebook_add_contacts_request.py @@ -0,0 +1,77 @@ +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 + +if TYPE_CHECKING: + from ..models.sms_phonebook_add_contacts_request_phone_numbers_item import ( + SmsPhonebookAddContactsRequestPhoneNumbersItem, + ) + + +T = TypeVar("T", bound="SmsPhonebookAddContactsRequest") + + +@_attrs_define +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 = [] + for phone_numbers_item_data in self.phone_numbers: + phone_numbers_item = phone_numbers_item_data.to_dict() + phone_numbers.append(phone_numbers_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "phone_numbers": phone_numbers, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.sms_phonebook_add_contacts_request_phone_numbers_item import ( + SmsPhonebookAddContactsRequestPhoneNumbersItem, + ) + + d = dict(src_dict) + phone_numbers = [] + _phone_numbers = d.pop("phone_numbers") + for phone_numbers_item_data in _phone_numbers: + phone_numbers_item = SmsPhonebookAddContactsRequestPhoneNumbersItem.from_dict( + phone_numbers_item_data + ) + + phone_numbers.append(phone_numbers_item) + + sms_phonebook_add_contacts_request = cls( + 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_add_contacts_request_phone_numbers_item.py b/src/shellrent_sdk/client/models/sms_phonebook_add_contacts_request_phone_numbers_item.py new file mode 100644 index 0000000..f25d325 --- /dev/null +++ b/src/shellrent_sdk/client/models/sms_phonebook_add_contacts_request_phone_numbers_item.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +import datetime +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 + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="SmsPhonebookAddContactsRequestPhoneNumbersItem") + + +@_attrs_define +class SmsPhonebookAddContactsRequestPhoneNumbersItem: + phone_number: str + """ Phone number format: international format using the "00" prefix (digits only, no spaces/separators). + Example: 00393331122444. """ + name: str | Unset = UNSET + surname: str | Unset = UNSET + birth_date: datetime.date | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + phone_number = self.phone_number + + name = self.name + + surname = self.surname + + birth_date: str | Unset = UNSET + if not isinstance(self.birth_date, Unset): + birth_date = self.birth_date.isoformat() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "phone_number": phone_number, + } + ) + if name is not UNSET: + field_dict["name"] = name + if surname is not UNSET: + field_dict["surname"] = surname + if birth_date is not UNSET: + field_dict["birth_date"] = birth_date + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + phone_number = d.pop("phone_number") + + name = d.pop("name", UNSET) + + surname = d.pop("surname", UNSET) + + _birth_date = d.pop("birth_date", UNSET) + birth_date: datetime.date | Unset + if isinstance(_birth_date, Unset): + birth_date = UNSET + else: + birth_date = datetime.date.fromisoformat(_birth_date) + + sms_phonebook_add_contacts_request_phone_numbers_item = cls( + phone_number=phone_number, + name=name, + surname=surname, + birth_date=birth_date, + ) + + sms_phonebook_add_contacts_request_phone_numbers_item.additional_properties = d + return sms_phonebook_add_contacts_request_phone_numbers_item + + @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 new file mode 100644 index 0000000..f8f3500 --- /dev/null +++ b/src/shellrent_sdk/client/models/sms_phonebook_contact.py @@ -0,0 +1,134 @@ +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.country import Country + + +T = TypeVar("T", bound="SmsPhonebookContact") + + +@_attrs_define +class SmsPhonebookContact: + id: int + phonebooks: list[int] + country: Country + phone_number: str + name: None | str + surname: None | str + birth_date: datetime.date | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + phonebooks = self.phonebooks + + country = self.country.to_dict() + + phone_number = self.phone_number + + name: None | str + name = self.name + + surname: None | str + surname = self.surname + + birth_date: None | str + if isinstance(self.birth_date, datetime.date): + birth_date = self.birth_date.isoformat() + else: + birth_date = self.birth_date + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "phonebooks": phonebooks, + "country": country, + "phone_number": phone_number, + "name": name, + "surname": surname, + "birth_date": birth_date, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.country import Country + + d = dict(src_dict) + id = d.pop("id") + + phonebooks = cast(list[int], d.pop("phonebooks")) + + country = Country.from_dict(d.pop("country")) + + phone_number = d.pop("phone_number") + + def _parse_name(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + name = _parse_name(d.pop("name")) + + def _parse_surname(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + surname = _parse_surname(d.pop("surname")) + + def _parse_birth_date(data: object) -> datetime.date | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + birth_date_type_0 = datetime.date.fromisoformat(data) + + return birth_date_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.date | None, data) + + birth_date = _parse_birth_date(d.pop("birth_date")) + + sms_phonebook_contact = cls( + id=id, + phonebooks=phonebooks, + country=country, + phone_number=phone_number, + name=name, + surname=surname, + birth_date=birth_date, + ) + + sms_phonebook_contact.additional_properties = d + return sms_phonebook_contact + + @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_paginated_list_response.py b/src/shellrent_sdk/client/models/sms_phonebook_contact_paginated_list_response.py new file mode 100644 index 0000000..3c5176c --- /dev/null +++ b/src/shellrent_sdk/client/models/sms_phonebook_contact_paginated_list_response.py @@ -0,0 +1,99 @@ +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.pagination_meta import PaginationMeta + from ..models.sms_phonebook_contact import SmsPhonebookContact + + +T = TypeVar("T", bound="SmsPhonebookContactPaginatedListResponse") + + +@_attrs_define +class SmsPhonebookContactPaginatedListResponse: + error: int + message: None | str + data: list[SmsPhonebookContact] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.pagination_meta import PaginationMeta + from ..models.sms_phonebook_contact import SmsPhonebookContact + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = SmsPhonebookContact.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + sms_phonebook_contact_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + sms_phonebook_contact_paginated_list_response.additional_properties = d + return sms_phonebook_contact_paginated_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/sms_phonebook_create_request.py b/src/shellrent_sdk/client/models/sms_phonebook_create_request.py new file mode 100644 index 0000000..7c7c281 --- /dev/null +++ b/src/shellrent_sdk/client/models/sms_phonebook_create_request.py @@ -0,0 +1,92 @@ +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.sms_phonebook_create_request_phone_numbers_item import ( + SmsPhonebookCreateRequestPhoneNumbersItem, + ) + + +T = TypeVar("T", bound="SmsPhonebookCreateRequest") + + +@_attrs_define +class SmsPhonebookCreateRequest: + name: str + """ 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 + + phone_numbers: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.phone_numbers, Unset): + phone_numbers = [] + for phone_numbers_item_data in self.phone_numbers: + phone_numbers_item = phone_numbers_item_data.to_dict() + phone_numbers.append(phone_numbers_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "name": name, + } + ) + if phone_numbers is not UNSET: + field_dict["phone_numbers"] = phone_numbers + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.sms_phonebook_create_request_phone_numbers_item import ( + SmsPhonebookCreateRequestPhoneNumbersItem, + ) + + d = dict(src_dict) + name = d.pop("name") + + _phone_numbers = d.pop("phone_numbers", UNSET) + phone_numbers: list[SmsPhonebookCreateRequestPhoneNumbersItem] | Unset = UNSET + if _phone_numbers is not UNSET: + phone_numbers = [] + for phone_numbers_item_data in _phone_numbers: + phone_numbers_item = SmsPhonebookCreateRequestPhoneNumbersItem.from_dict( + phone_numbers_item_data + ) + + phone_numbers.append(phone_numbers_item) + + sms_phonebook_create_request = cls( + name=name, + 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_create_request_phone_numbers_item.py b/src/shellrent_sdk/client/models/sms_phonebook_create_request_phone_numbers_item.py new file mode 100644 index 0000000..6b30ed7 --- /dev/null +++ b/src/shellrent_sdk/client/models/sms_phonebook_create_request_phone_numbers_item.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +import datetime +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 + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="SmsPhonebookCreateRequestPhoneNumbersItem") + + +@_attrs_define +class SmsPhonebookCreateRequestPhoneNumbersItem: + phone_number: str + """ Phone number format: international format using the "00" prefix (digits only, no spaces/separators). + Example: 00393331122444. """ + name: str | Unset = UNSET + surname: str | Unset = UNSET + birth_date: datetime.date | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + phone_number = self.phone_number + + name = self.name + + surname = self.surname + + birth_date: str | Unset = UNSET + if not isinstance(self.birth_date, Unset): + birth_date = self.birth_date.isoformat() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "phone_number": phone_number, + } + ) + if name is not UNSET: + field_dict["name"] = name + if surname is not UNSET: + field_dict["surname"] = surname + if birth_date is not UNSET: + field_dict["birth_date"] = birth_date + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + phone_number = d.pop("phone_number") + + name = d.pop("name", UNSET) + + surname = d.pop("surname", UNSET) + + _birth_date = d.pop("birth_date", UNSET) + birth_date: datetime.date | Unset + if isinstance(_birth_date, Unset): + birth_date = UNSET + else: + birth_date = datetime.date.fromisoformat(_birth_date) + + sms_phonebook_create_request_phone_numbers_item = cls( + phone_number=phone_number, + name=name, + surname=surname, + birth_date=birth_date, + ) + + sms_phonebook_create_request_phone_numbers_item.additional_properties = d + return sms_phonebook_create_request_phone_numbers_item + + @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 new file mode 100644 index 0000000..ebd210e --- /dev/null +++ b/src/shellrent_sdk/client/models/sms_phonebook_edit_request.py @@ -0,0 +1,57 @@ +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="SmsPhonebookEditRequest") + + +@_attrs_define +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, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + name = d.pop("name") + + sms_phonebook_edit_request = cls( + 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 new file mode 100644 index 0000000..6a661b7 --- /dev/null +++ b/src/shellrent_sdk/client/models/sms_phonebook_paginated_list_response.py @@ -0,0 +1,99 @@ +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.pagination_meta import PaginationMeta + from ..models.sms_phonebook import SmsPhonebook + + +T = TypeVar("T", bound="SmsPhonebookPaginatedListResponse") + + +@_attrs_define +class SmsPhonebookPaginatedListResponse: + error: int + message: None | str + data: list[SmsPhonebook] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.pagination_meta import PaginationMeta + from ..models.sms_phonebook import SmsPhonebook + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = SmsPhonebook.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + sms_phonebook_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + sms_phonebook_paginated_list_response.additional_properties = d + return sms_phonebook_paginated_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/sms_phonebook_response.py b/src/shellrent_sdk/client/models/sms_phonebook_response.py new file mode 100644 index 0000000..aca27d8 --- /dev/null +++ b/src/shellrent_sdk/client/models/sms_phonebook_response.py @@ -0,0 +1,112 @@ +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.sms_phonebook import SmsPhonebook + from ..models.sms_phonebook_response_meta_type_0 import SmsPhonebookResponseMetaType0 + + +T = TypeVar("T", bound="SmsPhonebookResponse") + + +@_attrs_define +class SmsPhonebookResponse: + error: int + message: None | str + data: SmsPhonebook + meta: None | SmsPhonebookResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, SmsPhonebookResponseMetaType0): + 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.sms_phonebook import SmsPhonebook + from ..models.sms_phonebook_response_meta_type_0 import ( + SmsPhonebookResponseMetaType0, + ) + + 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 = 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")) + + sms_phonebook_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + sms_phonebook_response.additional_properties = d + return sms_phonebook_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/sms_phonebook_response_meta_type_0.py b/src/shellrent_sdk/client/models/sms_phonebook_response_meta_type_0.py new file mode 100644 index 0000000..943e09a --- /dev/null +++ b/src/shellrent_sdk/client/models/sms_phonebook_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..d256d0c --- /dev/null +++ b/src/shellrent_sdk/client/models/sms_price.py @@ -0,0 +1,103 @@ +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.amount import Amount + from ..models.country import Country + + +T = TypeVar("T", bound="SmsPrice") + + +@_attrs_define +class SmsPrice: + country: Country + standard_price: Amount + premium_price: Amount + valid_from: datetime.datetime | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + country = self.country.to_dict() + + standard_price = self.standard_price.to_dict() + + premium_price = self.premium_price.to_dict() + + valid_from: None | str + if isinstance(self.valid_from, datetime.datetime): + valid_from = self.valid_from.isoformat() + else: + valid_from = self.valid_from + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "country": country, + "standard_price": standard_price, + "premium_price": premium_price, + "valid_from": valid_from, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.amount import Amount + from ..models.country import Country + + d = dict(src_dict) + country = Country.from_dict(d.pop("country")) + + standard_price = Amount.from_dict(d.pop("standard_price")) + + premium_price = Amount.from_dict(d.pop("premium_price")) + + def _parse_valid_from(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + valid_from_type_0 = datetime.datetime.fromisoformat(data) + + return valid_from_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + valid_from = _parse_valid_from(d.pop("valid_from")) + + sms_price = cls( + country=country, + standard_price=standard_price, + premium_price=premium_price, + valid_from=valid_from, + ) + + sms_price.additional_properties = d + return sms_price + + @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_paginated_list_response.py b/src/shellrent_sdk/client/models/sms_price_paginated_list_response.py new file mode 100644 index 0000000..09dd056 --- /dev/null +++ b/src/shellrent_sdk/client/models/sms_price_paginated_list_response.py @@ -0,0 +1,99 @@ +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.pagination_meta import PaginationMeta + from ..models.sms_price import SmsPrice + + +T = TypeVar("T", bound="SmsPricePaginatedListResponse") + + +@_attrs_define +class SmsPricePaginatedListResponse: + error: int + message: None | str + data: list[SmsPrice] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.pagination_meta import PaginationMeta + from ..models.sms_price import SmsPrice + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = SmsPrice.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + sms_price_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + sms_price_paginated_list_response.additional_properties = d + return sms_price_paginated_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/sms_price_response.py b/src/shellrent_sdk/client/models/sms_price_response.py new file mode 100644 index 0000000..82e9aa7 --- /dev/null +++ b/src/shellrent_sdk/client/models/sms_price_response.py @@ -0,0 +1,112 @@ +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.sms_price import SmsPrice + from ..models.sms_price_response_meta_type_0 import SmsPriceResponseMetaType0 + + +T = TypeVar("T", bound="SmsPriceResponse") + + +@_attrs_define +class SmsPriceResponse: + error: int + message: None | str + data: SmsPrice + meta: None | SmsPriceResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, SmsPriceResponseMetaType0): + 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.sms_price import SmsPrice + from ..models.sms_price_response_meta_type_0 import ( + SmsPriceResponseMetaType0, + ) + + 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 = 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")) + + sms_price_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + sms_price_response.additional_properties = d + return sms_price_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/sms_price_response_meta_type_0.py b/src/shellrent_sdk/client/models/sms_price_response_meta_type_0.py new file mode 100644 index 0000000..ed306f0 --- /dev/null +++ b/src/shellrent_sdk/client/models/sms_price_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..27b6a0c --- /dev/null +++ b/src/shellrent_sdk/client/models/sms_response.py @@ -0,0 +1,110 @@ +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.sms import Sms + from ..models.sms_response_meta_type_0 import SmsResponseMetaType0 + + +T = TypeVar("T", bound="SmsResponse") + + +@_attrs_define +class SmsResponse: + error: int + message: None | str + data: Sms + meta: None | SmsResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, SmsResponseMetaType0): + 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.sms import Sms + from ..models.sms_response_meta_type_0 import SmsResponseMetaType0 + + 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 = 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")) + + sms_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + sms_response.additional_properties = d + return sms_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/sms_response_meta_type_0.py b/src/shellrent_sdk/client/models/sms_response_meta_type_0.py new file mode 100644 index 0000000..83ffb39 --- /dev/null +++ b/src/shellrent_sdk/client/models/sms_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..24a49d4 --- /dev/null +++ b/src/shellrent_sdk/client/models/ssl_certificate.py @@ -0,0 +1,362 @@ +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="SslCertificate") + + +@_attrs_define +class SslCertificate: + ssl_certificate_id: int + purchase_id: int + domain_name: None | str + cn_type: None | str + validation_type: None | str + san_max: int + can_reissue: bool + validation_method: None | str + valid_to: datetime.datetime | None + csr_md5_hash: None | str + csr_sha256_hash: None | str + certificate_status: None | str + approver_email: None | str + admin_first_name: None | str + admin_last_name: None | str + admin_organization: None | str + admin_role: None | str + admin_email: None | str + admin_phone_cc: None | str + admin_phone_number: None | str + admin_address: None | str + admin_city: None | str + admin_state: None | str + admin_postal_code: None | str + admin_country: None | str + 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 + + purchase_id = self.purchase_id + + domain_name: None | str + domain_name = self.domain_name + + cn_type: None | str + cn_type = self.cn_type + + validation_type: None | str + validation_type = self.validation_type + + san_max = self.san_max + + can_reissue = self.can_reissue + + validation_method: None | str + validation_method = self.validation_method + + valid_to: None | str + if isinstance(self.valid_to, datetime.datetime): + valid_to = self.valid_to.isoformat() + else: + valid_to = self.valid_to + + csr_md5_hash: None | str + csr_md5_hash = self.csr_md5_hash + + csr_sha256_hash: None | str + csr_sha256_hash = self.csr_sha256_hash + + certificate_status: None | str + certificate_status = self.certificate_status + + approver_email: None | str + approver_email = self.approver_email + + admin_first_name: None | str + admin_first_name = self.admin_first_name + + admin_last_name: None | str + admin_last_name = self.admin_last_name + + admin_organization: None | str + admin_organization = self.admin_organization + + admin_role: None | str + admin_role = self.admin_role + + admin_email: None | str + admin_email = self.admin_email + + admin_phone_cc: None | str + admin_phone_cc = self.admin_phone_cc + + admin_phone_number: None | str + admin_phone_number = self.admin_phone_number + + admin_address: None | str + admin_address = self.admin_address + + admin_city: None | str + admin_city = self.admin_city + + admin_state: None | str + admin_state = self.admin_state + + admin_postal_code: None | str + admin_postal_code = self.admin_postal_code + + admin_country: None | str + admin_country = self.admin_country + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "ssl_certificate_id": ssl_certificate_id, + "purchase_id": purchase_id, + "domain_name": domain_name, + "cn_type": cn_type, + "validation_type": validation_type, + "san_max": san_max, + "can_reissue": can_reissue, + "validation_method": validation_method, + "valid_to": valid_to, + "csr_md5_hash": csr_md5_hash, + "csr_sha256_hash": csr_sha256_hash, + "certificate_status": certificate_status, + "approver_email": approver_email, + "admin_first_name": admin_first_name, + "admin_last_name": admin_last_name, + "admin_organization": admin_organization, + "admin_role": admin_role, + "admin_email": admin_email, + "admin_phone_cc": admin_phone_cc, + "admin_phone_number": admin_phone_number, + "admin_address": admin_address, + "admin_city": admin_city, + "admin_state": admin_state, + "admin_postal_code": admin_postal_code, + "admin_country": admin_country, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + ssl_certificate_id = d.pop("ssl_certificate_id") + + purchase_id = d.pop("purchase_id") + + def _parse_domain_name(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + domain_name = _parse_domain_name(d.pop("domain_name")) + + def _parse_cn_type(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + cn_type = _parse_cn_type(d.pop("cn_type")) + + def _parse_validation_type(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + validation_type = _parse_validation_type(d.pop("validation_type")) + + san_max = d.pop("san_max") + + can_reissue = d.pop("can_reissue") + + def _parse_validation_method(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + validation_method = _parse_validation_method(d.pop("validation_method")) + + def _parse_valid_to(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + valid_to_type_0 = datetime.datetime.fromisoformat(data) + + return valid_to_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + valid_to = _parse_valid_to(d.pop("valid_to")) + + def _parse_csr_md5_hash(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + csr_md5_hash = _parse_csr_md5_hash(d.pop("csr_md5_hash")) + + def _parse_csr_sha256_hash(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + csr_sha256_hash = _parse_csr_sha256_hash(d.pop("csr_sha256_hash")) + + def _parse_certificate_status(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + certificate_status = _parse_certificate_status(d.pop("certificate_status")) + + def _parse_approver_email(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + approver_email = _parse_approver_email(d.pop("approver_email")) + + def _parse_admin_first_name(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + admin_first_name = _parse_admin_first_name(d.pop("admin_first_name")) + + def _parse_admin_last_name(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + admin_last_name = _parse_admin_last_name(d.pop("admin_last_name")) + + def _parse_admin_organization(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + admin_organization = _parse_admin_organization(d.pop("admin_organization")) + + def _parse_admin_role(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + admin_role = _parse_admin_role(d.pop("admin_role")) + + def _parse_admin_email(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + admin_email = _parse_admin_email(d.pop("admin_email")) + + def _parse_admin_phone_cc(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + admin_phone_cc = _parse_admin_phone_cc(d.pop("admin_phone_cc")) + + def _parse_admin_phone_number(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + admin_phone_number = _parse_admin_phone_number(d.pop("admin_phone_number")) + + def _parse_admin_address(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + admin_address = _parse_admin_address(d.pop("admin_address")) + + def _parse_admin_city(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + admin_city = _parse_admin_city(d.pop("admin_city")) + + def _parse_admin_state(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + admin_state = _parse_admin_state(d.pop("admin_state")) + + def _parse_admin_postal_code(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + admin_postal_code = _parse_admin_postal_code(d.pop("admin_postal_code")) + + def _parse_admin_country(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + admin_country = _parse_admin_country(d.pop("admin_country")) + + ssl_certificate = cls( + ssl_certificate_id=ssl_certificate_id, + purchase_id=purchase_id, + domain_name=domain_name, + cn_type=cn_type, + validation_type=validation_type, + san_max=san_max, + can_reissue=can_reissue, + validation_method=validation_method, + valid_to=valid_to, + csr_md5_hash=csr_md5_hash, + csr_sha256_hash=csr_sha256_hash, + certificate_status=certificate_status, + approver_email=approver_email, + admin_first_name=admin_first_name, + admin_last_name=admin_last_name, + admin_organization=admin_organization, + admin_role=admin_role, + admin_email=admin_email, + admin_phone_cc=admin_phone_cc, + admin_phone_number=admin_phone_number, + admin_address=admin_address, + admin_city=admin_city, + admin_state=admin_state, + admin_postal_code=admin_postal_code, + admin_country=admin_country, + ) + + ssl_certificate.additional_properties = d + return ssl_certificate + + @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_approver_emails.py b/src/shellrent_sdk/client/models/ssl_certificate_approver_emails.py new file mode 100644 index 0000000..bcc7659 --- /dev/null +++ b/src/shellrent_sdk/client/models/ssl_certificate_approver_emails.py @@ -0,0 +1,63 @@ +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="SslCertificateApproverEmails") + + +@_attrs_define +class SslCertificateApproverEmails: + domain_name: str + approver_emails: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + domain_name = self.domain_name + + approver_emails = self.approver_emails + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "domain_name": domain_name, + "approver_emails": approver_emails, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + domain_name = d.pop("domain_name") + + approver_emails = cast(list[str], d.pop("approver_emails")) + + ssl_certificate_approver_emails = cls( + domain_name=domain_name, + approver_emails=approver_emails, + ) + + ssl_certificate_approver_emails.additional_properties = d + return ssl_certificate_approver_emails + + @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_approver_emails_response.py b/src/shellrent_sdk/client/models/ssl_certificate_approver_emails_response.py new file mode 100644 index 0000000..9deb984 --- /dev/null +++ b/src/shellrent_sdk/client/models/ssl_certificate_approver_emails_response.py @@ -0,0 +1,118 @@ +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_approver_emails import SslCertificateApproverEmails + from ..models.ssl_certificate_approver_emails_response_meta_type_0 import ( + SslCertificateApproverEmailsResponseMetaType0, + ) + + +T = TypeVar("T", bound="SslCertificateApproverEmailsResponse") + + +@_attrs_define +class SslCertificateApproverEmailsResponse: + error: int + message: None | str + data: SslCertificateApproverEmails + meta: None | SslCertificateApproverEmailsResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, SslCertificateApproverEmailsResponseMetaType0): + 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_approver_emails import ( + SslCertificateApproverEmails, + ) + from ..models.ssl_certificate_approver_emails_response_meta_type_0 import ( + SslCertificateApproverEmailsResponseMetaType0, + ) + + 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 = 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")) + + ssl_certificate_approver_emails_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + ssl_certificate_approver_emails_response.additional_properties = d + return ssl_certificate_approver_emails_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_approver_emails_response_meta_type_0.py b/src/shellrent_sdk/client/models/ssl_certificate_approver_emails_response_meta_type_0.py new file mode 100644 index 0000000..afa14a2 --- /dev/null +++ b/src/shellrent_sdk/client/models/ssl_certificate_approver_emails_response_meta_type_0.py @@ -0,0 +1,45 @@ +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.py b/src/shellrent_sdk/client/models/ssl_certificate_can_reemit.py new file mode 100644 index 0000000..52b601b --- /dev/null +++ b/src/shellrent_sdk/client/models/ssl_certificate_can_reemit.py @@ -0,0 +1,63 @@ +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="SslCertificateCanReemit") + + +@_attrs_define +class SslCertificateCanReemit: + ssl_certificate_id: int + can_reemit: bool + 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 + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "ssl_certificate_id": ssl_certificate_id, + "can_reemit": can_reemit, + } + ) + + return field_dict + + @classmethod + 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") + + ssl_certificate_can_reemit = cls( + ssl_certificate_id=ssl_certificate_id, + can_reemit=can_reemit, + ) + + ssl_certificate_can_reemit.additional_properties = d + return ssl_certificate_can_reemit + + @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 new file mode 100644 index 0000000..4992060 --- /dev/null +++ b/src/shellrent_sdk/client/models/ssl_certificate_can_reemit_response.py @@ -0,0 +1,116 @@ +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 new file mode 100644 index 0000000..8b6850f --- /dev/null +++ b/src/shellrent_sdk/client/models/ssl_certificate_can_reemit_response_meta_type_0.py @@ -0,0 +1,45 @@ +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_change_csr_request.py b/src/shellrent_sdk/client/models/ssl_certificate_change_csr_request.py new file mode 100644 index 0000000..68fd010 --- /dev/null +++ b/src/shellrent_sdk/client/models/ssl_certificate_change_csr_request.py @@ -0,0 +1,56 @@ +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="SslCertificateChangeCsrRequest") + + +@_attrs_define +class SslCertificateChangeCsrRequest: + csr: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + 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, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + csr = d.pop("csr") + + ssl_certificate_change_csr_request = cls( + 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 new file mode 100644 index 0000000..35f76fe --- /dev/null +++ b/src/shellrent_sdk/client/models/ssl_certificate_export.py @@ -0,0 +1,70 @@ +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="SslCertificateExport") + + +@_attrs_define +class SslCertificateExport: + format_: str + filename: str + content_base64: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + format_ = self.format_ + + filename = self.filename + + content_base64 = self.content_base64 + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "format": format_, + "filename": filename, + "content_base64": content_base64, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + format_ = d.pop("format") + + filename = d.pop("filename") + + content_base64 = d.pop("content_base64") + + ssl_certificate_export = cls( + format_=format_, + filename=filename, + content_base64=content_base64, + ) + + ssl_certificate_export.additional_properties = d + return ssl_certificate_export + + @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_format.py b/src/shellrent_sdk/client/models/ssl_certificate_export_format.py new file mode 100644 index 0000000..a03cad7 --- /dev/null +++ b/src/shellrent_sdk/client/models/ssl_certificate_export_format.py @@ -0,0 +1,97 @@ +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="SslCertificateExportFormat") + + +@_attrs_define +class SslCertificateExportFormat: + format_: str + name: str + description: None | str + filename: str + available: bool + requires_passphrase: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + format_ = self.format_ + + name = self.name + + description: None | str + description = self.description + + filename = self.filename + + available = self.available + + requires_passphrase = self.requires_passphrase + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "format": format_, + "name": name, + "description": description, + "filename": filename, + "available": available, + "requires_passphrase": requires_passphrase, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + format_ = d.pop("format") + + name = d.pop("name") + + def _parse_description(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + description = _parse_description(d.pop("description")) + + filename = d.pop("filename") + + available = d.pop("available") + + requires_passphrase = d.pop("requires_passphrase") + + ssl_certificate_export_format = cls( + format_=format_, + name=name, + description=description, + filename=filename, + available=available, + requires_passphrase=requires_passphrase, + ) + + ssl_certificate_export_format.additional_properties = d + return ssl_certificate_export_format + + @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_format_list_response.py b/src/shellrent_sdk/client/models/ssl_certificate_export_format_list_response.py new file mode 100644 index 0000000..fc55deb --- /dev/null +++ b/src/shellrent_sdk/client/models/ssl_certificate_export_format_list_response.py @@ -0,0 +1,126 @@ +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_export_format import SslCertificateExportFormat + from ..models.ssl_certificate_export_format_list_response_meta_type_0 import ( + SslCertificateExportFormatListResponseMetaType0, + ) + + +T = TypeVar("T", bound="SslCertificateExportFormatListResponse") + + +@_attrs_define +class SslCertificateExportFormatListResponse: + error: int + message: None | str + data: list[SslCertificateExportFormat] + meta: None | SslCertificateExportFormatListResponseMetaType0 + 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 + message = self.message + + data = [] + for data_item_data in self.data: + 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 + + 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_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") + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = SslCertificateExportFormat.from_dict(data_item_data) + + 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")) + + ssl_certificate_export_format_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + ssl_certificate_export_format_list_response.additional_properties = d + return ssl_certificate_export_format_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/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 new file mode 100644 index 0000000..4ceb3ff --- /dev/null +++ b/src/shellrent_sdk/client/models/ssl_certificate_export_format_list_response_meta_type_0.py @@ -0,0 +1,45 @@ +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_response.py b/src/shellrent_sdk/client/models/ssl_certificate_export_response.py new file mode 100644 index 0000000..85d5b5c --- /dev/null +++ b/src/shellrent_sdk/client/models/ssl_certificate_export_response.py @@ -0,0 +1,116 @@ +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_export import SslCertificateExport + from ..models.ssl_certificate_export_response_meta_type_0 import ( + SslCertificateExportResponseMetaType0, + ) + + +T = TypeVar("T", bound="SslCertificateExportResponse") + + +@_attrs_define +class SslCertificateExportResponse: + error: int + message: None | str + data: SslCertificateExport + meta: None | SslCertificateExportResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, SslCertificateExportResponseMetaType0): + 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_export import SslCertificateExport + from ..models.ssl_certificate_export_response_meta_type_0 import ( + SslCertificateExportResponseMetaType0, + ) + + 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 = 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")) + + ssl_certificate_export_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + ssl_certificate_export_response.additional_properties = d + return ssl_certificate_export_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_export_response_meta_type_0.py b/src/shellrent_sdk/client/models/ssl_certificate_export_response_meta_type_0.py new file mode 100644 index 0000000..f2f6045 --- /dev/null +++ b/src/shellrent_sdk/client/models/ssl_certificate_export_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..4988c29 --- /dev/null +++ b/src/shellrent_sdk/client/models/ssl_certificate_key.py @@ -0,0 +1,69 @@ +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="SslCertificateKey") + + +@_attrs_define +class SslCertificateKey: + ssl_certificate_id: int + csr: None | str + 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 + + csr: None | str + csr = self.csr + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "ssl_certificate_id": ssl_certificate_id, + "csr": csr, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + ssl_certificate_id = d.pop("ssl_certificate_id") + + def _parse_csr(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + csr = _parse_csr(d.pop("csr")) + + ssl_certificate_key = cls( + ssl_certificate_id=ssl_certificate_id, + csr=csr, + ) + + ssl_certificate_key.additional_properties = d + return ssl_certificate_key + + @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_response.py b/src/shellrent_sdk/client/models/ssl_certificate_key_response.py new file mode 100644 index 0000000..02691f4 --- /dev/null +++ b/src/shellrent_sdk/client/models/ssl_certificate_key_response.py @@ -0,0 +1,114 @@ +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_key import SslCertificateKey + from ..models.ssl_certificate_key_response_meta_type_0 import SslCertificateKeyResponseMetaType0 + + +T = TypeVar("T", bound="SslCertificateKeyResponse") + + +@_attrs_define +class SslCertificateKeyResponse: + error: int + message: None | str + data: SslCertificateKey + meta: None | SslCertificateKeyResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, SslCertificateKeyResponseMetaType0): + 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_key import SslCertificateKey + from ..models.ssl_certificate_key_response_meta_type_0 import ( + SslCertificateKeyResponseMetaType0, + ) + + 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 = 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")) + + ssl_certificate_key_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + ssl_certificate_key_response.additional_properties = d + return ssl_certificate_key_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_key_response_meta_type_0.py b/src/shellrent_sdk/client/models/ssl_certificate_key_response_meta_type_0.py new file mode 100644 index 0000000..130b52c --- /dev/null +++ b/src/shellrent_sdk/client/models/ssl_certificate_key_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..6a144f4 --- /dev/null +++ b/src/shellrent_sdk/client/models/ssl_certificate_keys.py @@ -0,0 +1,108 @@ +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="SslCertificateKeys") + + +@_attrs_define +class SslCertificateKeys: + ssl_certificate_id: int + csr: None | str + private_key: None | str + public_key: None | str + certificate_authority: None | str + 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 + + csr: None | str + csr = self.csr + + private_key: None | str + private_key = self.private_key + + public_key: None | str + public_key = self.public_key + + certificate_authority: None | str + certificate_authority = self.certificate_authority + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "ssl_certificate_id": ssl_certificate_id, + "csr": csr, + "private_key": private_key, + "public_key": public_key, + "certificate_authority": certificate_authority, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + ssl_certificate_id = d.pop("ssl_certificate_id") + + def _parse_csr(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + csr = _parse_csr(d.pop("csr")) + + def _parse_private_key(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + private_key = _parse_private_key(d.pop("private_key")) + + def _parse_public_key(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + public_key = _parse_public_key(d.pop("public_key")) + + def _parse_certificate_authority(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + certificate_authority = _parse_certificate_authority(d.pop("certificate_authority")) + + ssl_certificate_keys = cls( + ssl_certificate_id=ssl_certificate_id, + csr=csr, + private_key=private_key, + public_key=public_key, + certificate_authority=certificate_authority, + ) + + ssl_certificate_keys.additional_properties = d + return ssl_certificate_keys + + @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_response.py b/src/shellrent_sdk/client/models/ssl_certificate_keys_response.py new file mode 100644 index 0000000..4f7bc1d --- /dev/null +++ b/src/shellrent_sdk/client/models/ssl_certificate_keys_response.py @@ -0,0 +1,116 @@ +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_keys import SslCertificateKeys + from ..models.ssl_certificate_keys_response_meta_type_0 import ( + SslCertificateKeysResponseMetaType0, + ) + + +T = TypeVar("T", bound="SslCertificateKeysResponse") + + +@_attrs_define +class SslCertificateKeysResponse: + error: int + message: None | str + data: SslCertificateKeys + meta: None | SslCertificateKeysResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, SslCertificateKeysResponseMetaType0): + 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_keys import SslCertificateKeys + from ..models.ssl_certificate_keys_response_meta_type_0 import ( + SslCertificateKeysResponseMetaType0, + ) + + 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 = 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")) + + ssl_certificate_keys_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + ssl_certificate_keys_response.additional_properties = d + return ssl_certificate_keys_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_keys_response_meta_type_0.py b/src/shellrent_sdk/client/models/ssl_certificate_keys_response_meta_type_0.py new file mode 100644 index 0000000..d698958 --- /dev/null +++ b/src/shellrent_sdk/client/models/ssl_certificate_keys_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..4ef0a71 --- /dev/null +++ b/src/shellrent_sdk/client/models/ssl_certificate_owner_request.py @@ -0,0 +1,296 @@ +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="SslCertificateOwnerRequest") + + +@_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) + + 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 + + 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 + if admin_role is not UNSET: + field_dict["admin_role"] = admin_role + if admin_first_name is not UNSET: + field_dict["admin_first_name"] = admin_first_name + if admin_last_name is not UNSET: + field_dict["admin_last_name"] = admin_last_name + if admin_email is not UNSET: + field_dict["admin_email"] = admin_email + if admin_organization is not UNSET: + field_dict["admin_organization"] = admin_organization + if admin_phone_cc is not UNSET: + field_dict["admin_phone_cc"] = admin_phone_cc + if admin_phone_number is not UNSET: + field_dict["admin_phone_number"] = admin_phone_number + if admin_address is not UNSET: + field_dict["admin_address"] = admin_address + if admin_city is not UNSET: + field_dict["admin_city"] = admin_city + if admin_state is not UNSET: + field_dict["admin_state"] = admin_state + if admin_postal_code is not UNSET: + field_dict["admin_postal_code"] = admin_postal_code + if admin_country is not UNSET: + field_dict["admin_country"] = admin_country + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + + 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)) + + ssl_certificate_owner_request = cls( + admin_title=admin_title, + admin_role=admin_role, + admin_first_name=admin_first_name, + admin_last_name=admin_last_name, + admin_email=admin_email, + admin_organization=admin_organization, + admin_phone_cc=admin_phone_cc, + admin_phone_number=admin_phone_number, + admin_address=admin_address, + admin_city=admin_city, + admin_state=admin_state, + admin_postal_code=admin_postal_code, + 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 new file mode 100644 index 0000000..2369d0f --- /dev/null +++ b/src/shellrent_sdk/client/models/ssl_certificate_paginated_list_response.py @@ -0,0 +1,99 @@ +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.pagination_meta import PaginationMeta + from ..models.ssl_certificate import SslCertificate + + +T = TypeVar("T", bound="SslCertificatePaginatedListResponse") + + +@_attrs_define +class SslCertificatePaginatedListResponse: + error: int + message: None | str + data: list[SslCertificate] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.pagination_meta import PaginationMeta + from ..models.ssl_certificate import SslCertificate + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = SslCertificate.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + ssl_certificate_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + ssl_certificate_paginated_list_response.additional_properties = d + return ssl_certificate_paginated_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/ssl_certificate_reemit_request.py b/src/shellrent_sdk/client/models/ssl_certificate_reemit_request.py new file mode 100644 index 0000000..b78c70e --- /dev/null +++ b/src/shellrent_sdk/client/models/ssl_certificate_reemit_request.py @@ -0,0 +1,87 @@ +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="SslCertificateReemitRequest") + + +@_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) + + 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 + + csr_key: None | str | Unset + if isinstance(self.csr_key, Unset): + csr_key = UNSET + else: + 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 + if csr_key is not UNSET: + field_dict["csr_key"] = csr_key + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + + 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)) + + 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 new file mode 100644 index 0000000..15b8886 --- /dev/null +++ b/src/shellrent_sdk/client/models/ssl_certificate_response.py @@ -0,0 +1,112 @@ +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 import SslCertificate + from ..models.ssl_certificate_response_meta_type_0 import SslCertificateResponseMetaType0 + + +T = TypeVar("T", bound="SslCertificateResponse") + + +@_attrs_define +class SslCertificateResponse: + error: int + message: None | str + data: SslCertificate + meta: None | SslCertificateResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, SslCertificateResponseMetaType0): + 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 import SslCertificate + from ..models.ssl_certificate_response_meta_type_0 import ( + SslCertificateResponseMetaType0, + ) + + 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 = 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")) + + ssl_certificate_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + ssl_certificate_response.additional_properties = d + return ssl_certificate_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_response_meta_type_0.py b/src/shellrent_sdk/client/models/ssl_certificate_response_meta_type_0.py new file mode 100644 index 0000000..b8ddfa5 --- /dev/null +++ b/src/shellrent_sdk/client/models/ssl_certificate_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..7bb922b --- /dev/null +++ b/src/shellrent_sdk/client/models/sub_account_create_request.py @@ -0,0 +1,151 @@ +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 + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="SubAccountCreateRequest") + + +@_attrs_define +class SubAccountCreateRequest: + person_password: str + administrative_person_name: str + administrative_person_surname: str + administrative_address: str + administrative_city: str + administrative_state: str + """ State or province """ + administrative_country: str + """ Country ISO code with 2 letters, ie. "IT" for Italy, "ES" for Spain, etc. """ + administrative_postal_code: str + administrative_phone: str + """ Phone number without international phone code """ + administrative_email: str + 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 """ + 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 + + administrative_person_name = self.administrative_person_name + + administrative_person_surname = self.administrative_person_surname + + administrative_address = self.administrative_address + + administrative_city = self.administrative_city + + administrative_state = self.administrative_state + + administrative_country = self.administrative_country + + administrative_postal_code = self.administrative_postal_code + + administrative_phone = self.administrative_phone + + administrative_email = self.administrative_email + + administrative_phone_prefix = self.administrative_phone_prefix + + administrative_mobile_prefix = self.administrative_mobile_prefix + + administrative_mobile = self.administrative_mobile + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "person_password": person_password, + "administrative_person_name": administrative_person_name, + "administrative_person_surname": administrative_person_surname, + "administrative_address": administrative_address, + "administrative_city": administrative_city, + "administrative_state": administrative_state, + "administrative_country": administrative_country, + "administrative_postal_code": administrative_postal_code, + "administrative_phone": administrative_phone, + "administrative_email": administrative_email, + } + ) + if administrative_phone_prefix is not UNSET: + field_dict["administrative_phone_prefix"] = administrative_phone_prefix + if administrative_mobile_prefix is not UNSET: + field_dict["administrative_mobile_prefix"] = administrative_mobile_prefix + if administrative_mobile is not UNSET: + field_dict["administrative_mobile"] = administrative_mobile + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + person_password = d.pop("person_password") + + administrative_person_name = d.pop("administrative_person_name") + + administrative_person_surname = d.pop("administrative_person_surname") + + administrative_address = d.pop("administrative_address") + + administrative_city = d.pop("administrative_city") + + administrative_state = d.pop("administrative_state") + + administrative_country = d.pop("administrative_country") + + administrative_postal_code = d.pop("administrative_postal_code") + + administrative_phone = d.pop("administrative_phone") + + administrative_email = d.pop("administrative_email") + + administrative_phone_prefix = d.pop("administrative_phone_prefix", UNSET) + + administrative_mobile_prefix = d.pop("administrative_mobile_prefix", UNSET) + + administrative_mobile = d.pop("administrative_mobile", UNSET) + + sub_account_create_request = cls( + person_password=person_password, + administrative_person_name=administrative_person_name, + administrative_person_surname=administrative_person_surname, + administrative_address=administrative_address, + administrative_city=administrative_city, + administrative_state=administrative_state, + administrative_country=administrative_country, + administrative_postal_code=administrative_postal_code, + administrative_phone=administrative_phone, + administrative_email=administrative_email, + administrative_phone_prefix=administrative_phone_prefix, + administrative_mobile_prefix=administrative_mobile_prefix, + 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 new file mode 100644 index 0000000..642dffc --- /dev/null +++ b/src/shellrent_sdk/client/models/sub_account_update_request.py @@ -0,0 +1,173 @@ +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="SubAccountUpdateRequest") + + +@_attrs_define +class SubAccountUpdateRequest: + person_password: str | Unset = UNSET + username_alias: None | str | Unset = UNSET + administrative_person_name: str | Unset = UNSET + administrative_person_surname: str | Unset = UNSET + administrative_address: str | Unset = UNSET + administrative_city: str | Unset = UNSET + administrative_state: str | Unset = UNSET + """ State or province """ + administrative_country: str | Unset = UNSET + """ Country ISO code with 2 letters """ + administrative_postal_code: str | Unset = UNSET + administrative_phone_prefix: str | Unset = UNSET + administrative_phone: str | Unset = UNSET + administrative_mobile_prefix: str | Unset = UNSET + administrative_mobile: str | Unset = UNSET + administrative_email: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + person_password = self.person_password + + username_alias: None | str | Unset + if isinstance(self.username_alias, Unset): + username_alias = UNSET + else: + username_alias = self.username_alias + + administrative_person_name = self.administrative_person_name + + administrative_person_surname = self.administrative_person_surname + + administrative_address = self.administrative_address + + administrative_city = self.administrative_city + + administrative_state = self.administrative_state + + administrative_country = self.administrative_country + + administrative_postal_code = self.administrative_postal_code + + administrative_phone_prefix = self.administrative_phone_prefix + + administrative_phone = self.administrative_phone + + administrative_mobile_prefix = self.administrative_mobile_prefix + + administrative_mobile = self.administrative_mobile + + 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 + if username_alias is not UNSET: + field_dict["username_alias"] = username_alias + if administrative_person_name is not UNSET: + field_dict["administrative_person_name"] = administrative_person_name + if administrative_person_surname is not UNSET: + field_dict["administrative_person_surname"] = administrative_person_surname + if administrative_address is not UNSET: + field_dict["administrative_address"] = administrative_address + if administrative_city is not UNSET: + field_dict["administrative_city"] = administrative_city + if administrative_state is not UNSET: + field_dict["administrative_state"] = administrative_state + if administrative_country is not UNSET: + field_dict["administrative_country"] = administrative_country + if administrative_postal_code is not UNSET: + field_dict["administrative_postal_code"] = administrative_postal_code + if administrative_phone_prefix is not UNSET: + field_dict["administrative_phone_prefix"] = administrative_phone_prefix + if administrative_phone is not UNSET: + field_dict["administrative_phone"] = administrative_phone + if administrative_mobile_prefix is not UNSET: + field_dict["administrative_mobile_prefix"] = administrative_mobile_prefix + if administrative_mobile is not UNSET: + field_dict["administrative_mobile"] = administrative_mobile + if administrative_email is not UNSET: + field_dict["administrative_email"] = administrative_email + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + person_password = d.pop("person_password", UNSET) + + def _parse_username_alias(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + username_alias = _parse_username_alias(d.pop("username_alias", UNSET)) + + administrative_person_name = d.pop("administrative_person_name", UNSET) + + administrative_person_surname = d.pop("administrative_person_surname", UNSET) + + administrative_address = d.pop("administrative_address", UNSET) + + administrative_city = d.pop("administrative_city", UNSET) + + administrative_state = d.pop("administrative_state", UNSET) + + administrative_country = d.pop("administrative_country", UNSET) + + administrative_postal_code = d.pop("administrative_postal_code", UNSET) + + administrative_phone_prefix = d.pop("administrative_phone_prefix", UNSET) + + administrative_phone = d.pop("administrative_phone", UNSET) + + administrative_mobile_prefix = d.pop("administrative_mobile_prefix", UNSET) + + administrative_mobile = d.pop("administrative_mobile", UNSET) + + administrative_email = d.pop("administrative_email", UNSET) + + sub_account_update_request = cls( + person_password=person_password, + username_alias=username_alias, + administrative_person_name=administrative_person_name, + administrative_person_surname=administrative_person_surname, + administrative_address=administrative_address, + administrative_city=administrative_city, + administrative_state=administrative_state, + administrative_country=administrative_country, + administrative_postal_code=administrative_postal_code, + administrative_phone_prefix=administrative_phone_prefix, + administrative_phone=administrative_phone, + administrative_mobile_prefix=administrative_mobile_prefix, + administrative_mobile=administrative_mobile, + 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 new file mode 100644 index 0000000..29f8c35 --- /dev/null +++ b/src/shellrent_sdk/client/models/task.py @@ -0,0 +1,138 @@ +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 + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.task_status import TaskStatus + + +T = TypeVar("T", bound="Task") + + +@_attrs_define +class Task: + task_id: int + purchase_id: int + task_status: TaskStatus + executed_instructions: int | None + total_instructions: int | None + is_started: bool + date_started: datetime.datetime + ask_user_error: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + task_id = self.task_id + + purchase_id = self.purchase_id + + task_status = self.task_status.to_dict() + + executed_instructions: int | None + executed_instructions = self.executed_instructions + + total_instructions: int | None + total_instructions = self.total_instructions + + is_started = self.is_started + + date_started = self.date_started.isoformat() + + 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 + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "task_id": task_id, + "purchase_id": purchase_id, + "task_status": task_status, + "executed_instructions": executed_instructions, + "total_instructions": total_instructions, + "is_started": is_started, + "date_started": date_started, + } + ) + if ask_user_error is not UNSET: + field_dict["ask_user_error"] = ask_user_error + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.task_status import TaskStatus + + d = dict(src_dict) + task_id = d.pop("task_id") + + purchase_id = d.pop("purchase_id") + + task_status = TaskStatus.from_dict(d.pop("task_status")) + + def _parse_executed_instructions(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + executed_instructions = _parse_executed_instructions(d.pop("executed_instructions")) + + def _parse_total_instructions(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + total_instructions = _parse_total_instructions(d.pop("total_instructions")) + + 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: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + ask_user_error = _parse_ask_user_error(d.pop("ask_user_error", UNSET)) + + task = cls( + task_id=task_id, + purchase_id=purchase_id, + task_status=task_status, + executed_instructions=executed_instructions, + total_instructions=total_instructions, + is_started=is_started, + date_started=date_started, + ask_user_error=ask_user_error, + ) + + task.additional_properties = d + return task + + @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_paginated_list_response.py b/src/shellrent_sdk/client/models/task_paginated_list_response.py new file mode 100644 index 0000000..f60ec76 --- /dev/null +++ b/src/shellrent_sdk/client/models/task_paginated_list_response.py @@ -0,0 +1,99 @@ +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.pagination_meta import PaginationMeta + from ..models.task import Task + + +T = TypeVar("T", bound="TaskPaginatedListResponse") + + +@_attrs_define +class TaskPaginatedListResponse: + error: int + message: None | str + data: list[Task] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.pagination_meta import PaginationMeta + from ..models.task import Task + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = Task.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + task_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + task_paginated_list_response.additional_properties = d + return task_paginated_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/task_response.py b/src/shellrent_sdk/client/models/task_response.py new file mode 100644 index 0000000..bf99bc8 --- /dev/null +++ b/src/shellrent_sdk/client/models/task_response.py @@ -0,0 +1,110 @@ +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.task import Task + from ..models.task_response_meta_type_0 import TaskResponseMetaType0 + + +T = TypeVar("T", bound="TaskResponse") + + +@_attrs_define +class TaskResponse: + error: int + message: None | str + data: Task + meta: None | TaskResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, TaskResponseMetaType0): + 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.task import Task + from ..models.task_response_meta_type_0 import TaskResponseMetaType0 + + 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 = 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")) + + task_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + task_response.additional_properties = d + return task_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/task_response_meta_type_0.py b/src/shellrent_sdk/client/models/task_response_meta_type_0.py new file mode 100644 index 0000000..271be3c --- /dev/null +++ b/src/shellrent_sdk/client/models/task_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..c6d5c04 --- /dev/null +++ b/src/shellrent_sdk/client/models/task_status.py @@ -0,0 +1,63 @@ +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="TaskStatus") + + +@_attrs_define +class TaskStatus: + status_code: str + status_name: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + status_code = self.status_code + + status_name = self.status_name + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "status_code": status_code, + "status_name": status_name, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + status_code = d.pop("status_code") + + status_name = d.pop("status_name") + + task_status = cls( + status_code=status_code, + status_name=status_name, + ) + + task_status.additional_properties = d + return task_status + + @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/tax_regime.py b/src/shellrent_sdk/client/models/tax_regime.py new file mode 100644 index 0000000..95f94fb --- /dev/null +++ b/src/shellrent_sdk/client/models/tax_regime.py @@ -0,0 +1,83 @@ +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="TaxRegime") + + +@_attrs_define +class TaxRegime: + regime_code: str + regime_name: str + code_edocument: None | str + tax_rate: float + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + regime_code = self.regime_code + + regime_name = self.regime_name + + code_edocument: None | str + code_edocument = self.code_edocument + + tax_rate = self.tax_rate + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "regime_code": regime_code, + "regime_name": regime_name, + "code_edocument": code_edocument, + "tax_rate": tax_rate, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + regime_code = d.pop("regime_code") + + regime_name = d.pop("regime_name") + + def _parse_code_edocument(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + code_edocument = _parse_code_edocument(d.pop("code_edocument")) + + tax_rate = d.pop("tax_rate") + + tax_regime = cls( + regime_code=regime_code, + regime_name=regime_name, + code_edocument=code_edocument, + tax_rate=tax_rate, + ) + + tax_regime.additional_properties = d + return tax_regime + + @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/tld.py b/src/shellrent_sdk/client/models/tld.py new file mode 100644 index 0000000..73269df --- /dev/null +++ b/src/shellrent_sdk/client/models/tld.py @@ -0,0 +1,236 @@ +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.country import Country + from ..models.tld_contact_specification import TldContactSpecification + + +T = TypeVar("T", bound="Tld") + + +@_attrs_define +class Tld: + tld_id: int + extension: str + punycode: str + country: Country | None + char_min: int | None + char_max: int | None + hyphen_allowed: bool + number_allowed: bool + punycode_allowed: bool + dnssec_enabled: bool + rdap_enabled: bool + rdap_url: str + contact_data: list[TldContactSpecification] + update_contact_r: bool + update_contact_a: bool + update_contact_t: bool + update_contact_o: bool + update_contact_additional: bool + update_contact_transfer: bool + transfer_authcode: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.country import Country + + tld_id = self.tld_id + + extension = self.extension + + punycode = self.punycode + + country: dict[str, Any] | None + if isinstance(self.country, Country): + country = self.country.to_dict() + else: + country = self.country + + char_min: int | None + char_min = self.char_min + + char_max: int | None + char_max = self.char_max + + hyphen_allowed = self.hyphen_allowed + + number_allowed = self.number_allowed + + punycode_allowed = self.punycode_allowed + + dnssec_enabled = self.dnssec_enabled + + rdap_enabled = self.rdap_enabled + + rdap_url = self.rdap_url + + contact_data = [] + for contact_data_item_data in self.contact_data: + contact_data_item = contact_data_item_data.to_dict() + contact_data.append(contact_data_item) + + update_contact_r = self.update_contact_r + + update_contact_a = self.update_contact_a + + update_contact_t = self.update_contact_t + + update_contact_o = self.update_contact_o + + update_contact_additional = self.update_contact_additional + + update_contact_transfer = self.update_contact_transfer + + transfer_authcode = self.transfer_authcode + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "tld_id": tld_id, + "extension": extension, + "punycode": punycode, + "country": country, + "char_min": char_min, + "char_max": char_max, + "hyphen_allowed": hyphen_allowed, + "number_allowed": number_allowed, + "punycode_allowed": punycode_allowed, + "dnssec_enabled": dnssec_enabled, + "rdap_enabled": rdap_enabled, + "rdap_url": rdap_url, + "contact_data": contact_data, + "update_contact_r": update_contact_r, + "update_contact_a": update_contact_a, + "update_contact_t": update_contact_t, + "update_contact_o": update_contact_o, + "update_contact_additional": update_contact_additional, + "update_contact_transfer": update_contact_transfer, + "transfer_authcode": transfer_authcode, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.country import Country + from ..models.tld_contact_specification import TldContactSpecification + + d = dict(src_dict) + tld_id = d.pop("tld_id") + + extension = d.pop("extension") + + punycode = d.pop("punycode") + + def _parse_country(data: object) -> Country | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + country_type_0 = Country.from_dict(data) + + return country_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(Country | None, data) + + country = _parse_country(d.pop("country")) + + def _parse_char_min(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + char_min = _parse_char_min(d.pop("char_min")) + + def _parse_char_max(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + char_max = _parse_char_max(d.pop("char_max")) + + hyphen_allowed = d.pop("hyphen_allowed") + + number_allowed = d.pop("number_allowed") + + punycode_allowed = d.pop("punycode_allowed") + + dnssec_enabled = d.pop("dnssec_enabled") + + rdap_enabled = d.pop("rdap_enabled") + + rdap_url = d.pop("rdap_url") + + contact_data = [] + _contact_data = d.pop("contact_data") + for contact_data_item_data in _contact_data: + contact_data_item = TldContactSpecification.from_dict(contact_data_item_data) + + contact_data.append(contact_data_item) + + update_contact_r = d.pop("update_contact_r") + + update_contact_a = d.pop("update_contact_a") + + update_contact_t = d.pop("update_contact_t") + + update_contact_o = d.pop("update_contact_o") + + update_contact_additional = d.pop("update_contact_additional") + + update_contact_transfer = d.pop("update_contact_transfer") + + transfer_authcode = d.pop("transfer_authcode") + + tld = cls( + tld_id=tld_id, + extension=extension, + punycode=punycode, + country=country, + char_min=char_min, + char_max=char_max, + hyphen_allowed=hyphen_allowed, + number_allowed=number_allowed, + punycode_allowed=punycode_allowed, + dnssec_enabled=dnssec_enabled, + rdap_enabled=rdap_enabled, + rdap_url=rdap_url, + contact_data=contact_data, + update_contact_r=update_contact_r, + update_contact_a=update_contact_a, + update_contact_t=update_contact_t, + update_contact_o=update_contact_o, + update_contact_additional=update_contact_additional, + update_contact_transfer=update_contact_transfer, + transfer_authcode=transfer_authcode, + ) + + tld.additional_properties = d + return tld + + @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/tld_contact_specification.py b/src/shellrent_sdk/client/models/tld_contact_specification.py new file mode 100644 index 0000000..5466d90 --- /dev/null +++ b/src/shellrent_sdk/client/models/tld_contact_specification.py @@ -0,0 +1,93 @@ +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="TldContactSpecification") + + +@_attrs_define +class TldContactSpecification: + """Represents a single TLD contact specification""" + + name: str + """ Code of the contact specification """ + type_: str + """ Data type of the specification value """ + enum: list[str] | None + """ If not null, the list of allowed values for this specification """ + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + name = self.name + + type_ = self.type_ + + enum: list[str] | None + if isinstance(self.enum, list): + enum = self.enum + + else: + enum = self.enum + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "name": name, + "type": type_, + "enum": enum, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + name = d.pop("name") + + type_ = d.pop("type") + + def _parse_enum(data: object) -> list[str] | None: + if data is None: + return data + try: + if not isinstance(data, list): + raise TypeError() + enum_type_0 = cast(list[str], data) + + return enum_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[str] | None, data) + + enum = _parse_enum(d.pop("enum")) + + tld_contact_specification = cls( + name=name, + type_=type_, + enum=enum, + ) + + tld_contact_specification.additional_properties = d + return tld_contact_specification + + @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/tld_paginated_list_response.py b/src/shellrent_sdk/client/models/tld_paginated_list_response.py new file mode 100644 index 0000000..7b2d6f2 --- /dev/null +++ b/src/shellrent_sdk/client/models/tld_paginated_list_response.py @@ -0,0 +1,99 @@ +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.pagination_meta import PaginationMeta + from ..models.tld import Tld + + +T = TypeVar("T", bound="TldPaginatedListResponse") + + +@_attrs_define +class TldPaginatedListResponse: + error: int + message: None | str + data: list[Tld] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.pagination_meta import PaginationMeta + from ..models.tld import Tld + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = Tld.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + tld_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + tld_paginated_list_response.additional_properties = d + return tld_paginated_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/tld_response.py b/src/shellrent_sdk/client/models/tld_response.py new file mode 100644 index 0000000..41f014a --- /dev/null +++ b/src/shellrent_sdk/client/models/tld_response.py @@ -0,0 +1,110 @@ +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.tld import Tld + from ..models.tld_response_meta_type_0 import TldResponseMetaType0 + + +T = TypeVar("T", bound="TldResponse") + + +@_attrs_define +class TldResponse: + error: int + message: None | str + data: Tld + meta: None | TldResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, TldResponseMetaType0): + 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.tld import Tld + from ..models.tld_response_meta_type_0 import TldResponseMetaType0 + + 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 = 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")) + + tld_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + tld_response.additional_properties = d + return tld_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/tld_response_meta_type_0.py b/src/shellrent_sdk/client/models/tld_response_meta_type_0.py new file mode 100644 index 0000000..6834037 --- /dev/null +++ b/src/shellrent_sdk/client/models/tld_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..8abf68c --- /dev/null +++ b/src/shellrent_sdk/client/models/upload_file_body.py @@ -0,0 +1,45 @@ +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="UploadFileBody") + + +@_attrs_define +class UploadFileBody: + 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) + upload_file_body = cls() + + upload_file_body.additional_properties = d + return upload_file_body + + @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.py b/src/shellrent_sdk/client/models/web_monitoring.py new file mode 100644 index 0000000..87de7fb --- /dev/null +++ b/src/shellrent_sdk/client/models/web_monitoring.py @@ -0,0 +1,277 @@ +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="WebMonitoring") + + +@_attrs_define +class WebMonitoring: + web_monitoring_id: int + purchase_id: int | None + service_name: None | str + purchase_name: None | str + purchase_status_code: None | str + monitored_domain: None | str + host_ref: None | str + web_scenario_ref: None | str + status: None | str + email_notification: None | str + sms_notification: None | str + ips: None | str + ip_isp: None | str + ip_location: None | str + last_http_response: int | None + last_down_date: datetime.datetime | None + send_ssl_notify: bool + active: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + web_monitoring_id = self.web_monitoring_id + + purchase_id: int | None + 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 + + monitored_domain: None | str + monitored_domain = self.monitored_domain + + host_ref: None | str + host_ref = self.host_ref + + web_scenario_ref: None | str + web_scenario_ref = self.web_scenario_ref + + status: None | str + status = self.status + + email_notification: None | str + email_notification = self.email_notification + + sms_notification: None | str + sms_notification = self.sms_notification + + ips: None | str + ips = self.ips + + ip_isp: None | str + ip_isp = self.ip_isp + + ip_location: None | str + ip_location = self.ip_location + + last_http_response: int | None + last_http_response = self.last_http_response + + last_down_date: None | str + if isinstance(self.last_down_date, datetime.datetime): + last_down_date = self.last_down_date.isoformat() + else: + last_down_date = self.last_down_date + + send_ssl_notify = self.send_ssl_notify + + active = self.active + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "web_monitoring_id": web_monitoring_id, + "purchase_id": purchase_id, + "service_name": service_name, + "purchase_name": purchase_name, + "purchase_status_code": purchase_status_code, + "monitored_domain": monitored_domain, + "host_ref": host_ref, + "web_scenario_ref": web_scenario_ref, + "status": status, + "email_notification": email_notification, + "sms_notification": sms_notification, + "ips": ips, + "ip_isp": ip_isp, + "ip_location": ip_location, + "last_http_response": last_http_response, + "last_down_date": last_down_date, + "send_ssl_notify": send_ssl_notify, + "active": active, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + web_monitoring_id = d.pop("web_monitoring_id") + + def _parse_purchase_id(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + purchase_id = _parse_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_monitored_domain(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + monitored_domain = _parse_monitored_domain(d.pop("monitored_domain")) + + def _parse_host_ref(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + host_ref = _parse_host_ref(d.pop("host_ref")) + + def _parse_web_scenario_ref(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + web_scenario_ref = _parse_web_scenario_ref(d.pop("web_scenario_ref")) + + 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_email_notification(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + email_notification = _parse_email_notification(d.pop("email_notification")) + + def _parse_sms_notification(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + sms_notification = _parse_sms_notification(d.pop("sms_notification")) + + def _parse_ips(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + ips = _parse_ips(d.pop("ips")) + + def _parse_ip_isp(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + ip_isp = _parse_ip_isp(d.pop("ip_isp")) + + def _parse_ip_location(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + ip_location = _parse_ip_location(d.pop("ip_location")) + + def _parse_last_http_response(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + last_http_response = _parse_last_http_response(d.pop("last_http_response")) + + def _parse_last_down_date(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + last_down_date_type_0 = datetime.datetime.fromisoformat(data) + + return last_down_date_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + last_down_date = _parse_last_down_date(d.pop("last_down_date")) + + send_ssl_notify = d.pop("send_ssl_notify") + + active = d.pop("active") + + web_monitoring = cls( + web_monitoring_id=web_monitoring_id, + purchase_id=purchase_id, + service_name=service_name, + purchase_name=purchase_name, + purchase_status_code=purchase_status_code, + monitored_domain=monitored_domain, + host_ref=host_ref, + web_scenario_ref=web_scenario_ref, + status=status, + email_notification=email_notification, + sms_notification=sms_notification, + ips=ips, + ip_isp=ip_isp, + ip_location=ip_location, + last_http_response=last_http_response, + last_down_date=last_down_date, + send_ssl_notify=send_ssl_notify, + active=active, + ) + + web_monitoring.additional_properties = d + return web_monitoring + + @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_availability_chart.py b/src/shellrent_sdk/client/models/web_monitoring_availability_chart.py new file mode 100644 index 0000000..55e5dfc --- /dev/null +++ b/src/shellrent_sdk/client/models/web_monitoring_availability_chart.py @@ -0,0 +1,108 @@ +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 + +if TYPE_CHECKING: + from ..models.web_monitoring_availability_chart_legend import ( + WebMonitoringAvailabilityChartLegend, + ) + from ..models.web_monitoring_availability_chart_points_item import ( + WebMonitoringAvailabilityChartPointsItem, + ) + + +T = TypeVar("T", bound="WebMonitoringAvailabilityChart") + + +@_attrs_define +class WebMonitoringAvailabilityChart: + web_monitoring_id: int + interval: str + unit: str + legend: WebMonitoringAvailabilityChartLegend + points: list[WebMonitoringAvailabilityChartPointsItem] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + web_monitoring_id = self.web_monitoring_id + + interval = self.interval + + unit = self.unit + + legend = self.legend.to_dict() + + points = [] + for points_item_data in self.points: + points_item = points_item_data.to_dict() + points.append(points_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "web_monitoring_id": web_monitoring_id, + "interval": interval, + "unit": unit, + "legend": legend, + "points": points, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.web_monitoring_availability_chart_legend import ( + WebMonitoringAvailabilityChartLegend, + ) + from ..models.web_monitoring_availability_chart_points_item import ( + WebMonitoringAvailabilityChartPointsItem, + ) + + d = dict(src_dict) + web_monitoring_id = d.pop("web_monitoring_id") + + interval = d.pop("interval") + + unit = d.pop("unit") + + legend = WebMonitoringAvailabilityChartLegend.from_dict(d.pop("legend")) + + points = [] + _points = d.pop("points") + for points_item_data in _points: + points_item = WebMonitoringAvailabilityChartPointsItem.from_dict(points_item_data) + + points.append(points_item) + + web_monitoring_availability_chart = cls( + web_monitoring_id=web_monitoring_id, + interval=interval, + unit=unit, + legend=legend, + points=points, + ) + + web_monitoring_availability_chart.additional_properties = d + return web_monitoring_availability_chart + + @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_availability_chart_legend.py b/src/shellrent_sdk/client/models/web_monitoring_availability_chart_legend.py new file mode 100644 index 0000000..9210f5a --- /dev/null +++ b/src/shellrent_sdk/client/models/web_monitoring_availability_chart_legend.py @@ -0,0 +1,72 @@ +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 + +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 + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + up = self.up + + down = self.down + + warning = self.warning + + 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 + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + up = d.pop("up", UNSET) + + down = d.pop("down", UNSET) + + warning = d.pop("warning", UNSET) + + web_monitoring_availability_chart_legend = cls( + up=up, + down=down, + warning=warning, + ) + + web_monitoring_availability_chart_legend.additional_properties = d + return web_monitoring_availability_chart_legend + + @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_availability_chart_points_item.py b/src/shellrent_sdk/client/models/web_monitoring_availability_chart_points_item.py new file mode 100644 index 0000000..ead4a07 --- /dev/null +++ b/src/shellrent_sdk/client/models/web_monitoring_availability_chart_points_item.py @@ -0,0 +1,66 @@ +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 + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="WebMonitoringAvailabilityChartPointsItem") + + +@_attrs_define +class WebMonitoringAvailabilityChartPointsItem: + x: float | Unset = UNSET + """ UNIX timestamp in milliseconds """ + y: int | Unset = UNSET + """ Availability status code (0 up, 1 down, 2 warning) """ + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + x = self.x + + y = self.y + + 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 + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + x = d.pop("x", UNSET) + + y = d.pop("y", UNSET) + + web_monitoring_availability_chart_points_item = cls( + x=x, + y=y, + ) + + web_monitoring_availability_chart_points_item.additional_properties = d + return web_monitoring_availability_chart_points_item + + @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_availability_chart_response.py b/src/shellrent_sdk/client/models/web_monitoring_availability_chart_response.py new file mode 100644 index 0000000..905bfb8 --- /dev/null +++ b/src/shellrent_sdk/client/models/web_monitoring_availability_chart_response.py @@ -0,0 +1,118 @@ +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.web_monitoring_availability_chart import WebMonitoringAvailabilityChart + from ..models.web_monitoring_availability_chart_response_meta_type_0 import ( + WebMonitoringAvailabilityChartResponseMetaType0, + ) + + +T = TypeVar("T", bound="WebMonitoringAvailabilityChartResponse") + + +@_attrs_define +class WebMonitoringAvailabilityChartResponse: + error: int + message: None | str + data: WebMonitoringAvailabilityChart + meta: None | WebMonitoringAvailabilityChartResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, WebMonitoringAvailabilityChartResponseMetaType0): + 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.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") + + 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 = 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")) + + web_monitoring_availability_chart_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + web_monitoring_availability_chart_response.additional_properties = d + return web_monitoring_availability_chart_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/web_monitoring_availability_chart_response_meta_type_0.py b/src/shellrent_sdk/client/models/web_monitoring_availability_chart_response_meta_type_0.py new file mode 100644 index 0000000..2f8ff26 --- /dev/null +++ b/src/shellrent_sdk/client/models/web_monitoring_availability_chart_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..dbf9179 --- /dev/null +++ b/src/shellrent_sdk/client/models/web_monitoring_download_speed_chart.py @@ -0,0 +1,95 @@ +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 + +if TYPE_CHECKING: + from ..models.web_monitoring_download_speed_chart_points_item import ( + WebMonitoringDownloadSpeedChartPointsItem, + ) + + +T = TypeVar("T", bound="WebMonitoringDownloadSpeedChart") + + +@_attrs_define +class WebMonitoringDownloadSpeedChart: + web_monitoring_id: int + interval: str + unit: str + points: list[WebMonitoringDownloadSpeedChartPointsItem] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + web_monitoring_id = self.web_monitoring_id + + interval = self.interval + + unit = self.unit + + points = [] + for points_item_data in self.points: + points_item = points_item_data.to_dict() + points.append(points_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "web_monitoring_id": web_monitoring_id, + "interval": interval, + "unit": unit, + "points": points, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.web_monitoring_download_speed_chart_points_item import ( + WebMonitoringDownloadSpeedChartPointsItem, + ) + + d = dict(src_dict) + web_monitoring_id = d.pop("web_monitoring_id") + + interval = d.pop("interval") + + unit = d.pop("unit") + + points = [] + _points = d.pop("points") + for points_item_data in _points: + points_item = WebMonitoringDownloadSpeedChartPointsItem.from_dict(points_item_data) + + points.append(points_item) + + web_monitoring_download_speed_chart = cls( + web_monitoring_id=web_monitoring_id, + interval=interval, + unit=unit, + points=points, + ) + + web_monitoring_download_speed_chart.additional_properties = d + return web_monitoring_download_speed_chart + + @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_points_item.py b/src/shellrent_sdk/client/models/web_monitoring_download_speed_chart_points_item.py new file mode 100644 index 0000000..dae539a --- /dev/null +++ b/src/shellrent_sdk/client/models/web_monitoring_download_speed_chart_points_item.py @@ -0,0 +1,66 @@ +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 + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="WebMonitoringDownloadSpeedChartPointsItem") + + +@_attrs_define +class WebMonitoringDownloadSpeedChartPointsItem: + x: float | Unset = UNSET + """ UNIX timestamp in milliseconds """ + y: float | Unset = UNSET + """ Download speed value in KB/s """ + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + x = self.x + + y = self.y + + 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 + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + x = d.pop("x", UNSET) + + y = d.pop("y", UNSET) + + web_monitoring_download_speed_chart_points_item = cls( + x=x, + y=y, + ) + + web_monitoring_download_speed_chart_points_item.additional_properties = d + return web_monitoring_download_speed_chart_points_item + + @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_response.py b/src/shellrent_sdk/client/models/web_monitoring_download_speed_chart_response.py new file mode 100644 index 0000000..c6d3a0a --- /dev/null +++ b/src/shellrent_sdk/client/models/web_monitoring_download_speed_chart_response.py @@ -0,0 +1,118 @@ +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.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") + + +@_attrs_define +class WebMonitoringDownloadSpeedChartResponse: + error: int + message: None | str + data: WebMonitoringDownloadSpeedChart + meta: None | WebMonitoringDownloadSpeedChartResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, WebMonitoringDownloadSpeedChartResponseMetaType0): + 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.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") + + 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 = 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")) + + web_monitoring_download_speed_chart_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + web_monitoring_download_speed_chart_response.additional_properties = d + return web_monitoring_download_speed_chart_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/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 new file mode 100644 index 0000000..58be829 --- /dev/null +++ b/src/shellrent_sdk/client/models/web_monitoring_download_speed_chart_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..af7a326 --- /dev/null +++ b/src/shellrent_sdk/client/models/web_monitoring_notices.py @@ -0,0 +1,89 @@ +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="WebMonitoringNotices") + + +@_attrs_define +class WebMonitoringNotices: + web_monitoring_id: int + notification_email: None | str + notification_sms: None | str + send_ssl_notify: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + web_monitoring_id = self.web_monitoring_id + + notification_email: None | str + notification_email = self.notification_email + + notification_sms: None | str + notification_sms = self.notification_sms + + send_ssl_notify = self.send_ssl_notify + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "web_monitoring_id": web_monitoring_id, + "notification_email": notification_email, + "notification_sms": notification_sms, + "send_ssl_notify": send_ssl_notify, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + web_monitoring_id = d.pop("web_monitoring_id") + + def _parse_notification_email(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + notification_email = _parse_notification_email(d.pop("notification_email")) + + def _parse_notification_sms(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + notification_sms = _parse_notification_sms(d.pop("notification_sms")) + + send_ssl_notify = d.pop("send_ssl_notify") + + web_monitoring_notices = cls( + web_monitoring_id=web_monitoring_id, + notification_email=notification_email, + notification_sms=notification_sms, + send_ssl_notify=send_ssl_notify, + ) + + web_monitoring_notices.additional_properties = d + return web_monitoring_notices + + @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_response.py b/src/shellrent_sdk/client/models/web_monitoring_notices_response.py new file mode 100644 index 0000000..bc12ffe --- /dev/null +++ b/src/shellrent_sdk/client/models/web_monitoring_notices_response.py @@ -0,0 +1,116 @@ +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.web_monitoring_notices import WebMonitoringNotices + from ..models.web_monitoring_notices_response_meta_type_0 import ( + WebMonitoringNoticesResponseMetaType0, + ) + + +T = TypeVar("T", bound="WebMonitoringNoticesResponse") + + +@_attrs_define +class WebMonitoringNoticesResponse: + error: int + message: None | str + data: WebMonitoringNotices + meta: None | WebMonitoringNoticesResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, WebMonitoringNoticesResponseMetaType0): + 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.web_monitoring_notices import WebMonitoringNotices + from ..models.web_monitoring_notices_response_meta_type_0 import ( + WebMonitoringNoticesResponseMetaType0, + ) + + 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 = 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")) + + web_monitoring_notices_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + web_monitoring_notices_response.additional_properties = d + return web_monitoring_notices_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/web_monitoring_notices_response_meta_type_0.py b/src/shellrent_sdk/client/models/web_monitoring_notices_response_meta_type_0.py new file mode 100644 index 0000000..9ac5b02 --- /dev/null +++ b/src/shellrent_sdk/client/models/web_monitoring_notices_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..c02d3e7 --- /dev/null +++ b/src/shellrent_sdk/client/models/web_monitoring_notices_update_request.py @@ -0,0 +1,75 @@ +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 + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="WebMonitoringNoticesUpdateRequest") + + +@_attrs_define +class WebMonitoringNoticesUpdateRequest: + notification_email: str | Unset = UNSET + """ Notification email. Use empty string to clear. """ + notification_sms: str | Unset = UNSET + """ 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 + + notification_sms = self.notification_sms + + 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 + if notification_sms is not UNSET: + field_dict["notification_sms"] = notification_sms + if send_ssl_notify is not UNSET: + field_dict["send_ssl_notify"] = send_ssl_notify + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + notification_email = d.pop("notification_email", UNSET) + + notification_sms = d.pop("notification_sms", UNSET) + + send_ssl_notify = d.pop("send_ssl_notify", UNSET) + + web_monitoring_notices_update_request = cls( + notification_email=notification_email, + notification_sms=notification_sms, + 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 new file mode 100644 index 0000000..5f5faa4 --- /dev/null +++ b/src/shellrent_sdk/client/models/web_monitoring_paginated_list_response.py @@ -0,0 +1,99 @@ +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.pagination_meta import PaginationMeta + from ..models.web_monitoring import WebMonitoring + + +T = TypeVar("T", bound="WebMonitoringPaginatedListResponse") + + +@_attrs_define +class WebMonitoringPaginatedListResponse: + error: int + message: None | str + data: list[WebMonitoring] + meta: PaginationMeta + 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 = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + meta = self.meta.to_dict() + + 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.pagination_meta import PaginationMeta + from ..models.web_monitoring import WebMonitoring + + 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 = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = WebMonitoring.from_dict(data_item_data) + + data.append(data_item) + + meta = PaginationMeta.from_dict(d.pop("meta")) + + web_monitoring_paginated_list_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + web_monitoring_paginated_list_response.additional_properties = d + return web_monitoring_paginated_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/web_monitoring_response.py b/src/shellrent_sdk/client/models/web_monitoring_response.py new file mode 100644 index 0000000..3457e87 --- /dev/null +++ b/src/shellrent_sdk/client/models/web_monitoring_response.py @@ -0,0 +1,112 @@ +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.web_monitoring import WebMonitoring + from ..models.web_monitoring_response_meta_type_0 import WebMonitoringResponseMetaType0 + + +T = TypeVar("T", bound="WebMonitoringResponse") + + +@_attrs_define +class WebMonitoringResponse: + error: int + message: None | str + data: WebMonitoring + meta: None | WebMonitoringResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, WebMonitoringResponseMetaType0): + 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.web_monitoring import WebMonitoring + from ..models.web_monitoring_response_meta_type_0 import ( + WebMonitoringResponseMetaType0, + ) + + 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 = 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")) + + web_monitoring_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + web_monitoring_response.additional_properties = d + return web_monitoring_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/web_monitoring_response_meta_type_0.py b/src/shellrent_sdk/client/models/web_monitoring_response_meta_type_0.py new file mode 100644 index 0000000..8949771 --- /dev/null +++ b/src/shellrent_sdk/client/models/web_monitoring_response_meta_type_0.py @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..3de8154 --- /dev/null +++ b/src/shellrent_sdk/client/models/web_monitoring_response_time_chart.py @@ -0,0 +1,95 @@ +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 + +if TYPE_CHECKING: + from ..models.web_monitoring_response_time_chart_points_item import ( + WebMonitoringResponseTimeChartPointsItem, + ) + + +T = TypeVar("T", bound="WebMonitoringResponseTimeChart") + + +@_attrs_define +class WebMonitoringResponseTimeChart: + web_monitoring_id: int + interval: str + unit: str + points: list[WebMonitoringResponseTimeChartPointsItem] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + web_monitoring_id = self.web_monitoring_id + + interval = self.interval + + unit = self.unit + + points = [] + for points_item_data in self.points: + points_item = points_item_data.to_dict() + points.append(points_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "web_monitoring_id": web_monitoring_id, + "interval": interval, + "unit": unit, + "points": points, + } + ) + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + from ..models.web_monitoring_response_time_chart_points_item import ( + WebMonitoringResponseTimeChartPointsItem, + ) + + d = dict(src_dict) + web_monitoring_id = d.pop("web_monitoring_id") + + interval = d.pop("interval") + + unit = d.pop("unit") + + points = [] + _points = d.pop("points") + for points_item_data in _points: + points_item = WebMonitoringResponseTimeChartPointsItem.from_dict(points_item_data) + + points.append(points_item) + + web_monitoring_response_time_chart = cls( + web_monitoring_id=web_monitoring_id, + interval=interval, + unit=unit, + points=points, + ) + + web_monitoring_response_time_chart.additional_properties = d + return web_monitoring_response_time_chart + + @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_points_item.py b/src/shellrent_sdk/client/models/web_monitoring_response_time_chart_points_item.py new file mode 100644 index 0000000..0e50366 --- /dev/null +++ b/src/shellrent_sdk/client/models/web_monitoring_response_time_chart_points_item.py @@ -0,0 +1,66 @@ +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 + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="WebMonitoringResponseTimeChartPointsItem") + + +@_attrs_define +class WebMonitoringResponseTimeChartPointsItem: + x: float | Unset = UNSET + """ UNIX timestamp in milliseconds """ + y: float | Unset = UNSET + """ Response time value in milliseconds """ + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + x = self.x + + y = self.y + + 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 + + return field_dict + + @classmethod + def from_dict(cls, src_dict: Mapping[str, Any]) -> Self: + d = dict(src_dict) + x = d.pop("x", UNSET) + + y = d.pop("y", UNSET) + + web_monitoring_response_time_chart_points_item = cls( + x=x, + y=y, + ) + + web_monitoring_response_time_chart_points_item.additional_properties = d + return web_monitoring_response_time_chart_points_item + + @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_response.py b/src/shellrent_sdk/client/models/web_monitoring_response_time_chart_response.py new file mode 100644 index 0000000..6a55370 --- /dev/null +++ b/src/shellrent_sdk/client/models/web_monitoring_response_time_chart_response.py @@ -0,0 +1,118 @@ +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.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") + + +@_attrs_define +class WebMonitoringResponseTimeChartResponse: + error: int + message: None | str + data: WebMonitoringResponseTimeChart + meta: None | WebMonitoringResponseTimeChartResponseMetaType0 + 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 + message = self.message + + data = self.data.to_dict() + + meta: dict[str, Any] | None + if isinstance(self.meta, WebMonitoringResponseTimeChartResponseMetaType0): + 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.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") + + 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 = 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")) + + web_monitoring_response_time_chart_response = cls( + error=error, + message=message, + data=data, + meta=meta, + ) + + web_monitoring_response_time_chart_response.additional_properties = d + return web_monitoring_response_time_chart_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/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 new file mode 100644 index 0000000..4f948dd --- /dev/null +++ b/src/shellrent_sdk/client/models/web_monitoring_response_time_chart_response_meta_type_0.py @@ -0,0 +1,45 @@ +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/src/shellrent_sdk/client/types.py b/src/shellrent_sdk/client/types.py new file mode 100644 index 0000000..b64af09 --- /dev/null +++ b/src/shellrent_sdk/client/types.py @@ -0,0 +1,54 @@ +"""Contains some shared types for properties""" + +from collections.abc import Mapping, MutableMapping +from http import HTTPStatus +from typing import IO, BinaryIO, Generic, Literal, TypeVar + +from attrs import define + + +class Unset: + def __bool__(self) -> Literal[False]: + return False + + +UNSET: Unset = Unset() + +# The types that `httpx.Client(files=)` can accept, copied from that library. +FileContent = IO[bytes] | bytes | str +FileTypes = ( + # (filename, file (or bytes), content_type) + tuple[str | None, FileContent, str | None] + # (filename, file (or bytes), content_type, headers) + | tuple[str | None, FileContent, str | None, Mapping[str, str]] +) +RequestFiles = list[tuple[str, FileTypes]] + + +@define +class File: + """Contains information for file uploads""" + + payload: BinaryIO + file_name: str | None = None + mime_type: str | None = None + + def to_tuple(self) -> FileTypes: + """Return a tuple representation that httpx will accept for multipart/form-data""" + return self.file_name, self.payload, self.mime_type + + +T = TypeVar("T") + + +@define +class Response(Generic[T]): + """A response from an endpoint""" + + status_code: HTTPStatus + content: bytes + headers: MutableMapping[str, str] + parsed: T | None + + +__all__ = ["UNSET", "File", "FileTypes", "RequestFiles", "Response", "Unset"] From b6f3ff97c9c5040fdd03595c1effb508119d1933 Mon Sep 17 00:00:00 2001 From: Tobia Zanarella Date: Wed, 30 Sep 2026 22:31:12 +0200 Subject: [PATCH 3/3] Add authentication, client factory, CLI, tests, docs and CI - shellrent_sdk.auth: ClientCredentials, TokenStore with MemoryTokenStore and FileTokenStore (0700 directory, 0600 files, atomic writes), and OAuth2Auth, an httpx.Auth that requests the token from the auth flow, reuses it until 60 s before it expires, retries once after a 401 and is safe across threads and event loops. The secret is never cached. - shellrent_sdk.http: RetryTransport (429 with Retry-After, sync and async, following the proxy and certificate environment like httpx) and client_args() for the httpx clients. - create_client(), returning the generated AuthenticatedClient, and unwrap()/ApiException for the documented error responses. - The shellrent command (shellrent api, shellrent token), modelled on gh api, with the token cached in a file. - auth, http and the CLI do not depend on the generated code: they are used by shellrent-internal-sdk too. - Packaging with hatchling and hatch-vcs, uv.lock, Ruff and strict mypy, pytest with httpx.MockTransport, CI on Python 3.11-3.14 plus the lowest dependencies and the regeneration check, release to PyPI with Trusted Publishing. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 60 ++++ .github/workflows/release.yml | 51 +++ .gitignore | 14 + CHANGELOG.md | 29 ++ CLAUDE.md | 60 ++++ LICENSE | 2 +- README.md | 309 +++++++++++++++++- pyproject.toml | 79 +++++ src/shellrent_sdk/__init__.py | 22 ++ src/shellrent_sdk/__main__.py | 5 + src/shellrent_sdk/_errors.py | 54 +++ src/shellrent_sdk/_factory.py | 48 +++ src/shellrent_sdk/auth.py | 527 ++++++++++++++++++++++++++++++ src/shellrent_sdk/cli.py | 220 +++++++++++++ src/shellrent_sdk/http.py | 237 ++++++++++++++ src/shellrent_sdk/py.typed | 0 tests/__init__.py | 0 tests/fixtures/tls/ca.pem | 11 + tests/fixtures/tls/server-key.pem | 5 + tests/fixtures/tls/server.pem | 12 + tests/integration/__init__.py | 0 tests/integration/test_errors.py | 30 ++ tests/integration/test_health.py | 35 ++ tests/servers.py | 125 +++++++ tests/support.py | 107 ++++++ tests/unit/__init__.py | 0 tests/unit/test_auth.py | 527 ++++++++++++++++++++++++++++++ tests/unit/test_cli.py | 254 ++++++++++++++ tests/unit/test_client.py | 275 ++++++++++++++++ tests/unit/test_environment.py | 207 ++++++++++++ tests/unit/test_http.py | 226 +++++++++++++ tests/unit/test_layers.py | 33 ++ tests/unit/test_token_store.py | 199 +++++++++++ uv.lock | 465 ++++++++++++++++++++++++++ 34 files changed, 4225 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/release.yml create mode 100644 .gitignore create mode 100644 CHANGELOG.md create mode 100644 CLAUDE.md create mode 100644 pyproject.toml create mode 100644 src/shellrent_sdk/__init__.py create mode 100644 src/shellrent_sdk/__main__.py create mode 100644 src/shellrent_sdk/_errors.py create mode 100644 src/shellrent_sdk/_factory.py create mode 100644 src/shellrent_sdk/auth.py create mode 100644 src/shellrent_sdk/cli.py create mode 100644 src/shellrent_sdk/http.py create mode 100644 src/shellrent_sdk/py.typed create mode 100644 tests/__init__.py create mode 100644 tests/fixtures/tls/ca.pem create mode 100644 tests/fixtures/tls/server-key.pem create mode 100644 tests/fixtures/tls/server.pem create mode 100644 tests/integration/__init__.py create mode 100644 tests/integration/test_errors.py create mode 100644 tests/integration/test_health.py create mode 100644 tests/servers.py create mode 100644 tests/support.py create mode 100644 tests/unit/__init__.py create mode 100644 tests/unit/test_auth.py create mode 100644 tests/unit/test_cli.py create mode 100644 tests/unit/test_client.py create mode 100644 tests/unit/test_environment.py create mode 100644 tests/unit/test_http.py create mode 100644 tests/unit/test_layers.py create mode 100644 tests/unit/test_token_store.py create mode 100644 uv.lock diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..eebd02f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,60 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + +permissions: + contents: read + +jobs: + checks: + name: Checks (Python ${{ matrix.python }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python: ['3.11', '3.12', '3.13', '3.14'] + steps: + - uses: actions/checkout@v7 + - uses: astral-sh/setup-uv@v10.2.0 + with: + python-version: ${{ matrix.python }} + - run: uv sync --locked + - 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 + 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 }} + + lowest-dependencies: + name: Checks (Python 3.11, lowest dependencies) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: astral-sh/setup-uv@v10.2.0 + with: + python-version: '3.11' + # The lowest versions allowed by pyproject.toml for the direct dependencies (httpx, attrs, dev tools). + - run: uv sync --resolution lowest-direct + - 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 + + generated-code: + name: Generated code is up to date + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: astral-sh/setup-uv@v10.2.0 + - run: bin/generate + - name: Compare with the committed code + run: | + git add --all --intent-to-add + git diff --stat --exit-code diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a34c1ed --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,51 @@ +# Publishes to PyPI with Trusted Publishing: PyPI trusts this file by its name (release.yml) +# and the "pypi" environment, whose approval is required before the upload. +name: Release + +on: + push: + tags: ['v*'] + +permissions: + contents: read + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + with: + # hatch-vcs takes the version from the git tags. + fetch-depth: 0 + - uses: astral-sh/setup-uv@v10.2.0 + - run: uv build + - name: Check that the version is the one of the tag + run: | + version="${GITHUB_REF_NAME#v}" + ls dist + if [[ ! -f "dist/shellrent_sdk-${version}.tar.gz" || ! -f "dist/shellrent_sdk-${version}-py3-none-any.whl" ]]; then + echo "::error::The built version is not ${version}, the one of the tag ${GITHUB_REF_NAME}" + exit 1 + fi + - uses: actions/upload-artifact@v7 + with: + name: dist + path: dist/ + if-no-files-found: error + + publish: + name: Publish to PyPI + needs: build + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/shellrent-sdk + permissions: + id-token: write + steps: + - uses: actions/download-artifact@v8 + with: + name: dist + path: dist/ + - uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d260963 --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +__pycache__/ +*.py[cod] +.venv/ +dist/ +build/ +*.egg-info/ +.mypy_cache/ +.pytest_cache/ +.ruff_cache/ +.coverage +htmlcov/ + +# Metadata of files copied from Windows to WSL +*:Zone.Identifier diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..caf7f06 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,29 @@ +# Changelog + +All notable changes to this project are documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +### Added + +- Functions and models for the Shellrent API 3.0.0 (OpenAPI 3.1 specification), generated with + openapi-python-client 0.29.1: nullable references typed as `Model | None`, required fields without + `Unset`, `OrderPayRequest` as the body of `pay_orders` and `Payment | None` as its data, and the 429 + responses documented. +- `create_client()`, returning the generated client configured for the API. +- OAuth2 client credentials authentication (`shellrent_sdk.auth.OAuth2Auth`), with the token cached in + memory, in files (`FileTokenStore`) or in any store implementing `TokenStore`. +- Retries of the requests rejected with 429 Too Many Requests, following `Retry-After` + (`shellrent_sdk.http.RetryTransport`). Like the default transports of httpx, it follows `HTTP_PROXY`, + `HTTPS_PROXY`, `ALL_PROXY`, `NO_PROXY`, `SSL_CERT_FILE` and `SSL_CERT_DIR` (`trust_env=False` ignores + them). +- `unwrap()` and `ApiException`, to turn the documented error responses into exceptions, including the + 429 left after the retries. +- `TokenError`, with the OAuth2 `error` and `error_description` of the token endpoint, such as + `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/commits/main diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..b0b9c6a --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,60 @@ +# CLAUDE.md + +SDK Python ufficiale delle API pubbliche Shellrent (`shellrent-sdk`, package `shellrent_sdk`): client generato +da `spec/openapi.yaml`; a mano solo autenticazione, creazione del client, CLI, test, documentazione e CI. + +## Generato e scritto a mano + +- Generato: tutto `src/shellrent_sdk/client/`. Non si modifica mai a mano: `bin/generate` lo cancella e lo ricrea. +- Scritto a mano: il resto di `src/shellrent_sdk/`, `tests/`, `bin/generate`, `openapi-python-client.yaml`, + `pyproject.toml`, README, CHANGELOG, CI. +- Per cambiare il codice generato, in quest'ordine: opzioni in `openapi-python-client.yaml`, + `content_type_overrides`, template custom (ultima risorsa: dalla 0.29 si rompono a ogni aggiornamento). + +## Rigenerazione + +- `bin/generate` (serve uv) esegue con `uvx` openapi-python-client e ruff, con le versioni fissate nello + script. `--fail-on-warning`: un'operazione non gestita blocca la generazione invece di sparire dal client. +- I post-hook del generatore (ruff) usano `[tool.ruff]` di `pyproject.toml`: se lo cambi, rigenera. +- Per aggiornare il generatore: cambia `GENERATOR_VERSION` (ed eventualmente `RUFF_VERSION`), lancia + `bin/generate`, rivedi il diff, confronta `requires-python` e dipendenze con quelle che il generatore + dichiarerebbe (prova con `--meta uv` in una cartella temporanea), lancia i test, annota in `CHANGELOG.md`. +- `spec/openapi.yaml` è una copia della spec dell'applicazione Shellrent: qui non si modifica. I problemi si + correggono nell'applicazione e poi si ricopia il file. + +## Versionamento e rilascio + +- SemVer dai tag git (hatch-vcs: niente versione in `pyproject.toml`). Nuove operazioni o modelli: minor. + operationId o modelli rinominati o rimossi: major, perché cambiano moduli e classi. Nel diff controlla anche + le firme generate: parametri di path posizionali, gli altri keyword-only; un parametro rinominato o un + parametro di path aggiunto o spostato è una major. +- Ogni modifica va in `CHANGELOG.md` (Keep a Changelog, sezione `[Unreleased]`). +- Rilascio: tag `vX.Y.Z` (versione PEP 440 normalizzata, come `v1.2.0` o `v1.3.0rc1`) → `release.yml` builda + e verifica che la versione coincida col tag → il job `publish` attende l'approvazione dell'environment + `pypi` → Trusted Publishing, senza token. Non rinominare `release.yml`: PyPI lo riconosce per nome. + +## Test e verifica + +- `uv sync`, poi `uv run ruff format`, `uv run ruff check`, `uv run mypy` (strict, senza il codice generato) + e `uv run pytest`. +- `tests/support.py`: API finta per `httpx.MockTransport`, orologio finto, `Sleeps` (retry senza dormire). + `tests/servers.py`: proxy e server HTTPS locali; i certificati di `tests/fixtures/tls` scadono nel 2126 e la + 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. + +## Vincoli + +- Python minimo 3.11, come il codice generato. Dipendenze di runtime: solo quelle del codice generato (httpx, + attrs) con gli stessi limiti. Niente nuove dipendenze senza un motivo forte. +- Il client secret non deve mai finire in cache, nei log, nei messaggi d'errore o nell'output della CLI; la CLI + lo legge solo dall'ambiente, mai da un'opzione. +- `auth.py`, `http.py` e `cli.py` non importano nulla da `shellrent_sdk.client` (lo verifica `test_layers.py`). +- I transport di default di `RetryTransport` seguono l'ambiente come quelli di httpx: proxy con + `urllib.request.getproxies`/`proxy_bypass` (httpx non ha un'API pubblica), certificati con `trust_env`. +- L'interfaccia pubblica di `auth`, `http` e della CLI (`main(argv)`, comandi, variabili d'ambiente, exit + code) è usata da `shellrent-internal-sdk`: cambiarla è una modifica incompatibile (major). +- `create_client()` restituisce `AuthenticatedClient` perché le funzioni generate lo richiedono nel tipo; il + token lo mette `OAuth2Auth` a ogni richiesta, non il campo `token` del client. diff --git a/LICENSE b/LICENSE index ff68cfb..57194ef 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2026 Shellrent +Copyright (c) 2026 Shellrent S.r.l. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 8310610..26aa1ca 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,307 @@ -# shellrent-sdk-python -Shellrent API Python SDK client +# Shellrent Python SDK + +[![CI](https://github.com/shellrent/shellrent-sdk-python/actions/workflows/ci.yml/badge.svg)](https://github.com/shellrent/shellrent-sdk-python/actions/workflows/ci.yml) + +Official Python SDK for the [Shellrent](https://www.shellrent.com) public API: domains, hosting, +servers, storage, SSL certificates, purchases and billing. + +The functions and the models are generated from the OpenAPI specification with +[openapi-python-client](https://github.com/openapi-generators/openapi-python-client); the SDK adds +OAuth2 authentication, token caching, retries on rate limits and the `shellrent` command. + +## Requirements + +Python 3.11 or later. + +## Installation + +```bash +pip install shellrent-sdk +``` + +With [uv](https://docs.astral.sh/uv/): + +```bash +uv add shellrent-sdk +``` + +## Authentication + +The API uses OAuth2 with the client credentials grant. Create the client with the ID and the secret +of your API client: + +```python +from shellrent_sdk import ClientCredentials, create_client + +client = create_client(ClientCredentials("your-client-id", "your-client-secret")) +``` + +The SDK requests an access token on the first call, sends it with every request and requests a new +one shortly before it expires (tokens last 10 minutes). If the API answers 401, the SDK requests a +new token and sends the request once more. + +By default the token has every scope assigned to the client and the only audience of the client. +To request less, or to choose the audience of a client that has more than one: + +```python +credentials = ClientCredentials( + "your-client-id", + "your-client-secret", + scopes=["purchases:read", "billing:read"], + audience="api-public", +) +``` + +`create_client()` without credentials, like `ClientCredentials.from_env()`, reads them from these +environment variables: + +| Variable | Value | +| --- | --- | +| `SHELLRENT_CLIENT_ID` | required | +| `SHELLRENT_CLIENT_SECRET` | required | +| `SHELLRENT_SCOPES` | optional, separated by spaces or commas | +| `SHELLRENT_API_URL` | optional, default `https://api.shellrent.com` | + +To use another environment, such as staging, set `SHELLRENT_API_URL` or pass `api_url=` to +`ClientCredentials`: both the token and the API calls then go to that URL. `repr()` of the +credentials never shows the secret. + +## Token cache + +By default each client keeps its token in memory (`MemoryTokenStore`). To share the token between +processes, such as the workers of a web application or scripts run by cron, pass a `FileTokenStore`: +this saves a token request per process and keeps you within the limit of the token endpoint +(5 requests every 15 seconds). + +```python +from shellrent_sdk import FileTokenStore, create_client + +# $XDG_CACHE_HOME/shellrent-sdk, or ~/.cache/shellrent-sdk +client = create_client(token_store=FileTokenStore()) + +# In a web application the home directory of the server user may not be writable: +client = create_client(token_store=FileTokenStore("/var/cache/myapp/shellrent")) +``` + +`FileTokenStore` creates its directory readable by its owner only (0700) and writes each token +atomically to a file with mode 0600. The client secret is never cached. + +Any object with the methods of the `TokenStore` protocol works as well: `get(key)`, returning `None` +for missing or expired keys, `set(key, value, ttl)` and `delete(key)`. Django's cache has them already +(`create_client(token_store=django.core.cache.cache)`); for Redis: + +```python +class RedisTokenStore: + def __init__(self, redis): + self.redis = redis + + def get(self, key): + value = self.redis.get(key) + return value.decode() if value is not None else None + + def set(self, key, value, ttl): + self.redis.set(key, value, ex=ttl) + + def delete(self, key): + self.redis.delete(key) +``` + +## Usage + +The operations are in `shellrent_sdk.client.api`: one package per tag of the specification, one +module per `operationId`, in snake case. For example `listPurchases`, tagged `Purchases`, is +`shellrent_sdk.client.api.purchases.list_purchases`. The packages are `account`, `billing`, +`domains`, `health`, `hosting`, `license_`, `monitoring`, `o_auth`, `payment`, `pec`, `purchases`, +`server`, `shop`, `sms`, `ssl` and `storage`; the models are in `shellrent_sdk.client.models`. + +Each module has four functions with the same arguments: `sync()` and `asyncio()` return the parsed +body, `sync_detailed()` and `asyncio_detailed()` return a `Response` that also has `status_code`, +`headers` and the raw `content`. Path parameters are positional, the others keyword-only. + +```python +from shellrent_sdk import create_client, unwrap +from shellrent_sdk.client.api.purchases import get_purchase, list_purchases + +with create_client() as client: + purchases = unwrap(list_purchases.sync_detailed(client=client, page=1, per_page=50)) + for purchase in purchases.data: + print(purchase.purchase_id, purchase.purchase_name) + print(f"Page {purchases.meta.page} of {purchases.meta.pages}") + + purchase = unwrap(get_purchase.sync_detailed(123, client=client)).data +``` + +Every JSON response has the envelope `{error, message, data, meta}`: `data` is the payload, `meta` +the pagination, if any. The client can be used for many calls; `with` closes its connections at the +end. The same client works with `asyncio`: + +```python +import asyncio + +from shellrent_sdk import create_client, unwrap +from shellrent_sdk.client.api.purchases import get_purchase + + +async def main() -> None: + async with create_client() as client: + calls = [get_purchase.asyncio_detailed(n, client=client) for n in (1, 2, 3)] + for response in await asyncio.gather(*calls): + print(unwrap(response).data.purchase_name) + + +asyncio.run(main()) +``` + +Operations that download a file, such as `download_invoice_pdf`, return a `File` with the bytes in +`payload`; the file name is in the `Content-Disposition` header. `download_invoice_xml` and +`download_credit_note_xml` return the XML or, for signed documents, the p7m file: see `Content-Type`. + +```python +from pathlib import Path + +from shellrent_sdk.client.api.billing import download_invoice_pdf + +response = download_invoice_pdf.sync_detailed(456, client=client) +Path("invoice.pdf").write_bytes(unwrap(response).payload.read()) +``` + +`create_client()` also takes these options: + +```python +client = create_client( + credentials, + token_store=FileTokenStore(), # see "Token cache" + retry=False, # do not retry the requests rejected with 429 + timeout=60.0, # seconds, default 30 +) +``` + +As with httpx, the requests follow the proxy and certificate settings of the environment: +`HTTP_PROXY`, `HTTPS_PROXY`, `ALL_PROXY`, `NO_PROXY`, `SSL_CERT_FILE` and `SSL_CERT_DIR`. + +## Error handling + +`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. + +```python +import httpx + +from shellrent_sdk import ApiException, TokenError, UnexpectedStatus, unwrap + +try: + purchase = unwrap(get_purchase.sync_detailed(123, client=client)) +except ApiException as e: + # A documented error response, such as 404 + print(e.status_code, e.error.message) +except UnexpectedStatus as e: + # A status code missing from the specification, such as 503 + print(e.status_code, e.content) +except TokenError as e: + # The token endpoint refused the credentials, such as invalid_client + print(e.error, e.error_description) +except httpx.TransportError as e: + # Network errors and timeouts + print(e) +``` + +- `ApiException` has `status_code`, `error` (the envelope, with `message`), `headers` and `content`. +- `UnexpectedStatus`, raised by the generated functions, has `status_code` and `content`. +- `TokenError` has the OAuth2 `error` and `error_description`, and the HTTP `status_code` of the + token endpoint. + +The API accepts 60 requests a minute per client. Requests rejected with 429 Too Many Requests, the +token requests included, are retried up to twice after the time given by `Retry-After`, if it is no +more than 60 seconds. If they are rejected again, `unwrap()` raises `ApiException` with +`status_code` 429 and `Retry-After` in `headers`; for the token endpoint, `TokenError` with `error` +`rate_limited`. `create_client(retry=False)` turns the retries off. + +## Command line + +The package installs the `shellrent` command, modelled on `gh api`: it sends a request to any path +of the API and prints the body of the response on stdout. It reads the credentials only from the +environment variables above: there is no option for the secret, which would show in `ps` and in the +shell history. + +```bash +export SHELLRENT_CLIENT_ID=your-client-id +export SHELLRENT_CLIENT_SECRET=your-client-secret + +shellrent api GET /api/v3/purchases | jq '.data[] | {purchase_id, name: .purchase_name.full_name}' +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 - + +# Files are written as they are +shellrent api GET /api/v3/invoices/456/download/pdf > invoice.pdf + +# An access token for other tools +curl -H "Authorization: Bearer $(shellrent token)" https://api.shellrent.com/api/v3/purchases +``` + +| Exit status | Meaning | +| --- | --- | +| 0 | 2xx response | +| 1 | HTTP error (the body is still on stdout, the status on stderr) or failed request | +| 2 | usage error, missing credentials, or credentials refused by the token endpoint | + +```bash +if ! body=$(shellrent api GET /api/v3/purchases/123); then + echo "Failed: $(jq -r .message <<<"$body")" >&2 +fi +``` + +Each run is a new process, so the command keeps the token in a file, in `$XDG_CACHE_HOME/shellrent-sdk` +or `~/.cache/shellrent-sdk`, and reuses it until it expires: scripts run by cron do not request a +token every time. `SHELLRENT_TOKEN_CACHE` sets another directory, or `off` to keep the token only +for the current run. `python -m shellrent_sdk` is the same as `shellrent`, and +`uvx --from shellrent-sdk shellrent` runs it without installing it. + +## Using httpx directly + +`shellrent_sdk.auth` and `shellrent_sdk.http` do not depend on the generated code. +`shellrent_sdk.http.client_args()` returns the arguments of an `httpx.Client` or `httpx.AsyncClient` +with the authentication, the retries, the `User-Agent` and the timeout of the SDK: + +```python +import httpx + +from shellrent_sdk import ClientCredentials +from shellrent_sdk.http import client_args + +with httpx.Client(**client_args(ClientCredentials.from_env())) as http: + print(http.get("/api/v3/purchases").json()) +``` + +## Regenerating the code + +The code in `src/shellrent_sdk/client/` is generated from `spec/openapi.yaml`: do not edit it by +hand. To regenerate it, with [uv](https://docs.astral.sh/uv/) installed: + +```bash +bin/generate +``` + +The script runs openapi-python-client (version pinned in the script) with +`openapi-python-client.yaml`, replacing the whole directory. CI fails if the committed code differs +from the generated one. + +## Versioning + +The SDK follows [Semantic Versioning](https://semver.org): + +- new operations or models: minor version; +- renamed or removed operations (`operationId`) or models: major version, since modules and classes + change name; +- fixes: patch version. + +Changes are listed in [CHANGELOG.md](CHANGELOG.md). + +## License + +MIT, see [LICENSE](LICENSE). diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..eaf5c07 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,79 @@ +[build-system] +requires = ["hatchling>=1.27", "hatch-vcs>=0.4"] +build-backend = "hatchling.build" + +[project] +name = "shellrent-sdk" +dynamic = ["version"] +description = "Official Python SDK for the Shellrent public API" +readme = "README.md" +license = "MIT" +license-files = ["LICENSE"] +authors = [{ name = "Shellrent S.r.l." }] +# Same as the generated code (openapi-python-client 0.29). +requires-python = ">=3.11" +keywords = ["shellrent", "api", "sdk", "client", "hosting", "domains", "openapi"] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", + "Topic :: Internet :: WWW/HTTP", + "Topic :: Software Development :: Libraries :: Python Modules", + "Typing :: Typed", +] +# The dependencies of the generated code, with the same bounds. +dependencies = [ + "httpx>=0.23.1,<0.29.0", + "attrs>=22.2.0", +] + +[project.urls] +Homepage = "https://github.com/shellrent/shellrent-sdk-python" +Issues = "https://github.com/shellrent/shellrent-sdk-python/issues" +Changelog = "https://github.com/shellrent/shellrent-sdk-python/blob/main/CHANGELOG.md" + +[project.scripts] +shellrent = "shellrent_sdk.cli:main" + +[dependency-groups] +dev = [ + "mypy>=1.15", + "pytest>=8.0", + "ruff>=0.16", +] + +[tool.hatch.version] +source = "vcs" + +[tool.hatch.build.targets.wheel] +packages = ["src/shellrent_sdk"] + +[tool.hatch.build.targets.sdist] +only-include = ["src", "tests", "CHANGELOG.md"] + +[tool.ruff] +line-length = 100 +src = ["src", "tests"] +# Generated by bin/generate, which formats it with its own settings. +extend-exclude = ["src/shellrent_sdk/client"] + +[tool.mypy] +strict = true +files = ["src", "tests"] +exclude = ["^src/shellrent_sdk/client/"] + +[[tool.mypy.overrides]] +# Generated code: its types are used to check the rest, its own errors are not reported. +module = ["shellrent_sdk.client", "shellrent_sdk.client.*"] +ignore_errors = true + +[tool.pytest.ini_options] +testpaths = ["tests"] +addopts = ["--strict-markers"] +xfail_strict = true diff --git a/src/shellrent_sdk/__init__.py b/src/shellrent_sdk/__init__.py new file mode 100644 index 0000000..fca43eb --- /dev/null +++ b/src/shellrent_sdk/__init__.py @@ -0,0 +1,22 @@ +"""Official Python SDK for the Shellrent public API. + +The functions of the operations are generated in ``shellrent_sdk.client.api``, one module per tag and +one module per operationId; the models in ``shellrent_sdk.client.models``. +""" + +from ._errors import ApiException, unwrap +from ._factory import create_client +from .auth import ClientCredentials, FileTokenStore, MemoryTokenStore, TokenError, TokenStore +from .client.errors import UnexpectedStatus + +__all__ = [ + "ApiException", + "ClientCredentials", + "FileTokenStore", + "MemoryTokenStore", + "TokenError", + "TokenStore", + "UnexpectedStatus", + "create_client", + "unwrap", +] diff --git a/src/shellrent_sdk/__main__.py b/src/shellrent_sdk/__main__.py new file mode 100644 index 0000000..f84a761 --- /dev/null +++ b/src/shellrent_sdk/__main__.py @@ -0,0 +1,5 @@ +"""``python -m shellrent_sdk``: the same as the ``shellrent`` command.""" + +from .cli import main + +raise SystemExit(main()) diff --git a/src/shellrent_sdk/_errors.py b/src/shellrent_sdk/_errors.py new file mode 100644 index 0000000..db4a029 --- /dev/null +++ b/src/shellrent_sdk/_errors.py @@ -0,0 +1,54 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, TypeVar + +from .client.errors import UnexpectedStatus +from .client.types import Response + +if TYPE_CHECKING: + from .client.models.api_error import ApiError + +T = TypeVar("T") + + +class ApiException(Exception): + """The API answered with an error response documented in the specification. + + Attributes: + status_code: HTTP status, such as 404. + error: The error envelope, with ``message``. + headers: Headers of the response, such as ``Retry-After``. + content: Body of the response. + """ + + def __init__( + self, status_code: int, error: ApiError, headers: Mapping[str, str], content: bytes + ) -> None: + super().__init__(f"HTTP {status_code}: {error.message}") + self.status_code = status_code + self.error = error + self.headers = headers + self.content = content + + +def unwrap(response: Response[T | ApiError]) -> T: + """Returns the parsed body of a successful response and raises an exception for the others. + + Takes the result of the ``sync_detailed()`` and ``asyncio_detailed()`` functions:: + + purchase = unwrap(get_purchase.sync_detailed(123, client=client)) + + Raises: + ApiException: An error response documented in the specification (``ApiError``). + UnexpectedStatus: Any other response outside 2xx, or without a parsed body. + """ + # Imported here: importing the models takes a while, and the CLI does not need them. + from .client.models.api_error import ApiError + + parsed = response.parsed + if isinstance(parsed, ApiError): + raise ApiException(response.status_code, parsed, response.headers, response.content) + if parsed is None or not 200 <= response.status_code < 300: + raise UnexpectedStatus(response.status_code, response.content) + return parsed diff --git a/src/shellrent_sdk/_factory.py b/src/shellrent_sdk/_factory.py new file mode 100644 index 0000000..ac88138 --- /dev/null +++ b/src/shellrent_sdk/_factory.py @@ -0,0 +1,48 @@ +from __future__ import annotations + +import httpx + +from .auth import ClientCredentials, MemoryTokenStore, TokenStore +from .client import AuthenticatedClient +from .http import client_args + + +def create_client( + credentials: ClientCredentials | None = None, + *, + token_store: TokenStore | None = None, + retry: bool = True, + timeout: float | httpx.Timeout | None = 30.0, +) -> AuthenticatedClient: + """Creates the client of the Shellrent API, to pass to the functions of ``shellrent_sdk.client.api``. + + Args: + credentials: Default ``ClientCredentials.from_env()``. + token_store: Cache of the access token; default a ``MemoryTokenStore``. Pass a + ``FileTokenStore`` (or a shared cache) to reuse the token across processes. + retry: Retry the requests rejected with 429 Too Many Requests, see ``RetryTransport``. + timeout: Timeout of the requests, in seconds. + + Documented error responses are returned as ``ApiError`` (see ``unwrap()``); undocumented status + codes raise ``UnexpectedStatus``. + """ + if credentials is None: + credentials = ClientCredentials.from_env() + + args = client_args( + credentials, + token_store=token_store if token_store is not None else MemoryTokenStore(), + retry=retry, + timeout=timeout, + ) + return AuthenticatedClient( + base_url=args.pop("base_url"), + # The generated client would send a fixed token: the header is set by OAuth2Auth instead, + # which replaces this empty default in every request. + token="", + prefix="", + headers=args.pop("headers"), + timeout=args.pop("timeout"), + httpx_args=args, + raise_on_unexpected_status=True, + ) diff --git a/src/shellrent_sdk/auth.py b/src/shellrent_sdk/auth.py new file mode 100644 index 0000000..0c27516 --- /dev/null +++ b/src/shellrent_sdk/auth.py @@ -0,0 +1,527 @@ +"""OAuth2 client credentials authentication for the Shellrent APIs. + +This module does not depend on the generated client: other SDKs, with clients of their own, use it too. +""" + +from __future__ import annotations + +import asyncio +import contextlib +import hashlib +import json +import logging +import os +import re +import tempfile +import threading +import time +import weakref +from collections.abc import AsyncGenerator, Callable, Generator, Iterable, Iterator, Mapping +from pathlib import Path +from typing import Any, Final, NamedTuple, Protocol + +import httpx + +__all__ = [ + "DEFAULT_API_URL", + "EXPIRY_MARGIN", + "ClientCredentials", + "FileTokenStore", + "MemoryTokenStore", + "OAuth2Auth", + "TokenError", + "TokenStore", +] + +DEFAULT_API_URL: Final = "https://api.shellrent.com" + +#: Seconds before its expiry after which an access token is no longer used. +EXPIRY_MARGIN: Final = 60 + +logger = logging.getLogger(__name__) + + +class ClientCredentials: + """OAuth2 client credentials of a Shellrent API client. + + Args: + client_id: ID of the API client. + client_secret: Secret of the API client. It is never cached and never shown by ``repr()``. + scopes: Scopes to request; ``None`` (or an empty list) lets the server grant every scope + of the client. + audience: Audience to request; ``None`` lets the server use the only audience of the client. + api_url: Base URL of the API, to change only to use another environment such as staging. + token_url: Token endpoint; ``None`` means ``{api_url}/oauth/token``. + """ + + def __init__( + self, + client_id: str, + client_secret: str, + *, + scopes: Iterable[str] | None = None, + audience: str | None = None, + api_url: str = DEFAULT_API_URL, + token_url: str | None = None, + ) -> None: + if not client_id or not client_secret: + raise ValueError("The client ID and the client secret must not be empty.") + if isinstance(scopes, str): + raise TypeError("scopes must be a list of strings, not a string.") + + scope_list = tuple(scopes or ()) + api_url = api_url.rstrip("/") + + self.client_id: Final = client_id + self._client_secret = client_secret + self.scopes: Final = scope_list or None + self.audience: Final = audience + self.api_url: Final = api_url + self.token_url: Final = token_url or f"{api_url}/oauth/token" + + @classmethod + def from_env(cls) -> ClientCredentials: + """Reads the credentials from the environment. + + ``SHELLRENT_CLIENT_ID`` and ``SHELLRENT_CLIENT_SECRET`` are required; ``SHELLRENT_SCOPES`` + (separated by spaces or commas) and ``SHELLRENT_API_URL`` are optional. + + Raises: + ValueError: The client ID or the client secret is not set. + """ + client_id = _env("SHELLRENT_CLIENT_ID") + client_secret = _env("SHELLRENT_CLIENT_SECRET") + if client_id is None or client_secret is None: + raise ValueError( + "The SHELLRENT_CLIENT_ID and SHELLRENT_CLIENT_SECRET environment variables must be set." + ) + + scopes = _env("SHELLRENT_SCOPES") + return cls( + client_id, + client_secret, + scopes=[scope for scope in re.split(r"[\s,]+", scopes) if scope] if scopes else None, + api_url=_env("SHELLRENT_API_URL") or DEFAULT_API_URL, + ) + + @property + def client_secret(self) -> str: + return self._client_secret + + def __repr__(self) -> str: + return ( + f"{type(self).__name__}(client_id={self.client_id!r}, scopes={self.scopes!r}, " + f"audience={self.audience!r}, api_url={self.api_url!r}, token_url={self.token_url!r})" + ) + + +class TokenError(Exception): + """The token endpoint did not issue an access token. + + Attributes: + error: OAuth2 error code, such as ``invalid_client`` or ``invalid_scope``, if any. + error_description: OAuth2 error description, if any. + status_code: HTTP status of the response of the token endpoint. + """ + + def __init__( + self, + message: str, + *, + error: str | None = None, + error_description: str | None = None, + status_code: int, + ) -> None: + super().__init__(message) + self.error = error + self.error_description = error_description + self.status_code = status_code + + +class TokenStore(Protocol): + """Cache of access tokens, shared by the clients (and the processes) that use it. + + The semantics are those of PSR-16 and of Django's cache: ``get`` returns ``None`` for missing + and expired keys, ``set`` stores a value for ``ttl`` seconds, ``delete`` ignores missing keys. + Values are opaque strings; the client secret is never stored. + """ + + def get(self, key: str, /) -> str | None: ... + + def set(self, key: str, value: str, ttl: int, /) -> object: ... + + def delete(self, key: str, /) -> object: ... + + +class MemoryTokenStore: + """Keeps the tokens in memory, for the life of the process.""" + + def __init__(self, *, clock: Callable[[], float] = time.monotonic) -> None: + self._clock = clock + self._items: dict[str, tuple[str, float]] = {} + self._lock = threading.Lock() + + def get(self, key: str) -> str | None: + with self._lock: + item = self._items.get(key) + if item is None: + return None + if item[1] <= self._clock(): + del self._items[key] + return None + return item[0] + + def set(self, key: str, value: str, ttl: int) -> None: + with self._lock: + if ttl > 0: + self._items[key] = (value, self._clock() + ttl) + else: + self._items.pop(key, None) + + def delete(self, key: str) -> None: + with self._lock: + self._items.pop(key, None) + + +class FileTokenStore: + """Keeps the tokens in files, one per key, shared by the processes of the same user. + + The directory defaults to ``$XDG_CACHE_HOME/shellrent-sdk``, or ``~/.cache/shellrent-sdk``. + When it does not exist it is created readable by its owner only (0700); the files are always + written with mode 0600, through a temporary file and an atomic rename. + """ + + _KEY_PATTERN: Final = re.compile(r"[A-Za-z0-9_-][A-Za-z0-9_.-]*") + + def __init__( + self, + directory: str | os.PathLike[str] | None = None, + *, + clock: Callable[[], float] = time.time, + ) -> None: + self.directory: Final = Path(directory) if directory is not None else _default_cache_dir() + self._clock = clock + + def get(self, key: str) -> str | None: + try: + data = json.loads(self._path(key).read_text(encoding="utf-8")) + except FileNotFoundError: + return None + except ValueError: # Not JSON: a file of someone else, or damaged. + return None + + if not isinstance(data, dict): + return None + value, expires_at = data.get("value"), data.get("expires_at") + if not isinstance(value, str) or not isinstance(expires_at, int | float): + return None + return value if expires_at > self._clock() else None + + def set(self, key: str, value: str, ttl: int) -> None: + path = self._path(key) + if ttl <= 0: + self.delete(key) + return + + self._create_directory() + content = json.dumps({"value": value, "expires_at": self._clock() + ttl}) + # mkstemp creates the file with mode 0600; the rename makes the new content visible at once. + fd, temp_path = tempfile.mkstemp(dir=self.directory, prefix=".", suffix=".tmp") + try: + with os.fdopen(fd, "w", encoding="utf-8") as file: + file.write(content) + os.replace(temp_path, path) + except BaseException: + Path(temp_path).unlink(missing_ok=True) + raise + + def delete(self, key: str) -> None: + self._path(key).unlink(missing_ok=True) + + def _path(self, key: str) -> Path: + if not self._KEY_PATTERN.fullmatch(key): + raise ValueError(f"Invalid key for FileTokenStore: {key!r}") + return self.directory / f"{key}.json" + + def _create_directory(self) -> None: + try: + self.directory.mkdir(mode=0o700, parents=True) + except FileExistsError: + return + # The mode given to mkdir is reduced by the umask. + self.directory.chmod(0o700) + + +class _Token(NamedTuple): + access_token: str + expires_at: float + + +class OAuth2Auth(httpx.Auth): + """httpx authentication with the OAuth2 client credentials grant. + + The access token is requested by the authentication flow itself, through the client that sends + the request (its transport, timeouts and retries included), so it works with both + ``httpx.Client`` and ``httpx.AsyncClient``. The token is reused until ``EXPIRY_MARGIN`` seconds + before it expires, and shared with the other clients and processes through ``token_store``. + When the API answers 401 the token is discarded and the request is sent once more with a new one. + + The instance can be shared by threads and tasks: while one of them requests a token, the others + wait for it instead of requesting their own. + + Raises (from the requests of the client): + TokenError: The token endpoint did not issue an access token. + """ + + def __init__( + self, + credentials: ClientCredentials, + token_store: TokenStore | None = None, + *, + clock: Callable[[], float] = time.time, + ) -> None: + self._credentials = credentials + self._store: TokenStore = token_store if token_store is not None else MemoryTokenStore() + self._clock = clock + self._cache_key = _cache_key(credentials) + self._token: _Token | None = None + self._state_lock = threading.Lock() + self._sync_request_lock = threading.Lock() + # An asyncio.Lock works only in the event loop that first waits on it: one per loop. + self._async_request_locks: weakref.WeakKeyDictionary[ + asyncio.AbstractEventLoop, asyncio.Lock + ] = weakref.WeakKeyDictionary() + + def sync_auth_flow( + self, request: httpx.Request + ) -> Generator[httpx.Request, httpx.Response, None]: + request.read() # Sent twice after a 401. + rejected: str | None = None + while True: + token = self._current_token(rejected) + if token is None: + with self._sync_request_lock: + token = self._current_token(rejected) + if token is None: + token_response = yield self._token_request( + request.headers, request.extensions + ) + token_response.read() + token = self._save_token(token_response) + + request.headers["Authorization"] = f"Bearer {token}" + response = yield request + if response.status_code != 401 or rejected is not None: + return + self._discard(token) + rejected = token + + async def async_auth_flow( + self, request: httpx.Request + ) -> AsyncGenerator[httpx.Request, httpx.Response]: + await request.aread() # Sent twice after a 401. + rejected: str | None = None + while True: + token = self._current_token(rejected) + if token is None: + async with self._async_request_lock(): + token = self._current_token(rejected) + if token is None: + token_response = yield self._token_request( + request.headers, request.extensions + ) + await token_response.aread() + token = self._save_token(token_response) + + request.headers["Authorization"] = f"Bearer {token}" + response = yield request + if response.status_code != 401 or rejected is not None: + return + self._discard(token) + rejected = token + + def get_token(self, client: httpx.Client) -> str: + """Returns a valid access token, requesting a new one through ``client`` when needed. + + Raises: + TokenError: The token endpoint did not issue an access token. + """ + token = self._current_token(None) + if token is not None: + return token + with self._sync_request_lock: + token = self._current_token(None) + if token is not None: + return token + request = self._token_request(client.headers, {"timeout": client.timeout.as_dict()}) + return self._save_token(client.send(request, auth=None)) + + async def aget_token(self, client: httpx.AsyncClient) -> str: + """Returns a valid access token, requesting a new one through ``client`` when needed. + + Raises: + TokenError: The token endpoint did not issue an access token. + """ + token = self._current_token(None) + if token is not None: + return token + async with self._async_request_lock(): + token = self._current_token(None) + if token is not None: + return token + request = self._token_request(client.headers, {"timeout": client.timeout.as_dict()}) + return self._save_token(await client.send(request, auth=None)) + + def _async_request_lock(self) -> asyncio.Lock: + loop = asyncio.get_running_loop() + with self._state_lock: + lock = self._async_request_locks.get(loop) + if lock is None: + lock = self._async_request_locks[loop] = asyncio.Lock() + return lock + + def _current_token(self, rejected: str | None) -> str | None: + """The token in memory or else in the store, if still valid and not the rejected one.""" + with self._state_lock: + now = self._clock() + token = self._token + if token is None or token.expires_at <= now or token.access_token == rejected: + token = self._stored_token() + if token is not None and ( + token.expires_at <= now or token.access_token == rejected + ): + token = None + self._token = token + return token.access_token if token is not None else None + + def _token_request( + self, headers: httpx.Headers, extensions: Mapping[str, Any] + ) -> httpx.Request: + credentials = self._credentials + form = { + "grant_type": "client_credentials", + "client_id": credentials.client_id, + "client_secret": credentials.client_secret, + } + if credentials.scopes is not None: + form["scope"] = " ".join(credentials.scopes) + if credentials.audience is not None: + form["audience"] = credentials.audience + + token_headers = {"Accept": "application/json"} + if "User-Agent" in headers: + token_headers["User-Agent"] = headers["User-Agent"] + token_extensions = {"timeout": extensions["timeout"]} if "timeout" in extensions else {} + + return httpx.Request( + "POST", + credentials.token_url, + headers=token_headers, + data=form, + extensions=token_extensions, + ) + + def _save_token(self, response: httpx.Response) -> str: + """Reads the token from the response of the token endpoint and keeps it.""" + try: + body = response.json() + except ValueError: + body = None + if not isinstance(body, dict): + body = {} + + access_token = body.get("access_token") + expires_in = body.get("expires_in") + if ( + response.status_code != 200 + or not isinstance(access_token, str) + or not access_token + or not isinstance(expires_in, int | float) + or isinstance(expires_in, bool) + ): + raise self._token_error(response, body) + + now = self._clock() + token = _Token(access_token, now + expires_in - EXPIRY_MARGIN) + with self._state_lock: + self._token = token + ttl = int(token.expires_at - now) + if ttl > 0: + value = json.dumps( + {"access_token": token.access_token, "expires_at": token.expires_at} + ) + with self._store_errors_logged(): + self._store.set(self._cache_key, value, ttl) + return access_token + + def _discard(self, token: str) -> None: + """Forgets a token rejected by the API, unless another request has replaced it already.""" + with self._state_lock: + if self._token is not None and self._token.access_token == token: + self._token = None + stored = self._stored_token() + if stored is not None and stored.access_token == token: + with self._store_errors_logged(): + self._store.delete(self._cache_key) + + def _stored_token(self) -> _Token | None: + value: object = None + with self._store_errors_logged(): + value = self._store.get(self._cache_key) + if not isinstance(value, str): + return None + try: + data = json.loads(value) + return _Token(str(data["access_token"]), float(data["expires_at"])) + except (ValueError, TypeError, KeyError): + return None + + @contextlib.contextmanager + def _store_errors_logged(self) -> Iterator[None]: + # Without the store the token is still reused in memory; other processes request their own. + try: + yield + except Exception as exc: # noqa: BLE001 - any failure of a third-party cache. + logger.warning("The token store %s failed: %s", type(self._store).__name__, exc) + + def _token_error(self, response: httpx.Response, body: dict[str, Any]) -> TokenError: + error = body.get("error") + description = body.get("error_description") + error = error if isinstance(error, str) else None + description = description if isinstance(description, str) else None + + message = ( + f"The token endpoint {self._credentials.token_url} answered HTTP {response.status_code}" + ) + if error is not None: + message += f": {error}" + (f" ({description})" if description is not None else "") + elif response.status_code == 200: + message += " without a valid access token" + + return TokenError( + message, error=error, error_description=description, status_code=response.status_code + ) + + +def _cache_key(credentials: ClientCredentials) -> str: + """Key of the token of these credentials: it identifies them without the secret.""" + identity = [ + credentials.token_url, + credentials.client_id, + credentials.audience, + sorted(credentials.scopes) if credentials.scopes is not None else None, + ] + digest = hashlib.sha256(json.dumps(identity).encode()).hexdigest() + return f"shellrent_sdk.token.{digest}" + + +def _default_cache_dir() -> Path: + # The XDG specification says to ignore relative paths. + xdg_cache_home = os.environ.get("XDG_CACHE_HOME", "") + base = Path(xdg_cache_home) if os.path.isabs(xdg_cache_home) else Path.home() / ".cache" + return base / "shellrent-sdk" + + +def _env(name: str) -> str | None: + value = os.environ.get(name) + return value if value else None diff --git a/src/shellrent_sdk/cli.py b/src/shellrent_sdk/cli.py new file mode 100644 index 0000000..32dde94 --- /dev/null +++ b/src/shellrent_sdk/cli.py @@ -0,0 +1,220 @@ +"""The ``shellrent`` command, modelled on ``gh api``: calls any endpoint of the Shellrent APIs. + +The credentials are read only from the environment: an option with the secret would show it in +``ps`` and in the shell history. +""" + +from __future__ import annotations + +import argparse +import json +import os +import sys +from collections.abc import Sequence +from pathlib import Path +from typing import Final +from urllib.parse import urlsplit + +import httpx + +from .auth import ( + ClientCredentials, + FileTokenStore, + MemoryTokenStore, + OAuth2Auth, + TokenError, + TokenStore, +) +from .http import _package_version, client_args + +__all__ = ["main"] + +EXIT_OK: Final = 0 +EXIT_HTTP_ERROR: Final = 1 +EXIT_USAGE: Final = 2 + +_ENVIRONMENT_HELP: Final = """\ +environment variables: + SHELLRENT_CLIENT_ID client ID (required) + SHELLRENT_CLIENT_SECRET client secret (required) + SHELLRENT_SCOPES scopes to request, separated by spaces or commas (default: all) + SHELLRENT_API_URL base URL of the API (default: https://api.shellrent.com) + SHELLRENT_TOKEN_CACHE directory of the token cache (default: $XDG_CACHE_HOME/shellrent-sdk + or ~/.cache/shellrent-sdk), or "off" not to cache the token + +exit status: + 0 success, 1 HTTP error or failed request, 2 usage or authentication error +""" + + +class _UsageError(Exception): + pass + + +def main(argv: Sequence[str] | None = None) -> int: + """Runs the command with the arguments ``argv`` (default ``sys.argv[1:]``). + + Returns the exit status: 0 for a 2xx response, 1 for an HTTP error or a failed request, + 2 for a usage or authentication error. + """ + parser = _parser() + try: + args = parser.parse_args(argv) + except SystemExit as exc: # --help, --version and usage errors. + return exc.code if isinstance(exc.code, int) else EXIT_USAGE + + try: + status: int = args.command(args) + except _UsageError as exc: + return _fail(f"error: {exc}", EXIT_USAGE) + except TokenError as exc: + return _fail(str(exc), EXIT_USAGE) + except httpx.HTTPError as exc: + return _fail(f"request failed: {exc}", EXIT_HTTP_ERROR) + return status + + +def _parser() -> argparse.ArgumentParser: + parser = argparse.ArgumentParser( + prog="shellrent", + description="Call the Shellrent APIs.", + epilog=_ENVIRONMENT_HELP, + formatter_class=argparse.RawDescriptionHelpFormatter, + ) + parser.add_argument("--version", action="version", version=f"%(prog)s {_package_version()}") + commands = parser.add_subparsers(title="commands", metavar="COMMAND", required=True) + + api = commands.add_parser( + "api", + help="send a request and print the body of the response", + description=( + "Send a request to PATH and print the body of the response on stdout. " + "Any endpoint works, such as /api/v3/purchases or /api/internal/v3/...: " + "the credentials decide which ones are allowed." + ), + epilog=_ENVIRONMENT_HELP, + formatter_class=argparse.RawDescriptionHelpFormatter, + ) + api.add_argument("method", metavar="METHOD", help="HTTP method, such as GET or POST") + api.add_argument( + "path", metavar="PATH", help="path of the endpoint, with the query string if any" + ) + api.add_argument( + "-d", + "--data", + metavar="JSON", + help="JSON body of the request: the text itself, @FILE to read it from FILE, - to read it from stdin", + ) + api.set_defaults(command=_api) + + token = commands.add_parser( + "token", + help="print a valid access token", + description="Print a valid access token, from the cache if there is one.", + epilog=_ENVIRONMENT_HELP, + formatter_class=argparse.RawDescriptionHelpFormatter, + ) + token.set_defaults(command=_token) + return parser + + +def _api(args: argparse.Namespace) -> int: + method = str(args.method).upper() + if not method.isascii() or not method.isalpha(): + raise _UsageError(f"invalid METHOD: {args.method}") + path = _path(args.path) + body = _body(args.data) if args.data is not None else None + credentials = _credentials() + + headers = {"Accept": "application/json, */*"} + if body is not None: + headers["Content-Type"] = "application/json" + + client, _ = _client(credentials) + with client: + response = client.request(method, path, content=body, headers=headers) + + _write_stdout(response.content) + if response.is_success: + return EXIT_OK + return _fail( + f"HTTP {response.status_code} {response.reason_phrase}{_api_message(response)}", + EXIT_HTTP_ERROR, + ) + + +def _token(args: argparse.Namespace) -> int: + client, auth = _client(_credentials()) + with client: + token = auth.get_token(client) + print(token) + return EXIT_OK + + +def _client(credentials: ClientCredentials) -> tuple[httpx.Client, OAuth2Auth]: + args = client_args(credentials, token_store=_token_store()) + return httpx.Client(**args), args["auth"] + + +def _credentials() -> ClientCredentials: + try: + return ClientCredentials.from_env() + except ValueError as exc: + raise _UsageError(str(exc)) from None + + +def _token_store() -> TokenStore: + # Each run is a new process: without a file the token would be requested every time. + setting = os.environ.get("SHELLRENT_TOKEN_CACHE", "") + if setting.lower() == "off": + return MemoryTokenStore() + return FileTokenStore(setting or None) + + +def _path(path: str) -> str: + # A URL would send the token to another host. + parts = urlsplit(path) + if parts.scheme or parts.netloc: + raise _UsageError(f"PATH must be a path such as /api/v3/purchases, not a URL: {path}") + return path if path.startswith("/") else f"/{path}" + + +def _body(data: str) -> bytes: + if data == "-": + content = sys.stdin.buffer.read() + elif data.startswith("@"): + try: + content = Path(data[1:]).read_bytes() + except OSError as exc: + raise _UsageError(f"cannot read {data[1:]}: {exc.strerror}") from None + else: + content = data.encode() + + try: + json.loads(content) + except ValueError as exc: + raise _UsageError(f"the data is not valid JSON: {exc}") from None + return content + + +def _api_message(response: httpx.Response) -> str: + """The message of the error envelope, if any.""" + try: + body = response.json() + except ValueError: + return "" + message = body.get("message") if isinstance(body, dict) else None + return f": {message}" if isinstance(message, str) and message else "" + + +def _write_stdout(content: bytes) -> None: + sys.stdout.flush() + sys.stdout.buffer.write(content) + if content and not content.endswith(b"\n") and sys.stdout.isatty(): + sys.stdout.buffer.write(b"\n") + sys.stdout.buffer.flush() + + +def _fail(message: str, status: int) -> int: + print(f"shellrent: {message}", file=sys.stderr) + return status diff --git a/src/shellrent_sdk/http.py b/src/shellrent_sdk/http.py new file mode 100644 index 0000000..faf77d8 --- /dev/null +++ b/src/shellrent_sdk/http.py @@ -0,0 +1,237 @@ +"""HTTP layer of the Shellrent SDKs: retries on 429 and the configuration of the httpx clients. + +This module does not depend on the generated client: other SDKs, with clients of their own, use it too. +""" + +from __future__ import annotations + +import asyncio +import email.utils +import importlib.metadata +import logging +import threading +import time +import urllib.request +from collections.abc import Awaitable, Callable +from typing import Any, Final + +import httpx + +from .auth import ClientCredentials, OAuth2Auth, TokenStore + +__all__ = [ + "MAX_RETRIES", + "MAX_RETRY_DELAY", + "RetryTransport", + "client_args", + "default_user_agent", +] + +#: Retries of a request rejected with 429 Too Many Requests. +MAX_RETRIES: Final = 2 + +#: Longest wait, in seconds, before a retry: a longer Retry-After returns the 429 to the caller. +MAX_RETRY_DELAY: Final = 60.0 + +logger = logging.getLogger(__name__) + + +class RetryTransport(httpx.BaseTransport, httpx.AsyncBaseTransport): + """Transport that retries the requests rejected with 429 Too Many Requests. + + It waits for the time given by ``Retry-After`` (seconds or HTTP date; 1 s, then 2 s, when the + header is missing) and retries up to ``max_retries`` times; if the wait would be longer than + ``max_delay`` seconds, or the retries are over, it returns the 429 response. + + It wraps a sync transport, for ``httpx.Client``, and an async one, for ``httpx.AsyncClient``, so + the same instance can serve both, as the generated client requires. + + By default it sends the requests through ``httpx.HTTPTransport`` and ``httpx.AsyncHTTPTransport`` + that, like the default transports of an httpx client, follow the environment: the proxies of + ``HTTP_PROXY``, ``HTTPS_PROXY`` and ``ALL_PROXY`` (or of the system settings on Windows and macOS), + except for the hosts in ``NO_PROXY``, and the certificates of ``SSL_CERT_FILE`` and + ``SSL_CERT_DIR``. The proxies are read when the transport is created; ``trust_env=False`` ignores + the environment. Pass ``transport`` and ``async_transport`` to use transports of your own instead. + """ + + def __init__( + self, + transport: httpx.BaseTransport | None = None, + async_transport: httpx.AsyncBaseTransport | None = None, + *, + trust_env: bool = True, + max_retries: int = MAX_RETRIES, + max_delay: float = MAX_RETRY_DELAY, + sleep: Callable[[float], None] = time.sleep, + async_sleep: Callable[[float], Awaitable[None]] = asyncio.sleep, + ) -> None: + self._transport = transport + self._async_transport = async_transport + self._trust_env = trust_env + self._proxies = _environment_proxies() if trust_env else {} + self._max_retries = max_retries + self._max_delay = max_delay + self._sleep = sleep + self._async_sleep = async_sleep + self._lock = threading.Lock() + # Default transports, created on first use: one per proxy URL, None for no proxy. + self._sync_transports: dict[str | None, httpx.HTTPTransport] = {} + self._async_transports: dict[str | None, httpx.AsyncHTTPTransport] = {} + + def handle_request(self, request: httpx.Request) -> httpx.Response: + transport = self._sync_transport(request.url) + request.read() # The body is sent again on retry. + retries = 0 + while True: + response = transport.handle_request(request) + delay = self._retry_delay(response, retries) + if delay is None: + return response + response.close() + logger.info("%s %s: HTTP 429, retrying in %.1f s", request.method, request.url, delay) + self._sleep(delay) + retries += 1 + + async def handle_async_request(self, request: httpx.Request) -> httpx.Response: + transport = self._async_transport_for(request.url) + await request.aread() # The body is sent again on retry. + retries = 0 + while True: + response = await transport.handle_async_request(request) + delay = self._retry_delay(response, retries) + if delay is None: + return response + await response.aclose() + logger.info("%s %s: HTTP 429, retrying in %.1f s", request.method, request.url, delay) + await self._async_sleep(delay) + retries += 1 + + def close(self) -> None: + if self._transport is not None: + self._transport.close() + with self._lock: + transports = list(self._sync_transports.values()) + self._sync_transports.clear() + for transport in transports: + transport.close() + + async def aclose(self) -> None: + if self._async_transport is not None: + await self._async_transport.aclose() + with self._lock: + transports = list(self._async_transports.values()) + self._async_transports.clear() + for transport in transports: + await transport.aclose() + + def _sync_transport(self, url: httpx.URL) -> httpx.BaseTransport: + if self._transport is not None: + return self._transport + proxy = self._proxy_for(url) + with self._lock: + transport = self._sync_transports.get(proxy) + if transport is None: + transport = httpx.HTTPTransport(trust_env=self._trust_env, proxy=_proxy(proxy)) + self._sync_transports[proxy] = transport + return transport + + def _async_transport_for(self, url: httpx.URL) -> httpx.AsyncBaseTransport: + if self._async_transport is not None: + return self._async_transport + proxy = self._proxy_for(url) + with self._lock: + transport = self._async_transports.get(proxy) + if transport is None: + transport = httpx.AsyncHTTPTransport(trust_env=self._trust_env, proxy=_proxy(proxy)) + self._async_transports[proxy] = transport + return transport + + def _proxy_for(self, url: httpx.URL) -> str | None: + """URL of the proxy for a request to ``url``, or None to connect directly.""" + proxy = self._proxies.get(url.scheme) or self._proxies.get("all") + if proxy is None: + return None + host = url.host + if url.port is not None and ":" not in host: # Not for IPv6 addresses. + host = f"{host}:{url.port}" + return None if urllib.request.proxy_bypass(host) else proxy + + def _retry_delay(self, response: httpx.Response, retries: int) -> float | None: + """Seconds to wait before retrying the request, or None to return the response.""" + if response.status_code != 429 or retries >= self._max_retries: + return None + delay = _retry_after(response.headers.get("Retry-After", "")) + if delay is None: + delay = float(2**retries) + return delay if delay <= self._max_delay else None + + +def default_user_agent() -> str: + """``shellrent-sdk-python/``, with the installed version of the package.""" + return f"shellrent-sdk-python/{_package_version()}" + + +def client_args( + credentials: ClientCredentials, + *, + token_store: TokenStore | None = None, + retry: bool = True, + timeout: float | httpx.Timeout | None = 30.0, + user_agent: str | None = None, +) -> dict[str, Any]: + """Keyword arguments for ``httpx.Client`` and ``httpx.AsyncClient`` that call the Shellrent APIs. + + They set ``base_url`` (the API URL of the credentials), ``auth`` (an ``OAuth2Auth``), + ``transport`` (a ``RetryTransport``, unless ``retry`` is false), the ``User-Agent`` header + (default: ``default_user_agent()``) and ``timeout``. + + A generated client takes ``base_url``, ``headers`` and ``timeout`` as arguments of its own and + the rest as ``httpx_args``. + + Args: + token_store: Cache of the access token; default a new ``MemoryTokenStore``. + """ + args: dict[str, Any] = { + "base_url": credentials.api_url, + "auth": OAuth2Auth(credentials, token_store), + "headers": {"User-Agent": user_agent or default_user_agent()}, + "timeout": httpx.Timeout(timeout), + } + if retry: + args["transport"] = RetryTransport() + return args + + +def _package_version() -> str: + try: + return importlib.metadata.version("shellrent-sdk") + except importlib.metadata.PackageNotFoundError: + return "unknown" + + +def _environment_proxies() -> dict[str, str]: + """Proxies by URL scheme ("http", "https" and "all" for any), as httpx reads them.""" + proxies = urllib.request.getproxies() + return { + scheme: url if "://" in url else f"http://{url}" + for scheme in ("http", "https", "all") + if (url := proxies.get(scheme)) + } + + +def _proxy(url: str | None) -> httpx.Proxy | None: + return httpx.Proxy(url) if url is not None else None + + +def _retry_after(value: str) -> float | None: + """Seconds given by a Retry-After header: a number of seconds or an HTTP date.""" + value = value.strip() + if value.isascii() and value.isdigit(): + return float(value) + if not value: + return None + try: + date = email.utils.parsedate_to_datetime(value) + except (TypeError, ValueError): + return None + return max(0.0, date.timestamp() - time.time()) diff --git a/src/shellrent_sdk/py.typed b/src/shellrent_sdk/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/fixtures/tls/ca.pem b/tests/fixtures/tls/ca.pem new file mode 100644 index 0000000..c746b6b --- /dev/null +++ b/tests/fixtures/tls/ca.pem @@ -0,0 +1,11 @@ +-----BEGIN CERTIFICATE----- +MIIBqDCCAU2gAwIBAgIUEPbYi0KJgVtxyj4CzqAqsLKgfgowCgYIKoZIzj0EAwIw +IDEeMBwGA1UEAwwVc2hlbGxyZW50LXNkayB0ZXN0IENBMCAXDTI2MDkzMDE5MDMy +M1oYDzIxMjYwOTA2MTkwMzIzWjAgMR4wHAYDVQQDDBVzaGVsbHJlbnQtc2RrIHRl +c3QgQ0EwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAASpw2MdPH39Zp8By+0qwMuM +z2IR5NvjBjQl+RRjlcpvmF+uSnDj6UmpWGue1XpDPXuWaaDw8JnDjsTOKQE6azod +o2MwYTAfBgNVHSMEGDAWgBRm34Zc+OzZrD5qK2faQ44AEGJrtTAPBgNVHRMBAf8E +BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUZt+GXPjs2aw+aitn2kOO +ABBia7UwCgYIKoZIzj0EAwIDSQAwRgIhAKToobe8hti5hXVeUnKmXwJdVzga9IM4 +Ll4t3FORK4BkAiEAyJAW6axhEGWZRU6qiZWfCn5P8uWv5FK8Q2npm+qhOY0= +-----END CERTIFICATE----- diff --git a/tests/fixtures/tls/server-key.pem b/tests/fixtures/tls/server-key.pem new file mode 100644 index 0000000..df7d947 --- /dev/null +++ b/tests/fixtures/tls/server-key.pem @@ -0,0 +1,5 @@ +-----BEGIN PRIVATE KEY----- +MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgOqRhIfP2ZnDfKqhM +utv63jKNkWeBd26sVOnD7wHT9+ahRANCAAS+ck9s+RO9Qti60lZlUMvb1DE3Hy37 +e4loDo+U78U4KIduhS/WBofRDZELxcCf1x/sot2hZk8MJz3CraJisAOk +-----END PRIVATE KEY----- diff --git a/tests/fixtures/tls/server.pem b/tests/fixtures/tls/server.pem new file mode 100644 index 0000000..72415b2 --- /dev/null +++ b/tests/fixtures/tls/server.pem @@ -0,0 +1,12 @@ +-----BEGIN CERTIFICATE----- +MIIByzCCAXGgAwIBAgIUPDQahzDZiSMwPMb4TJG/qqmWwDQwCgYIKoZIzj0EAwIw +IDEeMBwGA1UEAwwVc2hlbGxyZW50LXNkayB0ZXN0IENBMCAXDTI2MDkzMDE5MDMy +M1oYDzIxMjYwOTA2MTkwMzIzWjAUMRIwEAYDVQQDDAlsb2NhbGhvc3QwWTATBgcq +hkjOPQIBBggqhkjOPQMBBwNCAAS+ck9s+RO9Qti60lZlUMvb1DE3Hy37e4loDo+U +78U4KIduhS/WBofRDZELxcCf1x/sot2hZk8MJz3CraJisAOko4GSMIGPMAwGA1Ud +EwEB/wQCMAAwDgYDVR0PAQH/BAQDAgeAMBMGA1UdJQQMMAoGCCsGAQUFBwMBMBoG +A1UdEQQTMBGCCWxvY2FsaG9zdIcEfwAAATAdBgNVHQ4EFgQUPQqH1G93W1ypoXLO +Xv85J8GBymwwHwYDVR0jBBgwFoAUZt+GXPjs2aw+aitn2kOOABBia7UwCgYIKoZI +zj0EAwIDSAAwRQIgXlsvb7EryRRglk1S+2QBXjQ3CxaMPhvAlqb7R3dWmukCIQDx +uw/viCwoOWl5J++U2wqvGsRKHrcd2MzbHMfiJTl3Zw== +-----END CERTIFICATE----- diff --git a/tests/integration/__init__.py b/tests/integration/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/integration/test_errors.py b/tests/integration/test_errors.py new file mode 100644 index 0000000..fae9922 --- /dev/null +++ b/tests/integration/test_errors.py @@ -0,0 +1,30 @@ +"""Error responses of the real API; skipped without SHELLRENT_CLIENT_ID and SHELLRENT_CLIENT_SECRET. + +The credentials need the purchases:read scope. +""" + +from __future__ import annotations + +import os + +import pytest + +from shellrent_sdk import ApiException, create_client, unwrap +from shellrent_sdk.client.api.purchases import get_purchase + +pytestmark = pytest.mark.skipif( + not (os.environ.get("SHELLRENT_CLIENT_ID") and os.environ.get("SHELLRENT_CLIENT_SECRET")), + reason="SHELLRENT_CLIENT_ID and SHELLRENT_CLIENT_SECRET are not set", +) + +#: No purchase has this ID. +MISSING_PURCHASE_ID = 2_147_483_647 + + +def test_a_missing_purchase_raises_api_exception_404() -> None: + with create_client() as client, pytest.raises(ApiException) as info: + unwrap(get_purchase.sync_detailed(MISSING_PURCHASE_ID, client=client)) + + assert info.value.status_code == 404 + assert info.value.error.error > 0 + assert info.value.error.message diff --git a/tests/integration/test_health.py b/tests/integration/test_health.py new file mode 100644 index 0000000..5b9ddd2 --- /dev/null +++ b/tests/integration/test_health.py @@ -0,0 +1,35 @@ +"""Calls the real API with the credentials in SHELLRENT_CLIENT_ID and SHELLRENT_CLIENT_SECRET +(and SHELLRENT_API_URL, if set); skipped without them.""" + +from __future__ import annotations + +import os + +import httpx +import pytest + +from shellrent_sdk import ClientCredentials, create_client, unwrap +from shellrent_sdk.client.api.health import get_health +from shellrent_sdk.http import client_args + +pytestmark = pytest.mark.skipif( + not (os.environ.get("SHELLRENT_CLIENT_ID") and os.environ.get("SHELLRENT_CLIENT_SECRET")), + reason="SHELLRENT_CLIENT_ID and SHELLRENT_CLIENT_SECRET are not set", +) + + +def test_gets_a_token() -> None: + args = client_args(ClientCredentials.from_env()) + + with httpx.Client(**args) as client: + token = args["auth"].get_token(client) + + assert token + + +def test_get_health() -> None: + with create_client() as client: + health = unwrap(get_health.sync_detailed(client=client)) + + assert health.error == 0 + assert health.data.status diff --git a/tests/servers.py b/tests/servers.py new file mode 100644 index 0000000..4cc826d --- /dev/null +++ b/tests/servers.py @@ -0,0 +1,125 @@ +"""Local servers for the tests of proxies and certificates: an HTTP proxy and an HTTPS server.""" + +from __future__ import annotations + +import contextlib +import json +import select +import socket +import ssl +import threading +from collections.abc import Iterator +from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer +from pathlib import Path + +TLS_DIR = Path(__file__).parent / "fixtures" / "tls" +#: Test CA that signed the certificate of the HTTPS server, for 127.0.0.1 and localhost. +CA_FILE = TLS_DIR / "ca.pem" +#: Name of CA_FILE in a directory for SSL_CERT_DIR: the OpenSSL hash of its subject. +CA_HASH_NAME = "2024fd72.0" + + +class Server(ThreadingHTTPServer): + daemon_threads = True + + def __init__(self, handler: type[BaseHTTPRequestHandler]) -> None: + super().__init__(("127.0.0.1", 0), handler) + #: Request lines received, such as "GET http://api.test/api/health". + self.requests: list[str] = [] + + @property + def port(self) -> int: + return int(self.server_address[1]) + + @property + def url(self) -> str: + return f"http://127.0.0.1:{self.port}" + + +class ProxyHandler(BaseHTTPRequestHandler): + """Answers the requests forwarded to it, and tunnels CONNECT to the host requested.""" + + server: Server + + def do_GET(self) -> None: + self.server.requests.append(f"{self.command} {self.path}") + if self.path.endswith("/oauth/token"): + self._reply({"access_token": "token-1", "expires_in": 600}) + else: + self._reply({"error": 0, "message": "", "data": {"target": self.path}, "meta": None}) + + def do_POST(self) -> None: + self.rfile.read(int(self.headers.get("Content-Length", 0))) + self.do_GET() + + def do_CONNECT(self) -> None: + self.server.requests.append(f"CONNECT {self.path}") + host, port = self.path.rsplit(":", 1) + with socket.create_connection((host, int(port))) as upstream: + self.send_response(200, "Connection established") + self.end_headers() + sockets = [self.connection, upstream] + while True: + readable, _, _ = select.select(sockets, [], [], 5) + if not readable: + break + for sock in readable: + data = sock.recv(65536) + if not data: + self.close_connection = True + return + (upstream if sock is self.connection else self.connection).sendall(data) + self.close_connection = True + + def _reply(self, body: object) -> None: + content = json.dumps(body).encode() + self.send_response(200) + self.send_header("Content-Type", "application/json") + self.send_header("Content-Length", str(len(content))) + self.end_headers() + self.wfile.write(content) + + def log_message(self, format: str, *args: object) -> None: + pass + + +class HelloHandler(BaseHTTPRequestHandler): + server: Server + + def do_GET(self) -> None: + self.server.requests.append(f"GET {self.path}") + self.send_response(200) + self.send_header("Content-Length", "5") + self.end_headers() + self.wfile.write(b"hello") + + def log_message(self, format: str, *args: object) -> None: + pass + + +@contextlib.contextmanager +def serve(server: Server) -> Iterator[Server]: + thread = threading.Thread(target=server.serve_forever, args=(0.05,), daemon=True) + thread.start() + try: + yield server + finally: + server.shutdown() + server.server_close() + + +@contextlib.contextmanager +def proxy_server() -> Iterator[Server]: + with serve(Server(ProxyHandler)) as server: + yield server + + +@contextlib.contextmanager +def tls_server() -> Iterator[Server]: + """HTTPS server with a certificate signed by the test CA: https://localhost:/.""" + context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER) + context.load_cert_chain(TLS_DIR / "server.pem", TLS_DIR / "server-key.pem") + server = Server(HelloHandler) + server.socket = context.wrap_socket(server.socket, server_side=True) + with serve(server): + yield server diff --git a/tests/support.py b/tests/support.py new file mode 100644 index 0000000..f46e136 --- /dev/null +++ b/tests/support.py @@ -0,0 +1,107 @@ +"""Fakes shared by the tests: the API behind an httpx.MockTransport, a clock, a sleep that does not sleep.""" + +from __future__ import annotations + +import json +from typing import Any + +import httpx + +from shellrent_sdk.auth import ClientCredentials + +CLIENT_ID = "client-id" +CLIENT_SECRET = "s3cr3t-never-shown" +API_URL = "https://api.test" +TOKEN_URL = f"{API_URL}/oauth/token" + + +def credentials(**kwargs: Any) -> ClientCredentials: + return ClientCredentials(CLIENT_ID, CLIENT_SECRET, api_url=API_URL, **kwargs) + + +def token_response(access_token: str = "token-1", expires_in: int = 600) -> httpx.Response: + return httpx.Response( + 200, + json={ + "access_token": access_token, + "token_type": "Bearer", + "expires_in": expires_in, + "scope": "purchases:read", + "audience": "api-public", + }, + ) + + +def json_response(status: int = 200, data: Any = None, **kwargs: Any) -> httpx.Response: + body = {"error": 0 if status < 400 else status, "message": "", "data": data or {}, "meta": None} + return httpx.Response(status, json=body, **kwargs) + + +def health_response() -> httpx.Response: + return json_response(200, {"status": "ok"}) + + +def error_response(status: int, message: str, **kwargs: Any) -> httpx.Response: + """An error response as the API sends it, with data and meta null.""" + body = {"error": status, "message": message, "data": None, "meta": None} + return httpx.Response(status, json=body, **kwargs) + + +class FakeApi: + """Handler of an httpx.MockTransport: answers with the given responses, in order.""" + + def __init__(self, *responses: httpx.Response) -> None: + self.responses = list(responses) + self.requests: list[httpx.Request] = [] + + def __call__(self, request: httpx.Request) -> httpx.Response: + # A copy: the request sent again after a 401 is the same object, with another token. + self.requests.append( + httpx.Request( + request.method, request.url, headers=request.headers.copy(), content=request.read() + ) + ) + if not self.responses: + raise AssertionError(f"Unexpected request: {request.method} {request.url}") + return self.responses.pop(0) + + @property + def token_requests(self) -> list[httpx.Request]: + return [request for request in self.requests if str(request.url) == TOKEN_URL] + + @property + def api_requests(self) -> list[httpx.Request]: + return [request for request in self.requests if str(request.url) != TOKEN_URL] + + def transport(self) -> httpx.MockTransport: + return httpx.MockTransport(self) + + +def form(request: httpx.Request) -> dict[str, str]: + """The form-urlencoded body of a request.""" + return dict(httpx.QueryParams(request.content.decode())) + + +def body(request: httpx.Request) -> Any: + return json.loads(request.content) + + +class FakeClock: + def __init__(self, now: float = 1_000_000.0) -> None: + self.now = now + + def __call__(self) -> float: + return self.now + + +class Sleeps: + """Records the waits instead of sleeping, sync or async.""" + + def __init__(self) -> None: + self.delays: list[float] = [] + + def sleep(self, delay: float) -> None: + self.delays.append(delay) + + async def async_sleep(self, delay: float) -> None: + self.delays.append(delay) diff --git a/tests/unit/__init__.py b/tests/unit/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/unit/test_auth.py b/tests/unit/test_auth.py new file mode 100644 index 0000000..fc59696 --- /dev/null +++ b/tests/unit/test_auth.py @@ -0,0 +1,527 @@ +from __future__ import annotations + +import asyncio +import logging +import threading +import time + +import httpx +import pytest + +from shellrent_sdk.auth import ( + ClientCredentials, + MemoryTokenStore, + OAuth2Auth, + TokenError, +) +from tests.support import ( + API_URL, + CLIENT_ID, + CLIENT_SECRET, + TOKEN_URL, + FakeApi, + FakeClock, + body, + credentials, + error_response, + form, + health_response, + token_response, +) + + +def sync_client(api: FakeApi, auth: OAuth2Auth) -> httpx.Client: + return httpx.Client(base_url=API_URL, auth=auth, transport=api.transport()) + + +def async_client(api: FakeApi, auth: OAuth2Auth) -> httpx.AsyncClient: + return httpx.AsyncClient(base_url=API_URL, auth=auth, transport=api.transport()) + + +class RecordingStore(MemoryTokenStore): + def __init__(self) -> None: + super().__init__() + self.writes: list[tuple[str, str, int]] = [] + + def set(self, key: str, value: str, ttl: int) -> None: + self.writes.append((key, value, ttl)) + super().set(key, value, ttl) + + +class FailingStore: + def get(self, key: str) -> str | None: + raise OSError("read-only file system") + + def set(self, key: str, value: str, ttl: int) -> None: + raise OSError("read-only file system") + + def delete(self, key: str) -> None: + raise OSError("read-only file system") + + +# ClientCredentials + + +def test_credentials_derive_the_token_url_from_the_api_url() -> None: + creds = ClientCredentials("id", "secret", api_url="https://api.staging.test/") + + assert creds.api_url == "https://api.staging.test" + assert creds.token_url == "https://api.staging.test/oauth/token" + assert ClientCredentials("id", "secret").token_url == "https://api.shellrent.com/oauth/token" + + +def test_credentials_keep_the_secret_out_of_repr() -> None: + creds = credentials(scopes=["purchases:read"], audience="api-public") + + assert CLIENT_SECRET not in repr(creds) + assert CLIENT_SECRET not in str(creds) + assert "client-id" in repr(creds) + assert creds.client_secret == CLIENT_SECRET + + +def test_credentials_treat_empty_scopes_as_all_scopes() -> None: + assert credentials(scopes=[]).scopes is None + assert credentials(scopes=("a", "b")).scopes == ("a", "b") + + +def test_credentials_reject_invalid_values() -> None: + with pytest.raises(ValueError, match="must not be empty"): + ClientCredentials("id", "") + with pytest.raises(TypeError, match="not a string"): + ClientCredentials("id", "secret", scopes="purchases:read") + + +def test_credentials_from_env(monkeypatch: pytest.MonkeyPatch) -> None: + monkeypatch.setenv("SHELLRENT_CLIENT_ID", "env-id") + monkeypatch.setenv("SHELLRENT_CLIENT_SECRET", "env-secret") + monkeypatch.setenv("SHELLRENT_SCOPES", " purchases:read, billing:read shop:read ") + monkeypatch.setenv("SHELLRENT_API_URL", "https://api.staging.test") + + creds = ClientCredentials.from_env() + + assert creds.client_id == "env-id" + assert creds.client_secret == "env-secret" + assert creds.scopes == ("purchases:read", "billing:read", "shop:read") + assert creds.audience is None + assert creds.token_url == "https://api.staging.test/oauth/token" + + +def test_credentials_from_env_with_defaults(monkeypatch: pytest.MonkeyPatch) -> None: + monkeypatch.setenv("SHELLRENT_CLIENT_ID", "env-id") + monkeypatch.setenv("SHELLRENT_CLIENT_SECRET", "env-secret") + monkeypatch.setenv("SHELLRENT_SCOPES", "") + monkeypatch.delenv("SHELLRENT_API_URL", raising=False) + + creds = ClientCredentials.from_env() + + assert creds.scopes is None + assert creds.api_url == "https://api.shellrent.com" + + +def test_credentials_from_env_require_id_and_secret(monkeypatch: pytest.MonkeyPatch) -> None: + monkeypatch.setenv("SHELLRENT_CLIENT_ID", "env-id") + monkeypatch.delenv("SHELLRENT_CLIENT_SECRET", raising=False) + + with pytest.raises(ValueError, match="SHELLRENT_CLIENT_SECRET"): + ClientCredentials.from_env() + + +# Token requests + + +def test_requests_a_token_and_sends_it() -> None: + api = FakeApi(token_response("token-1"), health_response()) + + with sync_client(api, OAuth2Auth(credentials())) as client: + response = client.get("/api/health") + + assert response.status_code == 200 + token_request, api_request = api.requests + assert token_request.method == "POST" + assert str(token_request.url) == TOKEN_URL + assert token_request.headers["Content-Type"] == "application/x-www-form-urlencoded" + assert form(token_request) == { + "grant_type": "client_credentials", + "client_id": CLIENT_ID, + "client_secret": CLIENT_SECRET, + } + assert "Authorization" not in token_request.headers + assert api_request.headers["Authorization"] == "Bearer token-1" + + +def test_requests_the_given_scopes_and_audience() -> None: + api = FakeApi(token_response(), health_response()) + creds = credentials(scopes=["purchases:read", "billing:read"], audience="api-internal") + + with sync_client(api, OAuth2Auth(creds)) as client: + client.get("/api/health") + + assert form(api.token_requests[0])["scope"] == "purchases:read billing:read" + assert form(api.token_requests[0])["audience"] == "api-internal" + + +def test_reuses_the_token_until_60_seconds_before_it_expires() -> None: + clock = FakeClock() + api = FakeApi( + token_response("token-1", expires_in=600), + health_response(), + health_response(), + token_response("token-2", expires_in=600), + health_response(), + ) + + with sync_client(api, OAuth2Auth(credentials(), clock=clock)) as client: + client.get("/api/health") + clock.now += 539 + client.get("/api/health") + clock.now += 1 + client.get("/api/health") + + assert len(api.token_requests) == 2 + assert [r.headers["Authorization"] for r in api.api_requests] == [ + "Bearer token-1", + "Bearer token-1", + "Bearer token-2", + ] + + +def test_shares_the_token_through_the_store() -> None: + store = MemoryTokenStore() + api = FakeApi(token_response("token-1"), health_response(), health_response()) + + with sync_client(api, OAuth2Auth(credentials(), store)) as client: + client.get("/api/health") + with sync_client(api, OAuth2Auth(credentials(), store)) as client: + client.get("/api/health") + + assert len(api.token_requests) == 1 + assert api.api_requests[1].headers["Authorization"] == "Bearer token-1" + + +def test_keeps_the_tokens_of_different_scopes_apart() -> None: + store = MemoryTokenStore() + api = FakeApi( + token_response("token-1"), health_response(), token_response("token-2"), health_response() + ) + + with sync_client(api, OAuth2Auth(credentials(scopes=["a"]), store)) as client: + client.get("/api/health") + with sync_client(api, OAuth2Auth(credentials(scopes=["b"]), store)) as client: + client.get("/api/health") + + assert len(api.token_requests) == 2 + + +def test_never_stores_the_secret() -> None: + store = RecordingStore() + api = FakeApi(token_response("token-1", expires_in=600), health_response()) + + with sync_client(api, OAuth2Auth(credentials(), store)) as client: + client.get("/api/health") + + [(key, value, ttl)] = store.writes + assert ttl == 540 + assert "token-1" in value + assert CLIENT_SECRET not in key + assert CLIENT_SECRET not in value + + +def test_works_when_the_store_fails(caplog: pytest.LogCaptureFixture) -> None: + api = FakeApi(token_response("token-1"), health_response(), health_response()) + + with ( + caplog.at_level(logging.WARNING), + sync_client(api, OAuth2Auth(credentials(), FailingStore())) as client, + ): + client.get("/api/health") + client.get("/api/health") + + assert len(api.token_requests) == 1 + assert "read-only file system" in caplog.text + + +# 401 + + +def test_retries_once_with_a_new_token_after_401() -> None: + api = FakeApi( + token_response("token-1"), + error_response(401, "Token revoked"), + token_response("token-2"), + health_response(), + ) + + with sync_client(api, OAuth2Auth(credentials())) as client: + response = client.get("/api/health") + + assert response.status_code == 200 + assert [r.headers["Authorization"] for r in api.api_requests] == [ + "Bearer token-1", + "Bearer token-2", + ] + + +def test_returns_the_second_401() -> None: + api = FakeApi( + token_response("token-1"), + error_response(401, "Not authorized"), + token_response("token-2"), + error_response(401, "Not authorized"), + ) + + with sync_client(api, OAuth2Auth(credentials())) as client: + response = client.get("/api/health") + + assert response.status_code == 401 + assert len(api.requests) == 4 + + +def test_401_removes_the_token_from_the_store() -> None: + store = MemoryTokenStore() + api = FakeApi( + token_response("token-1"), + error_response(401, "Token revoked"), + token_response("token-2"), + health_response(), + health_response(), + ) + + with sync_client(api, OAuth2Auth(credentials(), store)) as client: + client.get("/api/health") + # Another client, as another process would, finds the new token. + with sync_client(api, OAuth2Auth(credentials(), store)) as client: + client.get("/api/health") + + assert len(api.token_requests) == 2 + assert api.api_requests[-1].headers["Authorization"] == "Bearer token-2" + + +def test_sends_the_body_again_after_401() -> None: + api = FakeApi( + token_response("token-1"), + error_response(401, "Expired"), + token_response("token-2"), + health_response(), + ) + + with sync_client(api, OAuth2Auth(credentials())) as client: + client.post("/api/v3/orders/pay", json={"order_ids": [1]}) + + first, second = api.api_requests + assert body(first) == body(second) == {"order_ids": [1]} + + +# TokenError + + +def test_token_endpoint_errors_raise_token_error() -> None: + api = FakeApi( + httpx.Response( + 401, + json={"error": "invalid_client", "error_description": "Client authentication failed"}, + ) + ) + + with sync_client(api, OAuth2Auth(credentials())) as client, pytest.raises(TokenError) as info: + client.get("/api/health") + + assert info.value.error == "invalid_client" + assert info.value.error_description == "Client authentication failed" + assert info.value.status_code == 401 + assert str(info.value) == ( + f"The token endpoint {TOKEN_URL} answered HTTP 401: invalid_client (Client authentication failed)" + ) + assert CLIENT_SECRET not in str(info.value) + assert len(api.api_requests) == 0 + + +def test_token_error_for_the_rate_limit_of_the_token_endpoint() -> None: + body = {"error": "rate_limited", "error_description": "Too many requests."} + api = FakeApi(httpx.Response(429, json=body, headers={"Retry-After": "15"})) + + with sync_client(api, OAuth2Auth(credentials())) as client, pytest.raises(TokenError) as info: + client.get("/api/health") + + assert info.value.status_code == 429 + assert info.value.error == "rate_limited" + assert info.value.error_description == "Too many requests." + assert str(info.value).endswith("answered HTTP 429: rate_limited (Too many requests.)") + + +def test_token_error_for_a_response_without_token() -> None: + api = FakeApi(httpx.Response(200, json={"token_type": "Bearer"})) + + with sync_client(api, OAuth2Auth(credentials())) as client, pytest.raises(TokenError) as info: + client.get("/api/health") + + assert info.value.error is None + assert info.value.status_code == 200 + assert "without a valid access token" in str(info.value) + + +def test_token_error_for_a_response_that_is_not_json() -> None: + api = FakeApi(httpx.Response(502, text="Bad gateway")) + + with sync_client(api, OAuth2Auth(credentials())) as client, pytest.raises(TokenError) as info: + client.get("/api/health") + + assert info.value.status_code == 502 + assert info.value.error is None + + +# Async and concurrency + + +def test_works_with_the_async_client() -> None: + api = FakeApi( + token_response("token-1"), + health_response(), + error_response(401, "Token revoked"), + token_response("token-2"), + health_response(), + ) + + async def run() -> list[int]: + async with async_client(api, OAuth2Auth(credentials())) as client: + first = await client.get("/api/health") + second = await client.get("/api/health") + return [first.status_code, second.status_code] + + assert asyncio.run(run()) == [200, 200] + assert [r.headers["Authorization"] for r in api.api_requests] == [ + "Bearer token-1", + "Bearer token-1", + "Bearer token-2", + ] + + +def test_sync_and_async_clients_share_the_token() -> None: + auth = OAuth2Auth(credentials()) + api = FakeApi(token_response("token-1"), health_response(), health_response()) + + with sync_client(api, auth) as client: + client.get("/api/health") + + async def run() -> None: + async with async_client(api, auth) as client: + await client.get("/api/health") + + asyncio.run(run()) + assert len(api.token_requests) == 1 + + +def test_concurrent_tasks_request_a_single_token() -> None: + token_requests = 0 + + async def handler(request: httpx.Request) -> httpx.Response: + nonlocal token_requests + if str(request.url) == TOKEN_URL: + token_requests += 1 + await asyncio.sleep(0.01) + return token_response() + return health_response() + + async def run() -> None: + transport = httpx.MockTransport(handler) + async with httpx.AsyncClient( + base_url=API_URL, auth=OAuth2Auth(credentials()), transport=transport + ) as client: + await asyncio.gather(*(client.get("/api/health") for _ in range(10))) + + asyncio.run(run()) + assert token_requests == 1 + + +def test_works_in_more_than_one_event_loop() -> None: + clock = FakeClock() + auth = OAuth2Auth(credentials(), clock=clock) + + async def handler(request: httpx.Request) -> httpx.Response: + if str(request.url) == TOKEN_URL: + await asyncio.sleep(0.01) + return token_response() + return health_response() + + async def run() -> list[int]: + async with httpx.AsyncClient( + base_url=API_URL, auth=auth, transport=httpx.MockTransport(handler) + ) as client: + responses = await asyncio.gather(*(client.get("/api/health") for _ in range(3))) + return [response.status_code for response in responses] + + assert asyncio.run(run()) == [200] * 3 + clock.now += 600 # The next loop needs a new token, and waits on the lock again. + assert asyncio.run(run()) == [200] * 3 + + +def test_concurrent_threads_request_a_single_token() -> None: + token_requests = 0 + counter_lock = threading.Lock() + + def handler(request: httpx.Request) -> httpx.Response: + nonlocal token_requests + if str(request.url) == TOKEN_URL: + with counter_lock: + token_requests += 1 + time.sleep(0.05) + return token_response() + return health_response() + + auth = OAuth2Auth(credentials()) + client = httpx.Client(base_url=API_URL, auth=auth, transport=httpx.MockTransport(handler)) + statuses: list[int] = [] + + def call() -> None: + statuses.append(client.get("/api/health").status_code) + + threads = [threading.Thread(target=call) for _ in range(8)] + for thread in threads: + thread.start() + for thread in threads: + thread.join() + client.close() + + assert statuses == [200] * 8 + assert token_requests == 1 + + +# get_token + + +def test_get_token_uses_the_client_and_the_cache() -> None: + api = FakeApi(token_response("token-1")) + auth = OAuth2Auth(credentials()) + + with httpx.Client( + auth=auth, transport=api.transport(), headers={"User-Agent": "test-agent"} + ) as client: + assert auth.get_token(client) == "token-1" + assert auth.get_token(client) == "token-1" + + [request] = api.requests + assert request.headers["User-Agent"] == "test-agent" + assert "Authorization" not in request.headers + + +def test_aget_token() -> None: + api = FakeApi(token_response("token-1")) + auth = OAuth2Auth(credentials()) + + async def run() -> str: + async with httpx.AsyncClient(auth=auth, transport=api.transport()) as client: + await auth.aget_token(client) + return await auth.aget_token(client) + + assert asyncio.run(run()) == "token-1" + assert len(api.requests) == 1 + + +def test_get_token_raises_token_error() -> None: + api = FakeApi(httpx.Response(400, json={"error": "invalid_scope"})) + auth = OAuth2Auth(credentials()) + + with ( + httpx.Client(transport=api.transport()) as client, + pytest.raises(TokenError, match="invalid_scope"), + ): + auth.get_token(client) diff --git a/tests/unit/test_cli.py b/tests/unit/test_cli.py new file mode 100644 index 0000000..33693f5 --- /dev/null +++ b/tests/unit/test_cli.py @@ -0,0 +1,254 @@ +from __future__ import annotations + +import io +import json +from pathlib import Path +from typing import Any + +import httpx +import pytest + +import shellrent_sdk.http +from shellrent_sdk import cli +from shellrent_sdk.http import RetryTransport +from tests.support import ( + API_URL, + CLIENT_ID, + CLIENT_SECRET, + TOKEN_URL, + FakeApi, + Sleeps, + body, + error_response, + health_response, + token_response, +) + + +@pytest.fixture +def api(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> FakeApi: + """The fake API behind the CLI, with the credentials in the environment.""" + monkeypatch.setenv("SHELLRENT_CLIENT_ID", CLIENT_ID) + monkeypatch.setenv("SHELLRENT_CLIENT_SECRET", CLIENT_SECRET) + monkeypatch.setenv("SHELLRENT_API_URL", API_URL) + monkeypatch.setenv("SHELLRENT_TOKEN_CACHE", str(tmp_path / "cache")) + monkeypatch.delenv("SHELLRENT_SCOPES", raising=False) + + fake = FakeApi() + real_client_args = shellrent_sdk.http.client_args + + def client_args(*args: Any, **kwargs: Any) -> dict[str, Any]: + result = real_client_args(*args, **kwargs) + result["transport"] = RetryTransport(fake.transport(), sleep=Sleeps().sleep) + return result + + monkeypatch.setattr(cli, "client_args", client_args) + return fake + + +def run(capsys: pytest.CaptureFixture[str], *argv: str) -> tuple[int, str, str]: + status = cli.main(list(argv)) + out, err = capsys.readouterr() + assert CLIENT_SECRET not in out + assert CLIENT_SECRET not in err + return status, out, err + + +# shellrent api + + +def test_prints_the_body_and_exits_0(api: FakeApi, capsys: pytest.CaptureFixture[str]) -> None: + api.responses += [token_response(), health_response()] + + status, out, err = run(capsys, "api", "get", "/api/health") + + assert status == 0 + assert json.loads(out)["data"] == {"status": "ok"} + assert err == "" + assert api.requests[1].method == "GET" + assert str(api.requests[1].url) == f"{API_URL}/api/health" + + +def test_calls_any_path_with_its_query_string( + api: FakeApi, capsys: pytest.CaptureFixture[str] +) -> None: + api.responses += [token_response(), health_response()] + + status, _, _ = run(capsys, "api", "GET", "api/internal/v3/customers?page=2") + + assert status == 0 + assert str(api.requests[1].url) == f"{API_URL}/api/internal/v3/customers?page=2" + + +def test_http_errors_exit_1_with_the_body_on_stdout( + api: FakeApi, capsys: pytest.CaptureFixture[str] +) -> None: + api.responses += [token_response(), error_response(404, "Purchase not found")] + + status, out, err = run(capsys, "api", "GET", "/api/v3/purchases/1") + + assert status == 1 + assert json.loads(out)["message"] == "Purchase not found" + assert err == "shellrent: HTTP 404 Not Found: Purchase not found\n" + + +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]}') + + assert status == 0 + request = api.requests[1] + assert request.method == "POST" + assert request.headers["Content-Type"] == "application/json" + assert body(request) == {"order_ids": [1]} + + +def test_sends_data_from_a_file( + api: FakeApi, capsys: pytest.CaptureFixture[str], tmp_path: Path +) -> None: + api.responses += [token_response(), health_response()] + data = tmp_path / "body.json" + data.write_text('{"order_ids": [2]}') + + status, _, _ = run(capsys, "api", "POST", "/api/v3/orders/pay", "--data", f"@{data}") + + assert status == 0 + assert body(api.requests[1]) == {"order_ids": [2]} + + +def test_sends_data_from_stdin( + api: FakeApi, capsys: pytest.CaptureFixture[str], monkeypatch: pytest.MonkeyPatch +) -> None: + 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", "-") + + assert status == 0 + assert body(api.requests[1]) == {"order_ids": [3]} + + +@pytest.mark.parametrize( + ("argv", "message"), + [ + (["api", "GET", "/x", "--data", "{not json"], "not valid JSON"), + ( + ["api", "GET", "/x", "--data", "@/does/not/exist.json"], + "cannot read /does/not/exist.json", + ), + (["api", "GET", "https://example.com/api/v3/purchases"], "not a URL"), + (["api", "GET", "//example.com/api/v3/purchases"], "not a URL"), + (["api", "G E T", "/x"], "invalid METHOD"), + ], +) +def test_usage_errors_exit_2( + api: FakeApi, capsys: pytest.CaptureFixture[str], argv: list[str], message: str +) -> None: + status, out, err = run(capsys, *argv) + + assert status == 2 + assert out == "" + assert message in err + assert api.requests == [] + + +def test_argument_errors_exit_2(capsys: pytest.CaptureFixture[str]) -> None: + assert run(capsys, "api", "GET")[0] == 2 + assert run(capsys)[0] == 2 + + +def test_missing_credentials_exit_2( + api: FakeApi, capsys: pytest.CaptureFixture[str], monkeypatch: pytest.MonkeyPatch +) -> None: + monkeypatch.delenv("SHELLRENT_CLIENT_SECRET") + + status, out, err = run(capsys, "api", "GET", "/api/health") + + assert status == 2 + assert out == "" + assert "SHELLRENT_CLIENT_SECRET" in err + + +def test_token_errors_exit_2(api: FakeApi, capsys: pytest.CaptureFixture[str]) -> None: + api.responses += [ + httpx.Response( + 401, + json={"error": "invalid_client", "error_description": "Client authentication failed"}, + ) + ] + + status, out, err = run(capsys, "api", "GET", "/api/health") + + assert status == 2 + assert out == "" + assert err == ( + f"shellrent: The token endpoint {TOKEN_URL} answered HTTP 401: " + "invalid_client (Client authentication failed)\n" + ) + + +def test_network_errors_exit_1( + capsys: pytest.CaptureFixture[str], monkeypatch: pytest.MonkeyPatch, api: FakeApi +) -> None: + def fail(request: httpx.Request) -> httpx.Response: + raise httpx.ConnectError("Name or service not known", request=request) + + real_client_args = shellrent_sdk.http.client_args + monkeypatch.setattr( + cli, + "client_args", + lambda *a, **k: {**real_client_args(*a, **k), "transport": httpx.MockTransport(fail)}, + ) + + status, _, err = run(capsys, "api", "GET", "/api/health") + + assert status == 1 + assert err == "shellrent: request failed: Name or service not known\n" + + +# shellrent token + + +def test_token_prints_a_token_from_the_cache( + api: FakeApi, capsys: pytest.CaptureFixture[str], tmp_path: Path +) -> None: + api.responses += [token_response("token-1")] + + assert run(capsys, "token") == (0, "token-1\n", "") + assert run(capsys, "token") == (0, "token-1\n", "") + assert len(api.requests) == 1 + [file] = (tmp_path / "cache").iterdir() + assert CLIENT_SECRET not in file.read_text() + + +def test_the_cache_can_be_turned_off( + api: FakeApi, + capsys: pytest.CaptureFixture[str], + monkeypatch: pytest.MonkeyPatch, + tmp_path: Path, +) -> None: + monkeypatch.setenv("SHELLRENT_TOKEN_CACHE", "off") + api.responses += [token_response("token-1"), token_response("token-2")] + + assert run(capsys, "token")[1] == "token-1\n" + assert run(capsys, "token")[1] == "token-2\n" + assert not (tmp_path / "cache").exists() + + +def test_the_api_command_uses_the_cached_token( + api: FakeApi, capsys: pytest.CaptureFixture[str] +) -> None: + api.responses += [token_response("token-1"), health_response(), health_response()] + + run(capsys, "api", "GET", "/api/health") + run(capsys, "api", "GET", "/api/health") + + assert len(api.token_requests) == 1 + + +def test_version(capsys: pytest.CaptureFixture[str]) -> None: + status, out, _ = run(capsys, "--version") + + assert status == 0 + assert out.startswith("shellrent ") diff --git a/tests/unit/test_client.py b/tests/unit/test_client.py new file mode 100644 index 0000000..058d0fc --- /dev/null +++ b/tests/unit/test_client.py @@ -0,0 +1,275 @@ +from __future__ import annotations + +import asyncio +import json +from typing import Any + +import httpx +import pytest + +import shellrent_sdk._factory +import shellrent_sdk.http +from shellrent_sdk import ApiException, UnexpectedStatus, create_client, unwrap +from shellrent_sdk.client import AuthenticatedClient +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.purchases import get_purchase, list_tasks +from shellrent_sdk.client.api.shop import pay_orders +from shellrent_sdk.client.models import ( + ApiError, + HealthStatusResponse, + OrderPayRequest, + Payment, +) +from shellrent_sdk.http import RetryTransport, default_user_agent +from tests.support import ( + API_URL, + CLIENT_ID, + TOKEN_URL, + FakeApi, + Sleeps, + credentials, + error_response, + health_response, + token_response, +) + + +@pytest.fixture +def api(monkeypatch: pytest.MonkeyPatch) -> FakeApi: + """The fake API, behind the transport of the clients made by create_client().""" + fake = FakeApi() + real_client_args = shellrent_sdk.http.client_args + + def client_args(*args: Any, **kwargs: Any) -> dict[str, Any]: + result = real_client_args(*args, **kwargs) + if "transport" in result: + result["transport"] = RetryTransport( + fake.transport(), fake.transport(), sleep=Sleeps().sleep + ) + else: + result["transport"] = fake.transport() + return result + + monkeypatch.setattr(shellrent_sdk._factory, "client_args", client_args) + return fake + + +def test_creates_the_generated_client() -> None: + client = create_client(credentials()) + + assert isinstance(client, AuthenticatedClient) + assert client.raise_on_unexpected_status is True + assert client.get_httpx_client().base_url == httpx.URL(API_URL) + assert client.get_httpx_client().timeout == httpx.Timeout(30.0) + + +def test_reads_the_credentials_from_the_environment( + monkeypatch: pytest.MonkeyPatch, api: FakeApi +) -> None: + monkeypatch.setenv("SHELLRENT_CLIENT_ID", "env-id") + monkeypatch.setenv("SHELLRENT_CLIENT_SECRET", "env-secret") + monkeypatch.setenv("SHELLRENT_API_URL", "https://api.staging.test") + api.responses += [token_response(), health_response()] + + get_health.sync(client=create_client()) + + assert [str(r.url) for r in api.requests] == [ + "https://api.staging.test/oauth/token", + "https://api.staging.test/api/health", + ] + + +def test_calls_the_api_with_token_and_user_agent(api: FakeApi) -> None: + api.responses += [token_response("token-1"), health_response()] + + health = get_health.sync(client=create_client(credentials())) + + assert isinstance(health, HealthStatusResponse) + assert health.data.status == "ok" + token_request, api_request = api.requests + assert str(token_request.url) == TOKEN_URL + assert api_request.headers["Authorization"] == "Bearer token-1" + assert api_request.headers["User-Agent"] == default_user_agent() + assert token_request.headers["User-Agent"] == default_user_agent() + + +def test_works_with_the_async_functions(api: FakeApi) -> None: + api.responses += [token_response("token-1"), health_response(), health_response()] + client = create_client(credentials()) + + async def run() -> None: + async with client: + await get_health.asyncio(client=client) + + asyncio.run(run()) + get_health.sync(client=client) + assert len(api.token_requests) == 1 + + +def test_retries_429(api: FakeApi) -> None: + api.responses += [ + token_response(), + error_response(429, "Too Many Requests", headers={"Retry-After": "1"}), + health_response(), + ] + + health = get_health.sync(client=create_client(credentials())) + + assert isinstance(health, HealthStatusResponse) + + +def test_documented_errors_are_returned_as_api_error(api: FakeApi) -> None: + api.responses += [token_response(), error_response(404, "Purchase not found")] + + result = get_purchase.sync(123, client=create_client(credentials())) + + assert isinstance(result, ApiError) + assert result.message == "Purchase not found" + assert result.data is None + assert result.meta is None + + +def test_unwrap_returns_the_parsed_body(api: FakeApi) -> None: + api.responses += [token_response(), health_response()] + + health: HealthStatusResponse = unwrap( + get_health.sync_detailed(client=create_client(credentials())) + ) + + assert health.data.status == "ok" + + +def test_unwrap_raises_api_exception(api: FakeApi) -> None: + api.responses += [ + token_response(), + error_response(404, "Purchase not found", headers={"X-Request-Id": "abc"}), + ] + + with pytest.raises(ApiException) as info: + unwrap(get_purchase.sync_detailed(123, client=create_client(credentials()))) + + assert info.value.status_code == 404 + assert info.value.error.message == "Purchase not found" + assert info.value.headers["X-Request-Id"] == "abc" + assert str(info.value) == "HTTP 404: Purchase not found" + + +def test_undocumented_status_codes_raise_unexpected_status(api: FakeApi) -> None: + api.responses += [token_response(), error_response(503, "Maintenance")] + + with pytest.raises(UnexpectedStatus) as info: + get_purchase.sync(123, client=create_client(credentials())) + + assert info.value.status_code == 503 + + +def test_inline_envelopes_accept_null_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()) + + # 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)) + + assert (payment.data, payment.message, payment.meta) == (None, None, None) + assert (antivirus.data, antivirus.message, antivirus.meta) == (None, None, 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": 20}, + } + api.responses += [token_response(), httpx.Response(200, json=body)] + + unwrap(list_tasks.sync_detailed(client=create_client(credentials()))) + + assert dict(api.api_requests[0].url.params) == { + "alive_only": "true", + "page": "1", + "per_page": "20", + } + + +def test_downloads_return_the_bytes(api: FakeApi) -> None: + pdf = b"%PDF-1.7 binary \x00\xff" + api.responses += [ + token_response(), + httpx.Response( + 200, + content=pdf, + headers={ + "Content-Type": "application/pdf", + "Content-Disposition": 'attachment; filename="1.pdf"', + }, + ), + ] + + response = download_invoice_pdf.sync_detailed(1, client=create_client(credentials())) + file = unwrap(response) + + assert file.payload.read() == pdf + assert response.headers["Content-Disposition"] == 'attachment; filename="1.pdf"' + + +def test_a_429_after_the_retries_raises_api_exception(api: FakeApi) -> None: + too_many_requests = error_response(429, "Too Many Requests", headers={"Retry-After": "1"}) + api.responses += [token_response(), too_many_requests, too_many_requests, too_many_requests] + + with pytest.raises(ApiException) as info: + unwrap(get_purchase.sync_detailed(123, client=create_client(credentials()))) + + assert info.value.status_code == 429 + assert info.value.headers["Retry-After"] == "1" + assert len(api.api_requests) == 3 + + +def test_without_retry(api: FakeApi) -> None: + api.responses += [ + token_response(), + error_response(429, "Too Many Requests", headers={"Retry-After": "1"}), + ] + + with pytest.raises(ApiException) as info: + unwrap(get_purchase.sync_detailed(123, client=create_client(credentials(), retry=False))) + + assert info.value.status_code == 429 + assert len(api.api_requests) == 1 + assert CLIENT_ID not in str(info.value) + + +PAYMENT = { + "payment_id": 7, + "payment_method": "prepaid_credit", + "payment_code": "PAY-7", + "amount_total": {"amount": 12.2, "currency": "EUR"}, + "amount_payed": {"amount": 12.2, "currency": "EUR"}, + "date_payment": "2026-09-30T12:00:00+02:00", + "payed": True, + "prepaid_credit_operations": [], + "provider_data": 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) + + result = unwrap(pay_orders.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, + } diff --git a/tests/unit/test_environment.py b/tests/unit/test_environment.py new file mode 100644 index 0000000..2ca3f5c --- /dev/null +++ b/tests/unit/test_environment.py @@ -0,0 +1,207 @@ +"""RetryTransport follows the proxy and certificate settings of the environment, as httpx does.""" + +from __future__ import annotations + +import asyncio +import shutil +from collections.abc import Iterator +from pathlib import Path + +import httpx +import pytest + +from shellrent_sdk.auth import ClientCredentials +from shellrent_sdk.http import RetryTransport, client_args +from tests.servers import CA_FILE, CA_HASH_NAME, Server, proxy_server, tls_server + +ENVIRONMENT = [ + "HTTP_PROXY", + "HTTPS_PROXY", + "ALL_PROXY", + "NO_PROXY", + "SSL_CERT_FILE", + "SSL_CERT_DIR", + "REQUEST_METHOD", +] + +#: A port where nothing listens: a request sent there fails. +CLOSED = "http://127.0.0.1:9" + + +@pytest.fixture(autouse=True) +def clean_environment(monkeypatch: pytest.MonkeyPatch) -> None: + for name in ENVIRONMENT: + monkeypatch.delenv(name, raising=False) + monkeypatch.delenv(name.lower(), raising=False) + + +@pytest.fixture +def proxy() -> Iterator[Server]: + with proxy_server() as server: + yield server + + +@pytest.fixture +def https() -> Iterator[Server]: + with tls_server() as server: + yield server + + +def get(url: str, transport: RetryTransport) -> httpx.Response: + with httpx.Client(transport=transport) as client: + return client.get(url) + + +def target(response: httpx.Response) -> str: + """The request target seen by the proxy.""" + return str(response.json()["data"]["target"]) + + +# Proxies + + +def test_uses_http_proxy(monkeypatch: pytest.MonkeyPatch, proxy: Server) -> None: + monkeypatch.setenv("HTTP_PROXY", proxy.url) + + response = get("http://api.example.test/api/health", RetryTransport()) + + assert target(response) == "http://api.example.test/api/health" + + +def test_uses_all_proxy(monkeypatch: pytest.MonkeyPatch, proxy: Server) -> None: + monkeypatch.setenv("all_proxy", proxy.url) + + response = get("http://api.example.test/api/health", RetryTransport()) + + assert target(response) == "http://api.example.test/api/health" + + +def test_accepts_proxies_without_scheme(monkeypatch: pytest.MonkeyPatch, proxy: Server) -> None: + monkeypatch.setenv("HTTP_PROXY", f"127.0.0.1:{proxy.port}") + + response = get("http://api.example.test/api/health", RetryTransport()) + + assert target(response) == "http://api.example.test/api/health" + + +def test_uses_https_proxy_with_ssl_cert_file( + monkeypatch: pytest.MonkeyPatch, proxy: Server, https: Server +) -> None: + monkeypatch.setenv("HTTPS_PROXY", proxy.url) + monkeypatch.setenv("HTTP_PROXY", CLOSED) + monkeypatch.setenv("SSL_CERT_FILE", str(CA_FILE)) + + response = get(f"https://localhost:{https.port}/api/health", RetryTransport()) + + assert response.text == "hello" + assert proxy.requests == [f"CONNECT localhost:{https.port}"] + + +def test_no_proxy_skips_the_proxy(monkeypatch: pytest.MonkeyPatch, proxy: Server) -> None: + monkeypatch.setenv("HTTP_PROXY", CLOSED) + monkeypatch.setenv("NO_PROXY", "example.org, 127.0.0.1") + + response = get(f"{proxy.url}/api/health", RetryTransport()) + + assert target(response) == "/api/health" + + +def test_no_proxy_star_skips_every_proxy(monkeypatch: pytest.MonkeyPatch, proxy: Server) -> None: + monkeypatch.setenv("ALL_PROXY", CLOSED) + monkeypatch.setenv("NO_PROXY", "*") + + response = get(f"{proxy.url}/api/health", RetryTransport()) + + assert target(response) == "/api/health" + + +def test_uses_the_proxy_for_async_requests(monkeypatch: pytest.MonkeyPatch, proxy: Server) -> None: + monkeypatch.setenv("HTTP_PROXY", proxy.url) + transport = RetryTransport() + + async def run() -> httpx.Response: + async with httpx.AsyncClient(transport=transport) as client: + return await client.get("http://api.example.test/api/health") + + assert target(asyncio.run(run())) == "http://api.example.test/api/health" + + +def test_the_sdk_clients_use_the_proxy(monkeypatch: pytest.MonkeyPatch, proxy: Server) -> None: + monkeypatch.setenv("HTTP_PROXY", proxy.url) + credentials = ClientCredentials("client-id", "secret", api_url="http://api.example.test") + + with httpx.Client(**client_args(credentials)) as client: + response = client.get("/api/v3/purchases") + + assert target(response) == "http://api.example.test/api/v3/purchases" + assert proxy.requests == [ + "POST http://api.example.test/oauth/token", + "GET http://api.example.test/api/v3/purchases", + ] + + +def test_trust_env_false_ignores_the_proxies( + monkeypatch: pytest.MonkeyPatch, proxy: Server +) -> None: + monkeypatch.setenv("HTTP_PROXY", CLOSED) + + response = get(f"{proxy.url}/api/health", RetryTransport(trust_env=False)) + + assert target(response) == "/api/health" + + +def test_transports_of_your_own_are_used_as_they_are( + monkeypatch: pytest.MonkeyPatch, proxy: Server +) -> None: + monkeypatch.setenv("HTTP_PROXY", CLOSED) + + response = get(f"{proxy.url}/api/health", RetryTransport(httpx.HTTPTransport())) + + assert target(response) == "/api/health" + + +# Certificates + + +def test_trusts_the_certificates_of_ssl_cert_file( + monkeypatch: pytest.MonkeyPatch, https: Server +) -> None: + monkeypatch.setenv("SSL_CERT_FILE", str(CA_FILE)) + + assert get(f"https://localhost:{https.port}/", RetryTransport()).text == "hello" + + +def test_trusts_the_certificates_of_ssl_cert_dir( + monkeypatch: pytest.MonkeyPatch, https: Server, tmp_path: Path +) -> None: + shutil.copy(CA_FILE, tmp_path / CA_HASH_NAME) + monkeypatch.setenv("SSL_CERT_DIR", str(tmp_path)) + + assert get(f"https://localhost:{https.port}/", RetryTransport()).text == "hello" + + +def test_trusts_the_certificates_of_ssl_cert_file_in_async_requests( + monkeypatch: pytest.MonkeyPatch, https: Server +) -> None: + monkeypatch.setenv("SSL_CERT_FILE", str(CA_FILE)) + transport = RetryTransport() + + async def run() -> str: + async with httpx.AsyncClient(transport=transport) as client: + return (await client.get(f"https://localhost:{https.port}/")).text + + assert asyncio.run(run()) == "hello" + + +def test_rejects_unknown_certificates(https: Server) -> None: + with pytest.raises(httpx.ConnectError, match="CERTIFICATE_VERIFY_FAILED"): + get(f"https://localhost:{https.port}/", RetryTransport()) + + +def test_trust_env_false_ignores_ssl_cert_file( + monkeypatch: pytest.MonkeyPatch, https: Server +) -> None: + monkeypatch.setenv("SSL_CERT_FILE", str(CA_FILE)) + + with pytest.raises(httpx.ConnectError, match="CERTIFICATE_VERIFY_FAILED"): + get(f"https://localhost:{https.port}/", RetryTransport(trust_env=False)) diff --git a/tests/unit/test_http.py b/tests/unit/test_http.py new file mode 100644 index 0000000..1b9f3c9 --- /dev/null +++ b/tests/unit/test_http.py @@ -0,0 +1,226 @@ +from __future__ import annotations + +import asyncio +import email.utils +import importlib.metadata +import time +from typing import Any + +import httpx +import pytest + +from shellrent_sdk.auth import OAuth2Auth +from shellrent_sdk.http import RetryTransport, client_args, default_user_agent +from tests.support import ( + API_URL, + TOKEN_URL, + FakeApi, + Sleeps, + body, + credentials, + error_response, + health_response, + token_response, +) + + +def too_many_requests(retry_after: str | None = None) -> httpx.Response: + headers = {"Retry-After": retry_after} if retry_after is not None else {} + return error_response(429, "Too Many Requests", headers=headers) + + +def retrying_client(api: FakeApi, sleeps: Sleeps, **kwargs: Any) -> httpx.Client: + transport = RetryTransport(api.transport(), sleep=sleeps.sleep, **kwargs) + return httpx.Client(base_url=API_URL, transport=transport) + + +# RetryTransport + + +def test_retries_after_the_time_given_by_retry_after() -> None: + api, sleeps = FakeApi(too_many_requests("3"), health_response()), Sleeps() + + with retrying_client(api, sleeps) as client: + response = client.get("/api/health") + + assert response.status_code == 200 + assert sleeps.delays == [3.0] + assert len(api.requests) == 2 + + +def test_retries_twice_at_most() -> None: + api, sleeps = ( + FakeApi(too_many_requests("1"), too_many_requests("1"), too_many_requests("1")), + Sleeps(), + ) + + with retrying_client(api, sleeps) as client: + response = client.get("/api/health") + + assert response.status_code == 429 + assert response.headers["Retry-After"] == "1" + assert response.json()["message"] == "Too Many Requests" + assert sleeps.delays == [1.0, 1.0] + assert len(api.requests) == 3 + + +def test_waits_1_then_2_seconds_without_retry_after() -> None: + api, sleeps = FakeApi(too_many_requests(), too_many_requests(), health_response()), Sleeps() + + with retrying_client(api, sleeps) as client: + response = client.get("/api/health") + + assert response.status_code == 200 + assert sleeps.delays == [1.0, 2.0] + + +def test_accepts_retry_after_as_http_date() -> None: + date = email.utils.formatdate(time.time() + 30, usegmt=True) + api, sleeps = FakeApi(too_many_requests(date), health_response()), Sleeps() + + with retrying_client(api, sleeps) as client: + client.get("/api/health") + + [delay] = sleeps.delays + assert 28 <= delay <= 30 + + +def test_gives_up_when_retry_after_is_longer_than_60_seconds() -> None: + api, sleeps = FakeApi(too_many_requests("61")), Sleeps() + + with retrying_client(api, sleeps) as client: + response = client.get("/api/health") + + assert response.status_code == 429 + assert sleeps.delays == [] + + +def test_limits_can_be_changed() -> None: + api, sleeps = FakeApi(too_many_requests("5"), too_many_requests("5")), Sleeps() + + with retrying_client(api, sleeps, max_retries=1, max_delay=10) as client: + response = client.get("/api/health") + + assert response.status_code == 429 + assert sleeps.delays == [5.0] + + +def test_does_not_retry_other_errors() -> None: + api, sleeps = ( + FakeApi(error_response(503, "Unavailable", headers={"Retry-After": "1"})), + Sleeps(), + ) + + with retrying_client(api, sleeps) as client: + response = client.get("/api/health") + + assert response.status_code == 503 + assert sleeps.delays == [] + + +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]}) + + assert [body(request) for request in api.requests] == [{"order_ids": [1, 2]}] * 2 + + +def test_retries_async_requests() -> None: + api, sleeps = FakeApi(too_many_requests("2"), too_many_requests(), health_response()), Sleeps() + transport = RetryTransport(async_transport=api.transport(), async_sleep=sleeps.async_sleep) + + async def run() -> int: + async with httpx.AsyncClient(base_url=API_URL, transport=transport) as client: + return (await client.get("/api/health")).status_code + + assert asyncio.run(run()) == 200 + assert sleeps.delays == [2.0, 2.0] + + +def test_the_same_transport_serves_sync_and_async_clients() -> None: + api = FakeApi(health_response(), health_response()) + transport = RetryTransport(api.transport(), api.transport()) + + with httpx.Client(base_url=API_URL, transport=transport) as client: + client.get("/api/health") + + async def run() -> None: + async with httpx.AsyncClient(base_url=API_URL, transport=transport) as client: + await client.get("/api/health") + + asyncio.run(run()) + assert len(api.requests) == 2 + + +def test_retries_the_token_endpoint_too() -> None: + api, sleeps = FakeApi(too_many_requests("4"), token_response(), health_response()), Sleeps() + transport = RetryTransport(api.transport(), sleep=sleeps.sleep) + + with httpx.Client( + base_url=API_URL, auth=OAuth2Auth(credentials()), transport=transport + ) as client: + response = client.get("/api/health") + + assert response.status_code == 200 + assert sleeps.delays == [4.0] + assert [str(r.url) for r in api.requests] == [TOKEN_URL, TOKEN_URL, f"{API_URL}/api/health"] + + +# client_args + + +def test_client_args() -> None: + args = client_args(credentials(), timeout=12) + + assert args["base_url"] == API_URL + assert isinstance(args["auth"], OAuth2Auth) + assert isinstance(args["transport"], RetryTransport) + assert args["headers"] == {"User-Agent": default_user_agent()} + assert args["timeout"] == httpx.Timeout(12) + + +def test_client_args_without_retry() -> None: + args = client_args(credentials(), retry=False, user_agent="internal-sdk/1.0") + + assert "transport" not in args + assert args["headers"] == {"User-Agent": "internal-sdk/1.0"} + assert args["timeout"] == httpx.Timeout(30.0) + + +def test_user_agent_has_the_package_version() -> None: + version = importlib.metadata.version("shellrent-sdk") + assert default_user_agent() == f"shellrent-sdk-python/{version}" + + +@pytest.mark.parametrize("client_class", [httpx.Client, httpx.AsyncClient]) +def test_clients_send_user_agent_and_timeout_to_the_token_endpoint_too( + client_class: type[httpx.Client | httpx.AsyncClient], +) -> None: + api = FakeApi(token_response(), health_response()) + args = client_args(credentials(), timeout=7) + args["transport"] = RetryTransport(api.transport(), api.transport()) + timeouts: list[Any] = [] + + def record_timeout(request: httpx.Request) -> None: + timeouts.append(request.extensions.get("timeout")) + + if client_class is httpx.Client: + with httpx.Client(**args, event_hooks={"request": [record_timeout]}) as client: + client.get("/api/health") + else: + + async def record_timeout_async(request: httpx.Request) -> None: + record_timeout(request) + + async def run() -> None: + async with httpx.AsyncClient( + **args, event_hooks={"request": [record_timeout_async]} + ) as client: + await client.get("/api/health") + + asyncio.run(run()) + + assert [r.headers["User-Agent"] for r in api.requests] == [default_user_agent()] * 2 + assert timeouts == [httpx.Timeout(7).as_dict()] * 2 diff --git a/tests/unit/test_layers.py b/tests/unit/test_layers.py new file mode 100644 index 0000000..2a687a9 --- /dev/null +++ b/tests/unit/test_layers.py @@ -0,0 +1,33 @@ +"""auth, http and cli are used by other SDKs, with generated clients of their own.""" + +from __future__ import annotations + +import ast +from pathlib import Path + +import pytest + +import shellrent_sdk + +PACKAGE_DIR = Path(shellrent_sdk.__file__).parent + + +def imported_modules(path: Path) -> set[str]: + modules: set[str] = set() + for node in ast.walk(ast.parse(path.read_text(encoding="utf-8"))): + if isinstance(node, ast.Import): + modules.update(alias.name for alias in node.names) + elif isinstance(node, ast.ImportFrom): + module = node.module or "" + if node.level: # Relative to shellrent_sdk, where the modules are. + module = f"shellrent_sdk.{module}" if module else "shellrent_sdk" + modules.add(module) + modules.update(f"{module}.{alias.name}" for alias in node.names) + return modules + + +@pytest.mark.parametrize("module", ["auth.py", "http.py", "cli.py"]) +def test_does_not_import_the_generated_client(module: str) -> None: + imports = imported_modules(PACKAGE_DIR / module) + + assert not [name for name in imports if name.startswith("shellrent_sdk.client")] diff --git a/tests/unit/test_token_store.py b/tests/unit/test_token_store.py new file mode 100644 index 0000000..b6d1519 --- /dev/null +++ b/tests/unit/test_token_store.py @@ -0,0 +1,199 @@ +from __future__ import annotations + +import json +import os +import stat +import sys +from pathlib import Path + +import httpx +import pytest + +from shellrent_sdk.auth import FileTokenStore, MemoryTokenStore, OAuth2Auth +from tests.support import ( + API_URL, + CLIENT_SECRET, + FakeApi, + FakeClock, + credentials, + health_response, + token_response, +) + +posix_only = pytest.mark.skipif(sys.platform == "win32", reason="POSIX permissions") + + +def mode(path: Path) -> int: + return stat.S_IMODE(path.stat().st_mode) + + +# MemoryTokenStore + + +def test_memory_store_keeps_values_until_they_expire() -> None: + clock = FakeClock() + store = MemoryTokenStore(clock=clock) + + store.set("key", "value", 10) + assert store.get("key") == "value" + clock.now += 10 + assert store.get("key") is None + + +def test_memory_store_deletes_values() -> None: + store = MemoryTokenStore() + store.set("key", "value", 10) + store.delete("key") + store.delete("missing") + + assert store.get("key") is None + + +# FileTokenStore + + +def test_file_store_keeps_values_between_instances(tmp_path: Path) -> None: + FileTokenStore(tmp_path).set("key", "value", 10) + + assert FileTokenStore(tmp_path).get("key") == "value" + assert FileTokenStore(tmp_path).get("missing") is None + + +def test_file_store_ignores_expired_values(tmp_path: Path) -> None: + clock = FakeClock() + store = FileTokenStore(tmp_path, clock=clock) + + store.set("key", "value", 10) + clock.now += 9 + assert store.get("key") == "value" + clock.now += 1 + assert store.get("key") is None + + +def test_file_store_deletes_values(tmp_path: Path) -> None: + store = FileTokenStore(tmp_path) + store.set("key", "value", 10) + store.delete("key") + store.delete("missing") + + assert store.get("key") is None + assert list(tmp_path.iterdir()) == [] + + +def test_file_store_set_with_expired_ttl_deletes(tmp_path: Path) -> None: + store = FileTokenStore(tmp_path) + store.set("key", "value", 10) + store.set("key", "value", 0) + + assert store.get("key") is None + + +def test_file_store_ignores_damaged_files(tmp_path: Path) -> None: + store = FileTokenStore(tmp_path) + (tmp_path / "key.json").write_text("{not json") + (tmp_path / "other.json").write_text(json.dumps({"value": 1, "expires_at": "tomorrow"})) + + assert store.get("key") is None + assert store.get("other") is None + + +@pytest.mark.parametrize("key", ["../key", "a/b", ".hidden", ""]) +def test_file_store_rejects_keys_that_are_not_file_names(tmp_path: Path, key: str) -> None: + with pytest.raises(ValueError, match="Invalid key"): + FileTokenStore(tmp_path).set(key, "value", 10) + + +@posix_only +def test_file_store_creates_private_directory_and_files(tmp_path: Path) -> None: + directory = tmp_path / "cache" / "shellrent-sdk" + old_umask = os.umask(0o022) + try: + FileTokenStore(directory).set("key", "value", 10) + finally: + os.umask(old_umask) + + assert mode(directory) == 0o700 + assert mode(directory / "key.json") == 0o600 + + +def test_file_store_writes_through_a_temporary_file( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch +) -> None: + replaced: list[tuple[str, str]] = [] + real_replace = os.replace + + def replace(src: str, dst: str) -> None: + replaced.append((str(src), str(dst))) + real_replace(src, dst) + + monkeypatch.setattr(os, "replace", replace) + FileTokenStore(tmp_path).set("key", "value", 10) + + [(src, dst)] = replaced + assert Path(src).parent == tmp_path + assert dst == str(tmp_path / "key.json") + assert [p.name for p in tmp_path.iterdir()] == ["key.json"] + + +def test_file_store_keeps_the_old_file_when_the_write_fails( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch +) -> None: + store = FileTokenStore(tmp_path) + store.set("key", "old", 10) + + def replace(src: str, dst: str) -> None: + raise OSError("disk full") + + monkeypatch.setattr(os, "replace", replace) + with pytest.raises(OSError, match="disk full"): + store.set("key", "new", 10) + + assert store.get("key") == "old" + assert [p.name for p in tmp_path.iterdir()] == ["key.json"] + + +def test_file_store_default_directory(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> None: + monkeypatch.setenv("XDG_CACHE_HOME", str(tmp_path / "xdg")) + assert FileTokenStore().directory == tmp_path / "xdg" / "shellrent-sdk" + + monkeypatch.setenv("XDG_CACHE_HOME", "relative/path") + monkeypatch.setenv("HOME", str(tmp_path / "home")) + monkeypatch.setenv("USERPROFILE", str(tmp_path / "home")) + assert FileTokenStore().directory == tmp_path / "home" / ".cache" / "shellrent-sdk" + + +# With OAuth2Auth + + +def test_a_new_process_reuses_the_token_in_the_file(tmp_path: Path) -> None: + api = FakeApi(token_response("token-1"), health_response(), health_response()) + + for _ in range(2): + auth = OAuth2Auth(credentials(), FileTokenStore(tmp_path)) + with httpx.Client(base_url=API_URL, auth=auth, transport=api.transport()) as client: + client.get("/api/health") + + assert len(api.token_requests) == 1 + [file] = tmp_path.iterdir() + assert "token-1" in file.read_text() + assert CLIENT_SECRET not in file.read_text() + assert CLIENT_SECRET not in file.name + + +def test_an_expired_token_in_the_file_is_not_used(tmp_path: Path) -> None: + clock = FakeClock() + api = FakeApi( + token_response("token-1"), health_response(), token_response("token-2"), health_response() + ) + + auth = OAuth2Auth(credentials(), FileTokenStore(tmp_path, clock=clock), clock=clock) + with httpx.Client(base_url=API_URL, auth=auth, transport=api.transport()) as client: + client.get("/api/health") + + clock.now += 540 + auth = OAuth2Auth(credentials(), FileTokenStore(tmp_path, clock=clock), clock=clock) + with httpx.Client(base_url=API_URL, auth=auth, transport=api.transport()) as client: + client.get("/api/health") + + assert len(api.token_requests) == 2 + assert api.api_requests[-1].headers["Authorization"] == "Bearer token-2" diff --git a/uv.lock b/uv.lock new file mode 100644 index 0000000..8c8cabb --- /dev/null +++ b/uv.lock @@ -0,0 +1,465 @@ +version = 1 +revision = 3 +requires-python = ">=3.11" +resolution-markers = [ + "python_full_version >= '3.15'", + "python_full_version < '3.15'", +] + +[[package]] +name = "anyio" +version = "4.15.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "idna" }, + { name = "typing-extensions", marker = "python_full_version < '3.15'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/a9/d2/f4d173e22df740bc37b1db102b386ba719b66e95b0f0d751f556b387e6d2/anyio-4.15.1.tar.gz", hash = "sha256:9f28306018cbd6d329e64a36d58256edff76dd996fe423bc957326e578b82a94", size = 276966, upload-time = "2026-09-05T10:42:39.44Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/12/b8/4bd346e22b28902df4d651910f5242c28d84e4a5c2435ca5c3f797ed7e2e/anyio-4.15.1-py3-none-any.whl", hash = "sha256:6152fdbbf9a77fdec97731721bebf7c4c44f7c29b424b0065826173efc7ed101", size = 132079, upload-time = "2026-09-05T10:42:37.923Z" }, +] + +[[package]] +name = "ast-serialize" +version = "0.11.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/54/1e/4f6082cdd6e5a29093513e9a3eabc5ed1c5331a9a84386b2fece80a00a48/ast_serialize-0.11.2.tar.gz", hash = "sha256:976a5bd75845d22f4b52905ddf53ab669ef1b14dba7735f5512841a2ef2b5450", size = 954387, upload-time = "2026-09-13T18:48:55.673Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a3/2e/beec3364eef4b01793a676d8cd16e9014c42044a5505000ceae3955e33fa/ast_serialize-0.11.2-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:f6a8dfc5ab204a706f6e5d39c6f77c18c27ef084fa2081803a64a9160ce89277", size = 897089, upload-time = "2026-09-13T18:47:22.69Z" }, + { url = "https://files.pythonhosted.org/packages/6f/d7/ef56443df2891c6ba2c4019c2cb3dcaf97c9948da6d963068e04e8dac6ea/ast_serialize-0.11.2-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:cb073bfa15742699d408ac50f60878383b5665ae1791d1b6799ea6f08633cd77", size = 1235218, upload-time = "2026-09-13T18:47:24.541Z" }, + { url = "https://files.pythonhosted.org/packages/42/8d/cff58d17ba1d0272ff0b7ab5d3bdfcf8f47317eb0f47c001d394bffebf95/ast_serialize-0.11.2-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:1d6ad94edbe93bf1dabc06c9f37d55b898fdabc456aa6d7ced5e23c14f795f32", size = 1216399, upload-time = "2026-09-13T18:47:26.202Z" }, + { url = "https://files.pythonhosted.org/packages/de/d2/a1da7675af5f42335c36e4da6d86ef4fd7168cead18de81df0a2d6faeb1a/ast_serialize-0.11.2-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:40b2801cf2221bd922d9f69d2f0ebc373c3db47207315d525b2d87fa161a2af4", size = 1282064, upload-time = "2026-09-13T18:47:27.787Z" }, + { url = "https://files.pythonhosted.org/packages/97/89/5a400a13b2c9c0152ebb5ad45408a3fe5e4e60e325d3ac4e5cf6e915a0cc/ast_serialize-0.11.2-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:fd666cebd6ab3b3c0fd348a6202c26e18a401ee34293c3804d3472266bc146f6", size = 1285864, upload-time = "2026-09-13T18:47:29.667Z" }, + { url = "https://files.pythonhosted.org/packages/02/b8/80a381c70fd49f0316fb0383c4f9e4c13e81b010b64889bd45898ce8f5f4/ast_serialize-0.11.2-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0d01f61352c96370febf6c0dbd488dee9183a731fb2702170da9163ae317cded", size = 1554755, upload-time = "2026-09-13T18:47:31.257Z" }, + { url = "https://files.pythonhosted.org/packages/90/97/dcaa34a32d2db789221c125b3eb10feb5089715fe53d9874d627afc26231/ast_serialize-0.11.2-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a0fd40c668b0fa19b8fdb61d9e63d547e2e19cfbfe053a51ef0b6c37070298a8", size = 1301807, upload-time = "2026-09-13T18:47:32.714Z" }, + { url = "https://files.pythonhosted.org/packages/5c/9a/84a22420cb312642d7d31547c644d09a3d101418c6d6b9ef2ec30735cf11/ast_serialize-0.11.2-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:efa819d7c14c8e4153dcd84671826331538be7cbe460383fc6386f5eea5bd234", size = 1301941, upload-time = "2026-09-13T18:47:34.418Z" }, + { url = "https://files.pythonhosted.org/packages/20/8a/aa5f3dcf1aed9678c25982f40d366004e3c0cac47bc0c240f6b837dcbb1f/ast_serialize-0.11.2-cp314-cp314t-manylinux_2_31_riscv64.whl", hash = "sha256:a9ffa8a197a721f07a352d0be6185f5b3e6f9aaebfdb66169ed652108531ae3b", size = 1307910, upload-time = "2026-09-13T18:47:36.253Z" }, + { url = "https://files.pythonhosted.org/packages/78/79/91a5102797fe3dc992171382d8579bcb33cbd1424b864ad3117ac43fb3fe/ast_serialize-0.11.2-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:00119a8fb8c1dc0f1fab023f4d8071fa49e3b0208ee54d589fd463c16ab0124e", size = 1356258, upload-time = "2026-09-13T18:47:37.984Z" }, + { url = "https://files.pythonhosted.org/packages/51/52/54eeef9918e187ced417c4363eecea66975314cd5b9c91759eef7f7b714b/ast_serialize-0.11.2-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:0de02520c11391a026e62987a9aa2c3c2ff01545155059ddf0c4bdf2c5ecbe9f", size = 1459057, upload-time = "2026-09-13T18:47:39.891Z" }, + { url = "https://files.pythonhosted.org/packages/e4/cb/fd84b52b15d42f2423319cffd1fb7f1e9df5d5198e69ab0b449c450254cf/ast_serialize-0.11.2-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:b4e4558956b6a0fb35e18fba58f7d1810b1f2c0e6b52352572cd5dfb6b4ef33a", size = 1562447, upload-time = "2026-09-13T18:47:41.727Z" }, + { url = "https://files.pythonhosted.org/packages/be/92/9fb34f2e64b84a63cca92fb86bd0847b995a63b67477f44c20502fb60352/ast_serialize-0.11.2-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:6061a54f39e82a9f2cbcb9c268fc441890e4818a6636473caa4f4063254e0750", size = 1556423, upload-time = "2026-09-13T18:47:43.357Z" }, + { url = "https://files.pythonhosted.org/packages/75/0f/c43c44449e7ebc4e83ebd48750088fb06234622faa2d62d2a6dc8970d2a3/ast_serialize-0.11.2-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:85fbb01e83967a126d71f679f2b9528ef0912cb0854aa1a4657314c34e255b57", size = 1687156, upload-time = "2026-09-13T18:47:44.995Z" }, + { url = "https://files.pythonhosted.org/packages/2b/a7/9e520f4a79b639da9ee20c1e747c3d739329e902fc55ac38065f25419f56/ast_serialize-0.11.2-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:7aaaffc32905159774a107d3cf33dad59bd41b7a0d1bc9885532186753ee7439", size = 1481008, upload-time = "2026-09-13T18:47:46.602Z" }, + { url = "https://files.pythonhosted.org/packages/48/a8/bdd3989f19de09cffcd8179c131f6741a5a8619705fc75b09541ff61530b/ast_serialize-0.11.2-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:08eda88a0f290a36c38cab33df8bf7e35eb95bc802ca5beb2c8fcda471a7d10c", size = 1501597, upload-time = "2026-09-13T18:47:48.265Z" }, + { url = "https://files.pythonhosted.org/packages/a5/8a/ca2dce2950875a4ef1d7c298196f803b0adcdb7c15ed0cecc71d84bccd70/ast_serialize-0.11.2-cp314-cp314t-win32.whl", hash = "sha256:76cc294246e60a914326b4ca88c6a5ea89c064906614aaf1537ce82f09e9449f", size = 1119503, upload-time = "2026-09-13T18:47:49.896Z" }, + { url = "https://files.pythonhosted.org/packages/5a/12/3f38e3613d07c46f9f81c5b1352748c6552397cc52825502e2c6ae44c6ea/ast_serialize-0.11.2-cp314-cp314t-win_amd64.whl", hash = "sha256:43b51e6ebe6549bf21416c3c78ee886147b80875a87cc6f69e303dde0d75be0b", size = 1156828, upload-time = "2026-09-13T18:47:51.454Z" }, + { url = "https://files.pythonhosted.org/packages/22/90/f89a4f67428a261daafdb69a0d0132c27933268702d1ba47e0b61c51aff1/ast_serialize-0.11.2-cp314-cp314t-win_arm64.whl", hash = "sha256:8df32ad4ff7843734a6c2f067ee974f6d3109ee5a2c3e1a9d2f79347bd282a9a", size = 1128298, upload-time = "2026-09-13T18:47:53.008Z" }, + { url = "https://files.pythonhosted.org/packages/0b/55/a1962188abf0e62d84d55892bb044347e434711763b9a1d4ad867a70c1be/ast_serialize-0.11.2-cp315-abi3.abi3t-macosx_10_12_x86_64.whl", hash = "sha256:ab924ba260efd7509492f272d4e236d24564033f20c005d7c63a107c6a76fc85", size = 1235457, upload-time = "2026-09-13T18:47:54.554Z" }, + { url = "https://files.pythonhosted.org/packages/2a/ad/439c2959150718446af76fbe2f4000f35eba9869ef8564f3d9a3d0b1c370/ast_serialize-0.11.2-cp315-abi3.abi3t-macosx_11_0_arm64.whl", hash = "sha256:a586be418eb70a9f1396cea29ddac8f4b9bf277fb73ea2340db31e218bc00f32", size = 1215705, upload-time = "2026-09-13T18:47:56.178Z" }, + { url = "https://files.pythonhosted.org/packages/6d/d8/2c6542fc3e7c56a0a25d8d12d034d5a2d2e1900e292567b1c1dca8e83124/ast_serialize-0.11.2-cp315-abi3.abi3t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8532f20916fa3189d4d785ef2a62d93c4d651ec9c5bffda66d2fc36898351f34", size = 1282530, upload-time = "2026-09-13T18:47:57.619Z" }, + { url = "https://files.pythonhosted.org/packages/fa/ad/6f6755cd0842db46c3b10b1e4735f14aad78d71dea4753eb46933101711b/ast_serialize-0.11.2-cp315-abi3.abi3t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ee732ae167e686d1d3c00f98d7d82b23138304694f0441b14d7ddf9c0f8a921c", size = 1287792, upload-time = "2026-09-13T18:47:59.227Z" }, + { url = "https://files.pythonhosted.org/packages/03/40/5da672f5dd23fb7dc0c884c97711e56a3540f2fe3c4355a81f8beb385911/ast_serialize-0.11.2-cp315-abi3.abi3t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:75a1c7f46b9c19fc0ae01ca6fd076301628faa2ed7a8edbd55c6353c483946a3", size = 1557971, upload-time = "2026-09-13T18:48:00.96Z" }, + { url = "https://files.pythonhosted.org/packages/df/c7/2bb25684f697801eb72866fdb94ed5edbff3867ce878b0e542a4a5b9dab9/ast_serialize-0.11.2-cp315-abi3.abi3t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2fdf31a0bb85ea2575cc91669f005e6647d2efed491231c4dc1497bc9a5b3aa6", size = 1303230, upload-time = "2026-09-13T18:48:02.337Z" }, + { url = "https://files.pythonhosted.org/packages/d8/85/754681846f26e0ff1da729b1ffe3171e93c22f0aa6ec3cea5b14e3703846/ast_serialize-0.11.2-cp315-abi3.abi3t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3b78e6fdef3b06c86ed263e1962fee5a7b9d2d158e738b212d13b2c605ee12f5", size = 1302271, upload-time = "2026-09-13T18:48:03.915Z" }, + { url = "https://files.pythonhosted.org/packages/fb/dc/f5521d8cb44b69095c3982ae3658a12c403e0efa19e51aeb9c8a79dff60c/ast_serialize-0.11.2-cp315-abi3.abi3t-manylinux_2_31_riscv64.whl", hash = "sha256:8d62a47714c8bc432b9fabcc29989c815c5da17327d35151f2fd0d85c2a7a5ff", size = 1309529, upload-time = "2026-09-13T18:48:05.562Z" }, + { url = "https://files.pythonhosted.org/packages/73/0d/649182c7fd7c4f782279bed514de2dd67e48a5afecb605a098d64fdc01fd/ast_serialize-0.11.2-cp315-abi3.abi3t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8a5ffa70e76191dcf240d3c43e20c93b3bfd26f54d89148c762d57837f5bcd2c", size = 1356869, upload-time = "2026-09-13T18:48:07.534Z" }, + { url = "https://files.pythonhosted.org/packages/bf/cc/aff4d84c16afa742d13a75384127c7d24594dc8c304f0558a15924fd51af/ast_serialize-0.11.2-cp315-abi3.abi3t-musllinux_1_2_aarch64.whl", hash = "sha256:bfbe47a3a7c368f28836e78b2440a3643ac0ec4c67d9fe53588e1448f0a3d35d", size = 1460006, upload-time = "2026-09-13T18:48:09.162Z" }, + { url = "https://files.pythonhosted.org/packages/94/a7/891cbec2e5e0d7159196159d3ff0646622f3120ff4576c839ac2dd56c719/ast_serialize-0.11.2-cp315-abi3.abi3t-musllinux_1_2_armv7l.whl", hash = "sha256:7f1823275b246f9c7d373be6879e4eec09686948895d4ad083f4b27fd7e4da70", size = 1562935, upload-time = "2026-09-13T18:48:10.978Z" }, + { url = "https://files.pythonhosted.org/packages/45/c4/2c8c4498340ea9aff87a9fd408309aa25d56dd51d7bbddfdb46a3c31424a/ast_serialize-0.11.2-cp315-abi3.abi3t-musllinux_1_2_i686.whl", hash = "sha256:57c0f5cb0021a5beb1e5e4d6e840ae2f23a28909703ef4d256a144cc1ad3d437", size = 1557109, upload-time = "2026-09-13T18:48:12.616Z" }, + { url = "https://files.pythonhosted.org/packages/0d/8b/c5d4e5226fa18885fe17f949aee3ab1aeb8389c384d946ec1b7c9489cc94/ast_serialize-0.11.2-cp315-abi3.abi3t-musllinux_1_2_ppc64le.whl", hash = "sha256:cd320a5c4f1f2742af97eea22954f776379175c5ef2504801e9a155f2ff9a4d7", size = 1691603, upload-time = "2026-09-13T18:48:14.293Z" }, + { url = "https://files.pythonhosted.org/packages/73/d6/1d2ca472586f9e3416a289a22f36eeb6dd6f47d77b1a4aba358405babbc7/ast_serialize-0.11.2-cp315-abi3.abi3t-musllinux_1_2_riscv64.whl", hash = "sha256:13b13afe32e845c86a573497729e1b7ddeb26c572c78bf50ece51da23b8fad5e", size = 1483053, upload-time = "2026-09-13T18:48:15.789Z" }, + { url = "https://files.pythonhosted.org/packages/0e/16/d3703a7c1e3c76b144ac9349a54d3926d0749918a8dc13a66cede208b8ec/ast_serialize-0.11.2-cp315-abi3.abi3t-musllinux_1_2_x86_64.whl", hash = "sha256:9d80a81ec84660422579bdb8e789f656a794b48c7a1ae1261f6bd8bc1897d17d", size = 1502499, upload-time = "2026-09-13T18:48:17.405Z" }, + { url = "https://files.pythonhosted.org/packages/2b/e4/d974e55c2e247ef26ed1df01c74940583db9a5b3a8bcaad5732c6e2047fb/ast_serialize-0.11.2-cp315-abi3.abi3t-win32.whl", hash = "sha256:af8c003ce721b0099dd55cef4ba733500fc3054ea0cc8565d8957aaf7cccdeb4", size = 1119739, upload-time = "2026-09-13T18:48:19.005Z" }, + { url = "https://files.pythonhosted.org/packages/0d/00/d229443488e095054d5e0c0cc20689a2633b899d735849ff1b2c8e4f0cbf/ast_serialize-0.11.2-cp315-abi3.abi3t-win_amd64.whl", hash = "sha256:554d117cb916d8032d85007c654d179efbbfd446174c048062778136a922944f", size = 1158602, upload-time = "2026-09-13T18:48:20.524Z" }, + { url = "https://files.pythonhosted.org/packages/11/75/389fc1a6cfa0c4b2ce522f47d8401329d8bb11732e516d46465960fef1d9/ast_serialize-0.11.2-cp315-abi3.abi3t-win_arm64.whl", hash = "sha256:d60515335750d431e462af6e722bb55720a5e7827192777bddfd9c4376065a4d", size = 1128842, upload-time = "2026-09-13T18:48:22.052Z" }, + { url = "https://files.pythonhosted.org/packages/45/7d/c4f36898f19c728d091cdfdf960c9488e8d82bbe2e49ba13c05f43907a5d/ast_serialize-0.11.2-cp315-cp315-pyemscripten_2026_5_wasm32.whl", hash = "sha256:89499a439955931281986e97ca4dd3c064bf0d2e0027c0017344eb86667733a1", size = 897204, upload-time = "2026-09-13T18:48:23.695Z" }, + { url = "https://files.pythonhosted.org/packages/b1/54/f67120006fc73a55b6d057d4662d061fbb4eceafce3047c76ca8b382eb11/ast_serialize-0.11.2-cp39-abi3-macosx_10_12_x86_64.whl", hash = "sha256:daadf1c3e0224621607ffe16f1379e4bd372271ed2e1db8a67878f0bab3ef7e4", size = 1240734, upload-time = "2026-09-13T18:48:25.287Z" }, + { url = "https://files.pythonhosted.org/packages/9a/7e/8f2ab68bddbe58a66fbbaad87beeae3e7d7edddb17263d1fc423936cf34d/ast_serialize-0.11.2-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:1844ed9a487fb3de7325c52ddb33f2918b66b65cd54d3f8d83d23785ffe99fa4", size = 1228053, upload-time = "2026-09-13T18:48:26.788Z" }, + { url = "https://files.pythonhosted.org/packages/d2/1b/8a69ab68f4c1603819f0481d756abdd8caf27cec7f1d77caa71007ebe997/ast_serialize-0.11.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b17869f4ba261a5fa468a753328a548f4dbaf74b4eadae9e28aff66df7f1425b", size = 1292542, upload-time = "2026-09-13T18:48:28.295Z" }, + { url = "https://files.pythonhosted.org/packages/d1/ce/872f2e00f0467c289e483f0a34543463347243a2d0632748d89fcee5e0dc/ast_serialize-0.11.2-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:feb16d9c2a720e0120c58dd5d6e7b3c7c86b43249b60a3bc212bcb8fa031e2dd", size = 1294791, upload-time = "2026-09-13T18:48:29.969Z" }, + { url = "https://files.pythonhosted.org/packages/3a/82/36277c12af861c64b375c316135d8feffe3f400568463a8d2b2de4c2c4fb/ast_serialize-0.11.2-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f3109fe4805384effc8d0f8e41fbf875aa8f389af91b4348c1cfb60ea6e4cb82", size = 1567583, upload-time = "2026-09-13T18:48:31.85Z" }, + { url = "https://files.pythonhosted.org/packages/b0/d7/ec643df91cea8bcbcb4e8011d6a8b08e5119b84f9554879f3e3c786d29d1/ast_serialize-0.11.2-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:abdb3e49ba053c3486ac1263bee9f16cc9a4a8abd9f8c90bfc21e3669f3ad9d1", size = 1312878, upload-time = "2026-09-13T18:48:33.495Z" }, + { url = "https://files.pythonhosted.org/packages/04/6f/4c992cd7841ba589fefb14ddc9aff2f6db7f2a615d4074f9ad04115b5ce0/ast_serialize-0.11.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a7004ba572f09be34342ccb98dcd4bad5707d3d81adc8cb4c3f685d2a2c51bbc", size = 1312642, upload-time = "2026-09-13T18:48:35.294Z" }, + { url = "https://files.pythonhosted.org/packages/d5/e3/22aaa209c231a83cfea004fd67dee7a7a54da3f169c6c460b14b96887385/ast_serialize-0.11.2-cp39-abi3-manylinux_2_31_riscv64.whl", hash = "sha256:59c25f47524efa052971b860e128b1add0c94ede7dd16b2962952c85c3582365", size = 1319776, upload-time = "2026-09-13T18:48:36.866Z" }, + { url = "https://files.pythonhosted.org/packages/c1/f7/d4685fb54d10108ce44d3bc893ef670854d61645d47ed96d73524db90c23/ast_serialize-0.11.2-cp39-abi3-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f3a367e0e05ed2d1b747ceb07aa728a8c204cc008b589127e9bd4f40053d7575", size = 1365324, upload-time = "2026-09-13T18:48:38.412Z" }, + { url = "https://files.pythonhosted.org/packages/42/3a/250643ffad02bda520c50a9a5f02a5d43259a06f34ce393c91761d134d7e/ast_serialize-0.11.2-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:00bbf1f6669f813b48925b759f7ae4591067d456d443924055cab386e7e0a719", size = 1467653, upload-time = "2026-09-13T18:48:40.348Z" }, + { url = "https://files.pythonhosted.org/packages/c7/da/af66a646b9b7f8fdec95ce83fc7b1fe538b06864bc79bd554ac4fae2e6ea/ast_serialize-0.11.2-cp39-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:ec1c20f89c3e0d83576e3c06f79375ce936266591fe0d5fd969914af3185cbaa", size = 1571914, upload-time = "2026-09-13T18:48:41.968Z" }, + { url = "https://files.pythonhosted.org/packages/34/82/77a9714564b9e8800087a8afec41527c65c39e49282baae2ac847b9c1c6a/ast_serialize-0.11.2-cp39-abi3-musllinux_1_2_i686.whl", hash = "sha256:c58bb119b73657fdc5569692f316e1e25ca114bd62f7782eb527c6be438ba3a9", size = 1569862, upload-time = "2026-09-13T18:48:43.701Z" }, + { url = "https://files.pythonhosted.org/packages/65/06/fa77b52f46b9bd6dcd8ff2b880e3781f8c1a316bb1342bc3de92907c6f96/ast_serialize-0.11.2-cp39-abi3-musllinux_1_2_ppc64le.whl", hash = "sha256:f739e0b601be7300c5697a2573d9200bd1db74b34ab111ef9537b9d5dcd7f106", size = 1699020, upload-time = "2026-09-13T18:48:45.261Z" }, + { url = "https://files.pythonhosted.org/packages/e1/09/239c83153c7e0798e5867d6909cb06f53dccfef02f6999c8e2e21ecb98c3/ast_serialize-0.11.2-cp39-abi3-musllinux_1_2_riscv64.whl", hash = "sha256:cae5addfbb54cc1d47fe947ef9138e9d83849ed1cbc72b819cf36d96a2315b07", size = 1492869, upload-time = "2026-09-13T18:48:46.922Z" }, + { url = "https://files.pythonhosted.org/packages/2f/eb/6108fb9a43fc7ab5529856e38e33c6e3e064fbfe375fdcbb208c7cd5438d/ast_serialize-0.11.2-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:2fa3be25f7f5351b1b39c9f8a52779b2dbf21199efbae564b4746422e8edca4e", size = 1511621, upload-time = "2026-09-13T18:48:48.667Z" }, + { url = "https://files.pythonhosted.org/packages/8a/82/60367e58ef346a41ebc90d3f28593c1b8f5c2cb5314c7b2bbd98910ee131/ast_serialize-0.11.2-cp39-abi3-win32.whl", hash = "sha256:d70556a2f9230a44c99a655774cde823f056efc34466eabfb4085f0cb1ea9f99", size = 1125873, upload-time = "2026-09-13T18:48:50.661Z" }, + { url = "https://files.pythonhosted.org/packages/23/bf/b419c3205ce1143ba7c69baef4f0ba43c14d8712113bf34f9e0d27d609be/ast_serialize-0.11.2-cp39-abi3-win_amd64.whl", hash = "sha256:b9065dd23131a23b41f5bab3bf4e9b3c350a3fe8e36e8200eded9b729fcea484", size = 1165434, upload-time = "2026-09-13T18:48:52.169Z" }, + { url = "https://files.pythonhosted.org/packages/91/a7/c8bbb2173f7a7131b3b2412035b2d814ab5ef2ce9799bd06f07c451640e4/ast_serialize-0.11.2-cp39-abi3-win_arm64.whl", hash = "sha256:dab599cbdcb7b45b18c41fad746645580b3a24357082b7f0e8921cd373804f27", size = 1136031, upload-time = "2026-09-13T18:48:54.04Z" }, +] + +[[package]] +name = "attrs" +version = "26.1.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/9a/8e/82a0fe20a541c03148528be8cac2408564a6c9a0cc7e9171802bc1d26985/attrs-26.1.0.tar.gz", hash = "sha256:d03ceb89cb322a8fd706d4fb91940737b6642aa36998fe130a9bc96c985eff32", size = 952055, upload-time = "2026-03-19T14:22:25.026Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/64/b4/17d4b0b2a2dc85a6df63d1157e028ed19f90d4cd97c36717afef2bc2f395/attrs-26.1.0-py3-none-any.whl", hash = "sha256:c647aa4a12dfbad9333ca4e71fe62ddc36f4e63b2d260a37a8b83d2f043ac309", size = 67548, upload-time = "2026-03-19T14:22:23.645Z" }, +] + +[[package]] +name = "certifi" +version = "2026.7.22" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/a3/c2/24167ea9858356b47a87a50d39908bfdb72ceeefe0041586e704e5376b3a/certifi-2026.7.22.tar.gz", hash = "sha256:741e2c3b351ddf169a738da9f2c048608ff7f2c5cc02f1ebc6b118bb090d5d55", size = 138112, upload-time = "2026-07-22T03:35:12.644Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0b/a7/71ac2cff56fec219ed242bb11b8efb69fcc4bec75db06fb7bfe35de520e6/certifi-2026.7.22-py3-none-any.whl", hash = "sha256:62f22742b58a1a33014a2b6b706588a8d7e2a88ae7bd1a6ebe8c992928483775", size = 136983, upload-time = "2026-07-22T03:35:11.276Z" }, +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" }, +] + +[[package]] +name = "h11" +version = "0.16.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/01/ee/02a2c011bdab74c6fb3c75474d40b3052059d95df7e73351460c8588d963/h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1", size = 101250, upload-time = "2025-04-24T03:35:25.427Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/04/4b/29cac41a4d98d144bf5f6d33995617b185d14b22401f75ca86f384e87ff1/h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86", size = 37515, upload-time = "2025-04-24T03:35:24.344Z" }, +] + +[[package]] +name = "httpcore" +version = "1.0.9" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "certifi" }, + { name = "h11" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/06/94/82699a10bca87a5556c9c59b5963f2d039dbd239f25bc2a63907a05a14cb/httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8", size = 85484, upload-time = "2025-04-24T22:06:22.219Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7e/f5/f66802a942d491edb555dd61e3a9961140fd64c90bce1eafd741609d334d/httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55", size = 78784, upload-time = "2025-04-24T22:06:20.566Z" }, +] + +[[package]] +name = "httpx" +version = "0.28.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, + { name = "certifi" }, + { name = "httpcore" }, + { name = "idna" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b1/df/48c586a5fe32a0f01324ee087459e112ebb7224f646c0b5023f5e79e9956/httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc", size = 141406, upload-time = "2024-12-06T15:37:23.222Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2a/39/e50c7c3a983047577ee07d2a9e53faf5a69493943ec3f6a384bdc792deb2/httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad", size = 73517, upload-time = "2024-12-06T15:37:21.509Z" }, +] + +[[package]] +name = "idna" +version = "3.20" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f5/08/8eea9d4b8302028f3abb2c0813953f7aec26d33b7a8960ed760e65ff29fa/idna-3.20.tar.gz", hash = "sha256:a7db850025b95ded1eae8a46181a1a6c56c92c96f0e2b005d9ff8dc0210cab44", size = 216463, upload-time = "2026-09-17T14:11:04.752Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/58/a2/bb081bab032533a855d44de1d56f8e8426114ff1ba5d1f07a438a0a654f8/idna-3.20-py3-none-any.whl", hash = "sha256:ab7ae7122974553370f0bdb919e1a960b2cd1bc1ef0276416d896db81c14582c", size = 69583, upload-time = "2026-09-17T14:11:03.168Z" }, +] + +[[package]] +name = "iniconfig" +version = "2.3.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/72/34/14ca021ce8e5dfedc35312d08ba8bf51fdd999c576889fc2c24cb97f4f10/iniconfig-2.3.0.tar.gz", hash = "sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730", size = 20503, upload-time = "2025-10-18T21:55:43.219Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484, upload-time = "2025-10-18T21:55:41.639Z" }, +] + +[[package]] +name = "librt" +version = "0.16.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/04/f5/9dc696772d241814bacac7880bac32f2930b5a6ebc1f85317b83161a011c/librt-0.16.0.tar.gz", hash = "sha256:ac38d6d8d66bf3d744148dbbc0b8e193e195a51e364ed55e224631f5721891fc", size = 219839, upload-time = "2026-09-29T00:55:32.891Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ba/0e/b04fd2d76b6a78a02286938251b2c119fb36ddece92c76cb4886ef7d44b8/librt-0.16.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:fe4372c52d4849096c6cc1cda2817d293ec51440c890474ed59ef38d46556f18", size = 148058, upload-time = "2026-09-29T00:44:40.903Z" }, + { url = "https://files.pythonhosted.org/packages/a3/fc/e1ed24aadb32d38603c0c07f579d739eb4d90e64e90d525b024e4a999b4d/librt-0.16.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:c72c5295a84bd249526da9bdca38f2e176d15c31c13bb0063c5053f4ca023421", size = 153073, upload-time = "2026-09-29T00:44:42.165Z" }, + { url = "https://files.pythonhosted.org/packages/be/38/133ab655409420e0c34a9a9836a7f4e5ae75fba758d7fe177099130d58ba/librt-0.16.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:be56ba9c884143495b517f23fe794ae367d58cd89ea0fdd6d437e3c024a87f9f", size = 493052, upload-time = "2026-09-29T00:44:44.043Z" }, + { url = "https://files.pythonhosted.org/packages/94/42/aaa663bc9421f5bf7bbbe9d3316d7219749698ec7688ac3b519770a89c04/librt-0.16.0-cp311-cp311-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:ef46c1a29ffb8c72e882e22618ec618778eacd0578fb22c6e7cf9c11d15f357b", size = 485506, upload-time = "2026-09-29T00:44:45.479Z" }, + { url = "https://files.pythonhosted.org/packages/7b/59/83a6eb5087ba8b45b083859e2085256963e06d4c2531944cdd962670bfb5/librt-0.16.0-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:d3c94211ee0c4f8d649ec06b7c115c0ec4eadb873a0e3154ca15cef3f814b071", size = 498708, upload-time = "2026-09-29T00:44:46.916Z" }, + { url = "https://files.pythonhosted.org/packages/a0/e4/15a8d62b2bc12935080ec7277e2e0b9b233047781eb784a51d3e25af669a/librt-0.16.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:94aed6a8308818b91677957d1bd03188869cd7aeb23c5dba7912a6c0402f7602", size = 515981, upload-time = "2026-09-29T00:44:48.316Z" }, + { url = "https://files.pythonhosted.org/packages/46/4f/287cc282ac5dd815204c0779e79401bb0a568c3a1335fb319bf0838fb566/librt-0.16.0-cp311-cp311-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:349c0bcb87ebd07481b6ff781e25cdc699723dbe2212e57dabb27f7a13b7b87d", size = 508670, upload-time = "2026-09-29T00:44:49.726Z" }, + { url = "https://files.pythonhosted.org/packages/bf/5b/ab7292add898ade0d2b5b75d32a923aae315861671aa5c39f5491309f7ae/librt-0.16.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:001bfd59a7d45b17e3e75f2a8c6405280b35e7b84471792778e718c4f368950e", size = 530393, upload-time = "2026-09-29T00:44:51.356Z" }, + { url = "https://files.pythonhosted.org/packages/7a/9e/8e6bcf027d4bcbc16a4e864b3d158a1d3e5f55ffa53af0238020cad89271/librt-0.16.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:28e038895b998d7a0c7798922ce8a1dc157675df5cf1c9ef0aca809ed804b7a1", size = 534302, upload-time = "2026-09-29T00:44:52.893Z" }, + { url = "https://files.pythonhosted.org/packages/96/a4/8c5ab4f3b3a8e905ff8305d76976a2e666f52fe049edd398aed2402beb36/librt-0.16.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:0dbe4096a7ecc00fa835d24510ad8545a4efef738dac96e0e63516783ccde905", size = 536150, upload-time = "2026-09-29T00:44:54.421Z" }, + { url = "https://files.pythonhosted.org/packages/ea/5e/7c4bc267e3cd4b8bd288de9f62d61fff203829c9cc649ea2aa12e9218cf0/librt-0.16.0-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:5cd5b092441053364af968ea12084692cb9d4a22f3ce9524e377880bf028761e", size = 514316, upload-time = "2026-09-29T00:44:55.998Z" }, + { url = "https://files.pythonhosted.org/packages/e0/75/c8bc6b50f43c73819334233f5a3259c81216742cef56d2140c3dd377c3f0/librt-0.16.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:3ddeb3c9dedb461bb457c6c7d9aa7fbf35329da313d1a7543d00c8d0f3473c96", size = 557731, upload-time = "2026-09-29T00:44:57.581Z" }, + { url = "https://files.pythonhosted.org/packages/93/fb/e241f91bc8de6c7ac1c6a20ea6dd381bc52312b44d711ffcd97140db1e57/librt-0.16.0-cp311-cp311-win32.whl", hash = "sha256:e05108e0849966f53a8d2d3112a7af881d0efaa479bc735bba91108f9f2350a7", size = 104922, upload-time = "2026-09-29T00:44:59.078Z" }, + { url = "https://files.pythonhosted.org/packages/d1/38/c892383d2bb1a6a80b2ec8ede84970a265a792c56614a06282bf3008517c/librt-0.16.0-cp311-cp311-win_amd64.whl", hash = "sha256:5f49cff01bd608ef7d97104cb035c75455e79c2d70bf4a506cf773338ac1860d", size = 125093, upload-time = "2026-09-29T00:49:01.621Z" }, + { url = "https://files.pythonhosted.org/packages/e4/56/8bbde1ed0b21480163617648f638fdaec9374cf5e9c846ebcee34ec02a42/librt-0.16.0-cp311-cp311-win_arm64.whl", hash = "sha256:1d28ae980ae2218f9c5b95d191e947296f918c9bf0b400d467a9430275bbe678", size = 115910, upload-time = "2026-09-29T00:52:40.131Z" }, + { url = "https://files.pythonhosted.org/packages/ad/76/bbdaeb87b7c47b5c7343e90222b9bfa4e4a8a83f647e02933ad0129225b1/librt-0.16.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:fe52bf4641069e7978a14253b036cb9002def1926317e710f2e249f8a8c47742", size = 151028, upload-time = "2026-09-29T00:52:41.508Z" }, + { url = "https://files.pythonhosted.org/packages/fd/0c/ab8ed3dab0085931aec4a792c7eaac8dc6c5ff4691fda3a5360d9d8a9cd2/librt-0.16.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:5bcc2c4726ced915b00de0c9856a4eeabfb3fddb93e10e0b8f735b7709358b6d", size = 155283, upload-time = "2026-09-29T00:52:42.873Z" }, + { url = "https://files.pythonhosted.org/packages/eb/36/494e79d460c80c1f030661e8287c9eca5e1ad652dc2b2180b6cd42abce0a/librt-0.16.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ff7baa55f8e7c69851419e50a666015d02a74198716fd45c0125a2112e0a389f", size = 503185, upload-time = "2026-09-29T00:52:44.638Z" }, + { url = "https://files.pythonhosted.org/packages/9b/34/a8464038dd9db6e4381fa2b6eb73dc9a50888d77102c4c139304ac35cddc/librt-0.16.0-cp312-cp312-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:b95d5d92ab83d39e760a52091bb1baba664f3a2351e39b1e16801e5747c2f0e9", size = 496738, upload-time = "2026-09-29T00:52:46.441Z" }, + { url = "https://files.pythonhosted.org/packages/6a/53/e0e5e334ef0c6ed27039d323819368b9ef6712be87d55ee2bf9799398afd/librt-0.16.0-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:b6d085d70bce51d43c5c7c36d63490770180d8779e71c49305c87b4213918de7", size = 513818, upload-time = "2026-09-29T00:52:48.068Z" }, + { url = "https://files.pythonhosted.org/packages/ad/f7/7ce72cbf19d0addd05090b339152fd0548a02562c2866a603e6e3b3da2df/librt-0.16.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:36e53948e99bbe3ffea257124cfcae1cfb01831555c9a9c903c9f9a72db7fd07", size = 531952, upload-time = "2026-09-29T00:52:49.816Z" }, + { url = "https://files.pythonhosted.org/packages/83/22/0b1bcb6a8e723c8b4fd60dfc8ae8ec6461c54073fbc8685efeb8d900d407/librt-0.16.0-cp312-cp312-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:54d11f726aae9df5a6ffbbf0a03a52449bbac84a53ef03669cb41cdfd4ae41bf", size = 524465, upload-time = "2026-09-29T00:52:51.354Z" }, + { url = "https://files.pythonhosted.org/packages/64/2e/e9c23b8b9df1813da1be205deca9606beb7ddd033972246cd426d05374a0/librt-0.16.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:4323193ac0cd025f85af531df8ba91bf24d1973b401697347a6282e8fd3fcf5e", size = 543191, upload-time = "2026-09-29T00:52:53.284Z" }, + { url = "https://files.pythonhosted.org/packages/bc/e5/6a8b21b342c03ed7e230fa3afbfd2edc58e6e87ef1f0d11fa2b9a748c252/librt-0.16.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:e42f8e098b9c5396fefa05fb1cc7e33b0e08fc51da106b5de4a45fd22aac6743", size = 546979, upload-time = "2026-09-29T00:52:54.932Z" }, + { url = "https://files.pythonhosted.org/packages/84/9e/b5129023eced1be01e01c22757f53be551d463b1bb7264f787927404c1d6/librt-0.16.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:39ec1d5a14e37baf1450a6cabf03fe552340808bf1ad9d71824ab90117716459", size = 555317, upload-time = "2026-09-29T00:52:56.869Z" }, + { url = "https://files.pythonhosted.org/packages/71/89/28bba5938c725fe91f06bf93f7fa6c6b150229df53a87b454b0d5c2a796e/librt-0.16.0-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:d1aabe3925cbb4a08d15b7b20ba4011b53019da0c4173a25155139b7b1baed65", size = 535846, upload-time = "2026-09-29T00:52:58.475Z" }, + { url = "https://files.pythonhosted.org/packages/22/92/63773026614f888c5d4e370e395ce42ca604b89f70b3acdfedbf94851b80/librt-0.16.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:300c3ffdc459f4a779a8411ecb188e3ac0b1ff3a3a7b099642555dedae06c69b", size = 573700, upload-time = "2026-09-29T00:53:00.127Z" }, + { url = "https://files.pythonhosted.org/packages/66/8f/347d4677eefb57cd9f8e01d95a1dcee9a91b4e44e664173c32ff6f3752e5/librt-0.16.0-cp312-cp312-win32.whl", hash = "sha256:c17194318e4c0c0348b36f36c2ec7534436fe0a4c15582403162a4f08c80797a", size = 106158, upload-time = "2026-09-29T00:53:02.031Z" }, + { url = "https://files.pythonhosted.org/packages/f0/2c/5193dc81127cd5ddfad031391b046bf32dda219b38463ab872407ca30646/librt-0.16.0-cp312-cp312-win_amd64.whl", hash = "sha256:25a58a19ea8d83b68209f04912df765e9260635ef77646542ed4b4abe6bc7940", size = 126176, upload-time = "2026-09-29T00:53:03.445Z" }, + { url = "https://files.pythonhosted.org/packages/ff/3d/9668a400c8dd81d162eba38b33fa49fa6205f1a64493570a13fbb815c3ee/librt-0.16.0-cp312-cp312-win_arm64.whl", hash = "sha256:f7be7cf555bc30ec12622e9447299cc4a9b8ff307548b634794353db0c2065dc", size = 116572, upload-time = "2026-09-29T00:53:04.815Z" }, + { url = "https://files.pythonhosted.org/packages/46/cd/ae5e0e9dba45d1399aa04a5395bcc0bead40d9fa06dc903634a7b4d7473d/librt-0.16.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:c5e6144e68b577f157519f2ba88ca20e3ed61c29b00e5cdfa76cd2d45acf059a", size = 151036, upload-time = "2026-09-29T00:53:06.284Z" }, + { url = "https://files.pythonhosted.org/packages/41/5a/48a16e323c5f9447a94cce7b59babf60fa04e62c3365ecf060c77ed8b320/librt-0.16.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:33f41443a1f4e1f099331b3d8120e409fbff84b9760bc1cc9ea496f37ddaa5cc", size = 155211, upload-time = "2026-09-29T00:53:07.72Z" }, + { url = "https://files.pythonhosted.org/packages/3f/29/0f59299eb4251a409b2e690ad4b7d9f8a676db829d7817ec961f32b44f7e/librt-0.16.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7e510b7770bee609617a3374a96548eb114cae048023e3f049ee449e7ff2db32", size = 502587, upload-time = "2026-09-29T00:53:09.191Z" }, + { url = "https://files.pythonhosted.org/packages/de/ba/d6fb4ef8d1537c396079d72289f16be7cd35a366e5065c51253fea2760b6/librt-0.16.0-cp313-cp313-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:efc49c462d4516b8a58b00b490078fa64689fd1fe66970cc190131d7afb8027e", size = 496146, upload-time = "2026-09-29T00:53:11.016Z" }, + { url = "https://files.pythonhosted.org/packages/52/fc/8c50dd4d7cc97c0ee8f252c8a3104980f234391cf1519b554e8b9de08b60/librt-0.16.0-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:92caf82ebef5e12d21c72242b70d1e92536f1711cf2a727a4c276de4b4469087", size = 513336, upload-time = "2026-09-29T00:53:12.655Z" }, + { url = "https://files.pythonhosted.org/packages/a9/59/16c409c56f708eda2db9a0553662845d45e3871c77d70a240dae3f3bdc56/librt-0.16.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:17bac7f7a16b328fff77e440287693eb017abde913595b5827ebccbc21ecd8a6", size = 531689, upload-time = "2026-09-29T00:53:14.39Z" }, + { url = "https://files.pythonhosted.org/packages/88/82/d34772a6c29d1446dcca6e64d74062efd508523ab351aa16625a4689d5cc/librt-0.16.0-cp313-cp313-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:5b976054553670829985ed767feb78fb6bcede0175327c4844dd5c281c1be659", size = 524537, upload-time = "2026-09-29T00:53:16.064Z" }, + { url = "https://files.pythonhosted.org/packages/77/8f/24c5631313746131ccee53bc91fdc8374f9cf25e0082a1fee9c93bb98acc/librt-0.16.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:0058f9d68721094105917254c72ac0569117bb7b13b9769cf45d26d89f9d21cd", size = 543231, upload-time = "2026-09-29T00:53:17.939Z" }, + { url = "https://files.pythonhosted.org/packages/f2/cb/5f8e0d41dbd8b499c2265e939c31acc9ba59845565bf99539ad1c06aebcf/librt-0.16.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:30b7beaf3f4487b7d8adef1f158b49067cb4d5a19fa7a3bf31a4e7a820e435c5", size = 546499, upload-time = "2026-09-29T00:53:19.666Z" }, + { url = "https://files.pythonhosted.org/packages/be/61/063052de441d1385f59cea4223f184bf9e5d125de1ae3239b490aa1e486e/librt-0.16.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:468df902df016a06eb0e40b0747dc8d14e47d7a38b18b63b1fb167d85cb94d63", size = 555261, upload-time = "2026-09-29T00:53:21.292Z" }, + { url = "https://files.pythonhosted.org/packages/14/11/a2ada0529372268d6401afa9d457a095b68cd7753532b6f7f33049a19b43/librt-0.16.0-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:aea7b1f2b125dad5de85f049136651bff256c883c65e6b9209b2da0a1ac3cdef", size = 536029, upload-time = "2026-09-29T00:53:23.07Z" }, + { url = "https://files.pythonhosted.org/packages/23/9d/5bb6d38853382986dca702fc7e06c8256d30f5fa0676d882773b744610dc/librt-0.16.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:a8afb6557920860b7a3a596eb804cf37e09e7cf8a803db2478c202acc72d8c2e", size = 573748, upload-time = "2026-09-29T00:53:24.696Z" }, + { url = "https://files.pythonhosted.org/packages/99/f6/0025cde35ff7f607684dc775a2b2d732cce2561cec050a6ee1fb2e1fc6fe/librt-0.16.0-cp313-cp313-pyemscripten_2025_0_wasm32.whl", hash = "sha256:77c7a2b4fe2c1369e0d5aa1cade26740a7b14be32fbc9a5535d617d20065c39d", size = 79861, upload-time = "2026-09-29T00:53:26.089Z" }, + { url = "https://files.pythonhosted.org/packages/93/93/303b8592909bd583f83f02818ffbea3f7647ca1e22b1cd5465d04b8145fe/librt-0.16.0-cp313-cp313-win32.whl", hash = "sha256:02d89c813d5ff74b17df72d3a34819d132cd168e56b81bf755b809bd9e46b8c4", size = 106236, upload-time = "2026-09-29T00:53:27.43Z" }, + { url = "https://files.pythonhosted.org/packages/cf/24/80bbb463c60ed18e29cb26aba386ddb76609580e4e7160710e550587018c/librt-0.16.0-cp313-cp313-win_amd64.whl", hash = "sha256:14ed6ebe3e4f85f326d7920011ad30ff49ed9334e62cf88caef9ba973d9e3a92", size = 126180, upload-time = "2026-09-29T00:53:28.7Z" }, + { url = "https://files.pythonhosted.org/packages/43/80/b1a6fbdd7da825cdd55c71aa81eb6cfa82c513c360774152eacb50b4a771/librt-0.16.0-cp313-cp313-win_arm64.whl", hash = "sha256:83d4041a3d9b2fd053a8a4e1f22878b3e5833e2712956382d5c048d791454e91", size = 116557, upload-time = "2026-09-29T00:53:30.012Z" }, + { url = "https://files.pythonhosted.org/packages/1e/93/9e0cf7da129a93c3dc7f45bc3cd4a660f2aaa995aa8a6f95c2583ef41239/librt-0.16.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:931a0bb0fcac88f263e269e46eb30ba8e21402cd3c62ca40cb97034c0693fab1", size = 149844, upload-time = "2026-09-29T00:53:31.391Z" }, + { url = "https://files.pythonhosted.org/packages/8f/26/8a90d2a8f2b2e471bb486b7aec117b8ae622715ed6c39853aec48ea20073/librt-0.16.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:1bc17e54e5305f8d40b7ca203671ff5a9e59c1d0f8ea0f625dcca53a3984de11", size = 154111, upload-time = "2026-09-29T00:53:32.718Z" }, + { url = "https://files.pythonhosted.org/packages/35/ce/67abb46258da4d3e42ff5b141db6f38c59357bef84c7979f183b22f924f1/librt-0.16.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:877698bf6bca5721d8be345f2fe09778e40ecadea8b58c73075f2b1a53666bf2", size = 494234, upload-time = "2026-09-29T00:53:34.466Z" }, + { url = "https://files.pythonhosted.org/packages/12/f9/ea7162414a16f8f1bbd3b493ad6d22b926c5471916e078350bdbca8c4e5f/librt-0.16.0-cp314-cp314-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:5981c011b306781ce561e18e14230a14524a3d8109b97553666c942c18f31a96", size = 491173, upload-time = "2026-09-29T00:53:36.124Z" }, + { url = "https://files.pythonhosted.org/packages/b1/09/9b3e869060dd33f9989b80ba4fea306f6db8cecefcdfe6d7346ef0603f65/librt-0.16.0-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:afced3dfc17cd805ecf7a3d77996a71cf5f2c75aa66eb0c21a9930f4fc992f86", size = 505547, upload-time = "2026-09-29T00:53:37.686Z" }, + { url = "https://files.pythonhosted.org/packages/50/07/79007d2165f649ea93e08c0962d1d62c70af9cde77965255095bf9d96f9a/librt-0.16.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ca8052401c55d7511dda6760719fda7618067e83535d7d0010096d216c34b667", size = 523057, upload-time = "2026-09-29T00:53:39.301Z" }, + { url = "https://files.pythonhosted.org/packages/61/0c/8fbaff66d0ba376d8864653f5acce1569bae27e89648671f26f7eca67ab8/librt-0.16.0-cp314-cp314-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:1e511762a074005bb0aa569166779834e75e438370226930d0ce1866d4b6a33b", size = 515158, upload-time = "2026-09-29T00:53:41.012Z" }, + { url = "https://files.pythonhosted.org/packages/df/2e/23ff0dece76f07a4124413a57682efa0bbeb5765ac0122bc0955513f82ca/librt-0.16.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:f1e8591bd8a5a628cd7f07954c6a1592359a878bf032957a8e9057a41d644311", size = 534183, upload-time = "2026-09-29T00:53:42.451Z" }, + { url = "https://files.pythonhosted.org/packages/26/c4/e11dea21d9a29486eba78887380374189d472734fa32cc50cb37ca44d3d0/librt-0.16.0-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:a4aaefb4ba6c07e1aeebb2795c8958148f1d6f9af3b555b53d23d766edb6d67a", size = 540663, upload-time = "2026-09-29T00:53:44.272Z" }, + { url = "https://files.pythonhosted.org/packages/44/75/e873ae158a8b7f5359be33e7fd6c1fbe02d9a78a3e89a77de6b0e837f476/librt-0.16.0-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:d92db7a0f6aee44f1baee94750457e8d2d1c6ccea41842de6268d34e8dc7eddd", size = 545908, upload-time = "2026-09-29T00:53:45.812Z" }, + { url = "https://files.pythonhosted.org/packages/ba/36/8939d3f6a93e11bd9592e6fe28d2b44f1c2dc4bed6e22e72359a91e18ffb/librt-0.16.0-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:378dfaffb38e59c24a87cde5713cd865d51ff7383fa12947f3907f306ea1ca55", size = 523302, upload-time = "2026-09-29T00:53:47.596Z" }, + { url = "https://files.pythonhosted.org/packages/71/14/35309f44a077f0f42ade0e2e7cd88c0cea760c661af205c01ea90d3c0e1f/librt-0.16.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:3e0c39bdc85370422e8b637be76eb1fd07d30967551b03e62267dd156f553152", size = 565911, upload-time = "2026-09-29T00:53:49.278Z" }, + { url = "https://files.pythonhosted.org/packages/78/0c/df6255b94967f3159ebc46f08d8e783c12da6ee269ddb74b2efed63c640c/librt-0.16.0-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:1b384b90ab79a7bc30b566895809a636e0666f21f3cf12b54823d025b7e83839", size = 79119, upload-time = "2026-09-29T00:53:50.938Z" }, + { url = "https://files.pythonhosted.org/packages/6b/44/d30d5a5461378c9d33f36736c6791c3b4c4ba4b1ffe0da7350aedcb2c9a0/librt-0.16.0-cp314-cp314-win32.whl", hash = "sha256:52327da75a94012e7f932f913d20d3876bed3c102be00e6c3e8600ff7bdd58a7", size = 100140, upload-time = "2026-09-29T00:53:52.205Z" }, + { url = "https://files.pythonhosted.org/packages/c2/98/769712f356a1e897df3581bb0c3100375d054a000de26099360ea65b5111/librt-0.16.0-cp314-cp314-win_amd64.whl", hash = "sha256:3f0b8114c44b2ac06ff5dacd08e07e8e807ff4f46083f2a1602685122559be41", size = 120464, upload-time = "2026-09-29T00:53:53.495Z" }, + { url = "https://files.pythonhosted.org/packages/bf/d3/ae2abccc8bdc8b063c1613a77686e17b74e9d3d60cfe6f12c63fa2821b9f/librt-0.16.0-cp314-cp314-win_arm64.whl", hash = "sha256:8caf96a4ef8fb27d0ac0d1ad8337d26a240acd4a02fe4345d0a8f264753e8f99", size = 110889, upload-time = "2026-09-29T00:53:54.817Z" }, + { url = "https://files.pythonhosted.org/packages/e4/26/0737d4be058dd6376eade7dd8b380d4b869b6394cee929393a5a431c45bb/librt-0.16.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:953107e2f68d0f3512c48f898b0dbf0ce5cc52bba0f318d847c985dc555ee4cc", size = 159838, upload-time = "2026-09-29T00:53:56.22Z" }, + { url = "https://files.pythonhosted.org/packages/01/96/9bc96531d7c620e9949af904470f02e3fa8f35129ab8e8f281c51eaa3788/librt-0.16.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:ad37d5b9abd49c9a655dcda7ea52a8a752884062ef1ee71ae17c2f2a0f81fe6a", size = 162018, upload-time = "2026-09-29T00:53:57.532Z" }, + { url = "https://files.pythonhosted.org/packages/0e/fa/b0289dcb186eb3f97221ba00da5f4bd3ba7fa5e99752d48aa8d336615334/librt-0.16.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2c4aa329c17bd1aaea4f6e89335d8ccd494b3a5830b6654462273e50e11023f0", size = 703983, upload-time = "2026-09-29T00:53:59.024Z" }, + { url = "https://files.pythonhosted.org/packages/d9/ab/05ebbbde7530fc5eeb58fbd1581522a9f64f132fa703c4c595eed6e14760/librt-0.16.0-cp314-cp314t-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:0ead24d2562a49473dddd9efef8581f020007eb0054389c3ee3ffad38b1ca4c9", size = 683847, upload-time = "2026-09-29T00:54:00.671Z" }, + { url = "https://files.pythonhosted.org/packages/a3/75/f52aeecd4dbadbddf80725ba7de126d8bd5d0eb66247eae17a81ed90dd4d/librt-0.16.0-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:02118f56a9c36ddd07dfd9b919d9ecc117ba20a90987d56aa4c429fa34509188", size = 698045, upload-time = "2026-09-29T00:54:02.247Z" }, + { url = "https://files.pythonhosted.org/packages/e6/55/fa277a835cd6eb42380591ceb85f48c5b4d2b2d7e2cb9869e1e17d24d237/librt-0.16.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4e29522c62e28595ff7e324c6834ade51127707f0e255b18d1c1cf03d39c1048", size = 724640, upload-time = "2026-09-29T00:54:04.078Z" }, + { url = "https://files.pythonhosted.org/packages/25/e4/2cf64354f3fde8ebd591b3b48f96510bee24ac5f7d1e567adbbe210abdbd/librt-0.16.0-cp314-cp314t-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:3ff4b2367926b69c6215635902cccb04048e73094e9862900d27cb2c6bbff143", size = 731748, upload-time = "2026-09-29T00:54:05.741Z" }, + { url = "https://files.pythonhosted.org/packages/f8/c9/c180af3e94e01aa529fa93d7733fec2abc47f222345400cf21d5481d5f8a/librt-0.16.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:c6f1b27bf1632a7e016af9f145f82be95e1edd7721a646505c21059257cb5a04", size = 754960, upload-time = "2026-09-29T00:54:07.38Z" }, + { url = "https://files.pythonhosted.org/packages/95/d6/01073aa78c58f356b10d9c57b3fe9abb143df338142bcd316df417b89db0/librt-0.16.0-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:5696d7f52e7b37217cb3a8f92c744fe835942602fdd4c1a8bc4741d3bfdce15e", size = 747000, upload-time = "2026-09-29T00:54:09.06Z" }, + { url = "https://files.pythonhosted.org/packages/f7/d8/1de3783908658d697a8cfc00582f61299ffba7796d7260c112e4700b1109/librt-0.16.0-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:6072e92dd876ff6ceeb6cf371e35e51f479349837391341f479b08df4564242b", size = 749569, upload-time = "2026-09-29T00:54:10.702Z" }, + { url = "https://files.pythonhosted.org/packages/b7/32/e817f66c96d6caa8bb8435ff93c4c220624d59efc506be59ab98fcd01d0c/librt-0.16.0-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:39ca4f2f2fe05de8e63493da592d84311adabe5bef52b193851981da9816b302", size = 729483, upload-time = "2026-09-29T00:54:12.25Z" }, + { url = "https://files.pythonhosted.org/packages/7c/c9/23992ccd2b9d22798fdd0f61353183a47414e651da782ad83eb680f50833/librt-0.16.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:f9807485a908f00355820f18e91e045ffdcdc5adb68aaec40a1e2b88c5f7bba1", size = 776584, upload-time = "2026-09-29T00:54:13.837Z" }, + { url = "https://files.pythonhosted.org/packages/67/3b/e8af957f08e6e2e8e566b099e43d2748418aa565df6ee1d9d3331209fdfe/librt-0.16.0-cp314-cp314t-win32.whl", hash = "sha256:94be5cb7bca4df6201f4183e9e4fa2086c655283d20b38cd84500a69057575a7", size = 104402, upload-time = "2026-09-29T00:54:15.568Z" }, + { url = "https://files.pythonhosted.org/packages/ca/1c/946e6443d7cd32347a086043395e421e52fd603c9163d2ec970ceab8eed6/librt-0.16.0-cp314-cp314t-win_amd64.whl", hash = "sha256:d46ca272b251d033dd4527b0dec5f261a28a52bd5fa0f99c117b0a1f8588cc2d", size = 126227, upload-time = "2026-09-29T00:54:17.165Z" }, + { url = "https://files.pythonhosted.org/packages/c2/a3/bc4f9959d3c62bcbf9e5fd3470a8bbd8bf33224ed4c25d7fba173201b8ac/librt-0.16.0-cp314-cp314t-win_arm64.whl", hash = "sha256:b9d6d4b14e92d876f8026b54c20c445f36425214c1081dc76f74e40db386b82b", size = 116493, upload-time = "2026-09-29T00:54:18.567Z" }, + { url = "https://files.pythonhosted.org/packages/b6/4b/10fdb42dfab4c1533e1570e686b18e86ff4328b406361b39fb3016667638/librt-0.16.0-cp315-cp315-macosx_10_15_x86_64.whl", hash = "sha256:6fe436af2eaf630474f491af5d032cbe45f93fcff5c3b9fe4ab194a7255b20ff", size = 149829, upload-time = "2026-09-29T00:54:19.933Z" }, + { url = "https://files.pythonhosted.org/packages/8e/30/a90ca13f1d3d91af1680000a4038536907018fbd51764767287a05d28b8b/librt-0.16.0-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:8ff5d26c529336be9bd7ae04483235d77778ee7d6444a95353102b542601ce81", size = 154522, upload-time = "2026-09-29T00:54:21.306Z" }, + { url = "https://files.pythonhosted.org/packages/5c/dd/bcf364eacfa070bb1fc88d503111ae7177914197ba1fa717c748926e7930/librt-0.16.0-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:909d8e3c1faee44cb762b1c519ff8613dcc5ceae5c99987a00917b5a31fd1d6a", size = 497593, upload-time = "2026-09-29T00:54:22.798Z" }, + { url = "https://files.pythonhosted.org/packages/18/c1/2c4e81e347bdabfe8346bfc6dc37ae5e154d61c88e30848ec0606025a5e0/librt-0.16.0-cp315-cp315-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:6d4a64283ee61824b5790de882bc68e2d9d7a5143537cb7a966f7354f71646d4", size = 480459, upload-time = "2026-09-29T00:54:24.364Z" }, + { url = "https://files.pythonhosted.org/packages/ab/d7/fef2a3cb8400701be496f6e459876f650b3451f407e30cb243de571ae615/librt-0.16.0-cp315-cp315-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:5810ba811297fdf37a1531a57667cb8ace0842013ca8606bf9eb7c24cf4be154", size = 507814, upload-time = "2026-09-29T00:54:25.997Z" }, + { url = "https://files.pythonhosted.org/packages/e1/6f/53762927a32e9dc9eb1d1c1f3528da281290c86d96929a8af652f671266e/librt-0.16.0-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e56aaf8c167548dc8e5d6f3bd0f48dcdd299a23c73be3f744aab79d99e9c7f5d", size = 525114, upload-time = "2026-09-29T00:54:27.747Z" }, + { url = "https://files.pythonhosted.org/packages/6c/67/0b9d031f303c4e8c691a9a8ef9d272f13b530c11cc563b819df621b6a348/librt-0.16.0-cp315-cp315-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:8f36c58e33b304b525c6c9c5076399c6ebf1109e17b9051a05a407b091b9215b", size = 520465, upload-time = "2026-09-29T00:54:29.331Z" }, + { url = "https://files.pythonhosted.org/packages/ae/d5/2056a3a85864e882eb17a203a10ddb26fa748bc9718ec67e79059ab46cae/librt-0.16.0-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:242e00b3d4fa37c3d3c1ca5f5c9adb7d909ddb1eac9c41f2787320d00caa0af2", size = 537257, upload-time = "2026-09-29T00:54:30.915Z" }, + { url = "https://files.pythonhosted.org/packages/54/57/e0d79790c163cbc0909e209a6f62e30bb713b647f905a176cdc64848fd4d/librt-0.16.0-cp315-cp315-musllinux_1_2_i686.whl", hash = "sha256:0253721561787b8df8443eb347b7a6461015354e5bdd37ee38a41fef220d2bb0", size = 527442, upload-time = "2026-09-29T00:54:32.478Z" }, + { url = "https://files.pythonhosted.org/packages/aa/50/1c0c95aba7af51f4752ea34fbf2eb79b36e7cae3a72536248e8c735de735/librt-0.16.0-cp315-cp315-musllinux_1_2_ppc64le.whl", hash = "sha256:3e483a8d69ede8067db70c0e83007423b6925de6fd53afed01d66160f2e9398c", size = 548139, upload-time = "2026-09-29T00:54:34.183Z" }, + { url = "https://files.pythonhosted.org/packages/98/91/a8a43dd5138d4f55f88846b8f0c85454a4fad69952cebfcff9948f831290/librt-0.16.0-cp315-cp315-musllinux_1_2_riscv64.whl", hash = "sha256:69ba927445cfaaffb4081003ef5224c55a5c2ab67ef956f416ef744916e44121", size = 529708, upload-time = "2026-09-29T00:54:35.761Z" }, + { url = "https://files.pythonhosted.org/packages/2d/41/d5226881ab2b7c20d9d587b37bdd4a0ec8775a96d00ca87ac9f385587db4/librt-0.16.0-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:d6a365f2ab45a984d0e00eee0dd17f599ceab8cadab6ea07b6111c8132fc0e42", size = 567781, upload-time = "2026-09-29T00:54:37.409Z" }, + { url = "https://files.pythonhosted.org/packages/bb/bf/2345ba57a626e8c78c4ddcc724636a8df5a593fe46c1ee76bbf477e32b0d/librt-0.16.0-cp315-cp315-pyemscripten_2026_5_wasm32.whl", hash = "sha256:f01f3805f2dae4781c0c34b440e31740d082950bdaf89a6f601ad589a28af57a", size = 79177, upload-time = "2026-09-29T00:54:38.792Z" }, + { url = "https://files.pythonhosted.org/packages/1e/40/99e77936cc9207f629b077bf7cbc5e2f0827cddd7c29792f04ef881bd2c3/librt-0.16.0-cp315-cp315-win32.whl", hash = "sha256:b0e3e721c75d2e79a76d4422c79d7ba705fe1bbafec907037fe7a657a480a0e3", size = 100127, upload-time = "2026-09-29T00:54:40.251Z" }, + { url = "https://files.pythonhosted.org/packages/56/1e/801fe26bc622061b9dfd010e166d94142cb774b733217e6d98d1c0cf2638/librt-0.16.0-cp315-cp315-win_amd64.whl", hash = "sha256:bc02954b1295de798bbdb0b4e2d8a28c2117de8b5c73dcbeb27dc32572dfb971", size = 120480, upload-time = "2026-09-29T00:54:41.722Z" }, + { url = "https://files.pythonhosted.org/packages/bb/a9/d533983055bd36e112627384c2c038845d1df882540b8bcefb566475640b/librt-0.16.0-cp315-cp315-win_arm64.whl", hash = "sha256:c5db585d43449a5f54303d4b2774e45e1babd975cfe1630a3d708c0b80c3e560", size = 110915, upload-time = "2026-09-29T00:54:43.052Z" }, + { url = "https://files.pythonhosted.org/packages/55/fe/d62238fa9c653b0e0613290349467cb65711b5800e8e474f45e942a0ad95/librt-0.16.0-cp315-cp315t-macosx_10_15_x86_64.whl", hash = "sha256:f06c689cb14afd9b612727553a5ec5a40febf113ca41c4413a2b0b334285884b", size = 159714, upload-time = "2026-09-29T00:54:44.497Z" }, + { url = "https://files.pythonhosted.org/packages/f3/ac/f31efe7818700be72ba4f9af8a80fa67c39808c8d26dacc55dc1f6f35172/librt-0.16.0-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:13b4e8aba90b0b1c82474e9844aa9ffe7ad3faa484350e1da64cb8188d903134", size = 162086, upload-time = "2026-09-29T00:54:45.968Z" }, + { url = "https://files.pythonhosted.org/packages/d9/16/4d7487bf86a9d7e8e18f37ba5538789233ea693637379b75701bd35ec9de/librt-0.16.0-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5a269c46ae327d8e6f8c1f85f7516cb52c0fa48127565a1105a4f4a05ff2a0b4", size = 712727, upload-time = "2026-09-29T00:54:47.486Z" }, + { url = "https://files.pythonhosted.org/packages/77/74/50cd550ccc1a517b9ed62347625c01ddf8c4afad66490312677c011458f6/librt-0.16.0-cp315-cp315t-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:a33e0dae1f8592146a4764d54ce842b278732d21a84e17c3bbe6b1bc158a2248", size = 681106, upload-time = "2026-09-29T00:54:49.126Z" }, + { url = "https://files.pythonhosted.org/packages/df/5d/7293f712975ee6fdd2251411fd9ef1c62bc99c7b83ecbe62dbc999b1fab7/librt-0.16.0-cp315-cp315t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:47ada6ea32636492c61aa8ad27ae3b9404bfe7a97e3ba946d1984236cc741da0", size = 705921, upload-time = "2026-09-29T00:54:50.905Z" }, + { url = "https://files.pythonhosted.org/packages/67/f7/8aab946f11d59d1bece9ffc65d994b200c789a8ca5a95c17e17e609f912a/librt-0.16.0-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c43bd6e642d8a248c114327f98dd25ac5a7cb5aa168ef02f0559b91874df16b8", size = 731786, upload-time = "2026-09-29T00:54:52.584Z" }, + { url = "https://files.pythonhosted.org/packages/43/76/1c42ab31e7cb8384ebf6d3af607213c495222474f4940443ae7639ab7685/librt-0.16.0-cp315-cp315t-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:c3d1bb7841a816ace6449bb26d3f9560dbfa20e71c568d23f0f62bf1e68f50b1", size = 744964, upload-time = "2026-09-29T00:54:54.217Z" }, + { url = "https://files.pythonhosted.org/packages/6f/2e/4b19982d933d2dfced671e840b219e4c1cd3f507df6e6dabb51bbd4e3850/librt-0.16.0-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:3931f7a3db322e7f44e02a280e3949326ce9579ad388ee8d691dc7c76da9fb70", size = 765305, upload-time = "2026-09-29T00:54:55.815Z" }, + { url = "https://files.pythonhosted.org/packages/b8/1b/e872583de2dcb3ac7746e7a2321aeeb168274f3952a87dc66e05ddb29faf/librt-0.16.0-cp315-cp315t-musllinux_1_2_i686.whl", hash = "sha256:f4462528b6000afe8f16907b5c7c2553abf1df005ba5140e6eb394541c3624c3", size = 744959, upload-time = "2026-09-29T00:54:57.532Z" }, + { url = "https://files.pythonhosted.org/packages/10/de/a18c6bcfb297af2674233e90b3c3661c3a0af0f1434a0c966d2ef708a835/librt-0.16.0-cp315-cp315t-musllinux_1_2_ppc64le.whl", hash = "sha256:80039ba9b6a7d5f1a0175a4cca6bbefead87bd854c80abad1cb30afe47a830db", size = 758138, upload-time = "2026-09-29T00:54:59.484Z" }, + { url = "https://files.pythonhosted.org/packages/22/1c/0df1d732539c297bb1a093e1fe3204d2faf76a9022cf4e1d1c2fce059790/librt-0.16.0-cp315-cp315t-musllinux_1_2_riscv64.whl", hash = "sha256:7a1d272724b581bb6bc769dfdafed6da2ecc9886ba2450311de55a4ac2e1e9cd", size = 744268, upload-time = "2026-09-29T00:55:01.179Z" }, + { url = "https://files.pythonhosted.org/packages/a2/f7/ccaf31331f20c91a5bd9bd48ffc3f743f9c81bb5720cc7b2a720ca204f0a/librt-0.16.0-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:fbe4fb8c5445f7496d7f7f6bb0807875d09d47e6771ffa175fb2df2895fb86ba", size = 785783, upload-time = "2026-09-29T00:55:02.938Z" }, + { url = "https://files.pythonhosted.org/packages/c1/ea/7421d9e6db894cd6cd788b604b3394a163ded6b942052b6f96c23ccf08e1/librt-0.16.0-cp315-cp315t-win32.whl", hash = "sha256:375bfe6b572a8f6cfc398709356046173bf27e64c4c5edaf5f7062f051fb4bf9", size = 104355, upload-time = "2026-09-29T00:55:04.533Z" }, + { url = "https://files.pythonhosted.org/packages/85/6d/7c31a506eb847bc58aeb2402d58e17605e821f68ab5df5e66fe274a6df41/librt-0.16.0-cp315-cp315t-win_amd64.whl", hash = "sha256:bd3150023d3dc2bc70f3784e59ffa1140d56ddba3d8125b3d6f9f85221279bfc", size = 126134, upload-time = "2026-09-29T00:55:06.017Z" }, + { url = "https://files.pythonhosted.org/packages/36/69/7a5d10ac409c4da0355e054a14371871da9b5557fcc42772cd00181c6cce/librt-0.16.0-cp315-cp315t-win_arm64.whl", hash = "sha256:8ceafb70f2a4f0826f11031942e59c0728fd98da112dc346d4352bde1e486866", size = 116391, upload-time = "2026-09-29T00:55:07.484Z" }, +] + +[[package]] +name = "mypy" +version = "2.3.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "ast-serialize" }, + { name = "librt", marker = "platform_python_implementation != 'PyPy'" }, + { name = "mypy-extensions" }, + { name = "pathspec" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/82/6a/878cc1097d4035f82bd516658d0c528d2a9955bc7b363afcbd0b07fea11b/mypy-2.3.1.tar.gz", hash = "sha256:47c1b1207258513a9d93495f69c8be9de73916186f0e52703e8c461b7a623419", size = 3992554, upload-time = "2026-08-15T03:03:38.549Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a4/be/c624d4241484f37dc62839e177ab607a9b8b3e96f0866544ca99e8e41d51/mypy-2.3.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:94f04929f1c44c35fb0061e912087edaf504acede963a4a7d00680bd089d8531", size = 13936739, upload-time = "2026-08-15T03:03:26.475Z" }, + { url = "https://files.pythonhosted.org/packages/53/84/e3cf72f90dce5960871c82551c8fba6da05fc1018f79be41c047bd126bdd/mypy-2.3.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f5d716048611e85ca9eefb2e1baa5d73ede389b5820ded260ea27c757d667af8", size = 14166460, upload-time = "2026-08-15T03:01:50.565Z" }, + { url = "https://files.pythonhosted.org/packages/4a/ff/6b97d58aa0f79a5ab9b472db1f6d6df1b11a51d74d0c08ab3760d3a613ba/mypy-2.3.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b091a455111214cb5c9d54a57b9618e9a49f9fe2a42e4e1ac86e9d104ed96ce8", size = 15100476, upload-time = "2026-08-15T03:03:12.079Z" }, + { url = "https://files.pythonhosted.org/packages/da/f0/cbb4b7d2ae3ac635f6b4f2d9b04070b8a92edf50da599d3b39e5ed109001/mypy-2.3.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:df12e20c9efd614738c71b390007ecd0181125afc4ccafca04d78a1d2eed2c01", size = 15347826, upload-time = "2026-08-15T03:03:02.856Z" }, + { url = "https://files.pythonhosted.org/packages/5f/10/91dcdc6f8d43fc08e6a06ab1f9732f3abaaf835ac1b2e67b9dff56910855/mypy-2.3.1-cp311-cp311-win_amd64.whl", hash = "sha256:52eaf3a155f35cf80b40220288c861eb45f14a2340c1f6cbfbdb0feff32879d1", size = 11142615, upload-time = "2026-08-15T03:03:36.316Z" }, + { url = "https://files.pythonhosted.org/packages/3d/8a/28d54535bf4b9aa43b2d8918c2ef660378b9f66b23d78dcee052744ae622/mypy-2.3.1-cp311-cp311-win_arm64.whl", hash = "sha256:9b4eacbee8a69836c06eff6d0dd4e134a07c2b047755b30c08625fe214f322c6", size = 10141145, upload-time = "2026-08-15T03:03:07.406Z" }, + { url = "https://files.pythonhosted.org/packages/85/da/d6effc4f808a842d91edc22535dc9e799d2ff6e91449168b7f47a0771f54/mypy-2.3.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:a32bbbb940af990d3be0b8af321c7b6815bb1b3b48142fe7459b9cc5f58959ff", size = 14047547, upload-time = "2026-08-15T03:02:57.707Z" }, + { url = "https://files.pythonhosted.org/packages/e4/e6/478229701dab76f26485fc8ff5d6f241f393da22447400bbc56f6946aebe/mypy-2.3.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ff715e45b2231a8e85de1d163d1b42791e4d7aab8f5145f85fee1b710b735aff", size = 14216515, upload-time = "2026-08-15T03:01:26.496Z" }, + { url = "https://files.pythonhosted.org/packages/8d/fe/7c42327a3b21e84681f691982cbfe43f334a3685f3b683b72c376476c4fa/mypy-2.3.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:858fc57d3d91fa728e33e7ad71def60fc6272694607b306cd3292db53ae39080", size = 15307789, upload-time = "2026-08-15T03:03:31.62Z" }, + { url = "https://files.pythonhosted.org/packages/59/f4/7e597edbe01b5a56fa958ce541302dcaabfed979966f1dffedbea0ea0fc2/mypy-2.3.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:851833db876e7b650f93719c74b7879a08e338979c96054fdfc3bfd90a486355", size = 15548831, upload-time = "2026-08-15T03:03:15.55Z" }, + { url = "https://files.pythonhosted.org/packages/a3/52/cb31e084bc0314a1e384bdd677a4b80e55af04ccac077545e2238b9d320a/mypy-2.3.1-cp312-cp312-win_amd64.whl", hash = "sha256:4c5095a327483591c94e0c8d3ef9e50d4ab1369b541eae007c1f23bc2a41f6bb", size = 11226359, upload-time = "2026-08-15T03:03:29.002Z" }, + { url = "https://files.pythonhosted.org/packages/7a/47/88fcf6217b43fa2da81a8c2611370af18141536a4f0294bbf98b457d456d/mypy-2.3.1-cp312-cp312-win_arm64.whl", hash = "sha256:bbfe022634a2a195406bd469e888d2eaf193b02ba7e607391cd7640374aaae3b", size = 10214707, upload-time = "2026-08-15T03:02:48.807Z" }, + { url = "https://files.pythonhosted.org/packages/de/cf/862010ee800ca9c2bd0c4c0dacf0f092e5411824a09b8f97ad4be8fe250e/mypy-2.3.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:114dff494000f18bd10d5d95d84b8567b26da60279ecbe838131841df20e635d", size = 13964542, upload-time = "2026-08-15T03:02:21.43Z" }, + { url = "https://files.pythonhosted.org/packages/75/5a/3f3a2107b41e3e92e617e25daaee121413b91e9784bea733131ed4fecc5d/mypy-2.3.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c8637731bb5eee3671eb2c3200827aa3564ed8a9309ecee4d1afe77e6d031bdb", size = 14168922, upload-time = "2026-08-15T03:03:00.351Z" }, + { url = "https://files.pythonhosted.org/packages/8b/41/04dc4fe7e63d7820fa4eff272e95157d30cbea921388f3ab3fe77794cd0b/mypy-2.3.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1c80fbc405ed8020f5ff3802dc18cf060197bcdd3fbdd6a26ef2fd34dfdd5226", size = 15244791, upload-time = "2026-08-15T03:02:31.089Z" }, + { url = "https://files.pythonhosted.org/packages/96/fc/c3053b26b9054949285aa868cb6af8c10e7591541cacd79c5dcc06a1fcf9/mypy-2.3.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:84081f538ce27375045c02e3d7f81bd11d853400621ae245d87ce7b6c420ec74", size = 15501627, upload-time = "2026-08-15T03:03:34.128Z" }, + { url = "https://files.pythonhosted.org/packages/70/4e/d77daab008bbc4e5001374d7928f4a260d28f0e6747af444fc4763f7a310/mypy-2.3.1-cp313-cp313-win_amd64.whl", hash = "sha256:e9144ac16fde007096f9563eb2041b4433c2d705c4218edeb79e7e9d01035ee6", size = 11243961, upload-time = "2026-08-15T03:02:11.952Z" }, + { url = "https://files.pythonhosted.org/packages/f0/f8/7eb68c136e4abd30569fe31ef2bfcb7eceae9952cab80017c04cd09f5d0c/mypy-2.3.1-cp313-cp313-win_arm64.whl", hash = "sha256:77ad9529e67dca28e511f5cd5671436584ce91f6d3bac159a353158187b986ac", size = 10213219, upload-time = "2026-08-15T03:02:26.361Z" }, + { url = "https://files.pythonhosted.org/packages/be/c4/42a49d44aeff804edf1b19acce0b49e8bd1a9c57dee9605dd8d980aa43d7/mypy-2.3.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:192abaedf75da1bc0b1cef104927e70ec49c1ef0031cc4825c7ee10a438ed24d", size = 13986778, upload-time = "2026-08-15T03:01:33.69Z" }, + { url = "https://files.pythonhosted.org/packages/45/13/9331fd2dfed7194d66c5304072894a8be3e51e9deda6863c1eceaa35a43d/mypy-2.3.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:bf678dffd16efcda2c15cbd30e9ecc0081388e29ea23687a88e686ed92638dc3", size = 14188467, upload-time = "2026-08-15T03:02:40.554Z" }, + { url = "https://files.pythonhosted.org/packages/78/f7/f4a34edab45667c5465855dc585a20e87978ffa8aee711445b7239d120c6/mypy-2.3.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8e036f06b41630f4c8a1d48f9ac6aa26acc65f8be089973f5519da643318f03f", size = 15225538, upload-time = "2026-08-15T03:03:09.761Z" }, + { url = "https://files.pythonhosted.org/packages/40/05/534b3590757bd05794f73e07f6666c2a77b8597ffed795c94ce570096aa0/mypy-2.3.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:71af9c8a894e862b58e92abb08e53b05a384a1e5e5d6dc7cda59126211a53d82", size = 15480805, upload-time = "2026-08-15T03:01:41.134Z" }, + { url = "https://files.pythonhosted.org/packages/55/da/bdfba852e2562f599624af5bb7d29e36b0b4f526f2b8bac85efe0dd1803d/mypy-2.3.1-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:3c80cd23d85368bdd9f37d5231dfd97d35bcbf5bf41af96ef3a9b078ad1957f9", size = 7761712, upload-time = "2026-08-15T03:02:36.008Z" }, + { url = "https://files.pythonhosted.org/packages/98/31/60fc64a74cdba4f2a5d642d32317993e479163e1ac7d91b695e5d15e2264/mypy-2.3.1-cp314-cp314-win_amd64.whl", hash = "sha256:4956f34d145e145562a0a0bf367f642bbc85c04ec2baf47ae015947c3169a85d", size = 11423968, upload-time = "2026-08-15T03:02:06.931Z" }, + { url = "https://files.pythonhosted.org/packages/a9/23/eb5950b24cd26ba3b78f87707a275568d633c77dae8e61c9661be6055ca6/mypy-2.3.1-cp314-cp314-win_arm64.whl", hash = "sha256:cfb12e360242d23d91f5e978d94f58ea66acf5804c4fb6f2f794a20d4cb1b595", size = 10399323, upload-time = "2026-08-15T03:02:33.671Z" }, + { url = "https://files.pythonhosted.org/packages/82/c7/f80f4e46c0b9a00eb5f78a79d49dda8bdf56a5230f7257fb33e76be04da7/mypy-2.3.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:e5f1c50bb05b64e2026b52867e8d21106f01313c744a2c4ecc34c90d12e8d6e2", size = 15121308, upload-time = "2026-08-15T03:01:46.053Z" }, + { url = "https://files.pythonhosted.org/packages/5d/74/9b04f17c7074cc5188f02fb63a2ca1d43fedf479e84fe3091c39061a1d7f/mypy-2.3.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:667196b352f4cf304ded4c10f90cfc179263a1acfb3cdcfa984bdfd340d498bc", size = 15536590, upload-time = "2026-08-15T03:01:35.941Z" }, + { url = "https://files.pythonhosted.org/packages/26/04/c837ef6208e567774e2ed1f863f8ba6ec4817b1b6dd426315e5d559b6ec9/mypy-2.3.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b9c53e395c12cad2c6d4b67d5da7c6057638a132d85c08b73646b18f802a0045", size = 16791074, upload-time = "2026-08-15T03:01:31.073Z" }, + { url = "https://files.pythonhosted.org/packages/37/68/48730230afa45192d5bd429a6a2ff24a6f8dedda90fdf2b221792b54518f/mypy-2.3.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:18162b128c3f9c703cd35f5537446900b0d21a2549aa7a95d21380d2ef643fb0", size = 17069183, upload-time = "2026-08-15T03:02:28.566Z" }, + { url = "https://files.pythonhosted.org/packages/1c/ea/ca23fc9c20eeda09a15c9cbcf50015d0e73f409f6ead059e42aa69a608ff/mypy-2.3.1-cp314-cp314t-win_amd64.whl", hash = "sha256:30c0477d4aab7b7f39c8397dc877f2c96b9fe5588ec379f372c56eb63d599f63", size = 12154679, upload-time = "2026-08-15T03:02:04.809Z" }, + { url = "https://files.pythonhosted.org/packages/3b/67/8d982126034990869466f73b8db80dcb2234a7ac39b4dad093e047a79835/mypy-2.3.1-cp314-cp314t-win_arm64.whl", hash = "sha256:6941ab3619377bc3f32ca02876b07d27f216f5201604b664d3937ea0fdd23bb4", size = 10969159, upload-time = "2026-08-15T03:02:38.152Z" }, + { url = "https://files.pythonhosted.org/packages/ee/f7/41e7f2d8117fbc7a7587286162ffe2f688984b69c46ed63cf5f2e4fc3bae/mypy-2.3.1-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:6f041a6de52c9217ca125e78ba0a335cb7fd98a1c0580978e49ab2b126f70b57", size = 13990694, upload-time = "2026-08-15T03:03:21.919Z" }, + { url = "https://files.pythonhosted.org/packages/06/85/8f665811a0c8f3bf6fa1d9acd665ec2d97a2bcc453ae68dcd92340941cd6/mypy-2.3.1-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5159ae60f5dbc3a498af5ba8365505808ac8031bc63f9e00304ad545d40bdd9b", size = 14203518, upload-time = "2026-08-15T03:01:48.455Z" }, + { url = "https://files.pythonhosted.org/packages/2d/82/91b866c8546b120bff83b73a439d90d2d63ef3aff113599e6b8e4d566848/mypy-2.3.1-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:47a8a7a0a7f6f6e63995c0ac36fa0c07b127413fdc81f0439b7f3dccafd33561", size = 15220224, upload-time = "2026-08-15T03:01:23.577Z" }, + { url = "https://files.pythonhosted.org/packages/c8/78/c226c99208ee40de7c768369fa533f933afa003dfdc606ff021450724e91/mypy-2.3.1-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:2329c0501293d4e1f33bc15d04d6304d65a1cdda967ee93a05c1e681a3923133", size = 15501512, upload-time = "2026-08-15T03:02:09.453Z" }, + { url = "https://files.pythonhosted.org/packages/a9/e7/7cfb3f106c393979f4cc37ad6c0586044d50401e3c35b0c003e4f3ba6bc9/mypy-2.3.1-cp315-cp315-pyemscripten_2026_5_wasm32.whl", hash = "sha256:bb26deed807bdb0457cf3e3f1cd7c4a1cf9d66864eaf1b4a61e06805d4c6b1f9", size = 7761913, upload-time = "2026-08-15T03:01:55.65Z" }, + { url = "https://files.pythonhosted.org/packages/99/3c/52affefa273b97939a1f474ae4a349c8718635c15b941112dfab4291b0c1/mypy-2.3.1-cp315-cp315-win_amd64.whl", hash = "sha256:375d7013876a8233b2d05be185bfa09f689696cd999ce8b1cfe6acac5c80e8a3", size = 11422533, upload-time = "2026-08-15T03:03:24.101Z" }, + { url = "https://files.pythonhosted.org/packages/2a/b7/75643e70c72a5b346d8a9b1543c967ea8824df2ee3fb7ccba652c272b7bb/mypy-2.3.1-cp315-cp315-win_arm64.whl", hash = "sha256:586b3612214cceabb3c0f588c97e7d1e535393f06a60e912e994f6b3ace97523", size = 10397931, upload-time = "2026-08-15T03:02:55.265Z" }, + { url = "https://files.pythonhosted.org/packages/10/ce/53be21f2d4adfcd26f63f1184a13ed797015ab463853f117e2e11e4d726f/mypy-2.3.1-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:ef0c6335cda9d807f8193d8ff6204a72bc909fa9882aacbca14f43cdb7188306", size = 15118669, upload-time = "2026-08-15T03:02:51.479Z" }, + { url = "https://files.pythonhosted.org/packages/62/43/20de757cd42989d291a17fad607742c4c74e875ce5cea00e5a5225020ac1/mypy-2.3.1-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e598c8c66401d26b150872154a286e6d484cf2789c3bb28a7556806298423021", size = 15545627, upload-time = "2026-08-15T03:03:05.132Z" }, + { url = "https://files.pythonhosted.org/packages/7e/fc/092bdf77ad280eaf501422f0f3b966012b528076cc13e41a774861c907d1/mypy-2.3.1-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:eda22fd4efa9dcd39331d1dede9b5b8b8a7fd69af07592e778433da98610d29e", size = 16764157, upload-time = "2026-08-15T03:02:23.958Z" }, + { url = "https://files.pythonhosted.org/packages/94/5c/c94c4d62d909b07f552d0d9356d7acc943825558e602a64822ffa2231536/mypy-2.3.1-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:2a0ba2e57847849fb0d1fcdabb32786d223095ed8bc121dfe322bcdb3d9c46bc", size = 17073258, upload-time = "2026-08-15T03:02:14.573Z" }, + { url = "https://files.pythonhosted.org/packages/c0/f7/511a88b89e478053c02d22039bb8f3ce4183efe8fd7a4f0a5910a8bb0a32/mypy-2.3.1-cp315-cp315t-win_amd64.whl", hash = "sha256:3f7e865dd51f235f60a2dbcd8728a1c095f5ca28f095d48a725b84cd935735c4", size = 12135505, upload-time = "2026-08-15T03:02:16.714Z" }, + { url = "https://files.pythonhosted.org/packages/71/bf/02573b56964ecb0f7c644f915f53c325ae15c3faec521c5adf11599a32df/mypy-2.3.1-cp315-cp315t-win_arm64.whl", hash = "sha256:8ad80807dc3ab8ea978b1b2b6e4a657194ace1d4ef03e0e731aff1abd517da29", size = 10962647, upload-time = "2026-08-15T03:01:43.712Z" }, + { url = "https://files.pythonhosted.org/packages/8e/41/9675c7a1e78edecfba0b79e587a52594c56e189368261dc7b3a7fffb9527/mypy-2.3.1-py3-none-any.whl", hash = "sha256:6ed5c7e3419083268e5c9258bd1c1ef91af44a9e89374dbcaf37b775716e72eb", size = 2754338, upload-time = "2026-08-15T03:02:53.4Z" }, +] + +[[package]] +name = "mypy-extensions" +version = "1.1.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/a2/6e/371856a3fb9d31ca8dac321cda606860fa4548858c0cc45d9d1d4ca2628b/mypy_extensions-1.1.0.tar.gz", hash = "sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558", size = 6343, upload-time = "2025-04-22T14:54:24.164Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/79/7b/2c79738432f5c924bef5071f933bcc9efd0473bac3b4aa584a6f7c1c8df8/mypy_extensions-1.1.0-py3-none-any.whl", hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505", size = 4963, upload-time = "2025-04-22T14:54:22.983Z" }, +] + +[[package]] +name = "packaging" +version = "26.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/7d/fa/3944b40b07da9ce895c0e6303a5ab7d53da063554f534556b134a54d6093/packaging-26.3.tar.gz", hash = "sha256:94edc256424af38762eb31306eed28beb9f0efc50a8837492c9d6fd6004aed79", size = 313412, upload-time = "2026-08-04T18:15:28.737Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/63/34/ba1c580383c9eada3711951fef0795c80b829a078d72188184bcab9dd527/packaging-26.3-py3-none-any.whl", hash = "sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c", size = 129956, upload-time = "2026-08-04T18:15:27.159Z" }, +] + +[[package]] +name = "pathspec" +version = "1.1.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/5a/82/42f767fc1c1143d6fd36efb827202a2d997a375e160a71eb2888a925aac1/pathspec-1.1.1.tar.gz", hash = "sha256:17db5ecd524104a120e173814c90367a96a98d07c45b2e10c2f3919fff91bf5a", size = 135180, upload-time = "2026-04-27T01:46:08.907Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f1/d9/7fb5aa316bc299258e68c73ba3bddbc499654a07f151cba08f6153988714/pathspec-1.1.1-py3-none-any.whl", hash = "sha256:a00ce642f577bf7f473932318056212bc4f8bfdf53128c78bbd5af0b9b20b189", size = 57328, upload-time = "2026-04-27T01:46:07.06Z" }, +] + +[[package]] +name = "pluggy" +version = "1.6.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f9/e2/3e91f31a7d2b083fe6ef3fa267035b518369d9511ffab804f839851d2779/pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3", size = 69412, upload-time = "2025-05-15T12:30:07.975Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538, upload-time = "2025-05-15T12:30:06.134Z" }, +] + +[[package]] +name = "pygments" +version = "2.21.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/49/2e/ced460408999b33da6b31b0021b0f37d329e202d4169aeb164493778f25b/pygments-2.21.0.tar.gz", hash = "sha256:610ca751c9bc2492b38eb9a38a7fbc93edbbb2d7182edaf34e66ae493dee5c8c", size = 5005329, upload-time = "2026-08-17T08:02:48.824Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/71/46/17f022dd3e953bf20a04a028a21ec746d942f8d2af30fa0f124fa0e6a684/pygments-2.21.0-py3-none-any.whl", hash = "sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9", size = 1250147, upload-time = "2026-08-17T08:02:44.912Z" }, +] + +[[package]] +name = "pytest" +version = "9.1.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, + { name = "pygments" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/e4/47/b9efed96c114afcfa3c9d3fe98a76a1d14c74a9e266d397cf6eb64be5e01/pytest-9.1.1.tar.gz", hash = "sha256:1088fbde8f2b49d95a549a195707afa7a76a3ce9bcadc26b6d71f0ffda5fe313", size = 1636369, upload-time = "2026-06-19T10:58:32.857Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/24/25/1de2678b631f5a49215c6c96fff41ba892b0a34df68d6d80292b1b48aa7f/pytest-9.1.1-py3-none-any.whl", hash = "sha256:37a86b45efb9a47a61a36449063e8e18d0cab3161329fc099eb21783169c4f0c", size = 386536, upload-time = "2026-06-19T10:58:31.347Z" }, +] + +[[package]] +name = "ruff" +version = "0.16.9" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/96/bf/c935ca98e73fe8ce65b87ef08a280c0c1e85295d569228c15e87d8fdfaf1/ruff-0.16.9.tar.gz", hash = "sha256:12b625c6cfba78d285d9f48eda5f053374f1e53cb10ef17342a383750db99161", size = 4948764, upload-time = "2026-09-24T20:37:49.416Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0d/26/df51322b52ee1ada7eff2d071ea09d11d5c2d1dcc9f02594f5785c4d1635/ruff-0.16.9-py3-none-linux_armv6l.whl", hash = "sha256:95e6f022090368ab3b824c36276839c53b2adf1a3f4c09fefc33dfc400f6da96", size = 10082922, upload-time = "2026-09-24T20:37:13.045Z" }, + { url = "https://files.pythonhosted.org/packages/a5/27/7bf51f5a7aa375e9f339280a303aab44ca75dc1525f1cdc5991761685b0f/ruff-0.16.9-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:a5f27be168556594a86d2f415db0cf43f5291917849318f873c7e2791f7a8c67", size = 10236360, upload-time = "2026-09-24T20:37:16.049Z" }, + { url = "https://files.pythonhosted.org/packages/b6/63/09659283f92f02dff45809da194a70da2f688d87c55d8875c4fae3536072/ruff-0.16.9-py3-none-macosx_11_0_arm64.whl", hash = "sha256:1632eb1d6197f33bd00b1acbc5b71009e89a8895c158e2d2b03a834fac964ab6", size = 9892940, upload-time = "2026-09-24T20:37:17.957Z" }, + { url = "https://files.pythonhosted.org/packages/24/58/98de1b72ec172f5f8f1731236fe21585b3998bf7dfe9fcc44ae9ba626012/ruff-0.16.9-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b3f951b14d865d5952c89d40a5ca07e87abe24fa5453299878411e127748fb1c", size = 10032114, upload-time = "2026-09-24T20:37:19.942Z" }, + { url = "https://files.pythonhosted.org/packages/c8/7d/f1e17c54ab59d4bad1dce8ee3e22a7a1d0ef4745240decacdcf3832b5bb2/ruff-0.16.9-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:447fc07e1573afff7cb02803462b12b6c8ece7cf10e2cd78565fa6d7a1c0bf8d", size = 9910227, upload-time = "2026-09-24T20:37:21.872Z" }, + { url = "https://files.pythonhosted.org/packages/34/19/436f647a65075bbd3bab2668b3bdaa5120559b294694018cdcefabbbf30b/ruff-0.16.9-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8a3e039a6a40ed976c491722b60e0ae4a4aa1a86057f540ee7a37a5d19ae9120", size = 10547484, upload-time = "2026-09-24T20:37:24.229Z" }, + { url = "https://files.pythonhosted.org/packages/03/59/38430a6bc2f6d8095447ac39625cf8b6e9344a47e6c26225c8ba1bff3ffb/ruff-0.16.9-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4684dded7db60aa57cb118fa158630f5feade4af5782903b6053484bdf9bd129", size = 11412367, upload-time = "2026-09-24T20:37:26.307Z" }, + { url = "https://files.pythonhosted.org/packages/c8/bd/bbb6d7fc7f208c8b8c50dd5dc8206e4cfdb1e7a8fb852606a3adf370c880/ruff-0.16.9-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d29c934357e45642fda2f34c0b1f4025b4a6c01e15e4bf0016879d60078a142c", size = 10869787, upload-time = "2026-09-24T20:37:28.35Z" }, + { url = "https://files.pythonhosted.org/packages/bc/b8/9c543074918061abbefc3bd139bee22de35abedb00dde0f2d27288838962/ruff-0.16.9-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a21713e629d3e5bdb2f5c2def1cc7f04f47fa8e1a7eb0571b4a28e1da64bc728", size = 10406494, upload-time = "2026-09-24T20:37:30.624Z" }, + { url = "https://files.pythonhosted.org/packages/35/7a/5a8851bd146e7ccf8fd4b003f6c75c11f8fbdb0e60673b45097986b6bf41/ruff-0.16.9-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:7baa24ef5fc8e77aa93879e1d3f43754a01ae488e869f1ae30cf431afd4d2452", size = 10590083, upload-time = "2026-09-24T20:37:32.439Z" }, + { url = "https://files.pythonhosted.org/packages/87/f0/4c3467188f23f806960b46fa76575a7cd0514c9ba90562650b71efc96980/ruff-0.16.9-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:a41aac6230aadfaa133bdfa1614488531ffa3e0837567ae04c0da2058a9c0f9e", size = 10119151, upload-time = "2026-09-24T20:37:34.581Z" }, + { url = "https://files.pythonhosted.org/packages/15/34/5a4def5adea572ce6aea0bb64f21f928ee317b80e0db747d7979b01d7261/ruff-0.16.9-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:c2529fb5896d49115b0e9aa8f887490b34bbe76baf879ec2264ac59406869ce7", size = 9911544, upload-time = "2026-09-24T20:37:36.796Z" }, + { url = "https://files.pythonhosted.org/packages/62/5d/d15ebea7499eef9373318c0ee6ca127832927c6529731f6d48e18dce7ca9/ruff-0.16.9-py3-none-musllinux_1_2_i686.whl", hash = "sha256:41e3870277694177429b56406d65dfbdb2c2802c52b715edaf6a0b829c69d4ee", size = 10269884, upload-time = "2026-09-24T20:37:38.857Z" }, + { url = "https://files.pythonhosted.org/packages/d1/56/c5d3cd119ded7a3c7aba0e961b69cb3df701c91662c98ad694467d060ce1/ruff-0.16.9-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:8adbe4e58af167f767d7b2ba5e83c42e878350796cf78c2f5e14ab9903a92588", size = 10749366, upload-time = "2026-09-24T20:37:41.042Z" }, + { url = "https://files.pythonhosted.org/packages/ac/fe/734ec7527029ac757ecf821f143c9f3fcf69149c21f53a044a899b430f5a/ruff-0.16.9-py3-none-win32.whl", hash = "sha256:0e1dbc2073624dee6618d41d0098690a7244654af746704b64759e12b6b6b385", size = 10152355, upload-time = "2026-09-24T20:37:43.025Z" }, + { url = "https://files.pythonhosted.org/packages/14/21/26e4643629b3ebb44f0a06f9c9a53058d63d989415f63a9a3c28e2ee7f22/ruff-0.16.9-py3-none-win_amd64.whl", hash = "sha256:6bd40fec8cd4c8a3d4dd589bd8ad4e6320c13c29234159bfd959a40d529d597b", size = 10592965, upload-time = "2026-09-24T20:37:44.944Z" }, + { url = "https://files.pythonhosted.org/packages/51/60/5fb1a39dbb5ae314d5f59bc7348a63c1d5c20f3cd83914c4b5cb0be31d2d/ruff-0.16.9-py3-none-win_arm64.whl", hash = "sha256:ed1a252039200f57a59eebc063b54beabea67bfbaaca0eeaa7f54b5fbcda2284", size = 10458649, upload-time = "2026-09-24T20:37:46.882Z" }, +] + +[[package]] +name = "shellrent-sdk" +source = { editable = "." } +dependencies = [ + { name = "attrs" }, + { name = "httpx" }, +] + +[package.dev-dependencies] +dev = [ + { name = "mypy" }, + { name = "pytest" }, + { name = "ruff" }, +] + +[package.metadata] +requires-dist = [ + { name = "attrs", specifier = ">=22.2.0" }, + { name = "httpx", specifier = ">=0.23.1,<0.29.0" }, +] + +[package.metadata.requires-dev] +dev = [ + { name = "mypy", specifier = ">=1.15" }, + { name = "pytest", specifier = ">=8.0" }, + { name = "ruff", specifier = ">=0.16" }, +] + +[[package]] +name = "typing-extensions" +version = "4.16.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f6/cc/6253133b5bb138fc3306cebfbda2c520f545d36b5be2c7255cc528bb45d6/typing_extensions-4.16.0.tar.gz", hash = "sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5", size = 113555, upload-time = "2026-07-02T08:40:05.92Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/49/d3/b8441a820a491ddfc024b0b0cf0393375b75ea13866d9c66727e54c2fc80/typing_extensions-4.16.0-py3-none-any.whl", hash = "sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8", size = 45571, upload-time = "2026-07-02T08:40:04.659Z" }, +]