diff --git a/packages/generator/spec.json b/packages/generator/spec.json index 8b23ac1b..1a0ce174 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": [ { @@ -1447,7 +1263,7 @@ "tags": ["boards"] }, "get": { - "description": "Retrieves a list of boards that the user associated with the access token has access to. You can filter and sort the boards by specifying URL query parameter values. If you are an Enterprise customer and a Company Admin, you can retrieve all boards, including all private boards (boards that haven't been specifically shared with you) by enabling Content Admin permissions. To enable Content Admin permissions, see [Content Admin permissions for Company Admins](https://help.miro.com/hc/en-us/articles/360012777280-Content-Admin-permissions-for-Company-Admins). Note that you only get results instantaneously when you filter by the `team_id`, `project_id`, or both the `team_id` and `project_id`. If you use any other filter, you need to give a few seconds for the indexing of newly created boards before retrieving boards.

Required scope

boards:read

Rate limiting

Level 1
", + "description": "Retrieves a list of boards accessible to the user associated with the provided access token. This endpoint supports filtering and sorting through URL query parameters.\nCustomize the response by specifying `team_id`, `project_id`, or other query parameters. Filtering by `team_id` or `project_id` (or both) returns results instantly. For other filters, allow a few seconds for indexing of newly created boards.\n\nIf you're an Enterprise customer with Company Admin permissions:\n \n- Enable **Content Admin** permissions to retrieve all boards, including private boards (those not explicitly shared with you). For details, see the [Content Admin Permissions for Company Admins](https://help.miro.com/hc/en-us/articles/360012777280-Content-Admin-permissions-for-Company-Admins). \n- Note that **Private board contents remain inaccessible**. The API allows you to verify their existence but prevents viewing their contents to uphold security best practices. Unauthorized access attempts will return an error.\n

Required scope

boards:read

Rate limiting

Level 1
\n", "operationId": "get-boards", "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
", @@ -12376,6 +12376,11 @@ "type": "string", "description": "Indicates the status of the individual board export task.\nPossible values:\n`SUCCESS`: the board export task was completed successfully and the results are available.\n`ERROR`: the board export task encountered an error and failed to complete. The `errorMessage` field provides more information on the error.", "example": "CREATED" + }, + "errorType": { + "type": "string", + "description": "Indicates the type of error encountered during the board export task.\nPossible values:\n`TEMPORARY`: the board export task encountered a temporary error. Retry the board export task after some time.\n`FATAL`: the board export failed and cannot be retried. This export will never succeed due to issues such as board corruption, non-existence, or other unrecoverable errors. Please verify the board's state or contact support if assistance is needed.\n`UNKNOWN`: the board export task encountered an unexpected exception. Retry the board export task after some time.", + "example": "TEMPORARY" } }, "description": "Board export task results." @@ -12394,6 +12399,13 @@ "description": "List of board IDs to be exported.", "example": "o9J_kzlUDmo=" } + }, + "boardFormat": { + "type": "string", + "enum": ["SVG", "HTML", "PDF"], + "default": "SVG", + "description": "Specifies the format of the file to which the board will be exported. Supported formats include SVG (default), HTML, and PDF.", + "example": "SVG" } }, "description": "List of board IDs to be exported." 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..55ae9927 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, @@ -9662,7 +9662,7 @@ def get_boards( ) -> BoardsPagedResponse: """Get boards - Retrieves a list of boards that the user associated with the access token has access to. You can filter and sort the boards by specifying URL query parameter values. If you are an Enterprise customer and a Company Admin, you can retrieve all boards, including all private boards (boards that haven't been specifically shared with you) by enabling Content Admin permissions. To enable Content Admin permissions, see [Content Admin permissions for Company Admins](https://help.miro.com/hc/en-us/articles/360012777280-Content-Admin-permissions-for-Company-Admins). Note that you only get results instantaneously when you filter by the `team_id`, `project_id`, or both the `team_id` and `project_id`. If you use any other filter, you need to give a few seconds for the indexing of newly created boards before retrieving boards.

Required scope

boards:read

Rate limiting

Level 1
+ Retrieves a list of boards accessible to the user associated with the provided access token. This endpoint supports filtering and sorting through URL query parameters. Customize the response by specifying `team_id`, `project_id`, or other query parameters. Filtering by `team_id` or `project_id` (or both) returns results instantly. For other filters, allow a few seconds for indexing of newly created boards. If you're an Enterprise customer with Company Admin permissions: - Enable **Content Admin** permissions to retrieve all boards, including private boards (those not explicitly shared with you). For details, see the [Content Admin Permissions for Company Admins](https://help.miro.com/hc/en-us/articles/360012777280-Content-Admin-permissions-for-Company-Admins). - Note that **Private board contents remain inaccessible**. The API allows you to verify their existence but prevents viewing their contents to uphold security best practices. Unauthorized access attempts will return an error.

Required scope

boards:read

Rate limiting

Level 1
:param team_id: :type team_id: str 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-python/miro_api/models/board_export_task_result.py b/packages/miro-api-python/miro_api/models/board_export_task_result.py index d789f626..2f089178 100644 --- a/packages/miro-api-python/miro_api/models/board_export_task_result.py +++ b/packages/miro-api-python/miro_api/models/board_export_task_result.py @@ -40,8 +40,13 @@ class BoardExportTaskResult(BaseModel): status: StrictStr = Field( description="Indicates the status of the individual board export task. Possible values: `SUCCESS`: the board export task was completed successfully and the results are available. `ERROR`: the board export task encountered an error and failed to complete. The `errorMessage` field provides more information on the error." ) + error_type: Optional[StrictStr] = Field( + default=None, + description="Indicates the type of error encountered during the board export task. Possible values: `TEMPORARY`: the board export task encountered a temporary error. Retry the board export task after some time. `FATAL`: the board export failed and cannot be retried. This export will never succeed due to issues such as board corruption, non-existence, or other unrecoverable errors. Please verify the board's state or contact support if assistance is needed. `UNKNOWN`: the board export task encountered an unexpected exception. Retry the board export task after some time.", + alias="errorType", + ) additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["boardId", "errorMessage", "exportLink", "status"] + __properties: ClassVar[List[str]] = ["boardId", "errorMessage", "exportLink", "status", "errorType"] model_config = { "populate_by_name": True, @@ -107,6 +112,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "errorMessage": obj.get("errorMessage"), "exportLink": obj.get("exportLink"), "status": obj.get("status"), + "errorType": obj.get("errorType"), } ) # store additional fields in additional_properties diff --git a/packages/miro-api-python/miro_api/models/create_board_export_request.py b/packages/miro-api-python/miro_api/models/create_board_export_request.py index 6d567ca7..5689bd2a 100644 --- a/packages/miro-api-python/miro_api/models/create_board_export_request.py +++ b/packages/miro-api-python/miro_api/models/create_board_export_request.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from typing import Optional, Set @@ -32,8 +32,23 @@ class CreateBoardExportRequest(BaseModel): board_ids: Optional[Annotated[List[StrictStr], Field(min_length=1, max_length=50)]] = Field( default=None, description="List of board IDs to be exported.", alias="boardIds" ) + board_format: Optional[StrictStr] = Field( + default="SVG", + description="Specifies the format of the file to which the board will be exported. Supported formats include SVG (default), HTML, and PDF.", + alias="boardFormat", + ) additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["boardIds"] + __properties: ClassVar[List[str]] = ["boardIds", "boardFormat"] + + @field_validator("board_format") + def board_format_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(["SVG", "HTML", "PDF"]): + raise ValueError("must be one of enum values ('SVG', 'HTML', 'PDF')") + return value model_config = { "populate_by_name": True, @@ -93,7 +108,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"boardIds": obj.get("boardIds")}) + _obj = cls.model_validate( + { + "boardIds": obj.get("boardIds"), + "boardFormat": obj.get("boardFormat") if obj.get("boardFormat") is not None else "SVG", + } + ) # store additional fields in additional_properties for _key in obj.keys(): if _key not in cls.__properties: diff --git a/packages/miro-api/api/apis.ts b/packages/miro-api/api/apis.ts index 8ffe7c2e..3e638f5a 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)). @@ -1317,7 +1317,7 @@ export class MiroApi { } /** - * Retrieves a list of boards that the user associated with the access token has access to. You can filter and sort the boards by specifying URL query parameter values. If you are an Enterprise customer and a Company Admin, you can retrieve all boards, including all private boards (boards that haven\'t been specifically shared with you) by enabling Content Admin permissions. To enable Content Admin permissions, see [Content Admin permissions for Company Admins](https://help.miro.com/hc/en-us/articles/360012777280-Content-Admin-permissions-for-Company-Admins). Note that you only get results instantaneously when you filter by the `team_id`, `project_id`, or both the `team_id` and `project_id`. If you use any other filter, you need to give a few seconds for the indexing of newly created boards before retrieving boards.

