diff --git a/CHANGELOG.md b/CHANGELOG.md index a0a88b4c..bca58cc4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## Release (2025-XX-XX) +- `stackitmarketplace`: [v0.2.0](services/stackitmarketplace/CHANGELOG.md#v020-2025-03-05) + - **Feature:** Add method to create inquiries: `InquiriesCreateInquiry` + - **Feature:** Add `sort` property to `ApiListCatalogProductsRequest` + - **Feature:** Add payload `ApproveSubscriptionPayload` for `ApiApproveSubscriptionRequest` - `objectstorage`: [v1.0.1](services/objectstorage/CHANGELOG.md#v101-2025-02-26) - New value `eu02` in region enum - `postgresflex`: [v1.0.0](services/postgresflex/CHANGELOG.md#v100-2025-02-27) diff --git a/services/stackitmarketplace/CHANGELOG.md b/services/stackitmarketplace/CHANGELOG.md index 758949d3..be22e15f 100644 --- a/services/stackitmarketplace/CHANGELOG.md +++ b/services/stackitmarketplace/CHANGELOG.md @@ -1,3 +1,9 @@ +## v0.2.0 (2025-03-05) + +- **Feature:** Add method to create inquiries: `InquiriesCreateInquiry` +- **Feature:** Add `sort` property to `ApiListCatalogProductsRequest` +- **Feature:** Add payload `ApproveSubscriptionPayload` for `ApiApproveSubscriptionRequest` + ## v0.1.0 (2025-01-13) - **New**: STACKIT Marketplace module can be used to manage the STACKIT Marketplace. diff --git a/services/stackitmarketplace/pyproject.toml b/services/stackitmarketplace/pyproject.toml index fcda5781..022fb0c9 100644 --- a/services/stackitmarketplace/pyproject.toml +++ b/services/stackitmarketplace/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-stackitmarketplace" [tool.poetry] name = "stackit-stackitmarketplace" -version = "v0.1.0" +version = "v0.2.0" authors = [ "STACKIT Developer Tools ", ] diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/__init__.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/__init__.py index e1f15fc6..52f7e17d 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/__init__.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/__init__.py @@ -8,7 +8,7 @@ API to manage STACKIT Marketplace. The version of the OpenAPI document: 1 - Contact: marketplace@stackit.de + Contact: marketplace@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -34,6 +34,13 @@ ) # import models into sdk package +from stackit.stackitmarketplace.models.approve_subscription_payload import ( + ApproveSubscriptionPayload, +) +from stackit.stackitmarketplace.models.become_vendor import BecomeVendor +from stackit.stackitmarketplace.models.become_vendor_become_vendor import ( + BecomeVendorBecomeVendor, +) from stackit.stackitmarketplace.models.catalog_pricing_option_highlight import ( CatalogPricingOptionHighlight, ) @@ -61,16 +68,27 @@ from stackit.stackitmarketplace.models.catalog_product_vendor_terms import ( CatalogProductVendorTerms, ) +from stackit.stackitmarketplace.models.contact_sales import ContactSales +from stackit.stackitmarketplace.models.contact_sales_contact_sales import ( + ContactSalesContactSales, +) from stackit.stackitmarketplace.models.current_subscription_state_response import ( CurrentSubscriptionStateResponse, ) from stackit.stackitmarketplace.models.error_response import ErrorResponse +from stackit.stackitmarketplace.models.inquiries_create_inquiry_payload import ( + InquiriesCreateInquiryPayload, +) from stackit.stackitmarketplace.models.list_catalog_products_response import ( ListCatalogProductsResponse, ) from stackit.stackitmarketplace.models.list_vendor_subscriptions_response import ( ListVendorSubscriptionsResponse, ) +from stackit.stackitmarketplace.models.register_testing import RegisterTesting +from stackit.stackitmarketplace.models.register_testing_register_testing import ( + RegisterTestingRegisterTesting, +) from stackit.stackitmarketplace.models.requested_subscription_state_response import ( RequestedSubscriptionStateResponse, ) @@ -81,4 +99,8 @@ SubscriptionCancelResponse, ) from stackit.stackitmarketplace.models.subscription_product import SubscriptionProduct +from stackit.stackitmarketplace.models.suggest_product import SuggestProduct +from stackit.stackitmarketplace.models.suggest_product_suggest_product import ( + SuggestProductSuggestProduct, +) from stackit.stackitmarketplace.models.vendor_subscription import VendorSubscription diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/api/default_api.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/api/default_api.py index c004d0df..0a7dce0c 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/api/default_api.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/api/default_api.py @@ -6,7 +6,7 @@ API to manage STACKIT Marketplace. The version of the OpenAPI document: 1 - Contact: marketplace@stackit.de + Contact: marketplace@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -26,9 +26,15 @@ from stackit.stackitmarketplace.api_client import ApiClient, RequestSerialized from stackit.stackitmarketplace.api_response import ApiResponse +from stackit.stackitmarketplace.models.approve_subscription_payload import ( + ApproveSubscriptionPayload, +) from stackit.stackitmarketplace.models.catalog_product_detail import ( CatalogProductDetail, ) +from stackit.stackitmarketplace.models.inquiries_create_inquiry_payload import ( + InquiriesCreateInquiryPayload, +) from stackit.stackitmarketplace.models.list_catalog_products_response import ( ListCatalogProductsResponse, ) @@ -60,6 +66,7 @@ def approve_subscription( self, project_id: Annotated[StrictStr, Field(description="The project ID.")], subscription_id: Annotated[StrictStr, Field(description="The subscription ID.")], + approve_subscription_payload: Optional[ApproveSubscriptionPayload] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -78,6 +85,8 @@ def approve_subscription( :type project_id: str :param subscription_id: The subscription ID. (required) :type subscription_id: str + :param approve_subscription_payload: + :type approve_subscription_payload: ApproveSubscriptionPayload :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 @@ -103,6 +112,7 @@ def approve_subscription( _param = self._approve_subscription_serialize( project_id=project_id, subscription_id=subscription_id, + approve_subscription_payload=approve_subscription_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -128,6 +138,7 @@ def approve_subscription_with_http_info( self, project_id: Annotated[StrictStr, Field(description="The project ID.")], subscription_id: Annotated[StrictStr, Field(description="The subscription ID.")], + approve_subscription_payload: Optional[ApproveSubscriptionPayload] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -146,6 +157,8 @@ def approve_subscription_with_http_info( :type project_id: str :param subscription_id: The subscription ID. (required) :type subscription_id: str + :param approve_subscription_payload: + :type approve_subscription_payload: ApproveSubscriptionPayload :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 @@ -171,6 +184,7 @@ def approve_subscription_with_http_info( _param = self._approve_subscription_serialize( project_id=project_id, subscription_id=subscription_id, + approve_subscription_payload=approve_subscription_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -196,6 +210,7 @@ def approve_subscription_without_preload_content( self, project_id: Annotated[StrictStr, Field(description="The project ID.")], subscription_id: Annotated[StrictStr, Field(description="The subscription ID.")], + approve_subscription_payload: Optional[ApproveSubscriptionPayload] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -214,6 +229,8 @@ def approve_subscription_without_preload_content( :type project_id: str :param subscription_id: The subscription ID. (required) :type subscription_id: str + :param approve_subscription_payload: + :type approve_subscription_payload: ApproveSubscriptionPayload :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 @@ -239,6 +256,7 @@ def approve_subscription_without_preload_content( _param = self._approve_subscription_serialize( project_id=project_id, subscription_id=subscription_id, + approve_subscription_payload=approve_subscription_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -259,6 +277,7 @@ def _approve_subscription_serialize( self, project_id, subscription_id, + approve_subscription_payload, _request_auth, _content_type, _headers, @@ -285,11 +304,21 @@ def _approve_subscription_serialize( # process the header parameters # process the form parameters # process the body parameter + if approve_subscription_payload is not None: + _body_params = approve_subscription_payload # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + # authentication setting _auth_settings: List[str] = [] @@ -816,6 +845,252 @@ def _get_vendor_subscription_serialize( _request_auth=_request_auth, ) + @validate_call + def inquiries_create_inquiry( + self, + inquiries_create_inquiry_payload: InquiriesCreateInquiryPayload, + _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: + """Create inquiry + + Create an inquiry to contact sales, become a vendor, or suggest a product. Requests are limited to 10 per 5 minutes. + + :param inquiries_create_inquiry_payload: (required) + :type inquiries_create_inquiry_payload: InquiriesCreateInquiryPayload + :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 docstring might be too long + + _param = self._inquiries_create_inquiry_serialize( + inquiries_create_inquiry_payload=inquiries_create_inquiry_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "202": None, + "400": "ErrorResponse", + "401": "ErrorResponse", + "403": "ErrorResponse", + "404": "ErrorResponse", + } + 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 inquiries_create_inquiry_with_http_info( + self, + inquiries_create_inquiry_payload: InquiriesCreateInquiryPayload, + _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]: + """Create inquiry + + Create an inquiry to contact sales, become a vendor, or suggest a product. Requests are limited to 10 per 5 minutes. + + :param inquiries_create_inquiry_payload: (required) + :type inquiries_create_inquiry_payload: InquiriesCreateInquiryPayload + :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 docstring might be too long + + _param = self._inquiries_create_inquiry_serialize( + inquiries_create_inquiry_payload=inquiries_create_inquiry_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "202": None, + "400": "ErrorResponse", + "401": "ErrorResponse", + "403": "ErrorResponse", + "404": "ErrorResponse", + } + 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 inquiries_create_inquiry_without_preload_content( + self, + inquiries_create_inquiry_payload: InquiriesCreateInquiryPayload, + _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: + """Create inquiry + + Create an inquiry to contact sales, become a vendor, or suggest a product. Requests are limited to 10 per 5 minutes. + + :param inquiries_create_inquiry_payload: (required) + :type inquiries_create_inquiry_payload: InquiriesCreateInquiryPayload + :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 docstring might be too long + + _param = self._inquiries_create_inquiry_serialize( + inquiries_create_inquiry_payload=inquiries_create_inquiry_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "202": None, + "400": "ErrorResponse", + "401": "ErrorResponse", + "403": "ErrorResponse", + "404": "ErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _inquiries_create_inquiry_serialize( + self, + inquiries_create_inquiry_payload, + _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, Union[str, bytes]] = {} + _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 + if inquiries_create_inquiry_payload is not None: + _body_params = inquiries_create_inquiry_payload + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="POST", + resource_path="/v1/inquiries", + 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 list_catalog_products( self, @@ -836,6 +1111,18 @@ def list_catalog_products( ), ] = None, locale: Annotated[Optional[StrictStr], Field(description="The language of the response.")] = None, + filter: Annotated[ + Optional[StrictStr], + Field( + description='Filter the products based on attributes. E.g `deliveryMethod eq "SAAS"`. The supported attributes are `deliveryMethod`, `priceType`, `category`, `vendorId`, `vendorName`, and `name`. The supported operators are `eq`. Filters can be joined with `and` or `or`.' + ), + ] = None, + sort: Annotated[ + Optional[StrictStr], + Field( + description="Sort the products based on attributes and order (if specified). E.g `name:asc`. The supported attributes are `name`, `price`, and `deliveryMethod`. To set the sort order, append `asc` (ascending) or `desc` (descending) to the attribute, e.g. `name:asc`. To sort by multiple attributes, separate them with a comma. E.g `name,price:desc`. The order can be ommited to sort by the default order. E.g `name`." + ), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -856,6 +1143,10 @@ def list_catalog_products( :type limit: float :param locale: The language of the response. :type locale: str + :param filter: Filter the products based on attributes. E.g `deliveryMethod eq \"SAAS\"`. The supported attributes are `deliveryMethod`, `priceType`, `category`, `vendorId`, `vendorName`, and `name`. The supported operators are `eq`. Filters can be joined with `and` or `or`. + :type filter: str + :param sort: Sort the products based on attributes and order (if specified). E.g `name:asc`. The supported attributes are `name`, `price`, and `deliveryMethod`. To set the sort order, append `asc` (ascending) or `desc` (descending) to the attribute, e.g. `name:asc`. To sort by multiple attributes, separate them with a comma. E.g `name,price:desc`. The order can be ommited to sort by the default order. E.g `name`. + :type sort: 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 @@ -882,6 +1173,8 @@ def list_catalog_products( cursor=cursor, limit=limit, locale=locale, + filter=filter, + sort=sort, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -921,6 +1214,18 @@ def list_catalog_products_with_http_info( ), ] = None, locale: Annotated[Optional[StrictStr], Field(description="The language of the response.")] = None, + filter: Annotated[ + Optional[StrictStr], + Field( + description='Filter the products based on attributes. E.g `deliveryMethod eq "SAAS"`. The supported attributes are `deliveryMethod`, `priceType`, `category`, `vendorId`, `vendorName`, and `name`. The supported operators are `eq`. Filters can be joined with `and` or `or`.' + ), + ] = None, + sort: Annotated[ + Optional[StrictStr], + Field( + description="Sort the products based on attributes and order (if specified). E.g `name:asc`. The supported attributes are `name`, `price`, and `deliveryMethod`. To set the sort order, append `asc` (ascending) or `desc` (descending) to the attribute, e.g. `name:asc`. To sort by multiple attributes, separate them with a comma. E.g `name,price:desc`. The order can be ommited to sort by the default order. E.g `name`." + ), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -941,6 +1246,10 @@ def list_catalog_products_with_http_info( :type limit: float :param locale: The language of the response. :type locale: str + :param filter: Filter the products based on attributes. E.g `deliveryMethod eq \"SAAS\"`. The supported attributes are `deliveryMethod`, `priceType`, `category`, `vendorId`, `vendorName`, and `name`. The supported operators are `eq`. Filters can be joined with `and` or `or`. + :type filter: str + :param sort: Sort the products based on attributes and order (if specified). E.g `name:asc`. The supported attributes are `name`, `price`, and `deliveryMethod`. To set the sort order, append `asc` (ascending) or `desc` (descending) to the attribute, e.g. `name:asc`. To sort by multiple attributes, separate them with a comma. E.g `name,price:desc`. The order can be ommited to sort by the default order. E.g `name`. + :type sort: 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 @@ -967,6 +1276,8 @@ def list_catalog_products_with_http_info( cursor=cursor, limit=limit, locale=locale, + filter=filter, + sort=sort, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1006,6 +1317,18 @@ def list_catalog_products_without_preload_content( ), ] = None, locale: Annotated[Optional[StrictStr], Field(description="The language of the response.")] = None, + filter: Annotated[ + Optional[StrictStr], + Field( + description='Filter the products based on attributes. E.g `deliveryMethod eq "SAAS"`. The supported attributes are `deliveryMethod`, `priceType`, `category`, `vendorId`, `vendorName`, and `name`. The supported operators are `eq`. Filters can be joined with `and` or `or`.' + ), + ] = None, + sort: Annotated[ + Optional[StrictStr], + Field( + description="Sort the products based on attributes and order (if specified). E.g `name:asc`. The supported attributes are `name`, `price`, and `deliveryMethod`. To set the sort order, append `asc` (ascending) or `desc` (descending) to the attribute, e.g. `name:asc`. To sort by multiple attributes, separate them with a comma. E.g `name,price:desc`. The order can be ommited to sort by the default order. E.g `name`." + ), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1026,6 +1349,10 @@ def list_catalog_products_without_preload_content( :type limit: float :param locale: The language of the response. :type locale: str + :param filter: Filter the products based on attributes. E.g `deliveryMethod eq \"SAAS\"`. The supported attributes are `deliveryMethod`, `priceType`, `category`, `vendorId`, `vendorName`, and `name`. The supported operators are `eq`. Filters can be joined with `and` or `or`. + :type filter: str + :param sort: Sort the products based on attributes and order (if specified). E.g `name:asc`. The supported attributes are `name`, `price`, and `deliveryMethod`. To set the sort order, append `asc` (ascending) or `desc` (descending) to the attribute, e.g. `name:asc`. To sort by multiple attributes, separate them with a comma. E.g `name,price:desc`. The order can be ommited to sort by the default order. E.g `name`. + :type sort: 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 @@ -1052,6 +1379,8 @@ def list_catalog_products_without_preload_content( cursor=cursor, limit=limit, locale=locale, + filter=filter, + sort=sort, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1072,6 +1401,8 @@ def _list_catalog_products_serialize( cursor, limit, locale, + filter, + sort, _request_auth, _content_type, _headers, @@ -1103,6 +1434,14 @@ def _list_catalog_products_serialize( _query_params.append(("locale", locale)) + if filter is not None: + + _query_params.append(("filter", filter)) + + if sort is not None: + + _query_params.append(("sort", sort)) + # process the header parameters # process the form parameters # process the body parameter diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/api_client.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/api_client.py index d6a3695d..590b1854 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/api_client.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/api_client.py @@ -6,7 +6,7 @@ API to manage STACKIT Marketplace. The version of the OpenAPI document: 1 - Contact: marketplace@stackit.de + Contact: marketplace@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/configuration.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/configuration.py index 1cdb77a8..11ea4a83 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/configuration.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/configuration.py @@ -6,7 +6,7 @@ API to manage STACKIT Marketplace. The version of the OpenAPI document: 1 - Contact: marketplace@stackit.de + Contact: marketplace@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/exceptions.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/exceptions.py index ef4997b3..d3bf0cf8 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/exceptions.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/exceptions.py @@ -6,7 +6,7 @@ API to manage STACKIT Marketplace. The version of the OpenAPI document: 1 - Contact: marketplace@stackit.de + Contact: marketplace@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/__init__.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/__init__.py index ce52d668..aa388dbc 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/__init__.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/__init__.py @@ -7,7 +7,7 @@ API to manage STACKIT Marketplace. The version of the OpenAPI document: 1 - Contact: marketplace@stackit.de + Contact: marketplace@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -15,6 +15,13 @@ # import models into model package +from stackit.stackitmarketplace.models.approve_subscription_payload import ( + ApproveSubscriptionPayload, +) +from stackit.stackitmarketplace.models.become_vendor import BecomeVendor +from stackit.stackitmarketplace.models.become_vendor_become_vendor import ( + BecomeVendorBecomeVendor, +) from stackit.stackitmarketplace.models.catalog_pricing_option_highlight import ( CatalogPricingOptionHighlight, ) @@ -42,16 +49,27 @@ from stackit.stackitmarketplace.models.catalog_product_vendor_terms import ( CatalogProductVendorTerms, ) +from stackit.stackitmarketplace.models.contact_sales import ContactSales +from stackit.stackitmarketplace.models.contact_sales_contact_sales import ( + ContactSalesContactSales, +) from stackit.stackitmarketplace.models.current_subscription_state_response import ( CurrentSubscriptionStateResponse, ) from stackit.stackitmarketplace.models.error_response import ErrorResponse +from stackit.stackitmarketplace.models.inquiries_create_inquiry_payload import ( + InquiriesCreateInquiryPayload, +) from stackit.stackitmarketplace.models.list_catalog_products_response import ( ListCatalogProductsResponse, ) from stackit.stackitmarketplace.models.list_vendor_subscriptions_response import ( ListVendorSubscriptionsResponse, ) +from stackit.stackitmarketplace.models.register_testing import RegisterTesting +from stackit.stackitmarketplace.models.register_testing_register_testing import ( + RegisterTestingRegisterTesting, +) from stackit.stackitmarketplace.models.requested_subscription_state_response import ( RequestedSubscriptionStateResponse, ) @@ -62,4 +80,8 @@ SubscriptionCancelResponse, ) from stackit.stackitmarketplace.models.subscription_product import SubscriptionProduct +from stackit.stackitmarketplace.models.suggest_product import SuggestProduct +from stackit.stackitmarketplace.models.suggest_product_suggest_product import ( + SuggestProductSuggestProduct, +) from stackit.stackitmarketplace.models.vendor_subscription import VendorSubscription diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/approve_subscription_payload.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/approve_subscription_payload.py new file mode 100644 index 00000000..0951ec55 --- /dev/null +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/approve_subscription_payload.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + STACKIT Marketplace API + + API to manage STACKIT Marketplace. + + The version of the OpenAPI document: 1 + Contact: marketplace@stackit.cloud + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + + +class ApproveSubscriptionPayload(BaseModel): + """ + ApproveSubscriptionPayload + """ + + instance_target: Optional[StrictStr] = Field( + default=None, + description="The target URL of the user instance, used to redirect the user to the instance after the subscription is active.", + alias="instanceTarget", + ) + __properties: ClassVar[List[str]] = ["instanceTarget"] + + 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 ApproveSubscriptionPayload 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 ApproveSubscriptionPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"instanceTarget": obj.get("instanceTarget")}) + return _obj diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/become_vendor.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/become_vendor.py new file mode 100644 index 00000000..282075dc --- /dev/null +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/become_vendor.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + STACKIT Marketplace API + + API to manage STACKIT Marketplace. + + The version of the OpenAPI document: 1 + Contact: marketplace@stackit.cloud + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing_extensions import Self + +from stackit.stackitmarketplace.models.become_vendor_become_vendor import ( + BecomeVendorBecomeVendor, +) + + +class BecomeVendor(BaseModel): + """ + Become a vendor. + """ + + become_vendor: BecomeVendorBecomeVendor = Field(alias="becomeVendor") + type: StrictStr = Field(description="The form type.") + __properties: ClassVar[List[str]] = ["becomeVendor", "type"] + + @field_validator("type") + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(["become_vendor"]): + raise ValueError("must be one of enum values ('become_vendor')") + return value + + 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 BecomeVendor 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, + ) + # override the default output from pydantic by calling `to_dict()` of become_vendor + if self.become_vendor: + _dict["becomeVendor"] = self.become_vendor.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BecomeVendor from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "becomeVendor": ( + BecomeVendorBecomeVendor.from_dict(obj["becomeVendor"]) + if obj.get("becomeVendor") is not None + else None + ), + "type": obj.get("type"), + } + ) + return _obj diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/become_vendor_become_vendor.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/become_vendor_become_vendor.py new file mode 100644 index 00000000..c6ccaf3c --- /dev/null +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/become_vendor_become_vendor.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + STACKIT Marketplace API + + API to manage STACKIT Marketplace. + + The version of the OpenAPI document: 1 + Contact: marketplace@stackit.cloud + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing_extensions import Annotated, Self + + +class BecomeVendorBecomeVendor(BaseModel): + """ + BecomeVendorBecomeVendor + """ + + contact_email: StrictStr = Field(description="The contact e-mail address.", alias="contactEmail") + message: Annotated[str, Field(strict=True, max_length=512)] = Field(description="The message content.") + __properties: ClassVar[List[str]] = ["contactEmail", "message"] + + @field_validator("message") + def message_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[a-zA-ZäüöÄÜÖ0-9,.!?()@\/:=\n\t -]+$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-ZäüöÄÜÖ0-9,.!?()@\/:=\n\t -]+$/") + return value + + 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 BecomeVendorBecomeVendor 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 BecomeVendorBecomeVendor from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"contactEmail": obj.get("contactEmail"), "message": obj.get("message")}) + return _obj diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_pricing_option_highlight.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_pricing_option_highlight.py index c284710f..ab658310 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_pricing_option_highlight.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_pricing_option_highlight.py @@ -6,7 +6,7 @@ API to manage STACKIT Marketplace. The version of the OpenAPI document: 1 - Contact: marketplace@stackit.de + Contact: marketplace@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_detail.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_detail.py index 8ad6e1a8..84907759 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_detail.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_detail.py @@ -6,7 +6,7 @@ API to manage STACKIT Marketplace. The version of the OpenAPI document: 1 - Contact: marketplace@stackit.de + Contact: marketplace@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_details_vendor.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_details_vendor.py index d47a235d..31445810 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_details_vendor.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_details_vendor.py @@ -6,7 +6,7 @@ API to manage STACKIT Marketplace. The version of the OpenAPI document: 1 - Contact: marketplace@stackit.de + Contact: marketplace@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_highlight.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_highlight.py index 0bf81737..3c7dc923 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_highlight.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_highlight.py @@ -6,7 +6,7 @@ API to manage STACKIT Marketplace. The version of the OpenAPI document: 1 - Contact: marketplace@stackit.de + Contact: marketplace@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_overview.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_overview.py index 4811f40f..7bb0b144 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_overview.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_overview.py @@ -6,7 +6,7 @@ API to manage STACKIT Marketplace. The version of the OpenAPI document: 1 - Contact: marketplace@stackit.de + Contact: marketplace@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_overview_vendor.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_overview_vendor.py index 50049775..03107e29 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_overview_vendor.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_overview_vendor.py @@ -6,7 +6,7 @@ API to manage STACKIT Marketplace. The version of the OpenAPI document: 1 - Contact: marketplace@stackit.de + Contact: marketplace@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_pricing_option.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_pricing_option.py index a7608c40..95691a73 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_pricing_option.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_pricing_option.py @@ -6,7 +6,7 @@ API to manage STACKIT Marketplace. The version of the OpenAPI document: 1 - Contact: marketplace@stackit.de + Contact: marketplace@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_support_resource.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_support_resource.py index 6bc35ba8..b109e360 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_support_resource.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_support_resource.py @@ -6,7 +6,7 @@ API to manage STACKIT Marketplace. The version of the OpenAPI document: 1 - Contact: marketplace@stackit.de + Contact: marketplace@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_vendor_terms.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_vendor_terms.py index 98522f58..cf68e2fb 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_vendor_terms.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_vendor_terms.py @@ -6,7 +6,7 @@ API to manage STACKIT Marketplace. The version of the OpenAPI document: 1 - Contact: marketplace@stackit.de + Contact: marketplace@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/contact_sales.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/contact_sales.py new file mode 100644 index 00000000..00812a5c --- /dev/null +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/contact_sales.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + STACKIT Marketplace API + + API to manage STACKIT Marketplace. + + The version of the OpenAPI document: 1 + Contact: marketplace@stackit.cloud + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing_extensions import Self + +from stackit.stackitmarketplace.models.contact_sales_contact_sales import ( + ContactSalesContactSales, +) + + +class ContactSales(BaseModel): + """ + Contact sales. + """ + + contact_sales: ContactSalesContactSales = Field(alias="contactSales") + type: StrictStr = Field(description="The form type.") + __properties: ClassVar[List[str]] = ["contactSales", "type"] + + @field_validator("type") + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(["contact_sales"]): + raise ValueError("must be one of enum values ('contact_sales')") + return value + + 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 ContactSales 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, + ) + # override the default output from pydantic by calling `to_dict()` of contact_sales + if self.contact_sales: + _dict["contactSales"] = self.contact_sales.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ContactSales from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "contactSales": ( + ContactSalesContactSales.from_dict(obj["contactSales"]) + if obj.get("contactSales") is not None + else None + ), + "type": obj.get("type"), + } + ) + return _obj diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/contact_sales_contact_sales.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/contact_sales_contact_sales.py new file mode 100644 index 00000000..f32e1368 --- /dev/null +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/contact_sales_contact_sales.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + STACKIT Marketplace API + + API to manage STACKIT Marketplace. + + The version of the OpenAPI document: 1 + Contact: marketplace@stackit.cloud + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing_extensions import Annotated, Self + + +class ContactSalesContactSales(BaseModel): + """ + ContactSalesContactSales + """ + + company_name: Annotated[str, Field(strict=True, max_length=512)] = Field( + description="The company name.", alias="companyName" + ) + contact_email: StrictStr = Field(description="The contact e-mail address.", alias="contactEmail") + full_name: Annotated[str, Field(strict=True, max_length=512)] = Field( + description="The full name of the contact person.", alias="fullName" + ) + message: Annotated[str, Field(strict=True, max_length=512)] = Field(description="The message content.") + product_id: StrictStr = Field(description="The product ID.", alias="productId") + __properties: ClassVar[List[str]] = ["companyName", "contactEmail", "fullName", "message", "productId"] + + @field_validator("company_name") + def company_name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[a-zA-ZäüöÄÜÖ0-9,.!?()@\/:=\n\t -]+$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-ZäüöÄÜÖ0-9,.!?()@\/:=\n\t -]+$/") + return value + + @field_validator("full_name") + def full_name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[a-zA-ZäüöÄÜÖ0-9,.!?()@\/:=\n\t -]+$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-ZäüöÄÜÖ0-9,.!?()@\/:=\n\t -]+$/") + return value + + @field_validator("message") + def message_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[a-zA-ZäüöÄÜÖ0-9,.!?()@\/:=\n\t -]+$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-ZäüöÄÜÖ0-9,.!?()@\/:=\n\t -]+$/") + return value + + 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 ContactSalesContactSales 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 ContactSalesContactSales from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "companyName": obj.get("companyName"), + "contactEmail": obj.get("contactEmail"), + "fullName": obj.get("fullName"), + "message": obj.get("message"), + "productId": obj.get("productId"), + } + ) + return _obj diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/current_subscription_state_response.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/current_subscription_state_response.py index c762659d..e4fd4d88 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/current_subscription_state_response.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/current_subscription_state_response.py @@ -6,7 +6,7 @@ API to manage STACKIT Marketplace. The version of the OpenAPI document: 1 - Contact: marketplace@stackit.de + Contact: marketplace@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/error_response.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/error_response.py index f048befc..40f579d4 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/error_response.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/error_response.py @@ -6,7 +6,7 @@ API to manage STACKIT Marketplace. The version of the OpenAPI document: 1 - Contact: marketplace@stackit.de + Contact: marketplace@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/inquiries_create_inquiry_payload.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/inquiries_create_inquiry_payload.py new file mode 100644 index 00000000..3cf3a6c5 --- /dev/null +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/inquiries_create_inquiry_payload.py @@ -0,0 +1,177 @@ +# coding: utf-8 + +""" + STACKIT Marketplace API + + API to manage STACKIT Marketplace. + + The version of the OpenAPI document: 1 + Contact: marketplace@stackit.cloud + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, Dict, Optional, Set, Union + +from pydantic import ( + BaseModel, + ConfigDict, + ValidationError, + field_validator, +) +from typing_extensions import Self + +from stackit.stackitmarketplace.models.become_vendor import BecomeVendor +from stackit.stackitmarketplace.models.contact_sales import ContactSales +from stackit.stackitmarketplace.models.register_testing import RegisterTesting +from stackit.stackitmarketplace.models.suggest_product import SuggestProduct + + +INQUIRIESCREATEINQUIRYPAYLOAD_ONE_OF_SCHEMAS = ["BecomeVendor", "ContactSales", "RegisterTesting", "SuggestProduct"] + + +class InquiriesCreateInquiryPayload(BaseModel): + """ + InquiriesCreateInquiryPayload + """ + + # data type: SuggestProduct + oneof_schema_1_validator: Optional[SuggestProduct] = None + # data type: ContactSales + oneof_schema_2_validator: Optional[ContactSales] = None + # data type: BecomeVendor + oneof_schema_3_validator: Optional[BecomeVendor] = None + # data type: RegisterTesting + oneof_schema_4_validator: Optional[RegisterTesting] = None + actual_instance: Optional[Union[BecomeVendor, ContactSales, RegisterTesting, SuggestProduct]] = None + one_of_schemas: Set[str] = {"BecomeVendor", "ContactSales", "RegisterTesting", "SuggestProduct"} + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator("actual_instance") + def actual_instance_must_validate_oneof(cls, v): + instance = InquiriesCreateInquiryPayload.model_construct() + error_messages = [] + match = 0 + # validate data type: SuggestProduct + if not isinstance(v, SuggestProduct): + error_messages.append(f"Error! Input type `{type(v)}` is not `SuggestProduct`") + else: + match += 1 + # validate data type: ContactSales + if not isinstance(v, ContactSales): + error_messages.append(f"Error! Input type `{type(v)}` is not `ContactSales`") + else: + match += 1 + # validate data type: BecomeVendor + if not isinstance(v, BecomeVendor): + error_messages.append(f"Error! Input type `{type(v)}` is not `BecomeVendor`") + else: + match += 1 + # validate data type: RegisterTesting + if not isinstance(v, RegisterTesting): + error_messages.append(f"Error! Input type `{type(v)}` is not `RegisterTesting`") + else: + match += 1 + if match == 0: + # no match + raise ValueError( + "No match found when setting `actual_instance` in InquiriesCreateInquiryPayload with oneOf schemas: BecomeVendor, ContactSales, RegisterTesting, SuggestProduct. Details: " + + ", ".join(error_messages) + ) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into SuggestProduct + try: + instance.actual_instance = SuggestProduct.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ContactSales + try: + instance.actual_instance = ContactSales.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into BecomeVendor + try: + instance.actual_instance = BecomeVendor.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into RegisterTesting + try: + instance.actual_instance = RegisterTesting.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError( + "Multiple matches found when deserializing the JSON string into InquiriesCreateInquiryPayload with oneOf schemas: BecomeVendor, ContactSales, RegisterTesting, SuggestProduct. Details: " + + ", ".join(error_messages) + ) + elif match == 0: + # no match + raise ValueError( + "No match found when deserializing the JSON string into InquiriesCreateInquiryPayload with oneOf schemas: BecomeVendor, ContactSales, RegisterTesting, SuggestProduct. Details: " + + ", ".join(error_messages) + ) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], BecomeVendor, ContactSales, RegisterTesting, SuggestProduct]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/list_catalog_products_response.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/list_catalog_products_response.py index ea73476a..f121edc2 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/list_catalog_products_response.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/list_catalog_products_response.py @@ -6,7 +6,7 @@ API to manage STACKIT Marketplace. The version of the OpenAPI document: 1 - Contact: marketplace@stackit.de + Contact: marketplace@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/list_vendor_subscriptions_response.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/list_vendor_subscriptions_response.py index 13962904..c65642e3 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/list_vendor_subscriptions_response.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/list_vendor_subscriptions_response.py @@ -6,7 +6,7 @@ API to manage STACKIT Marketplace. The version of the OpenAPI document: 1 - Contact: marketplace@stackit.de + Contact: marketplace@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/register_testing.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/register_testing.py new file mode 100644 index 00000000..70672011 --- /dev/null +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/register_testing.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + STACKIT Marketplace API + + API to manage STACKIT Marketplace. + + The version of the OpenAPI document: 1 + Contact: marketplace@stackit.cloud + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing_extensions import Self + +from stackit.stackitmarketplace.models.register_testing_register_testing import ( + RegisterTestingRegisterTesting, +) + + +class RegisterTesting(BaseModel): + """ + Register for testing. + """ + + register_testing: RegisterTestingRegisterTesting = Field(alias="registerTesting") + type: StrictStr = Field(description="The form type.") + __properties: ClassVar[List[str]] = ["registerTesting", "type"] + + @field_validator("type") + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(["register_testing"]): + raise ValueError("must be one of enum values ('register_testing')") + return value + + 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 RegisterTesting 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, + ) + # override the default output from pydantic by calling `to_dict()` of register_testing + if self.register_testing: + _dict["registerTesting"] = self.register_testing.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RegisterTesting from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "registerTesting": ( + RegisterTestingRegisterTesting.from_dict(obj["registerTesting"]) + if obj.get("registerTesting") is not None + else None + ), + "type": obj.get("type"), + } + ) + return _obj diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/register_testing_register_testing.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/register_testing_register_testing.py new file mode 100644 index 00000000..2c71d3d9 --- /dev/null +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/register_testing_register_testing.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + STACKIT Marketplace API + + API to manage STACKIT Marketplace. + + The version of the OpenAPI document: 1 + Contact: marketplace@stackit.cloud + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing_extensions import Annotated, Self + + +class RegisterTestingRegisterTesting(BaseModel): + """ + RegisterTestingRegisterTesting + """ + + contact_email: StrictStr = Field(description="The contact e-mail address.", alias="contactEmail") + full_name: Annotated[str, Field(strict=True, max_length=512)] = Field( + description="The full name of the contact person.", alias="fullName" + ) + message: Annotated[str, Field(strict=True, max_length=512)] = Field(description="The message content.") + __properties: ClassVar[List[str]] = ["contactEmail", "fullName", "message"] + + @field_validator("full_name") + def full_name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[a-zA-ZäüöÄÜÖ0-9,.!?()@\/:=\n\t -]+$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-ZäüöÄÜÖ0-9,.!?()@\/:=\n\t -]+$/") + return value + + @field_validator("message") + def message_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[a-zA-ZäüöÄÜÖ0-9,.!?()@\/:=\n\t -]+$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-ZäüöÄÜÖ0-9,.!?()@\/:=\n\t -]+$/") + return value + + 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 RegisterTestingRegisterTesting 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 RegisterTestingRegisterTesting from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + {"contactEmail": obj.get("contactEmail"), "fullName": obj.get("fullName"), "message": obj.get("message")} + ) + return _obj diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/requested_subscription_state_response.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/requested_subscription_state_response.py index a305a469..ab9b9312 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/requested_subscription_state_response.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/requested_subscription_state_response.py @@ -6,7 +6,7 @@ API to manage STACKIT Marketplace. The version of the OpenAPI document: 1 - Contact: marketplace@stackit.de + Contact: marketplace@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/resolve_customer_payload.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/resolve_customer_payload.py index 3194510b..bbddc462 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/resolve_customer_payload.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/resolve_customer_payload.py @@ -6,7 +6,7 @@ API to manage STACKIT Marketplace. The version of the OpenAPI document: 1 - Contact: marketplace@stackit.de + Contact: marketplace@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/subscription_cancel_response.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/subscription_cancel_response.py index eabf198d..aaf1e9e5 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/subscription_cancel_response.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/subscription_cancel_response.py @@ -6,7 +6,7 @@ API to manage STACKIT Marketplace. The version of the OpenAPI document: 1 - Contact: marketplace@stackit.de + Contact: marketplace@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/subscription_product.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/subscription_product.py index b542501a..66c1bfa3 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/subscription_product.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/subscription_product.py @@ -6,7 +6,7 @@ API to manage STACKIT Marketplace. The version of the OpenAPI document: 1 - Contact: marketplace@stackit.de + Contact: marketplace@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/suggest_product.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/suggest_product.py new file mode 100644 index 00000000..ce7902fa --- /dev/null +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/suggest_product.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + STACKIT Marketplace API + + API to manage STACKIT Marketplace. + + The version of the OpenAPI document: 1 + Contact: marketplace@stackit.cloud + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing_extensions import Self + +from stackit.stackitmarketplace.models.suggest_product_suggest_product import ( + SuggestProductSuggestProduct, +) + + +class SuggestProduct(BaseModel): + """ + Suggest a product. + """ + + suggest_product: SuggestProductSuggestProduct = Field(alias="suggestProduct") + type: StrictStr = Field(description="The form type.") + __properties: ClassVar[List[str]] = ["suggestProduct", "type"] + + @field_validator("type") + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(["suggest_product"]): + raise ValueError("must be one of enum values ('suggest_product')") + return value + + 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 SuggestProduct 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, + ) + # override the default output from pydantic by calling `to_dict()` of suggest_product + if self.suggest_product: + _dict["suggestProduct"] = self.suggest_product.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SuggestProduct from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "suggestProduct": ( + SuggestProductSuggestProduct.from_dict(obj["suggestProduct"]) + if obj.get("suggestProduct") is not None + else None + ), + "type": obj.get("type"), + } + ) + return _obj diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/suggest_product_suggest_product.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/suggest_product_suggest_product.py new file mode 100644 index 00000000..8d325a1f --- /dev/null +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/suggest_product_suggest_product.py @@ -0,0 +1,128 @@ +# coding: utf-8 + +""" + STACKIT Marketplace API + + API to manage STACKIT Marketplace. + + The version of the OpenAPI document: 1 + Contact: marketplace@stackit.cloud + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, field_validator +from typing_extensions import Annotated, Self + + +class SuggestProductSuggestProduct(BaseModel): + """ + SuggestProductSuggestProduct + """ + + company_name: Annotated[str, Field(strict=True, max_length=512)] = Field( + description="The suggested product's company name.", alias="companyName" + ) + message: Optional[Annotated[str, Field(strict=True, max_length=512)]] = Field( + default=None, description="An additional message." + ) + name: Annotated[str, Field(strict=True, max_length=512)] = Field(description="The suggested product name.") + url: Annotated[str, Field(strict=True, max_length=512)] = Field(description="The suggested product's website URL.") + __properties: ClassVar[List[str]] = ["companyName", "message", "name", "url"] + + @field_validator("company_name") + def company_name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[a-zA-ZäüöÄÜÖ0-9,.!?()@\/:=\n\t -]+$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-ZäüöÄÜÖ0-9,.!?()@\/:=\n\t -]+$/") + return value + + @field_validator("message") + def message_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^[a-zA-ZäüöÄÜÖ0-9,.!?()@\/:=\n\t -]+$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-ZäüöÄÜÖ0-9,.!?()@\/:=\n\t -]+$/") + return value + + @field_validator("name") + def name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[a-zA-ZäüöÄÜÖ0-9,.!?()@\/:=\n\t -]+$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-ZäüöÄÜÖ0-9,.!?()@\/:=\n\t -]+$/") + return value + + @field_validator("url") + def url_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[a-zA-ZäüöÄÜÖ0-9,.!?()@\/:=\n\t -]+$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-ZäüöÄÜÖ0-9,.!?()@\/:=\n\t -]+$/") + return value + + 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 SuggestProductSuggestProduct 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 SuggestProductSuggestProduct from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "companyName": obj.get("companyName"), + "message": obj.get("message"), + "name": obj.get("name"), + "url": obj.get("url"), + } + ) + return _obj diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/vendor_subscription.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/vendor_subscription.py index 31855dce..b00a1811 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/vendor_subscription.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/vendor_subscription.py @@ -6,7 +6,7 @@ API to manage STACKIT Marketplace. The version of the OpenAPI document: 1 - Contact: marketplace@stackit.de + Contact: marketplace@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/rest.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/rest.py index a5b6119f..931dbe73 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/rest.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/rest.py @@ -6,7 +6,7 @@ API to manage STACKIT Marketplace. The version of the OpenAPI document: 1 - Contact: marketplace@stackit.de + Contact: marketplace@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually.