Update api spec (#260)
* YOYO NEW API SPEC! * I have generated the latest API! --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
		
				
					committed by
					
						
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							bbf311ab95
						
					
				
				
					commit
					e6d46fd6dc
				
			
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -22,6 +22,7 @@ def _get_kwargs(
 | 
			
		||||
    *,
 | 
			
		||||
    client: Client,
 | 
			
		||||
    pool: Optional[str] = None,
 | 
			
		||||
    replay: Optional[str] = None,
 | 
			
		||||
) -> Dict[str, Any]:
 | 
			
		||||
    url = "{}/ws/modeling/commands".format(client.base_url)  # noqa: E501
 | 
			
		||||
 | 
			
		||||
@ -46,6 +47,13 @@ def _get_kwargs(
 | 
			
		||||
        else:
 | 
			
		||||
            url = url + "?post_effect=" + str(post_effect)
 | 
			
		||||
 | 
			
		||||
    if replay is not None:
 | 
			
		||||
 | 
			
		||||
        if "?" in url:
 | 
			
		||||
            url = url + "&replay=" + str(replay)
 | 
			
		||||
        else:
 | 
			
		||||
            url = url + "?replay=" + str(replay)
 | 
			
		||||
 | 
			
		||||
    if show_grid is not None:
 | 
			
		||||
 | 
			
		||||
        if "?" in url:
 | 
			
		||||
@ -103,6 +111,7 @@ def sync(
 | 
			
		||||
    *,
 | 
			
		||||
    client: Client,
 | 
			
		||||
    pool: Optional[str] = None,
 | 
			
		||||
    replay: Optional[str] = None,
 | 
			
		||||
) -> ClientConnection:
 | 
			
		||||
    """Pass those commands to the engine via websocket, and pass responses back to the client. Basically, this is a websocket proxy between the frontend/client and the engine."""  # noqa: E501
 | 
			
		||||
 | 
			
		||||
@ -110,6 +119,7 @@ def sync(
 | 
			
		||||
        fps=fps,
 | 
			
		||||
        pool=pool,
 | 
			
		||||
        post_effect=post_effect,
 | 
			
		||||
        replay=replay,
 | 
			
		||||
        show_grid=show_grid,
 | 
			
		||||
        unlocked_framerate=unlocked_framerate,
 | 
			
		||||
        video_res_height=video_res_height,
 | 
			
		||||
@ -132,6 +142,7 @@ async def asyncio(
 | 
			
		||||
    *,
 | 
			
		||||
    client: Client,
 | 
			
		||||
    pool: Optional[str] = None,
 | 
			
		||||
    replay: Optional[str] = None,
 | 
			
		||||
) -> WebSocketClientProtocol:
 | 
			
		||||
    """Pass those commands to the engine via websocket, and pass responses back to the client. Basically, this is a websocket proxy between the frontend/client and the engine."""  # noqa: E501
 | 
			
		||||
 | 
			
		||||
@ -139,6 +150,7 @@ async def asyncio(
 | 
			
		||||
        fps=fps,
 | 
			
		||||
        pool=pool,
 | 
			
		||||
        post_effect=post_effect,
 | 
			
		||||
        replay=replay,
 | 
			
		||||
        show_grid=show_grid,
 | 
			
		||||
        unlocked_framerate=unlocked_framerate,
 | 
			
		||||
        video_res_height=video_res_height,
 | 
			
		||||
@ -171,6 +183,7 @@ class WebSocket:
 | 
			
		||||
        webrtc: bool,
 | 
			
		||||
        client: Client,
 | 
			
		||||
        pool: Optional[str] = None,
 | 
			
		||||
        replay: Optional[str] = None,
 | 
			
		||||
    ):
 | 
			
		||||
        self.ws = sync(
 | 
			
		||||
            fps,
 | 
			
		||||
@ -182,6 +195,7 @@ class WebSocket:
 | 
			
		||||
            webrtc,
 | 
			
		||||
            client=client,
 | 
			
		||||
            pool=pool,
 | 
			
		||||
            replay=replay,
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
    def __enter__(
 | 
			
		||||
 | 
			
		||||
@ -6948,6 +6948,7 @@ def test_modeling_commands_ws():
 | 
			
		||||
        video_res_width=10,
 | 
			
		||||
        webrtc=False,
 | 
			
		||||
        pool=None,  # Optional[str]
 | 
			
		||||
        replay=None,  # Optional[str]
 | 
			
		||||
    ) as websocket:
 | 
			
		||||
 | 
			
		||||
        # Send a message.
 | 
			
		||||
@ -6985,6 +6986,7 @@ async def test_modeling_commands_ws_async():
 | 
			
		||||
        video_res_width=10,
 | 
			
		||||
        webrtc=False,
 | 
			
		||||
        pool=None,  # Optional[str]
 | 
			
		||||
        replay=None,  # Optional[str]
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
    # Send a message.
 | 
			
		||||
 | 
			
		||||
@ -154,6 +154,7 @@ from .modeling_app_subscription_tier_name import ModelingAppSubscriptionTierName
 | 
			
		||||
from .modeling_cmd import ModelingCmd
 | 
			
		||||
from .modeling_cmd_id import ModelingCmdId
 | 
			
		||||
from .modeling_cmd_req import ModelingCmdReq
 | 
			
		||||
from .modeling_session_data import ModelingSessionData
 | 
			
		||||
from .mouse_click import MouseClick
 | 
			
		||||
from .o_auth2_client_info import OAuth2ClientInfo
 | 
			
		||||
from .o_auth2_grant_type import OAuth2GrantType
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										11
									
								
								kittycad/models/modeling_session_data.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								kittycad/models/modeling_session_data.py
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,11 @@
 | 
			
		||||
 | 
			
		||||
from pydantic import BaseModel, ConfigDict
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class ModelingSessionData(BaseModel):
 | 
			
		||||
    """Successful Websocket response."""
 | 
			
		||||
 | 
			
		||||
    api_call_id: str
 | 
			
		||||
 | 
			
		||||
    model_config = ConfigDict(protected_namespaces=())
 | 
			
		||||
@ -5,6 +5,7 @@ from typing_extensions import Annotated
 | 
			
		||||
 | 
			
		||||
from ..models.batch_response import BatchResponse
 | 
			
		||||
from ..models.ice_server import IceServer
 | 
			
		||||
from ..models.modeling_session_data import ModelingSessionData
 | 
			
		||||
from ..models.ok_modeling_cmd_response import OkModelingCmdResponse
 | 
			
		||||
from ..models.raw_file import RawFile
 | 
			
		||||
from ..models.rtc_ice_candidate_init import RtcIceCandidateInit
 | 
			
		||||
@ -135,6 +136,24 @@ class metrics_request(BaseModel):
 | 
			
		||||
    model_config = ConfigDict(protected_namespaces=())
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class ModelingSessionDataData(BaseModel):
 | 
			
		||||
    """"""
 | 
			
		||||
 | 
			
		||||
    session: ModelingSessionData
 | 
			
		||||
 | 
			
		||||
    model_config = ConfigDict(protected_namespaces=())
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class modeling_session_data(BaseModel):
 | 
			
		||||
    """Data about the Modeling Session (application-level)."""
 | 
			
		||||
 | 
			
		||||
    data: ModelingSessionDataData
 | 
			
		||||
 | 
			
		||||
    type: Literal["modeling_session_data"] = "modeling_session_data"
 | 
			
		||||
 | 
			
		||||
    model_config = ConfigDict(protected_namespaces=())
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class PongData(BaseModel):
 | 
			
		||||
    """"""
 | 
			
		||||
 | 
			
		||||
@ -161,6 +180,7 @@ OkWebSocketResponseData = RootModel[
 | 
			
		||||
            modeling_batch,
 | 
			
		||||
            export,
 | 
			
		||||
            metrics_request,
 | 
			
		||||
            modeling_session_data,
 | 
			
		||||
            pong,
 | 
			
		||||
        ],
 | 
			
		||||
        Field(discriminator="type"),
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										54
									
								
								spec.json
									
									
									
									
									
								
							
							
						
						
									
										54
									
								
								spec.json
									
									
									
									
									
								
							@ -13838,6 +13838,15 @@
 | 
			
		||||
              "$ref": "#/components/schemas/PostEffectType"
 | 
			
		||||
            }
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            "in": "query",
 | 
			
		||||
            "name": "replay",
 | 
			
		||||
            "description": "If given, when the session ends, the modeling commands sent during the session will be written out to this filename. For debugging.",
 | 
			
		||||
            "schema": {
 | 
			
		||||
              "nullable": true,
 | 
			
		||||
              "type": "string"
 | 
			
		||||
            }
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            "in": "query",
 | 
			
		||||
            "name": "show_grid",
 | 
			
		||||
@ -23493,6 +23502,19 @@
 | 
			
		||||
          "cmd_id"
 | 
			
		||||
        ]
 | 
			
		||||
      },
 | 
			
		||||
      "ModelingSessionData": {
 | 
			
		||||
        "description": "Successful Websocket response.",
 | 
			
		||||
        "type": "object",
 | 
			
		||||
        "properties": {
 | 
			
		||||
          "api_call_id": {
 | 
			
		||||
            "description": "ID of the API call this modeling session is using. Useful for tracing and debugging.",
 | 
			
		||||
            "type": "string"
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        "required": [
 | 
			
		||||
          "api_call_id"
 | 
			
		||||
        ]
 | 
			
		||||
      },
 | 
			
		||||
      "MouseClick": {
 | 
			
		||||
        "description": "The response from the `MouseClick` command.",
 | 
			
		||||
        "type": "object",
 | 
			
		||||
@ -24807,6 +24829,38 @@
 | 
			
		||||
              "type"
 | 
			
		||||
            ]
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            "description": "Data about the Modeling Session (application-level).",
 | 
			
		||||
            "type": "object",
 | 
			
		||||
            "properties": {
 | 
			
		||||
              "data": {
 | 
			
		||||
                "type": "object",
 | 
			
		||||
                "properties": {
 | 
			
		||||
                  "session": {
 | 
			
		||||
                    "description": "Data about the Modeling Session (application-level).",
 | 
			
		||||
                    "allOf": [
 | 
			
		||||
                      {
 | 
			
		||||
                        "$ref": "#/components/schemas/ModelingSessionData"
 | 
			
		||||
                      }
 | 
			
		||||
                    ]
 | 
			
		||||
                  }
 | 
			
		||||
                },
 | 
			
		||||
                "required": [
 | 
			
		||||
                  "session"
 | 
			
		||||
                ]
 | 
			
		||||
              },
 | 
			
		||||
              "type": {
 | 
			
		||||
                "type": "string",
 | 
			
		||||
                "enum": [
 | 
			
		||||
                  "modeling_session_data"
 | 
			
		||||
                ]
 | 
			
		||||
              }
 | 
			
		||||
            },
 | 
			
		||||
            "required": [
 | 
			
		||||
              "data",
 | 
			
		||||
              "type"
 | 
			
		||||
            ]
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            "description": "Pong response to a Ping message.",
 | 
			
		||||
            "type": "object",
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user