re-uploading work
This commit is contained in:
567
tests/generated_client/models/__init__.py
Normal file
567
tests/generated_client/models/__init__.py
Normal file
@@ -0,0 +1,567 @@
|
||||
""" Contains all the data models used in inputs/outputs """
|
||||
|
||||
from .action_response import ActionResponse
|
||||
from .action_response_out_schema_type_0 import ActionResponseOutSchemaType0
|
||||
from .action_response_param_schema_type_0 import ActionResponseParamSchemaType0
|
||||
from .action_summary import ActionSummary
|
||||
from .api_response_action_response import ApiResponseActionResponse
|
||||
from .api_response_action_response_data import ApiResponseActionResponseData
|
||||
from .api_response_action_response_data_out_schema_type_0 import ApiResponseActionResponseDataOutSchemaType0
|
||||
from .api_response_action_response_data_param_schema_type_0 import ApiResponseActionResponseDataParamSchemaType0
|
||||
from .api_response_current_user_response import ApiResponseCurrentUserResponse
|
||||
from .api_response_current_user_response_data import ApiResponseCurrentUserResponseData
|
||||
from .api_response_enforcement_response import ApiResponseEnforcementResponse
|
||||
from .api_response_enforcement_response_data import ApiResponseEnforcementResponseData
|
||||
from .api_response_enforcement_response_data_conditions import ApiResponseEnforcementResponseDataConditions
|
||||
from .api_response_enforcement_response_data_config_type_0 import ApiResponseEnforcementResponseDataConfigType0
|
||||
from .api_response_enforcement_response_data_payload import ApiResponseEnforcementResponseDataPayload
|
||||
from .api_response_event_response import ApiResponseEventResponse
|
||||
from .api_response_event_response_data import ApiResponseEventResponseData
|
||||
from .api_response_event_response_data_config_type_0 import ApiResponseEventResponseDataConfigType0
|
||||
from .api_response_event_response_data_payload import ApiResponseEventResponseDataPayload
|
||||
from .api_response_execution_response import ApiResponseExecutionResponse
|
||||
from .api_response_execution_response_data import ApiResponseExecutionResponseData
|
||||
from .api_response_execution_response_data_config import ApiResponseExecutionResponseDataConfig
|
||||
from .api_response_execution_response_data_result import ApiResponseExecutionResponseDataResult
|
||||
from .api_response_inquiry_response import ApiResponseInquiryResponse
|
||||
from .api_response_inquiry_response_data import ApiResponseInquiryResponseData
|
||||
from .api_response_inquiry_response_data_response_schema_type_0 import ApiResponseInquiryResponseDataResponseSchemaType0
|
||||
from .api_response_inquiry_response_data_response_type_0 import ApiResponseInquiryResponseDataResponseType0
|
||||
from .api_response_key_response import ApiResponseKeyResponse
|
||||
from .api_response_key_response_data import ApiResponseKeyResponseData
|
||||
from .api_response_pack_install_response import ApiResponsePackInstallResponse
|
||||
from .api_response_pack_install_response_data import ApiResponsePackInstallResponseData
|
||||
from .api_response_pack_response import ApiResponsePackResponse
|
||||
from .api_response_pack_response_data import ApiResponsePackResponseData
|
||||
from .api_response_pack_response_data_conf_schema import ApiResponsePackResponseDataConfSchema
|
||||
from .api_response_pack_response_data_config import ApiResponsePackResponseDataConfig
|
||||
from .api_response_pack_response_data_meta import ApiResponsePackResponseDataMeta
|
||||
from .api_response_queue_stats_response import ApiResponseQueueStatsResponse
|
||||
from .api_response_queue_stats_response_data import ApiResponseQueueStatsResponseData
|
||||
from .api_response_rule_response import ApiResponseRuleResponse
|
||||
from .api_response_rule_response_data import ApiResponseRuleResponseData
|
||||
from .api_response_rule_response_data_action_params import ApiResponseRuleResponseDataActionParams
|
||||
from .api_response_rule_response_data_conditions import ApiResponseRuleResponseDataConditions
|
||||
from .api_response_rule_response_data_trigger_params import ApiResponseRuleResponseDataTriggerParams
|
||||
from .api_response_sensor_response import ApiResponseSensorResponse
|
||||
from .api_response_sensor_response_data import ApiResponseSensorResponseData
|
||||
from .api_response_sensor_response_data_param_schema_type_0 import ApiResponseSensorResponseDataParamSchemaType0
|
||||
from .api_response_string import ApiResponseString
|
||||
from .api_response_token_response import ApiResponseTokenResponse
|
||||
from .api_response_token_response_data import ApiResponseTokenResponseData
|
||||
from .api_response_trigger_response import ApiResponseTriggerResponse
|
||||
from .api_response_trigger_response_data import ApiResponseTriggerResponseData
|
||||
from .api_response_trigger_response_data_out_schema_type_0 import ApiResponseTriggerResponseDataOutSchemaType0
|
||||
from .api_response_trigger_response_data_param_schema_type_0 import ApiResponseTriggerResponseDataParamSchemaType0
|
||||
from .api_response_webhook_receiver_response import ApiResponseWebhookReceiverResponse
|
||||
from .api_response_webhook_receiver_response_data import ApiResponseWebhookReceiverResponseData
|
||||
from .api_response_workflow_response import ApiResponseWorkflowResponse
|
||||
from .api_response_workflow_response_data import ApiResponseWorkflowResponseData
|
||||
from .api_response_workflow_response_data_definition import ApiResponseWorkflowResponseDataDefinition
|
||||
from .api_response_workflow_response_data_out_schema_type_0 import ApiResponseWorkflowResponseDataOutSchemaType0
|
||||
from .api_response_workflow_response_data_param_schema_type_0 import ApiResponseWorkflowResponseDataParamSchemaType0
|
||||
from .change_password_request import ChangePasswordRequest
|
||||
from .change_password_response_200 import ChangePasswordResponse200
|
||||
from .change_password_response_200_data import ChangePasswordResponse200Data
|
||||
from .create_action_request import CreateActionRequest
|
||||
from .create_action_request_out_schema_type_0 import CreateActionRequestOutSchemaType0
|
||||
from .create_action_request_param_schema_type_0 import CreateActionRequestParamSchemaType0
|
||||
from .create_action_response_201 import CreateActionResponse201
|
||||
from .create_action_response_201_data import CreateActionResponse201Data
|
||||
from .create_action_response_201_data_out_schema_type_0 import CreateActionResponse201DataOutSchemaType0
|
||||
from .create_action_response_201_data_param_schema_type_0 import CreateActionResponse201DataParamSchemaType0
|
||||
from .create_inquiry_request import CreateInquiryRequest
|
||||
from .create_inquiry_request_response_schema import CreateInquiryRequestResponseSchema
|
||||
from .create_key_request import CreateKeyRequest
|
||||
from .create_key_response_201 import CreateKeyResponse201
|
||||
from .create_key_response_201_data import CreateKeyResponse201Data
|
||||
from .create_pack_request import CreatePackRequest
|
||||
from .create_pack_request_conf_schema import CreatePackRequestConfSchema
|
||||
from .create_pack_request_config import CreatePackRequestConfig
|
||||
from .create_pack_request_meta import CreatePackRequestMeta
|
||||
from .create_pack_response_201 import CreatePackResponse201
|
||||
from .create_pack_response_201_data import CreatePackResponse201Data
|
||||
from .create_pack_response_201_data_conf_schema import CreatePackResponse201DataConfSchema
|
||||
from .create_pack_response_201_data_config import CreatePackResponse201DataConfig
|
||||
from .create_pack_response_201_data_meta import CreatePackResponse201DataMeta
|
||||
from .create_rule_request import CreateRuleRequest
|
||||
from .create_rule_request_action_params import CreateRuleRequestActionParams
|
||||
from .create_rule_request_conditions import CreateRuleRequestConditions
|
||||
from .create_rule_request_trigger_params import CreateRuleRequestTriggerParams
|
||||
from .create_sensor_request import CreateSensorRequest
|
||||
from .create_sensor_request_config_type_0 import CreateSensorRequestConfigType0
|
||||
from .create_sensor_request_param_schema_type_0 import CreateSensorRequestParamSchemaType0
|
||||
from .create_trigger_request import CreateTriggerRequest
|
||||
from .create_trigger_request_out_schema_type_0 import CreateTriggerRequestOutSchemaType0
|
||||
from .create_trigger_request_param_schema_type_0 import CreateTriggerRequestParamSchemaType0
|
||||
from .create_workflow_request import CreateWorkflowRequest
|
||||
from .create_workflow_request_definition import CreateWorkflowRequestDefinition
|
||||
from .create_workflow_request_out_schema import CreateWorkflowRequestOutSchema
|
||||
from .create_workflow_request_param_schema import CreateWorkflowRequestParamSchema
|
||||
from .create_workflow_response_201 import CreateWorkflowResponse201
|
||||
from .create_workflow_response_201_data import CreateWorkflowResponse201Data
|
||||
from .create_workflow_response_201_data_definition import CreateWorkflowResponse201DataDefinition
|
||||
from .create_workflow_response_201_data_out_schema_type_0 import CreateWorkflowResponse201DataOutSchemaType0
|
||||
from .create_workflow_response_201_data_param_schema_type_0 import CreateWorkflowResponse201DataParamSchemaType0
|
||||
from .current_user_response import CurrentUserResponse
|
||||
from .enforcement_condition import EnforcementCondition
|
||||
from .enforcement_response import EnforcementResponse
|
||||
from .enforcement_response_conditions import EnforcementResponseConditions
|
||||
from .enforcement_response_config_type_0 import EnforcementResponseConfigType0
|
||||
from .enforcement_response_payload import EnforcementResponsePayload
|
||||
from .enforcement_status import EnforcementStatus
|
||||
from .enforcement_summary import EnforcementSummary
|
||||
from .event_response import EventResponse
|
||||
from .event_response_config_type_0 import EventResponseConfigType0
|
||||
from .event_response_payload import EventResponsePayload
|
||||
from .event_summary import EventSummary
|
||||
from .execution_response import ExecutionResponse
|
||||
from .execution_response_config import ExecutionResponseConfig
|
||||
from .execution_response_result import ExecutionResponseResult
|
||||
from .execution_status import ExecutionStatus
|
||||
from .execution_summary import ExecutionSummary
|
||||
from .get_action_response_200 import GetActionResponse200
|
||||
from .get_action_response_200_data import GetActionResponse200Data
|
||||
from .get_action_response_200_data_out_schema_type_0 import GetActionResponse200DataOutSchemaType0
|
||||
from .get_action_response_200_data_param_schema_type_0 import GetActionResponse200DataParamSchemaType0
|
||||
from .get_current_user_response_200 import GetCurrentUserResponse200
|
||||
from .get_current_user_response_200_data import GetCurrentUserResponse200Data
|
||||
from .get_execution_response_200 import GetExecutionResponse200
|
||||
from .get_execution_response_200_data import GetExecutionResponse200Data
|
||||
from .get_execution_response_200_data_config import GetExecutionResponse200DataConfig
|
||||
from .get_execution_response_200_data_result import GetExecutionResponse200DataResult
|
||||
from .get_execution_stats_response_200 import GetExecutionStatsResponse200
|
||||
from .get_key_response_200 import GetKeyResponse200
|
||||
from .get_key_response_200_data import GetKeyResponse200Data
|
||||
from .get_pack_response_200 import GetPackResponse200
|
||||
from .get_pack_response_200_data import GetPackResponse200Data
|
||||
from .get_pack_response_200_data_conf_schema import GetPackResponse200DataConfSchema
|
||||
from .get_pack_response_200_data_config import GetPackResponse200DataConfig
|
||||
from .get_pack_response_200_data_meta import GetPackResponse200DataMeta
|
||||
from .get_pack_test_history_response_200 import GetPackTestHistoryResponse200
|
||||
from .get_pack_test_history_response_200_data_item import GetPackTestHistoryResponse200DataItem
|
||||
from .get_queue_stats_response_200 import GetQueueStatsResponse200
|
||||
from .get_queue_stats_response_200_data import GetQueueStatsResponse200Data
|
||||
from .get_workflow_response_200 import GetWorkflowResponse200
|
||||
from .get_workflow_response_200_data import GetWorkflowResponse200Data
|
||||
from .get_workflow_response_200_data_definition import GetWorkflowResponse200DataDefinition
|
||||
from .get_workflow_response_200_data_out_schema_type_0 import GetWorkflowResponse200DataOutSchemaType0
|
||||
from .get_workflow_response_200_data_param_schema_type_0 import GetWorkflowResponse200DataParamSchemaType0
|
||||
from .health_detailed_response_503 import HealthDetailedResponse503
|
||||
from .health_response import HealthResponse
|
||||
from .health_response_200 import HealthResponse200
|
||||
from .inquiry_respond_request import InquiryRespondRequest
|
||||
from .inquiry_respond_request_response import InquiryRespondRequestResponse
|
||||
from .inquiry_response import InquiryResponse
|
||||
from .inquiry_response_response_schema_type_0 import InquiryResponseResponseSchemaType0
|
||||
from .inquiry_response_response_type_0 import InquiryResponseResponseType0
|
||||
from .inquiry_status import InquiryStatus
|
||||
from .inquiry_summary import InquirySummary
|
||||
from .install_pack_request import InstallPackRequest
|
||||
from .key_response import KeyResponse
|
||||
from .key_summary import KeySummary
|
||||
from .login_request import LoginRequest
|
||||
from .login_response_200 import LoginResponse200
|
||||
from .login_response_200_data import LoginResponse200Data
|
||||
from .owner_type import OwnerType
|
||||
from .pack_install_response import PackInstallResponse
|
||||
from .pack_response import PackResponse
|
||||
from .pack_response_conf_schema import PackResponseConfSchema
|
||||
from .pack_response_config import PackResponseConfig
|
||||
from .pack_response_meta import PackResponseMeta
|
||||
from .pack_summary import PackSummary
|
||||
from .pack_test_execution import PackTestExecution
|
||||
from .pack_test_result import PackTestResult
|
||||
from .pack_test_summary import PackTestSummary
|
||||
from .pack_workflow_sync_response import PackWorkflowSyncResponse
|
||||
from .pack_workflow_validation_response import PackWorkflowValidationResponse
|
||||
from .pack_workflow_validation_response_errors import PackWorkflowValidationResponseErrors
|
||||
from .paginated_response_action_summary import PaginatedResponseActionSummary
|
||||
from .paginated_response_action_summary_data_item import PaginatedResponseActionSummaryDataItem
|
||||
from .paginated_response_enforcement_summary import PaginatedResponseEnforcementSummary
|
||||
from .paginated_response_enforcement_summary_data_item import PaginatedResponseEnforcementSummaryDataItem
|
||||
from .paginated_response_event_summary import PaginatedResponseEventSummary
|
||||
from .paginated_response_event_summary_data_item import PaginatedResponseEventSummaryDataItem
|
||||
from .paginated_response_execution_summary import PaginatedResponseExecutionSummary
|
||||
from .paginated_response_execution_summary_data_item import PaginatedResponseExecutionSummaryDataItem
|
||||
from .paginated_response_inquiry_summary import PaginatedResponseInquirySummary
|
||||
from .paginated_response_inquiry_summary_data_item import PaginatedResponseInquirySummaryDataItem
|
||||
from .paginated_response_key_summary import PaginatedResponseKeySummary
|
||||
from .paginated_response_key_summary_data_item import PaginatedResponseKeySummaryDataItem
|
||||
from .paginated_response_pack_summary import PaginatedResponsePackSummary
|
||||
from .paginated_response_pack_summary_data_item import PaginatedResponsePackSummaryDataItem
|
||||
from .paginated_response_pack_test_summary import PaginatedResponsePackTestSummary
|
||||
from .paginated_response_pack_test_summary_data_item import PaginatedResponsePackTestSummaryDataItem
|
||||
from .paginated_response_rule_summary import PaginatedResponseRuleSummary
|
||||
from .paginated_response_rule_summary_data_item import PaginatedResponseRuleSummaryDataItem
|
||||
from .paginated_response_sensor_summary import PaginatedResponseSensorSummary
|
||||
from .paginated_response_sensor_summary_data_item import PaginatedResponseSensorSummaryDataItem
|
||||
from .paginated_response_trigger_summary import PaginatedResponseTriggerSummary
|
||||
from .paginated_response_trigger_summary_data_item import PaginatedResponseTriggerSummaryDataItem
|
||||
from .paginated_response_workflow_summary import PaginatedResponseWorkflowSummary
|
||||
from .paginated_response_workflow_summary_data_item import PaginatedResponseWorkflowSummaryDataItem
|
||||
from .pagination_meta import PaginationMeta
|
||||
from .queue_stats_response import QueueStatsResponse
|
||||
from .refresh_token_request import RefreshTokenRequest
|
||||
from .refresh_token_response_200 import RefreshTokenResponse200
|
||||
from .refresh_token_response_200_data import RefreshTokenResponse200Data
|
||||
from .register_pack_request import RegisterPackRequest
|
||||
from .register_request import RegisterRequest
|
||||
from .register_response_200 import RegisterResponse200
|
||||
from .register_response_200_data import RegisterResponse200Data
|
||||
from .rule_response import RuleResponse
|
||||
from .rule_response_action_params import RuleResponseActionParams
|
||||
from .rule_response_conditions import RuleResponseConditions
|
||||
from .rule_response_trigger_params import RuleResponseTriggerParams
|
||||
from .rule_summary import RuleSummary
|
||||
from .sensor_response import SensorResponse
|
||||
from .sensor_response_param_schema_type_0 import SensorResponseParamSchemaType0
|
||||
from .sensor_summary import SensorSummary
|
||||
from .success_response import SuccessResponse
|
||||
from .sync_pack_workflows_response_200 import SyncPackWorkflowsResponse200
|
||||
from .sync_pack_workflows_response_200_data import SyncPackWorkflowsResponse200Data
|
||||
from .test_case_result import TestCaseResult
|
||||
from .test_pack_response_200 import TestPackResponse200
|
||||
from .test_pack_response_200_data import TestPackResponse200Data
|
||||
from .test_status import TestStatus
|
||||
from .test_suite_result import TestSuiteResult
|
||||
from .token_response import TokenResponse
|
||||
from .trigger_response import TriggerResponse
|
||||
from .trigger_response_out_schema_type_0 import TriggerResponseOutSchemaType0
|
||||
from .trigger_response_param_schema_type_0 import TriggerResponseParamSchemaType0
|
||||
from .trigger_summary import TriggerSummary
|
||||
from .update_action_request import UpdateActionRequest
|
||||
from .update_action_request_out_schema_type_0 import UpdateActionRequestOutSchemaType0
|
||||
from .update_action_request_param_schema_type_0 import UpdateActionRequestParamSchemaType0
|
||||
from .update_action_response_200 import UpdateActionResponse200
|
||||
from .update_action_response_200_data import UpdateActionResponse200Data
|
||||
from .update_action_response_200_data_out_schema_type_0 import UpdateActionResponse200DataOutSchemaType0
|
||||
from .update_action_response_200_data_param_schema_type_0 import UpdateActionResponse200DataParamSchemaType0
|
||||
from .update_inquiry_request import UpdateInquiryRequest
|
||||
from .update_inquiry_request_response_type_0 import UpdateInquiryRequestResponseType0
|
||||
from .update_key_request import UpdateKeyRequest
|
||||
from .update_key_response_200 import UpdateKeyResponse200
|
||||
from .update_key_response_200_data import UpdateKeyResponse200Data
|
||||
from .update_pack_request import UpdatePackRequest
|
||||
from .update_pack_request_conf_schema_type_0 import UpdatePackRequestConfSchemaType0
|
||||
from .update_pack_request_config_type_0 import UpdatePackRequestConfigType0
|
||||
from .update_pack_request_meta_type_0 import UpdatePackRequestMetaType0
|
||||
from .update_pack_response_200 import UpdatePackResponse200
|
||||
from .update_pack_response_200_data import UpdatePackResponse200Data
|
||||
from .update_pack_response_200_data_conf_schema import UpdatePackResponse200DataConfSchema
|
||||
from .update_pack_response_200_data_config import UpdatePackResponse200DataConfig
|
||||
from .update_pack_response_200_data_meta import UpdatePackResponse200DataMeta
|
||||
from .update_rule_request import UpdateRuleRequest
|
||||
from .update_rule_request_action_params_type_0 import UpdateRuleRequestActionParamsType0
|
||||
from .update_rule_request_conditions_type_0 import UpdateRuleRequestConditionsType0
|
||||
from .update_rule_request_trigger_params_type_0 import UpdateRuleRequestTriggerParamsType0
|
||||
from .update_sensor_request import UpdateSensorRequest
|
||||
from .update_sensor_request_param_schema_type_0 import UpdateSensorRequestParamSchemaType0
|
||||
from .update_trigger_request import UpdateTriggerRequest
|
||||
from .update_trigger_request_out_schema_type_0 import UpdateTriggerRequestOutSchemaType0
|
||||
from .update_trigger_request_param_schema_type_0 import UpdateTriggerRequestParamSchemaType0
|
||||
from .update_workflow_request import UpdateWorkflowRequest
|
||||
from .update_workflow_request_definition_type_0 import UpdateWorkflowRequestDefinitionType0
|
||||
from .update_workflow_request_out_schema_type_0 import UpdateWorkflowRequestOutSchemaType0
|
||||
from .update_workflow_request_param_schema_type_0 import UpdateWorkflowRequestParamSchemaType0
|
||||
from .update_workflow_response_200 import UpdateWorkflowResponse200
|
||||
from .update_workflow_response_200_data import UpdateWorkflowResponse200Data
|
||||
from .update_workflow_response_200_data_definition import UpdateWorkflowResponse200DataDefinition
|
||||
from .update_workflow_response_200_data_out_schema_type_0 import UpdateWorkflowResponse200DataOutSchemaType0
|
||||
from .update_workflow_response_200_data_param_schema_type_0 import UpdateWorkflowResponse200DataParamSchemaType0
|
||||
from .user_info import UserInfo
|
||||
from .validate_pack_workflows_response_200 import ValidatePackWorkflowsResponse200
|
||||
from .validate_pack_workflows_response_200_data import ValidatePackWorkflowsResponse200Data
|
||||
from .validate_pack_workflows_response_200_data_errors import ValidatePackWorkflowsResponse200DataErrors
|
||||
from .webhook_receiver_request import WebhookReceiverRequest
|
||||
from .webhook_receiver_response import WebhookReceiverResponse
|
||||
from .workflow_response import WorkflowResponse
|
||||
from .workflow_response_definition import WorkflowResponseDefinition
|
||||
from .workflow_response_out_schema_type_0 import WorkflowResponseOutSchemaType0
|
||||
from .workflow_response_param_schema_type_0 import WorkflowResponseParamSchemaType0
|
||||
from .workflow_summary import WorkflowSummary
|
||||
from .workflow_sync_result import WorkflowSyncResult
|
||||
|
||||
__all__ = (
|
||||
"ActionResponse",
|
||||
"ActionResponseOutSchemaType0",
|
||||
"ActionResponseParamSchemaType0",
|
||||
"ActionSummary",
|
||||
"ApiResponseActionResponse",
|
||||
"ApiResponseActionResponseData",
|
||||
"ApiResponseActionResponseDataOutSchemaType0",
|
||||
"ApiResponseActionResponseDataParamSchemaType0",
|
||||
"ApiResponseCurrentUserResponse",
|
||||
"ApiResponseCurrentUserResponseData",
|
||||
"ApiResponseEnforcementResponse",
|
||||
"ApiResponseEnforcementResponseData",
|
||||
"ApiResponseEnforcementResponseDataConditions",
|
||||
"ApiResponseEnforcementResponseDataConfigType0",
|
||||
"ApiResponseEnforcementResponseDataPayload",
|
||||
"ApiResponseEventResponse",
|
||||
"ApiResponseEventResponseData",
|
||||
"ApiResponseEventResponseDataConfigType0",
|
||||
"ApiResponseEventResponseDataPayload",
|
||||
"ApiResponseExecutionResponse",
|
||||
"ApiResponseExecutionResponseData",
|
||||
"ApiResponseExecutionResponseDataConfig",
|
||||
"ApiResponseExecutionResponseDataResult",
|
||||
"ApiResponseInquiryResponse",
|
||||
"ApiResponseInquiryResponseData",
|
||||
"ApiResponseInquiryResponseDataResponseSchemaType0",
|
||||
"ApiResponseInquiryResponseDataResponseType0",
|
||||
"ApiResponseKeyResponse",
|
||||
"ApiResponseKeyResponseData",
|
||||
"ApiResponsePackInstallResponse",
|
||||
"ApiResponsePackInstallResponseData",
|
||||
"ApiResponsePackResponse",
|
||||
"ApiResponsePackResponseData",
|
||||
"ApiResponsePackResponseDataConfig",
|
||||
"ApiResponsePackResponseDataConfSchema",
|
||||
"ApiResponsePackResponseDataMeta",
|
||||
"ApiResponseQueueStatsResponse",
|
||||
"ApiResponseQueueStatsResponseData",
|
||||
"ApiResponseRuleResponse",
|
||||
"ApiResponseRuleResponseData",
|
||||
"ApiResponseRuleResponseDataActionParams",
|
||||
"ApiResponseRuleResponseDataConditions",
|
||||
"ApiResponseRuleResponseDataTriggerParams",
|
||||
"ApiResponseSensorResponse",
|
||||
"ApiResponseSensorResponseData",
|
||||
"ApiResponseSensorResponseDataParamSchemaType0",
|
||||
"ApiResponseString",
|
||||
"ApiResponseTokenResponse",
|
||||
"ApiResponseTokenResponseData",
|
||||
"ApiResponseTriggerResponse",
|
||||
"ApiResponseTriggerResponseData",
|
||||
"ApiResponseTriggerResponseDataOutSchemaType0",
|
||||
"ApiResponseTriggerResponseDataParamSchemaType0",
|
||||
"ApiResponseWebhookReceiverResponse",
|
||||
"ApiResponseWebhookReceiverResponseData",
|
||||
"ApiResponseWorkflowResponse",
|
||||
"ApiResponseWorkflowResponseData",
|
||||
"ApiResponseWorkflowResponseDataDefinition",
|
||||
"ApiResponseWorkflowResponseDataOutSchemaType0",
|
||||
"ApiResponseWorkflowResponseDataParamSchemaType0",
|
||||
"ChangePasswordRequest",
|
||||
"ChangePasswordResponse200",
|
||||
"ChangePasswordResponse200Data",
|
||||
"CreateActionRequest",
|
||||
"CreateActionRequestOutSchemaType0",
|
||||
"CreateActionRequestParamSchemaType0",
|
||||
"CreateActionResponse201",
|
||||
"CreateActionResponse201Data",
|
||||
"CreateActionResponse201DataOutSchemaType0",
|
||||
"CreateActionResponse201DataParamSchemaType0",
|
||||
"CreateInquiryRequest",
|
||||
"CreateInquiryRequestResponseSchema",
|
||||
"CreateKeyRequest",
|
||||
"CreateKeyResponse201",
|
||||
"CreateKeyResponse201Data",
|
||||
"CreatePackRequest",
|
||||
"CreatePackRequestConfig",
|
||||
"CreatePackRequestConfSchema",
|
||||
"CreatePackRequestMeta",
|
||||
"CreatePackResponse201",
|
||||
"CreatePackResponse201Data",
|
||||
"CreatePackResponse201DataConfig",
|
||||
"CreatePackResponse201DataConfSchema",
|
||||
"CreatePackResponse201DataMeta",
|
||||
"CreateRuleRequest",
|
||||
"CreateRuleRequestActionParams",
|
||||
"CreateRuleRequestConditions",
|
||||
"CreateRuleRequestTriggerParams",
|
||||
"CreateSensorRequest",
|
||||
"CreateSensorRequestConfigType0",
|
||||
"CreateSensorRequestParamSchemaType0",
|
||||
"CreateTriggerRequest",
|
||||
"CreateTriggerRequestOutSchemaType0",
|
||||
"CreateTriggerRequestParamSchemaType0",
|
||||
"CreateWorkflowRequest",
|
||||
"CreateWorkflowRequestDefinition",
|
||||
"CreateWorkflowRequestOutSchema",
|
||||
"CreateWorkflowRequestParamSchema",
|
||||
"CreateWorkflowResponse201",
|
||||
"CreateWorkflowResponse201Data",
|
||||
"CreateWorkflowResponse201DataDefinition",
|
||||
"CreateWorkflowResponse201DataOutSchemaType0",
|
||||
"CreateWorkflowResponse201DataParamSchemaType0",
|
||||
"CurrentUserResponse",
|
||||
"EnforcementCondition",
|
||||
"EnforcementResponse",
|
||||
"EnforcementResponseConditions",
|
||||
"EnforcementResponseConfigType0",
|
||||
"EnforcementResponsePayload",
|
||||
"EnforcementStatus",
|
||||
"EnforcementSummary",
|
||||
"EventResponse",
|
||||
"EventResponseConfigType0",
|
||||
"EventResponsePayload",
|
||||
"EventSummary",
|
||||
"ExecutionResponse",
|
||||
"ExecutionResponseConfig",
|
||||
"ExecutionResponseResult",
|
||||
"ExecutionStatus",
|
||||
"ExecutionSummary",
|
||||
"GetActionResponse200",
|
||||
"GetActionResponse200Data",
|
||||
"GetActionResponse200DataOutSchemaType0",
|
||||
"GetActionResponse200DataParamSchemaType0",
|
||||
"GetCurrentUserResponse200",
|
||||
"GetCurrentUserResponse200Data",
|
||||
"GetExecutionResponse200",
|
||||
"GetExecutionResponse200Data",
|
||||
"GetExecutionResponse200DataConfig",
|
||||
"GetExecutionResponse200DataResult",
|
||||
"GetExecutionStatsResponse200",
|
||||
"GetKeyResponse200",
|
||||
"GetKeyResponse200Data",
|
||||
"GetPackResponse200",
|
||||
"GetPackResponse200Data",
|
||||
"GetPackResponse200DataConfig",
|
||||
"GetPackResponse200DataConfSchema",
|
||||
"GetPackResponse200DataMeta",
|
||||
"GetPackTestHistoryResponse200",
|
||||
"GetPackTestHistoryResponse200DataItem",
|
||||
"GetQueueStatsResponse200",
|
||||
"GetQueueStatsResponse200Data",
|
||||
"GetWorkflowResponse200",
|
||||
"GetWorkflowResponse200Data",
|
||||
"GetWorkflowResponse200DataDefinition",
|
||||
"GetWorkflowResponse200DataOutSchemaType0",
|
||||
"GetWorkflowResponse200DataParamSchemaType0",
|
||||
"HealthDetailedResponse503",
|
||||
"HealthResponse",
|
||||
"HealthResponse200",
|
||||
"InquiryRespondRequest",
|
||||
"InquiryRespondRequestResponse",
|
||||
"InquiryResponse",
|
||||
"InquiryResponseResponseSchemaType0",
|
||||
"InquiryResponseResponseType0",
|
||||
"InquiryStatus",
|
||||
"InquirySummary",
|
||||
"InstallPackRequest",
|
||||
"KeyResponse",
|
||||
"KeySummary",
|
||||
"LoginRequest",
|
||||
"LoginResponse200",
|
||||
"LoginResponse200Data",
|
||||
"OwnerType",
|
||||
"PackInstallResponse",
|
||||
"PackResponse",
|
||||
"PackResponseConfig",
|
||||
"PackResponseConfSchema",
|
||||
"PackResponseMeta",
|
||||
"PackSummary",
|
||||
"PackTestExecution",
|
||||
"PackTestResult",
|
||||
"PackTestSummary",
|
||||
"PackWorkflowSyncResponse",
|
||||
"PackWorkflowValidationResponse",
|
||||
"PackWorkflowValidationResponseErrors",
|
||||
"PaginatedResponseActionSummary",
|
||||
"PaginatedResponseActionSummaryDataItem",
|
||||
"PaginatedResponseEnforcementSummary",
|
||||
"PaginatedResponseEnforcementSummaryDataItem",
|
||||
"PaginatedResponseEventSummary",
|
||||
"PaginatedResponseEventSummaryDataItem",
|
||||
"PaginatedResponseExecutionSummary",
|
||||
"PaginatedResponseExecutionSummaryDataItem",
|
||||
"PaginatedResponseInquirySummary",
|
||||
"PaginatedResponseInquirySummaryDataItem",
|
||||
"PaginatedResponseKeySummary",
|
||||
"PaginatedResponseKeySummaryDataItem",
|
||||
"PaginatedResponsePackSummary",
|
||||
"PaginatedResponsePackSummaryDataItem",
|
||||
"PaginatedResponsePackTestSummary",
|
||||
"PaginatedResponsePackTestSummaryDataItem",
|
||||
"PaginatedResponseRuleSummary",
|
||||
"PaginatedResponseRuleSummaryDataItem",
|
||||
"PaginatedResponseSensorSummary",
|
||||
"PaginatedResponseSensorSummaryDataItem",
|
||||
"PaginatedResponseTriggerSummary",
|
||||
"PaginatedResponseTriggerSummaryDataItem",
|
||||
"PaginatedResponseWorkflowSummary",
|
||||
"PaginatedResponseWorkflowSummaryDataItem",
|
||||
"PaginationMeta",
|
||||
"QueueStatsResponse",
|
||||
"RefreshTokenRequest",
|
||||
"RefreshTokenResponse200",
|
||||
"RefreshTokenResponse200Data",
|
||||
"RegisterPackRequest",
|
||||
"RegisterRequest",
|
||||
"RegisterResponse200",
|
||||
"RegisterResponse200Data",
|
||||
"RuleResponse",
|
||||
"RuleResponseActionParams",
|
||||
"RuleResponseConditions",
|
||||
"RuleResponseTriggerParams",
|
||||
"RuleSummary",
|
||||
"SensorResponse",
|
||||
"SensorResponseParamSchemaType0",
|
||||
"SensorSummary",
|
||||
"SuccessResponse",
|
||||
"SyncPackWorkflowsResponse200",
|
||||
"SyncPackWorkflowsResponse200Data",
|
||||
"TestCaseResult",
|
||||
"TestPackResponse200",
|
||||
"TestPackResponse200Data",
|
||||
"TestStatus",
|
||||
"TestSuiteResult",
|
||||
"TokenResponse",
|
||||
"TriggerResponse",
|
||||
"TriggerResponseOutSchemaType0",
|
||||
"TriggerResponseParamSchemaType0",
|
||||
"TriggerSummary",
|
||||
"UpdateActionRequest",
|
||||
"UpdateActionRequestOutSchemaType0",
|
||||
"UpdateActionRequestParamSchemaType0",
|
||||
"UpdateActionResponse200",
|
||||
"UpdateActionResponse200Data",
|
||||
"UpdateActionResponse200DataOutSchemaType0",
|
||||
"UpdateActionResponse200DataParamSchemaType0",
|
||||
"UpdateInquiryRequest",
|
||||
"UpdateInquiryRequestResponseType0",
|
||||
"UpdateKeyRequest",
|
||||
"UpdateKeyResponse200",
|
||||
"UpdateKeyResponse200Data",
|
||||
"UpdatePackRequest",
|
||||
"UpdatePackRequestConfigType0",
|
||||
"UpdatePackRequestConfSchemaType0",
|
||||
"UpdatePackRequestMetaType0",
|
||||
"UpdatePackResponse200",
|
||||
"UpdatePackResponse200Data",
|
||||
"UpdatePackResponse200DataConfig",
|
||||
"UpdatePackResponse200DataConfSchema",
|
||||
"UpdatePackResponse200DataMeta",
|
||||
"UpdateRuleRequest",
|
||||
"UpdateRuleRequestActionParamsType0",
|
||||
"UpdateRuleRequestConditionsType0",
|
||||
"UpdateRuleRequestTriggerParamsType0",
|
||||
"UpdateSensorRequest",
|
||||
"UpdateSensorRequestParamSchemaType0",
|
||||
"UpdateTriggerRequest",
|
||||
"UpdateTriggerRequestOutSchemaType0",
|
||||
"UpdateTriggerRequestParamSchemaType0",
|
||||
"UpdateWorkflowRequest",
|
||||
"UpdateWorkflowRequestDefinitionType0",
|
||||
"UpdateWorkflowRequestOutSchemaType0",
|
||||
"UpdateWorkflowRequestParamSchemaType0",
|
||||
"UpdateWorkflowResponse200",
|
||||
"UpdateWorkflowResponse200Data",
|
||||
"UpdateWorkflowResponse200DataDefinition",
|
||||
"UpdateWorkflowResponse200DataOutSchemaType0",
|
||||
"UpdateWorkflowResponse200DataParamSchemaType0",
|
||||
"UserInfo",
|
||||
"ValidatePackWorkflowsResponse200",
|
||||
"ValidatePackWorkflowsResponse200Data",
|
||||
"ValidatePackWorkflowsResponse200DataErrors",
|
||||
"WebhookReceiverRequest",
|
||||
"WebhookReceiverResponse",
|
||||
"WorkflowResponse",
|
||||
"WorkflowResponseDefinition",
|
||||
"WorkflowResponseOutSchemaType0",
|
||||
"WorkflowResponseParamSchemaType0",
|
||||
"WorkflowSummary",
|
||||
"WorkflowSyncResult",
|
||||
)
|
||||
235
tests/generated_client/models/action_response.py
Normal file
235
tests/generated_client/models/action_response.py
Normal file
@@ -0,0 +1,235 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from dateutil.parser import isoparse
|
||||
from typing import cast
|
||||
import datetime
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.action_response_out_schema_type_0 import ActionResponseOutSchemaType0
|
||||
from ..models.action_response_param_schema_type_0 import ActionResponseParamSchemaType0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ActionResponse")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ActionResponse:
|
||||
""" Response DTO for action information
|
||||
|
||||
Attributes:
|
||||
created (datetime.datetime): Creation timestamp Example: 2024-01-13T10:30:00Z.
|
||||
description (str): Action description Example: Posts a message to a Slack channel.
|
||||
entrypoint (str): Entry point Example: /actions/slack/post_message.py.
|
||||
id (int): Action ID Example: 1.
|
||||
label (str): Human-readable label Example: Post Message to Slack.
|
||||
out_schema (ActionResponseOutSchemaType0 | None): Output schema
|
||||
pack (int): Pack ID Example: 1.
|
||||
pack_ref (str): Pack reference Example: slack.
|
||||
param_schema (ActionResponseParamSchemaType0 | None): Parameter schema
|
||||
ref (str): Unique reference identifier Example: slack.post_message.
|
||||
updated (datetime.datetime): Last update timestamp Example: 2024-01-13T10:30:00Z.
|
||||
runtime (int | None | Unset): Runtime ID Example: 1.
|
||||
"""
|
||||
|
||||
created: datetime.datetime
|
||||
description: str
|
||||
entrypoint: str
|
||||
id: int
|
||||
label: str
|
||||
out_schema: ActionResponseOutSchemaType0 | None
|
||||
pack: int
|
||||
pack_ref: str
|
||||
param_schema: ActionResponseParamSchemaType0 | None
|
||||
ref: str
|
||||
updated: datetime.datetime
|
||||
runtime: int | None | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.action_response_param_schema_type_0 import ActionResponseParamSchemaType0
|
||||
from ..models.action_response_out_schema_type_0 import ActionResponseOutSchemaType0
|
||||
created = self.created.isoformat()
|
||||
|
||||
description = self.description
|
||||
|
||||
entrypoint = self.entrypoint
|
||||
|
||||
id = self.id
|
||||
|
||||
label = self.label
|
||||
|
||||
out_schema: dict[str, Any] | None
|
||||
if isinstance(self.out_schema, ActionResponseOutSchemaType0):
|
||||
out_schema = self.out_schema.to_dict()
|
||||
else:
|
||||
out_schema = self.out_schema
|
||||
|
||||
pack = self.pack
|
||||
|
||||
pack_ref = self.pack_ref
|
||||
|
||||
param_schema: dict[str, Any] | None
|
||||
if isinstance(self.param_schema, ActionResponseParamSchemaType0):
|
||||
param_schema = self.param_schema.to_dict()
|
||||
else:
|
||||
param_schema = self.param_schema
|
||||
|
||||
ref = self.ref
|
||||
|
||||
updated = self.updated.isoformat()
|
||||
|
||||
runtime: int | None | Unset
|
||||
if isinstance(self.runtime, Unset):
|
||||
runtime = UNSET
|
||||
else:
|
||||
runtime = self.runtime
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"created": created,
|
||||
"description": description,
|
||||
"entrypoint": entrypoint,
|
||||
"id": id,
|
||||
"label": label,
|
||||
"out_schema": out_schema,
|
||||
"pack": pack,
|
||||
"pack_ref": pack_ref,
|
||||
"param_schema": param_schema,
|
||||
"ref": ref,
|
||||
"updated": updated,
|
||||
})
|
||||
if runtime is not UNSET:
|
||||
field_dict["runtime"] = runtime
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.action_response_out_schema_type_0 import ActionResponseOutSchemaType0
|
||||
from ..models.action_response_param_schema_type_0 import ActionResponseParamSchemaType0
|
||||
d = dict(src_dict)
|
||||
created = isoparse(d.pop("created"))
|
||||
|
||||
|
||||
|
||||
|
||||
description = d.pop("description")
|
||||
|
||||
entrypoint = d.pop("entrypoint")
|
||||
|
||||
id = d.pop("id")
|
||||
|
||||
label = d.pop("label")
|
||||
|
||||
def _parse_out_schema(data: object) -> ActionResponseOutSchemaType0 | None:
|
||||
if data is None:
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
out_schema_type_0 = ActionResponseOutSchemaType0.from_dict(data)
|
||||
|
||||
|
||||
|
||||
return out_schema_type_0
|
||||
except (TypeError, ValueError, AttributeError, KeyError):
|
||||
pass
|
||||
return cast(ActionResponseOutSchemaType0 | None, data)
|
||||
|
||||
out_schema = _parse_out_schema(d.pop("out_schema"))
|
||||
|
||||
|
||||
pack = d.pop("pack")
|
||||
|
||||
pack_ref = d.pop("pack_ref")
|
||||
|
||||
def _parse_param_schema(data: object) -> ActionResponseParamSchemaType0 | None:
|
||||
if data is None:
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
param_schema_type_0 = ActionResponseParamSchemaType0.from_dict(data)
|
||||
|
||||
|
||||
|
||||
return param_schema_type_0
|
||||
except (TypeError, ValueError, AttributeError, KeyError):
|
||||
pass
|
||||
return cast(ActionResponseParamSchemaType0 | None, data)
|
||||
|
||||
param_schema = _parse_param_schema(d.pop("param_schema"))
|
||||
|
||||
|
||||
ref = d.pop("ref")
|
||||
|
||||
updated = isoparse(d.pop("updated"))
|
||||
|
||||
|
||||
|
||||
|
||||
def _parse_runtime(data: object) -> int | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(int | None | Unset, data)
|
||||
|
||||
runtime = _parse_runtime(d.pop("runtime", UNSET))
|
||||
|
||||
|
||||
action_response = cls(
|
||||
created=created,
|
||||
description=description,
|
||||
entrypoint=entrypoint,
|
||||
id=id,
|
||||
label=label,
|
||||
out_schema=out_schema,
|
||||
pack=pack,
|
||||
pack_ref=pack_ref,
|
||||
param_schema=param_schema,
|
||||
ref=ref,
|
||||
updated=updated,
|
||||
runtime=runtime,
|
||||
)
|
||||
|
||||
|
||||
action_response.additional_properties = d
|
||||
return 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
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ActionResponseOutSchemaType0")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ActionResponseOutSchemaType0:
|
||||
""" Output schema
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
action_response_out_schema_type_0 = cls(
|
||||
)
|
||||
|
||||
|
||||
action_response_out_schema_type_0.additional_properties = d
|
||||
return action_response_out_schema_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
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ActionResponseParamSchemaType0")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ActionResponseParamSchemaType0:
|
||||
""" Parameter schema
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
action_response_param_schema_type_0 = cls(
|
||||
)
|
||||
|
||||
|
||||
action_response_param_schema_type_0.additional_properties = d
|
||||
return action_response_param_schema_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
|
||||
164
tests/generated_client/models/action_summary.py
Normal file
164
tests/generated_client/models/action_summary.py
Normal file
@@ -0,0 +1,164 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from dateutil.parser import isoparse
|
||||
from typing import cast
|
||||
import datetime
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ActionSummary")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ActionSummary:
|
||||
""" Simplified action response (for list endpoints)
|
||||
|
||||
Attributes:
|
||||
created (datetime.datetime): Creation timestamp Example: 2024-01-13T10:30:00Z.
|
||||
description (str): Action description Example: Posts a message to a Slack channel.
|
||||
entrypoint (str): Entry point Example: /actions/slack/post_message.py.
|
||||
id (int): Action ID Example: 1.
|
||||
label (str): Human-readable label Example: Post Message to Slack.
|
||||
pack_ref (str): Pack reference Example: slack.
|
||||
ref (str): Unique reference identifier Example: slack.post_message.
|
||||
updated (datetime.datetime): Last update timestamp Example: 2024-01-13T10:30:00Z.
|
||||
runtime (int | None | Unset): Runtime ID Example: 1.
|
||||
"""
|
||||
|
||||
created: datetime.datetime
|
||||
description: str
|
||||
entrypoint: str
|
||||
id: int
|
||||
label: str
|
||||
pack_ref: str
|
||||
ref: str
|
||||
updated: datetime.datetime
|
||||
runtime: int | None | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
created = self.created.isoformat()
|
||||
|
||||
description = self.description
|
||||
|
||||
entrypoint = self.entrypoint
|
||||
|
||||
id = self.id
|
||||
|
||||
label = self.label
|
||||
|
||||
pack_ref = self.pack_ref
|
||||
|
||||
ref = self.ref
|
||||
|
||||
updated = self.updated.isoformat()
|
||||
|
||||
runtime: int | None | Unset
|
||||
if isinstance(self.runtime, Unset):
|
||||
runtime = UNSET
|
||||
else:
|
||||
runtime = self.runtime
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"created": created,
|
||||
"description": description,
|
||||
"entrypoint": entrypoint,
|
||||
"id": id,
|
||||
"label": label,
|
||||
"pack_ref": pack_ref,
|
||||
"ref": ref,
|
||||
"updated": updated,
|
||||
})
|
||||
if runtime is not UNSET:
|
||||
field_dict["runtime"] = runtime
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
created = isoparse(d.pop("created"))
|
||||
|
||||
|
||||
|
||||
|
||||
description = d.pop("description")
|
||||
|
||||
entrypoint = d.pop("entrypoint")
|
||||
|
||||
id = d.pop("id")
|
||||
|
||||
label = d.pop("label")
|
||||
|
||||
pack_ref = d.pop("pack_ref")
|
||||
|
||||
ref = d.pop("ref")
|
||||
|
||||
updated = isoparse(d.pop("updated"))
|
||||
|
||||
|
||||
|
||||
|
||||
def _parse_runtime(data: object) -> int | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(int | None | Unset, data)
|
||||
|
||||
runtime = _parse_runtime(d.pop("runtime", UNSET))
|
||||
|
||||
|
||||
action_summary = cls(
|
||||
created=created,
|
||||
description=description,
|
||||
entrypoint=entrypoint,
|
||||
id=id,
|
||||
label=label,
|
||||
pack_ref=pack_ref,
|
||||
ref=ref,
|
||||
updated=updated,
|
||||
runtime=runtime,
|
||||
)
|
||||
|
||||
|
||||
action_summary.additional_properties = d
|
||||
return action_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
|
||||
107
tests/generated_client/models/api_response_action_response.py
Normal file
107
tests/generated_client/models/api_response_action_response.py
Normal file
@@ -0,0 +1,107 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from typing import cast
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.api_response_action_response_data import ApiResponseActionResponseData
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseActionResponse")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseActionResponse:
|
||||
""" Standard API response wrapper
|
||||
|
||||
Attributes:
|
||||
data (ApiResponseActionResponseData): Response DTO for action information
|
||||
message (None | str | Unset): Optional message
|
||||
"""
|
||||
|
||||
data: ApiResponseActionResponseData
|
||||
message: None | str | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.api_response_action_response_data import ApiResponseActionResponseData
|
||||
data = self.data.to_dict()
|
||||
|
||||
message: None | str | Unset
|
||||
if isinstance(self.message, Unset):
|
||||
message = UNSET
|
||||
else:
|
||||
message = self.message
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"data": data,
|
||||
})
|
||||
if message is not UNSET:
|
||||
field_dict["message"] = message
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.api_response_action_response_data import ApiResponseActionResponseData
|
||||
d = dict(src_dict)
|
||||
data = ApiResponseActionResponseData.from_dict(d.pop("data"))
|
||||
|
||||
|
||||
|
||||
|
||||
def _parse_message(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
message = _parse_message(d.pop("message", UNSET))
|
||||
|
||||
|
||||
api_response_action_response = cls(
|
||||
data=data,
|
||||
message=message,
|
||||
)
|
||||
|
||||
|
||||
api_response_action_response.additional_properties = d
|
||||
return api_response_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
|
||||
@@ -0,0 +1,235 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from dateutil.parser import isoparse
|
||||
from typing import cast
|
||||
import datetime
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.api_response_action_response_data_out_schema_type_0 import ApiResponseActionResponseDataOutSchemaType0
|
||||
from ..models.api_response_action_response_data_param_schema_type_0 import ApiResponseActionResponseDataParamSchemaType0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseActionResponseData")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseActionResponseData:
|
||||
""" Response DTO for action information
|
||||
|
||||
Attributes:
|
||||
created (datetime.datetime): Creation timestamp Example: 2024-01-13T10:30:00Z.
|
||||
description (str): Action description Example: Posts a message to a Slack channel.
|
||||
entrypoint (str): Entry point Example: /actions/slack/post_message.py.
|
||||
id (int): Action ID Example: 1.
|
||||
label (str): Human-readable label Example: Post Message to Slack.
|
||||
out_schema (ApiResponseActionResponseDataOutSchemaType0 | None): Output schema
|
||||
pack (int): Pack ID Example: 1.
|
||||
pack_ref (str): Pack reference Example: slack.
|
||||
param_schema (ApiResponseActionResponseDataParamSchemaType0 | None): Parameter schema
|
||||
ref (str): Unique reference identifier Example: slack.post_message.
|
||||
updated (datetime.datetime): Last update timestamp Example: 2024-01-13T10:30:00Z.
|
||||
runtime (int | None | Unset): Runtime ID Example: 1.
|
||||
"""
|
||||
|
||||
created: datetime.datetime
|
||||
description: str
|
||||
entrypoint: str
|
||||
id: int
|
||||
label: str
|
||||
out_schema: ApiResponseActionResponseDataOutSchemaType0 | None
|
||||
pack: int
|
||||
pack_ref: str
|
||||
param_schema: ApiResponseActionResponseDataParamSchemaType0 | None
|
||||
ref: str
|
||||
updated: datetime.datetime
|
||||
runtime: int | None | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.api_response_action_response_data_out_schema_type_0 import ApiResponseActionResponseDataOutSchemaType0
|
||||
from ..models.api_response_action_response_data_param_schema_type_0 import ApiResponseActionResponseDataParamSchemaType0
|
||||
created = self.created.isoformat()
|
||||
|
||||
description = self.description
|
||||
|
||||
entrypoint = self.entrypoint
|
||||
|
||||
id = self.id
|
||||
|
||||
label = self.label
|
||||
|
||||
out_schema: dict[str, Any] | None
|
||||
if isinstance(self.out_schema, ApiResponseActionResponseDataOutSchemaType0):
|
||||
out_schema = self.out_schema.to_dict()
|
||||
else:
|
||||
out_schema = self.out_schema
|
||||
|
||||
pack = self.pack
|
||||
|
||||
pack_ref = self.pack_ref
|
||||
|
||||
param_schema: dict[str, Any] | None
|
||||
if isinstance(self.param_schema, ApiResponseActionResponseDataParamSchemaType0):
|
||||
param_schema = self.param_schema.to_dict()
|
||||
else:
|
||||
param_schema = self.param_schema
|
||||
|
||||
ref = self.ref
|
||||
|
||||
updated = self.updated.isoformat()
|
||||
|
||||
runtime: int | None | Unset
|
||||
if isinstance(self.runtime, Unset):
|
||||
runtime = UNSET
|
||||
else:
|
||||
runtime = self.runtime
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"created": created,
|
||||
"description": description,
|
||||
"entrypoint": entrypoint,
|
||||
"id": id,
|
||||
"label": label,
|
||||
"out_schema": out_schema,
|
||||
"pack": pack,
|
||||
"pack_ref": pack_ref,
|
||||
"param_schema": param_schema,
|
||||
"ref": ref,
|
||||
"updated": updated,
|
||||
})
|
||||
if runtime is not UNSET:
|
||||
field_dict["runtime"] = runtime
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.api_response_action_response_data_out_schema_type_0 import ApiResponseActionResponseDataOutSchemaType0
|
||||
from ..models.api_response_action_response_data_param_schema_type_0 import ApiResponseActionResponseDataParamSchemaType0
|
||||
d = dict(src_dict)
|
||||
created = isoparse(d.pop("created"))
|
||||
|
||||
|
||||
|
||||
|
||||
description = d.pop("description")
|
||||
|
||||
entrypoint = d.pop("entrypoint")
|
||||
|
||||
id = d.pop("id")
|
||||
|
||||
label = d.pop("label")
|
||||
|
||||
def _parse_out_schema(data: object) -> ApiResponseActionResponseDataOutSchemaType0 | None:
|
||||
if data is None:
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
out_schema_type_0 = ApiResponseActionResponseDataOutSchemaType0.from_dict(data)
|
||||
|
||||
|
||||
|
||||
return out_schema_type_0
|
||||
except (TypeError, ValueError, AttributeError, KeyError):
|
||||
pass
|
||||
return cast(ApiResponseActionResponseDataOutSchemaType0 | None, data)
|
||||
|
||||
out_schema = _parse_out_schema(d.pop("out_schema"))
|
||||
|
||||
|
||||
pack = d.pop("pack")
|
||||
|
||||
pack_ref = d.pop("pack_ref")
|
||||
|
||||
def _parse_param_schema(data: object) -> ApiResponseActionResponseDataParamSchemaType0 | None:
|
||||
if data is None:
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
param_schema_type_0 = ApiResponseActionResponseDataParamSchemaType0.from_dict(data)
|
||||
|
||||
|
||||
|
||||
return param_schema_type_0
|
||||
except (TypeError, ValueError, AttributeError, KeyError):
|
||||
pass
|
||||
return cast(ApiResponseActionResponseDataParamSchemaType0 | None, data)
|
||||
|
||||
param_schema = _parse_param_schema(d.pop("param_schema"))
|
||||
|
||||
|
||||
ref = d.pop("ref")
|
||||
|
||||
updated = isoparse(d.pop("updated"))
|
||||
|
||||
|
||||
|
||||
|
||||
def _parse_runtime(data: object) -> int | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(int | None | Unset, data)
|
||||
|
||||
runtime = _parse_runtime(d.pop("runtime", UNSET))
|
||||
|
||||
|
||||
api_response_action_response_data = cls(
|
||||
created=created,
|
||||
description=description,
|
||||
entrypoint=entrypoint,
|
||||
id=id,
|
||||
label=label,
|
||||
out_schema=out_schema,
|
||||
pack=pack,
|
||||
pack_ref=pack_ref,
|
||||
param_schema=param_schema,
|
||||
ref=ref,
|
||||
updated=updated,
|
||||
runtime=runtime,
|
||||
)
|
||||
|
||||
|
||||
api_response_action_response_data.additional_properties = d
|
||||
return api_response_action_response_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
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseActionResponseDataOutSchemaType0")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseActionResponseDataOutSchemaType0:
|
||||
""" Output schema
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
api_response_action_response_data_out_schema_type_0 = cls(
|
||||
)
|
||||
|
||||
|
||||
api_response_action_response_data_out_schema_type_0.additional_properties = d
|
||||
return api_response_action_response_data_out_schema_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
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseActionResponseDataParamSchemaType0")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseActionResponseDataParamSchemaType0:
|
||||
""" Parameter schema
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
api_response_action_response_data_param_schema_type_0 = cls(
|
||||
)
|
||||
|
||||
|
||||
api_response_action_response_data_param_schema_type_0.additional_properties = d
|
||||
return api_response_action_response_data_param_schema_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
|
||||
@@ -0,0 +1,107 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from typing import cast
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.api_response_current_user_response_data import ApiResponseCurrentUserResponseData
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseCurrentUserResponse")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseCurrentUserResponse:
|
||||
""" Standard API response wrapper
|
||||
|
||||
Attributes:
|
||||
data (ApiResponseCurrentUserResponseData): Current user response
|
||||
message (None | str | Unset): Optional message
|
||||
"""
|
||||
|
||||
data: ApiResponseCurrentUserResponseData
|
||||
message: None | str | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.api_response_current_user_response_data import ApiResponseCurrentUserResponseData
|
||||
data = self.data.to_dict()
|
||||
|
||||
message: None | str | Unset
|
||||
if isinstance(self.message, Unset):
|
||||
message = UNSET
|
||||
else:
|
||||
message = self.message
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"data": data,
|
||||
})
|
||||
if message is not UNSET:
|
||||
field_dict["message"] = message
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.api_response_current_user_response_data import ApiResponseCurrentUserResponseData
|
||||
d = dict(src_dict)
|
||||
data = ApiResponseCurrentUserResponseData.from_dict(d.pop("data"))
|
||||
|
||||
|
||||
|
||||
|
||||
def _parse_message(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
message = _parse_message(d.pop("message", UNSET))
|
||||
|
||||
|
||||
api_response_current_user_response = cls(
|
||||
data=data,
|
||||
message=message,
|
||||
)
|
||||
|
||||
|
||||
api_response_current_user_response.additional_properties = d
|
||||
return api_response_current_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
|
||||
@@ -0,0 +1,108 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from typing import cast
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseCurrentUserResponseData")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseCurrentUserResponseData:
|
||||
""" Current user response
|
||||
|
||||
Attributes:
|
||||
id (int): Identity ID Example: 1.
|
||||
login (str): Identity login Example: admin.
|
||||
display_name (None | str | Unset): Display name Example: Administrator.
|
||||
"""
|
||||
|
||||
id: int
|
||||
login: str
|
||||
display_name: None | str | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
id = self.id
|
||||
|
||||
login = self.login
|
||||
|
||||
display_name: None | str | Unset
|
||||
if isinstance(self.display_name, Unset):
|
||||
display_name = UNSET
|
||||
else:
|
||||
display_name = self.display_name
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"id": id,
|
||||
"login": login,
|
||||
})
|
||||
if display_name is not UNSET:
|
||||
field_dict["display_name"] = display_name
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
id = d.pop("id")
|
||||
|
||||
login = d.pop("login")
|
||||
|
||||
def _parse_display_name(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
display_name = _parse_display_name(d.pop("display_name", UNSET))
|
||||
|
||||
|
||||
api_response_current_user_response_data = cls(
|
||||
id=id,
|
||||
login=login,
|
||||
display_name=display_name,
|
||||
)
|
||||
|
||||
|
||||
api_response_current_user_response_data.additional_properties = d
|
||||
return api_response_current_user_response_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
|
||||
@@ -0,0 +1,107 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from typing import cast
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.api_response_enforcement_response_data import ApiResponseEnforcementResponseData
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseEnforcementResponse")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseEnforcementResponse:
|
||||
""" Standard API response wrapper
|
||||
|
||||
Attributes:
|
||||
data (ApiResponseEnforcementResponseData): Full enforcement response with all details
|
||||
message (None | str | Unset): Optional message
|
||||
"""
|
||||
|
||||
data: ApiResponseEnforcementResponseData
|
||||
message: None | str | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.api_response_enforcement_response_data import ApiResponseEnforcementResponseData
|
||||
data = self.data.to_dict()
|
||||
|
||||
message: None | str | Unset
|
||||
if isinstance(self.message, Unset):
|
||||
message = UNSET
|
||||
else:
|
||||
message = self.message
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"data": data,
|
||||
})
|
||||
if message is not UNSET:
|
||||
field_dict["message"] = message
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.api_response_enforcement_response_data import ApiResponseEnforcementResponseData
|
||||
d = dict(src_dict)
|
||||
data = ApiResponseEnforcementResponseData.from_dict(d.pop("data"))
|
||||
|
||||
|
||||
|
||||
|
||||
def _parse_message(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
message = _parse_message(d.pop("message", UNSET))
|
||||
|
||||
|
||||
api_response_enforcement_response = cls(
|
||||
data=data,
|
||||
message=message,
|
||||
)
|
||||
|
||||
|
||||
api_response_enforcement_response.additional_properties = d
|
||||
return api_response_enforcement_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
|
||||
@@ -0,0 +1,245 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..models.enforcement_condition import EnforcementCondition
|
||||
from ..models.enforcement_status import EnforcementStatus
|
||||
from ..types import UNSET, Unset
|
||||
from dateutil.parser import isoparse
|
||||
from typing import cast
|
||||
import datetime
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.api_response_enforcement_response_data_conditions import ApiResponseEnforcementResponseDataConditions
|
||||
from ..models.api_response_enforcement_response_data_config_type_0 import ApiResponseEnforcementResponseDataConfigType0
|
||||
from ..models.api_response_enforcement_response_data_payload import ApiResponseEnforcementResponseDataPayload
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseEnforcementResponseData")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseEnforcementResponseData:
|
||||
""" Full enforcement response with all details
|
||||
|
||||
Attributes:
|
||||
condition (EnforcementCondition):
|
||||
conditions (ApiResponseEnforcementResponseDataConditions): Enforcement conditions (rule evaluation criteria)
|
||||
config (ApiResponseEnforcementResponseDataConfigType0 | None): Enforcement configuration
|
||||
created (datetime.datetime): Creation timestamp Example: 2024-01-13T10:30:00Z.
|
||||
id (int):
|
||||
payload (ApiResponseEnforcementResponseDataPayload): Enforcement payload
|
||||
rule_ref (str): Rule reference Example: slack.notify_on_error.
|
||||
status (EnforcementStatus):
|
||||
trigger_ref (str): Trigger reference Example: system.error_event.
|
||||
updated (datetime.datetime): Last update timestamp Example: 2024-01-13T10:30:00Z.
|
||||
event (int | None | Unset):
|
||||
rule (int | None | Unset):
|
||||
"""
|
||||
|
||||
condition: EnforcementCondition
|
||||
conditions: ApiResponseEnforcementResponseDataConditions
|
||||
config: ApiResponseEnforcementResponseDataConfigType0 | None
|
||||
created: datetime.datetime
|
||||
id: int
|
||||
payload: ApiResponseEnforcementResponseDataPayload
|
||||
rule_ref: str
|
||||
status: EnforcementStatus
|
||||
trigger_ref: str
|
||||
updated: datetime.datetime
|
||||
event: int | None | Unset = UNSET
|
||||
rule: int | None | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.api_response_enforcement_response_data_payload import ApiResponseEnforcementResponseDataPayload
|
||||
from ..models.api_response_enforcement_response_data_conditions import ApiResponseEnforcementResponseDataConditions
|
||||
from ..models.api_response_enforcement_response_data_config_type_0 import ApiResponseEnforcementResponseDataConfigType0
|
||||
condition = self.condition.value
|
||||
|
||||
conditions = self.conditions.to_dict()
|
||||
|
||||
config: dict[str, Any] | None
|
||||
if isinstance(self.config, ApiResponseEnforcementResponseDataConfigType0):
|
||||
config = self.config.to_dict()
|
||||
else:
|
||||
config = self.config
|
||||
|
||||
created = self.created.isoformat()
|
||||
|
||||
id = self.id
|
||||
|
||||
payload = self.payload.to_dict()
|
||||
|
||||
rule_ref = self.rule_ref
|
||||
|
||||
status = self.status.value
|
||||
|
||||
trigger_ref = self.trigger_ref
|
||||
|
||||
updated = self.updated.isoformat()
|
||||
|
||||
event: int | None | Unset
|
||||
if isinstance(self.event, Unset):
|
||||
event = UNSET
|
||||
else:
|
||||
event = self.event
|
||||
|
||||
rule: int | None | Unset
|
||||
if isinstance(self.rule, Unset):
|
||||
rule = UNSET
|
||||
else:
|
||||
rule = self.rule
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"condition": condition,
|
||||
"conditions": conditions,
|
||||
"config": config,
|
||||
"created": created,
|
||||
"id": id,
|
||||
"payload": payload,
|
||||
"rule_ref": rule_ref,
|
||||
"status": status,
|
||||
"trigger_ref": trigger_ref,
|
||||
"updated": updated,
|
||||
})
|
||||
if event is not UNSET:
|
||||
field_dict["event"] = event
|
||||
if rule is not UNSET:
|
||||
field_dict["rule"] = rule
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.api_response_enforcement_response_data_conditions import ApiResponseEnforcementResponseDataConditions
|
||||
from ..models.api_response_enforcement_response_data_config_type_0 import ApiResponseEnforcementResponseDataConfigType0
|
||||
from ..models.api_response_enforcement_response_data_payload import ApiResponseEnforcementResponseDataPayload
|
||||
d = dict(src_dict)
|
||||
condition = EnforcementCondition(d.pop("condition"))
|
||||
|
||||
|
||||
|
||||
|
||||
conditions = ApiResponseEnforcementResponseDataConditions.from_dict(d.pop("conditions"))
|
||||
|
||||
|
||||
|
||||
|
||||
def _parse_config(data: object) -> ApiResponseEnforcementResponseDataConfigType0 | None:
|
||||
if data is None:
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
config_type_0 = ApiResponseEnforcementResponseDataConfigType0.from_dict(data)
|
||||
|
||||
|
||||
|
||||
return config_type_0
|
||||
except (TypeError, ValueError, AttributeError, KeyError):
|
||||
pass
|
||||
return cast(ApiResponseEnforcementResponseDataConfigType0 | None, data)
|
||||
|
||||
config = _parse_config(d.pop("config"))
|
||||
|
||||
|
||||
created = isoparse(d.pop("created"))
|
||||
|
||||
|
||||
|
||||
|
||||
id = d.pop("id")
|
||||
|
||||
payload = ApiResponseEnforcementResponseDataPayload.from_dict(d.pop("payload"))
|
||||
|
||||
|
||||
|
||||
|
||||
rule_ref = d.pop("rule_ref")
|
||||
|
||||
status = EnforcementStatus(d.pop("status"))
|
||||
|
||||
|
||||
|
||||
|
||||
trigger_ref = d.pop("trigger_ref")
|
||||
|
||||
updated = isoparse(d.pop("updated"))
|
||||
|
||||
|
||||
|
||||
|
||||
def _parse_event(data: object) -> int | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(int | None | Unset, data)
|
||||
|
||||
event = _parse_event(d.pop("event", UNSET))
|
||||
|
||||
|
||||
def _parse_rule(data: object) -> int | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(int | None | Unset, data)
|
||||
|
||||
rule = _parse_rule(d.pop("rule", UNSET))
|
||||
|
||||
|
||||
api_response_enforcement_response_data = cls(
|
||||
condition=condition,
|
||||
conditions=conditions,
|
||||
config=config,
|
||||
created=created,
|
||||
id=id,
|
||||
payload=payload,
|
||||
rule_ref=rule_ref,
|
||||
status=status,
|
||||
trigger_ref=trigger_ref,
|
||||
updated=updated,
|
||||
event=event,
|
||||
rule=rule,
|
||||
)
|
||||
|
||||
|
||||
api_response_enforcement_response_data.additional_properties = d
|
||||
return api_response_enforcement_response_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
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseEnforcementResponseDataConditions")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseEnforcementResponseDataConditions:
|
||||
""" Enforcement conditions (rule evaluation criteria)
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
api_response_enforcement_response_data_conditions = cls(
|
||||
)
|
||||
|
||||
|
||||
api_response_enforcement_response_data_conditions.additional_properties = d
|
||||
return api_response_enforcement_response_data_conditions
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseEnforcementResponseDataConfigType0")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseEnforcementResponseDataConfigType0:
|
||||
""" Enforcement configuration
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
api_response_enforcement_response_data_config_type_0 = cls(
|
||||
)
|
||||
|
||||
|
||||
api_response_enforcement_response_data_config_type_0.additional_properties = d
|
||||
return api_response_enforcement_response_data_config_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
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseEnforcementResponseDataPayload")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseEnforcementResponseDataPayload:
|
||||
""" Enforcement payload
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
api_response_enforcement_response_data_payload = cls(
|
||||
)
|
||||
|
||||
|
||||
api_response_enforcement_response_data_payload.additional_properties = d
|
||||
return api_response_enforcement_response_data_payload
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
107
tests/generated_client/models/api_response_event_response.py
Normal file
107
tests/generated_client/models/api_response_event_response.py
Normal file
@@ -0,0 +1,107 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from typing import cast
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.api_response_event_response_data import ApiResponseEventResponseData
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseEventResponse")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseEventResponse:
|
||||
""" Standard API response wrapper
|
||||
|
||||
Attributes:
|
||||
data (ApiResponseEventResponseData): Full event response with all details
|
||||
message (None | str | Unset): Optional message
|
||||
"""
|
||||
|
||||
data: ApiResponseEventResponseData
|
||||
message: None | str | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.api_response_event_response_data import ApiResponseEventResponseData
|
||||
data = self.data.to_dict()
|
||||
|
||||
message: None | str | Unset
|
||||
if isinstance(self.message, Unset):
|
||||
message = UNSET
|
||||
else:
|
||||
message = self.message
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"data": data,
|
||||
})
|
||||
if message is not UNSET:
|
||||
field_dict["message"] = message
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.api_response_event_response_data import ApiResponseEventResponseData
|
||||
d = dict(src_dict)
|
||||
data = ApiResponseEventResponseData.from_dict(d.pop("data"))
|
||||
|
||||
|
||||
|
||||
|
||||
def _parse_message(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
message = _parse_message(d.pop("message", UNSET))
|
||||
|
||||
|
||||
api_response_event_response = cls(
|
||||
data=data,
|
||||
message=message,
|
||||
)
|
||||
|
||||
|
||||
api_response_event_response.additional_properties = d
|
||||
return api_response_event_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
|
||||
@@ -0,0 +1,220 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from dateutil.parser import isoparse
|
||||
from typing import cast
|
||||
import datetime
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.api_response_event_response_data_config_type_0 import ApiResponseEventResponseDataConfigType0
|
||||
from ..models.api_response_event_response_data_payload import ApiResponseEventResponseDataPayload
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseEventResponseData")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseEventResponseData:
|
||||
""" Full event response with all details
|
||||
|
||||
Attributes:
|
||||
config (ApiResponseEventResponseDataConfigType0 | None): Event configuration
|
||||
created (datetime.datetime): Creation timestamp Example: 2024-01-13T10:30:00Z.
|
||||
id (int):
|
||||
payload (ApiResponseEventResponseDataPayload): Event payload data
|
||||
trigger_ref (str): Trigger reference Example: core.webhook.
|
||||
updated (datetime.datetime): Last update timestamp Example: 2024-01-13T10:30:00Z.
|
||||
source (int | None | Unset):
|
||||
source_ref (None | str | Unset): Source reference Example: monitoring.webhook_sensor.
|
||||
trigger (int | None | Unset):
|
||||
"""
|
||||
|
||||
config: ApiResponseEventResponseDataConfigType0 | None
|
||||
created: datetime.datetime
|
||||
id: int
|
||||
payload: ApiResponseEventResponseDataPayload
|
||||
trigger_ref: str
|
||||
updated: datetime.datetime
|
||||
source: int | None | Unset = UNSET
|
||||
source_ref: None | str | Unset = UNSET
|
||||
trigger: int | None | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.api_response_event_response_data_payload import ApiResponseEventResponseDataPayload
|
||||
from ..models.api_response_event_response_data_config_type_0 import ApiResponseEventResponseDataConfigType0
|
||||
config: dict[str, Any] | None
|
||||
if isinstance(self.config, ApiResponseEventResponseDataConfigType0):
|
||||
config = self.config.to_dict()
|
||||
else:
|
||||
config = self.config
|
||||
|
||||
created = self.created.isoformat()
|
||||
|
||||
id = self.id
|
||||
|
||||
payload = self.payload.to_dict()
|
||||
|
||||
trigger_ref = self.trigger_ref
|
||||
|
||||
updated = self.updated.isoformat()
|
||||
|
||||
source: int | None | Unset
|
||||
if isinstance(self.source, Unset):
|
||||
source = UNSET
|
||||
else:
|
||||
source = self.source
|
||||
|
||||
source_ref: None | str | Unset
|
||||
if isinstance(self.source_ref, Unset):
|
||||
source_ref = UNSET
|
||||
else:
|
||||
source_ref = self.source_ref
|
||||
|
||||
trigger: int | None | Unset
|
||||
if isinstance(self.trigger, Unset):
|
||||
trigger = UNSET
|
||||
else:
|
||||
trigger = self.trigger
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"config": config,
|
||||
"created": created,
|
||||
"id": id,
|
||||
"payload": payload,
|
||||
"trigger_ref": trigger_ref,
|
||||
"updated": updated,
|
||||
})
|
||||
if source is not UNSET:
|
||||
field_dict["source"] = source
|
||||
if source_ref is not UNSET:
|
||||
field_dict["source_ref"] = source_ref
|
||||
if trigger is not UNSET:
|
||||
field_dict["trigger"] = trigger
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.api_response_event_response_data_config_type_0 import ApiResponseEventResponseDataConfigType0
|
||||
from ..models.api_response_event_response_data_payload import ApiResponseEventResponseDataPayload
|
||||
d = dict(src_dict)
|
||||
def _parse_config(data: object) -> ApiResponseEventResponseDataConfigType0 | None:
|
||||
if data is None:
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
config_type_0 = ApiResponseEventResponseDataConfigType0.from_dict(data)
|
||||
|
||||
|
||||
|
||||
return config_type_0
|
||||
except (TypeError, ValueError, AttributeError, KeyError):
|
||||
pass
|
||||
return cast(ApiResponseEventResponseDataConfigType0 | None, data)
|
||||
|
||||
config = _parse_config(d.pop("config"))
|
||||
|
||||
|
||||
created = isoparse(d.pop("created"))
|
||||
|
||||
|
||||
|
||||
|
||||
id = d.pop("id")
|
||||
|
||||
payload = ApiResponseEventResponseDataPayload.from_dict(d.pop("payload"))
|
||||
|
||||
|
||||
|
||||
|
||||
trigger_ref = d.pop("trigger_ref")
|
||||
|
||||
updated = isoparse(d.pop("updated"))
|
||||
|
||||
|
||||
|
||||
|
||||
def _parse_source(data: object) -> int | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(int | None | Unset, data)
|
||||
|
||||
source = _parse_source(d.pop("source", UNSET))
|
||||
|
||||
|
||||
def _parse_source_ref(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
source_ref = _parse_source_ref(d.pop("source_ref", UNSET))
|
||||
|
||||
|
||||
def _parse_trigger(data: object) -> int | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(int | None | Unset, data)
|
||||
|
||||
trigger = _parse_trigger(d.pop("trigger", UNSET))
|
||||
|
||||
|
||||
api_response_event_response_data = cls(
|
||||
config=config,
|
||||
created=created,
|
||||
id=id,
|
||||
payload=payload,
|
||||
trigger_ref=trigger_ref,
|
||||
updated=updated,
|
||||
source=source,
|
||||
source_ref=source_ref,
|
||||
trigger=trigger,
|
||||
)
|
||||
|
||||
|
||||
api_response_event_response_data.additional_properties = d
|
||||
return api_response_event_response_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
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseEventResponseDataConfigType0")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseEventResponseDataConfigType0:
|
||||
""" Event configuration
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
api_response_event_response_data_config_type_0 = cls(
|
||||
)
|
||||
|
||||
|
||||
api_response_event_response_data_config_type_0.additional_properties = d
|
||||
return api_response_event_response_data_config_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
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseEventResponseDataPayload")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseEventResponseDataPayload:
|
||||
""" Event payload data
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
api_response_event_response_data_payload = cls(
|
||||
)
|
||||
|
||||
|
||||
api_response_event_response_data_payload.additional_properties = d
|
||||
return api_response_event_response_data_payload
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
107
tests/generated_client/models/api_response_execution_response.py
Normal file
107
tests/generated_client/models/api_response_execution_response.py
Normal file
@@ -0,0 +1,107 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from typing import cast
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.api_response_execution_response_data import ApiResponseExecutionResponseData
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseExecutionResponse")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseExecutionResponse:
|
||||
""" Standard API response wrapper
|
||||
|
||||
Attributes:
|
||||
data (ApiResponseExecutionResponseData): Response DTO for execution information
|
||||
message (None | str | Unset): Optional message
|
||||
"""
|
||||
|
||||
data: ApiResponseExecutionResponseData
|
||||
message: None | str | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.api_response_execution_response_data import ApiResponseExecutionResponseData
|
||||
data = self.data.to_dict()
|
||||
|
||||
message: None | str | Unset
|
||||
if isinstance(self.message, Unset):
|
||||
message = UNSET
|
||||
else:
|
||||
message = self.message
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"data": data,
|
||||
})
|
||||
if message is not UNSET:
|
||||
field_dict["message"] = message
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.api_response_execution_response_data import ApiResponseExecutionResponseData
|
||||
d = dict(src_dict)
|
||||
data = ApiResponseExecutionResponseData.from_dict(d.pop("data"))
|
||||
|
||||
|
||||
|
||||
|
||||
def _parse_message(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
message = _parse_message(d.pop("message", UNSET))
|
||||
|
||||
|
||||
api_response_execution_response = cls(
|
||||
data=data,
|
||||
message=message,
|
||||
)
|
||||
|
||||
|
||||
api_response_execution_response.additional_properties = d
|
||||
return api_response_execution_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
|
||||
@@ -0,0 +1,236 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..models.execution_status import ExecutionStatus
|
||||
from ..types import UNSET, Unset
|
||||
from dateutil.parser import isoparse
|
||||
from typing import cast
|
||||
import datetime
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.api_response_execution_response_data_config import ApiResponseExecutionResponseDataConfig
|
||||
from ..models.api_response_execution_response_data_result import ApiResponseExecutionResponseDataResult
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseExecutionResponseData")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseExecutionResponseData:
|
||||
""" Response DTO for execution information
|
||||
|
||||
Attributes:
|
||||
action_ref (str): Action reference Example: slack.post_message.
|
||||
config (ApiResponseExecutionResponseDataConfig): Execution configuration/parameters
|
||||
created (datetime.datetime): Creation timestamp Example: 2024-01-13T10:30:00Z.
|
||||
id (int): Execution ID Example: 1.
|
||||
result (ApiResponseExecutionResponseDataResult): Execution result/output
|
||||
status (ExecutionStatus):
|
||||
updated (datetime.datetime): Last update timestamp Example: 2024-01-13T10:35:00Z.
|
||||
action (int | None | Unset): Action ID (optional, may be null for ad-hoc executions) Example: 1.
|
||||
enforcement (int | None | Unset): Enforcement ID (rule enforcement that triggered this) Example: 1.
|
||||
executor (int | None | Unset): Executor ID (worker/executor that ran this) Example: 1.
|
||||
parent (int | None | Unset): Parent execution ID (for nested/child executions) Example: 1.
|
||||
"""
|
||||
|
||||
action_ref: str
|
||||
config: ApiResponseExecutionResponseDataConfig
|
||||
created: datetime.datetime
|
||||
id: int
|
||||
result: ApiResponseExecutionResponseDataResult
|
||||
status: ExecutionStatus
|
||||
updated: datetime.datetime
|
||||
action: int | None | Unset = UNSET
|
||||
enforcement: int | None | Unset = UNSET
|
||||
executor: int | None | Unset = UNSET
|
||||
parent: int | None | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.api_response_execution_response_data_config import ApiResponseExecutionResponseDataConfig
|
||||
from ..models.api_response_execution_response_data_result import ApiResponseExecutionResponseDataResult
|
||||
action_ref = self.action_ref
|
||||
|
||||
config = self.config.to_dict()
|
||||
|
||||
created = self.created.isoformat()
|
||||
|
||||
id = self.id
|
||||
|
||||
result = self.result.to_dict()
|
||||
|
||||
status = self.status.value
|
||||
|
||||
updated = self.updated.isoformat()
|
||||
|
||||
action: int | None | Unset
|
||||
if isinstance(self.action, Unset):
|
||||
action = UNSET
|
||||
else:
|
||||
action = self.action
|
||||
|
||||
enforcement: int | None | Unset
|
||||
if isinstance(self.enforcement, Unset):
|
||||
enforcement = UNSET
|
||||
else:
|
||||
enforcement = self.enforcement
|
||||
|
||||
executor: int | None | Unset
|
||||
if isinstance(self.executor, Unset):
|
||||
executor = UNSET
|
||||
else:
|
||||
executor = self.executor
|
||||
|
||||
parent: int | None | Unset
|
||||
if isinstance(self.parent, Unset):
|
||||
parent = UNSET
|
||||
else:
|
||||
parent = self.parent
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"action_ref": action_ref,
|
||||
"config": config,
|
||||
"created": created,
|
||||
"id": id,
|
||||
"result": result,
|
||||
"status": status,
|
||||
"updated": updated,
|
||||
})
|
||||
if action is not UNSET:
|
||||
field_dict["action"] = action
|
||||
if enforcement is not UNSET:
|
||||
field_dict["enforcement"] = enforcement
|
||||
if executor is not UNSET:
|
||||
field_dict["executor"] = executor
|
||||
if parent is not UNSET:
|
||||
field_dict["parent"] = parent
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.api_response_execution_response_data_config import ApiResponseExecutionResponseDataConfig
|
||||
from ..models.api_response_execution_response_data_result import ApiResponseExecutionResponseDataResult
|
||||
d = dict(src_dict)
|
||||
action_ref = d.pop("action_ref")
|
||||
|
||||
config = ApiResponseExecutionResponseDataConfig.from_dict(d.pop("config"))
|
||||
|
||||
|
||||
|
||||
|
||||
created = isoparse(d.pop("created"))
|
||||
|
||||
|
||||
|
||||
|
||||
id = d.pop("id")
|
||||
|
||||
result = ApiResponseExecutionResponseDataResult.from_dict(d.pop("result"))
|
||||
|
||||
|
||||
|
||||
|
||||
status = ExecutionStatus(d.pop("status"))
|
||||
|
||||
|
||||
|
||||
|
||||
updated = isoparse(d.pop("updated"))
|
||||
|
||||
|
||||
|
||||
|
||||
def _parse_action(data: object) -> int | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(int | None | Unset, data)
|
||||
|
||||
action = _parse_action(d.pop("action", UNSET))
|
||||
|
||||
|
||||
def _parse_enforcement(data: object) -> int | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(int | None | Unset, data)
|
||||
|
||||
enforcement = _parse_enforcement(d.pop("enforcement", UNSET))
|
||||
|
||||
|
||||
def _parse_executor(data: object) -> int | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(int | None | Unset, data)
|
||||
|
||||
executor = _parse_executor(d.pop("executor", UNSET))
|
||||
|
||||
|
||||
def _parse_parent(data: object) -> int | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(int | None | Unset, data)
|
||||
|
||||
parent = _parse_parent(d.pop("parent", UNSET))
|
||||
|
||||
|
||||
api_response_execution_response_data = cls(
|
||||
action_ref=action_ref,
|
||||
config=config,
|
||||
created=created,
|
||||
id=id,
|
||||
result=result,
|
||||
status=status,
|
||||
updated=updated,
|
||||
action=action,
|
||||
enforcement=enforcement,
|
||||
executor=executor,
|
||||
parent=parent,
|
||||
)
|
||||
|
||||
|
||||
api_response_execution_response_data.additional_properties = d
|
||||
return api_response_execution_response_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
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseExecutionResponseDataConfig")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseExecutionResponseDataConfig:
|
||||
""" Execution configuration/parameters
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
api_response_execution_response_data_config = cls(
|
||||
)
|
||||
|
||||
|
||||
api_response_execution_response_data_config.additional_properties = d
|
||||
return api_response_execution_response_data_config
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseExecutionResponseDataResult")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseExecutionResponseDataResult:
|
||||
""" Execution result/output
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
api_response_execution_response_data_result = cls(
|
||||
)
|
||||
|
||||
|
||||
api_response_execution_response_data_result.additional_properties = d
|
||||
return api_response_execution_response_data_result
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
107
tests/generated_client/models/api_response_inquiry_response.py
Normal file
107
tests/generated_client/models/api_response_inquiry_response.py
Normal file
@@ -0,0 +1,107 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from typing import cast
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.api_response_inquiry_response_data import ApiResponseInquiryResponseData
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseInquiryResponse")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseInquiryResponse:
|
||||
""" Standard API response wrapper
|
||||
|
||||
Attributes:
|
||||
data (ApiResponseInquiryResponseData): Full inquiry response with all details
|
||||
message (None | str | Unset): Optional message
|
||||
"""
|
||||
|
||||
data: ApiResponseInquiryResponseData
|
||||
message: None | str | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.api_response_inquiry_response_data import ApiResponseInquiryResponseData
|
||||
data = self.data.to_dict()
|
||||
|
||||
message: None | str | Unset
|
||||
if isinstance(self.message, Unset):
|
||||
message = UNSET
|
||||
else:
|
||||
message = self.message
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"data": data,
|
||||
})
|
||||
if message is not UNSET:
|
||||
field_dict["message"] = message
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.api_response_inquiry_response_data import ApiResponseInquiryResponseData
|
||||
d = dict(src_dict)
|
||||
data = ApiResponseInquiryResponseData.from_dict(d.pop("data"))
|
||||
|
||||
|
||||
|
||||
|
||||
def _parse_message(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
message = _parse_message(d.pop("message", UNSET))
|
||||
|
||||
|
||||
api_response_inquiry_response = cls(
|
||||
data=data,
|
||||
message=message,
|
||||
)
|
||||
|
||||
|
||||
api_response_inquiry_response.additional_properties = d
|
||||
return api_response_inquiry_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
|
||||
@@ -0,0 +1,282 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..models.inquiry_status import InquiryStatus
|
||||
from ..types import UNSET, Unset
|
||||
from dateutil.parser import isoparse
|
||||
from typing import cast
|
||||
import datetime
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.api_response_inquiry_response_data_response_schema_type_0 import ApiResponseInquiryResponseDataResponseSchemaType0
|
||||
from ..models.api_response_inquiry_response_data_response_type_0 import ApiResponseInquiryResponseDataResponseType0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseInquiryResponseData")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseInquiryResponseData:
|
||||
""" Full inquiry response with all details
|
||||
|
||||
Attributes:
|
||||
created (datetime.datetime): Creation timestamp Example: 2024-01-13T10:30:00Z.
|
||||
execution (int):
|
||||
id (int):
|
||||
prompt (str): Prompt text displayed to the user Example: Approve deployment to production?.
|
||||
response (ApiResponseInquiryResponseDataResponseType0 | None): Response data provided by the user
|
||||
response_schema (ApiResponseInquiryResponseDataResponseSchemaType0 | None): JSON schema for expected response
|
||||
status (InquiryStatus):
|
||||
updated (datetime.datetime): Last update timestamp Example: 2024-01-13T10:45:00Z.
|
||||
assigned_to (int | None | Unset):
|
||||
responded_at (datetime.datetime | None | Unset): When the inquiry was responded to Example:
|
||||
2024-01-13T10:45:00Z.
|
||||
timeout_at (datetime.datetime | None | Unset): When the inquiry expires Example: 2024-01-13T11:30:00Z.
|
||||
"""
|
||||
|
||||
created: datetime.datetime
|
||||
execution: int
|
||||
id: int
|
||||
prompt: str
|
||||
response: ApiResponseInquiryResponseDataResponseType0 | None
|
||||
response_schema: ApiResponseInquiryResponseDataResponseSchemaType0 | None
|
||||
status: InquiryStatus
|
||||
updated: datetime.datetime
|
||||
assigned_to: int | None | Unset = UNSET
|
||||
responded_at: datetime.datetime | None | Unset = UNSET
|
||||
timeout_at: datetime.datetime | None | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.api_response_inquiry_response_data_response_type_0 import ApiResponseInquiryResponseDataResponseType0
|
||||
from ..models.api_response_inquiry_response_data_response_schema_type_0 import ApiResponseInquiryResponseDataResponseSchemaType0
|
||||
created = self.created.isoformat()
|
||||
|
||||
execution = self.execution
|
||||
|
||||
id = self.id
|
||||
|
||||
prompt = self.prompt
|
||||
|
||||
response: dict[str, Any] | None
|
||||
if isinstance(self.response, ApiResponseInquiryResponseDataResponseType0):
|
||||
response = self.response.to_dict()
|
||||
else:
|
||||
response = self.response
|
||||
|
||||
response_schema: dict[str, Any] | None
|
||||
if isinstance(self.response_schema, ApiResponseInquiryResponseDataResponseSchemaType0):
|
||||
response_schema = self.response_schema.to_dict()
|
||||
else:
|
||||
response_schema = self.response_schema
|
||||
|
||||
status = self.status.value
|
||||
|
||||
updated = self.updated.isoformat()
|
||||
|
||||
assigned_to: int | None | Unset
|
||||
if isinstance(self.assigned_to, Unset):
|
||||
assigned_to = UNSET
|
||||
else:
|
||||
assigned_to = self.assigned_to
|
||||
|
||||
responded_at: None | str | Unset
|
||||
if isinstance(self.responded_at, Unset):
|
||||
responded_at = UNSET
|
||||
elif isinstance(self.responded_at, datetime.datetime):
|
||||
responded_at = self.responded_at.isoformat()
|
||||
else:
|
||||
responded_at = self.responded_at
|
||||
|
||||
timeout_at: None | str | Unset
|
||||
if isinstance(self.timeout_at, Unset):
|
||||
timeout_at = UNSET
|
||||
elif isinstance(self.timeout_at, datetime.datetime):
|
||||
timeout_at = self.timeout_at.isoformat()
|
||||
else:
|
||||
timeout_at = self.timeout_at
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"created": created,
|
||||
"execution": execution,
|
||||
"id": id,
|
||||
"prompt": prompt,
|
||||
"response": response,
|
||||
"response_schema": response_schema,
|
||||
"status": status,
|
||||
"updated": updated,
|
||||
})
|
||||
if assigned_to is not UNSET:
|
||||
field_dict["assigned_to"] = assigned_to
|
||||
if responded_at is not UNSET:
|
||||
field_dict["responded_at"] = responded_at
|
||||
if timeout_at is not UNSET:
|
||||
field_dict["timeout_at"] = timeout_at
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.api_response_inquiry_response_data_response_schema_type_0 import ApiResponseInquiryResponseDataResponseSchemaType0
|
||||
from ..models.api_response_inquiry_response_data_response_type_0 import ApiResponseInquiryResponseDataResponseType0
|
||||
d = dict(src_dict)
|
||||
created = isoparse(d.pop("created"))
|
||||
|
||||
|
||||
|
||||
|
||||
execution = d.pop("execution")
|
||||
|
||||
id = d.pop("id")
|
||||
|
||||
prompt = d.pop("prompt")
|
||||
|
||||
def _parse_response(data: object) -> ApiResponseInquiryResponseDataResponseType0 | None:
|
||||
if data is None:
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
response_type_0 = ApiResponseInquiryResponseDataResponseType0.from_dict(data)
|
||||
|
||||
|
||||
|
||||
return response_type_0
|
||||
except (TypeError, ValueError, AttributeError, KeyError):
|
||||
pass
|
||||
return cast(ApiResponseInquiryResponseDataResponseType0 | None, data)
|
||||
|
||||
response = _parse_response(d.pop("response"))
|
||||
|
||||
|
||||
def _parse_response_schema(data: object) -> ApiResponseInquiryResponseDataResponseSchemaType0 | None:
|
||||
if data is None:
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
response_schema_type_0 = ApiResponseInquiryResponseDataResponseSchemaType0.from_dict(data)
|
||||
|
||||
|
||||
|
||||
return response_schema_type_0
|
||||
except (TypeError, ValueError, AttributeError, KeyError):
|
||||
pass
|
||||
return cast(ApiResponseInquiryResponseDataResponseSchemaType0 | None, data)
|
||||
|
||||
response_schema = _parse_response_schema(d.pop("response_schema"))
|
||||
|
||||
|
||||
status = InquiryStatus(d.pop("status"))
|
||||
|
||||
|
||||
|
||||
|
||||
updated = isoparse(d.pop("updated"))
|
||||
|
||||
|
||||
|
||||
|
||||
def _parse_assigned_to(data: object) -> int | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(int | None | Unset, data)
|
||||
|
||||
assigned_to = _parse_assigned_to(d.pop("assigned_to", UNSET))
|
||||
|
||||
|
||||
def _parse_responded_at(data: object) -> datetime.datetime | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, str):
|
||||
raise TypeError()
|
||||
responded_at_type_0 = isoparse(data)
|
||||
|
||||
|
||||
|
||||
return responded_at_type_0
|
||||
except (TypeError, ValueError, AttributeError, KeyError):
|
||||
pass
|
||||
return cast(datetime.datetime | None | Unset, data)
|
||||
|
||||
responded_at = _parse_responded_at(d.pop("responded_at", UNSET))
|
||||
|
||||
|
||||
def _parse_timeout_at(data: object) -> datetime.datetime | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, str):
|
||||
raise TypeError()
|
||||
timeout_at_type_0 = isoparse(data)
|
||||
|
||||
|
||||
|
||||
return timeout_at_type_0
|
||||
except (TypeError, ValueError, AttributeError, KeyError):
|
||||
pass
|
||||
return cast(datetime.datetime | None | Unset, data)
|
||||
|
||||
timeout_at = _parse_timeout_at(d.pop("timeout_at", UNSET))
|
||||
|
||||
|
||||
api_response_inquiry_response_data = cls(
|
||||
created=created,
|
||||
execution=execution,
|
||||
id=id,
|
||||
prompt=prompt,
|
||||
response=response,
|
||||
response_schema=response_schema,
|
||||
status=status,
|
||||
updated=updated,
|
||||
assigned_to=assigned_to,
|
||||
responded_at=responded_at,
|
||||
timeout_at=timeout_at,
|
||||
)
|
||||
|
||||
|
||||
api_response_inquiry_response_data.additional_properties = d
|
||||
return api_response_inquiry_response_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
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseInquiryResponseDataResponseSchemaType0")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseInquiryResponseDataResponseSchemaType0:
|
||||
""" JSON schema for expected response
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
api_response_inquiry_response_data_response_schema_type_0 = cls(
|
||||
)
|
||||
|
||||
|
||||
api_response_inquiry_response_data_response_schema_type_0.additional_properties = d
|
||||
return api_response_inquiry_response_data_response_schema_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
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseInquiryResponseDataResponseType0")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseInquiryResponseDataResponseType0:
|
||||
""" Response data provided by the user
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
api_response_inquiry_response_data_response_type_0 = cls(
|
||||
)
|
||||
|
||||
|
||||
api_response_inquiry_response_data_response_type_0.additional_properties = d
|
||||
return api_response_inquiry_response_data_response_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
|
||||
107
tests/generated_client/models/api_response_key_response.py
Normal file
107
tests/generated_client/models/api_response_key_response.py
Normal file
@@ -0,0 +1,107 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from typing import cast
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.api_response_key_response_data import ApiResponseKeyResponseData
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseKeyResponse")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseKeyResponse:
|
||||
""" Standard API response wrapper
|
||||
|
||||
Attributes:
|
||||
data (ApiResponseKeyResponseData): Full key response with all details (value redacted in list views)
|
||||
message (None | str | Unset): Optional message
|
||||
"""
|
||||
|
||||
data: ApiResponseKeyResponseData
|
||||
message: None | str | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.api_response_key_response_data import ApiResponseKeyResponseData
|
||||
data = self.data.to_dict()
|
||||
|
||||
message: None | str | Unset
|
||||
if isinstance(self.message, Unset):
|
||||
message = UNSET
|
||||
else:
|
||||
message = self.message
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"data": data,
|
||||
})
|
||||
if message is not UNSET:
|
||||
field_dict["message"] = message
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.api_response_key_response_data import ApiResponseKeyResponseData
|
||||
d = dict(src_dict)
|
||||
data = ApiResponseKeyResponseData.from_dict(d.pop("data"))
|
||||
|
||||
|
||||
|
||||
|
||||
def _parse_message(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
message = _parse_message(d.pop("message", UNSET))
|
||||
|
||||
|
||||
api_response_key_response = cls(
|
||||
data=data,
|
||||
message=message,
|
||||
)
|
||||
|
||||
|
||||
api_response_key_response.additional_properties = d
|
||||
return api_response_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
|
||||
315
tests/generated_client/models/api_response_key_response_data.py
Normal file
315
tests/generated_client/models/api_response_key_response_data.py
Normal file
@@ -0,0 +1,315 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..models.owner_type import OwnerType
|
||||
from ..types import UNSET, Unset
|
||||
from dateutil.parser import isoparse
|
||||
from typing import cast
|
||||
import datetime
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseKeyResponseData")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseKeyResponseData:
|
||||
""" Full key response with all details (value redacted in list views)
|
||||
|
||||
Attributes:
|
||||
created (datetime.datetime): Creation timestamp Example: 2024-01-13T10:30:00Z.
|
||||
encrypted (bool): Whether the value is encrypted Example: True.
|
||||
id (int):
|
||||
name (str): Human-readable name Example: GitHub API Token.
|
||||
owner_type (OwnerType):
|
||||
ref (str): Unique reference identifier Example: github_token.
|
||||
updated (datetime.datetime): Last update timestamp Example: 2024-01-13T10:30:00Z.
|
||||
value (str): The secret value (decrypted if encrypted) Example: ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
|
||||
owner (None | str | Unset): Owner identifier Example: github-integration.
|
||||
owner_action (int | None | Unset):
|
||||
owner_action_ref (None | str | Unset): Owner action reference Example: github.create_issue.
|
||||
owner_identity (int | None | Unset):
|
||||
owner_pack (int | None | Unset):
|
||||
owner_pack_ref (None | str | Unset): Owner pack reference Example: github.
|
||||
owner_sensor (int | None | Unset):
|
||||
owner_sensor_ref (None | str | Unset): Owner sensor reference Example: github.webhook.
|
||||
"""
|
||||
|
||||
created: datetime.datetime
|
||||
encrypted: bool
|
||||
id: int
|
||||
name: str
|
||||
owner_type: OwnerType
|
||||
ref: str
|
||||
updated: datetime.datetime
|
||||
value: str
|
||||
owner: None | str | Unset = UNSET
|
||||
owner_action: int | None | Unset = UNSET
|
||||
owner_action_ref: None | str | Unset = UNSET
|
||||
owner_identity: int | None | Unset = UNSET
|
||||
owner_pack: int | None | Unset = UNSET
|
||||
owner_pack_ref: None | str | Unset = UNSET
|
||||
owner_sensor: int | None | Unset = UNSET
|
||||
owner_sensor_ref: None | str | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
created = self.created.isoformat()
|
||||
|
||||
encrypted = self.encrypted
|
||||
|
||||
id = self.id
|
||||
|
||||
name = self.name
|
||||
|
||||
owner_type = self.owner_type.value
|
||||
|
||||
ref = self.ref
|
||||
|
||||
updated = self.updated.isoformat()
|
||||
|
||||
value = self.value
|
||||
|
||||
owner: None | str | Unset
|
||||
if isinstance(self.owner, Unset):
|
||||
owner = UNSET
|
||||
else:
|
||||
owner = self.owner
|
||||
|
||||
owner_action: int | None | Unset
|
||||
if isinstance(self.owner_action, Unset):
|
||||
owner_action = UNSET
|
||||
else:
|
||||
owner_action = self.owner_action
|
||||
|
||||
owner_action_ref: None | str | Unset
|
||||
if isinstance(self.owner_action_ref, Unset):
|
||||
owner_action_ref = UNSET
|
||||
else:
|
||||
owner_action_ref = self.owner_action_ref
|
||||
|
||||
owner_identity: int | None | Unset
|
||||
if isinstance(self.owner_identity, Unset):
|
||||
owner_identity = UNSET
|
||||
else:
|
||||
owner_identity = self.owner_identity
|
||||
|
||||
owner_pack: int | None | Unset
|
||||
if isinstance(self.owner_pack, Unset):
|
||||
owner_pack = UNSET
|
||||
else:
|
||||
owner_pack = self.owner_pack
|
||||
|
||||
owner_pack_ref: None | str | Unset
|
||||
if isinstance(self.owner_pack_ref, Unset):
|
||||
owner_pack_ref = UNSET
|
||||
else:
|
||||
owner_pack_ref = self.owner_pack_ref
|
||||
|
||||
owner_sensor: int | None | Unset
|
||||
if isinstance(self.owner_sensor, Unset):
|
||||
owner_sensor = UNSET
|
||||
else:
|
||||
owner_sensor = self.owner_sensor
|
||||
|
||||
owner_sensor_ref: None | str | Unset
|
||||
if isinstance(self.owner_sensor_ref, Unset):
|
||||
owner_sensor_ref = UNSET
|
||||
else:
|
||||
owner_sensor_ref = self.owner_sensor_ref
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"created": created,
|
||||
"encrypted": encrypted,
|
||||
"id": id,
|
||||
"name": name,
|
||||
"owner_type": owner_type,
|
||||
"ref": ref,
|
||||
"updated": updated,
|
||||
"value": value,
|
||||
})
|
||||
if owner is not UNSET:
|
||||
field_dict["owner"] = owner
|
||||
if owner_action is not UNSET:
|
||||
field_dict["owner_action"] = owner_action
|
||||
if owner_action_ref is not UNSET:
|
||||
field_dict["owner_action_ref"] = owner_action_ref
|
||||
if owner_identity is not UNSET:
|
||||
field_dict["owner_identity"] = owner_identity
|
||||
if owner_pack is not UNSET:
|
||||
field_dict["owner_pack"] = owner_pack
|
||||
if owner_pack_ref is not UNSET:
|
||||
field_dict["owner_pack_ref"] = owner_pack_ref
|
||||
if owner_sensor is not UNSET:
|
||||
field_dict["owner_sensor"] = owner_sensor
|
||||
if owner_sensor_ref is not UNSET:
|
||||
field_dict["owner_sensor_ref"] = owner_sensor_ref
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
created = isoparse(d.pop("created"))
|
||||
|
||||
|
||||
|
||||
|
||||
encrypted = d.pop("encrypted")
|
||||
|
||||
id = d.pop("id")
|
||||
|
||||
name = d.pop("name")
|
||||
|
||||
owner_type = OwnerType(d.pop("owner_type"))
|
||||
|
||||
|
||||
|
||||
|
||||
ref = d.pop("ref")
|
||||
|
||||
updated = isoparse(d.pop("updated"))
|
||||
|
||||
|
||||
|
||||
|
||||
value = d.pop("value")
|
||||
|
||||
def _parse_owner(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
owner = _parse_owner(d.pop("owner", UNSET))
|
||||
|
||||
|
||||
def _parse_owner_action(data: object) -> int | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(int | None | Unset, data)
|
||||
|
||||
owner_action = _parse_owner_action(d.pop("owner_action", UNSET))
|
||||
|
||||
|
||||
def _parse_owner_action_ref(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
owner_action_ref = _parse_owner_action_ref(d.pop("owner_action_ref", UNSET))
|
||||
|
||||
|
||||
def _parse_owner_identity(data: object) -> int | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(int | None | Unset, data)
|
||||
|
||||
owner_identity = _parse_owner_identity(d.pop("owner_identity", UNSET))
|
||||
|
||||
|
||||
def _parse_owner_pack(data: object) -> int | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(int | None | Unset, data)
|
||||
|
||||
owner_pack = _parse_owner_pack(d.pop("owner_pack", UNSET))
|
||||
|
||||
|
||||
def _parse_owner_pack_ref(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
owner_pack_ref = _parse_owner_pack_ref(d.pop("owner_pack_ref", UNSET))
|
||||
|
||||
|
||||
def _parse_owner_sensor(data: object) -> int | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(int | None | Unset, data)
|
||||
|
||||
owner_sensor = _parse_owner_sensor(d.pop("owner_sensor", UNSET))
|
||||
|
||||
|
||||
def _parse_owner_sensor_ref(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
owner_sensor_ref = _parse_owner_sensor_ref(d.pop("owner_sensor_ref", UNSET))
|
||||
|
||||
|
||||
api_response_key_response_data = cls(
|
||||
created=created,
|
||||
encrypted=encrypted,
|
||||
id=id,
|
||||
name=name,
|
||||
owner_type=owner_type,
|
||||
ref=ref,
|
||||
updated=updated,
|
||||
value=value,
|
||||
owner=owner,
|
||||
owner_action=owner_action,
|
||||
owner_action_ref=owner_action_ref,
|
||||
owner_identity=owner_identity,
|
||||
owner_pack=owner_pack,
|
||||
owner_pack_ref=owner_pack_ref,
|
||||
owner_sensor=owner_sensor,
|
||||
owner_sensor_ref=owner_sensor_ref,
|
||||
)
|
||||
|
||||
|
||||
api_response_key_response_data.additional_properties = d
|
||||
return api_response_key_response_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
|
||||
@@ -0,0 +1,107 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from typing import cast
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.api_response_pack_install_response_data import ApiResponsePackInstallResponseData
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponsePackInstallResponse")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponsePackInstallResponse:
|
||||
""" Standard API response wrapper
|
||||
|
||||
Attributes:
|
||||
data (ApiResponsePackInstallResponseData): Response for pack install/register operations with test results
|
||||
message (None | str | Unset): Optional message
|
||||
"""
|
||||
|
||||
data: ApiResponsePackInstallResponseData
|
||||
message: None | str | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.api_response_pack_install_response_data import ApiResponsePackInstallResponseData
|
||||
data = self.data.to_dict()
|
||||
|
||||
message: None | str | Unset
|
||||
if isinstance(self.message, Unset):
|
||||
message = UNSET
|
||||
else:
|
||||
message = self.message
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"data": data,
|
||||
})
|
||||
if message is not UNSET:
|
||||
field_dict["message"] = message
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.api_response_pack_install_response_data import ApiResponsePackInstallResponseData
|
||||
d = dict(src_dict)
|
||||
data = ApiResponsePackInstallResponseData.from_dict(d.pop("data"))
|
||||
|
||||
|
||||
|
||||
|
||||
def _parse_message(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
message = _parse_message(d.pop("message", UNSET))
|
||||
|
||||
|
||||
api_response_pack_install_response = cls(
|
||||
data=data,
|
||||
message=message,
|
||||
)
|
||||
|
||||
|
||||
api_response_pack_install_response.additional_properties = d
|
||||
return api_response_pack_install_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
|
||||
@@ -0,0 +1,130 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from typing import cast
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.pack_response import PackResponse
|
||||
from ..models.pack_test_result import PackTestResult
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponsePackInstallResponseData")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponsePackInstallResponseData:
|
||||
""" Response for pack install/register operations with test results
|
||||
|
||||
Attributes:
|
||||
pack (PackResponse): Response DTO for pack information
|
||||
tests_skipped (bool): Whether tests were skipped
|
||||
test_result (None | PackTestResult | Unset):
|
||||
"""
|
||||
|
||||
pack: PackResponse
|
||||
tests_skipped: bool
|
||||
test_result: None | PackTestResult | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.pack_test_result import PackTestResult
|
||||
from ..models.pack_response import PackResponse
|
||||
pack = self.pack.to_dict()
|
||||
|
||||
tests_skipped = self.tests_skipped
|
||||
|
||||
test_result: dict[str, Any] | None | Unset
|
||||
if isinstance(self.test_result, Unset):
|
||||
test_result = UNSET
|
||||
elif isinstance(self.test_result, PackTestResult):
|
||||
test_result = self.test_result.to_dict()
|
||||
else:
|
||||
test_result = self.test_result
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"pack": pack,
|
||||
"tests_skipped": tests_skipped,
|
||||
})
|
||||
if test_result is not UNSET:
|
||||
field_dict["test_result"] = test_result
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.pack_response import PackResponse
|
||||
from ..models.pack_test_result import PackTestResult
|
||||
d = dict(src_dict)
|
||||
pack = PackResponse.from_dict(d.pop("pack"))
|
||||
|
||||
|
||||
|
||||
|
||||
tests_skipped = d.pop("tests_skipped")
|
||||
|
||||
def _parse_test_result(data: object) -> None | PackTestResult | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
test_result_type_1 = PackTestResult.from_dict(data)
|
||||
|
||||
|
||||
|
||||
return test_result_type_1
|
||||
except (TypeError, ValueError, AttributeError, KeyError):
|
||||
pass
|
||||
return cast(None | PackTestResult | Unset, data)
|
||||
|
||||
test_result = _parse_test_result(d.pop("test_result", UNSET))
|
||||
|
||||
|
||||
api_response_pack_install_response_data = cls(
|
||||
pack=pack,
|
||||
tests_skipped=tests_skipped,
|
||||
test_result=test_result,
|
||||
)
|
||||
|
||||
|
||||
api_response_pack_install_response_data.additional_properties = d
|
||||
return api_response_pack_install_response_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
|
||||
107
tests/generated_client/models/api_response_pack_response.py
Normal file
107
tests/generated_client/models/api_response_pack_response.py
Normal file
@@ -0,0 +1,107 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from typing import cast
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.api_response_pack_response_data import ApiResponsePackResponseData
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponsePackResponse")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponsePackResponse:
|
||||
""" Standard API response wrapper
|
||||
|
||||
Attributes:
|
||||
data (ApiResponsePackResponseData): Response DTO for pack information
|
||||
message (None | str | Unset): Optional message
|
||||
"""
|
||||
|
||||
data: ApiResponsePackResponseData
|
||||
message: None | str | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.api_response_pack_response_data import ApiResponsePackResponseData
|
||||
data = self.data.to_dict()
|
||||
|
||||
message: None | str | Unset
|
||||
if isinstance(self.message, Unset):
|
||||
message = UNSET
|
||||
else:
|
||||
message = self.message
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"data": data,
|
||||
})
|
||||
if message is not UNSET:
|
||||
field_dict["message"] = message
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.api_response_pack_response_data import ApiResponsePackResponseData
|
||||
d = dict(src_dict)
|
||||
data = ApiResponsePackResponseData.from_dict(d.pop("data"))
|
||||
|
||||
|
||||
|
||||
|
||||
def _parse_message(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
message = _parse_message(d.pop("message", UNSET))
|
||||
|
||||
|
||||
api_response_pack_response = cls(
|
||||
data=data,
|
||||
message=message,
|
||||
)
|
||||
|
||||
|
||||
api_response_pack_response.additional_properties = d
|
||||
return api_response_pack_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
|
||||
222
tests/generated_client/models/api_response_pack_response_data.py
Normal file
222
tests/generated_client/models/api_response_pack_response_data.py
Normal file
@@ -0,0 +1,222 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from dateutil.parser import isoparse
|
||||
from typing import cast
|
||||
import datetime
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.api_response_pack_response_data_conf_schema import ApiResponsePackResponseDataConfSchema
|
||||
from ..models.api_response_pack_response_data_config import ApiResponsePackResponseDataConfig
|
||||
from ..models.api_response_pack_response_data_meta import ApiResponsePackResponseDataMeta
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponsePackResponseData")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponsePackResponseData:
|
||||
""" Response DTO for pack information
|
||||
|
||||
Attributes:
|
||||
conf_schema (ApiResponsePackResponseDataConfSchema): Configuration schema
|
||||
config (ApiResponsePackResponseDataConfig): Pack configuration
|
||||
created (datetime.datetime): Creation timestamp Example: 2024-01-13T10:30:00Z.
|
||||
id (int): Pack ID Example: 1.
|
||||
is_standard (bool): Is standard pack
|
||||
label (str): Human-readable label Example: Slack Integration.
|
||||
meta (ApiResponsePackResponseDataMeta): Pack metadata
|
||||
ref (str): Unique reference identifier Example: slack.
|
||||
runtime_deps (list[str]): Runtime dependencies Example: ['core'].
|
||||
tags (list[str]): Tags Example: ['messaging', 'collaboration'].
|
||||
updated (datetime.datetime): Last update timestamp Example: 2024-01-13T10:30:00Z.
|
||||
version (str): Pack version Example: 1.0.0.
|
||||
description (None | str | Unset): Pack description Example: Integration with Slack for messaging and
|
||||
notifications.
|
||||
"""
|
||||
|
||||
conf_schema: ApiResponsePackResponseDataConfSchema
|
||||
config: ApiResponsePackResponseDataConfig
|
||||
created: datetime.datetime
|
||||
id: int
|
||||
is_standard: bool
|
||||
label: str
|
||||
meta: ApiResponsePackResponseDataMeta
|
||||
ref: str
|
||||
runtime_deps: list[str]
|
||||
tags: list[str]
|
||||
updated: datetime.datetime
|
||||
version: str
|
||||
description: None | str | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.api_response_pack_response_data_config import ApiResponsePackResponseDataConfig
|
||||
from ..models.api_response_pack_response_data_meta import ApiResponsePackResponseDataMeta
|
||||
from ..models.api_response_pack_response_data_conf_schema import ApiResponsePackResponseDataConfSchema
|
||||
conf_schema = self.conf_schema.to_dict()
|
||||
|
||||
config = self.config.to_dict()
|
||||
|
||||
created = self.created.isoformat()
|
||||
|
||||
id = self.id
|
||||
|
||||
is_standard = self.is_standard
|
||||
|
||||
label = self.label
|
||||
|
||||
meta = self.meta.to_dict()
|
||||
|
||||
ref = self.ref
|
||||
|
||||
runtime_deps = self.runtime_deps
|
||||
|
||||
|
||||
|
||||
tags = self.tags
|
||||
|
||||
|
||||
|
||||
updated = self.updated.isoformat()
|
||||
|
||||
version = self.version
|
||||
|
||||
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({
|
||||
"conf_schema": conf_schema,
|
||||
"config": config,
|
||||
"created": created,
|
||||
"id": id,
|
||||
"is_standard": is_standard,
|
||||
"label": label,
|
||||
"meta": meta,
|
||||
"ref": ref,
|
||||
"runtime_deps": runtime_deps,
|
||||
"tags": tags,
|
||||
"updated": updated,
|
||||
"version": version,
|
||||
})
|
||||
if description is not UNSET:
|
||||
field_dict["description"] = description
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.api_response_pack_response_data_conf_schema import ApiResponsePackResponseDataConfSchema
|
||||
from ..models.api_response_pack_response_data_config import ApiResponsePackResponseDataConfig
|
||||
from ..models.api_response_pack_response_data_meta import ApiResponsePackResponseDataMeta
|
||||
d = dict(src_dict)
|
||||
conf_schema = ApiResponsePackResponseDataConfSchema.from_dict(d.pop("conf_schema"))
|
||||
|
||||
|
||||
|
||||
|
||||
config = ApiResponsePackResponseDataConfig.from_dict(d.pop("config"))
|
||||
|
||||
|
||||
|
||||
|
||||
created = isoparse(d.pop("created"))
|
||||
|
||||
|
||||
|
||||
|
||||
id = d.pop("id")
|
||||
|
||||
is_standard = d.pop("is_standard")
|
||||
|
||||
label = d.pop("label")
|
||||
|
||||
meta = ApiResponsePackResponseDataMeta.from_dict(d.pop("meta"))
|
||||
|
||||
|
||||
|
||||
|
||||
ref = d.pop("ref")
|
||||
|
||||
runtime_deps = cast(list[str], d.pop("runtime_deps"))
|
||||
|
||||
|
||||
tags = cast(list[str], d.pop("tags"))
|
||||
|
||||
|
||||
updated = isoparse(d.pop("updated"))
|
||||
|
||||
|
||||
|
||||
|
||||
version = d.pop("version")
|
||||
|
||||
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))
|
||||
|
||||
|
||||
api_response_pack_response_data = cls(
|
||||
conf_schema=conf_schema,
|
||||
config=config,
|
||||
created=created,
|
||||
id=id,
|
||||
is_standard=is_standard,
|
||||
label=label,
|
||||
meta=meta,
|
||||
ref=ref,
|
||||
runtime_deps=runtime_deps,
|
||||
tags=tags,
|
||||
updated=updated,
|
||||
version=version,
|
||||
description=description,
|
||||
)
|
||||
|
||||
|
||||
api_response_pack_response_data.additional_properties = d
|
||||
return api_response_pack_response_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
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponsePackResponseDataConfSchema")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponsePackResponseDataConfSchema:
|
||||
""" Configuration schema
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
api_response_pack_response_data_conf_schema = cls(
|
||||
)
|
||||
|
||||
|
||||
api_response_pack_response_data_conf_schema.additional_properties = d
|
||||
return api_response_pack_response_data_conf_schema
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponsePackResponseDataConfig")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponsePackResponseDataConfig:
|
||||
""" Pack configuration
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
api_response_pack_response_data_config = cls(
|
||||
)
|
||||
|
||||
|
||||
api_response_pack_response_data_config.additional_properties = d
|
||||
return api_response_pack_response_data_config
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponsePackResponseDataMeta")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponsePackResponseDataMeta:
|
||||
""" Pack metadata
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
api_response_pack_response_data_meta = cls(
|
||||
)
|
||||
|
||||
|
||||
api_response_pack_response_data_meta.additional_properties = d
|
||||
return api_response_pack_response_data_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
|
||||
@@ -0,0 +1,107 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from typing import cast
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.api_response_queue_stats_response_data import ApiResponseQueueStatsResponseData
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseQueueStatsResponse")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseQueueStatsResponse:
|
||||
""" Standard API response wrapper
|
||||
|
||||
Attributes:
|
||||
data (ApiResponseQueueStatsResponseData): Response DTO for queue statistics
|
||||
message (None | str | Unset): Optional message
|
||||
"""
|
||||
|
||||
data: ApiResponseQueueStatsResponseData
|
||||
message: None | str | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.api_response_queue_stats_response_data import ApiResponseQueueStatsResponseData
|
||||
data = self.data.to_dict()
|
||||
|
||||
message: None | str | Unset
|
||||
if isinstance(self.message, Unset):
|
||||
message = UNSET
|
||||
else:
|
||||
message = self.message
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"data": data,
|
||||
})
|
||||
if message is not UNSET:
|
||||
field_dict["message"] = message
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.api_response_queue_stats_response_data import ApiResponseQueueStatsResponseData
|
||||
d = dict(src_dict)
|
||||
data = ApiResponseQueueStatsResponseData.from_dict(d.pop("data"))
|
||||
|
||||
|
||||
|
||||
|
||||
def _parse_message(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
message = _parse_message(d.pop("message", UNSET))
|
||||
|
||||
|
||||
api_response_queue_stats_response = cls(
|
||||
data=data,
|
||||
message=message,
|
||||
)
|
||||
|
||||
|
||||
api_response_queue_stats_response.additional_properties = d
|
||||
return api_response_queue_stats_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
|
||||
@@ -0,0 +1,174 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from dateutil.parser import isoparse
|
||||
from typing import cast
|
||||
import datetime
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseQueueStatsResponseData")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseQueueStatsResponseData:
|
||||
""" Response DTO for queue statistics
|
||||
|
||||
Attributes:
|
||||
action_id (int): Action ID Example: 1.
|
||||
action_ref (str): Action reference Example: slack.post_message.
|
||||
active_count (int): Number of currently running executions Example: 2.
|
||||
last_updated (datetime.datetime): Timestamp of last statistics update Example: 2024-01-13T10:30:00Z.
|
||||
max_concurrent (int): Maximum concurrent executions allowed Example: 3.
|
||||
queue_length (int): Number of executions waiting in queue Example: 5.
|
||||
total_completed (int): Total executions completed since queue creation Example: 95.
|
||||
total_enqueued (int): Total executions enqueued since queue creation Example: 100.
|
||||
oldest_enqueued_at (datetime.datetime | None | Unset): Timestamp of oldest queued execution (if any) Example:
|
||||
2024-01-13T10:30:00Z.
|
||||
"""
|
||||
|
||||
action_id: int
|
||||
action_ref: str
|
||||
active_count: int
|
||||
last_updated: datetime.datetime
|
||||
max_concurrent: int
|
||||
queue_length: int
|
||||
total_completed: int
|
||||
total_enqueued: int
|
||||
oldest_enqueued_at: datetime.datetime | None | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
action_id = self.action_id
|
||||
|
||||
action_ref = self.action_ref
|
||||
|
||||
active_count = self.active_count
|
||||
|
||||
last_updated = self.last_updated.isoformat()
|
||||
|
||||
max_concurrent = self.max_concurrent
|
||||
|
||||
queue_length = self.queue_length
|
||||
|
||||
total_completed = self.total_completed
|
||||
|
||||
total_enqueued = self.total_enqueued
|
||||
|
||||
oldest_enqueued_at: None | str | Unset
|
||||
if isinstance(self.oldest_enqueued_at, Unset):
|
||||
oldest_enqueued_at = UNSET
|
||||
elif isinstance(self.oldest_enqueued_at, datetime.datetime):
|
||||
oldest_enqueued_at = self.oldest_enqueued_at.isoformat()
|
||||
else:
|
||||
oldest_enqueued_at = self.oldest_enqueued_at
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"action_id": action_id,
|
||||
"action_ref": action_ref,
|
||||
"active_count": active_count,
|
||||
"last_updated": last_updated,
|
||||
"max_concurrent": max_concurrent,
|
||||
"queue_length": queue_length,
|
||||
"total_completed": total_completed,
|
||||
"total_enqueued": total_enqueued,
|
||||
})
|
||||
if oldest_enqueued_at is not UNSET:
|
||||
field_dict["oldest_enqueued_at"] = oldest_enqueued_at
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
action_id = d.pop("action_id")
|
||||
|
||||
action_ref = d.pop("action_ref")
|
||||
|
||||
active_count = d.pop("active_count")
|
||||
|
||||
last_updated = isoparse(d.pop("last_updated"))
|
||||
|
||||
|
||||
|
||||
|
||||
max_concurrent = d.pop("max_concurrent")
|
||||
|
||||
queue_length = d.pop("queue_length")
|
||||
|
||||
total_completed = d.pop("total_completed")
|
||||
|
||||
total_enqueued = d.pop("total_enqueued")
|
||||
|
||||
def _parse_oldest_enqueued_at(data: object) -> datetime.datetime | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, str):
|
||||
raise TypeError()
|
||||
oldest_enqueued_at_type_0 = isoparse(data)
|
||||
|
||||
|
||||
|
||||
return oldest_enqueued_at_type_0
|
||||
except (TypeError, ValueError, AttributeError, KeyError):
|
||||
pass
|
||||
return cast(datetime.datetime | None | Unset, data)
|
||||
|
||||
oldest_enqueued_at = _parse_oldest_enqueued_at(d.pop("oldest_enqueued_at", UNSET))
|
||||
|
||||
|
||||
api_response_queue_stats_response_data = cls(
|
||||
action_id=action_id,
|
||||
action_ref=action_ref,
|
||||
active_count=active_count,
|
||||
last_updated=last_updated,
|
||||
max_concurrent=max_concurrent,
|
||||
queue_length=queue_length,
|
||||
total_completed=total_completed,
|
||||
total_enqueued=total_enqueued,
|
||||
oldest_enqueued_at=oldest_enqueued_at,
|
||||
)
|
||||
|
||||
|
||||
api_response_queue_stats_response_data.additional_properties = d
|
||||
return api_response_queue_stats_response_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
|
||||
107
tests/generated_client/models/api_response_rule_response.py
Normal file
107
tests/generated_client/models/api_response_rule_response.py
Normal file
@@ -0,0 +1,107 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from typing import cast
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.api_response_rule_response_data import ApiResponseRuleResponseData
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseRuleResponse")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseRuleResponse:
|
||||
""" Standard API response wrapper
|
||||
|
||||
Attributes:
|
||||
data (ApiResponseRuleResponseData): Response DTO for rule information
|
||||
message (None | str | Unset): Optional message
|
||||
"""
|
||||
|
||||
data: ApiResponseRuleResponseData
|
||||
message: None | str | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.api_response_rule_response_data import ApiResponseRuleResponseData
|
||||
data = self.data.to_dict()
|
||||
|
||||
message: None | str | Unset
|
||||
if isinstance(self.message, Unset):
|
||||
message = UNSET
|
||||
else:
|
||||
message = self.message
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"data": data,
|
||||
})
|
||||
if message is not UNSET:
|
||||
field_dict["message"] = message
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.api_response_rule_response_data import ApiResponseRuleResponseData
|
||||
d = dict(src_dict)
|
||||
data = ApiResponseRuleResponseData.from_dict(d.pop("data"))
|
||||
|
||||
|
||||
|
||||
|
||||
def _parse_message(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
message = _parse_message(d.pop("message", UNSET))
|
||||
|
||||
|
||||
api_response_rule_response = cls(
|
||||
data=data,
|
||||
message=message,
|
||||
)
|
||||
|
||||
|
||||
api_response_rule_response.additional_properties = d
|
||||
return api_response_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
|
||||
226
tests/generated_client/models/api_response_rule_response_data.py
Normal file
226
tests/generated_client/models/api_response_rule_response_data.py
Normal file
@@ -0,0 +1,226 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from dateutil.parser import isoparse
|
||||
from typing import cast
|
||||
import datetime
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.api_response_rule_response_data_action_params import ApiResponseRuleResponseDataActionParams
|
||||
from ..models.api_response_rule_response_data_conditions import ApiResponseRuleResponseDataConditions
|
||||
from ..models.api_response_rule_response_data_trigger_params import ApiResponseRuleResponseDataTriggerParams
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseRuleResponseData")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseRuleResponseData:
|
||||
""" Response DTO for rule information
|
||||
|
||||
Attributes:
|
||||
action (int): Action ID Example: 1.
|
||||
action_params (ApiResponseRuleResponseDataActionParams): Parameters to pass to the action when rule is triggered
|
||||
action_ref (str): Action reference Example: slack.post_message.
|
||||
conditions (ApiResponseRuleResponseDataConditions): Conditions for rule evaluation
|
||||
created (datetime.datetime): Creation timestamp Example: 2024-01-13T10:30:00Z.
|
||||
description (str): Rule description Example: Send Slack notification when an error occurs.
|
||||
enabled (bool): Whether the rule is enabled Example: True.
|
||||
id (int): Rule ID Example: 1.
|
||||
label (str): Human-readable label Example: Notify on Error.
|
||||
pack (int): Pack ID Example: 1.
|
||||
pack_ref (str): Pack reference Example: slack.
|
||||
ref (str): Unique reference identifier Example: slack.notify_on_error.
|
||||
trigger (int): Trigger ID Example: 1.
|
||||
trigger_params (ApiResponseRuleResponseDataTriggerParams): Parameters for trigger configuration and event
|
||||
filtering
|
||||
trigger_ref (str): Trigger reference Example: system.error_event.
|
||||
updated (datetime.datetime): Last update timestamp Example: 2024-01-13T10:30:00Z.
|
||||
"""
|
||||
|
||||
action: int
|
||||
action_params: ApiResponseRuleResponseDataActionParams
|
||||
action_ref: str
|
||||
conditions: ApiResponseRuleResponseDataConditions
|
||||
created: datetime.datetime
|
||||
description: str
|
||||
enabled: bool
|
||||
id: int
|
||||
label: str
|
||||
pack: int
|
||||
pack_ref: str
|
||||
ref: str
|
||||
trigger: int
|
||||
trigger_params: ApiResponseRuleResponseDataTriggerParams
|
||||
trigger_ref: str
|
||||
updated: datetime.datetime
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.api_response_rule_response_data_trigger_params import ApiResponseRuleResponseDataTriggerParams
|
||||
from ..models.api_response_rule_response_data_action_params import ApiResponseRuleResponseDataActionParams
|
||||
from ..models.api_response_rule_response_data_conditions import ApiResponseRuleResponseDataConditions
|
||||
action = self.action
|
||||
|
||||
action_params = self.action_params.to_dict()
|
||||
|
||||
action_ref = self.action_ref
|
||||
|
||||
conditions = self.conditions.to_dict()
|
||||
|
||||
created = self.created.isoformat()
|
||||
|
||||
description = self.description
|
||||
|
||||
enabled = self.enabled
|
||||
|
||||
id = self.id
|
||||
|
||||
label = self.label
|
||||
|
||||
pack = self.pack
|
||||
|
||||
pack_ref = self.pack_ref
|
||||
|
||||
ref = self.ref
|
||||
|
||||
trigger = self.trigger
|
||||
|
||||
trigger_params = self.trigger_params.to_dict()
|
||||
|
||||
trigger_ref = self.trigger_ref
|
||||
|
||||
updated = self.updated.isoformat()
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"action": action,
|
||||
"action_params": action_params,
|
||||
"action_ref": action_ref,
|
||||
"conditions": conditions,
|
||||
"created": created,
|
||||
"description": description,
|
||||
"enabled": enabled,
|
||||
"id": id,
|
||||
"label": label,
|
||||
"pack": pack,
|
||||
"pack_ref": pack_ref,
|
||||
"ref": ref,
|
||||
"trigger": trigger,
|
||||
"trigger_params": trigger_params,
|
||||
"trigger_ref": trigger_ref,
|
||||
"updated": updated,
|
||||
})
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.api_response_rule_response_data_action_params import ApiResponseRuleResponseDataActionParams
|
||||
from ..models.api_response_rule_response_data_conditions import ApiResponseRuleResponseDataConditions
|
||||
from ..models.api_response_rule_response_data_trigger_params import ApiResponseRuleResponseDataTriggerParams
|
||||
d = dict(src_dict)
|
||||
action = d.pop("action")
|
||||
|
||||
action_params = ApiResponseRuleResponseDataActionParams.from_dict(d.pop("action_params"))
|
||||
|
||||
|
||||
|
||||
|
||||
action_ref = d.pop("action_ref")
|
||||
|
||||
conditions = ApiResponseRuleResponseDataConditions.from_dict(d.pop("conditions"))
|
||||
|
||||
|
||||
|
||||
|
||||
created = isoparse(d.pop("created"))
|
||||
|
||||
|
||||
|
||||
|
||||
description = d.pop("description")
|
||||
|
||||
enabled = d.pop("enabled")
|
||||
|
||||
id = d.pop("id")
|
||||
|
||||
label = d.pop("label")
|
||||
|
||||
pack = d.pop("pack")
|
||||
|
||||
pack_ref = d.pop("pack_ref")
|
||||
|
||||
ref = d.pop("ref")
|
||||
|
||||
trigger = d.pop("trigger")
|
||||
|
||||
trigger_params = ApiResponseRuleResponseDataTriggerParams.from_dict(d.pop("trigger_params"))
|
||||
|
||||
|
||||
|
||||
|
||||
trigger_ref = d.pop("trigger_ref")
|
||||
|
||||
updated = isoparse(d.pop("updated"))
|
||||
|
||||
|
||||
|
||||
|
||||
api_response_rule_response_data = cls(
|
||||
action=action,
|
||||
action_params=action_params,
|
||||
action_ref=action_ref,
|
||||
conditions=conditions,
|
||||
created=created,
|
||||
description=description,
|
||||
enabled=enabled,
|
||||
id=id,
|
||||
label=label,
|
||||
pack=pack,
|
||||
pack_ref=pack_ref,
|
||||
ref=ref,
|
||||
trigger=trigger,
|
||||
trigger_params=trigger_params,
|
||||
trigger_ref=trigger_ref,
|
||||
updated=updated,
|
||||
)
|
||||
|
||||
|
||||
api_response_rule_response_data.additional_properties = d
|
||||
return api_response_rule_response_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
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseRuleResponseDataActionParams")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseRuleResponseDataActionParams:
|
||||
""" Parameters to pass to the action when rule is triggered
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
api_response_rule_response_data_action_params = cls(
|
||||
)
|
||||
|
||||
|
||||
api_response_rule_response_data_action_params.additional_properties = d
|
||||
return api_response_rule_response_data_action_params
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseRuleResponseDataConditions")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseRuleResponseDataConditions:
|
||||
""" Conditions for rule evaluation
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
api_response_rule_response_data_conditions = cls(
|
||||
)
|
||||
|
||||
|
||||
api_response_rule_response_data_conditions.additional_properties = d
|
||||
return api_response_rule_response_data_conditions
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseRuleResponseDataTriggerParams")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseRuleResponseDataTriggerParams:
|
||||
""" Parameters for trigger configuration and event filtering
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
api_response_rule_response_data_trigger_params = cls(
|
||||
)
|
||||
|
||||
|
||||
api_response_rule_response_data_trigger_params.additional_properties = d
|
||||
return api_response_rule_response_data_trigger_params
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
107
tests/generated_client/models/api_response_sensor_response.py
Normal file
107
tests/generated_client/models/api_response_sensor_response.py
Normal file
@@ -0,0 +1,107 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from typing import cast
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.api_response_sensor_response_data import ApiResponseSensorResponseData
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseSensorResponse")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseSensorResponse:
|
||||
""" Standard API response wrapper
|
||||
|
||||
Attributes:
|
||||
data (ApiResponseSensorResponseData): Response DTO for sensor information
|
||||
message (None | str | Unset): Optional message
|
||||
"""
|
||||
|
||||
data: ApiResponseSensorResponseData
|
||||
message: None | str | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.api_response_sensor_response_data import ApiResponseSensorResponseData
|
||||
data = self.data.to_dict()
|
||||
|
||||
message: None | str | Unset
|
||||
if isinstance(self.message, Unset):
|
||||
message = UNSET
|
||||
else:
|
||||
message = self.message
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"data": data,
|
||||
})
|
||||
if message is not UNSET:
|
||||
field_dict["message"] = message
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.api_response_sensor_response_data import ApiResponseSensorResponseData
|
||||
d = dict(src_dict)
|
||||
data = ApiResponseSensorResponseData.from_dict(d.pop("data"))
|
||||
|
||||
|
||||
|
||||
|
||||
def _parse_message(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
message = _parse_message(d.pop("message", UNSET))
|
||||
|
||||
|
||||
api_response_sensor_response = cls(
|
||||
data=data,
|
||||
message=message,
|
||||
)
|
||||
|
||||
|
||||
api_response_sensor_response.additional_properties = d
|
||||
return api_response_sensor_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
|
||||
@@ -0,0 +1,249 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from dateutil.parser import isoparse
|
||||
from typing import cast
|
||||
import datetime
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.api_response_sensor_response_data_param_schema_type_0 import ApiResponseSensorResponseDataParamSchemaType0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseSensorResponseData")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseSensorResponseData:
|
||||
""" Response DTO for sensor information
|
||||
|
||||
Attributes:
|
||||
created (datetime.datetime): Creation timestamp Example: 2024-01-13T10:30:00Z.
|
||||
description (str): Sensor description Example: Monitors CPU usage and generates events.
|
||||
enabled (bool): Whether the sensor is enabled Example: True.
|
||||
entrypoint (str): Entry point Example: /sensors/monitoring/cpu_monitor.py.
|
||||
id (int): Sensor ID Example: 1.
|
||||
label (str): Human-readable label Example: CPU Monitoring Sensor.
|
||||
param_schema (ApiResponseSensorResponseDataParamSchemaType0 | None): Parameter schema
|
||||
ref (str): Unique reference identifier Example: monitoring.cpu_sensor.
|
||||
runtime (int): Runtime ID Example: 1.
|
||||
runtime_ref (str): Runtime reference Example: python3.
|
||||
trigger (int): Trigger ID Example: 1.
|
||||
trigger_ref (str): Trigger reference Example: monitoring.cpu_threshold.
|
||||
updated (datetime.datetime): Last update timestamp Example: 2024-01-13T10:30:00Z.
|
||||
pack (int | None | Unset): Pack ID (optional) Example: 1.
|
||||
pack_ref (None | str | Unset): Pack reference (optional) Example: monitoring.
|
||||
"""
|
||||
|
||||
created: datetime.datetime
|
||||
description: str
|
||||
enabled: bool
|
||||
entrypoint: str
|
||||
id: int
|
||||
label: str
|
||||
param_schema: ApiResponseSensorResponseDataParamSchemaType0 | None
|
||||
ref: str
|
||||
runtime: int
|
||||
runtime_ref: str
|
||||
trigger: int
|
||||
trigger_ref: str
|
||||
updated: datetime.datetime
|
||||
pack: int | None | Unset = UNSET
|
||||
pack_ref: None | str | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.api_response_sensor_response_data_param_schema_type_0 import ApiResponseSensorResponseDataParamSchemaType0
|
||||
created = self.created.isoformat()
|
||||
|
||||
description = self.description
|
||||
|
||||
enabled = self.enabled
|
||||
|
||||
entrypoint = self.entrypoint
|
||||
|
||||
id = self.id
|
||||
|
||||
label = self.label
|
||||
|
||||
param_schema: dict[str, Any] | None
|
||||
if isinstance(self.param_schema, ApiResponseSensorResponseDataParamSchemaType0):
|
||||
param_schema = self.param_schema.to_dict()
|
||||
else:
|
||||
param_schema = self.param_schema
|
||||
|
||||
ref = self.ref
|
||||
|
||||
runtime = self.runtime
|
||||
|
||||
runtime_ref = self.runtime_ref
|
||||
|
||||
trigger = self.trigger
|
||||
|
||||
trigger_ref = self.trigger_ref
|
||||
|
||||
updated = self.updated.isoformat()
|
||||
|
||||
pack: int | None | Unset
|
||||
if isinstance(self.pack, Unset):
|
||||
pack = UNSET
|
||||
else:
|
||||
pack = self.pack
|
||||
|
||||
pack_ref: None | str | Unset
|
||||
if isinstance(self.pack_ref, Unset):
|
||||
pack_ref = UNSET
|
||||
else:
|
||||
pack_ref = self.pack_ref
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"created": created,
|
||||
"description": description,
|
||||
"enabled": enabled,
|
||||
"entrypoint": entrypoint,
|
||||
"id": id,
|
||||
"label": label,
|
||||
"param_schema": param_schema,
|
||||
"ref": ref,
|
||||
"runtime": runtime,
|
||||
"runtime_ref": runtime_ref,
|
||||
"trigger": trigger,
|
||||
"trigger_ref": trigger_ref,
|
||||
"updated": updated,
|
||||
})
|
||||
if pack is not UNSET:
|
||||
field_dict["pack"] = pack
|
||||
if pack_ref is not UNSET:
|
||||
field_dict["pack_ref"] = pack_ref
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.api_response_sensor_response_data_param_schema_type_0 import ApiResponseSensorResponseDataParamSchemaType0
|
||||
d = dict(src_dict)
|
||||
created = isoparse(d.pop("created"))
|
||||
|
||||
|
||||
|
||||
|
||||
description = d.pop("description")
|
||||
|
||||
enabled = d.pop("enabled")
|
||||
|
||||
entrypoint = d.pop("entrypoint")
|
||||
|
||||
id = d.pop("id")
|
||||
|
||||
label = d.pop("label")
|
||||
|
||||
def _parse_param_schema(data: object) -> ApiResponseSensorResponseDataParamSchemaType0 | None:
|
||||
if data is None:
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
param_schema_type_0 = ApiResponseSensorResponseDataParamSchemaType0.from_dict(data)
|
||||
|
||||
|
||||
|
||||
return param_schema_type_0
|
||||
except (TypeError, ValueError, AttributeError, KeyError):
|
||||
pass
|
||||
return cast(ApiResponseSensorResponseDataParamSchemaType0 | None, data)
|
||||
|
||||
param_schema = _parse_param_schema(d.pop("param_schema"))
|
||||
|
||||
|
||||
ref = d.pop("ref")
|
||||
|
||||
runtime = d.pop("runtime")
|
||||
|
||||
runtime_ref = d.pop("runtime_ref")
|
||||
|
||||
trigger = d.pop("trigger")
|
||||
|
||||
trigger_ref = d.pop("trigger_ref")
|
||||
|
||||
updated = isoparse(d.pop("updated"))
|
||||
|
||||
|
||||
|
||||
|
||||
def _parse_pack(data: object) -> int | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(int | None | Unset, data)
|
||||
|
||||
pack = _parse_pack(d.pop("pack", UNSET))
|
||||
|
||||
|
||||
def _parse_pack_ref(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
pack_ref = _parse_pack_ref(d.pop("pack_ref", UNSET))
|
||||
|
||||
|
||||
api_response_sensor_response_data = cls(
|
||||
created=created,
|
||||
description=description,
|
||||
enabled=enabled,
|
||||
entrypoint=entrypoint,
|
||||
id=id,
|
||||
label=label,
|
||||
param_schema=param_schema,
|
||||
ref=ref,
|
||||
runtime=runtime,
|
||||
runtime_ref=runtime_ref,
|
||||
trigger=trigger,
|
||||
trigger_ref=trigger_ref,
|
||||
updated=updated,
|
||||
pack=pack,
|
||||
pack_ref=pack_ref,
|
||||
)
|
||||
|
||||
|
||||
api_response_sensor_response_data.additional_properties = d
|
||||
return api_response_sensor_response_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
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseSensorResponseDataParamSchemaType0")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseSensorResponseDataParamSchemaType0:
|
||||
""" Parameter schema
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
api_response_sensor_response_data_param_schema_type_0 = cls(
|
||||
)
|
||||
|
||||
|
||||
api_response_sensor_response_data_param_schema_type_0.additional_properties = d
|
||||
return api_response_sensor_response_data_param_schema_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
|
||||
100
tests/generated_client/models/api_response_string.py
Normal file
100
tests/generated_client/models/api_response_string.py
Normal file
@@ -0,0 +1,100 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from typing import cast
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseString")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseString:
|
||||
""" Standard API response wrapper
|
||||
|
||||
Attributes:
|
||||
data (str):
|
||||
message (None | str | Unset): Optional message
|
||||
"""
|
||||
|
||||
data: str
|
||||
message: None | str | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
data = self.data
|
||||
|
||||
message: None | str | Unset
|
||||
if isinstance(self.message, Unset):
|
||||
message = UNSET
|
||||
else:
|
||||
message = self.message
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"data": data,
|
||||
})
|
||||
if message is not UNSET:
|
||||
field_dict["message"] = message
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
data = d.pop("data")
|
||||
|
||||
def _parse_message(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
message = _parse_message(d.pop("message", UNSET))
|
||||
|
||||
|
||||
api_response_string = cls(
|
||||
data=data,
|
||||
message=message,
|
||||
)
|
||||
|
||||
|
||||
api_response_string.additional_properties = d
|
||||
return api_response_string
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
107
tests/generated_client/models/api_response_token_response.py
Normal file
107
tests/generated_client/models/api_response_token_response.py
Normal file
@@ -0,0 +1,107 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from typing import cast
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.api_response_token_response_data import ApiResponseTokenResponseData
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseTokenResponse")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseTokenResponse:
|
||||
""" Standard API response wrapper
|
||||
|
||||
Attributes:
|
||||
data (ApiResponseTokenResponseData): Token response
|
||||
message (None | str | Unset): Optional message
|
||||
"""
|
||||
|
||||
data: ApiResponseTokenResponseData
|
||||
message: None | str | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.api_response_token_response_data import ApiResponseTokenResponseData
|
||||
data = self.data.to_dict()
|
||||
|
||||
message: None | str | Unset
|
||||
if isinstance(self.message, Unset):
|
||||
message = UNSET
|
||||
else:
|
||||
message = self.message
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"data": data,
|
||||
})
|
||||
if message is not UNSET:
|
||||
field_dict["message"] = message
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.api_response_token_response_data import ApiResponseTokenResponseData
|
||||
d = dict(src_dict)
|
||||
data = ApiResponseTokenResponseData.from_dict(d.pop("data"))
|
||||
|
||||
|
||||
|
||||
|
||||
def _parse_message(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
message = _parse_message(d.pop("message", UNSET))
|
||||
|
||||
|
||||
api_response_token_response = cls(
|
||||
data=data,
|
||||
message=message,
|
||||
)
|
||||
|
||||
|
||||
api_response_token_response.additional_properties = d
|
||||
return api_response_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
|
||||
@@ -0,0 +1,140 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from typing import cast
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.user_info import UserInfo
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseTokenResponseData")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseTokenResponseData:
|
||||
""" Token response
|
||||
|
||||
Attributes:
|
||||
access_token (str): Access token (JWT) Example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9....
|
||||
expires_in (int): Access token expiration in seconds Example: 3600.
|
||||
refresh_token (str): Refresh token Example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9....
|
||||
token_type (str): Token type (always "Bearer") Example: Bearer.
|
||||
user (None | Unset | UserInfo):
|
||||
"""
|
||||
|
||||
access_token: str
|
||||
expires_in: int
|
||||
refresh_token: str
|
||||
token_type: str
|
||||
user: None | Unset | UserInfo = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.user_info import UserInfo
|
||||
access_token = self.access_token
|
||||
|
||||
expires_in = self.expires_in
|
||||
|
||||
refresh_token = self.refresh_token
|
||||
|
||||
token_type = self.token_type
|
||||
|
||||
user: dict[str, Any] | None | Unset
|
||||
if isinstance(self.user, Unset):
|
||||
user = UNSET
|
||||
elif isinstance(self.user, UserInfo):
|
||||
user = self.user.to_dict()
|
||||
else:
|
||||
user = self.user
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"access_token": access_token,
|
||||
"expires_in": expires_in,
|
||||
"refresh_token": refresh_token,
|
||||
"token_type": token_type,
|
||||
})
|
||||
if user is not UNSET:
|
||||
field_dict["user"] = user
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.user_info import UserInfo
|
||||
d = dict(src_dict)
|
||||
access_token = d.pop("access_token")
|
||||
|
||||
expires_in = d.pop("expires_in")
|
||||
|
||||
refresh_token = d.pop("refresh_token")
|
||||
|
||||
token_type = d.pop("token_type")
|
||||
|
||||
def _parse_user(data: object) -> None | Unset | UserInfo:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
user_type_1 = UserInfo.from_dict(data)
|
||||
|
||||
|
||||
|
||||
return user_type_1
|
||||
except (TypeError, ValueError, AttributeError, KeyError):
|
||||
pass
|
||||
return cast(None | Unset | UserInfo, data)
|
||||
|
||||
user = _parse_user(d.pop("user", UNSET))
|
||||
|
||||
|
||||
api_response_token_response_data = cls(
|
||||
access_token=access_token,
|
||||
expires_in=expires_in,
|
||||
refresh_token=refresh_token,
|
||||
token_type=token_type,
|
||||
user=user,
|
||||
)
|
||||
|
||||
|
||||
api_response_token_response_data.additional_properties = d
|
||||
return api_response_token_response_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
|
||||
107
tests/generated_client/models/api_response_trigger_response.py
Normal file
107
tests/generated_client/models/api_response_trigger_response.py
Normal file
@@ -0,0 +1,107 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from typing import cast
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.api_response_trigger_response_data import ApiResponseTriggerResponseData
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseTriggerResponse")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseTriggerResponse:
|
||||
""" Standard API response wrapper
|
||||
|
||||
Attributes:
|
||||
data (ApiResponseTriggerResponseData): Response DTO for trigger information
|
||||
message (None | str | Unset): Optional message
|
||||
"""
|
||||
|
||||
data: ApiResponseTriggerResponseData
|
||||
message: None | str | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.api_response_trigger_response_data import ApiResponseTriggerResponseData
|
||||
data = self.data.to_dict()
|
||||
|
||||
message: None | str | Unset
|
||||
if isinstance(self.message, Unset):
|
||||
message = UNSET
|
||||
else:
|
||||
message = self.message
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"data": data,
|
||||
})
|
||||
if message is not UNSET:
|
||||
field_dict["message"] = message
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.api_response_trigger_response_data import ApiResponseTriggerResponseData
|
||||
d = dict(src_dict)
|
||||
data = ApiResponseTriggerResponseData.from_dict(d.pop("data"))
|
||||
|
||||
|
||||
|
||||
|
||||
def _parse_message(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
message = _parse_message(d.pop("message", UNSET))
|
||||
|
||||
|
||||
api_response_trigger_response = cls(
|
||||
data=data,
|
||||
message=message,
|
||||
)
|
||||
|
||||
|
||||
api_response_trigger_response.additional_properties = d
|
||||
return api_response_trigger_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
|
||||
@@ -0,0 +1,283 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from dateutil.parser import isoparse
|
||||
from typing import cast
|
||||
import datetime
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.api_response_trigger_response_data_out_schema_type_0 import ApiResponseTriggerResponseDataOutSchemaType0
|
||||
from ..models.api_response_trigger_response_data_param_schema_type_0 import ApiResponseTriggerResponseDataParamSchemaType0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseTriggerResponseData")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseTriggerResponseData:
|
||||
""" Response DTO for trigger information
|
||||
|
||||
Attributes:
|
||||
created (datetime.datetime): Creation timestamp Example: 2024-01-13T10:30:00Z.
|
||||
enabled (bool): Whether the trigger is enabled Example: True.
|
||||
id (int): Trigger ID Example: 1.
|
||||
label (str): Human-readable label Example: Webhook Trigger.
|
||||
out_schema (ApiResponseTriggerResponseDataOutSchemaType0 | None): Output schema
|
||||
param_schema (ApiResponseTriggerResponseDataParamSchemaType0 | None): Parameter schema
|
||||
ref (str): Unique reference identifier Example: core.webhook.
|
||||
updated (datetime.datetime): Last update timestamp Example: 2024-01-13T10:30:00Z.
|
||||
webhook_enabled (bool): Whether webhooks are enabled for this trigger
|
||||
description (None | str | Unset): Trigger description Example: Triggers when a webhook is received.
|
||||
pack (int | None | Unset): Pack ID (optional) Example: 1.
|
||||
pack_ref (None | str | Unset): Pack reference (optional) Example: core.
|
||||
webhook_key (None | str | Unset): Webhook key (only present if webhooks are enabled) Example:
|
||||
wh_k7j2n9p4m8q1r5w3x6z0a2b5c8d1e4f7g9h2.
|
||||
"""
|
||||
|
||||
created: datetime.datetime
|
||||
enabled: bool
|
||||
id: int
|
||||
label: str
|
||||
out_schema: ApiResponseTriggerResponseDataOutSchemaType0 | None
|
||||
param_schema: ApiResponseTriggerResponseDataParamSchemaType0 | None
|
||||
ref: str
|
||||
updated: datetime.datetime
|
||||
webhook_enabled: bool
|
||||
description: None | str | Unset = UNSET
|
||||
pack: int | None | Unset = UNSET
|
||||
pack_ref: None | str | Unset = UNSET
|
||||
webhook_key: None | str | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.api_response_trigger_response_data_out_schema_type_0 import ApiResponseTriggerResponseDataOutSchemaType0
|
||||
from ..models.api_response_trigger_response_data_param_schema_type_0 import ApiResponseTriggerResponseDataParamSchemaType0
|
||||
created = self.created.isoformat()
|
||||
|
||||
enabled = self.enabled
|
||||
|
||||
id = self.id
|
||||
|
||||
label = self.label
|
||||
|
||||
out_schema: dict[str, Any] | None
|
||||
if isinstance(self.out_schema, ApiResponseTriggerResponseDataOutSchemaType0):
|
||||
out_schema = self.out_schema.to_dict()
|
||||
else:
|
||||
out_schema = self.out_schema
|
||||
|
||||
param_schema: dict[str, Any] | None
|
||||
if isinstance(self.param_schema, ApiResponseTriggerResponseDataParamSchemaType0):
|
||||
param_schema = self.param_schema.to_dict()
|
||||
else:
|
||||
param_schema = self.param_schema
|
||||
|
||||
ref = self.ref
|
||||
|
||||
updated = self.updated.isoformat()
|
||||
|
||||
webhook_enabled = self.webhook_enabled
|
||||
|
||||
description: None | str | Unset
|
||||
if isinstance(self.description, Unset):
|
||||
description = UNSET
|
||||
else:
|
||||
description = self.description
|
||||
|
||||
pack: int | None | Unset
|
||||
if isinstance(self.pack, Unset):
|
||||
pack = UNSET
|
||||
else:
|
||||
pack = self.pack
|
||||
|
||||
pack_ref: None | str | Unset
|
||||
if isinstance(self.pack_ref, Unset):
|
||||
pack_ref = UNSET
|
||||
else:
|
||||
pack_ref = self.pack_ref
|
||||
|
||||
webhook_key: None | str | Unset
|
||||
if isinstance(self.webhook_key, Unset):
|
||||
webhook_key = UNSET
|
||||
else:
|
||||
webhook_key = self.webhook_key
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"created": created,
|
||||
"enabled": enabled,
|
||||
"id": id,
|
||||
"label": label,
|
||||
"out_schema": out_schema,
|
||||
"param_schema": param_schema,
|
||||
"ref": ref,
|
||||
"updated": updated,
|
||||
"webhook_enabled": webhook_enabled,
|
||||
})
|
||||
if description is not UNSET:
|
||||
field_dict["description"] = description
|
||||
if pack is not UNSET:
|
||||
field_dict["pack"] = pack
|
||||
if pack_ref is not UNSET:
|
||||
field_dict["pack_ref"] = pack_ref
|
||||
if webhook_key is not UNSET:
|
||||
field_dict["webhook_key"] = webhook_key
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.api_response_trigger_response_data_out_schema_type_0 import ApiResponseTriggerResponseDataOutSchemaType0
|
||||
from ..models.api_response_trigger_response_data_param_schema_type_0 import ApiResponseTriggerResponseDataParamSchemaType0
|
||||
d = dict(src_dict)
|
||||
created = isoparse(d.pop("created"))
|
||||
|
||||
|
||||
|
||||
|
||||
enabled = d.pop("enabled")
|
||||
|
||||
id = d.pop("id")
|
||||
|
||||
label = d.pop("label")
|
||||
|
||||
def _parse_out_schema(data: object) -> ApiResponseTriggerResponseDataOutSchemaType0 | None:
|
||||
if data is None:
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
out_schema_type_0 = ApiResponseTriggerResponseDataOutSchemaType0.from_dict(data)
|
||||
|
||||
|
||||
|
||||
return out_schema_type_0
|
||||
except (TypeError, ValueError, AttributeError, KeyError):
|
||||
pass
|
||||
return cast(ApiResponseTriggerResponseDataOutSchemaType0 | None, data)
|
||||
|
||||
out_schema = _parse_out_schema(d.pop("out_schema"))
|
||||
|
||||
|
||||
def _parse_param_schema(data: object) -> ApiResponseTriggerResponseDataParamSchemaType0 | None:
|
||||
if data is None:
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
param_schema_type_0 = ApiResponseTriggerResponseDataParamSchemaType0.from_dict(data)
|
||||
|
||||
|
||||
|
||||
return param_schema_type_0
|
||||
except (TypeError, ValueError, AttributeError, KeyError):
|
||||
pass
|
||||
return cast(ApiResponseTriggerResponseDataParamSchemaType0 | None, data)
|
||||
|
||||
param_schema = _parse_param_schema(d.pop("param_schema"))
|
||||
|
||||
|
||||
ref = d.pop("ref")
|
||||
|
||||
updated = isoparse(d.pop("updated"))
|
||||
|
||||
|
||||
|
||||
|
||||
webhook_enabled = d.pop("webhook_enabled")
|
||||
|
||||
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))
|
||||
|
||||
|
||||
def _parse_pack(data: object) -> int | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(int | None | Unset, data)
|
||||
|
||||
pack = _parse_pack(d.pop("pack", UNSET))
|
||||
|
||||
|
||||
def _parse_pack_ref(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
pack_ref = _parse_pack_ref(d.pop("pack_ref", UNSET))
|
||||
|
||||
|
||||
def _parse_webhook_key(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
webhook_key = _parse_webhook_key(d.pop("webhook_key", UNSET))
|
||||
|
||||
|
||||
api_response_trigger_response_data = cls(
|
||||
created=created,
|
||||
enabled=enabled,
|
||||
id=id,
|
||||
label=label,
|
||||
out_schema=out_schema,
|
||||
param_schema=param_schema,
|
||||
ref=ref,
|
||||
updated=updated,
|
||||
webhook_enabled=webhook_enabled,
|
||||
description=description,
|
||||
pack=pack,
|
||||
pack_ref=pack_ref,
|
||||
webhook_key=webhook_key,
|
||||
)
|
||||
|
||||
|
||||
api_response_trigger_response_data.additional_properties = d
|
||||
return api_response_trigger_response_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
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseTriggerResponseDataOutSchemaType0")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseTriggerResponseDataOutSchemaType0:
|
||||
""" Output schema
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
api_response_trigger_response_data_out_schema_type_0 = cls(
|
||||
)
|
||||
|
||||
|
||||
api_response_trigger_response_data_out_schema_type_0.additional_properties = d
|
||||
return api_response_trigger_response_data_out_schema_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
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseTriggerResponseDataParamSchemaType0")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseTriggerResponseDataParamSchemaType0:
|
||||
""" Parameter schema
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
api_response_trigger_response_data_param_schema_type_0 = cls(
|
||||
)
|
||||
|
||||
|
||||
api_response_trigger_response_data_param_schema_type_0.additional_properties = d
|
||||
return api_response_trigger_response_data_param_schema_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
|
||||
@@ -0,0 +1,107 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from typing import cast
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.api_response_webhook_receiver_response_data import ApiResponseWebhookReceiverResponseData
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseWebhookReceiverResponse")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseWebhookReceiverResponse:
|
||||
""" Standard API response wrapper
|
||||
|
||||
Attributes:
|
||||
data (ApiResponseWebhookReceiverResponseData): Response from webhook receiver endpoint
|
||||
message (None | str | Unset): Optional message
|
||||
"""
|
||||
|
||||
data: ApiResponseWebhookReceiverResponseData
|
||||
message: None | str | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.api_response_webhook_receiver_response_data import ApiResponseWebhookReceiverResponseData
|
||||
data = self.data.to_dict()
|
||||
|
||||
message: None | str | Unset
|
||||
if isinstance(self.message, Unset):
|
||||
message = UNSET
|
||||
else:
|
||||
message = self.message
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"data": data,
|
||||
})
|
||||
if message is not UNSET:
|
||||
field_dict["message"] = message
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.api_response_webhook_receiver_response_data import ApiResponseWebhookReceiverResponseData
|
||||
d = dict(src_dict)
|
||||
data = ApiResponseWebhookReceiverResponseData.from_dict(d.pop("data"))
|
||||
|
||||
|
||||
|
||||
|
||||
def _parse_message(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
message = _parse_message(d.pop("message", UNSET))
|
||||
|
||||
|
||||
api_response_webhook_receiver_response = cls(
|
||||
data=data,
|
||||
message=message,
|
||||
)
|
||||
|
||||
|
||||
api_response_webhook_receiver_response.additional_properties = d
|
||||
return api_response_webhook_receiver_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
|
||||
@@ -0,0 +1,107 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from dateutil.parser import isoparse
|
||||
from typing import cast
|
||||
import datetime
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseWebhookReceiverResponseData")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseWebhookReceiverResponseData:
|
||||
""" Response from webhook receiver endpoint
|
||||
|
||||
Attributes:
|
||||
event_id (int): ID of the event created from this webhook
|
||||
message (str): Success message
|
||||
received_at (datetime.datetime): Timestamp when the webhook was received
|
||||
trigger_ref (str): Reference of the trigger that received this webhook
|
||||
"""
|
||||
|
||||
event_id: int
|
||||
message: str
|
||||
received_at: datetime.datetime
|
||||
trigger_ref: str
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
event_id = self.event_id
|
||||
|
||||
message = self.message
|
||||
|
||||
received_at = self.received_at.isoformat()
|
||||
|
||||
trigger_ref = self.trigger_ref
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"event_id": event_id,
|
||||
"message": message,
|
||||
"received_at": received_at,
|
||||
"trigger_ref": trigger_ref,
|
||||
})
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
event_id = d.pop("event_id")
|
||||
|
||||
message = d.pop("message")
|
||||
|
||||
received_at = isoparse(d.pop("received_at"))
|
||||
|
||||
|
||||
|
||||
|
||||
trigger_ref = d.pop("trigger_ref")
|
||||
|
||||
api_response_webhook_receiver_response_data = cls(
|
||||
event_id=event_id,
|
||||
message=message,
|
||||
received_at=received_at,
|
||||
trigger_ref=trigger_ref,
|
||||
)
|
||||
|
||||
|
||||
api_response_webhook_receiver_response_data.additional_properties = d
|
||||
return api_response_webhook_receiver_response_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
|
||||
107
tests/generated_client/models/api_response_workflow_response.py
Normal file
107
tests/generated_client/models/api_response_workflow_response.py
Normal file
@@ -0,0 +1,107 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from typing import cast
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.api_response_workflow_response_data import ApiResponseWorkflowResponseData
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseWorkflowResponse")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseWorkflowResponse:
|
||||
""" Standard API response wrapper
|
||||
|
||||
Attributes:
|
||||
data (ApiResponseWorkflowResponseData): Response DTO for workflow information
|
||||
message (None | str | Unset): Optional message
|
||||
"""
|
||||
|
||||
data: ApiResponseWorkflowResponseData
|
||||
message: None | str | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.api_response_workflow_response_data import ApiResponseWorkflowResponseData
|
||||
data = self.data.to_dict()
|
||||
|
||||
message: None | str | Unset
|
||||
if isinstance(self.message, Unset):
|
||||
message = UNSET
|
||||
else:
|
||||
message = self.message
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"data": data,
|
||||
})
|
||||
if message is not UNSET:
|
||||
field_dict["message"] = message
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.api_response_workflow_response_data import ApiResponseWorkflowResponseData
|
||||
d = dict(src_dict)
|
||||
data = ApiResponseWorkflowResponseData.from_dict(d.pop("data"))
|
||||
|
||||
|
||||
|
||||
|
||||
def _parse_message(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
message = _parse_message(d.pop("message", UNSET))
|
||||
|
||||
|
||||
api_response_workflow_response = cls(
|
||||
data=data,
|
||||
message=message,
|
||||
)
|
||||
|
||||
|
||||
api_response_workflow_response.additional_properties = d
|
||||
return api_response_workflow_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
|
||||
@@ -0,0 +1,261 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from dateutil.parser import isoparse
|
||||
from typing import cast
|
||||
import datetime
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.api_response_workflow_response_data_definition import ApiResponseWorkflowResponseDataDefinition
|
||||
from ..models.api_response_workflow_response_data_out_schema_type_0 import ApiResponseWorkflowResponseDataOutSchemaType0
|
||||
from ..models.api_response_workflow_response_data_param_schema_type_0 import ApiResponseWorkflowResponseDataParamSchemaType0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseWorkflowResponseData")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseWorkflowResponseData:
|
||||
""" Response DTO for workflow information
|
||||
|
||||
Attributes:
|
||||
created (datetime.datetime): Creation timestamp Example: 2024-01-13T10:30:00Z.
|
||||
definition (ApiResponseWorkflowResponseDataDefinition): Workflow definition
|
||||
enabled (bool): Whether the workflow is enabled Example: True.
|
||||
id (int): Workflow ID Example: 1.
|
||||
label (str): Human-readable label Example: Incident Response Workflow.
|
||||
out_schema (ApiResponseWorkflowResponseDataOutSchemaType0 | None): Output schema
|
||||
pack (int): Pack ID Example: 1.
|
||||
pack_ref (str): Pack reference Example: slack.
|
||||
param_schema (ApiResponseWorkflowResponseDataParamSchemaType0 | None): Parameter schema
|
||||
ref (str): Unique reference identifier Example: slack.incident_workflow.
|
||||
tags (list[str]): Tags Example: ['incident', 'slack', 'approval'].
|
||||
updated (datetime.datetime): Last update timestamp Example: 2024-01-13T10:30:00Z.
|
||||
version (str): Workflow version Example: 1.0.0.
|
||||
description (None | str | Unset): Workflow description Example: Automated incident response workflow with
|
||||
notifications and approvals.
|
||||
"""
|
||||
|
||||
created: datetime.datetime
|
||||
definition: ApiResponseWorkflowResponseDataDefinition
|
||||
enabled: bool
|
||||
id: int
|
||||
label: str
|
||||
out_schema: ApiResponseWorkflowResponseDataOutSchemaType0 | None
|
||||
pack: int
|
||||
pack_ref: str
|
||||
param_schema: ApiResponseWorkflowResponseDataParamSchemaType0 | None
|
||||
ref: str
|
||||
tags: list[str]
|
||||
updated: datetime.datetime
|
||||
version: str
|
||||
description: None | str | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.api_response_workflow_response_data_definition import ApiResponseWorkflowResponseDataDefinition
|
||||
from ..models.api_response_workflow_response_data_param_schema_type_0 import ApiResponseWorkflowResponseDataParamSchemaType0
|
||||
from ..models.api_response_workflow_response_data_out_schema_type_0 import ApiResponseWorkflowResponseDataOutSchemaType0
|
||||
created = self.created.isoformat()
|
||||
|
||||
definition = self.definition.to_dict()
|
||||
|
||||
enabled = self.enabled
|
||||
|
||||
id = self.id
|
||||
|
||||
label = self.label
|
||||
|
||||
out_schema: dict[str, Any] | None
|
||||
if isinstance(self.out_schema, ApiResponseWorkflowResponseDataOutSchemaType0):
|
||||
out_schema = self.out_schema.to_dict()
|
||||
else:
|
||||
out_schema = self.out_schema
|
||||
|
||||
pack = self.pack
|
||||
|
||||
pack_ref = self.pack_ref
|
||||
|
||||
param_schema: dict[str, Any] | None
|
||||
if isinstance(self.param_schema, ApiResponseWorkflowResponseDataParamSchemaType0):
|
||||
param_schema = self.param_schema.to_dict()
|
||||
else:
|
||||
param_schema = self.param_schema
|
||||
|
||||
ref = self.ref
|
||||
|
||||
tags = self.tags
|
||||
|
||||
|
||||
|
||||
updated = self.updated.isoformat()
|
||||
|
||||
version = self.version
|
||||
|
||||
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({
|
||||
"created": created,
|
||||
"definition": definition,
|
||||
"enabled": enabled,
|
||||
"id": id,
|
||||
"label": label,
|
||||
"out_schema": out_schema,
|
||||
"pack": pack,
|
||||
"pack_ref": pack_ref,
|
||||
"param_schema": param_schema,
|
||||
"ref": ref,
|
||||
"tags": tags,
|
||||
"updated": updated,
|
||||
"version": version,
|
||||
})
|
||||
if description is not UNSET:
|
||||
field_dict["description"] = description
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.api_response_workflow_response_data_definition import ApiResponseWorkflowResponseDataDefinition
|
||||
from ..models.api_response_workflow_response_data_out_schema_type_0 import ApiResponseWorkflowResponseDataOutSchemaType0
|
||||
from ..models.api_response_workflow_response_data_param_schema_type_0 import ApiResponseWorkflowResponseDataParamSchemaType0
|
||||
d = dict(src_dict)
|
||||
created = isoparse(d.pop("created"))
|
||||
|
||||
|
||||
|
||||
|
||||
definition = ApiResponseWorkflowResponseDataDefinition.from_dict(d.pop("definition"))
|
||||
|
||||
|
||||
|
||||
|
||||
enabled = d.pop("enabled")
|
||||
|
||||
id = d.pop("id")
|
||||
|
||||
label = d.pop("label")
|
||||
|
||||
def _parse_out_schema(data: object) -> ApiResponseWorkflowResponseDataOutSchemaType0 | None:
|
||||
if data is None:
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
out_schema_type_0 = ApiResponseWorkflowResponseDataOutSchemaType0.from_dict(data)
|
||||
|
||||
|
||||
|
||||
return out_schema_type_0
|
||||
except (TypeError, ValueError, AttributeError, KeyError):
|
||||
pass
|
||||
return cast(ApiResponseWorkflowResponseDataOutSchemaType0 | None, data)
|
||||
|
||||
out_schema = _parse_out_schema(d.pop("out_schema"))
|
||||
|
||||
|
||||
pack = d.pop("pack")
|
||||
|
||||
pack_ref = d.pop("pack_ref")
|
||||
|
||||
def _parse_param_schema(data: object) -> ApiResponseWorkflowResponseDataParamSchemaType0 | None:
|
||||
if data is None:
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
param_schema_type_0 = ApiResponseWorkflowResponseDataParamSchemaType0.from_dict(data)
|
||||
|
||||
|
||||
|
||||
return param_schema_type_0
|
||||
except (TypeError, ValueError, AttributeError, KeyError):
|
||||
pass
|
||||
return cast(ApiResponseWorkflowResponseDataParamSchemaType0 | None, data)
|
||||
|
||||
param_schema = _parse_param_schema(d.pop("param_schema"))
|
||||
|
||||
|
||||
ref = d.pop("ref")
|
||||
|
||||
tags = cast(list[str], d.pop("tags"))
|
||||
|
||||
|
||||
updated = isoparse(d.pop("updated"))
|
||||
|
||||
|
||||
|
||||
|
||||
version = d.pop("version")
|
||||
|
||||
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))
|
||||
|
||||
|
||||
api_response_workflow_response_data = cls(
|
||||
created=created,
|
||||
definition=definition,
|
||||
enabled=enabled,
|
||||
id=id,
|
||||
label=label,
|
||||
out_schema=out_schema,
|
||||
pack=pack,
|
||||
pack_ref=pack_ref,
|
||||
param_schema=param_schema,
|
||||
ref=ref,
|
||||
tags=tags,
|
||||
updated=updated,
|
||||
version=version,
|
||||
description=description,
|
||||
)
|
||||
|
||||
|
||||
api_response_workflow_response_data.additional_properties = d
|
||||
return api_response_workflow_response_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
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseWorkflowResponseDataDefinition")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseWorkflowResponseDataDefinition:
|
||||
""" Workflow definition
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
api_response_workflow_response_data_definition = cls(
|
||||
)
|
||||
|
||||
|
||||
api_response_workflow_response_data_definition.additional_properties = d
|
||||
return api_response_workflow_response_data_definition
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseWorkflowResponseDataOutSchemaType0")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseWorkflowResponseDataOutSchemaType0:
|
||||
""" Output schema
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
api_response_workflow_response_data_out_schema_type_0 = cls(
|
||||
)
|
||||
|
||||
|
||||
api_response_workflow_response_data_out_schema_type_0.additional_properties = d
|
||||
return api_response_workflow_response_data_out_schema_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
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ApiResponseWorkflowResponseDataParamSchemaType0")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ApiResponseWorkflowResponseDataParamSchemaType0:
|
||||
""" Parameter schema
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
api_response_workflow_response_data_param_schema_type_0 = cls(
|
||||
)
|
||||
|
||||
|
||||
api_response_workflow_response_data_param_schema_type_0.additional_properties = d
|
||||
return api_response_workflow_response_data_param_schema_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
|
||||
85
tests/generated_client/models/change_password_request.py
Normal file
85
tests/generated_client/models/change_password_request.py
Normal file
@@ -0,0 +1,85 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ChangePasswordRequest")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ChangePasswordRequest:
|
||||
""" Change password request
|
||||
|
||||
Attributes:
|
||||
current_password (str): Current password Example: OldPassword123!.
|
||||
new_password (str): New password Example: NewPassword456!.
|
||||
"""
|
||||
|
||||
current_password: str
|
||||
new_password: str
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
current_password = self.current_password
|
||||
|
||||
new_password = self.new_password
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"current_password": current_password,
|
||||
"new_password": new_password,
|
||||
})
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
current_password = d.pop("current_password")
|
||||
|
||||
new_password = d.pop("new_password")
|
||||
|
||||
change_password_request = cls(
|
||||
current_password=current_password,
|
||||
new_password=new_password,
|
||||
)
|
||||
|
||||
|
||||
change_password_request.additional_properties = d
|
||||
return change_password_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
|
||||
107
tests/generated_client/models/change_password_response_200.py
Normal file
107
tests/generated_client/models/change_password_response_200.py
Normal file
@@ -0,0 +1,107 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from typing import cast
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.change_password_response_200_data import ChangePasswordResponse200Data
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ChangePasswordResponse200")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ChangePasswordResponse200:
|
||||
""" Standard API response wrapper
|
||||
|
||||
Attributes:
|
||||
data (ChangePasswordResponse200Data): Success message response (for operations that don't return data)
|
||||
message (None | str | Unset): Optional message
|
||||
"""
|
||||
|
||||
data: ChangePasswordResponse200Data
|
||||
message: None | str | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.change_password_response_200_data import ChangePasswordResponse200Data
|
||||
data = self.data.to_dict()
|
||||
|
||||
message: None | str | Unset
|
||||
if isinstance(self.message, Unset):
|
||||
message = UNSET
|
||||
else:
|
||||
message = self.message
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"data": data,
|
||||
})
|
||||
if message is not UNSET:
|
||||
field_dict["message"] = message
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.change_password_response_200_data import ChangePasswordResponse200Data
|
||||
d = dict(src_dict)
|
||||
data = ChangePasswordResponse200Data.from_dict(d.pop("data"))
|
||||
|
||||
|
||||
|
||||
|
||||
def _parse_message(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
message = _parse_message(d.pop("message", UNSET))
|
||||
|
||||
|
||||
change_password_response_200 = cls(
|
||||
data=data,
|
||||
message=message,
|
||||
)
|
||||
|
||||
|
||||
change_password_response_200.additional_properties = d
|
||||
return change_password_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
|
||||
@@ -0,0 +1,85 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="ChangePasswordResponse200Data")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ChangePasswordResponse200Data:
|
||||
""" Success message response (for operations that don't return data)
|
||||
|
||||
Attributes:
|
||||
message (str): Message describing the operation Example: Operation completed successfully.
|
||||
success (bool): Success indicator Example: True.
|
||||
"""
|
||||
|
||||
message: str
|
||||
success: bool
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
message = self.message
|
||||
|
||||
success = self.success
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"message": message,
|
||||
"success": success,
|
||||
})
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
message = d.pop("message")
|
||||
|
||||
success = d.pop("success")
|
||||
|
||||
change_password_response_200_data = cls(
|
||||
message=message,
|
||||
success=success,
|
||||
)
|
||||
|
||||
|
||||
change_password_response_200_data.additional_properties = d
|
||||
return change_password_response_200_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
|
||||
209
tests/generated_client/models/create_action_request.py
Normal file
209
tests/generated_client/models/create_action_request.py
Normal file
@@ -0,0 +1,209 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from typing import cast
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.create_action_request_out_schema_type_0 import CreateActionRequestOutSchemaType0
|
||||
from ..models.create_action_request_param_schema_type_0 import CreateActionRequestParamSchemaType0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="CreateActionRequest")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CreateActionRequest:
|
||||
""" Request DTO for creating a new action
|
||||
|
||||
Attributes:
|
||||
description (str): Action description Example: Posts a message to a Slack channel.
|
||||
entrypoint (str): Entry point for action execution (e.g., path to script, function name) Example:
|
||||
/actions/slack/post_message.py.
|
||||
label (str): Human-readable label Example: Post Message to Slack.
|
||||
pack_ref (str): Pack reference this action belongs to Example: slack.
|
||||
ref (str): Unique reference identifier (e.g., "core.http", "aws.ec2.start_instance") Example:
|
||||
slack.post_message.
|
||||
out_schema (CreateActionRequestOutSchemaType0 | None | Unset): Output schema (JSON Schema) defining expected
|
||||
outputs
|
||||
param_schema (CreateActionRequestParamSchemaType0 | None | Unset): Parameter schema (JSON Schema) defining
|
||||
expected inputs
|
||||
runtime (int | None | Unset): Optional runtime ID for this action Example: 1.
|
||||
"""
|
||||
|
||||
description: str
|
||||
entrypoint: str
|
||||
label: str
|
||||
pack_ref: str
|
||||
ref: str
|
||||
out_schema: CreateActionRequestOutSchemaType0 | None | Unset = UNSET
|
||||
param_schema: CreateActionRequestParamSchemaType0 | None | Unset = UNSET
|
||||
runtime: int | None | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.create_action_request_out_schema_type_0 import CreateActionRequestOutSchemaType0
|
||||
from ..models.create_action_request_param_schema_type_0 import CreateActionRequestParamSchemaType0
|
||||
description = self.description
|
||||
|
||||
entrypoint = self.entrypoint
|
||||
|
||||
label = self.label
|
||||
|
||||
pack_ref = self.pack_ref
|
||||
|
||||
ref = self.ref
|
||||
|
||||
out_schema: dict[str, Any] | None | Unset
|
||||
if isinstance(self.out_schema, Unset):
|
||||
out_schema = UNSET
|
||||
elif isinstance(self.out_schema, CreateActionRequestOutSchemaType0):
|
||||
out_schema = self.out_schema.to_dict()
|
||||
else:
|
||||
out_schema = self.out_schema
|
||||
|
||||
param_schema: dict[str, Any] | None | Unset
|
||||
if isinstance(self.param_schema, Unset):
|
||||
param_schema = UNSET
|
||||
elif isinstance(self.param_schema, CreateActionRequestParamSchemaType0):
|
||||
param_schema = self.param_schema.to_dict()
|
||||
else:
|
||||
param_schema = self.param_schema
|
||||
|
||||
runtime: int | None | Unset
|
||||
if isinstance(self.runtime, Unset):
|
||||
runtime = UNSET
|
||||
else:
|
||||
runtime = self.runtime
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"description": description,
|
||||
"entrypoint": entrypoint,
|
||||
"label": label,
|
||||
"pack_ref": pack_ref,
|
||||
"ref": ref,
|
||||
})
|
||||
if out_schema is not UNSET:
|
||||
field_dict["out_schema"] = out_schema
|
||||
if param_schema is not UNSET:
|
||||
field_dict["param_schema"] = param_schema
|
||||
if runtime is not UNSET:
|
||||
field_dict["runtime"] = runtime
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.create_action_request_out_schema_type_0 import CreateActionRequestOutSchemaType0
|
||||
from ..models.create_action_request_param_schema_type_0 import CreateActionRequestParamSchemaType0
|
||||
d = dict(src_dict)
|
||||
description = d.pop("description")
|
||||
|
||||
entrypoint = d.pop("entrypoint")
|
||||
|
||||
label = d.pop("label")
|
||||
|
||||
pack_ref = d.pop("pack_ref")
|
||||
|
||||
ref = d.pop("ref")
|
||||
|
||||
def _parse_out_schema(data: object) -> CreateActionRequestOutSchemaType0 | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
out_schema_type_0 = CreateActionRequestOutSchemaType0.from_dict(data)
|
||||
|
||||
|
||||
|
||||
return out_schema_type_0
|
||||
except (TypeError, ValueError, AttributeError, KeyError):
|
||||
pass
|
||||
return cast(CreateActionRequestOutSchemaType0 | None | Unset, data)
|
||||
|
||||
out_schema = _parse_out_schema(d.pop("out_schema", UNSET))
|
||||
|
||||
|
||||
def _parse_param_schema(data: object) -> CreateActionRequestParamSchemaType0 | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
param_schema_type_0 = CreateActionRequestParamSchemaType0.from_dict(data)
|
||||
|
||||
|
||||
|
||||
return param_schema_type_0
|
||||
except (TypeError, ValueError, AttributeError, KeyError):
|
||||
pass
|
||||
return cast(CreateActionRequestParamSchemaType0 | None | Unset, data)
|
||||
|
||||
param_schema = _parse_param_schema(d.pop("param_schema", UNSET))
|
||||
|
||||
|
||||
def _parse_runtime(data: object) -> int | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(int | None | Unset, data)
|
||||
|
||||
runtime = _parse_runtime(d.pop("runtime", UNSET))
|
||||
|
||||
|
||||
create_action_request = cls(
|
||||
description=description,
|
||||
entrypoint=entrypoint,
|
||||
label=label,
|
||||
pack_ref=pack_ref,
|
||||
ref=ref,
|
||||
out_schema=out_schema,
|
||||
param_schema=param_schema,
|
||||
runtime=runtime,
|
||||
)
|
||||
|
||||
|
||||
create_action_request.additional_properties = d
|
||||
return create_action_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
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="CreateActionRequestOutSchemaType0")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CreateActionRequestOutSchemaType0:
|
||||
""" Output schema (JSON Schema) defining expected outputs
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
create_action_request_out_schema_type_0 = cls(
|
||||
)
|
||||
|
||||
|
||||
create_action_request_out_schema_type_0.additional_properties = d
|
||||
return create_action_request_out_schema_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
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="CreateActionRequestParamSchemaType0")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CreateActionRequestParamSchemaType0:
|
||||
""" Parameter schema (JSON Schema) defining expected inputs
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
create_action_request_param_schema_type_0 = cls(
|
||||
)
|
||||
|
||||
|
||||
create_action_request_param_schema_type_0.additional_properties = d
|
||||
return create_action_request_param_schema_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
|
||||
107
tests/generated_client/models/create_action_response_201.py
Normal file
107
tests/generated_client/models/create_action_response_201.py
Normal file
@@ -0,0 +1,107 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from typing import cast
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.create_action_response_201_data import CreateActionResponse201Data
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="CreateActionResponse201")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CreateActionResponse201:
|
||||
""" Standard API response wrapper
|
||||
|
||||
Attributes:
|
||||
data (CreateActionResponse201Data): Response DTO for action information
|
||||
message (None | str | Unset): Optional message
|
||||
"""
|
||||
|
||||
data: CreateActionResponse201Data
|
||||
message: None | str | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.create_action_response_201_data import CreateActionResponse201Data
|
||||
data = self.data.to_dict()
|
||||
|
||||
message: None | str | Unset
|
||||
if isinstance(self.message, Unset):
|
||||
message = UNSET
|
||||
else:
|
||||
message = self.message
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"data": data,
|
||||
})
|
||||
if message is not UNSET:
|
||||
field_dict["message"] = message
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.create_action_response_201_data import CreateActionResponse201Data
|
||||
d = dict(src_dict)
|
||||
data = CreateActionResponse201Data.from_dict(d.pop("data"))
|
||||
|
||||
|
||||
|
||||
|
||||
def _parse_message(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
message = _parse_message(d.pop("message", UNSET))
|
||||
|
||||
|
||||
create_action_response_201 = cls(
|
||||
data=data,
|
||||
message=message,
|
||||
)
|
||||
|
||||
|
||||
create_action_response_201.additional_properties = d
|
||||
return create_action_response_201
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
235
tests/generated_client/models/create_action_response_201_data.py
Normal file
235
tests/generated_client/models/create_action_response_201_data.py
Normal file
@@ -0,0 +1,235 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from dateutil.parser import isoparse
|
||||
from typing import cast
|
||||
import datetime
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.create_action_response_201_data_out_schema_type_0 import CreateActionResponse201DataOutSchemaType0
|
||||
from ..models.create_action_response_201_data_param_schema_type_0 import CreateActionResponse201DataParamSchemaType0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="CreateActionResponse201Data")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CreateActionResponse201Data:
|
||||
""" Response DTO for action information
|
||||
|
||||
Attributes:
|
||||
created (datetime.datetime): Creation timestamp Example: 2024-01-13T10:30:00Z.
|
||||
description (str): Action description Example: Posts a message to a Slack channel.
|
||||
entrypoint (str): Entry point Example: /actions/slack/post_message.py.
|
||||
id (int): Action ID Example: 1.
|
||||
label (str): Human-readable label Example: Post Message to Slack.
|
||||
out_schema (CreateActionResponse201DataOutSchemaType0 | None): Output schema
|
||||
pack (int): Pack ID Example: 1.
|
||||
pack_ref (str): Pack reference Example: slack.
|
||||
param_schema (CreateActionResponse201DataParamSchemaType0 | None): Parameter schema
|
||||
ref (str): Unique reference identifier Example: slack.post_message.
|
||||
updated (datetime.datetime): Last update timestamp Example: 2024-01-13T10:30:00Z.
|
||||
runtime (int | None | Unset): Runtime ID Example: 1.
|
||||
"""
|
||||
|
||||
created: datetime.datetime
|
||||
description: str
|
||||
entrypoint: str
|
||||
id: int
|
||||
label: str
|
||||
out_schema: CreateActionResponse201DataOutSchemaType0 | None
|
||||
pack: int
|
||||
pack_ref: str
|
||||
param_schema: CreateActionResponse201DataParamSchemaType0 | None
|
||||
ref: str
|
||||
updated: datetime.datetime
|
||||
runtime: int | None | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.create_action_response_201_data_out_schema_type_0 import CreateActionResponse201DataOutSchemaType0
|
||||
from ..models.create_action_response_201_data_param_schema_type_0 import CreateActionResponse201DataParamSchemaType0
|
||||
created = self.created.isoformat()
|
||||
|
||||
description = self.description
|
||||
|
||||
entrypoint = self.entrypoint
|
||||
|
||||
id = self.id
|
||||
|
||||
label = self.label
|
||||
|
||||
out_schema: dict[str, Any] | None
|
||||
if isinstance(self.out_schema, CreateActionResponse201DataOutSchemaType0):
|
||||
out_schema = self.out_schema.to_dict()
|
||||
else:
|
||||
out_schema = self.out_schema
|
||||
|
||||
pack = self.pack
|
||||
|
||||
pack_ref = self.pack_ref
|
||||
|
||||
param_schema: dict[str, Any] | None
|
||||
if isinstance(self.param_schema, CreateActionResponse201DataParamSchemaType0):
|
||||
param_schema = self.param_schema.to_dict()
|
||||
else:
|
||||
param_schema = self.param_schema
|
||||
|
||||
ref = self.ref
|
||||
|
||||
updated = self.updated.isoformat()
|
||||
|
||||
runtime: int | None | Unset
|
||||
if isinstance(self.runtime, Unset):
|
||||
runtime = UNSET
|
||||
else:
|
||||
runtime = self.runtime
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"created": created,
|
||||
"description": description,
|
||||
"entrypoint": entrypoint,
|
||||
"id": id,
|
||||
"label": label,
|
||||
"out_schema": out_schema,
|
||||
"pack": pack,
|
||||
"pack_ref": pack_ref,
|
||||
"param_schema": param_schema,
|
||||
"ref": ref,
|
||||
"updated": updated,
|
||||
})
|
||||
if runtime is not UNSET:
|
||||
field_dict["runtime"] = runtime
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.create_action_response_201_data_out_schema_type_0 import CreateActionResponse201DataOutSchemaType0
|
||||
from ..models.create_action_response_201_data_param_schema_type_0 import CreateActionResponse201DataParamSchemaType0
|
||||
d = dict(src_dict)
|
||||
created = isoparse(d.pop("created"))
|
||||
|
||||
|
||||
|
||||
|
||||
description = d.pop("description")
|
||||
|
||||
entrypoint = d.pop("entrypoint")
|
||||
|
||||
id = d.pop("id")
|
||||
|
||||
label = d.pop("label")
|
||||
|
||||
def _parse_out_schema(data: object) -> CreateActionResponse201DataOutSchemaType0 | None:
|
||||
if data is None:
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
out_schema_type_0 = CreateActionResponse201DataOutSchemaType0.from_dict(data)
|
||||
|
||||
|
||||
|
||||
return out_schema_type_0
|
||||
except (TypeError, ValueError, AttributeError, KeyError):
|
||||
pass
|
||||
return cast(CreateActionResponse201DataOutSchemaType0 | None, data)
|
||||
|
||||
out_schema = _parse_out_schema(d.pop("out_schema"))
|
||||
|
||||
|
||||
pack = d.pop("pack")
|
||||
|
||||
pack_ref = d.pop("pack_ref")
|
||||
|
||||
def _parse_param_schema(data: object) -> CreateActionResponse201DataParamSchemaType0 | None:
|
||||
if data is None:
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
param_schema_type_0 = CreateActionResponse201DataParamSchemaType0.from_dict(data)
|
||||
|
||||
|
||||
|
||||
return param_schema_type_0
|
||||
except (TypeError, ValueError, AttributeError, KeyError):
|
||||
pass
|
||||
return cast(CreateActionResponse201DataParamSchemaType0 | None, data)
|
||||
|
||||
param_schema = _parse_param_schema(d.pop("param_schema"))
|
||||
|
||||
|
||||
ref = d.pop("ref")
|
||||
|
||||
updated = isoparse(d.pop("updated"))
|
||||
|
||||
|
||||
|
||||
|
||||
def _parse_runtime(data: object) -> int | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(int | None | Unset, data)
|
||||
|
||||
runtime = _parse_runtime(d.pop("runtime", UNSET))
|
||||
|
||||
|
||||
create_action_response_201_data = cls(
|
||||
created=created,
|
||||
description=description,
|
||||
entrypoint=entrypoint,
|
||||
id=id,
|
||||
label=label,
|
||||
out_schema=out_schema,
|
||||
pack=pack,
|
||||
pack_ref=pack_ref,
|
||||
param_schema=param_schema,
|
||||
ref=ref,
|
||||
updated=updated,
|
||||
runtime=runtime,
|
||||
)
|
||||
|
||||
|
||||
create_action_response_201_data.additional_properties = d
|
||||
return create_action_response_201_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
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="CreateActionResponse201DataOutSchemaType0")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CreateActionResponse201DataOutSchemaType0:
|
||||
""" Output schema
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
create_action_response_201_data_out_schema_type_0 = cls(
|
||||
)
|
||||
|
||||
|
||||
create_action_response_201_data_out_schema_type_0.additional_properties = d
|
||||
return create_action_response_201_data_out_schema_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
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="CreateActionResponse201DataParamSchemaType0")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CreateActionResponse201DataParamSchemaType0:
|
||||
""" Parameter schema
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
create_action_response_201_data_param_schema_type_0 = cls(
|
||||
)
|
||||
|
||||
|
||||
create_action_response_201_data_param_schema_type_0.additional_properties = d
|
||||
return create_action_response_201_data_param_schema_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
|
||||
159
tests/generated_client/models/create_inquiry_request.py
Normal file
159
tests/generated_client/models/create_inquiry_request.py
Normal file
@@ -0,0 +1,159 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from dateutil.parser import isoparse
|
||||
from typing import cast
|
||||
import datetime
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.create_inquiry_request_response_schema import CreateInquiryRequestResponseSchema
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="CreateInquiryRequest")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CreateInquiryRequest:
|
||||
""" Request to create a new inquiry
|
||||
|
||||
Attributes:
|
||||
execution (int):
|
||||
prompt (str): Prompt text to display to the user Example: Approve deployment to production?.
|
||||
response_schema (CreateInquiryRequestResponseSchema): Optional JSON schema for the expected response format
|
||||
assigned_to (int | None | Unset):
|
||||
timeout_at (datetime.datetime | None | Unset): Optional timeout timestamp (when inquiry expires) Example:
|
||||
2024-01-13T11:30:00Z.
|
||||
"""
|
||||
|
||||
execution: int
|
||||
prompt: str
|
||||
response_schema: CreateInquiryRequestResponseSchema
|
||||
assigned_to: int | None | Unset = UNSET
|
||||
timeout_at: datetime.datetime | None | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.create_inquiry_request_response_schema import CreateInquiryRequestResponseSchema
|
||||
execution = self.execution
|
||||
|
||||
prompt = self.prompt
|
||||
|
||||
response_schema = self.response_schema.to_dict()
|
||||
|
||||
assigned_to: int | None | Unset
|
||||
if isinstance(self.assigned_to, Unset):
|
||||
assigned_to = UNSET
|
||||
else:
|
||||
assigned_to = self.assigned_to
|
||||
|
||||
timeout_at: None | str | Unset
|
||||
if isinstance(self.timeout_at, Unset):
|
||||
timeout_at = UNSET
|
||||
elif isinstance(self.timeout_at, datetime.datetime):
|
||||
timeout_at = self.timeout_at.isoformat()
|
||||
else:
|
||||
timeout_at = self.timeout_at
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"execution": execution,
|
||||
"prompt": prompt,
|
||||
"response_schema": response_schema,
|
||||
})
|
||||
if assigned_to is not UNSET:
|
||||
field_dict["assigned_to"] = assigned_to
|
||||
if timeout_at is not UNSET:
|
||||
field_dict["timeout_at"] = timeout_at
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.create_inquiry_request_response_schema import CreateInquiryRequestResponseSchema
|
||||
d = dict(src_dict)
|
||||
execution = d.pop("execution")
|
||||
|
||||
prompt = d.pop("prompt")
|
||||
|
||||
response_schema = CreateInquiryRequestResponseSchema.from_dict(d.pop("response_schema"))
|
||||
|
||||
|
||||
|
||||
|
||||
def _parse_assigned_to(data: object) -> int | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(int | None | Unset, data)
|
||||
|
||||
assigned_to = _parse_assigned_to(d.pop("assigned_to", UNSET))
|
||||
|
||||
|
||||
def _parse_timeout_at(data: object) -> datetime.datetime | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, str):
|
||||
raise TypeError()
|
||||
timeout_at_type_0 = isoparse(data)
|
||||
|
||||
|
||||
|
||||
return timeout_at_type_0
|
||||
except (TypeError, ValueError, AttributeError, KeyError):
|
||||
pass
|
||||
return cast(datetime.datetime | None | Unset, data)
|
||||
|
||||
timeout_at = _parse_timeout_at(d.pop("timeout_at", UNSET))
|
||||
|
||||
|
||||
create_inquiry_request = cls(
|
||||
execution=execution,
|
||||
prompt=prompt,
|
||||
response_schema=response_schema,
|
||||
assigned_to=assigned_to,
|
||||
timeout_at=timeout_at,
|
||||
)
|
||||
|
||||
|
||||
create_inquiry_request.additional_properties = d
|
||||
return create_inquiry_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
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="CreateInquiryRequestResponseSchema")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CreateInquiryRequestResponseSchema:
|
||||
""" Optional JSON schema for the expected response format
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
create_inquiry_request_response_schema = cls(
|
||||
)
|
||||
|
||||
|
||||
create_inquiry_request_response_schema.additional_properties = d
|
||||
return create_inquiry_request_response_schema
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
284
tests/generated_client/models/create_key_request.py
Normal file
284
tests/generated_client/models/create_key_request.py
Normal file
@@ -0,0 +1,284 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..models.owner_type import OwnerType
|
||||
from ..types import UNSET, Unset
|
||||
from typing import cast
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="CreateKeyRequest")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CreateKeyRequest:
|
||||
""" Request to create a new key/secret
|
||||
|
||||
Attributes:
|
||||
name (str): Human-readable name for the key Example: GitHub API Token.
|
||||
owner_type (OwnerType):
|
||||
ref (str): Unique reference for the key (e.g., "github_token", "aws_secret_key") Example: github_token.
|
||||
value (str): The secret value to store Example: ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
|
||||
encrypted (bool | Unset): Whether to encrypt the value (recommended: true) Example: True.
|
||||
owner (None | str | Unset): Optional owner string identifier Example: github-integration.
|
||||
owner_action (int | None | Unset):
|
||||
owner_action_ref (None | str | Unset): Optional owner action reference Example: github.create_issue.
|
||||
owner_identity (int | None | Unset):
|
||||
owner_pack (int | None | Unset):
|
||||
owner_pack_ref (None | str | Unset): Optional owner pack reference Example: github.
|
||||
owner_sensor (int | None | Unset):
|
||||
owner_sensor_ref (None | str | Unset): Optional owner sensor reference Example: github.webhook.
|
||||
"""
|
||||
|
||||
name: str
|
||||
owner_type: OwnerType
|
||||
ref: str
|
||||
value: str
|
||||
encrypted: bool | Unset = UNSET
|
||||
owner: None | str | Unset = UNSET
|
||||
owner_action: int | None | Unset = UNSET
|
||||
owner_action_ref: None | str | Unset = UNSET
|
||||
owner_identity: int | None | Unset = UNSET
|
||||
owner_pack: int | None | Unset = UNSET
|
||||
owner_pack_ref: None | str | Unset = UNSET
|
||||
owner_sensor: int | None | Unset = UNSET
|
||||
owner_sensor_ref: None | str | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
name = self.name
|
||||
|
||||
owner_type = self.owner_type.value
|
||||
|
||||
ref = self.ref
|
||||
|
||||
value = self.value
|
||||
|
||||
encrypted = self.encrypted
|
||||
|
||||
owner: None | str | Unset
|
||||
if isinstance(self.owner, Unset):
|
||||
owner = UNSET
|
||||
else:
|
||||
owner = self.owner
|
||||
|
||||
owner_action: int | None | Unset
|
||||
if isinstance(self.owner_action, Unset):
|
||||
owner_action = UNSET
|
||||
else:
|
||||
owner_action = self.owner_action
|
||||
|
||||
owner_action_ref: None | str | Unset
|
||||
if isinstance(self.owner_action_ref, Unset):
|
||||
owner_action_ref = UNSET
|
||||
else:
|
||||
owner_action_ref = self.owner_action_ref
|
||||
|
||||
owner_identity: int | None | Unset
|
||||
if isinstance(self.owner_identity, Unset):
|
||||
owner_identity = UNSET
|
||||
else:
|
||||
owner_identity = self.owner_identity
|
||||
|
||||
owner_pack: int | None | Unset
|
||||
if isinstance(self.owner_pack, Unset):
|
||||
owner_pack = UNSET
|
||||
else:
|
||||
owner_pack = self.owner_pack
|
||||
|
||||
owner_pack_ref: None | str | Unset
|
||||
if isinstance(self.owner_pack_ref, Unset):
|
||||
owner_pack_ref = UNSET
|
||||
else:
|
||||
owner_pack_ref = self.owner_pack_ref
|
||||
|
||||
owner_sensor: int | None | Unset
|
||||
if isinstance(self.owner_sensor, Unset):
|
||||
owner_sensor = UNSET
|
||||
else:
|
||||
owner_sensor = self.owner_sensor
|
||||
|
||||
owner_sensor_ref: None | str | Unset
|
||||
if isinstance(self.owner_sensor_ref, Unset):
|
||||
owner_sensor_ref = UNSET
|
||||
else:
|
||||
owner_sensor_ref = self.owner_sensor_ref
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"name": name,
|
||||
"owner_type": owner_type,
|
||||
"ref": ref,
|
||||
"value": value,
|
||||
})
|
||||
if encrypted is not UNSET:
|
||||
field_dict["encrypted"] = encrypted
|
||||
if owner is not UNSET:
|
||||
field_dict["owner"] = owner
|
||||
if owner_action is not UNSET:
|
||||
field_dict["owner_action"] = owner_action
|
||||
if owner_action_ref is not UNSET:
|
||||
field_dict["owner_action_ref"] = owner_action_ref
|
||||
if owner_identity is not UNSET:
|
||||
field_dict["owner_identity"] = owner_identity
|
||||
if owner_pack is not UNSET:
|
||||
field_dict["owner_pack"] = owner_pack
|
||||
if owner_pack_ref is not UNSET:
|
||||
field_dict["owner_pack_ref"] = owner_pack_ref
|
||||
if owner_sensor is not UNSET:
|
||||
field_dict["owner_sensor"] = owner_sensor
|
||||
if owner_sensor_ref is not UNSET:
|
||||
field_dict["owner_sensor_ref"] = owner_sensor_ref
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
name = d.pop("name")
|
||||
|
||||
owner_type = OwnerType(d.pop("owner_type"))
|
||||
|
||||
|
||||
|
||||
|
||||
ref = d.pop("ref")
|
||||
|
||||
value = d.pop("value")
|
||||
|
||||
encrypted = d.pop("encrypted", UNSET)
|
||||
|
||||
def _parse_owner(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
owner = _parse_owner(d.pop("owner", UNSET))
|
||||
|
||||
|
||||
def _parse_owner_action(data: object) -> int | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(int | None | Unset, data)
|
||||
|
||||
owner_action = _parse_owner_action(d.pop("owner_action", UNSET))
|
||||
|
||||
|
||||
def _parse_owner_action_ref(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
owner_action_ref = _parse_owner_action_ref(d.pop("owner_action_ref", UNSET))
|
||||
|
||||
|
||||
def _parse_owner_identity(data: object) -> int | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(int | None | Unset, data)
|
||||
|
||||
owner_identity = _parse_owner_identity(d.pop("owner_identity", UNSET))
|
||||
|
||||
|
||||
def _parse_owner_pack(data: object) -> int | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(int | None | Unset, data)
|
||||
|
||||
owner_pack = _parse_owner_pack(d.pop("owner_pack", UNSET))
|
||||
|
||||
|
||||
def _parse_owner_pack_ref(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
owner_pack_ref = _parse_owner_pack_ref(d.pop("owner_pack_ref", UNSET))
|
||||
|
||||
|
||||
def _parse_owner_sensor(data: object) -> int | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(int | None | Unset, data)
|
||||
|
||||
owner_sensor = _parse_owner_sensor(d.pop("owner_sensor", UNSET))
|
||||
|
||||
|
||||
def _parse_owner_sensor_ref(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
owner_sensor_ref = _parse_owner_sensor_ref(d.pop("owner_sensor_ref", UNSET))
|
||||
|
||||
|
||||
create_key_request = cls(
|
||||
name=name,
|
||||
owner_type=owner_type,
|
||||
ref=ref,
|
||||
value=value,
|
||||
encrypted=encrypted,
|
||||
owner=owner,
|
||||
owner_action=owner_action,
|
||||
owner_action_ref=owner_action_ref,
|
||||
owner_identity=owner_identity,
|
||||
owner_pack=owner_pack,
|
||||
owner_pack_ref=owner_pack_ref,
|
||||
owner_sensor=owner_sensor,
|
||||
owner_sensor_ref=owner_sensor_ref,
|
||||
)
|
||||
|
||||
|
||||
create_key_request.additional_properties = d
|
||||
return create_key_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
|
||||
107
tests/generated_client/models/create_key_response_201.py
Normal file
107
tests/generated_client/models/create_key_response_201.py
Normal file
@@ -0,0 +1,107 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from typing import cast
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.create_key_response_201_data import CreateKeyResponse201Data
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="CreateKeyResponse201")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CreateKeyResponse201:
|
||||
""" Standard API response wrapper
|
||||
|
||||
Attributes:
|
||||
data (CreateKeyResponse201Data): Full key response with all details (value redacted in list views)
|
||||
message (None | str | Unset): Optional message
|
||||
"""
|
||||
|
||||
data: CreateKeyResponse201Data
|
||||
message: None | str | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.create_key_response_201_data import CreateKeyResponse201Data
|
||||
data = self.data.to_dict()
|
||||
|
||||
message: None | str | Unset
|
||||
if isinstance(self.message, Unset):
|
||||
message = UNSET
|
||||
else:
|
||||
message = self.message
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"data": data,
|
||||
})
|
||||
if message is not UNSET:
|
||||
field_dict["message"] = message
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.create_key_response_201_data import CreateKeyResponse201Data
|
||||
d = dict(src_dict)
|
||||
data = CreateKeyResponse201Data.from_dict(d.pop("data"))
|
||||
|
||||
|
||||
|
||||
|
||||
def _parse_message(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
message = _parse_message(d.pop("message", UNSET))
|
||||
|
||||
|
||||
create_key_response_201 = cls(
|
||||
data=data,
|
||||
message=message,
|
||||
)
|
||||
|
||||
|
||||
create_key_response_201.additional_properties = d
|
||||
return create_key_response_201
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
315
tests/generated_client/models/create_key_response_201_data.py
Normal file
315
tests/generated_client/models/create_key_response_201_data.py
Normal file
@@ -0,0 +1,315 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..models.owner_type import OwnerType
|
||||
from ..types import UNSET, Unset
|
||||
from dateutil.parser import isoparse
|
||||
from typing import cast
|
||||
import datetime
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="CreateKeyResponse201Data")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CreateKeyResponse201Data:
|
||||
""" Full key response with all details (value redacted in list views)
|
||||
|
||||
Attributes:
|
||||
created (datetime.datetime): Creation timestamp Example: 2024-01-13T10:30:00Z.
|
||||
encrypted (bool): Whether the value is encrypted Example: True.
|
||||
id (int):
|
||||
name (str): Human-readable name Example: GitHub API Token.
|
||||
owner_type (OwnerType):
|
||||
ref (str): Unique reference identifier Example: github_token.
|
||||
updated (datetime.datetime): Last update timestamp Example: 2024-01-13T10:30:00Z.
|
||||
value (str): The secret value (decrypted if encrypted) Example: ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
|
||||
owner (None | str | Unset): Owner identifier Example: github-integration.
|
||||
owner_action (int | None | Unset):
|
||||
owner_action_ref (None | str | Unset): Owner action reference Example: github.create_issue.
|
||||
owner_identity (int | None | Unset):
|
||||
owner_pack (int | None | Unset):
|
||||
owner_pack_ref (None | str | Unset): Owner pack reference Example: github.
|
||||
owner_sensor (int | None | Unset):
|
||||
owner_sensor_ref (None | str | Unset): Owner sensor reference Example: github.webhook.
|
||||
"""
|
||||
|
||||
created: datetime.datetime
|
||||
encrypted: bool
|
||||
id: int
|
||||
name: str
|
||||
owner_type: OwnerType
|
||||
ref: str
|
||||
updated: datetime.datetime
|
||||
value: str
|
||||
owner: None | str | Unset = UNSET
|
||||
owner_action: int | None | Unset = UNSET
|
||||
owner_action_ref: None | str | Unset = UNSET
|
||||
owner_identity: int | None | Unset = UNSET
|
||||
owner_pack: int | None | Unset = UNSET
|
||||
owner_pack_ref: None | str | Unset = UNSET
|
||||
owner_sensor: int | None | Unset = UNSET
|
||||
owner_sensor_ref: None | str | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
created = self.created.isoformat()
|
||||
|
||||
encrypted = self.encrypted
|
||||
|
||||
id = self.id
|
||||
|
||||
name = self.name
|
||||
|
||||
owner_type = self.owner_type.value
|
||||
|
||||
ref = self.ref
|
||||
|
||||
updated = self.updated.isoformat()
|
||||
|
||||
value = self.value
|
||||
|
||||
owner: None | str | Unset
|
||||
if isinstance(self.owner, Unset):
|
||||
owner = UNSET
|
||||
else:
|
||||
owner = self.owner
|
||||
|
||||
owner_action: int | None | Unset
|
||||
if isinstance(self.owner_action, Unset):
|
||||
owner_action = UNSET
|
||||
else:
|
||||
owner_action = self.owner_action
|
||||
|
||||
owner_action_ref: None | str | Unset
|
||||
if isinstance(self.owner_action_ref, Unset):
|
||||
owner_action_ref = UNSET
|
||||
else:
|
||||
owner_action_ref = self.owner_action_ref
|
||||
|
||||
owner_identity: int | None | Unset
|
||||
if isinstance(self.owner_identity, Unset):
|
||||
owner_identity = UNSET
|
||||
else:
|
||||
owner_identity = self.owner_identity
|
||||
|
||||
owner_pack: int | None | Unset
|
||||
if isinstance(self.owner_pack, Unset):
|
||||
owner_pack = UNSET
|
||||
else:
|
||||
owner_pack = self.owner_pack
|
||||
|
||||
owner_pack_ref: None | str | Unset
|
||||
if isinstance(self.owner_pack_ref, Unset):
|
||||
owner_pack_ref = UNSET
|
||||
else:
|
||||
owner_pack_ref = self.owner_pack_ref
|
||||
|
||||
owner_sensor: int | None | Unset
|
||||
if isinstance(self.owner_sensor, Unset):
|
||||
owner_sensor = UNSET
|
||||
else:
|
||||
owner_sensor = self.owner_sensor
|
||||
|
||||
owner_sensor_ref: None | str | Unset
|
||||
if isinstance(self.owner_sensor_ref, Unset):
|
||||
owner_sensor_ref = UNSET
|
||||
else:
|
||||
owner_sensor_ref = self.owner_sensor_ref
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"created": created,
|
||||
"encrypted": encrypted,
|
||||
"id": id,
|
||||
"name": name,
|
||||
"owner_type": owner_type,
|
||||
"ref": ref,
|
||||
"updated": updated,
|
||||
"value": value,
|
||||
})
|
||||
if owner is not UNSET:
|
||||
field_dict["owner"] = owner
|
||||
if owner_action is not UNSET:
|
||||
field_dict["owner_action"] = owner_action
|
||||
if owner_action_ref is not UNSET:
|
||||
field_dict["owner_action_ref"] = owner_action_ref
|
||||
if owner_identity is not UNSET:
|
||||
field_dict["owner_identity"] = owner_identity
|
||||
if owner_pack is not UNSET:
|
||||
field_dict["owner_pack"] = owner_pack
|
||||
if owner_pack_ref is not UNSET:
|
||||
field_dict["owner_pack_ref"] = owner_pack_ref
|
||||
if owner_sensor is not UNSET:
|
||||
field_dict["owner_sensor"] = owner_sensor
|
||||
if owner_sensor_ref is not UNSET:
|
||||
field_dict["owner_sensor_ref"] = owner_sensor_ref
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
created = isoparse(d.pop("created"))
|
||||
|
||||
|
||||
|
||||
|
||||
encrypted = d.pop("encrypted")
|
||||
|
||||
id = d.pop("id")
|
||||
|
||||
name = d.pop("name")
|
||||
|
||||
owner_type = OwnerType(d.pop("owner_type"))
|
||||
|
||||
|
||||
|
||||
|
||||
ref = d.pop("ref")
|
||||
|
||||
updated = isoparse(d.pop("updated"))
|
||||
|
||||
|
||||
|
||||
|
||||
value = d.pop("value")
|
||||
|
||||
def _parse_owner(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
owner = _parse_owner(d.pop("owner", UNSET))
|
||||
|
||||
|
||||
def _parse_owner_action(data: object) -> int | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(int | None | Unset, data)
|
||||
|
||||
owner_action = _parse_owner_action(d.pop("owner_action", UNSET))
|
||||
|
||||
|
||||
def _parse_owner_action_ref(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
owner_action_ref = _parse_owner_action_ref(d.pop("owner_action_ref", UNSET))
|
||||
|
||||
|
||||
def _parse_owner_identity(data: object) -> int | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(int | None | Unset, data)
|
||||
|
||||
owner_identity = _parse_owner_identity(d.pop("owner_identity", UNSET))
|
||||
|
||||
|
||||
def _parse_owner_pack(data: object) -> int | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(int | None | Unset, data)
|
||||
|
||||
owner_pack = _parse_owner_pack(d.pop("owner_pack", UNSET))
|
||||
|
||||
|
||||
def _parse_owner_pack_ref(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
owner_pack_ref = _parse_owner_pack_ref(d.pop("owner_pack_ref", UNSET))
|
||||
|
||||
|
||||
def _parse_owner_sensor(data: object) -> int | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(int | None | Unset, data)
|
||||
|
||||
owner_sensor = _parse_owner_sensor(d.pop("owner_sensor", UNSET))
|
||||
|
||||
|
||||
def _parse_owner_sensor_ref(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
owner_sensor_ref = _parse_owner_sensor_ref(d.pop("owner_sensor_ref", UNSET))
|
||||
|
||||
|
||||
create_key_response_201_data = cls(
|
||||
created=created,
|
||||
encrypted=encrypted,
|
||||
id=id,
|
||||
name=name,
|
||||
owner_type=owner_type,
|
||||
ref=ref,
|
||||
updated=updated,
|
||||
value=value,
|
||||
owner=owner,
|
||||
owner_action=owner_action,
|
||||
owner_action_ref=owner_action_ref,
|
||||
owner_identity=owner_identity,
|
||||
owner_pack=owner_pack,
|
||||
owner_pack_ref=owner_pack_ref,
|
||||
owner_sensor=owner_sensor,
|
||||
owner_sensor_ref=owner_sensor_ref,
|
||||
)
|
||||
|
||||
|
||||
create_key_response_201_data.additional_properties = d
|
||||
return create_key_response_201_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
|
||||
221
tests/generated_client/models/create_pack_request.py
Normal file
221
tests/generated_client/models/create_pack_request.py
Normal file
@@ -0,0 +1,221 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from typing import cast
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.create_pack_request_conf_schema import CreatePackRequestConfSchema
|
||||
from ..models.create_pack_request_config import CreatePackRequestConfig
|
||||
from ..models.create_pack_request_meta import CreatePackRequestMeta
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="CreatePackRequest")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CreatePackRequest:
|
||||
""" Request DTO for creating a new pack
|
||||
|
||||
Attributes:
|
||||
label (str): Human-readable label Example: Slack Integration.
|
||||
ref (str): Unique reference identifier (e.g., "core", "aws", "slack") Example: slack.
|
||||
version (str): Pack version (semver format recommended) Example: 1.0.0.
|
||||
conf_schema (CreatePackRequestConfSchema | Unset): Configuration schema (JSON Schema)
|
||||
config (CreatePackRequestConfig | Unset): Pack configuration values
|
||||
description (None | str | Unset): Pack description Example: Integration with Slack for messaging and
|
||||
notifications.
|
||||
is_standard (bool | Unset): Whether this is a standard/built-in pack
|
||||
meta (CreatePackRequestMeta | Unset): Pack metadata
|
||||
runtime_deps (list[str] | Unset): Runtime dependencies (refs of required packs) Example: ['core'].
|
||||
tags (list[str] | Unset): Tags for categorization Example: ['messaging', 'collaboration'].
|
||||
"""
|
||||
|
||||
label: str
|
||||
ref: str
|
||||
version: str
|
||||
conf_schema: CreatePackRequestConfSchema | Unset = UNSET
|
||||
config: CreatePackRequestConfig | Unset = UNSET
|
||||
description: None | str | Unset = UNSET
|
||||
is_standard: bool | Unset = UNSET
|
||||
meta: CreatePackRequestMeta | Unset = UNSET
|
||||
runtime_deps: list[str] | Unset = UNSET
|
||||
tags: list[str] | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.create_pack_request_config import CreatePackRequestConfig
|
||||
from ..models.create_pack_request_meta import CreatePackRequestMeta
|
||||
from ..models.create_pack_request_conf_schema import CreatePackRequestConfSchema
|
||||
label = self.label
|
||||
|
||||
ref = self.ref
|
||||
|
||||
version = self.version
|
||||
|
||||
conf_schema: dict[str, Any] | Unset = UNSET
|
||||
if not isinstance(self.conf_schema, Unset):
|
||||
conf_schema = self.conf_schema.to_dict()
|
||||
|
||||
config: dict[str, Any] | Unset = UNSET
|
||||
if not isinstance(self.config, Unset):
|
||||
config = self.config.to_dict()
|
||||
|
||||
description: None | str | Unset
|
||||
if isinstance(self.description, Unset):
|
||||
description = UNSET
|
||||
else:
|
||||
description = self.description
|
||||
|
||||
is_standard = self.is_standard
|
||||
|
||||
meta: dict[str, Any] | Unset = UNSET
|
||||
if not isinstance(self.meta, Unset):
|
||||
meta = self.meta.to_dict()
|
||||
|
||||
runtime_deps: list[str] | Unset = UNSET
|
||||
if not isinstance(self.runtime_deps, Unset):
|
||||
runtime_deps = self.runtime_deps
|
||||
|
||||
|
||||
|
||||
tags: list[str] | Unset = UNSET
|
||||
if not isinstance(self.tags, Unset):
|
||||
tags = self.tags
|
||||
|
||||
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"label": label,
|
||||
"ref": ref,
|
||||
"version": version,
|
||||
})
|
||||
if conf_schema is not UNSET:
|
||||
field_dict["conf_schema"] = conf_schema
|
||||
if config is not UNSET:
|
||||
field_dict["config"] = config
|
||||
if description is not UNSET:
|
||||
field_dict["description"] = description
|
||||
if is_standard is not UNSET:
|
||||
field_dict["is_standard"] = is_standard
|
||||
if meta is not UNSET:
|
||||
field_dict["meta"] = meta
|
||||
if runtime_deps is not UNSET:
|
||||
field_dict["runtime_deps"] = runtime_deps
|
||||
if tags is not UNSET:
|
||||
field_dict["tags"] = tags
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.create_pack_request_conf_schema import CreatePackRequestConfSchema
|
||||
from ..models.create_pack_request_config import CreatePackRequestConfig
|
||||
from ..models.create_pack_request_meta import CreatePackRequestMeta
|
||||
d = dict(src_dict)
|
||||
label = d.pop("label")
|
||||
|
||||
ref = d.pop("ref")
|
||||
|
||||
version = d.pop("version")
|
||||
|
||||
_conf_schema = d.pop("conf_schema", UNSET)
|
||||
conf_schema: CreatePackRequestConfSchema | Unset
|
||||
if isinstance(_conf_schema, Unset):
|
||||
conf_schema = UNSET
|
||||
else:
|
||||
conf_schema = CreatePackRequestConfSchema.from_dict(_conf_schema)
|
||||
|
||||
|
||||
|
||||
|
||||
_config = d.pop("config", UNSET)
|
||||
config: CreatePackRequestConfig | Unset
|
||||
if isinstance(_config, Unset):
|
||||
config = UNSET
|
||||
else:
|
||||
config = CreatePackRequestConfig.from_dict(_config)
|
||||
|
||||
|
||||
|
||||
|
||||
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))
|
||||
|
||||
|
||||
is_standard = d.pop("is_standard", UNSET)
|
||||
|
||||
_meta = d.pop("meta", UNSET)
|
||||
meta: CreatePackRequestMeta | Unset
|
||||
if isinstance(_meta, Unset):
|
||||
meta = UNSET
|
||||
else:
|
||||
meta = CreatePackRequestMeta.from_dict(_meta)
|
||||
|
||||
|
||||
|
||||
|
||||
runtime_deps = cast(list[str], d.pop("runtime_deps", UNSET))
|
||||
|
||||
|
||||
tags = cast(list[str], d.pop("tags", UNSET))
|
||||
|
||||
|
||||
create_pack_request = cls(
|
||||
label=label,
|
||||
ref=ref,
|
||||
version=version,
|
||||
conf_schema=conf_schema,
|
||||
config=config,
|
||||
description=description,
|
||||
is_standard=is_standard,
|
||||
meta=meta,
|
||||
runtime_deps=runtime_deps,
|
||||
tags=tags,
|
||||
)
|
||||
|
||||
|
||||
create_pack_request.additional_properties = d
|
||||
return create_pack_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
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="CreatePackRequestConfSchema")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CreatePackRequestConfSchema:
|
||||
""" Configuration schema (JSON Schema)
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
create_pack_request_conf_schema = cls(
|
||||
)
|
||||
|
||||
|
||||
create_pack_request_conf_schema.additional_properties = d
|
||||
return create_pack_request_conf_schema
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
66
tests/generated_client/models/create_pack_request_config.py
Normal file
66
tests/generated_client/models/create_pack_request_config.py
Normal file
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="CreatePackRequestConfig")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CreatePackRequestConfig:
|
||||
""" Pack configuration values
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
create_pack_request_config = cls(
|
||||
)
|
||||
|
||||
|
||||
create_pack_request_config.additional_properties = d
|
||||
return create_pack_request_config
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
66
tests/generated_client/models/create_pack_request_meta.py
Normal file
66
tests/generated_client/models/create_pack_request_meta.py
Normal file
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="CreatePackRequestMeta")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CreatePackRequestMeta:
|
||||
""" Pack metadata
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
create_pack_request_meta = cls(
|
||||
)
|
||||
|
||||
|
||||
create_pack_request_meta.additional_properties = d
|
||||
return create_pack_request_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
|
||||
107
tests/generated_client/models/create_pack_response_201.py
Normal file
107
tests/generated_client/models/create_pack_response_201.py
Normal file
@@ -0,0 +1,107 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from typing import cast
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.create_pack_response_201_data import CreatePackResponse201Data
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="CreatePackResponse201")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CreatePackResponse201:
|
||||
""" Standard API response wrapper
|
||||
|
||||
Attributes:
|
||||
data (CreatePackResponse201Data): Response DTO for pack information
|
||||
message (None | str | Unset): Optional message
|
||||
"""
|
||||
|
||||
data: CreatePackResponse201Data
|
||||
message: None | str | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.create_pack_response_201_data import CreatePackResponse201Data
|
||||
data = self.data.to_dict()
|
||||
|
||||
message: None | str | Unset
|
||||
if isinstance(self.message, Unset):
|
||||
message = UNSET
|
||||
else:
|
||||
message = self.message
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"data": data,
|
||||
})
|
||||
if message is not UNSET:
|
||||
field_dict["message"] = message
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.create_pack_response_201_data import CreatePackResponse201Data
|
||||
d = dict(src_dict)
|
||||
data = CreatePackResponse201Data.from_dict(d.pop("data"))
|
||||
|
||||
|
||||
|
||||
|
||||
def _parse_message(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
message = _parse_message(d.pop("message", UNSET))
|
||||
|
||||
|
||||
create_pack_response_201 = cls(
|
||||
data=data,
|
||||
message=message,
|
||||
)
|
||||
|
||||
|
||||
create_pack_response_201.additional_properties = d
|
||||
return create_pack_response_201
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
222
tests/generated_client/models/create_pack_response_201_data.py
Normal file
222
tests/generated_client/models/create_pack_response_201_data.py
Normal file
@@ -0,0 +1,222 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from dateutil.parser import isoparse
|
||||
from typing import cast
|
||||
import datetime
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.create_pack_response_201_data_conf_schema import CreatePackResponse201DataConfSchema
|
||||
from ..models.create_pack_response_201_data_config import CreatePackResponse201DataConfig
|
||||
from ..models.create_pack_response_201_data_meta import CreatePackResponse201DataMeta
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="CreatePackResponse201Data")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CreatePackResponse201Data:
|
||||
""" Response DTO for pack information
|
||||
|
||||
Attributes:
|
||||
conf_schema (CreatePackResponse201DataConfSchema): Configuration schema
|
||||
config (CreatePackResponse201DataConfig): Pack configuration
|
||||
created (datetime.datetime): Creation timestamp Example: 2024-01-13T10:30:00Z.
|
||||
id (int): Pack ID Example: 1.
|
||||
is_standard (bool): Is standard pack
|
||||
label (str): Human-readable label Example: Slack Integration.
|
||||
meta (CreatePackResponse201DataMeta): Pack metadata
|
||||
ref (str): Unique reference identifier Example: slack.
|
||||
runtime_deps (list[str]): Runtime dependencies Example: ['core'].
|
||||
tags (list[str]): Tags Example: ['messaging', 'collaboration'].
|
||||
updated (datetime.datetime): Last update timestamp Example: 2024-01-13T10:30:00Z.
|
||||
version (str): Pack version Example: 1.0.0.
|
||||
description (None | str | Unset): Pack description Example: Integration with Slack for messaging and
|
||||
notifications.
|
||||
"""
|
||||
|
||||
conf_schema: CreatePackResponse201DataConfSchema
|
||||
config: CreatePackResponse201DataConfig
|
||||
created: datetime.datetime
|
||||
id: int
|
||||
is_standard: bool
|
||||
label: str
|
||||
meta: CreatePackResponse201DataMeta
|
||||
ref: str
|
||||
runtime_deps: list[str]
|
||||
tags: list[str]
|
||||
updated: datetime.datetime
|
||||
version: str
|
||||
description: None | str | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.create_pack_response_201_data_config import CreatePackResponse201DataConfig
|
||||
from ..models.create_pack_response_201_data_conf_schema import CreatePackResponse201DataConfSchema
|
||||
from ..models.create_pack_response_201_data_meta import CreatePackResponse201DataMeta
|
||||
conf_schema = self.conf_schema.to_dict()
|
||||
|
||||
config = self.config.to_dict()
|
||||
|
||||
created = self.created.isoformat()
|
||||
|
||||
id = self.id
|
||||
|
||||
is_standard = self.is_standard
|
||||
|
||||
label = self.label
|
||||
|
||||
meta = self.meta.to_dict()
|
||||
|
||||
ref = self.ref
|
||||
|
||||
runtime_deps = self.runtime_deps
|
||||
|
||||
|
||||
|
||||
tags = self.tags
|
||||
|
||||
|
||||
|
||||
updated = self.updated.isoformat()
|
||||
|
||||
version = self.version
|
||||
|
||||
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({
|
||||
"conf_schema": conf_schema,
|
||||
"config": config,
|
||||
"created": created,
|
||||
"id": id,
|
||||
"is_standard": is_standard,
|
||||
"label": label,
|
||||
"meta": meta,
|
||||
"ref": ref,
|
||||
"runtime_deps": runtime_deps,
|
||||
"tags": tags,
|
||||
"updated": updated,
|
||||
"version": version,
|
||||
})
|
||||
if description is not UNSET:
|
||||
field_dict["description"] = description
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.create_pack_response_201_data_conf_schema import CreatePackResponse201DataConfSchema
|
||||
from ..models.create_pack_response_201_data_config import CreatePackResponse201DataConfig
|
||||
from ..models.create_pack_response_201_data_meta import CreatePackResponse201DataMeta
|
||||
d = dict(src_dict)
|
||||
conf_schema = CreatePackResponse201DataConfSchema.from_dict(d.pop("conf_schema"))
|
||||
|
||||
|
||||
|
||||
|
||||
config = CreatePackResponse201DataConfig.from_dict(d.pop("config"))
|
||||
|
||||
|
||||
|
||||
|
||||
created = isoparse(d.pop("created"))
|
||||
|
||||
|
||||
|
||||
|
||||
id = d.pop("id")
|
||||
|
||||
is_standard = d.pop("is_standard")
|
||||
|
||||
label = d.pop("label")
|
||||
|
||||
meta = CreatePackResponse201DataMeta.from_dict(d.pop("meta"))
|
||||
|
||||
|
||||
|
||||
|
||||
ref = d.pop("ref")
|
||||
|
||||
runtime_deps = cast(list[str], d.pop("runtime_deps"))
|
||||
|
||||
|
||||
tags = cast(list[str], d.pop("tags"))
|
||||
|
||||
|
||||
updated = isoparse(d.pop("updated"))
|
||||
|
||||
|
||||
|
||||
|
||||
version = d.pop("version")
|
||||
|
||||
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))
|
||||
|
||||
|
||||
create_pack_response_201_data = cls(
|
||||
conf_schema=conf_schema,
|
||||
config=config,
|
||||
created=created,
|
||||
id=id,
|
||||
is_standard=is_standard,
|
||||
label=label,
|
||||
meta=meta,
|
||||
ref=ref,
|
||||
runtime_deps=runtime_deps,
|
||||
tags=tags,
|
||||
updated=updated,
|
||||
version=version,
|
||||
description=description,
|
||||
)
|
||||
|
||||
|
||||
create_pack_response_201_data.additional_properties = d
|
||||
return create_pack_response_201_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
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="CreatePackResponse201DataConfSchema")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CreatePackResponse201DataConfSchema:
|
||||
""" Configuration schema
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
create_pack_response_201_data_conf_schema = cls(
|
||||
)
|
||||
|
||||
|
||||
create_pack_response_201_data_conf_schema.additional_properties = d
|
||||
return create_pack_response_201_data_conf_schema
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="CreatePackResponse201DataConfig")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CreatePackResponse201DataConfig:
|
||||
""" Pack configuration
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
create_pack_response_201_data_config = cls(
|
||||
)
|
||||
|
||||
|
||||
create_pack_response_201_data_config.additional_properties = d
|
||||
return create_pack_response_201_data_config
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="CreatePackResponse201DataMeta")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CreatePackResponse201DataMeta:
|
||||
""" Pack metadata
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
create_pack_response_201_data_meta = cls(
|
||||
)
|
||||
|
||||
|
||||
create_pack_response_201_data_meta.additional_properties = d
|
||||
return create_pack_response_201_data_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
|
||||
196
tests/generated_client/models/create_rule_request.py
Normal file
196
tests/generated_client/models/create_rule_request.py
Normal file
@@ -0,0 +1,196 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from typing import cast
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.create_rule_request_action_params import CreateRuleRequestActionParams
|
||||
from ..models.create_rule_request_conditions import CreateRuleRequestConditions
|
||||
from ..models.create_rule_request_trigger_params import CreateRuleRequestTriggerParams
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="CreateRuleRequest")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CreateRuleRequest:
|
||||
""" Request DTO for creating a new rule
|
||||
|
||||
Attributes:
|
||||
action_ref (str): Action reference to execute when rule matches Example: slack.post_message.
|
||||
description (str): Rule description Example: Send Slack notification when an error occurs.
|
||||
label (str): Human-readable label Example: Notify on Error.
|
||||
pack_ref (str): Pack reference this rule belongs to Example: slack.
|
||||
ref (str): Unique reference identifier (e.g., "mypack.notify_on_error") Example: slack.notify_on_error.
|
||||
trigger_ref (str): Trigger reference that activates this rule Example: system.error_event.
|
||||
action_params (CreateRuleRequestActionParams | Unset): Parameters to pass to the action when rule is triggered
|
||||
conditions (CreateRuleRequestConditions | Unset): Conditions for rule evaluation (JSON Logic or custom format)
|
||||
enabled (bool | Unset): Whether the rule is enabled Example: True.
|
||||
trigger_params (CreateRuleRequestTriggerParams | Unset): Parameters for trigger configuration and event
|
||||
filtering
|
||||
"""
|
||||
|
||||
action_ref: str
|
||||
description: str
|
||||
label: str
|
||||
pack_ref: str
|
||||
ref: str
|
||||
trigger_ref: str
|
||||
action_params: CreateRuleRequestActionParams | Unset = UNSET
|
||||
conditions: CreateRuleRequestConditions | Unset = UNSET
|
||||
enabled: bool | Unset = UNSET
|
||||
trigger_params: CreateRuleRequestTriggerParams | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.create_rule_request_action_params import CreateRuleRequestActionParams
|
||||
from ..models.create_rule_request_trigger_params import CreateRuleRequestTriggerParams
|
||||
from ..models.create_rule_request_conditions import CreateRuleRequestConditions
|
||||
action_ref = self.action_ref
|
||||
|
||||
description = self.description
|
||||
|
||||
label = self.label
|
||||
|
||||
pack_ref = self.pack_ref
|
||||
|
||||
ref = self.ref
|
||||
|
||||
trigger_ref = self.trigger_ref
|
||||
|
||||
action_params: dict[str, Any] | Unset = UNSET
|
||||
if not isinstance(self.action_params, Unset):
|
||||
action_params = self.action_params.to_dict()
|
||||
|
||||
conditions: dict[str, Any] | Unset = UNSET
|
||||
if not isinstance(self.conditions, Unset):
|
||||
conditions = self.conditions.to_dict()
|
||||
|
||||
enabled = self.enabled
|
||||
|
||||
trigger_params: dict[str, Any] | Unset = UNSET
|
||||
if not isinstance(self.trigger_params, Unset):
|
||||
trigger_params = self.trigger_params.to_dict()
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"action_ref": action_ref,
|
||||
"description": description,
|
||||
"label": label,
|
||||
"pack_ref": pack_ref,
|
||||
"ref": ref,
|
||||
"trigger_ref": trigger_ref,
|
||||
})
|
||||
if action_params is not UNSET:
|
||||
field_dict["action_params"] = action_params
|
||||
if conditions is not UNSET:
|
||||
field_dict["conditions"] = conditions
|
||||
if enabled is not UNSET:
|
||||
field_dict["enabled"] = enabled
|
||||
if trigger_params is not UNSET:
|
||||
field_dict["trigger_params"] = trigger_params
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.create_rule_request_action_params import CreateRuleRequestActionParams
|
||||
from ..models.create_rule_request_conditions import CreateRuleRequestConditions
|
||||
from ..models.create_rule_request_trigger_params import CreateRuleRequestTriggerParams
|
||||
d = dict(src_dict)
|
||||
action_ref = d.pop("action_ref")
|
||||
|
||||
description = d.pop("description")
|
||||
|
||||
label = d.pop("label")
|
||||
|
||||
pack_ref = d.pop("pack_ref")
|
||||
|
||||
ref = d.pop("ref")
|
||||
|
||||
trigger_ref = d.pop("trigger_ref")
|
||||
|
||||
_action_params = d.pop("action_params", UNSET)
|
||||
action_params: CreateRuleRequestActionParams | Unset
|
||||
if isinstance(_action_params, Unset):
|
||||
action_params = UNSET
|
||||
else:
|
||||
action_params = CreateRuleRequestActionParams.from_dict(_action_params)
|
||||
|
||||
|
||||
|
||||
|
||||
_conditions = d.pop("conditions", UNSET)
|
||||
conditions: CreateRuleRequestConditions | Unset
|
||||
if isinstance(_conditions, Unset):
|
||||
conditions = UNSET
|
||||
else:
|
||||
conditions = CreateRuleRequestConditions.from_dict(_conditions)
|
||||
|
||||
|
||||
|
||||
|
||||
enabled = d.pop("enabled", UNSET)
|
||||
|
||||
_trigger_params = d.pop("trigger_params", UNSET)
|
||||
trigger_params: CreateRuleRequestTriggerParams | Unset
|
||||
if isinstance(_trigger_params, Unset):
|
||||
trigger_params = UNSET
|
||||
else:
|
||||
trigger_params = CreateRuleRequestTriggerParams.from_dict(_trigger_params)
|
||||
|
||||
|
||||
|
||||
|
||||
create_rule_request = cls(
|
||||
action_ref=action_ref,
|
||||
description=description,
|
||||
label=label,
|
||||
pack_ref=pack_ref,
|
||||
ref=ref,
|
||||
trigger_ref=trigger_ref,
|
||||
action_params=action_params,
|
||||
conditions=conditions,
|
||||
enabled=enabled,
|
||||
trigger_params=trigger_params,
|
||||
)
|
||||
|
||||
|
||||
create_rule_request.additional_properties = d
|
||||
return create_rule_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
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="CreateRuleRequestActionParams")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CreateRuleRequestActionParams:
|
||||
""" Parameters to pass to the action when rule is triggered
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
create_rule_request_action_params = cls(
|
||||
)
|
||||
|
||||
|
||||
create_rule_request_action_params.additional_properties = d
|
||||
return create_rule_request_action_params
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="CreateRuleRequestConditions")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CreateRuleRequestConditions:
|
||||
""" Conditions for rule evaluation (JSON Logic or custom format)
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
create_rule_request_conditions = cls(
|
||||
)
|
||||
|
||||
|
||||
create_rule_request_conditions.additional_properties = d
|
||||
return create_rule_request_conditions
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="CreateRuleRequestTriggerParams")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CreateRuleRequestTriggerParams:
|
||||
""" Parameters for trigger configuration and event filtering
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
create_rule_request_trigger_params = cls(
|
||||
)
|
||||
|
||||
|
||||
create_rule_request_trigger_params.additional_properties = d
|
||||
return create_rule_request_trigger_params
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
212
tests/generated_client/models/create_sensor_request.py
Normal file
212
tests/generated_client/models/create_sensor_request.py
Normal file
@@ -0,0 +1,212 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from typing import cast
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.create_sensor_request_config_type_0 import CreateSensorRequestConfigType0
|
||||
from ..models.create_sensor_request_param_schema_type_0 import CreateSensorRequestParamSchemaType0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="CreateSensorRequest")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CreateSensorRequest:
|
||||
""" Request DTO for creating a new sensor
|
||||
|
||||
Attributes:
|
||||
description (str): Sensor description Example: Monitors CPU usage and generates events.
|
||||
entrypoint (str): Entry point for sensor execution (e.g., path to script, function name) Example:
|
||||
/sensors/monitoring/cpu_monitor.py.
|
||||
label (str): Human-readable label Example: CPU Monitoring Sensor.
|
||||
pack_ref (str): Pack reference this sensor belongs to Example: monitoring.
|
||||
ref (str): Unique reference identifier (e.g., "mypack.cpu_monitor") Example: monitoring.cpu_sensor.
|
||||
runtime_ref (str): Runtime reference for this sensor Example: python3.
|
||||
trigger_ref (str): Trigger reference this sensor monitors for Example: monitoring.cpu_threshold.
|
||||
config (CreateSensorRequestConfigType0 | None | Unset): Configuration values for this sensor instance (conforms
|
||||
to param_schema)
|
||||
enabled (bool | Unset): Whether the sensor is enabled Example: True.
|
||||
param_schema (CreateSensorRequestParamSchemaType0 | None | Unset): Parameter schema (JSON Schema) for sensor
|
||||
configuration
|
||||
"""
|
||||
|
||||
description: str
|
||||
entrypoint: str
|
||||
label: str
|
||||
pack_ref: str
|
||||
ref: str
|
||||
runtime_ref: str
|
||||
trigger_ref: str
|
||||
config: CreateSensorRequestConfigType0 | None | Unset = UNSET
|
||||
enabled: bool | Unset = UNSET
|
||||
param_schema: CreateSensorRequestParamSchemaType0 | None | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.create_sensor_request_param_schema_type_0 import CreateSensorRequestParamSchemaType0
|
||||
from ..models.create_sensor_request_config_type_0 import CreateSensorRequestConfigType0
|
||||
description = self.description
|
||||
|
||||
entrypoint = self.entrypoint
|
||||
|
||||
label = self.label
|
||||
|
||||
pack_ref = self.pack_ref
|
||||
|
||||
ref = self.ref
|
||||
|
||||
runtime_ref = self.runtime_ref
|
||||
|
||||
trigger_ref = self.trigger_ref
|
||||
|
||||
config: dict[str, Any] | None | Unset
|
||||
if isinstance(self.config, Unset):
|
||||
config = UNSET
|
||||
elif isinstance(self.config, CreateSensorRequestConfigType0):
|
||||
config = self.config.to_dict()
|
||||
else:
|
||||
config = self.config
|
||||
|
||||
enabled = self.enabled
|
||||
|
||||
param_schema: dict[str, Any] | None | Unset
|
||||
if isinstance(self.param_schema, Unset):
|
||||
param_schema = UNSET
|
||||
elif isinstance(self.param_schema, CreateSensorRequestParamSchemaType0):
|
||||
param_schema = self.param_schema.to_dict()
|
||||
else:
|
||||
param_schema = self.param_schema
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"description": description,
|
||||
"entrypoint": entrypoint,
|
||||
"label": label,
|
||||
"pack_ref": pack_ref,
|
||||
"ref": ref,
|
||||
"runtime_ref": runtime_ref,
|
||||
"trigger_ref": trigger_ref,
|
||||
})
|
||||
if config is not UNSET:
|
||||
field_dict["config"] = config
|
||||
if enabled is not UNSET:
|
||||
field_dict["enabled"] = enabled
|
||||
if param_schema is not UNSET:
|
||||
field_dict["param_schema"] = param_schema
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.create_sensor_request_config_type_0 import CreateSensorRequestConfigType0
|
||||
from ..models.create_sensor_request_param_schema_type_0 import CreateSensorRequestParamSchemaType0
|
||||
d = dict(src_dict)
|
||||
description = d.pop("description")
|
||||
|
||||
entrypoint = d.pop("entrypoint")
|
||||
|
||||
label = d.pop("label")
|
||||
|
||||
pack_ref = d.pop("pack_ref")
|
||||
|
||||
ref = d.pop("ref")
|
||||
|
||||
runtime_ref = d.pop("runtime_ref")
|
||||
|
||||
trigger_ref = d.pop("trigger_ref")
|
||||
|
||||
def _parse_config(data: object) -> CreateSensorRequestConfigType0 | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
config_type_0 = CreateSensorRequestConfigType0.from_dict(data)
|
||||
|
||||
|
||||
|
||||
return config_type_0
|
||||
except (TypeError, ValueError, AttributeError, KeyError):
|
||||
pass
|
||||
return cast(CreateSensorRequestConfigType0 | None | Unset, data)
|
||||
|
||||
config = _parse_config(d.pop("config", UNSET))
|
||||
|
||||
|
||||
enabled = d.pop("enabled", UNSET)
|
||||
|
||||
def _parse_param_schema(data: object) -> CreateSensorRequestParamSchemaType0 | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
param_schema_type_0 = CreateSensorRequestParamSchemaType0.from_dict(data)
|
||||
|
||||
|
||||
|
||||
return param_schema_type_0
|
||||
except (TypeError, ValueError, AttributeError, KeyError):
|
||||
pass
|
||||
return cast(CreateSensorRequestParamSchemaType0 | None | Unset, data)
|
||||
|
||||
param_schema = _parse_param_schema(d.pop("param_schema", UNSET))
|
||||
|
||||
|
||||
create_sensor_request = cls(
|
||||
description=description,
|
||||
entrypoint=entrypoint,
|
||||
label=label,
|
||||
pack_ref=pack_ref,
|
||||
ref=ref,
|
||||
runtime_ref=runtime_ref,
|
||||
trigger_ref=trigger_ref,
|
||||
config=config,
|
||||
enabled=enabled,
|
||||
param_schema=param_schema,
|
||||
)
|
||||
|
||||
|
||||
create_sensor_request.additional_properties = d
|
||||
return create_sensor_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
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="CreateSensorRequestConfigType0")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CreateSensorRequestConfigType0:
|
||||
""" Configuration values for this sensor instance (conforms to param_schema)
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
create_sensor_request_config_type_0 = cls(
|
||||
)
|
||||
|
||||
|
||||
create_sensor_request_config_type_0.additional_properties = d
|
||||
return create_sensor_request_config_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
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="CreateSensorRequestParamSchemaType0")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CreateSensorRequestParamSchemaType0:
|
||||
""" Parameter schema (JSON Schema) for sensor configuration
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
create_sensor_request_param_schema_type_0 = cls(
|
||||
)
|
||||
|
||||
|
||||
create_sensor_request_param_schema_type_0.additional_properties = d
|
||||
return create_sensor_request_param_schema_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
|
||||
213
tests/generated_client/models/create_trigger_request.py
Normal file
213
tests/generated_client/models/create_trigger_request.py
Normal file
@@ -0,0 +1,213 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from typing import cast
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.create_trigger_request_out_schema_type_0 import CreateTriggerRequestOutSchemaType0
|
||||
from ..models.create_trigger_request_param_schema_type_0 import CreateTriggerRequestParamSchemaType0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="CreateTriggerRequest")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CreateTriggerRequest:
|
||||
""" Request DTO for creating a new trigger
|
||||
|
||||
Attributes:
|
||||
label (str): Human-readable label Example: Webhook Trigger.
|
||||
ref (str): Unique reference identifier (e.g., "core.webhook", "system.timer") Example: core.webhook.
|
||||
description (None | str | Unset): Trigger description Example: Triggers when a webhook is received.
|
||||
enabled (bool | Unset): Whether the trigger is enabled Example: True.
|
||||
out_schema (CreateTriggerRequestOutSchemaType0 | None | Unset): Output schema (JSON Schema) defining event data
|
||||
structure
|
||||
pack_ref (None | str | Unset): Optional pack reference this trigger belongs to Example: core.
|
||||
param_schema (CreateTriggerRequestParamSchemaType0 | None | Unset): Parameter schema (JSON Schema) defining
|
||||
event payload structure
|
||||
"""
|
||||
|
||||
label: str
|
||||
ref: str
|
||||
description: None | str | Unset = UNSET
|
||||
enabled: bool | Unset = UNSET
|
||||
out_schema: CreateTriggerRequestOutSchemaType0 | None | Unset = UNSET
|
||||
pack_ref: None | str | Unset = UNSET
|
||||
param_schema: CreateTriggerRequestParamSchemaType0 | None | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.create_trigger_request_out_schema_type_0 import CreateTriggerRequestOutSchemaType0
|
||||
from ..models.create_trigger_request_param_schema_type_0 import CreateTriggerRequestParamSchemaType0
|
||||
label = self.label
|
||||
|
||||
ref = self.ref
|
||||
|
||||
description: None | str | Unset
|
||||
if isinstance(self.description, Unset):
|
||||
description = UNSET
|
||||
else:
|
||||
description = self.description
|
||||
|
||||
enabled = self.enabled
|
||||
|
||||
out_schema: dict[str, Any] | None | Unset
|
||||
if isinstance(self.out_schema, Unset):
|
||||
out_schema = UNSET
|
||||
elif isinstance(self.out_schema, CreateTriggerRequestOutSchemaType0):
|
||||
out_schema = self.out_schema.to_dict()
|
||||
else:
|
||||
out_schema = self.out_schema
|
||||
|
||||
pack_ref: None | str | Unset
|
||||
if isinstance(self.pack_ref, Unset):
|
||||
pack_ref = UNSET
|
||||
else:
|
||||
pack_ref = self.pack_ref
|
||||
|
||||
param_schema: dict[str, Any] | None | Unset
|
||||
if isinstance(self.param_schema, Unset):
|
||||
param_schema = UNSET
|
||||
elif isinstance(self.param_schema, CreateTriggerRequestParamSchemaType0):
|
||||
param_schema = self.param_schema.to_dict()
|
||||
else:
|
||||
param_schema = self.param_schema
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"label": label,
|
||||
"ref": ref,
|
||||
})
|
||||
if description is not UNSET:
|
||||
field_dict["description"] = description
|
||||
if enabled is not UNSET:
|
||||
field_dict["enabled"] = enabled
|
||||
if out_schema is not UNSET:
|
||||
field_dict["out_schema"] = out_schema
|
||||
if pack_ref is not UNSET:
|
||||
field_dict["pack_ref"] = pack_ref
|
||||
if param_schema is not UNSET:
|
||||
field_dict["param_schema"] = param_schema
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.create_trigger_request_out_schema_type_0 import CreateTriggerRequestOutSchemaType0
|
||||
from ..models.create_trigger_request_param_schema_type_0 import CreateTriggerRequestParamSchemaType0
|
||||
d = dict(src_dict)
|
||||
label = d.pop("label")
|
||||
|
||||
ref = d.pop("ref")
|
||||
|
||||
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))
|
||||
|
||||
|
||||
enabled = d.pop("enabled", UNSET)
|
||||
|
||||
def _parse_out_schema(data: object) -> CreateTriggerRequestOutSchemaType0 | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
out_schema_type_0 = CreateTriggerRequestOutSchemaType0.from_dict(data)
|
||||
|
||||
|
||||
|
||||
return out_schema_type_0
|
||||
except (TypeError, ValueError, AttributeError, KeyError):
|
||||
pass
|
||||
return cast(CreateTriggerRequestOutSchemaType0 | None | Unset, data)
|
||||
|
||||
out_schema = _parse_out_schema(d.pop("out_schema", UNSET))
|
||||
|
||||
|
||||
def _parse_pack_ref(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
pack_ref = _parse_pack_ref(d.pop("pack_ref", UNSET))
|
||||
|
||||
|
||||
def _parse_param_schema(data: object) -> CreateTriggerRequestParamSchemaType0 | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, dict):
|
||||
raise TypeError()
|
||||
param_schema_type_0 = CreateTriggerRequestParamSchemaType0.from_dict(data)
|
||||
|
||||
|
||||
|
||||
return param_schema_type_0
|
||||
except (TypeError, ValueError, AttributeError, KeyError):
|
||||
pass
|
||||
return cast(CreateTriggerRequestParamSchemaType0 | None | Unset, data)
|
||||
|
||||
param_schema = _parse_param_schema(d.pop("param_schema", UNSET))
|
||||
|
||||
|
||||
create_trigger_request = cls(
|
||||
label=label,
|
||||
ref=ref,
|
||||
description=description,
|
||||
enabled=enabled,
|
||||
out_schema=out_schema,
|
||||
pack_ref=pack_ref,
|
||||
param_schema=param_schema,
|
||||
)
|
||||
|
||||
|
||||
create_trigger_request.additional_properties = d
|
||||
return create_trigger_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
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="CreateTriggerRequestOutSchemaType0")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CreateTriggerRequestOutSchemaType0:
|
||||
""" Output schema (JSON Schema) defining event data structure
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
create_trigger_request_out_schema_type_0 = cls(
|
||||
)
|
||||
|
||||
|
||||
create_trigger_request_out_schema_type_0.additional_properties = d
|
||||
return create_trigger_request_out_schema_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
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="CreateTriggerRequestParamSchemaType0")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CreateTriggerRequestParamSchemaType0:
|
||||
""" Parameter schema (JSON Schema) defining event payload structure
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
create_trigger_request_param_schema_type_0 = cls(
|
||||
)
|
||||
|
||||
|
||||
create_trigger_request_param_schema_type_0.additional_properties = d
|
||||
return create_trigger_request_param_schema_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
|
||||
223
tests/generated_client/models/create_workflow_request.py
Normal file
223
tests/generated_client/models/create_workflow_request.py
Normal file
@@ -0,0 +1,223 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from typing import cast
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.create_workflow_request_definition import CreateWorkflowRequestDefinition
|
||||
from ..models.create_workflow_request_out_schema import CreateWorkflowRequestOutSchema
|
||||
from ..models.create_workflow_request_param_schema import CreateWorkflowRequestParamSchema
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="CreateWorkflowRequest")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CreateWorkflowRequest:
|
||||
""" Request DTO for creating a new workflow
|
||||
|
||||
Attributes:
|
||||
definition (CreateWorkflowRequestDefinition): Workflow definition (complete workflow YAML structure as JSON)
|
||||
label (str): Human-readable label Example: Incident Response Workflow.
|
||||
out_schema (CreateWorkflowRequestOutSchema): Output schema (JSON Schema) defining expected outputs
|
||||
pack_ref (str): Pack reference this workflow belongs to Example: slack.
|
||||
param_schema (CreateWorkflowRequestParamSchema): Parameter schema (JSON Schema) defining expected inputs
|
||||
ref (str): Unique reference identifier (e.g., "core.notify_on_failure", "slack.incident_workflow") Example:
|
||||
slack.incident_workflow.
|
||||
version (str): Workflow version (semantic versioning recommended) Example: 1.0.0.
|
||||
description (None | str | Unset): Workflow description Example: Automated incident response workflow with
|
||||
notifications and approvals.
|
||||
enabled (bool | None | Unset): Whether the workflow is enabled Example: True.
|
||||
tags (list[str] | None | Unset): Tags for categorization and search Example: ['incident', 'slack', 'approval'].
|
||||
"""
|
||||
|
||||
definition: CreateWorkflowRequestDefinition
|
||||
label: str
|
||||
out_schema: CreateWorkflowRequestOutSchema
|
||||
pack_ref: str
|
||||
param_schema: CreateWorkflowRequestParamSchema
|
||||
ref: str
|
||||
version: str
|
||||
description: None | str | Unset = UNSET
|
||||
enabled: bool | None | Unset = UNSET
|
||||
tags: list[str] | None | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.create_workflow_request_param_schema import CreateWorkflowRequestParamSchema
|
||||
from ..models.create_workflow_request_definition import CreateWorkflowRequestDefinition
|
||||
from ..models.create_workflow_request_out_schema import CreateWorkflowRequestOutSchema
|
||||
definition = self.definition.to_dict()
|
||||
|
||||
label = self.label
|
||||
|
||||
out_schema = self.out_schema.to_dict()
|
||||
|
||||
pack_ref = self.pack_ref
|
||||
|
||||
param_schema = self.param_schema.to_dict()
|
||||
|
||||
ref = self.ref
|
||||
|
||||
version = self.version
|
||||
|
||||
description: None | str | Unset
|
||||
if isinstance(self.description, Unset):
|
||||
description = UNSET
|
||||
else:
|
||||
description = self.description
|
||||
|
||||
enabled: bool | None | Unset
|
||||
if isinstance(self.enabled, Unset):
|
||||
enabled = UNSET
|
||||
else:
|
||||
enabled = self.enabled
|
||||
|
||||
tags: list[str] | None | Unset
|
||||
if isinstance(self.tags, Unset):
|
||||
tags = UNSET
|
||||
elif isinstance(self.tags, list):
|
||||
tags = self.tags
|
||||
|
||||
|
||||
else:
|
||||
tags = self.tags
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"definition": definition,
|
||||
"label": label,
|
||||
"out_schema": out_schema,
|
||||
"pack_ref": pack_ref,
|
||||
"param_schema": param_schema,
|
||||
"ref": ref,
|
||||
"version": version,
|
||||
})
|
||||
if description is not UNSET:
|
||||
field_dict["description"] = description
|
||||
if enabled is not UNSET:
|
||||
field_dict["enabled"] = enabled
|
||||
if tags is not UNSET:
|
||||
field_dict["tags"] = tags
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.create_workflow_request_definition import CreateWorkflowRequestDefinition
|
||||
from ..models.create_workflow_request_out_schema import CreateWorkflowRequestOutSchema
|
||||
from ..models.create_workflow_request_param_schema import CreateWorkflowRequestParamSchema
|
||||
d = dict(src_dict)
|
||||
definition = CreateWorkflowRequestDefinition.from_dict(d.pop("definition"))
|
||||
|
||||
|
||||
|
||||
|
||||
label = d.pop("label")
|
||||
|
||||
out_schema = CreateWorkflowRequestOutSchema.from_dict(d.pop("out_schema"))
|
||||
|
||||
|
||||
|
||||
|
||||
pack_ref = d.pop("pack_ref")
|
||||
|
||||
param_schema = CreateWorkflowRequestParamSchema.from_dict(d.pop("param_schema"))
|
||||
|
||||
|
||||
|
||||
|
||||
ref = d.pop("ref")
|
||||
|
||||
version = d.pop("version")
|
||||
|
||||
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))
|
||||
|
||||
|
||||
def _parse_enabled(data: object) -> bool | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(bool | None | Unset, data)
|
||||
|
||||
enabled = _parse_enabled(d.pop("enabled", UNSET))
|
||||
|
||||
|
||||
def _parse_tags(data: object) -> list[str] | None | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
try:
|
||||
if not isinstance(data, list):
|
||||
raise TypeError()
|
||||
tags_type_0 = cast(list[str], data)
|
||||
|
||||
return tags_type_0
|
||||
except (TypeError, ValueError, AttributeError, KeyError):
|
||||
pass
|
||||
return cast(list[str] | None | Unset, data)
|
||||
|
||||
tags = _parse_tags(d.pop("tags", UNSET))
|
||||
|
||||
|
||||
create_workflow_request = cls(
|
||||
definition=definition,
|
||||
label=label,
|
||||
out_schema=out_schema,
|
||||
pack_ref=pack_ref,
|
||||
param_schema=param_schema,
|
||||
ref=ref,
|
||||
version=version,
|
||||
description=description,
|
||||
enabled=enabled,
|
||||
tags=tags,
|
||||
)
|
||||
|
||||
|
||||
create_workflow_request.additional_properties = d
|
||||
return create_workflow_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
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="CreateWorkflowRequestDefinition")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CreateWorkflowRequestDefinition:
|
||||
""" Workflow definition (complete workflow YAML structure as JSON)
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
create_workflow_request_definition = cls(
|
||||
)
|
||||
|
||||
|
||||
create_workflow_request_definition.additional_properties = d
|
||||
return create_workflow_request_definition
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="CreateWorkflowRequestOutSchema")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CreateWorkflowRequestOutSchema:
|
||||
""" Output schema (JSON Schema) defining expected outputs
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
create_workflow_request_out_schema = cls(
|
||||
)
|
||||
|
||||
|
||||
create_workflow_request_out_schema.additional_properties = d
|
||||
return create_workflow_request_out_schema
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
@@ -0,0 +1,66 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="CreateWorkflowRequestParamSchema")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CreateWorkflowRequestParamSchema:
|
||||
""" Parameter schema (JSON Schema) defining expected inputs
|
||||
|
||||
"""
|
||||
|
||||
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: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
d = dict(src_dict)
|
||||
create_workflow_request_param_schema = cls(
|
||||
)
|
||||
|
||||
|
||||
create_workflow_request_param_schema.additional_properties = d
|
||||
return create_workflow_request_param_schema
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
107
tests/generated_client/models/create_workflow_response_201.py
Normal file
107
tests/generated_client/models/create_workflow_response_201.py
Normal file
@@ -0,0 +1,107 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
from typing import cast
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.create_workflow_response_201_data import CreateWorkflowResponse201Data
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
T = TypeVar("T", bound="CreateWorkflowResponse201")
|
||||
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CreateWorkflowResponse201:
|
||||
""" Standard API response wrapper
|
||||
|
||||
Attributes:
|
||||
data (CreateWorkflowResponse201Data): Response DTO for workflow information
|
||||
message (None | str | Unset): Optional message
|
||||
"""
|
||||
|
||||
data: CreateWorkflowResponse201Data
|
||||
message: None | str | Unset = UNSET
|
||||
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
from ..models.create_workflow_response_201_data import CreateWorkflowResponse201Data
|
||||
data = self.data.to_dict()
|
||||
|
||||
message: None | str | Unset
|
||||
if isinstance(self.message, Unset):
|
||||
message = UNSET
|
||||
else:
|
||||
message = self.message
|
||||
|
||||
|
||||
field_dict: dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({
|
||||
"data": data,
|
||||
})
|
||||
if message is not UNSET:
|
||||
field_dict["message"] = message
|
||||
|
||||
return field_dict
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
||||
from ..models.create_workflow_response_201_data import CreateWorkflowResponse201Data
|
||||
d = dict(src_dict)
|
||||
data = CreateWorkflowResponse201Data.from_dict(d.pop("data"))
|
||||
|
||||
|
||||
|
||||
|
||||
def _parse_message(data: object) -> None | str | Unset:
|
||||
if data is None:
|
||||
return data
|
||||
if isinstance(data, Unset):
|
||||
return data
|
||||
return cast(None | str | Unset, data)
|
||||
|
||||
message = _parse_message(d.pop("message", UNSET))
|
||||
|
||||
|
||||
create_workflow_response_201 = cls(
|
||||
data=data,
|
||||
message=message,
|
||||
)
|
||||
|
||||
|
||||
create_workflow_response_201.additional_properties = d
|
||||
return create_workflow_response_201
|
||||
|
||||
@property
|
||||
def additional_keys(self) -> list[str]:
|
||||
return list(self.additional_properties.keys())
|
||||
|
||||
def __getitem__(self, key: str) -> Any:
|
||||
return self.additional_properties[key]
|
||||
|
||||
def __setitem__(self, key: str, value: Any) -> None:
|
||||
self.additional_properties[key] = value
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
del self.additional_properties[key]
|
||||
|
||||
def __contains__(self, key: str) -> bool:
|
||||
return key in self.additional_properties
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user