Required scope

boards:read

Rate limiting

Level 1
+ * Retrieves a list of boards accessible to the user associated with the provided access token. This endpoint supports filtering and sorting through URL query parameters. Customize the response by specifying `team_id`, `project_id`, or other query parameters. Filtering by `team_id` or `project_id` (or both) returns results instantly. For other filters, allow a few seconds for indexing of newly created boards. If you\'re an Enterprise customer with Company Admin permissions: - Enable **Content Admin** permissions to retrieve all boards, including private boards (those not explicitly shared with you). For details, see the [Content Admin Permissions for Company Admins](https://help.miro.com/hc/en-us/articles/360012777280-Content-Admin-permissions-for-Company-Admins). - Note that **Private board contents remain inaccessible**. The API allows you to verify their existence but prevents viewing their contents to uphold security best practices. Unauthorized access attempts will return an error.

Required scope

boards:read

Rate limiting

Level 1
* @summary Get boards * @param teamId * @param projectId diff --git a/packages/miro-api/model/boardExportTaskResult.ts b/packages/miro-api/model/boardExportTaskResult.ts index 6d4a42f0..fb1f8a16 100644 --- a/packages/miro-api/model/boardExportTaskResult.ts +++ b/packages/miro-api/model/boardExportTaskResult.ts @@ -31,6 +31,10 @@ export class BoardExportTaskResult { * Indicates the status of the individual board export task. Possible values: `SUCCESS`: the board export task was completed successfully and the results are available. `ERROR`: the board export task encountered an error and failed to complete. The `errorMessage` field provides more information on the error. */ 'status': string + /** + * Indicates the type of error encountered during the board export task. Possible values: `TEMPORARY`: the board export task encountered a temporary error. Retry the board export task after some time. `FATAL`: the board export failed and cannot be retried. This export will never succeed due to issues such as board corruption, non-existence, or other unrecoverable errors. Please verify the board\'s state or contact support if assistance is needed. `UNKNOWN`: the board export task encountered an unexpected exception. Retry the board export task after some time. + */ + 'errorType'?: string /** @ignore */ static discriminator: string | undefined = undefined @@ -57,6 +61,11 @@ export class BoardExportTaskResult { baseName: 'status', type: 'string', }, + { + name: 'errorType', + baseName: 'errorType', + type: 'string', + }, ] /** @ignore */ diff --git a/packages/miro-api/model/createBoardExportRequest.ts b/packages/miro-api/model/createBoardExportRequest.ts index fbab2a90..383e6bd2 100644 --- a/packages/miro-api/model/createBoardExportRequest.ts +++ b/packages/miro-api/model/createBoardExportRequest.ts @@ -19,6 +19,13 @@ export class CreateBoardExportRequest { * List of board IDs to be exported. */ 'boardIds'?: Array + /** + * Specifies the format of the file to which the board will be exported. Supported formats include SVG (default), HTML, and PDF. + */ + 'boardFormat'?: + | string + | (typeof CreateBoardExportRequest.BoardFormatEnum)[keyof typeof CreateBoardExportRequest.BoardFormatEnum] = + CreateBoardExportRequest.BoardFormatEnum.Svg /** @ignore */ static discriminator: string | undefined = undefined @@ -30,6 +37,11 @@ export class CreateBoardExportRequest { baseName: 'boardIds', type: 'Array', }, + { + name: 'boardFormat', + baseName: 'boardFormat', + type: 'CreateBoardExportRequest.BoardFormatEnum', + }, ] /** @ignore */ @@ -37,3 +49,11 @@ export class CreateBoardExportRequest { return CreateBoardExportRequest.attributeTypeMap } } + +export namespace CreateBoardExportRequest { + export const BoardFormatEnum = { + Svg: 'SVG', + Html: 'HTML', + Pdf: 'PDF', + } as const +} diff --git a/packages/miro-api/model/models.ts b/packages/miro-api/model/models.ts index 9d630f13..45ff9c30 100644 --- a/packages/miro-api/model/models.ts +++ b/packages/miro-api/model/models.ts @@ -655,6 +655,7 @@ let enumsMap: {[index: string]: any} = { 'ConnectorStyle.StrokeStyleEnum': ConnectorStyle.StrokeStyleEnum, 'ConnectorStyle.TextOrientationEnum': ConnectorStyle.TextOrientationEnum, 'ConnectorWithLinks.ShapeEnum': ConnectorWithLinks.ShapeEnum, + 'CreateBoardExportRequest.BoardFormatEnum': CreateBoardExportRequest.BoardFormatEnum, 'CreateBoardSubscriptionRequest.StatusEnum': CreateBoardSubscriptionRequest.StatusEnum, 'CustomField.IconShapeEnum': CustomField.IconShapeEnum, 'CustomFieldPlatformTags.IconShapeEnum': CustomFieldPlatformTags.IconShapeEnum,