From 830a81571cd5ec23c46c4ccbefdc8ca9ae9e1651 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 18 Sep 2024 16:33:43 -0500 Subject: [PATCH] feat: API Sync by GitHub Action for @ctreatma (#28) This API Sync PR was triggered by @ctreatma through [GitHub Actions workflow_displatch](https://github.com/equinix/equinix-sdk-python/actions?query=event%3Aworkflow_dispatch) on 2024-09-17. * latest Swagger is fetched * patches have been applied * generated client has been updated --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Charles Treatman --- equinix/services/metalv1/__init__.py | 2 - equinix/services/metalv1/api/__init__.py | 1 - equinix/services/metalv1/api/otps_api.py | 1052 ----------------- .../metalv1/api/two_factor_auth_api.py | 491 -------- equinix/services/metalv1/docs/OTPsApi.md | 318 ----- .../services/metalv1/docs/RecoveryCodeList.md | 30 - .../services/metalv1/docs/TwoFactorAuthApi.md | 147 --- equinix/services/metalv1/models/__init__.py | 1 - .../metalv1/models/recovery_code_list.py | 88 -- .../services/metalv1/test/test_otps_api.py | 58 - .../metalv1/test/test_recovery_code_list.py | 53 - .../metalv1/test/test_two_factor_auth_api.py | 14 - equinix/services/metalv1_README.md | 7 - script/patch_metal_spec.py | 11 - .../components/schemas/Project.yaml | 2 + .../components/schemas/RecoveryCodeList.yaml | 6 - .../metalv1/oas3.fetched/openapi3.yaml | 10 - .../metalv1/oas3.fetched/paths/plans.yaml | 2 +- .../paths/user/otp/recovery-codes.yaml | 62 - .../oas3.fetched/paths/user/otp/sms.yaml | 36 - .../paths/user/otp/sms/receive.yaml | 33 - .../paths/user/otp/verify/otp.yaml | 29 - .../metalv1/oas3.patched/openapi3.yaml | 174 --- 23 files changed, 3 insertions(+), 2624 deletions(-) delete mode 100644 equinix/services/metalv1/api/otps_api.py delete mode 100644 equinix/services/metalv1/docs/OTPsApi.md delete mode 100644 equinix/services/metalv1/docs/RecoveryCodeList.md delete mode 100644 equinix/services/metalv1/models/recovery_code_list.py delete mode 100644 equinix/services/metalv1/test/test_otps_api.py delete mode 100644 equinix/services/metalv1/test/test_recovery_code_list.py delete mode 100644 spec/services/metalv1/oas3.fetched/components/schemas/RecoveryCodeList.yaml delete mode 100644 spec/services/metalv1/oas3.fetched/paths/user/otp/recovery-codes.yaml delete mode 100644 spec/services/metalv1/oas3.fetched/paths/user/otp/sms.yaml delete mode 100644 spec/services/metalv1/oas3.fetched/paths/user/otp/sms/receive.yaml delete mode 100644 spec/services/metalv1/oas3.fetched/paths/user/otp/verify/otp.yaml diff --git a/equinix/services/metalv1/__init__.py b/equinix/services/metalv1/__init__.py index 175ce306..6bb98d66 100644 --- a/equinix/services/metalv1/__init__.py +++ b/equinix/services/metalv1/__init__.py @@ -36,7 +36,6 @@ from equinix.services.metalv1.api.memberships_api import MembershipsApi from equinix.services.metalv1.api.metal_gateways_api import MetalGatewaysApi from equinix.services.metalv1.api.metros_api import MetrosApi -from equinix.services.metalv1.api.otps_api import OTPsApi from equinix.services.metalv1.api.operating_systems_api import OperatingSystemsApi from equinix.services.metalv1.api.organizations_api import OrganizationsApi from equinix.services.metalv1.api.password_reset_tokens_api import PasswordResetTokensApi @@ -250,7 +249,6 @@ from equinix.services.metalv1.models.project_usage import ProjectUsage from equinix.services.metalv1.models.project_usage_list import ProjectUsageList from equinix.services.metalv1.models.raid import Raid -from equinix.services.metalv1.models.recovery_code_list import RecoveryCodeList from equinix.services.metalv1.models.request_ip_reservation201_response import RequestIPReservation201Response from equinix.services.metalv1.models.request_ip_reservation_request import RequestIPReservationRequest from equinix.services.metalv1.models.ssh_key import SSHKey diff --git a/equinix/services/metalv1/api/__init__.py b/equinix/services/metalv1/api/__init__.py index 3cedc5a3..b7e98563 100644 --- a/equinix/services/metalv1/api/__init__.py +++ b/equinix/services/metalv1/api/__init__.py @@ -21,7 +21,6 @@ from equinix.services.metalv1.api.memberships_api import MembershipsApi from equinix.services.metalv1.api.metal_gateways_api import MetalGatewaysApi from equinix.services.metalv1.api.metros_api import MetrosApi -from equinix.services.metalv1.api.otps_api import OTPsApi from equinix.services.metalv1.api.operating_systems_api import OperatingSystemsApi from equinix.services.metalv1.api.organizations_api import OrganizationsApi from equinix.services.metalv1.api.password_reset_tokens_api import PasswordResetTokensApi diff --git a/equinix/services/metalv1/api/otps_api.py b/equinix/services/metalv1/api/otps_api.py deleted file mode 100644 index f5ee9f7d..00000000 --- a/equinix/services/metalv1/api/otps_api.py +++ /dev/null @@ -1,1052 +0,0 @@ -# coding: utf-8 - -""" - Metal API - - The version of the OpenAPI document: 1.0.0 - Contact: support@equinixmetal.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from pydantic import Field, StrictStr -from typing_extensions import Annotated -from equinix.services.metalv1.models.recovery_code_list import RecoveryCodeList - -from equinix.services.metalv1.api_client import ApiClient, RequestSerialized -from equinix.services.metalv1.api_response import ApiResponse -from equinix.services.metalv1.rest import RESTResponseType - - -class OTPsApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - @validate_call - def find_ensure_otp( - self, - otp: Annotated[StrictStr, Field(description="OTP")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Verify user by providing an OTP - - It verifies the user once a valid OTP is provided. It gives back a session token, essentially logging in the user. - - :param otp: OTP (required) - :type otp: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._find_ensure_otp_serialize( - otp=otp, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "Error", - '401': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def find_ensure_otp_with_http_info( - self, - otp: Annotated[StrictStr, Field(description="OTP")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Verify user by providing an OTP - - It verifies the user once a valid OTP is provided. It gives back a session token, essentially logging in the user. - - :param otp: OTP (required) - :type otp: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._find_ensure_otp_serialize( - otp=otp, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "Error", - '401': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def find_ensure_otp_without_preload_content( - self, - otp: Annotated[StrictStr, Field(description="OTP")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Verify user by providing an OTP - - It verifies the user once a valid OTP is provided. It gives back a session token, essentially logging in the user. - - :param otp: OTP (required) - :type otp: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._find_ensure_otp_serialize( - otp=otp, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "Error", - '401': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _find_ensure_otp_serialize( - self, - otp, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if otp is not None: - _path_params['otp'] = otp - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'x_auth_token' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/user/otp/verify/{otp}', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - @validate_call - def find_recovery_codes( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RecoveryCodeList: - """Retrieve my recovery codes - - Returns my recovery codes. - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._find_recovery_codes_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "RecoveryCodeList", - '401': "Error", - '404': "Error", - '422': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def find_recovery_codes_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[RecoveryCodeList]: - """Retrieve my recovery codes - - Returns my recovery codes. - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._find_recovery_codes_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "RecoveryCodeList", - '401': "Error", - '404': "Error", - '422': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def find_recovery_codes_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Retrieve my recovery codes - - Returns my recovery codes. - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._find_recovery_codes_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "RecoveryCodeList", - '401': "Error", - '404': "Error", - '422': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _find_recovery_codes_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'x_auth_token' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/user/otp/recovery-codes', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - @validate_call - def receive_codes( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Receive an OTP per sms - - Sends an OTP to the user's mobile phone. - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._receive_codes_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "Error", - '401': "Error", - '422': "Error", - '500': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def receive_codes_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Receive an OTP per sms - - Sends an OTP to the user's mobile phone. - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._receive_codes_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "Error", - '401': "Error", - '422': "Error", - '500': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def receive_codes_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Receive an OTP per sms - - Sends an OTP to the user's mobile phone. - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._receive_codes_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "Error", - '401': "Error", - '422': "Error", - '500': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _receive_codes_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'x_auth_token' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/user/otp/sms/receive', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - @validate_call - def regenerate_codes( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RecoveryCodeList: - """Generate new recovery codes - - Generate a new set of recovery codes. - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._regenerate_codes_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "RecoveryCodeList", - '401': "Error", - '404': "Error", - '422': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def regenerate_codes_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[RecoveryCodeList]: - """Generate new recovery codes - - Generate a new set of recovery codes. - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._regenerate_codes_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "RecoveryCodeList", - '401': "Error", - '404': "Error", - '422': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def regenerate_codes_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Generate new recovery codes - - Generate a new set of recovery codes. - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._regenerate_codes_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "RecoveryCodeList", - '401': "Error", - '404': "Error", - '422': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _regenerate_codes_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'x_auth_token' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/user/otp/recovery-codes', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - diff --git a/equinix/services/metalv1/api/two_factor_auth_api.py b/equinix/services/metalv1/api/two_factor_auth_api.py index e69c12d2..1ea837c8 100644 --- a/equinix/services/metalv1/api/two_factor_auth_api.py +++ b/equinix/services/metalv1/api/two_factor_auth_api.py @@ -279,253 +279,6 @@ def _disable_tfa_app_serialize( ) - @validate_call - def disable_tfa_sms( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Disable two factor authentication - - Disables two factor authentication. - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._disable_tfa_sms_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '401': "Error", - '404': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def disable_tfa_sms_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Disable two factor authentication - - Disables two factor authentication. - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._disable_tfa_sms_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '401': "Error", - '404': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def disable_tfa_sms_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Disable two factor authentication - - Disables two factor authentication. - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._disable_tfa_sms_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '401': "Error", - '404': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _disable_tfa_sms_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'x_auth_token' - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/user/otp/sms', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - @validate_call def enable_tfa_app( self, @@ -770,247 +523,3 @@ def _enable_tfa_app_serialize( ) - @validate_call - def enable_tfa_sms( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Enable two factor auth using sms - - Enables two factor authentication with sms. - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._enable_tfa_sms_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '401': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def enable_tfa_sms_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Enable two factor auth using sms - - Enables two factor authentication with sms. - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._enable_tfa_sms_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '401': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def enable_tfa_sms_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Enable two factor auth using sms - - Enables two factor authentication with sms. - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._enable_tfa_sms_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '401': "Error", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _enable_tfa_sms_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'x_auth_token' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/user/otp/sms', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - diff --git a/equinix/services/metalv1/docs/OTPsApi.md b/equinix/services/metalv1/docs/OTPsApi.md deleted file mode 100644 index e794ea48..00000000 --- a/equinix/services/metalv1/docs/OTPsApi.md +++ /dev/null @@ -1,318 +0,0 @@ -# equinix.services.metalv1.OTPsApi - -All URIs are relative to *https://api.equinix.com/metal/v1* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**find_ensure_otp**](OTPsApi.md#find_ensure_otp) | **POST** /user/otp/verify/{otp} | Verify user by providing an OTP -[**find_recovery_codes**](OTPsApi.md#find_recovery_codes) | **GET** /user/otp/recovery-codes | Retrieve my recovery codes -[**receive_codes**](OTPsApi.md#receive_codes) | **POST** /user/otp/sms/receive | Receive an OTP per sms -[**regenerate_codes**](OTPsApi.md#regenerate_codes) | **POST** /user/otp/recovery-codes | Generate new recovery codes - - -# **find_ensure_otp** -> find_ensure_otp(otp) - -Verify user by providing an OTP - -It verifies the user once a valid OTP is provided. It gives back a session token, essentially logging in the user. - -### Example - -* Api Key Authentication (x_auth_token): - -```python -import equinix.services.metalv1 -from equinix.services.metalv1.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = equinix.services.metalv1.Configuration( - host = "https://api.equinix.com/metal/v1" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: x_auth_token -configuration.api_key['x_auth_token'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x_auth_token'] = 'Bearer' - -# Enter a context with an instance of the API client -with equinix.services.metalv1.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = equinix.services.metalv1.OTPsApi(api_client) - otp = 'otp_example' # str | OTP - - try: - # Verify user by providing an OTP - api_instance.find_ensure_otp(otp) - except Exception as e: - print("Exception when calling OTPsApi->find_ensure_otp: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **otp** | **str**| OTP | - -### Return type - -void (empty response body) - -### Authorization - -[x_auth_token](../README.md#x_auth_token) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**204** | no content | - | -**400** | bad request | - | -**401** | unauthorized | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **find_recovery_codes** -> RecoveryCodeList find_recovery_codes() - -Retrieve my recovery codes - -Returns my recovery codes. - -### Example - -* Api Key Authentication (x_auth_token): - -```python -import equinix.services.metalv1 -from equinix.services.metalv1.models.recovery_code_list import RecoveryCodeList -from equinix.services.metalv1.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = equinix.services.metalv1.Configuration( - host = "https://api.equinix.com/metal/v1" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: x_auth_token -configuration.api_key['x_auth_token'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x_auth_token'] = 'Bearer' - -# Enter a context with an instance of the API client -with equinix.services.metalv1.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = equinix.services.metalv1.OTPsApi(api_client) - - try: - # Retrieve my recovery codes - api_response = api_instance.find_recovery_codes() - print("The response of OTPsApi->find_recovery_codes:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling OTPsApi->find_recovery_codes: %s\n" % e) -``` - - - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**RecoveryCodeList**](RecoveryCodeList.md) - -### Authorization - -[x_auth_token](../README.md#x_auth_token) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | ok | - | -**401** | unauthorized | - | -**404** | not found | - | -**422** | unprocessable entity | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **receive_codes** -> receive_codes() - -Receive an OTP per sms - -Sends an OTP to the user's mobile phone. - -### Example - -* Api Key Authentication (x_auth_token): - -```python -import equinix.services.metalv1 -from equinix.services.metalv1.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = equinix.services.metalv1.Configuration( - host = "https://api.equinix.com/metal/v1" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: x_auth_token -configuration.api_key['x_auth_token'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x_auth_token'] = 'Bearer' - -# Enter a context with an instance of the API client -with equinix.services.metalv1.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = equinix.services.metalv1.OTPsApi(api_client) - - try: - # Receive an OTP per sms - api_instance.receive_codes() - except Exception as e: - print("Exception when calling OTPsApi->receive_codes: %s\n" % e) -``` - - - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -void (empty response body) - -### Authorization - -[x_auth_token](../README.md#x_auth_token) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**204** | no content | - | -**400** | bad request | - | -**401** | unauthorized | - | -**422** | unprocessable entity | - | -**500** | internal server error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **regenerate_codes** -> RecoveryCodeList regenerate_codes() - -Generate new recovery codes - -Generate a new set of recovery codes. - -### Example - -* Api Key Authentication (x_auth_token): - -```python -import equinix.services.metalv1 -from equinix.services.metalv1.models.recovery_code_list import RecoveryCodeList -from equinix.services.metalv1.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = equinix.services.metalv1.Configuration( - host = "https://api.equinix.com/metal/v1" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: x_auth_token -configuration.api_key['x_auth_token'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x_auth_token'] = 'Bearer' - -# Enter a context with an instance of the API client -with equinix.services.metalv1.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = equinix.services.metalv1.OTPsApi(api_client) - - try: - # Generate new recovery codes - api_response = api_instance.regenerate_codes() - print("The response of OTPsApi->regenerate_codes:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling OTPsApi->regenerate_codes: %s\n" % e) -``` - - - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**RecoveryCodeList**](RecoveryCodeList.md) - -### Authorization - -[x_auth_token](../README.md#x_auth_token) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | ok | - | -**401** | unauthorized | - | -**404** | not found | - | -**422** | unprocessable entity | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/RecoveryCodeList.md b/equinix/services/metalv1/docs/RecoveryCodeList.md deleted file mode 100644 index 524653b7..00000000 --- a/equinix/services/metalv1/docs/RecoveryCodeList.md +++ /dev/null @@ -1,30 +0,0 @@ -# RecoveryCodeList - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**href** | **str** | | [optional] -**recovery_codes** | **List[str]** | | [optional] - -## Example - -```python -from equinix.services.metalv1.models.recovery_code_list import RecoveryCodeList - -# TODO update the JSON string below -json = "{}" -# create an instance of RecoveryCodeList from a JSON string -recovery_code_list_instance = RecoveryCodeList.from_json(json) -# print the JSON string representation of the object -print(RecoveryCodeList.to_json()) - -# convert the object into a dict -recovery_code_list_dict = recovery_code_list_instance.to_dict() -# create an instance of RecoveryCodeList from a dict -recovery_code_list_form_dict = recovery_code_list.from_dict(recovery_code_list_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/equinix/services/metalv1/docs/TwoFactorAuthApi.md b/equinix/services/metalv1/docs/TwoFactorAuthApi.md index 8e7a6796..cb703b9a 100644 --- a/equinix/services/metalv1/docs/TwoFactorAuthApi.md +++ b/equinix/services/metalv1/docs/TwoFactorAuthApi.md @@ -5,9 +5,7 @@ All URIs are relative to *https://api.equinix.com/metal/v1* Method | HTTP request | Description ------------- | ------------- | ------------- [**disable_tfa_app**](TwoFactorAuthApi.md#disable_tfa_app) | **DELETE** /user/otp/app | Disable two factor authentication -[**disable_tfa_sms**](TwoFactorAuthApi.md#disable_tfa_sms) | **DELETE** /user/otp/sms | Disable two factor authentication [**enable_tfa_app**](TwoFactorAuthApi.md#enable_tfa_app) | **POST** /user/otp/app | Enable two factor auth using app -[**enable_tfa_sms**](TwoFactorAuthApi.md#enable_tfa_sms) | **POST** /user/otp/sms | Enable two factor auth using sms # **disable_tfa_app** @@ -57,79 +55,6 @@ with equinix.services.metalv1.ApiClient(configuration) as api_client: -### Parameters - -This endpoint does not need any parameter. - -### Return type - -void (empty response body) - -### Authorization - -[x_auth_token](../README.md#x_auth_token) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**204** | no content | - | -**401** | unauthorized | - | -**404** | not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **disable_tfa_sms** -> disable_tfa_sms() - -Disable two factor authentication - -Disables two factor authentication. - -### Example - -* Api Key Authentication (x_auth_token): - -```python -import equinix.services.metalv1 -from equinix.services.metalv1.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = equinix.services.metalv1.Configuration( - host = "https://api.equinix.com/metal/v1" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: x_auth_token -configuration.api_key['x_auth_token'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x_auth_token'] = 'Bearer' - -# Enter a context with an instance of the API client -with equinix.services.metalv1.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = equinix.services.metalv1.TwoFactorAuthApi(api_client) - - try: - # Disable two factor authentication - api_instance.disable_tfa_sms() - except Exception as e: - print("Exception when calling TwoFactorAuthApi->disable_tfa_sms: %s\n" % e) -``` - - - ### Parameters This endpoint does not need any parameter. @@ -203,78 +128,6 @@ with equinix.services.metalv1.ApiClient(configuration) as api_client: -### Parameters - -This endpoint does not need any parameter. - -### Return type - -void (empty response body) - -### Authorization - -[x_auth_token](../README.md#x_auth_token) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | ok | - | -**401** | unauthorized | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **enable_tfa_sms** -> enable_tfa_sms() - -Enable two factor auth using sms - -Enables two factor authentication with sms. - -### Example - -* Api Key Authentication (x_auth_token): - -```python -import equinix.services.metalv1 -from equinix.services.metalv1.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = equinix.services.metalv1.Configuration( - host = "https://api.equinix.com/metal/v1" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: x_auth_token -configuration.api_key['x_auth_token'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x_auth_token'] = 'Bearer' - -# Enter a context with an instance of the API client -with equinix.services.metalv1.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = equinix.services.metalv1.TwoFactorAuthApi(api_client) - - try: - # Enable two factor auth using sms - api_instance.enable_tfa_sms() - except Exception as e: - print("Exception when calling TwoFactorAuthApi->enable_tfa_sms: %s\n" % e) -``` - - - ### Parameters This endpoint does not need any parameter. diff --git a/equinix/services/metalv1/models/__init__.py b/equinix/services/metalv1/models/__init__.py index 69f12bdf..589c85e5 100644 --- a/equinix/services/metalv1/models/__init__.py +++ b/equinix/services/metalv1/models/__init__.py @@ -194,7 +194,6 @@ from equinix.services.metalv1.models.project_usage import ProjectUsage from equinix.services.metalv1.models.project_usage_list import ProjectUsageList from equinix.services.metalv1.models.raid import Raid -from equinix.services.metalv1.models.recovery_code_list import RecoveryCodeList from equinix.services.metalv1.models.request_ip_reservation201_response import RequestIPReservation201Response from equinix.services.metalv1.models.request_ip_reservation_request import RequestIPReservationRequest from equinix.services.metalv1.models.ssh_key import SSHKey diff --git a/equinix/services/metalv1/models/recovery_code_list.py b/equinix/services/metalv1/models/recovery_code_list.py deleted file mode 100644 index f90563ee..00000000 --- a/equinix/services/metalv1/models/recovery_code_list.py +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 - -""" - Metal API - - The version of the OpenAPI document: 1.0.0 - Contact: support@equinixmetal.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class RecoveryCodeList(BaseModel): - """ - RecoveryCodeList - """ # noqa: E501 - href: Optional[StrictStr] = None - recovery_codes: Optional[List[StrictStr]] = None - __properties: ClassVar[List[str]] = ["href", "recovery_codes"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of RecoveryCodeList from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of RecoveryCodeList from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "href": obj.get("href"), - "recovery_codes": obj.get("recovery_codes") - }) - return _obj - - diff --git a/equinix/services/metalv1/test/test_otps_api.py b/equinix/services/metalv1/test/test_otps_api.py deleted file mode 100644 index 6c313be0..00000000 --- a/equinix/services/metalv1/test/test_otps_api.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -""" - Metal API - - The version of the OpenAPI document: 1.0.0 - Contact: support@equinixmetal.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from equinix.services.metalv1.api.otps_api import OTPsApi - - -class TestOTPsApi(unittest.TestCase): - """OTPsApi unit test stubs""" - - def setUp(self) -> None: - self.api = OTPsApi() - - def tearDown(self) -> None: - pass - - def test_find_ensure_otp(self) -> None: - """Test case for find_ensure_otp - - Verify user by providing an OTP - """ - pass - - def test_find_recovery_codes(self) -> None: - """Test case for find_recovery_codes - - Retrieve my recovery codes - """ - pass - - def test_receive_codes(self) -> None: - """Test case for receive_codes - - Receive an OTP per sms - """ - pass - - def test_regenerate_codes(self) -> None: - """Test case for regenerate_codes - - Generate new recovery codes - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/equinix/services/metalv1/test/test_recovery_code_list.py b/equinix/services/metalv1/test/test_recovery_code_list.py deleted file mode 100644 index ad6010b9..00000000 --- a/equinix/services/metalv1/test/test_recovery_code_list.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - Metal API - - The version of the OpenAPI document: 1.0.0 - Contact: support@equinixmetal.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from equinix.services.metalv1.models.recovery_code_list import RecoveryCodeList - -class TestRecoveryCodeList(unittest.TestCase): - """RecoveryCodeList unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> RecoveryCodeList: - """Test RecoveryCodeList - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `RecoveryCodeList` - """ - model = RecoveryCodeList() - if include_optional: - return RecoveryCodeList( - href = '', - recovery_codes = [ - '' - ] - ) - else: - return RecoveryCodeList( - ) - """ - - def testRecoveryCodeList(self): - """Test RecoveryCodeList""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/equinix/services/metalv1/test/test_two_factor_auth_api.py b/equinix/services/metalv1/test/test_two_factor_auth_api.py index 801a01aa..d0fe852a 100644 --- a/equinix/services/metalv1/test/test_two_factor_auth_api.py +++ b/equinix/services/metalv1/test/test_two_factor_auth_api.py @@ -32,13 +32,6 @@ def test_disable_tfa_app(self) -> None: """ pass - def test_disable_tfa_sms(self) -> None: - """Test case for disable_tfa_sms - - Disable two factor authentication - """ - pass - def test_enable_tfa_app(self) -> None: """Test case for enable_tfa_app @@ -46,13 +39,6 @@ def test_enable_tfa_app(self) -> None: """ pass - def test_enable_tfa_sms(self) -> None: - """Test case for enable_tfa_sms - - Enable two factor auth using sms - """ - pass - if __name__ == '__main__': unittest.main() diff --git a/equinix/services/metalv1_README.md b/equinix/services/metalv1_README.md index ca1cf000..963c2dd4 100644 --- a/equinix/services/metalv1_README.md +++ b/equinix/services/metalv1_README.md @@ -188,10 +188,6 @@ Class | Method | HTTP request | Description *MetalGatewaysApi* | [**get_metal_gateway_elastic_ips**](equinix/services/metalv1/docs/MetalGatewaysApi.md#get_metal_gateway_elastic_ips) | **GET** /metal-gateways/{id}/ips | List Metal Gateway Elastic IPs *MetrosApi* | [**find_metros**](equinix/services/metalv1/docs/MetrosApi.md#find_metros) | **GET** /locations/metros | Retrieve all metros *MetrosApi* | [**get_metro**](equinix/services/metalv1/docs/MetrosApi.md#get_metro) | **GET** /locations/metros/{id} | Retrieve a specific Metro's details -*OTPsApi* | [**find_ensure_otp**](equinix/services/metalv1/docs/OTPsApi.md#find_ensure_otp) | **POST** /user/otp/verify/{otp} | Verify user by providing an OTP -*OTPsApi* | [**find_recovery_codes**](equinix/services/metalv1/docs/OTPsApi.md#find_recovery_codes) | **GET** /user/otp/recovery-codes | Retrieve my recovery codes -*OTPsApi* | [**receive_codes**](equinix/services/metalv1/docs/OTPsApi.md#receive_codes) | **POST** /user/otp/sms/receive | Receive an OTP per sms -*OTPsApi* | [**regenerate_codes**](equinix/services/metalv1/docs/OTPsApi.md#regenerate_codes) | **POST** /user/otp/recovery-codes | Generate new recovery codes *OperatingSystemsApi* | [**find_operating_system_version**](equinix/services/metalv1/docs/OperatingSystemsApi.md#find_operating_system_version) | **GET** /operating-system-versions | Retrieve all operating system versions *OperatingSystemsApi* | [**find_operating_systems**](equinix/services/metalv1/docs/OperatingSystemsApi.md#find_operating_systems) | **GET** /operating-systems | Retrieve all operating systems *OrganizationsApi* | [**create_organization**](equinix/services/metalv1/docs/OrganizationsApi.md#create_organization) | **POST** /organizations | Create an organization @@ -264,9 +260,7 @@ Class | Method | HTTP request | Description *TransferRequestsApi* | [**decline_transfer_request**](equinix/services/metalv1/docs/TransferRequestsApi.md#decline_transfer_request) | **DELETE** /transfers/{id} | Decline a transfer request *TransferRequestsApi* | [**find_transfer_request_by_id**](equinix/services/metalv1/docs/TransferRequestsApi.md#find_transfer_request_by_id) | **GET** /transfers/{id} | View a transfer request *TwoFactorAuthApi* | [**disable_tfa_app**](equinix/services/metalv1/docs/TwoFactorAuthApi.md#disable_tfa_app) | **DELETE** /user/otp/app | Disable two factor authentication -*TwoFactorAuthApi* | [**disable_tfa_sms**](equinix/services/metalv1/docs/TwoFactorAuthApi.md#disable_tfa_sms) | **DELETE** /user/otp/sms | Disable two factor authentication *TwoFactorAuthApi* | [**enable_tfa_app**](equinix/services/metalv1/docs/TwoFactorAuthApi.md#enable_tfa_app) | **POST** /user/otp/app | Enable two factor auth using app -*TwoFactorAuthApi* | [**enable_tfa_sms**](equinix/services/metalv1/docs/TwoFactorAuthApi.md#enable_tfa_sms) | **POST** /user/otp/sms | Enable two factor auth using sms *UsagesApi* | [**find_device_usages**](equinix/services/metalv1/docs/UsagesApi.md#find_device_usages) | **GET** /devices/{id}/usages | Retrieve all usages for device *UsagesApi* | [**find_project_usage**](equinix/services/metalv1/docs/UsagesApi.md#find_project_usage) | **GET** /projects/{id}/usages | Retrieve all usages for project *UserVerificationTokensApi* | [**consume_verification_request**](equinix/services/metalv1/docs/UserVerificationTokensApi.md#consume_verification_request) | **PUT** /verify-email | Verify a user using an email verification token @@ -485,7 +479,6 @@ Class | Method | HTTP request | Description - [ProjectUsage](equinix/services/metalv1/docs/ProjectUsage.md) - [ProjectUsageList](equinix/services/metalv1/docs/ProjectUsageList.md) - [Raid](equinix/services/metalv1/docs/Raid.md) - - [RecoveryCodeList](equinix/services/metalv1/docs/RecoveryCodeList.md) - [RequestIPReservation201Response](equinix/services/metalv1/docs/RequestIPReservation201Response.md) - [RequestIPReservationRequest](equinix/services/metalv1/docs/RequestIPReservationRequest.md) - [SSHKey](equinix/services/metalv1/docs/SSHKey.md) diff --git a/script/patch_metal_spec.py b/script/patch_metal_spec.py index 6e43bd09..507b14b3 100755 --- a/script/patch_metal_spec.py +++ b/script/patch_metal_spec.py @@ -78,17 +78,6 @@ def loadYaml(fn): del fixedSpec['components']['schemas']['Address']['required'] -# FIX 13. rename query attribute categories to "categories[]" - -plans_get_params = fixedSpec['paths']['/plans']['get']['parameters'] - -for i, p in enumerate(plans_get_params): - if p['name'] == 'categories': - fixedSpec['paths']['/plans']['get']['parameters'][i]['name'] = "categories[]" - break - - - # Mark paginated operation with `x-equinix-metal-paginated-property` refkey = "$ref" diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Project.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Project.yaml index 48af7d0b..5d074398 100644 --- a/spec/services/metalv1/oas3.fetched/components/schemas/Project.yaml +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Project.yaml @@ -1,4 +1,6 @@ properties: + backend_transfer_enabled: + type: boolean bgp_config: $ref: './Href.yaml' created_at: diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/RecoveryCodeList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/RecoveryCodeList.yaml deleted file mode 100644 index 40928232..00000000 --- a/spec/services/metalv1/oas3.fetched/components/schemas/RecoveryCodeList.yaml +++ /dev/null @@ -1,6 +0,0 @@ -properties: - recovery_codes: - items: - type: string - type: array -type: object diff --git a/spec/services/metalv1/oas3.fetched/openapi3.yaml b/spec/services/metalv1/oas3.fetched/openapi3.yaml index bb464539..27d44abe 100644 --- a/spec/services/metalv1/oas3.fetched/openapi3.yaml +++ b/spec/services/metalv1/oas3.fetched/openapi3.yaml @@ -371,8 +371,6 @@ components: $ref: './components/schemas/ProjectUsage.yaml' ProjectUsageList: $ref: './components/schemas/ProjectUsageList.yaml' - RecoveryCodeList: - $ref: './components/schemas/RecoveryCodeList.yaml' SSHKey: $ref: './components/schemas/SSHKey.yaml' SSHKeyCreateInput: @@ -788,14 +786,6 @@ paths: $ref: ./paths/user/api-keys/id.yaml /user/otp/app: $ref: ./paths/user/otp/app.yaml - /user/otp/recovery-codes: - $ref: ./paths/user/otp/recovery-codes.yaml - /user/otp/sms: - $ref: ./paths/user/otp/sms.yaml - /user/otp/sms/receive: - $ref: ./paths/user/otp/sms/receive.yaml - /user/otp/verify/{otp}: - $ref: ./paths/user/otp/verify/otp.yaml /userdata/validate: $ref: ./paths/userdata/validate.yaml /users: diff --git a/spec/services/metalv1/oas3.fetched/paths/plans.yaml b/spec/services/metalv1/oas3.fetched/paths/plans.yaml index 1f04891e..05764589 100644 --- a/spec/services/metalv1/oas3.fetched/paths/plans.yaml +++ b/spec/services/metalv1/oas3.fetched/paths/plans.yaml @@ -4,7 +4,7 @@ get: parameters: - description: Filter plans by its category in: query - name: categories + name: categories[] schema: type: array items: diff --git a/spec/services/metalv1/oas3.fetched/paths/user/otp/recovery-codes.yaml b/spec/services/metalv1/oas3.fetched/paths/user/otp/recovery-codes.yaml deleted file mode 100644 index b0f88de7..00000000 --- a/spec/services/metalv1/oas3.fetched/paths/user/otp/recovery-codes.yaml +++ /dev/null @@ -1,62 +0,0 @@ -get: - description: Returns my recovery codes. - operationId: findRecoveryCodes - responses: - "200": - content: - application/json: - schema: - $ref: '../../../components/schemas/RecoveryCodeList.yaml' - description: ok - "401": - content: - application/json: - schema: - $ref: '../../../components/schemas/Error.yaml' - description: unauthorized - "404": - content: - application/json: - schema: - $ref: '../../../components/schemas/Error.yaml' - description: not found - "422": - content: - application/json: - schema: - $ref: '../../../components/schemas/Error.yaml' - description: unprocessable entity - summary: Retrieve my recovery codes - tags: - - OTPs -post: - description: Generate a new set of recovery codes. - operationId: regenerateCodes - responses: - "200": - content: - application/json: - schema: - $ref: '../../../components/schemas/RecoveryCodeList.yaml' - description: ok - "401": - content: - application/json: - schema: - $ref: '../../../components/schemas/Error.yaml' - description: unauthorized - "404": - content: - application/json: - schema: - $ref: '../../../components/schemas/Error.yaml' - description: not found - "422": - content: - application/json: - schema: - $ref: '../../../components/schemas/Error.yaml' - description: unprocessable entity - summary: Generate new recovery codes - tags: - - OTPs diff --git a/spec/services/metalv1/oas3.fetched/paths/user/otp/sms.yaml b/spec/services/metalv1/oas3.fetched/paths/user/otp/sms.yaml deleted file mode 100644 index d7b17f74..00000000 --- a/spec/services/metalv1/oas3.fetched/paths/user/otp/sms.yaml +++ /dev/null @@ -1,36 +0,0 @@ -delete: - description: Disables two factor authentication. - operationId: disableTfaSms - responses: - "204": - description: no content - "401": - content: - application/json: - schema: - $ref: '../../../components/schemas/Error.yaml' - description: unauthorized - "404": - content: - application/json: - schema: - $ref: '../../../components/schemas/Error.yaml' - description: not found - summary: Disable two factor authentication - tags: - - TwoFactorAuth -post: - description: Enables two factor authentication with sms. - operationId: enableTfaSms - responses: - "200": - description: ok - "401": - content: - application/json: - schema: - $ref: '../../../components/schemas/Error.yaml' - description: unauthorized - summary: Enable two factor auth using sms - tags: - - TwoFactorAuth diff --git a/spec/services/metalv1/oas3.fetched/paths/user/otp/sms/receive.yaml b/spec/services/metalv1/oas3.fetched/paths/user/otp/sms/receive.yaml deleted file mode 100644 index c2bea8dc..00000000 --- a/spec/services/metalv1/oas3.fetched/paths/user/otp/sms/receive.yaml +++ /dev/null @@ -1,33 +0,0 @@ -post: - description: Sends an OTP to the user's mobile phone. - operationId: receiveCodes - responses: - "204": - description: no content - "400": - content: - application/json: - schema: - $ref: '../../../../components/schemas/Error.yaml' - description: bad request - "401": - content: - application/json: - schema: - $ref: '../../../../components/schemas/Error.yaml' - description: unauthorized - "422": - content: - application/json: - schema: - $ref: '../../../../components/schemas/Error.yaml' - description: unprocessable entity - "500": - content: - application/json: - schema: - $ref: '../../../../components/schemas/Error.yaml' - description: internal server error - summary: Receive an OTP per sms - tags: - - OTPs diff --git a/spec/services/metalv1/oas3.fetched/paths/user/otp/verify/otp.yaml b/spec/services/metalv1/oas3.fetched/paths/user/otp/verify/otp.yaml deleted file mode 100644 index 750dc153..00000000 --- a/spec/services/metalv1/oas3.fetched/paths/user/otp/verify/otp.yaml +++ /dev/null @@ -1,29 +0,0 @@ -post: - description: It verifies the user once a valid OTP is provided. It gives back a - session token, essentially logging in the user. - operationId: findEnsureOtp - parameters: - - description: OTP - in: path - name: otp - required: true - schema: - type: string - responses: - "204": - description: no content - "400": - content: - application/json: - schema: - $ref: '../../../../components/schemas/Error.yaml' - description: bad request - "401": - content: - application/json: - schema: - $ref: '../../../../components/schemas/Error.yaml' - description: unauthorized - summary: Verify user by providing an OTP - tags: - - OTPs diff --git a/spec/services/metalv1/oas3.patched/openapi3.yaml b/spec/services/metalv1/oas3.patched/openapi3.yaml index 65e120c7..9f8d9f25 100644 --- a/spec/services/metalv1/oas3.patched/openapi3.yaml +++ b/spec/services/metalv1/oas3.patched/openapi3.yaml @@ -4225,16 +4225,6 @@ components: name: type: string type: object - RecoveryCodeList: - properties: - href: - format: uri - type: string - recovery_codes: - items: - type: string - type: array - type: object SSHKey: properties: created_at: @@ -17997,170 +17987,6 @@ paths: summary: Enable two factor auth using app tags: - TwoFactorAuth - /user/otp/recovery-codes: - get: - description: Returns my recovery codes. - operationId: findRecoveryCodes - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/RecoveryCodeList' - description: ok - '401': - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: unauthorized - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: not found - '422': - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: unprocessable entity - summary: Retrieve my recovery codes - tags: - - OTPs - post: - description: Generate a new set of recovery codes. - operationId: regenerateCodes - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/RecoveryCodeList' - description: ok - '401': - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: unauthorized - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: not found - '422': - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: unprocessable entity - summary: Generate new recovery codes - tags: - - OTPs - /user/otp/sms: - delete: - description: Disables two factor authentication. - operationId: disableTfaSms - responses: - '204': - description: no content - '401': - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: unauthorized - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: not found - summary: Disable two factor authentication - tags: - - TwoFactorAuth - post: - description: Enables two factor authentication with sms. - operationId: enableTfaSms - responses: - '200': - description: ok - '401': - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: unauthorized - summary: Enable two factor auth using sms - tags: - - TwoFactorAuth - /user/otp/sms/receive: - post: - description: Sends an OTP to the user's mobile phone. - operationId: receiveCodes - responses: - '204': - description: no content - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: bad request - '401': - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: unauthorized - '422': - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: unprocessable entity - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: internal server error - summary: Receive an OTP per sms - tags: - - OTPs - /user/otp/verify/{otp}: - post: - description: It verifies the user once a valid OTP is provided. It gives back - a session token, essentially logging in the user. - operationId: findEnsureOtp - parameters: - - description: OTP - in: path - name: otp - required: true - schema: - type: string - responses: - '204': - description: no content - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: bad request - '401': - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: unauthorized - summary: Verify user by providing an OTP - tags: - - OTPs /userdata/validate: post: description: Validates user data (Userdata)