From 3ed4d22e04ca766186ea4e9d24555aebb1254162 Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 29 Nov 2024 08:07:46 +0000 Subject: [PATCH] Upgrade api specification --- packages/generator/spec.json | 370 ++++++------- .../miro-api-python/.openapi-generator/FILES | 6 +- .../miro-api-python/miro_api/api/__init__.py | 520 +++++++++--------- .../miro-api-python/miro_api/api_client.py | 2 +- .../miro-api-python/miro_api/configuration.py | 2 +- packages/miro-api/api/apis.ts | 6 +- 6 files changed, 453 insertions(+), 453 deletions(-) diff --git a/packages/generator/spec.json b/packages/generator/spec.json index 8b23ac1b..90504c58 100644 --- a/packages/generator/spec.json +++ b/packages/generator/spec.json @@ -141,193 +141,9 @@ } } }, - "/v2-experimental/apps/{app_id}/metrics": { - "get": { - "summary": "Get app metrics", - "description": "Returns a list of usage metrics for a specific app for a given time range, grouped by requested time period.\n\nThis endpoint requires an app management API token. It can be generated in the Your Apps section of Developer Hub. \n", - "operationId": "get-metrics", - "tags": ["app-management"], - "parameters": [ - { - "in": "path", - "name": "app_id", - "required": true, - "schema": { - "type": "string" - }, - "description": "ID of the app to get metrics for." - }, - { - "in": "query", - "name": "startDate", - "required": true, - "schema": { - "type": "string", - "format": "date" - }, - "description": "Start date of the period in UTC format. For example, 2024-12-31." - }, - { - "in": "query", - "name": "endDate", - "required": true, - "schema": { - "type": "string", - "format": "date" - }, - "description": "End date of the period in UTC format. For example, 2024-12-31." - }, - { - "in": "query", - "name": "period", - "schema": { - "type": "string", - "enum": ["DAY", "WEEK", "MONTH"], - "default": "WEEK" - }, - "description": "Group data by this time period." - } - ], - "responses": { - "200": { - "description": "Successful response", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "periodStart": { - "type": "string", - "description": "Date from which the metrics are aggregated.", - "format": "date" - }, - "uniqueUsers": { - "type": "integer", - "description": "Number of unique users who performed at least one activity in the application." - }, - "uniqueRecurringUsers": { - "type": "integer", - "description": "Number of unique users who have been active for more than one day over the past 30 days." - }, - "uniqueOrganizations": { - "type": "integer", - "description": "Number of unique company accounts that have installed the application." - }, - "installations": { - "type": "integer", - "description": "Number of application installations for a team." - }, - "uninstallations": { - "type": "integer", - "description": "Number of application uninstallations for a team." - } - } - } - } - } - } - }, - "404": { - "description": "App not found response", - "content": { - "application/json": { - "schema": { - "type": "object", - "description": "App not found response", - "properties": { - "message": { - "type": "string" - }, - "status": { - "type": "integer" - } - } - } - } - } - } - } - } - }, - "/v2-experimental/apps/{app_id}/metrics-total": { - "get": { - "summary": "Get total app metrics", - "description": "Returns total usage metrics for a specific app since the app was created.\n\nThis endpoint requires an app management API token. It can be generated in your apps section of Developer Hub. \n", - "operationId": "get-metrics-total", - "tags": ["app-management"], - "parameters": [ - { - "in": "path", - "name": "app_id", - "required": true, - "schema": { - "type": "string" - }, - "description": "ID of the app to get total metrics for." - } - ], - "responses": { - "200": { - "description": "Successful response", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "uniqueUsers": { - "type": "integer", - "description": "Number of unique users who performed at least one activity in the application." - }, - "uniqueRecurringUsers": { - "type": "integer", - "description": "Number of unique users who have been active for more than one day over the past 30 days." - }, - "uniqueOrganizations": { - "type": "integer", - "description": "Number of unique company accounts that have installed the application." - }, - "installations": { - "type": "integer", - "description": "Number of application installations for a team." - }, - "uninstallations": { - "type": "integer", - "description": "Number of application uninstallations for a team." - } - } - } - } - } - }, - "404": { - "description": "App not found response", - "content": { - "application/json": { - "schema": { - "type": "object", - "description": "App not found response", - "properties": { - "message": { - "type": "string", - "description": "Description of the error." - }, - "status": { - "type": "integer", - "description": "HTTP status code." - } - } - } - } - } - } - } - } - }, "/v2/audit/logs": { "get": { - "description": "Retrieves a page of audit events.

Required scope

auditlogs:read

Rate limiting

Level 2", + "description": "Retrieves a page of audit events from the last 90 days. If you want to retrieve data that is older than 90 days, you can use the CSV export feature.

Required scope

auditlogs:read

Rate limiting

Level 2", "operationId": "enterprise-get-audit-logs", "parameters": [ { @@ -5036,6 +4852,190 @@ "tags": ["Bulk operations"] } }, + "/v2-experimental/apps/{app_id}/metrics": { + "get": { + "summary": "Get app metrics", + "description": "Returns a list of usage metrics for a specific app for a given time range, grouped by requested time period.\n\nThis endpoint requires an app management API token. It can be generated in the Your Apps section of Developer Hub.
\n

Required scope

boards:read
\n

Rate limiting

Level 1
\n", + "operationId": "get-metrics", + "tags": ["App metrics (experimental)"], + "parameters": [ + { + "in": "path", + "name": "app_id", + "required": true, + "schema": { + "type": "string" + }, + "description": "ID of the app to get metrics for." + }, + { + "in": "query", + "name": "startDate", + "required": true, + "schema": { + "type": "string", + "format": "date" + }, + "description": "Start date of the period in UTC format. For example, 2024-12-31." + }, + { + "in": "query", + "name": "endDate", + "required": true, + "schema": { + "type": "string", + "format": "date" + }, + "description": "End date of the period in UTC format. For example, 2024-12-31." + }, + { + "in": "query", + "name": "period", + "schema": { + "type": "string", + "enum": ["DAY", "WEEK", "MONTH"], + "default": "WEEK" + }, + "description": "Group data by this time period." + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "object", + "properties": { + "periodStart": { + "type": "string", + "description": "Date from which the metrics are aggregated.", + "format": "date" + }, + "uniqueUsers": { + "type": "integer", + "description": "Number of unique users who performed at least one activity in the application." + }, + "uniqueRecurringUsers": { + "type": "integer", + "description": "Number of unique users who have been active for more than one day over the past 30 days." + }, + "uniqueOrganizations": { + "type": "integer", + "description": "Number of unique company accounts that have installed the application." + }, + "installations": { + "type": "integer", + "description": "Number of application installations for a team." + }, + "uninstallations": { + "type": "integer", + "description": "Number of application uninstallations for a team." + } + } + } + } + } + } + }, + "404": { + "description": "App not found response", + "content": { + "application/json": { + "schema": { + "type": "object", + "description": "App not found response", + "properties": { + "message": { + "type": "string" + }, + "status": { + "type": "integer" + } + } + } + } + } + } + } + } + }, + "/v2-experimental/apps/{app_id}/metrics-total": { + "get": { + "summary": "Get total app metrics", + "description": "Returns total usage metrics for a specific app since the app was created.\n\nThis endpoint requires an app management API token. It can be generated in your apps section of Developer Hub.
\n

Required scope

boards:read
\n

Rate limiting

Level 1
\n", + "operationId": "get-metrics-total", + "tags": ["App metrics (experimental)"], + "parameters": [ + { + "in": "path", + "name": "app_id", + "required": true, + "schema": { + "type": "string" + }, + "description": "ID of the app to get total metrics for." + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "uniqueUsers": { + "type": "integer", + "description": "Number of unique users who performed at least one activity in the application." + }, + "uniqueRecurringUsers": { + "type": "integer", + "description": "Number of unique users who have been active for more than one day over the past 30 days." + }, + "uniqueOrganizations": { + "type": "integer", + "description": "Number of unique company accounts that have installed the application." + }, + "installations": { + "type": "integer", + "description": "Number of application installations for a team." + }, + "uninstallations": { + "type": "integer", + "description": "Number of application uninstallations for a team." + } + } + } + } + } + }, + "404": { + "description": "App not found response", + "content": { + "application/json": { + "schema": { + "type": "object", + "description": "App not found response", + "properties": { + "message": { + "type": "string", + "description": "Description of the error." + }, + "status": { + "type": "integer", + "description": "HTTP status code." + } + } + } + } + } + } + } + } + }, "/v2-experimental/webhooks/board_subscriptions": { "post": { "description": "Creates a webhook subscription to receive notifications when an item on a board is updated. Subscriptions are created per user, per board. You can create multiple subscriptions. We currently support all board items except tags, connectors, and comments.

Required scope

boards:read

Rate limiting

Level 2
", diff --git a/packages/miro-api-python/.openapi-generator/FILES b/packages/miro-api-python/.openapi-generator/FILES index 1a5f238d..cf77bfd2 100644 --- a/packages/miro-api-python/.openapi-generator/FILES +++ b/packages/miro-api-python/.openapi-generator/FILES @@ -1,6 +1,6 @@ miro_api/api/__init__.py miro_api/api/app_cards_api.py -miro_api/api/app_management_api.py +miro_api/api/app_metrics_experimental_api.py miro_api/api/audit_logs_api.py miro_api/api/board_classification_board_level_api.py miro_api/api/board_classification_organization_level_api.py @@ -49,7 +49,7 @@ miro_api/docs/AppCardStyle.md miro_api/docs/AppCardStylePlatformbulkcreateoperation.md miro_api/docs/AppCardUpdateRequest.md miro_api/docs/AppCardsApi.md -miro_api/docs/AppManagementApi.md +miro_api/docs/AppMetricsExperimentalApi.md miro_api/docs/AuditContext.md miro_api/docs/AuditCreatedBy.md miro_api/docs/AuditEvent.md @@ -699,7 +699,7 @@ miro_api/test/test_app_card_style.py miro_api/test/test_app_card_style_platformbulkcreateoperation.py miro_api/test/test_app_card_update_request.py miro_api/test/test_app_cards_api.py -miro_api/test/test_app_management_api.py +miro_api/test/test_app_metrics_experimental_api.py miro_api/test/test_audit_context.py miro_api/test/test_audit_created_by.py miro_api/test/test_audit_event.py diff --git a/packages/miro-api-python/miro_api/api/__init__.py b/packages/miro-api-python/miro_api/api/__init__.py index 91450876..1abcd81e 100644 --- a/packages/miro-api-python/miro_api/api/__init__.py +++ b/packages/miro-api-python/miro_api/api/__init__.py @@ -15,12 +15,16 @@ from typing_extensions import Annotated -from pydantic import Field, StrictInt, StrictStr, field_validator +from datetime import date +from pydantic import Field, StrictStr, field_validator from typing import Optional +from miro_api.models.get_metrics200_response_inner import GetMetrics200ResponseInner +from miro_api.models.get_metrics_total200_response import GetMetricsTotal200Response + +from pydantic import Field, StrictInt, StrictStr, field_validator from miro_api.models.audit_page import AuditPage from datetime import datetime -from pydantic import Field, StrictStr, field_validator from typing import List, Optional from miro_api.models.get_board_item_content_logs_response import GetBoardItemContentLogsResponse @@ -98,10 +102,6 @@ from miro_api.models.app_card_item import AppCardItem from miro_api.models.app_card_update_request import AppCardUpdateRequest -from datetime import date -from miro_api.models.get_metrics200_response_inner import GetMetrics200ResponseInner -from miro_api.models.get_metrics_total200_response import GetMetricsTotal200Response - from miro_api.models.board_member_changes import BoardMemberChanges from miro_api.models.board_member_with_links import BoardMemberWithLinks from miro_api.models.board_members_invite import BoardMembersInvite @@ -189,6 +189,259 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call + def get_metrics( + self, + app_id: Annotated[StrictStr, Field(description="ID of the app to get metrics for.")], + start_date: Annotated[ + date, Field(description="Start date of the period in UTC format. For example, 2024-12-31.") + ], + end_date: Annotated[date, Field(description="End date of the period in UTC format. For example, 2024-12-31.")], + period: Annotated[Optional[StrictStr], Field(description="Group data by this time period.")] = None, + _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, + ) -> List[GetMetrics200ResponseInner]: + """Get app metrics + + Returns a list of usage metrics for a specific app for a given time range, grouped by requested time period. This endpoint requires an app management API token. It can be generated in the Your Apps section of Developer Hub.

Required scope

boards:read

Rate limiting

Level 1
+ + :param app_id: ID of the app to get metrics for. (required) + :type app_id: str + :param start_date: Start date of the period in UTC format. For example, 2024-12-31. (required) + :type start_date: date + :param end_date: End date of the period in UTC format. For example, 2024-12-31. (required) + :type end_date: date + :param period: Group data by this time period. + :type period: 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._get_metrics_serialize( + app_id=app_id, + start_date=start_date, + end_date=end_date, + period=period, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[GetMetrics200ResponseInner]", + "404": "GetMetrics404Response", + } + 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 + + def _get_metrics_serialize( + self, + app_id, + start_date, + end_date, + period, + _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 app_id is not None: + _path_params["app_id"] = app_id + # process the query parameters + if start_date is not None: + if isinstance(start_date, date): + _query_params.append(("startDate", start_date.strftime(self.api_client.configuration.date_format))) + else: + _query_params.append(("startDate", start_date)) + + if end_date is not None: + if isinstance(end_date, date): + _query_params.append(("endDate", end_date.strftime(self.api_client.configuration.date_format))) + else: + _query_params.append(("endDate", end_date)) + + if period is not None: + + _query_params.append(("period", period)) + + # 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] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v2-experimental/apps/{app_id}/metrics", + 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 get_metrics_total( + self, + app_id: Annotated[StrictStr, Field(description="ID of the app to get total metrics for.")], + _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, + ) -> GetMetricsTotal200Response: + """Get total app metrics + + Returns total usage metrics for a specific app since the app was created. This endpoint requires an app management API token. It can be generated in your apps section of Developer Hub.

Required scope

boards:read

Rate limiting

Level 1
+ + :param app_id: ID of the app to get total metrics for. (required) + :type app_id: 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._get_metrics_total_serialize( + app_id=app_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetMetricsTotal200Response", + "404": "GetMetricsTotal404Response", + } + 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 + + def _get_metrics_total_serialize( + self, + app_id, + _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 app_id is not None: + _path_params["app_id"] = app_id + # 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] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v2-experimental/apps/{app_id}/metrics-total", + 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 enterprise_get_audit_logs( self, @@ -234,7 +487,7 @@ def enterprise_get_audit_logs( ) -> AuditPage: """Get audit logs - Retrieves a page of audit events.

Required scope

auditlogs:read

Rate limiting

Level 2 + Retrieves a page of audit events from the last 90 days. If you want to retrieve data that is older than 90 days, you can use the CSV export feature.

Required scope

auditlogs:read

Rate limiting

Level 2 :param created_after: Retrieve audit logs created after the date and time provided. This is the start date of the duration for which you want to retrieve audit logs. For example, if you want to retrieve audit logs between `2023-03-30T17:26:50.000Z` and `2023-04-30T17:26:50.000Z`, provide `2023-03-30T17:26:50.000Z` as the value for the `createdAfter` parameter.
Format: UTC, adheres to [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601), including milliseconds and a [trailing Z offset](https://en.wikipedia.org/wiki/ISO_8601#Coordinated_Universal_Time_(UTC)).\" (required) :type created_after: str @@ -8371,259 +8624,6 @@ def _update_app_card_item_serialize( _request_auth=_request_auth, ) - @validate_call - def get_metrics( - self, - app_id: Annotated[StrictStr, Field(description="ID of the app to get metrics for.")], - start_date: Annotated[ - date, Field(description="Start date of the period in UTC format. For example, 2024-12-31.") - ], - end_date: Annotated[date, Field(description="End date of the period in UTC format. For example, 2024-12-31.")], - period: Annotated[Optional[StrictStr], Field(description="Group data by this time period.")] = None, - _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, - ) -> List[GetMetrics200ResponseInner]: - """Get app metrics - - Returns a list of usage metrics for a specific app for a given time range, grouped by requested time period. This endpoint requires an app management API token. It can be generated in the Your Apps section of Developer Hub. - - :param app_id: ID of the app to get metrics for. (required) - :type app_id: str - :param start_date: Start date of the period in UTC format. For example, 2024-12-31. (required) - :type start_date: date - :param end_date: End date of the period in UTC format. For example, 2024-12-31. (required) - :type end_date: date - :param period: Group data by this time period. - :type period: 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._get_metrics_serialize( - app_id=app_id, - start_date=start_date, - end_date=end_date, - period=period, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "List[GetMetrics200ResponseInner]", - "404": "GetMetrics404Response", - } - 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 - - def _get_metrics_serialize( - self, - app_id, - start_date, - end_date, - period, - _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 app_id is not None: - _path_params["app_id"] = app_id - # process the query parameters - if start_date is not None: - if isinstance(start_date, date): - _query_params.append(("startDate", start_date.strftime(self.api_client.configuration.date_format))) - else: - _query_params.append(("startDate", start_date)) - - if end_date is not None: - if isinstance(end_date, date): - _query_params.append(("endDate", end_date.strftime(self.api_client.configuration.date_format))) - else: - _query_params.append(("endDate", end_date)) - - if period is not None: - - _query_params.append(("period", period)) - - # 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] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/v2-experimental/apps/{app_id}/metrics", - 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 get_metrics_total( - self, - app_id: Annotated[StrictStr, Field(description="ID of the app to get total metrics for.")], - _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, - ) -> GetMetricsTotal200Response: - """Get total app metrics - - Returns total usage metrics for a specific app since the app was created. This endpoint requires an app management API token. It can be generated in your apps section of Developer Hub. - - :param app_id: ID of the app to get total metrics for. (required) - :type app_id: 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._get_metrics_total_serialize( - app_id=app_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "GetMetricsTotal200Response", - "404": "GetMetricsTotal404Response", - } - 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 - - def _get_metrics_total_serialize( - self, - app_id, - _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 app_id is not None: - _path_params["app_id"] = app_id - # 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] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/v2-experimental/apps/{app_id}/metrics-total", - 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 get_board_members( self, diff --git a/packages/miro-api-python/miro_api/api_client.py b/packages/miro-api-python/miro_api/api_client.py index 095d1273..9c49bef7 100644 --- a/packages/miro-api-python/miro_api/api_client.py +++ b/packages/miro-api-python/miro_api/api_client.py @@ -82,7 +82,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None, cook self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = "OpenAPI-Generator/2.2.1/python" + self.user_agent = "OpenAPI-Generator/2.2.2/python" self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/packages/miro-api-python/miro_api/configuration.py b/packages/miro-api-python/miro_api/configuration.py index 562ed9fb..f0234b6b 100644 --- a/packages/miro-api-python/miro_api/configuration.py +++ b/packages/miro-api-python/miro_api/configuration.py @@ -390,7 +390,7 @@ def to_debug_report(self): "OS: {env}\n" "Python Version: {pyversion}\n" "Version of the API: v2.0\n" - "SDK Package Version: 2.2.1".format(env=sys.platform, pyversion=sys.version) + "SDK Package Version: 2.2.2".format(env=sys.platform, pyversion=sys.version) ) def get_host_settings(self): diff --git a/packages/miro-api/api/apis.ts b/packages/miro-api/api/apis.ts index 8ffe7c2e..3953ff31 100644 --- a/packages/miro-api/api/apis.ts +++ b/packages/miro-api/api/apis.ts @@ -338,7 +338,7 @@ export class MiroApi { } /** - * Returns a list of usage metrics for a specific app for a given time range, grouped by requested time period. This endpoint requires an app management API token. It can be generated in the Your Apps section of Developer Hub. + * Returns a list of usage metrics for a specific app for a given time range, grouped by requested time period. This endpoint requires an app management API token. It can be generated in the Your Apps section of Developer Hub.

Required scope

boards:read

Rate limiting

Level 1
* @summary Get app metrics * @param appId ID of the app to get metrics for. * @param startDate Start date of the period in UTC format. For example, 2024-12-31. @@ -403,7 +403,7 @@ export class MiroApi { } /** - * Returns total usage metrics for a specific app since the app was created. This endpoint requires an app management API token. It can be generated in your apps section of Developer Hub. + * Returns total usage metrics for a specific app since the app was created. This endpoint requires an app management API token. It can be generated in your apps section of Developer Hub.

Required scope

boards:read

Rate limiting

Level 1
* @summary Get total app metrics * @param appId ID of the app to get total metrics for. */ @@ -436,7 +436,7 @@ export class MiroApi { } /** - * Retrieves a page of audit events.

Required scope

auditlogs:read

Rate limiting

Level 2 + * Retrieves a page of audit events from the last 90 days. If you want to retrieve data that is older than 90 days, you can use the CSV export feature.

Required scope

auditlogs:read

Rate limiting

Level 2 * @summary Get audit logs * @param createdAfter Retrieve audit logs created after the date and time provided. This is the start date of the duration for which you want to retrieve audit logs. For example, if you want to retrieve audit logs between `2023-03-30T17:26:50.000Z` and `2023-04-30T17:26:50.000Z`, provide `2023-03-30T17:26:50.000Z` as the value for the `createdAfter` parameter.<br>Format: UTC, adheres to [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601), including milliseconds and a [trailing Z offset](https://en.wikipedia.org/wiki/ISO_8601#Coordinated_Universal_Time_(UTC)).\" * @param createdBefore Retrieve audit logs created before the date and time provided. This is the end date of the duration for which you want to retrieve audit logs. For example, if you want to retrieve audit logs between `2023-03-30T17:26:50.000Z` and `2023-04-30T17:26:50.000Z`, provide `2023-04-30T17:26:50.000Z` as the value for the `createdBefore` parameter.<br>Format: UTC, adheres to [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601), including milliseconds and a [trailing Z offset](https://en.wikipedia.org/wiki/ISO_8601#Coordinated_Universal_Time_(UTC)).