Skip to content
Merged
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
1 change: 1 addition & 0 deletions src/cloud_discovery/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ Class | Method | HTTP request | Description
- [SubAccountListResponseV2](cloud_discovery/docs/SubAccountListResponseV2.md)
- [SubAccountProvCredConfig](cloud_discovery/docs/SubAccountProvCredConfig.md)
- [SubAccountV2](cloud_discovery/docs/SubAccountV2.md)
- [ZoneFilter](cloud_discovery/docs/ZoneFilter.md)


<a id="documentation-for-authorization"></a>
Expand Down
1 change: 1 addition & 0 deletions src/cloud_discovery/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@
from cloud_discovery.models.sub_account_list_response_v2 import SubAccountListResponseV2
from cloud_discovery.models.sub_account_prov_cred_config import SubAccountProvCredConfig
from cloud_discovery.models.sub_account_v2 import SubAccountV2
from cloud_discovery.models.zone_filter import ZoneFilter
2 changes: 2 additions & 0 deletions src/cloud_discovery/docs/DNSConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**consolidated_zone_data_enabled** | **bool** | | [optional]
**resolver_endpoints_sync_enabled** | **bool** | resolver_endpoints_sync_enabled enables discovery of inbound and outbound endpoints from third party providers. | [optional]
**split_view_enabled** | **bool** | split_view_enabled consolidates private zones into a single view, which is separate from the public zone view. | [optional]
**sync_type** | **str** | | [optional]
**view_id** | **str** | | [optional]
**view_name** | **str** | | [optional]
**zone_filters** | [**List[ZoneFilter]**](ZoneFilter.md) | | [optional]

## Example

Expand Down
2 changes: 2 additions & 0 deletions src/cloud_discovery/docs/DiscoveryConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Name | Type | Description | Notes
**destination_types_enabled** | **List[str]** | Destinations types enabled: Ex.: DNS, IPAM and ACCOUNT. | [optional]
**destinations** | [**List[Destination]**](Destination.md) | Destinations. | [optional]
**id** | **str** | Auto-generated unique discovery config ID. Format BloxID. | [optional] [readonly]
**is_disabled** | **bool** | is_disabled. Enables/Disables provider. Newer version of desired_state. | [optional]
**labs_provider** | **bool** | labs_provider. Indicates if a provider is enabled through Infoblox Labs. | [optional]
**last_sync** | **datetime** | Last sync timestamp. | [optional] [readonly]
**name** | **str** | Name of the discovery config. |
**provider_type** | **str** | Provider type. Ex.: Amazon Web Services, Google Cloud Platform, Microsoft Azure. |
Expand Down
2 changes: 1 addition & 1 deletion src/cloud_discovery/docs/SourceConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Name | Type | Description | Notes
**created_at** | **datetime** | Timestamp when the object has been created. | [optional] [readonly]
**credential_config** | [**CredentialConfig**](CredentialConfig.md) | Credential configuration. Ex.: &#39;{ \&quot;access_identifier\&quot;: \&quot;arn:aws:iam::1234:role/access_for_discovery\&quot;, \&quot;region\&quot;: \&quot;us-east-1\&quot;, \&quot;enclave\&quot;: \&quot;commercial/gov\&quot; }&#39;. | [optional]
**deleted_at** | **datetime** | Timestamp when the object has been deleted. | [optional] [readonly]
**id** | **str** | Auto-generated unique source config ID. Format BloxID. | [optional]
**id** | **str** | Auto-generated unique source config ID. Format BloxID. | [optional] [readonly]
**restricted_to_accounts** | **List[str]** | Provider account IDs such as accountID/ SubscriptionID to be restricted for a given source_config. | [optional]
**updated_at** | **datetime** | Timestamp when the object has been updated. | [optional] [readonly]

Expand Down
30 changes: 30 additions & 0 deletions src/cloud_discovery/docs/ZoneFilter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# ZoneFilter


## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**action** | **str** | | [optional]
**wildcards** | **List[str]** | | [optional]

## Example

