diff --git a/openapi.yaml b/openapi.yaml index b913c17..0ddeeb2 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -628,6 +628,14 @@ paths: responses: '200': description: Domain successfully requested and instance registered + content: + application/json: + schema: + type: object + properties: + domain: + type: string + example: "my-awesome-app.dployr.dev" '500': $ref: '#/components/responses/InternalServerError' @@ -1113,15 +1121,10 @@ components: type: object required: - token - - address properties: token: type: string description: Installation token issued by base for this instance - address: - type: string - description: IP address or host address of the instance reachable by base - Error: type: object properties: diff --git a/python/client/kiota-lock.json b/python/client/kiota-lock.json index 6868800..7c3849d 100644 --- a/python/client/kiota-lock.json +++ b/python/client/kiota-lock.json @@ -1,5 +1,5 @@ { - "descriptionHash": "9588EF3546FC0EC1D93A2353400A9B9104D6670CEE7BD66D1EA5A822C1C5DE99EE2427CF2F975B235AC2CC1EEB721F3C15D6F703074C96226BB487E46F21640B", + "descriptionHash": "D25B8A4F955B5A90B79404C59769A3283BB437108AAF6D8C16FE79F98F7806939614DD4D32CDB13C58545A2B5FFE8501DCF73A37D20AA4F69BF33CA0A8BFAF38", "descriptionLocation": "../../openapi.yaml", "lockFileVersion": "1.0.0", "kiotaVersion": "1.29.0", diff --git a/python/client/models/request_domain_request.py b/python/client/models/request_domain_request.py index 7ca5d3b..4b955b7 100644 --- a/python/client/models/request_domain_request.py +++ b/python/client/models/request_domain_request.py @@ -9,8 +9,6 @@ class RequestDomainRequest(AdditionalDataHolder, Parsable): # Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. additional_data: dict[str, Any] = field(default_factory=dict) - # IP address or host address of the instance reachable by base - address: Optional[str] = None # Installation token issued by base for this instance token: Optional[str] = None @@ -31,7 +29,6 @@ def get_field_deserializers(self,) -> dict[str, Callable[[ParseNode], None]]: Returns: dict[str, Callable[[ParseNode], None]] """ fields: dict[str, Callable[[Any], None]] = { - "address": lambda n : setattr(self, 'address', n.get_str_value()), "token": lambda n : setattr(self, 'token', n.get_str_value()), } return fields @@ -44,7 +41,6 @@ def serialize(self,writer: SerializationWriter) -> None: """ if writer is None: raise TypeError("writer cannot be null.") - writer.write_str_value("address", self.address) writer.write_str_value("token", self.token) writer.write_additional_data_value(self.additional_data) diff --git a/python/client/system/domain/domain_post_response.py b/python/client/system/domain/domain_post_response.py new file mode 100644 index 0000000..5e8969f --- /dev/null +++ b/python/client/system/domain/domain_post_response.py @@ -0,0 +1,47 @@ +from __future__ import annotations +from collections.abc import Callable +from dataclasses import dataclass, field +from kiota_abstractions.serialization import AdditionalDataHolder, Parsable, ParseNode, SerializationWriter +from typing import Any, Optional, TYPE_CHECKING, Union + +@dataclass +class DomainPostResponse(AdditionalDataHolder, Parsable): + # Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additional_data: dict[str, Any] = field(default_factory=dict) + + # The domain property + domain: Optional[str] = None + + @staticmethod + def create_from_discriminator_value(parse_node: ParseNode) -> DomainPostResponse: + """ + Creates a new instance of the appropriate class based on discriminator value + param parse_node: The parse node to use to read the discriminator value and create the object + Returns: DomainPostResponse + """ + if parse_node is None: + raise TypeError("parse_node cannot be null.") + return DomainPostResponse() + + def get_field_deserializers(self,) -> dict[str, Callable[[ParseNode], None]]: + """ + The deserialization information for the current model + Returns: dict[str, Callable[[ParseNode], None]] + """ + fields: dict[str, Callable[[Any], None]] = { + "domain": lambda n : setattr(self, 'domain', n.get_str_value()), + } + return fields + + def serialize(self,writer: SerializationWriter) -> None: + """ + Serializes information the current object + param writer: Serialization writer to use to serialize this model + Returns: None + """ + if writer is None: + raise TypeError("writer cannot be null.") + writer.write_str_value("domain", self.domain) + writer.write_additional_data_value(self.additional_data) + + diff --git a/python/client/system/domain/domain_request_builder.py b/python/client/system/domain/domain_request_builder.py index 54175a2..45a07ed 100644 --- a/python/client/system/domain/domain_request_builder.py +++ b/python/client/system/domain/domain_request_builder.py @@ -16,6 +16,7 @@ if TYPE_CHECKING: from ...models.error import Error from ...models.request_domain_request import RequestDomainRequest + from .domain_post_response import DomainPostResponse class DomainRequestBuilder(BaseRequestBuilder): """ @@ -30,12 +31,12 @@ def __init__(self,request_adapter: RequestAdapter, path_parameters: Union[str, d """ super().__init__(request_adapter, "{+baseurl}/system/domain", path_parameters) - async def post(self,body: RequestDomainRequest, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> Optional[bytes]: + async def post(self,body: RequestDomainRequest, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> Optional[DomainPostResponse]: """ Request and assign a managed domain for this dployr instance from the base control plane.This endpoint is typically called during installation with a token issued by base andthe instance's address. It does **not** require authentication. param body: The request body param request_configuration: Configuration for the request such as headers, query parameters, and middleware options. - Returns: bytes + Returns: Optional[DomainPostResponse] """ if body is None: raise TypeError("body cannot be null.") @@ -49,7 +50,9 @@ async def post(self,body: RequestDomainRequest, request_configuration: Optional[ } if not self.request_adapter: raise Exception("Http core is null") - return await self.request_adapter.send_primitive_async(request_info, "bytes", error_mapping) + from .domain_post_response import DomainPostResponse + + return await self.request_adapter.send_async(request_info, DomainPostResponse, error_mapping) def to_post_request_information(self,body: RequestDomainRequest, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> RequestInformation: """ diff --git a/python/pyproject.toml b/python/pyproject.toml index 509a73a..0462003 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "dployr-sdk" -version = "2.0.0" +version = "2.1.0" description = "Python SDK for dployr" readme = "README.md" requires-python = ">=3.8" diff --git a/python/src/dployr_sdk/__init__.py b/python/src/dployr_sdk/__init__.py index a39aa63..5666917 100644 --- a/python/src/dployr_sdk/__init__.py +++ b/python/src/dployr_sdk/__init__.py @@ -11,5 +11,5 @@ from .client_factory import create_dployr_client, TokenManager -__version__ = "2.0.0" +__version__ = "2.1.0" __all__ = ["create_dployr_client", "TokenManager"] diff --git a/typescript/client/kiota-lock.json b/typescript/client/kiota-lock.json index ad5c927..844ee4e 100644 --- a/typescript/client/kiota-lock.json +++ b/typescript/client/kiota-lock.json @@ -1,5 +1,5 @@ { - "descriptionHash": "9588EF3546FC0EC1D93A2353400A9B9104D6670CEE7BD66D1EA5A822C1C5DE99EE2427CF2F975B235AC2CC1EEB721F3C15D6F703074C96226BB487E46F21640B", + "descriptionHash": "D25B8A4F955B5A90B79404C59769A3283BB437108AAF6D8C16FE79F98F7806939614DD4D32CDB13C58545A2B5FFE8501DCF73A37D20AA4F69BF33CA0A8BFAF38", "descriptionLocation": "../../openapi.yaml", "lockFileVersion": "1.0.0", "kiotaVersion": "1.29.0", diff --git a/typescript/client/models/index.ts b/typescript/client/models/index.ts index bde6b5e..98063c2 100644 --- a/typescript/client/models/index.ts +++ b/typescript/client/models/index.ts @@ -666,7 +666,6 @@ export function deserializeIntoRemoteObj(remoteObj: Partial | undefin // @ts-ignore export function deserializeIntoRequestDomainRequest(requestDomainRequest: Partial | undefined = {}) : Record void> { return { - "address": n => { requestDomainRequest.address = n.getStringValue(); }, "token": n => { requestDomainRequest.token = n.getStringValue(); }, } } @@ -986,10 +985,6 @@ export interface RemoteObj extends AdditionalDataHolder, Parsable { url?: string | null; } export interface RequestDomainRequest extends AdditionalDataHolder, Parsable { - /** - * IP address or host address of the instance reachable by base - */ - address?: string | null; /** * Installation token issued by base for this instance */ @@ -1214,7 +1209,6 @@ export function serializeRemoteObj(writer: SerializationWriter, remoteObj: Parti // @ts-ignore export function serializeRequestDomainRequest(writer: SerializationWriter, requestDomainRequest: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { if (!requestDomainRequest || isSerializingDerivedType) { return; } - writer.writeStringValue("address", requestDomainRequest.address); writer.writeStringValue("token", requestDomainRequest.token); writer.writeAdditionalData(requestDomainRequest.additionalData); } diff --git a/typescript/client/system/domain/index.ts b/typescript/client/system/domain/index.ts index d618cc9..ed7cd23 100644 --- a/typescript/client/system/domain/index.ts +++ b/typescript/client/system/domain/index.ts @@ -4,8 +4,34 @@ // @ts-ignore import { createErrorEscapedFromDiscriminatorValue, serializeRequestDomainRequest, type ErrorEscaped, type RequestDomainRequest } from '../../models/index.js'; // @ts-ignore -import { type BaseRequestBuilder, type Parsable, type ParsableFactory, type RequestConfiguration, type RequestInformation, type RequestsMetadata } from '@microsoft/kiota-abstractions'; +import { type AdditionalDataHolder, type BaseRequestBuilder, type Parsable, type ParsableFactory, type ParseNode, type RequestConfiguration, type RequestInformation, type RequestsMetadata, type SerializationWriter } from '@microsoft/kiota-abstractions'; +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {DomainPostResponse} + */ +// @ts-ignore +export function createDomainPostResponseFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoDomainPostResponse; +} +/** + * The deserialization information for the current model + * @param DomainPostResponse The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoDomainPostResponse(domainPostResponse: Partial | undefined = {}) : Record void> { + return { + "domain": n => { domainPostResponse.domain = n.getStringValue(); }, + } +} +export interface DomainPostResponse extends AdditionalDataHolder, Parsable { + /** + * The domain property + */ + domain?: string | null; +} /** * Builds and executes requests for operations under /system/domain */ @@ -14,10 +40,10 @@ export interface DomainRequestBuilder extends BaseRequestBuilder} + * @returns {Promise} * @throws {ErrorEscaped} error when the service returns a 500 status code */ - post(body: RequestDomainRequest, requestConfiguration?: RequestConfiguration | undefined) : Promise; + post(body: RequestDomainRequest, requestConfiguration?: RequestConfiguration | undefined) : Promise; /** * Request and assign a managed domain for this dployr instance from the base control plane.This endpoint is typically called during installation with a token issued by base andthe instance's address. It does **not** require authentication. * @param body The request body @@ -26,6 +52,18 @@ export interface DomainRequestBuilder extends BaseRequestBuilder | undefined) : RequestInformation; } +/** + * Serializes information the current object + * @param DomainPostResponse The instance to serialize from. + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeDomainPostResponse(writer: SerializationWriter, domainPostResponse: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!domainPostResponse || isSerializingDerivedType) { return; } + writer.writeStringValue("domain", domainPostResponse.domain); + writer.writeAdditionalData(domainPostResponse.additionalData); +} /** * Uri template for the request builder. */ @@ -40,8 +78,8 @@ export const DomainRequestBuilderRequestsMetadata: RequestsMetadata = { errorMappings: { 500: createErrorEscapedFromDiscriminatorValue as ParsableFactory, }, - adapterMethodName: "sendPrimitive", - responseBodyFactory: "ArrayBuffer", + adapterMethodName: "send", + responseBodyFactory: createDomainPostResponseFromDiscriminatorValue, requestBodyContentType: "application/json", requestBodySerializer: serializeRequestDomainRequest, requestInformationContentSetMethod: "setContentFromParsable", diff --git a/typescript/package-lock.json b/typescript/package-lock.json index 94d1d88..3171b28 100644 --- a/typescript/package-lock.json +++ b/typescript/package-lock.json @@ -1,12 +1,12 @@ { "name": "@dployr-io/dployr-sdk", - "version": "2.0.0", + "version": "2.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@dployr-io/dployr-sdk", - "version": "2.0.0", + "version": "2.1.0", "dependencies": { "@microsoft/kiota-bundle": "^1.0.0-preview.99" }, diff --git a/typescript/package.json b/typescript/package.json index 6a92e6c..68b8fa4 100644 --- a/typescript/package.json +++ b/typescript/package.json @@ -1,6 +1,6 @@ { "name": "@dployr-io/dployr-sdk", - "version": "2.0.0", + "version": "2.1.0", "type": "module", "description": "TypeScript SDK for dployr", "repository": {