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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion python/client/kiota-lock.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"descriptionHash": "9588EF3546FC0EC1D93A2353400A9B9104D6670CEE7BD66D1EA5A822C1C5DE99EE2427CF2F975B235AC2CC1EEB721F3C15D6F703074C96226BB487E46F21640B",
"descriptionHash": "D25B8A4F955B5A90B79404C59769A3283BB437108AAF6D8C16FE79F98F7806939614DD4D32CDB13C58545A2B5FFE8501DCF73A37D20AA4F69BF33CA0A8BFAF38",
"descriptionLocation": "../../openapi.yaml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.29.0",
Expand Down
4 changes: 0 additions & 4 deletions python/client/models/request_domain_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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)

Expand Down
47 changes: 47 additions & 0 deletions python/client/system/domain/domain_post_response.py
Original file line number Diff line number Diff line change
@@ -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)


9 changes: 6 additions & 3 deletions python/client/system/domain/domain_request_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand All @@ -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.")
Expand All @@ -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:
"""
Expand Down
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion python/src/dployr_sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
2 changes: 1 addition & 1 deletion typescript/client/kiota-lock.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"descriptionHash": "9588EF3546FC0EC1D93A2353400A9B9104D6670CEE7BD66D1EA5A822C1C5DE99EE2427CF2F975B235AC2CC1EEB721F3C15D6F703074C96226BB487E46F21640B",
"descriptionHash": "D25B8A4F955B5A90B79404C59769A3283BB437108AAF6D8C16FE79F98F7806939614DD4D32CDB13C58545A2B5FFE8501DCF73A37D20AA4F69BF33CA0A8BFAF38",
"descriptionLocation": "../../openapi.yaml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.29.0",
Expand Down
6 changes: 0 additions & 6 deletions typescript/client/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,6 @@ export function deserializeIntoRemoteObj(remoteObj: Partial<RemoteObj> | undefin
// @ts-ignore
export function deserializeIntoRequestDomainRequest(requestDomainRequest: Partial<RequestDomainRequest> | undefined = {}) : Record<string, (node: ParseNode) => void> {
return {
"address": n => { requestDomainRequest.address = n.getStringValue(); },
"token": n => { requestDomainRequest.token = n.getStringValue(); },
}
}
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -1214,7 +1209,6 @@ export function serializeRemoteObj(writer: SerializationWriter, remoteObj: Parti
// @ts-ignore
export function serializeRequestDomainRequest(writer: SerializationWriter, requestDomainRequest: Partial<RequestDomainRequest> | undefined | null = {}, isSerializingDerivedType: boolean = false) : void {
if (!requestDomainRequest || isSerializingDerivedType) { return; }
writer.writeStringValue("address", requestDomainRequest.address);
writer.writeStringValue("token", requestDomainRequest.token);
writer.writeAdditionalData(requestDomainRequest.additionalData);
}
Expand Down
48 changes: 43 additions & 5 deletions typescript/client/system/domain/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, (node: ParseNode) => void>) {
return deserializeIntoDomainPostResponse;
}
/**
* The deserialization information for the current model
* @param DomainPostResponse The instance to deserialize into.
* @returns {Record<string, (node: ParseNode) => void>}
*/
// @ts-ignore
export function deserializeIntoDomainPostResponse(domainPostResponse: Partial<DomainPostResponse> | undefined = {}) : Record<string, (node: ParseNode) => 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
*/
Expand All @@ -14,10 +40,10 @@ export interface DomainRequestBuilder extends BaseRequestBuilder<DomainRequestBu
* 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 requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @returns {Promise<ArrayBuffer>}
* @returns {Promise<DomainPostResponse>}
* @throws {ErrorEscaped} error when the service returns a 500 status code
*/
post(body: RequestDomainRequest, requestConfiguration?: RequestConfiguration<object> | undefined) : Promise<ArrayBuffer | undefined>;
post(body: RequestDomainRequest, requestConfiguration?: RequestConfiguration<object> | undefined) : Promise<DomainPostResponse | undefined>;
/**
* 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
Expand All @@ -26,6 +52,18 @@ export interface DomainRequestBuilder extends BaseRequestBuilder<DomainRequestBu
*/
toPostRequestInformation(body: RequestDomainRequest, requestConfiguration?: RequestConfiguration<object> | 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<DomainPostResponse> | 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.
*/
Expand All @@ -40,8 +78,8 @@ export const DomainRequestBuilderRequestsMetadata: RequestsMetadata = {
errorMappings: {
500: createErrorEscapedFromDiscriminatorValue as ParsableFactory<Parsable>,
},
adapterMethodName: "sendPrimitive",
responseBodyFactory: "ArrayBuffer",
adapterMethodName: "send",
responseBodyFactory: createDomainPostResponseFromDiscriminatorValue,
requestBodyContentType: "application/json",
requestBodySerializer: serializeRequestDomainRequest,
requestInformationContentSetMethod: "setContentFromParsable",
Expand Down
4 changes: 2 additions & 2 deletions typescript/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion typescript/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down