```python
from cloud_discovery.models.zone_filter import ZoneFilter

# TODO update the JSON string below
json = "{}"
# create an instance of ZoneFilter from a JSON string
zone_filter_instance = ZoneFilter.from_json(json)
# print the JSON string representation of the object
print(ZoneFilter.to_json())
Comment thread
unasra marked this conversation as resolved.

# convert the object into a dict
zone_filter_dict = zone_filter_instance.to_dict()
# create an instance of ZoneFilter from a dict
zone_filter_from_dict = ZoneFilter.from_dict(zone_filter_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


1 change: 1 addition & 0 deletions src/cloud_discovery/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@
from cloud_discovery.models.sub_account_list_response_v2 import SubAccountListResponseV2
from cloud_discovery.models.sub_account_prov_cred_config import SubAccountProvCredConfig
from cloud_discovery.models.sub_account_v2 import SubAccountV2
from cloud_discovery.models.zone_filter import ZoneFilter
23 changes: 19 additions & 4 deletions src/cloud_discovery/models/discovery_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import json

from datetime import datetime
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from cloud_discovery.models.additional_config import AdditionalConfig
from cloud_discovery.models.credential_preference import CredentialPreference
Expand Down Expand Up @@ -67,6 +67,16 @@ class DiscoveryConfig(BaseModel):
default=None,
description="Auto-generated unique discovery config ID. Format BloxID."
)
is_disabled: Optional[StrictBool] = Field(
default=None,
description=
"is_disabled. Enables/Disables provider. Newer version of desired_state."
)
labs_provider: Optional[StrictBool] = Field(
default=None,
description=
"labs_provider. Indicates if a provider is enabled through Infoblox Labs."
)
last_sync: Optional[datetime] = Field(default=None,
description="Last sync timestamp.")
name: StrictStr = Field(description="Name of the discovery config.")
Expand Down Expand Up @@ -94,9 +104,10 @@ class DiscoveryConfig(BaseModel):
__properties: ClassVar[List[str]] = [
"account_preference", "additional_config", "created_at",
"credential_preference", "deleted_at", "description", "desired_state",
"destination_types_enabled", "destinations", "id", "last_sync", "name",
"provider_type", "source_configs", "status", "status_message",
"sync_interval", "tags", "updated_at"
"destination_types_enabled", "destinations", "id", "is_disabled",
"labs_provider", "last_sync", "name", "provider_type",
"source_configs", "status", "status_message", "sync_interval", "tags",
"updated_at"
]

model_config = ConfigDict(
Expand Down Expand Up @@ -215,6 +226,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if obj.get("destinations") is not None else None,
"id":
obj.get("id"),
"is_disabled":
obj.get("is_disabled"),
"labs_provider":
obj.get("labs_provider"),
"last_sync":
obj.get("last_sync"),
"name":
Expand Down
26 changes: 23 additions & 3 deletions src/cloud_discovery/models/dns_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from cloud_discovery.models.zone_filter import ZoneFilter
from typing import Optional, Set
from typing_extensions import Self

Expand All @@ -29,6 +30,11 @@ class DNSConfig(BaseModel):

# noqa: E501
consolidated_zone_data_enabled: Optional[StrictBool] = None
resolver_endpoints_sync_enabled: Optional[StrictBool] = Field(
default=None,
description=
"resolver_endpoints_sync_enabled enables discovery of inbound and outbound endpoints from third party providers."
)
split_view_enabled: Optional[StrictBool] = Field(
default=None,
description=
Expand All @@ -37,10 +43,12 @@ class DNSConfig(BaseModel):
sync_type: Optional[StrictStr] = None
view_id: Optional[StrictStr] = None
view_name: Optional[StrictStr] = None
zone_filters: Optional[List[ZoneFilter]] = None
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = [
"consolidated_zone_data_enabled", "split_view_enabled", "sync_type",
"view_id", "view_name"
"consolidated_zone_data_enabled", "resolver_endpoints_sync_enabled",
"split_view_enabled", "sync_type", "view_id", "view_name",
"zone_filters"
]

model_config = ConfigDict(
Expand Down Expand Up @@ -83,6 +91,13 @@ def to_dict(self) -> Dict[str, Any]:
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in zone_filters (list)
_items = []
if self.zone_filters:
for _item in self.zone_filters:
if _item:
_items.append(_item.to_dict())
_dict['zone_filters'] = _items
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
Expand All @@ -102,14 +117,19 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
_obj = cls.model_validate({
"consolidated_zone_data_enabled":
obj.get("consolidated_zone_data_enabled"),
"resolver_endpoints_sync_enabled":
obj.get("resolver_endpoints_sync_enabled"),
"split_view_enabled":
obj.get("split_view_enabled"),
"sync_type":
obj.get("sync_type"),
"view_id":
obj.get("view_id"),
"view_name":
obj.get("view_name")
obj.get("view_name"),
"zone_filters":
[ZoneFilter.from_dict(_item) for _item in obj["zone_filters"]]
if obj.get("zone_filters") is not None else None
})
# store additional fields in additional_properties
for _key in obj.keys():
Expand Down
2 changes: 2 additions & 0 deletions src/cloud_discovery/models/source_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,14 @@ def to_dict(self) -> Dict[str, Any]:
* OpenAPI `readOnly` fields are excluded.
* OpenAPI `readOnly` fields are excluded.
* OpenAPI `readOnly` fields are excluded.
* OpenAPI `readOnly` fields are excluded.
* Fields in `self.additional_properties` are added to the output dict.
"""
excluded_fields: Set[str] = set([
"account_schedule_id",
"created_at",
"deleted_at",
"id",
"updated_at",
"additional_properties",
])
Expand Down
101 changes: 101 additions & 0 deletions src/cloud_discovery/models/zone_filter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# coding: utf-8

"""
Discovery Configuration API V2

The Discovery configuration service is a Universal DDI Service that provides configuration for accessing and syncing the Cloud assets Base Paths: 1. provider: **/api/cloud_discovery/v2/**

The version of the OpenAPI document: v2
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
""" # noqa: E501

from __future__ import annotations
import pprint
import re # noqa: F401
import json

from pydantic import BaseModel, ConfigDict, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
Comment thread
unasra marked this conversation as resolved.
from typing_extensions import Self


class ZoneFilter(BaseModel):
"""
ZoneFilter
"""

# noqa: E501
action: Optional[StrictStr] = None
wildcards: Optional[List[StrictStr]] = None
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["action", "wildcards"]

model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)

def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))

def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())

@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of ZoneFilter from a JSON string"""
return cls.from_dict(json.loads(json_str))

def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:

* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
excluded_fields: Set[str] = set([
"additional_properties",
])

_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
_dict[_key] = _value

return _dict

@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of ZoneFilter from a dict"""
if obj is None:
return None

if not isinstance(obj, dict):
return cls.model_validate(obj)

_obj = cls.model_validate({
"action": obj.get("action"),
"wildcards": obj.get("wildcards")
})
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)

return _obj
Loading