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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sdk/neonpostgres/azure-mgmt-neonpostgres/_meta.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"commit": "4e3820497caa29ed0efada28a38cb4292cea9d55",
"commit": "d64f15c8860ba9000a923e27ce6da78ed3098bda",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"typespec_src": "specification/liftrneon/Neon.Postgres.Management",
"@azure-tools/typespec-python": "0.36.1"
"@azure-tools/typespec-python": "0.39.1"
}
85 changes: 85 additions & 0 deletions sdk/neonpostgres/azure-mgmt-neonpostgres/apiview-properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"CrossLanguagePackageId": "Neon.Postgres",
"CrossLanguageDefinitionId": {
"azure.mgmt.neonpostgres.models.Attributes": "Neon.Postgres.Models.Attributes",
"azure.mgmt.neonpostgres.models.Resource": "Azure.ResourceManager.CommonTypes.Resource",
"azure.mgmt.neonpostgres.models.ProxyResource": "Azure.ResourceManager.CommonTypes.ProxyResource",
"azure.mgmt.neonpostgres.models.Branch": "Neon.Postgres.Branch",
"azure.mgmt.neonpostgres.models.BranchProperties": "Neon.Postgres.Models.BranchProperties",
"azure.mgmt.neonpostgres.models.CompanyDetails": "LiftrBase.CompanyDetails",
"azure.mgmt.neonpostgres.models.Compute": "Neon.Postgres.Compute",
"azure.mgmt.neonpostgres.models.ComputeProperties": "Neon.Postgres.Models.ComputeProperties",
"azure.mgmt.neonpostgres.models.ConnectionUriProperties": "Neon.Postgres.Models.ConnectionUriProperties",
"azure.mgmt.neonpostgres.models.DefaultEndpointSettings": "Neon.Postgres.Models.DefaultEndpointSettings",
"azure.mgmt.neonpostgres.models.Endpoint": "Neon.Postgres.Endpoint",
"azure.mgmt.neonpostgres.models.EndpointProperties": "Neon.Postgres.Models.EndpointProperties",
"azure.mgmt.neonpostgres.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo",
"azure.mgmt.neonpostgres.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail",
"azure.mgmt.neonpostgres.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse",
"azure.mgmt.neonpostgres.models.MarketplaceDetails": "LiftrBase.MarketplaceDetails",
"azure.mgmt.neonpostgres.models.NeonDatabase": "Neon.Postgres.NeonDatabase",
"azure.mgmt.neonpostgres.models.NeonDatabaseProperties": "Neon.Postgres.Models.NeonDatabaseProperties",
"azure.mgmt.neonpostgres.models.NeonRole": "Neon.Postgres.NeonRole",
"azure.mgmt.neonpostgres.models.NeonRoleProperties": "Neon.Postgres.Models.NeonRoleProperties",
"azure.mgmt.neonpostgres.models.OfferDetails": "LiftrBase.OfferDetails",
"azure.mgmt.neonpostgres.models.Operation": "Azure.ResourceManager.CommonTypes.Operation",
"azure.mgmt.neonpostgres.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay",
"azure.mgmt.neonpostgres.models.OrganizationProperties": "LiftrBase.Data.OrganizationProperties",
"azure.mgmt.neonpostgres.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource",
"azure.mgmt.neonpostgres.models.OrganizationResource": "Neon.Postgres.OrganizationResource",
"azure.mgmt.neonpostgres.models.PartnerOrganizationProperties": "LiftrBase.Data.PartnerOrganizationProperties",
"azure.mgmt.neonpostgres.models.PgVersion": "Neon.Postgres.Models.PgVersion",
"azure.mgmt.neonpostgres.models.PgVersionsResult": "Neon.Postgres.Models.PgVersionsResult",
"azure.mgmt.neonpostgres.models.Project": "Neon.Postgres.Project",
"azure.mgmt.neonpostgres.models.ProjectProperties": "Neon.Postgres.Models.ProjectProperties",
"azure.mgmt.neonpostgres.models.SingleSignOnProperties": "LiftrBase.SingleSignOnProperties",
"azure.mgmt.neonpostgres.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData",
"azure.mgmt.neonpostgres.models.UserDetails": "LiftrBase.UserDetails",
"azure.mgmt.neonpostgres.models.Origin": "Azure.ResourceManager.CommonTypes.Origin",
"azure.mgmt.neonpostgres.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType",
"azure.mgmt.neonpostgres.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType",
"azure.mgmt.neonpostgres.models.MarketplaceSubscriptionStatus": "LiftrBase.MarketplaceSubscriptionStatus",
"azure.mgmt.neonpostgres.models.ResourceProvisioningState": "Azure.ResourceManager.ResourceProvisioningState",
"azure.mgmt.neonpostgres.models.SingleSignOnStates": "LiftrBase.SingleSignOnStates",
"azure.mgmt.neonpostgres.models.EndpointType": "Neon.Postgres.Models.EndpointType",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.operations.list": "Azure.ResourceManager.Operations.list",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.organizations.get": "Neon.Postgres.Organizations.get",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.organizations.begin_create_or_update": "Neon.Postgres.Organizations.createOrUpdate",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.organizations.begin_update": "Neon.Postgres.Organizations.update",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.organizations.begin_delete": "Neon.Postgres.Organizations.delete",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.organizations.list_by_resource_group": "Neon.Postgres.Organizations.listByResourceGroup",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.organizations.list_by_subscription": "Neon.Postgres.Organizations.listBySubscription",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.organizations.get_postgres_versions": "Neon.Postgres.Organizations.getPostgresVersions",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.projects.get": "Neon.Postgres.Projects.get",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.projects.begin_create_or_update": "Neon.Postgres.Projects.createOrUpdate",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.projects.begin_update": "Neon.Postgres.Projects.update",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.projects.delete": "Neon.Postgres.Projects.delete",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.projects.list": "Neon.Postgres.Projects.list",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.projects.get_connection_uri": "Neon.Postgres.Projects.getConnectionUri",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.branches.get": "Neon.Postgres.Branches.get",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.branches.begin_create_or_update": "Neon.Postgres.Branches.createOrUpdate",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.branches.begin_update": "Neon.Postgres.Branches.update",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.branches.delete": "Neon.Postgres.Branches.delete",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.branches.list": "Neon.Postgres.Branches.list",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.computes.get": "Neon.Postgres.Computes.get",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.computes.begin_create_or_update": "Neon.Postgres.Computes.createOrUpdate",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.computes.begin_update": "Neon.Postgres.Computes.update",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.computes.delete": "Neon.Postgres.Computes.delete",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.computes.list": "Neon.Postgres.Computes.list",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.neon_databases.get": "Neon.Postgres.NeonDatabases.get",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.neon_databases.begin_create_or_update": "Neon.Postgres.NeonDatabases.createOrUpdate",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.neon_databases.begin_update": "Neon.Postgres.NeonDatabases.update",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.neon_databases.delete": "Neon.Postgres.NeonDatabases.delete",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.neon_databases.list": "Neon.Postgres.NeonDatabases.list",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.neon_roles.get": "Neon.Postgres.NeonRoles.get",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.neon_roles.begin_create_or_update": "Neon.Postgres.NeonRoles.createOrUpdate",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.neon_roles.begin_update": "Neon.Postgres.NeonRoles.update",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.neon_roles.delete": "Neon.Postgres.NeonRoles.delete",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.neon_roles.list": "Neon.Postgres.NeonRoles.list",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.endpoints.get": "Neon.Postgres.Endpoints.get",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.endpoints.begin_create_or_update": "Neon.Postgres.Endpoints.createOrUpdate",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.endpoints.begin_update": "Neon.Postgres.Endpoints.update",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.endpoints.delete": "Neon.Postgres.Endpoints.delete",
"azure.mgmt.neonpostgres.NeonPostgresMgmtClient.endpoints.list": "Neon.Postgres.Endpoints.list"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,51 @@

from ._configuration import NeonPostgresMgmtClientConfiguration
from ._serialization import Deserializer, Serializer
from .operations import Operations, OrganizationsOperations
from .operations import (
BranchesOperations,
ComputesOperations,
EndpointsOperations,
ModelsOperations,
NeonDatabasesOperations,
NeonRolesOperations,
Operations,
OrganizationsOperations,
ProjectsOperations,
)

if TYPE_CHECKING:
from azure.core.credentials import TokenCredential


class NeonPostgresMgmtClient:
class NeonPostgresMgmtClient: # pylint: disable=too-many-instance-attributes
"""NeonPostgresMgmtClient.

:ivar models: ModelsOperations operations
:vartype models: azure.mgmt.neonpostgres.operations.ModelsOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.neonpostgres.operations.Operations
:ivar organizations: OrganizationsOperations operations
:vartype organizations: azure.mgmt.neonpostgres.operations.OrganizationsOperations
:ivar projects: ProjectsOperations operations
:vartype projects: azure.mgmt.neonpostgres.operations.ProjectsOperations
:ivar branches: BranchesOperations operations
:vartype branches: azure.mgmt.neonpostgres.operations.BranchesOperations
:ivar computes: ComputesOperations operations
:vartype computes: azure.mgmt.neonpostgres.operations.ComputesOperations
:ivar neon_databases: NeonDatabasesOperations operations
:vartype neon_databases: azure.mgmt.neonpostgres.operations.NeonDatabasesOperations
:ivar neon_roles: NeonRolesOperations operations
:vartype neon_roles: azure.mgmt.neonpostgres.operations.NeonRolesOperations
:ivar endpoints: EndpointsOperations operations
:vartype endpoints: azure.mgmt.neonpostgres.operations.EndpointsOperations
:param credential: Credential used to authenticate requests to the service. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:param base_url: Service host. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: The API version to use for this operation. Default value is
"2024-08-01-preview". Note that overriding this default value may result in unsupported
"2025-03-01-preview". Note that overriding this default value may result in unsupported
behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Expand Down Expand Up @@ -78,8 +102,15 @@ def __init__(
self._serialize = Serializer()
self._deserialize = Deserializer()
self._serialize.client_side_validation = False
self.models = ModelsOperations(self._client, self._config, self._serialize, self._deserialize)
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
self.organizations = OrganizationsOperations(self._client, self._config, self._serialize, self._deserialize)
self.projects = ProjectsOperations(self._client, self._config, self._serialize, self._deserialize)
self.branches = BranchesOperations(self._client, self._config, self._serialize, self._deserialize)
self.computes = ComputesOperations(self._client, self._config, self._serialize, self._deserialize)
self.neon_databases = NeonDatabasesOperations(self._client, self._config, self._serialize, self._deserialize)
self.neon_roles = NeonRolesOperations(self._client, self._config, self._serialize, self._deserialize)
self.endpoints = EndpointsOperations(self._client, self._config, self._serialize, self._deserialize)

def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
"""Runs the network request through the client's chained policies.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class NeonPostgresMgmtClientConfiguration: # pylint: disable=too-many-instance-
:param base_url: Service host. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: The API version to use for this operation. Default value is
"2024-08-01-preview". Note that overriding this default value may result in unsupported
"2025-03-01-preview". Note that overriding this default value may result in unsupported
behavior.
:paramtype api_version: str
"""
Expand All @@ -42,7 +42,7 @@ def __init__(
base_url: str = "https://management.azure.com",
**kwargs: Any
) -> None:
api_version: str = kwargs.pop("api_version", "2024-08-01-preview")
api_version: str = kwargs.pop("api_version", "2025-03-01-preview")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,15 +373,34 @@ def __ne__(self, other: typing.Any) -> bool:
return not self.__eq__(other)

def keys(self) -> typing.KeysView[str]:
"""
:returns: a set-like object providing a view on D's keys
:rtype: ~typing.KeysView
"""
return self._data.keys()

def values(self) -> typing.ValuesView[typing.Any]:
"""
:returns: an object providing a view on D's values
:rtype: ~typing.ValuesView
"""
return self._data.values()

def items(self) -> typing.ItemsView[str, typing.Any]:
"""
:returns: set-like object providing a view on D's items
:rtype: ~typing.ItemsView
"""
return self._data.items()

def get(self, key: str, default: typing.Any = None) -> typing.Any:
"""
Get the value for key if key is in the dictionary, else default.
:param str key: The key to look up.
:param any default: The value to return if key is not in the dictionary. Defaults to None
:returns: D[k] if k in D, else d.
:rtype: any
"""
try:
return self[key]
except KeyError:
Expand All @@ -397,17 +416,38 @@ def pop(self, key: str, default: _T) -> _T: ...
def pop(self, key: str, default: typing.Any) -> typing.Any: ...

def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any:
"""
Removes specified key and return the corresponding value.
:param str key: The key to pop.
:param any default: The value to return if key is not in the dictionary
:returns: The value corresponding to the key.
:rtype: any
:raises KeyError: If key is not found and default is not given.
"""
if default is _UNSET:
return self._data.pop(key)
return self._data.pop(key, default)

def popitem(self) -> typing.Tuple[str, typing.Any]:
"""
Removes and returns some (key, value) pair
:returns: The (key, value) pair.
:rtype: tuple
:raises KeyError: if D is empty.
"""
return self._data.popitem()

def clear(self) -> None:
"""
Remove all items from D.
"""
self._data.clear()

def update(self, *args: typing.Any, **kwargs: typing.Any) -> None:
"""
Updates D from mapping/iterable E and F.
:param any args: Either a mapping object or an iterable of key-value pairs.
"""
self._data.update(*args, **kwargs)

@typing.overload
Expand All @@ -417,6 +457,13 @@ def setdefault(self, key: str, default: None = None) -> None: ...
def setdefault(self, key: str, default: typing.Any) -> typing.Any: ...

def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any:
"""
Same as calling D.get(k, d), and setting D[k]=d if k not found
:param str key: The key to look up.
:param any default: The value to set if key is not in the dictionary
:returns: D[k] if k in D, else d.
:rtype: any
"""
if default is _UNSET:
return self._data.setdefault(key)
return self._data.setdefault(key, default)
Expand Down Expand Up @@ -754,7 +801,7 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-retur
except AttributeError:
model_name = annotation
if module is not None:
annotation = _get_model(module, model_name)
annotation = _get_model(module, model_name) # type: ignore

try:
if module and _is_model(annotation):
Expand Down Expand Up @@ -894,6 +941,35 @@ def _deserialize(
return _deserialize_with_callable(deserializer, value)


def _failsafe_deserialize(
deserializer: typing.Any,
value: typing.Any,
module: typing.Optional[str] = None,
rf: typing.Optional["_RestField"] = None,
format: typing.Optional[str] = None,
) -> typing.Any:
try:
return _deserialize(deserializer, value, module, rf, format)
except DeserializationError:
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
return None


def _failsafe_deserialize_xml(
deserializer: typing.Any,
value: typing.Any,
) -> typing.Any:
try:
return _deserialize_xml(deserializer, value)
except DeserializationError:
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
return None


class _RestField:
def __init__(
self,
Expand Down
Loading