diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index e06ad0c..1e19840 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: c75567cf-9def-4617-8ae7-65af6f367b68 management: - docChecksum: 552d84cd05ab94ffe7766e00a1642d41 + docChecksum: cd76cd0f868fa6f3c5147f51bb53b2b4 docVersion: 2.0.0 - speakeasyVersion: 1.570.2 - generationVersion: 2.638.5 - releaseVersion: 1.0.3 - configChecksum: f8263b93221ce3b52c95e02f71d7f53d + speakeasyVersion: 1.570.3 + generationVersion: 2.639.2 + releaseVersion: 1.1.0 + configChecksum: 94df2328ac542a5e5b2a84c48d9bc4d3 features: python: additionalDependencies: 1.0.0 @@ -26,7 +26,6 @@ features: globalServerURLs: 3.1.1 groups: 3.0.0 methodArguments: 1.0.2 - mockServer: 0.1.0 nameOverrides: 3.0.1 nullables: 1.0.1 responseFormat: 1.0.1 @@ -507,233 +506,6 @@ generatedFiles: - src/opperai/utils/serializers.py - src/opperai/utils/url.py - src/opperai/utils/values.py - - tests/mockserver/.gitignore - - tests/mockserver/Dockerfile - - tests/mockserver/Makefile - - tests/mockserver/README.md - - tests/mockserver/go.mod - - tests/mockserver/go.sum - - tests/mockserver/internal/handler/assert/contenttype.go - - tests/mockserver/internal/handler/assert/header.go - - tests/mockserver/internal/handler/assert/parameter.go - - tests/mockserver/internal/handler/assert/pointer.go - - tests/mockserver/internal/handler/assert/security.go - - tests/mockserver/internal/handler/doc.go - - tests/mockserver/internal/handler/generated_handler.go - - tests/mockserver/internal/handler/generated_handlers.go - - tests/mockserver/internal/handler/values/files.go - - tests/mockserver/internal/logging/doc.go - - tests/mockserver/internal/logging/formats.go - - tests/mockserver/internal/logging/http_file.go - - tests/mockserver/internal/logging/http_logger.go - - tests/mockserver/internal/logging/levels.go - - tests/mockserver/internal/logging/logger.go - - tests/mockserver/internal/logging/oas_operation.go - - tests/mockserver/internal/logging/oas_operation_call.go - - tests/mockserver/internal/sdk/models/components/addrequest.go - - tests/mockserver/internal/sdk/models/components/annotation.go - - tests/mockserver/internal/sdk/models/components/annotationurlcitation.go - - tests/mockserver/internal/sdk/models/components/appapipublicv2functioncallcallfunctionrequest.go - - tests/mockserver/internal/sdk/models/components/appapipublicv2functioncallcallfunctionresponse.go - - tests/mockserver/internal/sdk/models/components/appapipublicv2functionscallfunctionrequest.go - - tests/mockserver/internal/sdk/models/components/appapipublicv2functionscallfunctionresponse.go - - tests/mockserver/internal/sdk/models/components/audio.go - - tests/mockserver/internal/sdk/models/components/chatcompletion.go - - tests/mockserver/internal/sdk/models/components/chatcompletionassistantmessageparam.go - - tests/mockserver/internal/sdk/models/components/chatcompletionaudio.go - - tests/mockserver/internal/sdk/models/components/chatcompletionaudioparam.go - - tests/mockserver/internal/sdk/models/components/chatcompletioncontentpartimageparam.go - - tests/mockserver/internal/sdk/models/components/chatcompletioncontentpartinputaudioparam.go - - tests/mockserver/internal/sdk/models/components/chatcompletioncontentpartrefusalparam.go - - tests/mockserver/internal/sdk/models/components/chatcompletioncontentparttextparam.go - - tests/mockserver/internal/sdk/models/components/chatcompletiondevelopermessageparam.go - - tests/mockserver/internal/sdk/models/components/chatcompletionfunctioncalloptionparam.go - - tests/mockserver/internal/sdk/models/components/chatcompletionfunctionmessageparam.go - - tests/mockserver/internal/sdk/models/components/chatcompletionmessage.go - - tests/mockserver/internal/sdk/models/components/chatcompletionmessagetoolcall.go - - tests/mockserver/internal/sdk/models/components/chatcompletionmessagetoolcallparam.go - - tests/mockserver/internal/sdk/models/components/chatcompletionnamedtoolchoiceparam.go - - tests/mockserver/internal/sdk/models/components/chatcompletionnonstreaming.go - - tests/mockserver/internal/sdk/models/components/chatcompletionpredictioncontentparam.go - - tests/mockserver/internal/sdk/models/components/chatcompletionstreaming.go - - tests/mockserver/internal/sdk/models/components/chatcompletionstreamoptionsparam.go - - tests/mockserver/internal/sdk/models/components/chatcompletionsystemmessageparam.go - - tests/mockserver/internal/sdk/models/components/chatcompletiontokenlogprob.go - - tests/mockserver/internal/sdk/models/components/chatcompletiontoolmessageparam.go - - tests/mockserver/internal/sdk/models/components/chatcompletiontoolparam.go - - tests/mockserver/internal/sdk/models/components/chatcompletionusermessageparam.go - - tests/mockserver/internal/sdk/models/components/choice.go - - tests/mockserver/internal/sdk/models/components/choicelogprobs.go - - tests/mockserver/internal/sdk/models/components/completiontokensdetails.go - - tests/mockserver/internal/sdk/models/components/completionusage.go - - tests/mockserver/internal/sdk/models/components/createdatasetentryrequest.go - - tests/mockserver/internal/sdk/models/components/createdatasetentryresponse.go - - tests/mockserver/internal/sdk/models/components/createembeddingrequest.go - - tests/mockserver/internal/sdk/models/components/createembeddingresponse.go - - tests/mockserver/internal/sdk/models/components/createfunctionrequest.go - - tests/mockserver/internal/sdk/models/components/createfunctionresponse.go - - tests/mockserver/internal/sdk/models/components/createknowledgebaserequest.go - - tests/mockserver/internal/sdk/models/components/createknowledgebaseresponse.go - - tests/mockserver/internal/sdk/models/components/createspanmetricrequest.go - - tests/mockserver/internal/sdk/models/components/createspanmetricresponse.go - - tests/mockserver/internal/sdk/models/components/createspanrequest.go - - tests/mockserver/internal/sdk/models/components/createspanresponse.go - - tests/mockserver/internal/sdk/models/components/example.go - - tests/mockserver/internal/sdk/models/components/examplein.go - - tests/mockserver/internal/sdk/models/components/file.go - - tests/mockserver/internal/sdk/models/components/filefile.go - - tests/mockserver/internal/sdk/models/components/filter.go - - tests/mockserver/internal/sdk/models/components/functioncallconfiguration.go - - tests/mockserver/internal/sdk/models/components/functioncallinput.go - - tests/mockserver/internal/sdk/models/components/functioncalloutput.go - - tests/mockserver/internal/sdk/models/components/functiondefinition.go - - tests/mockserver/internal/sdk/models/components/functionoutput.go - - tests/mockserver/internal/sdk/models/components/getcustommodelresponse.go - - tests/mockserver/internal/sdk/models/components/getdatasetentriesresponse.go - - tests/mockserver/internal/sdk/models/components/getdatasetentryresponse.go - - tests/mockserver/internal/sdk/models/components/getfunctionresponse.go - - tests/mockserver/internal/sdk/models/components/getknowledgebaseresponse.go - - tests/mockserver/internal/sdk/models/components/getspanmetricresponse.go - - tests/mockserver/internal/sdk/models/components/getspanresponse.go - - tests/mockserver/internal/sdk/models/components/gettraceresponse.go - - tests/mockserver/internal/sdk/models/components/getuploadurlresponse.go - - tests/mockserver/internal/sdk/models/components/getusageresultitem.go - - tests/mockserver/internal/sdk/models/components/granularity.go - - tests/mockserver/internal/sdk/models/components/httpmetadata.go - - tests/mockserver/internal/sdk/models/components/imageurl.go - - tests/mockserver/internal/sdk/models/components/inputaudio.go - - tests/mockserver/internal/sdk/models/components/jsonschema.go - - tests/mockserver/internal/sdk/models/components/listcustommodelsresponseitem.go - - tests/mockserver/internal/sdk/models/components/listfunctionrevisionresponse.go - - tests/mockserver/internal/sdk/models/components/listfunctionsresponseitem.go - - tests/mockserver/internal/sdk/models/components/listknowledgebasesresponse.go - - tests/mockserver/internal/sdk/models/components/listlanguagemodelsresponse.go - - tests/mockserver/internal/sdk/models/components/listspanmetricsresponse.go - - tests/mockserver/internal/sdk/models/components/listtracesresponse.go - - tests/mockserver/internal/sdk/models/components/meta.go - - tests/mockserver/internal/sdk/models/components/model.go - - tests/mockserver/internal/sdk/models/components/op.go - - tests/mockserver/internal/sdk/models/components/openaitypeschatchatcompletionmessagetoolcallparamfunction.go - - tests/mockserver/internal/sdk/models/components/openaitypeschatchatcompletionnamedtoolchoiceparamfunction.go - - tests/mockserver/internal/sdk/models/components/openaitypeschatcompletioncreateparamsfunction.go - - tests/mockserver/internal/sdk/models/components/paginatedresponsegetdatasetentriesresponse.go - - tests/mockserver/internal/sdk/models/components/paginatedresponselistcustommodelsresponseitem.go - - tests/mockserver/internal/sdk/models/components/paginatedresponselistfunctionrevisionresponse.go - - tests/mockserver/internal/sdk/models/components/paginatedresponselistfunctionsresponseitem.go - - tests/mockserver/internal/sdk/models/components/paginatedresponselistknowledgebasesresponse.go - - tests/mockserver/internal/sdk/models/components/paginatedresponselistlanguagemodelsresponse.go - - tests/mockserver/internal/sdk/models/components/paginatedresponselistspanmetricsresponse.go - - tests/mockserver/internal/sdk/models/components/paginatedresponselisttracesresponse.go - - tests/mockserver/internal/sdk/models/components/prompttokensdetails.go - - tests/mockserver/internal/sdk/models/components/querydatasetentriesresponse.go - - tests/mockserver/internal/sdk/models/components/queryknowledgebaserequest.go - - tests/mockserver/internal/sdk/models/components/queryknowledgebaseresponse.go - - tests/mockserver/internal/sdk/models/components/registercustommodelrequest.go - - tests/mockserver/internal/sdk/models/components/registercustommodelresponse.go - - tests/mockserver/internal/sdk/models/components/registerfileuploadrequest.go - - tests/mockserver/internal/sdk/models/components/registerfileuploadresponse.go - - tests/mockserver/internal/sdk/models/components/responseformatjsonobject.go - - tests/mockserver/internal/sdk/models/components/responseformatjsonschema.go - - tests/mockserver/internal/sdk/models/components/responseformattext.go - - tests/mockserver/internal/sdk/models/components/savetodatasetresponse.go - - tests/mockserver/internal/sdk/models/components/security.go - - tests/mockserver/internal/sdk/models/components/spandata.go - - tests/mockserver/internal/sdk/models/components/spanmetricdata.go - - tests/mockserver/internal/sdk/models/components/spanschema.go - - tests/mockserver/internal/sdk/models/components/textprocessingconfiguration.go - - tests/mockserver/internal/sdk/models/components/tmodel.go - - tests/mockserver/internal/sdk/models/components/toplogprob.go - - tests/mockserver/internal/sdk/models/components/updatecustommodelrequest.go - - tests/mockserver/internal/sdk/models/components/updatecustommodelresponse.go - - tests/mockserver/internal/sdk/models/components/updatedatasetentryrequest.go - - tests/mockserver/internal/sdk/models/components/updatedatasetentryresponse.go - - tests/mockserver/internal/sdk/models/components/updatefunctionrequest.go - - tests/mockserver/internal/sdk/models/components/updatefunctionresponse.go - - tests/mockserver/internal/sdk/models/components/updatespanmetricrequest.go - - tests/mockserver/internal/sdk/models/components/updatespanmetricresponse.go - - tests/mockserver/internal/sdk/models/components/updatespanrequest.go - - tests/mockserver/internal/sdk/models/components/updatespanresponse.go - - tests/mockserver/internal/sdk/models/components/websearchoptions.go - - tests/mockserver/internal/sdk/models/components/websearchoptionsuserlocation.go - - tests/mockserver/internal/sdk/models/components/websearchoptionsuserlocationapproximate.go - - tests/mockserver/internal/sdk/models/operations/addknowledgeknowledgebaseidaddpost.go - - tests/mockserver/internal/sdk/models/operations/callfunctionfunctionsfunctionidcallpost.go - - tests/mockserver/internal/sdk/models/operations/callfunctionrevisionfunctionsfunctionidcallrevisionidpost.go - - tests/mockserver/internal/sdk/models/operations/chatcompletionsopenaichatcompletionspost.go - - tests/mockserver/internal/sdk/models/operations/createdatasetentrydatasetsdatasetidpost.go - - tests/mockserver/internal/sdk/models/operations/createembeddingembeddingspost.go - - tests/mockserver/internal/sdk/models/operations/createfunctionfunctionspost.go - - tests/mockserver/internal/sdk/models/operations/createknowledgebaseknowledgepost.go - - tests/mockserver/internal/sdk/models/operations/createmetricspansspanidmetricspost.go - - tests/mockserver/internal/sdk/models/operations/createspanspanspost.go - - tests/mockserver/internal/sdk/models/operations/deletecustommodelmodelscustommodeliddelete.go - - tests/mockserver/internal/sdk/models/operations/deletedatasetentrydatasetsdatasetidentriesentryiddelete.go - - tests/mockserver/internal/sdk/models/operations/deletefilefromknowledgebaseknowledgeknowledgebaseidfilesfileiddelete.go - - tests/mockserver/internal/sdk/models/operations/deletefunctionfunctionsfunctioniddelete.go - - tests/mockserver/internal/sdk/models/operations/deleteknowledgebaseknowledgeknowledgebaseiddelete.go - - tests/mockserver/internal/sdk/models/operations/deletemetricspansspanidmetricsmetriciddelete.go - - tests/mockserver/internal/sdk/models/operations/deletespanspansspaniddelete.go - - tests/mockserver/internal/sdk/models/operations/functioncallcallpost.go - - tests/mockserver/internal/sdk/models/operations/functionstreamcallstreampost.go - - tests/mockserver/internal/sdk/models/operations/getcustommodelbynamemodelscustombynamenameget.go - - tests/mockserver/internal/sdk/models/operations/getcustommodelmodelscustommodelidget.go - - tests/mockserver/internal/sdk/models/operations/getdatasetentrydatasetsdatasetidentriesentryidget.go - - tests/mockserver/internal/sdk/models/operations/getfunctionbynamefunctionsbynamenameget.go - - tests/mockserver/internal/sdk/models/operations/getfunctionbyrevisionfunctionsfunctionidrevisionsrevisionidget.go - - tests/mockserver/internal/sdk/models/operations/getfunctionfunctionsfunctionidget.go - - tests/mockserver/internal/sdk/models/operations/getknowledgebasebynameknowledgebynameknowledgebasenameget.go - - tests/mockserver/internal/sdk/models/operations/getknowledgebaseknowledgeknowledgebaseidget.go - - tests/mockserver/internal/sdk/models/operations/getmetricspansspanidmetricsmetricidget.go - - tests/mockserver/internal/sdk/models/operations/getspanspansspanidget.go - - tests/mockserver/internal/sdk/models/operations/gettracetracestraceidget.go - - tests/mockserver/internal/sdk/models/operations/getuploadurlknowledgeknowledgebaseiduploadurlget.go - - tests/mockserver/internal/sdk/models/operations/listcustommodelsmodelscustomget.go - - tests/mockserver/internal/sdk/models/operations/listdatasetentriesdatasetsdatasetidentriesget.go - - tests/mockserver/internal/sdk/models/operations/listfunctionrevisionsfunctionsfunctionidrevisionsget.go - - tests/mockserver/internal/sdk/models/operations/listfunctionsfunctionsget.go - - tests/mockserver/internal/sdk/models/operations/listknowledgebasesknowledgeget.go - - tests/mockserver/internal/sdk/models/operations/listmetricsspansspanidmetricsget.go - - tests/mockserver/internal/sdk/models/operations/listmodelsmodelsget.go - - tests/mockserver/internal/sdk/models/operations/listtracestracesget.go - - tests/mockserver/internal/sdk/models/operations/querydatasetentriesdatasetsdatasetidentriesquerypost.go - - tests/mockserver/internal/sdk/models/operations/queryknowledgebaseknowledgeknowledgebaseidquerypost.go - - tests/mockserver/internal/sdk/models/operations/registercustommodelmodelscustompost.go - - tests/mockserver/internal/sdk/models/operations/registerfileuploadknowledgeknowledgebaseidregisterfilepost.go - - tests/mockserver/internal/sdk/models/operations/savetodatasetspansspanidsaveexamplespost.go - - tests/mockserver/internal/sdk/models/operations/streamfunctionfunctionsfunctionidcallstreampost.go - - tests/mockserver/internal/sdk/models/operations/streamfunctionrevisionfunctionsfunctionidcallstreamrevisionidpost.go - - tests/mockserver/internal/sdk/models/operations/updatecustommodelmodelscustommodelidpatch.go - - tests/mockserver/internal/sdk/models/operations/updatedatasetentrydatasetsdatasetidentriesentryidpatch.go - - tests/mockserver/internal/sdk/models/operations/updatefunctionfunctionsfunctionidpatch.go - - tests/mockserver/internal/sdk/models/operations/updatemetricspansspanidmetricsmetricidpatch.go - - tests/mockserver/internal/sdk/models/operations/updatespanspansspanidpatch.go - - tests/mockserver/internal/sdk/models/operations/usageanalyticsusageget.go - - tests/mockserver/internal/sdk/models/sdkerrors/badrequesterror.go - - tests/mockserver/internal/sdk/models/sdkerrors/conflicterror.go - - tests/mockserver/internal/sdk/models/sdkerrors/error.go - - tests/mockserver/internal/sdk/models/sdkerrors/notfounderror.go - - tests/mockserver/internal/sdk/models/sdkerrors/requestvalidationerror.go - - tests/mockserver/internal/sdk/models/sdkerrors/unauthorizederror.go - - tests/mockserver/internal/sdk/types/bigint.go - - tests/mockserver/internal/sdk/types/date.go - - tests/mockserver/internal/sdk/types/datetime.go - - tests/mockserver/internal/sdk/types/decimal.go - - tests/mockserver/internal/sdk/types/jsonl/jsonl.go - - tests/mockserver/internal/sdk/types/pointers.go - - tests/mockserver/internal/sdk/types/stream/stream.go - - tests/mockserver/internal/sdk/utils/json.go - - tests/mockserver/internal/sdk/utils/reflect.go - - tests/mockserver/internal/sdk/utils/sort.go - - tests/mockserver/internal/server/doc.go - - tests/mockserver/internal/server/generated_handlers.go - - tests/mockserver/internal/server/internal_handlers.go - - tests/mockserver/internal/server/server.go - - tests/mockserver/internal/server/server_option.go - - tests/mockserver/internal/server/templates/log/index.html.tmpl - - tests/mockserver/internal/server/templates/log/operation.html.tmpl - - tests/mockserver/internal/server/templates/log/style.css.tmpl - - tests/mockserver/internal/tracking/requesttracker.go - - tests/mockserver/main.go examples: function_call_call_post: speakeasy-default-function-call-call-post: @@ -994,7 +766,7 @@ examples: path: span_id: "77b258a2-45c1-4b87-a50c-9116bc8ed1d6" requestBody: - application/json: {"name": "my span", "start_time": "2025-06-27T11:37:21.302644Z", "type": "email_tool", "end_time": "2025-06-27T11:37:21.302704Z", "input": "Hello, world!", "output": "Hello, world!", "error": "Exception: This is an error message", "meta": {"key": "value"}, "score": 10} + application/json: {"name": "my span", "start_time": "2025-06-27T11:37:30.236954Z", "type": "email_tool", "end_time": "2025-06-27T11:37:30.237016Z", "input": "Hello, world!", "output": "Hello, world!", "error": "Exception: This is an error message", "meta": {"key": "value"}, "score": 10} responses: "200": application/json: {"name": "my span", "start_time": "2024-03-20T10:00:00+00:00", "id": "84d9ffc8-336c-4953-b92f-fe05d5405951", "trace_id": "123e4567-e89b-12d3-a456-426614174000", "parent_id": "123e4567-e89b-12d3-a456-426614174000", "type": "email_tool", "end_time": "2024-03-20T10:00:10+00:00", "input": "Hello, world!", "output": "Hello, world!", "error": "Exception: This is an error message", "meta": {"key": "value"}, "score": 10} diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 7548c48..831fa69 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -25,7 +25,7 @@ generation: generateNewTests: false skipResponseBodyAssertions: false python: - version: 1.0.3 + version: 1.1.0 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index db1695d..110d9b4 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.570.2 +speakeasyVersion: 1.570.3 sources: FastAPI: sourceNamespace: fast-api - sourceRevisionDigest: sha256:b66f7e1f7511a3a98ba9cd12b772ec995f5cf4362a60fdcc5b2582f1fa09b05b - sourceBlobDigest: sha256:46c3eaf6d76d253f805f2e4bb527f5a3e1ee391f78222af96eebb199446604b1 + sourceRevisionDigest: sha256:adb5fec50e8fd1f8c7cc868716fb7e5fbf39fc756fbdd6fdfe5a2da297b44117 + sourceBlobDigest: sha256:0a9aca123316c592439d71ec2d82c03169a61672abb83ea322db326c0dca2c0a tags: - latest - 2.0.0 @@ -11,10 +11,10 @@ targets: opper: source: FastAPI sourceNamespace: fast-api - sourceRevisionDigest: sha256:b66f7e1f7511a3a98ba9cd12b772ec995f5cf4362a60fdcc5b2582f1fa09b05b - sourceBlobDigest: sha256:46c3eaf6d76d253f805f2e4bb527f5a3e1ee391f78222af96eebb199446604b1 + sourceRevisionDigest: sha256:adb5fec50e8fd1f8c7cc868716fb7e5fbf39fc756fbdd6fdfe5a2da297b44117 + sourceBlobDigest: sha256:0a9aca123316c592439d71ec2d82c03169a61672abb83ea322db326c0dca2c0a codeSamplesNamespace: fast-api-python-code-samples - codeSamplesRevisionDigest: sha256:27f0e2c1eed1575de750c05307aa2e88414496aea05007fc0a2f81e5797d1d6b + codeSamplesRevisionDigest: sha256:b12527fbb6485ea220536f7dea61d6b3be1edd299f38660c8018d5b79ee06160 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index c237bf4..df9f176 100644 --- a/README.md +++ b/README.md @@ -156,7 +156,7 @@ with Opper( ], "title": "OpperOutputExample", "type": "object", - }, input_={ + }, input={ "x": 4, "y": 5, }, examples=[ @@ -223,7 +223,7 @@ async def main(): ], "title": "OpperOutputExample", "type": "object", - }, input_={ + }, input={ "x": 4, "y": 5, }, examples=[ @@ -299,7 +299,7 @@ with Opper( ], "title": "OpperOutputExample", "type": "object", - }, input_={ + }, input={ "x": 4, "y": 5, }, examples=[ @@ -474,7 +474,7 @@ with Opper( ], "title": "OpperOutputExample", "type": "object", - }, input_={ + }, input={ "x": 4, "y": 5, }, examples=[ @@ -550,7 +550,7 @@ with Opper( ], "title": "OpperOutputExample", "type": "object", - }, input_={ + }, input={ "x": 4, "y": 5, }, examples=[ @@ -616,7 +616,7 @@ with Opper( ], "title": "OpperOutputExample", "type": "object", - }, input_={ + }, input={ "x": 4, "y": 5, }, examples=[ @@ -707,7 +707,7 @@ with Opper( ], "title": "OpperOutputExample", "type": "object", - }, input_={ + }, input={ "x": 4, "y": 5, }, examples=[ @@ -792,7 +792,7 @@ with Opper( ], "title": "OpperOutputExample", "type": "object", - }, input_={ + }, input={ "x": 4, "y": 5, }, examples=[ diff --git a/USAGE.md b/USAGE.md index fb05c92..abece1d 100644 --- a/USAGE.md +++ b/USAGE.md @@ -38,7 +38,7 @@ with Opper( ], "title": "OpperOutputExample", "type": "object", - }, input_={ + }, input={ "x": 4, "y": 5, }, examples=[ @@ -105,7 +105,7 @@ async def main(): ], "title": "OpperOutputExample", "type": "object", - }, input_={ + }, input={ "x": 4, "y": 5, }, examples=[ diff --git a/docs/models/updatespanrequest.md b/docs/models/updatespanrequest.md index 287b198..d77d240 100644 --- a/docs/models/updatespanrequest.md +++ b/docs/models/updatespanrequest.md @@ -6,9 +6,9 @@ | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | | `name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the span, something descriptive about the span that will be used to identify it when querying | my span | -| `start_time` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The start time of the span in UTC | 2025-06-27T11:37:21.302644Z | +| `start_time` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The start time of the span in UTC | 2025-06-27T11:37:30.236954Z | | `type` | *OptionalNullable[str]* | :heavy_minus_sign: | The type of the span | email_tool | -| `end_time` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The end time of the span in UTC | 2025-06-27T11:37:21.302704Z | +| `end_time` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The end time of the span in UTC | 2025-06-27T11:37:30.237016Z | | `input` | *OptionalNullable[str]* | :heavy_minus_sign: | The input of the span | Hello, world! | | `output` | *OptionalNullable[str]* | :heavy_minus_sign: | The output of the span | Hello, world! | | `error` | *OptionalNullable[str]* | :heavy_minus_sign: | In case of an error, the error message | Exception: This is an error message | diff --git a/docs/sdks/datasets/README.md b/docs/sdks/datasets/README.md index 7bb7ef8..e049ed9 100644 --- a/docs/sdks/datasets/README.md +++ b/docs/sdks/datasets/README.md @@ -26,7 +26,7 @@ with Opper( http_bearer=os.getenv("OPPER_HTTP_BEARER", ""), ) as opper: - res = opper.datasets.create_entry(dataset_id="50c15d18-6e79-449b-9e59-30324da6de5f", input_={ + res = opper.datasets.create_entry(dataset_id="50c15d18-6e79-449b-9e59-30324da6de5f", input={ "x": 4, "y": 5, }, output={ diff --git a/docs/sdks/embeddings/README.md b/docs/sdks/embeddings/README.md index bb9f8ac..4736118 100644 --- a/docs/sdks/embeddings/README.md +++ b/docs/sdks/embeddings/README.md @@ -22,7 +22,7 @@ with Opper( http_bearer=os.getenv("OPPER_HTTP_BEARER", ""), ) as opper: - res = opper.embeddings.create(input_="Hello, world!") + res = opper.embeddings.create(input="Hello, world!") # Handle response print(res) diff --git a/docs/sdks/entries/README.md b/docs/sdks/entries/README.md index c4a3171..69568d0 100644 --- a/docs/sdks/entries/README.md +++ b/docs/sdks/entries/README.md @@ -22,7 +22,7 @@ with Opper( http_bearer=os.getenv("OPPER_HTTP_BEARER", ""), ) as opper: - res = opper.datasets.entries.update(dataset_id="df57581c-3364-4ee6-a9f8-7de20cb937ff", entry_id="2789b25b-1a98-4360-96ee-67e9af98c53f", input_="Given this input, what is the output?", output="This is the output to the dataset entry", expected="This `was` the output to the dataset entry", comment="This is an example of how one can edit the output") + res = opper.datasets.entries.update(dataset_id="df57581c-3364-4ee6-a9f8-7de20cb937ff", entry_id="2789b25b-1a98-4360-96ee-67e9af98c53f", input="Given this input, what is the output?", output="This is the output to the dataset entry", expected="This `was` the output to the dataset entry", comment="This is an example of how one can edit the output") # Handle response print(res) diff --git a/docs/sdks/functions/README.md b/docs/sdks/functions/README.md index c23d264..97457ac 100644 --- a/docs/sdks/functions/README.md +++ b/docs/sdks/functions/README.md @@ -409,7 +409,7 @@ with Opper( http_bearer=os.getenv("OPPER_HTTP_BEARER", ""), ) as opper: - res = opper.functions.call(function_id="864c5880-3d87-4091-828c-33cc2c7219a9", input_={ + res = opper.functions.call(function_id="864c5880-3d87-4091-828c-33cc2c7219a9", input={ "x": 4, "y": 5, }, examples=[ @@ -486,7 +486,7 @@ with Opper( http_bearer=os.getenv("OPPER_HTTP_BEARER", ""), ) as opper: - res = opper.functions.stream(function_id="e35c595b-59f2-40b8-bc8a-d6f71ebd3c63", input_={ + res = opper.functions.stream(function_id="e35c595b-59f2-40b8-bc8a-d6f71ebd3c63", input={ "x": 4, "y": 5, }, examples=[ @@ -551,7 +551,7 @@ with Opper( http_bearer=os.getenv("OPPER_HTTP_BEARER", ""), ) as opper: - res = opper.functions.call_revision(function_id="b7391b0d-f115-4145-ae29-a136ae2d6a7a", revision_id="de9b5cac-c926-4aa1-a5ab-dc3aa3cd539c", input_={ + res = opper.functions.call_revision(function_id="b7391b0d-f115-4145-ae29-a136ae2d6a7a", revision_id="de9b5cac-c926-4aa1-a5ab-dc3aa3cd539c", input={ "x": 4, "y": 5, }, examples=[ @@ -629,7 +629,7 @@ with Opper( http_bearer=os.getenv("OPPER_HTTP_BEARER", ""), ) as opper: - res = opper.functions.stream_revision(function_id="d69e8466-7dba-4eaf-983c-ee6573398ae7", revision_id="c5701ae3-acaf-40b6-95f8-5c1192d84640", input_={ + res = opper.functions.stream_revision(function_id="d69e8466-7dba-4eaf-983c-ee6573398ae7", revision_id="c5701ae3-acaf-40b6-95f8-5c1192d84640", input={ "x": 4, "y": 5, }, examples=[ diff --git a/docs/sdks/opper/README.md b/docs/sdks/opper/README.md index 2e3808b..ba2f525 100644 --- a/docs/sdks/opper/README.md +++ b/docs/sdks/opper/README.md @@ -52,7 +52,7 @@ with Opper( ], "title": "OpperOutputExample", "type": "object", - }, input_={ + }, input={ "x": 4, "y": 5, }, examples=[ @@ -167,7 +167,7 @@ with Opper( ], "title": "OpperOutputExample", "type": "object", - }, input_={ + }, input={ "x": 4, "y": 5, }, examples=[ diff --git a/docs/sdks/spans/README.md b/docs/sdks/spans/README.md index b7923ba..b74e0c4 100644 --- a/docs/sdks/spans/README.md +++ b/docs/sdks/spans/README.md @@ -27,7 +27,7 @@ with Opper( http_bearer=os.getenv("OPPER_HTTP_BEARER", ""), ) as opper: - res = opper.spans.create(name="my span", start_time=parse_datetime("2024-03-20T10:00:00+00:00"), id="123e4567-e89b-12d3-a456-426614174000", trace_id="123e4567-e89b-12d3-a456-426614174000", parent_id="123e4567-e89b-12d3-a456-426614174000", type_="email_tool", end_time=parse_datetime("2024-03-20T10:00:10+00:00"), input_="Hello, world!", output="Hello, world!", error="Exception: This is an error message", meta={ + res = opper.spans.create(name="my span", start_time=parse_datetime("2024-03-20T10:00:00+00:00"), id="123e4567-e89b-12d3-a456-426614174000", trace_id="123e4567-e89b-12d3-a456-426614174000", parent_id="123e4567-e89b-12d3-a456-426614174000", type="email_tool", end_time=parse_datetime("2024-03-20T10:00:10+00:00"), input="Hello, world!", output="Hello, world!", error="Exception: This is an error message", meta={ "key": "value", }, score=10) @@ -127,7 +127,7 @@ with Opper( http_bearer=os.getenv("OPPER_HTTP_BEARER", ""), ) as opper: - res = opper.spans.update(span_id="77b258a2-45c1-4b87-a50c-9116bc8ed1d6", name="my span", start_time=parse_datetime("2025-06-27T11:37:21.302644Z"), type_="email_tool", end_time=parse_datetime("2025-06-27T11:37:21.302704Z"), input_="Hello, world!", output="Hello, world!", error="Exception: This is an error message", meta={ + res = opper.spans.update(span_id="77b258a2-45c1-4b87-a50c-9116bc8ed1d6", name="my span", start_time=parse_datetime("2025-06-27T11:37:30.236954Z"), type="email_tool", end_time=parse_datetime("2025-06-27T11:37:30.237016Z"), input="Hello, world!", output="Hello, world!", error="Exception: This is an error message", meta={ "key": "value", }, score=10) @@ -142,9 +142,9 @@ with Opper( | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | | `span_id` | *str* | :heavy_check_mark: | The ID of the span to update | | | `name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the span, something descriptive about the span that will be used to identify it when querying | my span | -| `start_time` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The start time of the span in UTC | 2025-06-27T11:37:21.302644Z | +| `start_time` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The start time of the span in UTC | 2025-06-27T11:37:30.236954Z | | `type` | *OptionalNullable[str]* | :heavy_minus_sign: | The type of the span | email_tool | -| `end_time` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The end time of the span in UTC | 2025-06-27T11:37:21.302704Z | +| `end_time` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The end time of the span in UTC | 2025-06-27T11:37:30.237016Z | | `input` | *OptionalNullable[str]* | :heavy_minus_sign: | The input of the span | Hello, world! | | `output` | *OptionalNullable[str]* | :heavy_minus_sign: | The output of the span | Hello, world! | | `error` | *OptionalNullable[str]* | :heavy_minus_sign: | In case of an error, the error message | Exception: This is an error message | diff --git a/pyproject.toml b/pyproject.toml index 2d7df06..a322f67 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "opperai" -version = "1.0.3" +version = "1.1.0" description = "Python Client SDK Generated by Speakeasy." authors = [{ name = "Speakeasy" },] readme = "README.md" diff --git a/src/opperai/_version.py b/src/opperai/_version.py index b92cda6..8c755d8 100644 --- a/src/opperai/_version.py +++ b/src/opperai/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "opperai" -__version__: str = "1.0.3" +__version__: str = "1.1.0" __openapi_doc_version__: str = "2.0.0" -__gen_version__: str = "2.638.5" -__user_agent__: str = "speakeasy-sdk/python 1.0.3 2.638.5 2.0.0 opperai" +__gen_version__: str = "2.639.2" +__user_agent__: str = "speakeasy-sdk/python 1.1.0 2.639.2 2.0.0 opperai" try: if __package__ is not None: diff --git a/src/opperai/datasets.py b/src/opperai/datasets.py index 8eb5c93..2a67fd0 100644 --- a/src/opperai/datasets.py +++ b/src/opperai/datasets.py @@ -25,7 +25,7 @@ def create_entry( self, *, dataset_id: str, - input_: Any, + input: Any, output: Any, expected: OptionalNullable[Any] = UNSET, comment: OptionalNullable[str] = UNSET, @@ -59,7 +59,7 @@ def create_entry( request = models.CreateDatasetEntryDatasetsDatasetIDPostRequest( dataset_id=dataset_id, create_dataset_entry_request=models.CreateDatasetEntryRequest( - input=input_, + input=input, output=output, expected=expected, comment=comment, @@ -161,7 +161,7 @@ async def create_entry_async( self, *, dataset_id: str, - input_: Any, + input: Any, output: Any, expected: OptionalNullable[Any] = UNSET, comment: OptionalNullable[str] = UNSET, @@ -195,7 +195,7 @@ async def create_entry_async( request = models.CreateDatasetEntryDatasetsDatasetIDPostRequest( dataset_id=dataset_id, create_dataset_entry_request=models.CreateDatasetEntryRequest( - input=input_, + input=input, output=output, expected=expected, comment=comment, diff --git a/src/opperai/embeddings.py b/src/opperai/embeddings.py index 0c27e77..f1fcc0d 100644 --- a/src/opperai/embeddings.py +++ b/src/opperai/embeddings.py @@ -12,7 +12,7 @@ class Embeddings(BaseSDK): def create( self, *, - input_: Union[models.Input, models.InputTypedDict], + input: Union[models.Input, models.InputTypedDict], model: OptionalNullable[Union[models.TModel, models.TModelTypedDict]] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -42,7 +42,7 @@ def create( request = models.CreateEmbeddingRequest( model=utils.get_pydantic_model(model, OptionalNullable[models.TModel]), - input=input_, + input=input, ) req = self._build_request( @@ -134,7 +134,7 @@ def create( async def create_async( self, *, - input_: Union[models.Input, models.InputTypedDict], + input: Union[models.Input, models.InputTypedDict], model: OptionalNullable[Union[models.TModel, models.TModelTypedDict]] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -164,7 +164,7 @@ async def create_async( request = models.CreateEmbeddingRequest( model=utils.get_pydantic_model(model, OptionalNullable[models.TModel]), - input=input_, + input=input, ) req = self._build_request_async( diff --git a/src/opperai/entries.py b/src/opperai/entries.py index 943de1e..8c63a54 100644 --- a/src/opperai/entries.py +++ b/src/opperai/entries.py @@ -14,7 +14,7 @@ def update( *, dataset_id: str, entry_id: str, - input_: OptionalNullable[Any] = UNSET, + input: OptionalNullable[Any] = UNSET, output: OptionalNullable[Any] = UNSET, expected: OptionalNullable[Any] = UNSET, comment: OptionalNullable[str] = UNSET, @@ -50,7 +50,7 @@ def update( dataset_id=dataset_id, entry_id=entry_id, update_dataset_entry_request=models.UpdateDatasetEntryRequest( - input=input_, + input=input, output=output, expected=expected, comment=comment, @@ -153,7 +153,7 @@ async def update_async( *, dataset_id: str, entry_id: str, - input_: OptionalNullable[Any] = UNSET, + input: OptionalNullable[Any] = UNSET, output: OptionalNullable[Any] = UNSET, expected: OptionalNullable[Any] = UNSET, comment: OptionalNullable[str] = UNSET, @@ -189,7 +189,7 @@ async def update_async( dataset_id=dataset_id, entry_id=entry_id, update_dataset_entry_request=models.UpdateDatasetEntryRequest( - input=input_, + input=input, output=output, expected=expected, comment=comment, diff --git a/src/opperai/functions.py b/src/opperai/functions.py index 5dc83a3..66ac939 100644 --- a/src/opperai/functions.py +++ b/src/opperai/functions.py @@ -67,6 +67,13 @@ def create( else: base_url = self._get_url(base_url, url_variables) + # region convert-pydantic-schemas + if input_schema is not UNSET and hasattr(input_schema, 'model_json_schema'): + input_schema = input_schema.model_json_schema() + if output_schema is not UNSET and hasattr(output_schema, 'model_json_schema'): + output_schema = output_schema.model_json_schema() + # endregion convert-pydantic-schemas + request = models.CreateFunctionRequest( name=name, description=description, @@ -215,6 +222,13 @@ async def create_async( else: base_url = self._get_url(base_url, url_variables) + # region convert-pydantic-schemas + if input_schema is not UNSET and hasattr(input_schema, 'model_json_schema'): + input_schema = input_schema.model_json_schema() + if output_schema is not UNSET and hasattr(output_schema, 'model_json_schema'): + output_schema = output_schema.model_json_schema() + # endregion convert-pydantic-schemas + request = models.CreateFunctionRequest( name=name, description=description, @@ -842,6 +856,13 @@ def update( else: base_url = self._get_url(base_url, url_variables) + # region convert-pydantic-schemas + if input_schema is not UNSET and hasattr(input_schema, 'model_json_schema'): + input_schema = input_schema.model_json_schema() + if output_schema is not UNSET and hasattr(output_schema, 'model_json_schema'): + output_schema = output_schema.model_json_schema() + # endregion convert-pydantic-schemas + request = models.UpdateFunctionFunctionsFunctionIDPatchRequest( function_id=function_id, update_function_request=models.UpdateFunctionRequest( @@ -987,6 +1008,13 @@ async def update_async( else: base_url = self._get_url(base_url, url_variables) + # region convert-pydantic-schemas + if input_schema is not UNSET and hasattr(input_schema, 'model_json_schema'): + input_schema = input_schema.model_json_schema() + if output_schema is not UNSET and hasattr(output_schema, 'model_json_schema'): + output_schema = output_schema.model_json_schema() + # endregion convert-pydantic-schemas + request = models.UpdateFunctionFunctionsFunctionIDPatchRequest( function_id=function_id, update_function_request=models.UpdateFunctionRequest( @@ -1789,7 +1817,7 @@ def call( self, *, function_id: str, - input_: OptionalNullable[Any] = UNSET, + input: OptionalNullable[Any] = UNSET, parent_span_id: OptionalNullable[str] = UNSET, examples: OptionalNullable[ Union[List[models.ExampleIn], List[models.ExampleInTypedDict]] @@ -1827,7 +1855,7 @@ def call( request = models.CallFunctionFunctionsFunctionIDCallPostRequest( function_id=function_id, app_api_public_v2_functions_call_function_request=models.AppAPIPublicV2FunctionsCallFunctionRequest( - input=input_, + input=input, parent_span_id=parent_span_id, examples=utils.get_pydantic_model( examples, OptionalNullable[List[models.ExampleIn]] @@ -1931,7 +1959,7 @@ async def call_async( self, *, function_id: str, - input_: OptionalNullable[Any] = UNSET, + input: OptionalNullable[Any] = UNSET, parent_span_id: OptionalNullable[str] = UNSET, examples: OptionalNullable[ Union[List[models.ExampleIn], List[models.ExampleInTypedDict]] @@ -1969,7 +1997,7 @@ async def call_async( request = models.CallFunctionFunctionsFunctionIDCallPostRequest( function_id=function_id, app_api_public_v2_functions_call_function_request=models.AppAPIPublicV2FunctionsCallFunctionRequest( - input=input_, + input=input, parent_span_id=parent_span_id, examples=utils.get_pydantic_model( examples, OptionalNullable[List[models.ExampleIn]] @@ -2073,7 +2101,7 @@ def stream( self, *, function_id: str, - input_: OptionalNullable[Any] = UNSET, + input: OptionalNullable[Any] = UNSET, parent_span_id: OptionalNullable[str] = UNSET, examples: OptionalNullable[ Union[List[models.ExampleIn], List[models.ExampleInTypedDict]] @@ -2125,7 +2153,7 @@ def stream( request = models.StreamFunctionFunctionsFunctionIDCallStreamPostRequest( function_id=function_id, app_api_public_v2_functions_call_function_request=models.AppAPIPublicV2FunctionsCallFunctionRequest( - input=input_, + input=input, parent_span_id=parent_span_id, examples=utils.get_pydantic_model( examples, OptionalNullable[List[models.ExampleIn]] @@ -2241,7 +2269,7 @@ async def stream_async( self, *, function_id: str, - input_: OptionalNullable[Any] = UNSET, + input: OptionalNullable[Any] = UNSET, parent_span_id: OptionalNullable[str] = UNSET, examples: OptionalNullable[ Union[List[models.ExampleIn], List[models.ExampleInTypedDict]] @@ -2293,7 +2321,7 @@ async def stream_async( request = models.StreamFunctionFunctionsFunctionIDCallStreamPostRequest( function_id=function_id, app_api_public_v2_functions_call_function_request=models.AppAPIPublicV2FunctionsCallFunctionRequest( - input=input_, + input=input, parent_span_id=parent_span_id, examples=utils.get_pydantic_model( examples, OptionalNullable[List[models.ExampleIn]] @@ -2410,7 +2438,7 @@ def call_revision( *, function_id: str, revision_id: str, - input_: OptionalNullable[Any] = UNSET, + input: OptionalNullable[Any] = UNSET, parent_span_id: OptionalNullable[str] = UNSET, examples: OptionalNullable[ Union[List[models.ExampleIn], List[models.ExampleInTypedDict]] @@ -2450,7 +2478,7 @@ def call_revision( function_id=function_id, revision_id=revision_id, app_api_public_v2_functions_call_function_request=models.AppAPIPublicV2FunctionsCallFunctionRequest( - input=input_, + input=input, parent_span_id=parent_span_id, examples=utils.get_pydantic_model( examples, OptionalNullable[List[models.ExampleIn]] @@ -2555,7 +2583,7 @@ async def call_revision_async( *, function_id: str, revision_id: str, - input_: OptionalNullable[Any] = UNSET, + input: OptionalNullable[Any] = UNSET, parent_span_id: OptionalNullable[str] = UNSET, examples: OptionalNullable[ Union[List[models.ExampleIn], List[models.ExampleInTypedDict]] @@ -2595,7 +2623,7 @@ async def call_revision_async( function_id=function_id, revision_id=revision_id, app_api_public_v2_functions_call_function_request=models.AppAPIPublicV2FunctionsCallFunctionRequest( - input=input_, + input=input, parent_span_id=parent_span_id, examples=utils.get_pydantic_model( examples, OptionalNullable[List[models.ExampleIn]] @@ -2700,7 +2728,7 @@ def stream_revision( *, function_id: str, revision_id: str, - input_: OptionalNullable[Any] = UNSET, + input: OptionalNullable[Any] = UNSET, parent_span_id: OptionalNullable[str] = UNSET, examples: OptionalNullable[ Union[List[models.ExampleIn], List[models.ExampleInTypedDict]] @@ -2756,7 +2784,7 @@ def stream_revision( function_id=function_id, revision_id=revision_id, app_api_public_v2_functions_call_function_request=models.AppAPIPublicV2FunctionsCallFunctionRequest( - input=input_, + input=input, parent_span_id=parent_span_id, examples=utils.get_pydantic_model( examples, OptionalNullable[List[models.ExampleIn]] @@ -2873,7 +2901,7 @@ async def stream_revision_async( *, function_id: str, revision_id: str, - input_: OptionalNullable[Any] = UNSET, + input: OptionalNullable[Any] = UNSET, parent_span_id: OptionalNullable[str] = UNSET, examples: OptionalNullable[ Union[List[models.ExampleIn], List[models.ExampleInTypedDict]] @@ -2929,7 +2957,7 @@ async def stream_revision_async( function_id=function_id, revision_id=revision_id, app_api_public_v2_functions_call_function_request=models.AppAPIPublicV2FunctionsCallFunctionRequest( - input=input_, + input=input, parent_span_id=parent_span_id, examples=utils.get_pydantic_model( examples, OptionalNullable[List[models.ExampleIn]] diff --git a/src/opperai/sdk.py b/src/opperai/sdk.py index 03bcd03..8da6a0d 100644 --- a/src/opperai/sdk.py +++ b/src/opperai/sdk.py @@ -205,7 +205,7 @@ def call( instructions: OptionalNullable[str] = UNSET, input_schema: OptionalNullable[Dict[str, Any]] = UNSET, output_schema: OptionalNullable[Dict[str, Any]] = UNSET, - input_: OptionalNullable[Any] = UNSET, + input: OptionalNullable[Any] = UNSET, model: Optional[Union[models.TModel, models.TModelTypedDict]] = None, examples: OptionalNullable[ Union[List[models.Example], List[models.ExampleTypedDict]] @@ -253,12 +253,19 @@ def call( else: base_url = self._get_url(base_url, url_variables) + # region convert-pydantic-schemas + if input_schema is not UNSET and hasattr(input_schema, 'model_json_schema'): + input_schema = input_schema.model_json_schema() + if output_schema is not UNSET and hasattr(output_schema, 'model_json_schema'): + output_schema = output_schema.model_json_schema() + # endregion convert-pydantic-schemas + request = models.AppAPIPublicV2FunctionCallCallFunctionRequest( name=name, instructions=instructions, input_schema=input_schema, output_schema=output_schema, - input=input_, + input=input, model=utils.get_pydantic_model(model, Optional[models.TModel]), examples=utils.get_pydantic_model( examples, OptionalNullable[List[models.Example]] @@ -368,7 +375,7 @@ async def call_async( instructions: OptionalNullable[str] = UNSET, input_schema: OptionalNullable[Dict[str, Any]] = UNSET, output_schema: OptionalNullable[Dict[str, Any]] = UNSET, - input_: OptionalNullable[Any] = UNSET, + input: OptionalNullable[Any] = UNSET, model: Optional[Union[models.TModel, models.TModelTypedDict]] = None, examples: OptionalNullable[ Union[List[models.Example], List[models.ExampleTypedDict]] @@ -416,12 +423,19 @@ async def call_async( else: base_url = self._get_url(base_url, url_variables) + # region convert-pydantic-schemas + if input_schema is not UNSET and hasattr(input_schema, 'model_json_schema'): + input_schema = input_schema.model_json_schema() + if output_schema is not UNSET and hasattr(output_schema, 'model_json_schema'): + output_schema = output_schema.model_json_schema() + # endregion convert-pydantic-schemas + request = models.AppAPIPublicV2FunctionCallCallFunctionRequest( name=name, instructions=instructions, input_schema=input_schema, output_schema=output_schema, - input=input_, + input=input, model=utils.get_pydantic_model(model, Optional[models.TModel]), examples=utils.get_pydantic_model( examples, OptionalNullable[List[models.Example]] @@ -531,7 +545,7 @@ def stream( instructions: OptionalNullable[str] = UNSET, input_schema: OptionalNullable[Dict[str, Any]] = UNSET, output_schema: OptionalNullable[Dict[str, Any]] = UNSET, - input_: OptionalNullable[Any] = UNSET, + input: OptionalNullable[Any] = UNSET, model: Optional[Union[models.TModel, models.TModelTypedDict]] = None, examples: OptionalNullable[ Union[List[models.Example], List[models.ExampleTypedDict]] @@ -595,12 +609,19 @@ def stream( else: base_url = self._get_url(base_url, url_variables) + # region convert-pydantic-schemas + if input_schema is not UNSET and hasattr(input_schema, 'model_json_schema'): + input_schema = input_schema.model_json_schema() + if output_schema is not UNSET and hasattr(output_schema, 'model_json_schema'): + output_schema = output_schema.model_json_schema() + # endregion convert-pydantic-schemas + request = models.AppAPIPublicV2FunctionCallCallFunctionRequest( name=name, instructions=instructions, input_schema=input_schema, output_schema=output_schema, - input=input_, + input=input, model=utils.get_pydantic_model(model, Optional[models.TModel]), examples=utils.get_pydantic_model( examples, OptionalNullable[List[models.Example]] @@ -721,7 +742,7 @@ async def stream_async( instructions: OptionalNullable[str] = UNSET, input_schema: OptionalNullable[Dict[str, Any]] = UNSET, output_schema: OptionalNullable[Dict[str, Any]] = UNSET, - input_: OptionalNullable[Any] = UNSET, + input: OptionalNullable[Any] = UNSET, model: Optional[Union[models.TModel, models.TModelTypedDict]] = None, examples: OptionalNullable[ Union[List[models.Example], List[models.ExampleTypedDict]] @@ -785,12 +806,19 @@ async def stream_async( else: base_url = self._get_url(base_url, url_variables) + # region convert-pydantic-schemas + if input_schema is not UNSET and hasattr(input_schema, 'model_json_schema'): + input_schema = input_schema.model_json_schema() + if output_schema is not UNSET and hasattr(output_schema, 'model_json_schema'): + output_schema = output_schema.model_json_schema() + # endregion convert-pydantic-schemas + request = models.AppAPIPublicV2FunctionCallCallFunctionRequest( name=name, instructions=instructions, input_schema=input_schema, output_schema=output_schema, - input=input_, + input=input, model=utils.get_pydantic_model(model, Optional[models.TModel]), examples=utils.get_pydantic_model( examples, OptionalNullable[List[models.Example]] diff --git a/src/opperai/spans.py b/src/opperai/spans.py index 2f6335e..30c3fc6 100644 --- a/src/opperai/spans.py +++ b/src/opperai/spans.py @@ -18,9 +18,9 @@ def create( id: OptionalNullable[str] = UNSET, trace_id: OptionalNullable[str] = UNSET, parent_id: OptionalNullable[str] = UNSET, - type_: OptionalNullable[str] = UNSET, + type: OptionalNullable[str] = UNSET, end_time: OptionalNullable[datetime] = UNSET, - input_: OptionalNullable[Any] = UNSET, + input: OptionalNullable[Any] = UNSET, output: OptionalNullable[Any] = UNSET, error: OptionalNullable[str] = UNSET, meta: OptionalNullable[Dict[str, Any]] = UNSET, @@ -67,9 +67,9 @@ def create( id=id, trace_id=trace_id, parent_id=parent_id, - type=type_, + type=type, end_time=end_time, - input=input_, + input=input, output=output, error=error, meta=meta, @@ -169,9 +169,9 @@ async def create_async( id: OptionalNullable[str] = UNSET, trace_id: OptionalNullable[str] = UNSET, parent_id: OptionalNullable[str] = UNSET, - type_: OptionalNullable[str] = UNSET, + type: OptionalNullable[str] = UNSET, end_time: OptionalNullable[datetime] = UNSET, - input_: OptionalNullable[Any] = UNSET, + input: OptionalNullable[Any] = UNSET, output: OptionalNullable[Any] = UNSET, error: OptionalNullable[str] = UNSET, meta: OptionalNullable[Dict[str, Any]] = UNSET, @@ -218,9 +218,9 @@ async def create_async( id=id, trace_id=trace_id, parent_id=parent_id, - type=type_, + type=type, end_time=end_time, - input=input_, + input=input, output=output, error=error, meta=meta, @@ -548,9 +548,9 @@ def update( span_id: str, name: OptionalNullable[str] = UNSET, start_time: OptionalNullable[datetime] = UNSET, - type_: OptionalNullable[str] = UNSET, + type: OptionalNullable[str] = UNSET, end_time: OptionalNullable[datetime] = UNSET, - input_: OptionalNullable[str] = UNSET, + input: OptionalNullable[str] = UNSET, output: OptionalNullable[str] = UNSET, error: OptionalNullable[str] = UNSET, meta: OptionalNullable[Dict[str, Any]] = UNSET, @@ -594,9 +594,9 @@ def update( update_span_request=models.UpdateSpanRequest( name=name, start_time=start_time, - type=type_, + type=type, end_time=end_time, - input=input_, + input=input, output=output, error=error, meta=meta, @@ -699,9 +699,9 @@ async def update_async( span_id: str, name: OptionalNullable[str] = UNSET, start_time: OptionalNullable[datetime] = UNSET, - type_: OptionalNullable[str] = UNSET, + type: OptionalNullable[str] = UNSET, end_time: OptionalNullable[datetime] = UNSET, - input_: OptionalNullable[str] = UNSET, + input: OptionalNullable[str] = UNSET, output: OptionalNullable[str] = UNSET, error: OptionalNullable[str] = UNSET, meta: OptionalNullable[Dict[str, Any]] = UNSET, @@ -745,9 +745,9 @@ async def update_async( update_span_request=models.UpdateSpanRequest( name=name, start_time=start_time, - type=type_, + type=type, end_time=end_time, - input=input_, + input=input, output=output, error=error, meta=meta, diff --git a/tests/mockserver/.gitignore b/tests/mockserver/.gitignore deleted file mode 100644 index 9544318..0000000 --- a/tests/mockserver/.gitignore +++ /dev/null @@ -1 +0,0 @@ -_debug diff --git a/tests/mockserver/Dockerfile b/tests/mockserver/Dockerfile deleted file mode 100644 index efdea18..0000000 --- a/tests/mockserver/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM golang:1.23 - -WORKDIR /usr/src/app - -COPY go.mod go.sum ./ -RUN go mod download && go mod verify -COPY . . -COPY *testdata /usr/local/bin/testdata -RUN go build -v -o /usr/local/bin/mockserver . -EXPOSE 18080 -ENTRYPOINT ["mockserver"] diff --git a/tests/mockserver/Makefile b/tests/mockserver/Makefile deleted file mode 100644 index 2ae6a36..0000000 --- a/tests/mockserver/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -.PHONY: start - -start: - @if command -v docker >/dev/null 2>&1; then \ - echo "Starting mock server with Docker..."; \ - docker build -t mockserver . && \ - docker run -i -p 18080:18080 -t --rm mockserver; \ - elif command -v go >/dev/null 2>&1; then \ - echo "Docker not found. Starting mock server with Go..."; \ - go run .; \ - else \ - echo "Neither Docker nor Go found. To run the mock server:"; \ - echo "\nOption 1 - Using Docker:"; \ - echo " docker build -t mockserver ."; \ - echo " docker run -i -p 18080:18080 -t --rm mockserver"; \ - echo "\nOption 2 - Using Go:"; \ - echo " go run ."; \ - fi diff --git a/tests/mockserver/README.md b/tests/mockserver/README.md deleted file mode 100644 index c8424fd..0000000 --- a/tests/mockserver/README.md +++ /dev/null @@ -1,52 +0,0 @@ -# Mock Server - -A generated HTTP mock server based on your OpenAPI Specification (OAS). Use this mock server for integration and contract testing. - -## Usage - -The server can be built and started via the [Go programming language toolchain](https://go.dev/) or [Docker](https://www.docker.com/). - -If you have Go installed, start the server directly via: - -```shell -go run . -``` - -Otherwise, if you have Docker installed, build and run the server via: - -```shell -docker build -t mockserver . -docker run -i -p 18080:18080 -t --rm mockserver -``` - -By default, the server runs on port `18080`. - -### Server Paths - -The server contains generated paths from the OAS and the following additional built-in paths. - -| Path | Description | -|---|---| -| [`/_mockserver/health`](https://localhost:18080/_mockserver/health) | verify server is running | -| [`/_mockserver/log`](https://localhost:18080/_mockserver/log) | view per-OAS-operation logs | - -Any request outside the generated and built-in paths will return a `404 Not Found` response. - -### Server Customization - -The server supports the following flags for customization. - -| Flag | Default | Description | -|---|---|---| -| `-address` | `:18080` | server listen address | -| `-log-format` | `text` | logging format (supported: `JSON`, `text`) | -| `-log-level` | `INFO` | logging level (supported: `DEBUG`, `INFO`, `WARN`, `ERROR`) | - -For example, enabling server debug logging: - -```shell -# via `go run` -go run . -log-level=DEBUG -# via `docker run` -docker run -i -p 18080:18080 -t --rm mockserver -log-level=DEBUG -``` diff --git a/tests/mockserver/go.mod b/tests/mockserver/go.mod deleted file mode 100644 index 38b2d5e..0000000 --- a/tests/mockserver/go.mod +++ /dev/null @@ -1,15 +0,0 @@ -module mockserver - -go 1.22 - -require ( - github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05 - github.com/go-pkgz/expirable-cache/v3 v3.0.0 - github.com/gorilla/mux v1.8.1 -) - -require ( - github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/stretchr/testify v1.9.0 // indirect -) diff --git a/tests/mockserver/go.sum b/tests/mockserver/go.sum deleted file mode 100644 index fa86a5f..0000000 --- a/tests/mockserver/go.sum +++ /dev/null @@ -1,16 +0,0 @@ -github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= -github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05 h1:S92OBrGuLLZsyM5ybUzgc/mPjIYk2AZqufieooe98uw= -github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05/go.mod h1:M9R1FoZ3y//hwwnJtO51ypFGwm8ZfpxPT/ZLtO1mcgQ= -github.com/go-pkgz/expirable-cache/v3 v3.0.0 h1:u3/gcu3sabLYiTCevoRKv+WzjIn5oo7P8XtiXBeRDLw= -github.com/go-pkgz/expirable-cache/v3 v3.0.0/go.mod h1:2OQiDyEGQalYecLWmXprm3maPXeVb5/6/X7yRPYTzec= -github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= -github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= -github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= -github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= -github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= -github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/tests/mockserver/internal/handler/assert/contenttype.go b/tests/mockserver/internal/handler/assert/contenttype.go deleted file mode 100644 index 42afbd0..0000000 --- a/tests/mockserver/internal/handler/assert/contenttype.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package assert - -import ( - "fmt" - "mime" - "net/http" - "strings" -) - -func ContentType(req *http.Request, expected string, isRequired bool) error { - got := req.Header.Get("Content-Type") - - if got == "" { - if isRequired { - return fmt.Errorf("expected Content-Type to be set, got: %s", got) - } - return nil - } - - mimeType, _, err := mime.ParseMediaType(got) - if err != nil { - return fmt.Errorf("got Content-Type %s is invalid: %w", got, err) - } - - expectedMimeType, _, err := mime.ParseMediaType(expected) - if err != nil { - return fmt.Errorf("expected Content-Type %s is invalid: %w", expected, err) - } - - if mimeType != expectedMimeType { - return fmt.Errorf( - "expected Content-Type to be %s, got: %s", - expected, - got, - ) - } - - return nil -} - -func AcceptHeader(req *http.Request, expectedValues []string) error { - if len(expectedValues) == 0 { - return nil - } - - gotAccept := req.Header.Get("Accept") - - gotValues := strings.Split(gotAccept, ",") - - for i, gotValue := range gotValues { - mimeType := strings.Split(strings.TrimSpace(gotValue), ";")[0] - - gotMimeType, _, err := mime.ParseMediaType(mimeType) - if err != nil { - return fmt.Errorf("got Accept value %s is invalid: %w", gotValue, err) - } - - gotValues[i] = gotMimeType - } - - allFound := true - - parsedExpectedValues := make([]string, len(expectedValues)) - - for i, expected := range expectedValues { - mimeType := strings.Split(expected, ";")[0] - - expectedMimeType, _, err := mime.ParseMediaType(mimeType) - if err != nil { - return fmt.Errorf("expected Accept value %s is invalid: %w", expected, err) - } - - parsedExpectedValues[i] = expectedMimeType - } - - for _, gotValue := range gotValues { - found := false - - for _, expected := range parsedExpectedValues { - if expected == gotValue { - found = true - break - } - } - - if !found { - allFound = false - break - } - } - - if !allFound { - return fmt.Errorf("expected Accept value to be one of %s, got: %s", strings.Join(parsedExpectedValues, ", "), gotAccept) - } - - return nil -} diff --git a/tests/mockserver/internal/handler/assert/header.go b/tests/mockserver/internal/handler/assert/header.go deleted file mode 100644 index 50f910d..0000000 --- a/tests/mockserver/internal/handler/assert/header.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package assert - -import ( - "fmt" - "net/http" -) - -// HeaderExists generically verifies the given request header name exists with -// a single, non-empty value. If an unexpected value is found, it will return an -// error with a diagnostic text body and which should cause the handler to return -// immediately. -func HeaderExists(req *http.Request, name string) error { - values := req.Header.Values(name) - - if len(values) == 0 { - return fmt.Errorf("missing expected header %s", name) - } - - if len(values) > 1 { - return fmt.Errorf("expected single header for %s, got %d values", name, len(values)) - } - - got := values[0] - - if got == "" { - return fmt.Errorf("expected non-empty header %s", name) - } - - return nil -} - -// HeaderValues generically verifies the given request header name has the -// expected values. If an unexpected value is found, it will return an error -// with a diagnostic text body and which should cause the handler to return -// immediately. -func HeaderValues(req *http.Request, name string, expected []string) error { - got := req.Header.Values(name) - - if len(got) == 0 { - return fmt.Errorf( - "missing expected header %s which should be %v", - name, - expected, - ) - } - - if len(got) != len(expected) { - return fmt.Errorf( - "expected header %s to be %v, got: %v", - name, - expected, - got, - ) - } - - for index, expectedValue := range expected { - if got[index] != expectedValue { - return fmt.Errorf( - "expected header %s to be %v, got: %v", - name, - expected, - got, - ) - } - } - - return nil -} diff --git a/tests/mockserver/internal/handler/assert/parameter.go b/tests/mockserver/internal/handler/assert/parameter.go deleted file mode 100644 index f8a5e45..0000000 --- a/tests/mockserver/internal/handler/assert/parameter.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package assert - -import ( - "fmt" - "net/http" - "net/url" -) - -// ParameterHeaderValues verifies the request header parameter key has the -// expected multiple values. If an unexpected value is found, it will return an -// error with a diagnostic text body and which should cause the handler to -// return immediately. -func ParameterHeaderValues(req *http.Request, key string, expected []string) error { - got := req.Header.Values(key) - - if len(got) == 0 { - return fmt.Errorf( - "missing expected header parameter %s which should be %v", - key, - expected, - ) - } - - if len(got) != len(expected) { - return fmt.Errorf( - "expected header parameter %s to be %s, got: %v", - key, - expected, - got, - ) - } - - for index, expectedValue := range expected { - if got[index] != expectedValue { - return fmt.Errorf( - "expected header parameter %s to be %v, got: %v", - key, - expected, - got, - ) - } - } - - return nil -} - -// ParameterPathValue verifies the request path parameter key has the expected -// value. If an unexpected value is found, it will return an error with -// a diagnostic text body and which should cause the handler to -// return immediately. -func ParameterPathValue(req *http.Request, key string, expected string) error { - got := req.PathValue(key) - - if got != expected { - return fmt.Errorf( - "expected path parameter %s to be %s, got: %s", - key, - expected, - got, - ) - } - - return nil -} - -// ParameterQueryValues verifies the request query parameter key has the -// expected multiple values. If an unexpected value is found, it will return an -// error with a diagnostic text body and which should cause the handler to -// return immediately. -func ParameterQueryValues(req *http.Request, key string, expected []string) error { - queryValues, err := url.ParseQuery(req.URL.RawQuery) - - if err != nil { - return fmt.Errorf("error parsing query parameters: %w", err) - } - - got, ok := queryValues[key] - - if !ok || len(got) == 0 { - return fmt.Errorf( - "missing expected query parameter %s which should be %v", - key, - expected, - ) - } - - if len(got) != len(expected) { - return fmt.Errorf( - "expected query parameter %s to be %s, got: %v", - key, - expected, - got, - ) - } - - for index, expectedValue := range expected { - if got[index] != expectedValue { - return fmt.Errorf( - "expected query parameter %s to be %v, got: %v", - key, - expected, - got, - ) - } - } - - return nil -} diff --git a/tests/mockserver/internal/handler/assert/pointer.go b/tests/mockserver/internal/handler/assert/pointer.go deleted file mode 100644 index fa03e4c..0000000 --- a/tests/mockserver/internal/handler/assert/pointer.go +++ /dev/null @@ -1,12 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package assert - -// Pointer returns a pointer to the given value. -// -// This is intended to simplify inline builtin value expressions that are not -// implemented in the Go language specification, such as a hypothetical -// &"example". -func Pointer[T any](v T) *T { - return &v -} diff --git a/tests/mockserver/internal/handler/assert/security.go b/tests/mockserver/internal/handler/assert/security.go deleted file mode 100644 index 7d0a714..0000000 --- a/tests/mockserver/internal/handler/assert/security.go +++ /dev/null @@ -1,75 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package assert - -import ( - "errors" - "fmt" - "net/http" - "strings" -) - -// SecurityAuthorizationHeader verifies the request security Authorization -// header is present and has the expected HTTP Authorization scheme with a value -// if required. If a missing value or multiple values are found, it will -// return an error with a diagnostic text body and which should cause the -// handler to return immediately. -func SecurityAuthorizationHeader(req *http.Request, optional bool, httpAuthorizationScheme string) error { - values := req.Header.Values("Authorization") - - if len(values) == 0 { - if optional { - return nil - } - - return errors.New("missing expected Authorization header") - } - - if len(values) > 1 { - return fmt.Errorf("expected single Authorization header, got %d values", len(values)) - } - - got := values[0] - - if got == "" { - // Should return error, even if optional, as that represents an errant - // client implementation. - return errors.New("expected non-empty Authorization header") - } - - if httpAuthorizationScheme != "" && !strings.HasPrefix(got, httpAuthorizationScheme+" ") { - return fmt.Errorf("expected HTTP Authorization scheme %s, got: %s", httpAuthorizationScheme, got) - } - - return nil -} - -// SecurityHeader verifies the request security header name is present and has -// a value if required. If a missing value or multiple values are found, it will -// return an error with a diagnostic text body and which should cause the -// handler to return immediately. -func SecurityHeader(req *http.Request, name string, optional bool) error { - values := req.Header.Values(name) - - if len(values) == 0 { - if optional { - return nil - } - - return fmt.Errorf("missing expected security header %s", name) - } - - if len(values) > 1 { - return fmt.Errorf("expected single security header for %s, got %d values", name, len(values)) - } - - got := values[0] - - if got == "" { - // Should return error, even if optional, as that represents an errant - // client implementation. - return fmt.Errorf("expected non-empty security header %s", name) - } - - return nil -} diff --git a/tests/mockserver/internal/handler/doc.go b/tests/mockserver/internal/handler/doc.go deleted file mode 100644 index a4e60c8..0000000 --- a/tests/mockserver/internal/handler/doc.go +++ /dev/null @@ -1,5 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -// Package handlers contains all generated HTTP handlers for the server. They -// are listed via the generated GeneratedHandlers() function. -package handler diff --git a/tests/mockserver/internal/handler/generated_handler.go b/tests/mockserver/internal/handler/generated_handler.go deleted file mode 100644 index 929558e..0000000 --- a/tests/mockserver/internal/handler/generated_handler.go +++ /dev/null @@ -1,35 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package handler - -import ( - "context" - "net/http" -) - -// GeneratedHandler is the type that encapsulates a generated handler. -type GeneratedHandler struct { - // HTTP request handler function. - handlerFunc http.HandlerFunc - - // HTTP method, such as GET. - Method string - - // URL path, such as /path. - Path string -} - -// NewGeneratedHandler creates a generated handler via method, path, and handler -// function. -func NewGeneratedHandler(ctx context.Context, method string, path string, handlerFunc http.HandlerFunc) *GeneratedHandler { - return &GeneratedHandler{ - handlerFunc: handlerFunc, - Method: method, - Path: path, - } -} - -// HandlerFunc returns the underlying HTTP handler function. -func (h GeneratedHandler) HandlerFunc() http.HandlerFunc { - return h.handlerFunc -} diff --git a/tests/mockserver/internal/handler/generated_handlers.go b/tests/mockserver/internal/handler/generated_handlers.go deleted file mode 100644 index 8339087..0000000 --- a/tests/mockserver/internal/handler/generated_handlers.go +++ /dev/null @@ -1,14 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package handler - -import ( - "context" - "mockserver/internal/logging" - "mockserver/internal/tracking" -) - -// GeneratedHandlers returns all generated handlers. -func GeneratedHandlers(ctx context.Context, dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) []*GeneratedHandler { - return []*GeneratedHandler{} -} diff --git a/tests/mockserver/internal/handler/values/files.go b/tests/mockserver/internal/handler/values/files.go deleted file mode 100644 index 6eca885..0000000 --- a/tests/mockserver/internal/handler/values/files.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package values - -import ( - "io" - "os" -) - -func ReadFileToStream(fileName string) io.Reader { - s, err := os.Open(fileName) - if err != nil { - panic(err) - } - return s -} - -func ReadFileToBytes(fileName string) []byte { - data, err := os.ReadFile(fileName) - if err != nil { - panic(err) - } - return data -} - -func ReadFileToString(fileName string) string { - data, err := os.ReadFile(fileName) - if err != nil { - panic(err) - } - return string(data) -} - -func ReadBytes(r io.Reader) []byte { - data, err := io.ReadAll(r) - if err != nil { - panic(err) - } - return data -} diff --git a/tests/mockserver/internal/logging/doc.go b/tests/mockserver/internal/logging/doc.go deleted file mode 100644 index 8835f1c..0000000 --- a/tests/mockserver/internal/logging/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -// Package logging contains the implementation and helpers for logging. -package logging diff --git a/tests/mockserver/internal/logging/formats.go b/tests/mockserver/internal/logging/formats.go deleted file mode 100644 index d6ab53c..0000000 --- a/tests/mockserver/internal/logging/formats.go +++ /dev/null @@ -1,38 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package logging - -import ( - "fmt" - "strings" -) - -const ( - // JSON log format. - FormatJSON = "JSON" - - // Plaintext log format. - FormatText = "text" - - // Default log format. - DefaultFormat = FormatText -) - -// Formats returns all supported formats. -func Formats() []string { - return []string{ - FormatJSON, - FormatText, - } -} - -func formatFromString(format string) (string, error) { - switch format { - case FormatJSON: - return format, nil - case FormatText: - return format, nil - default: - return "", fmt.Errorf("unsupported log format (%s), supported formats: %s", format, strings.Join(Formats(), ", ")) - } -} diff --git a/tests/mockserver/internal/logging/http_file.go b/tests/mockserver/internal/logging/http_file.go deleted file mode 100644 index d690d91..0000000 --- a/tests/mockserver/internal/logging/http_file.go +++ /dev/null @@ -1,310 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package logging - -import ( - "bufio" - "bytes" - "errors" - "fmt" - "io/fs" - "log" - "net/http" - "net/http/httptest" - "net/http/httputil" - "os" - "path/filepath" - "strconv" - "strings" - "sync" -) - -const ( - // DefaultHTTPFileDirectory is the default directory used for raw HTTP - // request and response files. - DefaultHTTPFileDirectory = "_debug" -) - -// HTTPFileDirectory is the directory where raw HTTP request and response files -// are written. -type HTTPFileDirectory struct { - // Filesystem at path. - filesystem fs.FS - - // Mapping of operations to call count. Used to sequentially increment file - // names and return current count. - operationCalls map[string]int64 - - // Mutex to protect operationCalls. - operationCallsMutex *sync.RWMutex - - // Absolute path to directory. - path string -} - -// NewHTTPFileDirectory will create a HTTPFileDirectory which exists and is a -// directory or will return an error. -func NewHTTPFileDirectory(explicitPath string) (*HTTPFileDirectory, error) { - path, err := filepath.Abs(DefaultHTTPFileDirectory) - if err != nil { - return nil, fmt.Errorf("error getting absolute path of HTTP file directory (%s): %w", DefaultHTTPFileDirectory, err) - } - - if explicitPath != "" { - absExplicitPath, err := filepath.Abs(explicitPath) - if err != nil { - return nil, fmt.Errorf("error getting absolute path of HTTP file directory (%s): %w", explicitPath, err) - } - - path = absExplicitPath - } - - result := &HTTPFileDirectory{ - filesystem: os.DirFS(path), - operationCalls: make(map[string]int64), - operationCallsMutex: new(sync.RWMutex), - path: path, - } - - fileInfo, err := os.Stat(path) - - if errors.Is(err, os.ErrNotExist) { - err := os.Mkdir(path, 0o2777) - if err != nil { - return nil, fmt.Errorf("error making HTTP file directory (%s): %w", path, err) - } - - return result, nil - } - - if err != nil { - return nil, fmt.Errorf("error reading HTTP file directory (%s): %w", path, err) - } - - if !fileInfo.IsDir() { - return nil, fmt.Errorf("error using HTTP file directory (%s): not a directory", path) - } - - return result, nil -} - -// Clean will remove all files from HTTPFileDirectory. -func (d *HTTPFileDirectory) Clean() error { - walkDirFunc := func(path string, entry fs.DirEntry, err error) error { - if err != nil { - return fmt.Errorf("error walking %s: %w", d.path, err) - } - - if path == "." { - return nil - } - - if entry.IsDir() { - return fs.SkipDir - } - - absPath := filepath.Join(d.path, path) - - err = os.Remove(absPath) - if err != nil { - return fmt.Errorf("error removing %s: %w", absPath, err) - } - - return nil - } - - return fs.WalkDir(d.filesystem, ".", walkDirFunc) -} - -// HandlerFunc is a HTTP handler that automatically writes the raw HTTP -// request and response to {path}/{operationId}_{call}_request and -// {path}/{operationId}_{call}_response files respectively. -func (d *HTTPFileDirectory) HandlerFunc(operationId string, next http.HandlerFunc) http.HandlerFunc { - return func(w http.ResponseWriter, req *http.Request) { - call := d.nextOperationCall(operationId) - - dump, err := httputil.DumpRequest(req, true) - if err != nil { - log.Printf("error dumping HTTP request: %s", err) - } - - if len(dump) > 0 { - requestPath := filepath.Join(d.path, d.operationCallRequestFilename(operationId, call)) - - err = os.WriteFile(requestPath, dump, 0o644) - if err != nil { - log.Printf("error writing HTTP request file (%s): %s", requestPath, err) - } - } - - recorder := httptest.NewRecorder() - - next(recorder, req) - - dump, err = httputil.DumpResponse(recorder.Result(), true) - if err != nil { - log.Printf("error dumping HTTP response: %s", err) - } - - if len(dump) > 0 { - responsePath := filepath.Join(d.path, d.operationCallResponseFilename(operationId, call)) - err = os.WriteFile(responsePath, dump, 0o644) - if err != nil { - log.Printf("error writing HTTP response file (%s): %s", responsePath, err) - } - } - - recorderToWriter(recorder, w) - } -} - -// Operation will return a new OASOperation from HTTPFileDirectory. -func (d *HTTPFileDirectory) Operation(operationId string) (*OASOperation, error) { - request, err := d.Request(operationId, 1) - if err != nil { - return nil, err - } - - result := NewOASOperation(d, operationId, request.Method, request.URL.Path) - - return result, nil -} - -// Operations will return all detected OASOperation from HTTPFileDirectory. -func (d *HTTPFileDirectory) Operations() ([]*OASOperation, error) { - var result []*OASOperation - - walkDirFunc := func(path string, entry fs.DirEntry, err error) error { - if err != nil { - return fmt.Errorf("error walking %s: %w", d.path, err) - } - - if !strings.HasSuffix(path, "_1_request") { - return nil - } - - operationId := strings.TrimSuffix(path, "_1_request") - operation, err := d.Operation(operationId) - if err != nil { - return err - } - - result = append(result, operation) - - return nil - } - - err := fs.WalkDir(d.filesystem, ".", walkDirFunc) - - return result, err -} - -// OperationCallCount will return the number of detected calls for an -// OASOperation. -func (d *HTTPFileDirectory) OperationCallCount(operationId string) int64 { - d.operationCallsMutex.RLock() - defer d.operationCallsMutex.RUnlock() - - result, ok := d.operationCalls[operationId] - - if ok { - return result - } - - return 0 -} - -// RawRequest returns the raw HTTP request contents as dumped by -// [httputil.DumpRequest]. -func (d *HTTPFileDirectory) RawRequest(operationId string, call int64) ([]byte, error) { - filename := d.operationCallRequestFilename(operationId, call) - file, err := fs.ReadFile(d.filesystem, filename) - if err != nil { - return nil, fmt.Errorf("error reading HTTP request file (%s): %w", filename, err) - } - - return file, nil -} - -// RawResponse returns the raw HTTP response contents as dumped by -// [httputil.DumpResponse]. -func (d *HTTPFileDirectory) RawResponse(operationId string, call int64) ([]byte, error) { - filename := d.operationCallResponseFilename(operationId, call) - file, err := fs.ReadFile(d.filesystem, d.operationCallResponseFilename(operationId, call)) - if err != nil { - return nil, fmt.Errorf("error reading HTTP response file (%s): %w", filename, err) - } - - return file, nil -} - -// Request returns the parsed HTTP request contents. -func (d *HTTPFileDirectory) Request(operationId string, call int64) (*http.Request, error) { - rawRequest, err := d.RawRequest(operationId, call) - if err != nil { - return nil, err - } - - result, err := http.ReadRequest(bufio.NewReader(bytes.NewReader(rawRequest))) - if err != nil { - return nil, fmt.Errorf("error converting HTTP request for operation %s call %d: %w", operationId, call, err) - } - - return result, nil -} - -// Response returns the parsed HTTP response contents. -func (d *HTTPFileDirectory) Response(operationId string, call int64) (*http.Response, error) { - rawResponse, err := d.RawResponse(operationId, call) - if err != nil { - return nil, err - } - - result, err := http.ReadResponse(bufio.NewReader(bytes.NewReader(rawResponse)), nil) - if err != nil { - return nil, fmt.Errorf("error converting HTTP response for operation %s call %d: %w", operationId, call, err) - } - - return result, nil -} - -// nextOperationCall returns the incremented call number for an operation. -func (d *HTTPFileDirectory) nextOperationCall(operationId string) int64 { - d.operationCallsMutex.Lock() - defer d.operationCallsMutex.Unlock() - - var result int64 - - priorCalls, ok := d.operationCalls[operationId] - - if ok { - result = priorCalls + 1 - } else { - // Start call counts at 1 for human consumption. - result = 1 - } - - d.operationCalls[operationId] = result - - return result -} - -// operationCallRequestFilename returns the raw HTTP request file name for the -// given operation and call. -func (d *HTTPFileDirectory) operationCallRequestFilename(operationId string, call int64) string { - return sanitizeOperationIdForFilename(operationId) + "_" + strconv.FormatInt(call, 10) + "_request" -} - -// operationCallResponseFilename returns the raw HTTP response file name for the -// given operation and call. -func (d *HTTPFileDirectory) operationCallResponseFilename(operationId string, call int64) string { - return sanitizeOperationIdForFilename(operationId) + "_" + strconv.FormatInt(call, 10) + "_response" -} - -func sanitizeOperationIdForFilename(operationId string) string { - operationId = strings.ReplaceAll(operationId, "{", "_") - operationId = strings.ReplaceAll(operationId, "}", "_") - operationId = strings.ReplaceAll(operationId, "/", "_") - operationId = strings.ReplaceAll(operationId, " ", "_") - return operationId -} diff --git a/tests/mockserver/internal/logging/http_logger.go b/tests/mockserver/internal/logging/http_logger.go deleted file mode 100644 index fdd5d05..0000000 --- a/tests/mockserver/internal/logging/http_logger.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package logging - -import ( - "context" - "fmt" - "log/slog" - "net/http" - "net/http/httptest" - "net/http/httputil" -) - -// HTTPLoggerHandler wraps another [http.Handler] with logging output using the -// provided logger. -func HTTPLoggerHandler(logger *slog.Logger, next http.Handler) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { - httpLogger := logger.WithGroup("http") - recorder := httptest.NewRecorder() - reqAttr := slog.Group( - "request", - slog.String("method", req.Method), - slog.String("url", req.URL.RequestURI()), - ) - - if !logger.Enabled(context.Background(), slog.LevelDebug) { - httpLogger.With(reqAttr).Info("received request") - next.ServeHTTP(recorder, req) - - resp := recorder.Result() - respAttr := slog.Group( - "response", - slog.String("status", resp.Status), - ) - - httpLogger.With(reqAttr).With(respAttr).Info("serving response") - - recorderToWriter(recorder, w) - - return - } - - dump, err := httputil.DumpRequest(req, true) - - if err != nil { - http.Error(w, fmt.Sprint(err), http.StatusInternalServerError) - - return - } - - rawReqAttr := slog.Group( - "request", - slog.String("method", req.Method), - slog.String("url", req.URL.RequestURI()), - slog.String("raw", string(dump)), - ) - - httpLogger.With(rawReqAttr).Debug("received request") - - next.ServeHTTP(recorder, req) - - dump, err = httputil.DumpResponse(recorder.Result(), true) - - if err != nil { - http.Error(w, fmt.Sprint(err), http.StatusInternalServerError) - - return - } - - rawRespAttr := slog.Group( - "response", - slog.String("raw", string(dump)), - ) - - // Intentionally use simpler request log attributes - httpLogger.With(reqAttr).With(rawRespAttr).Debug("serving response") - - recorderToWriter(recorder, w) - }) -} - -// recorderToWriter copies the recorded response back to the writer. -func recorderToWriter(recorder *httptest.ResponseRecorder, w http.ResponseWriter) { - for k, v := range recorder.Result().Header { - w.Header()[k] = v - } - - w.WriteHeader(recorder.Code) - _, _ = recorder.Body.WriteTo(w) -} diff --git a/tests/mockserver/internal/logging/levels.go b/tests/mockserver/internal/logging/levels.go deleted file mode 100644 index d2a8e93..0000000 --- a/tests/mockserver/internal/logging/levels.go +++ /dev/null @@ -1,55 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package logging - -import ( - "fmt" - "log/slog" - "strings" -) - -const ( - // Debug log level. - LevelDebug = "DEBUG" - - // Info log level. - LevelInfo = "INFO" - - // Warning log level. - LevelWarn = "WARN" - - // Error log level. - LevelError = "ERROR" - - // Default log level. - DefaultLevel = LevelInfo -) - -// Levels returns all supported levels. -func Levels() []string { - return []string{ - LevelDebug, - LevelInfo, - LevelWarn, - LevelError, - } -} - -func levelFromString(level string) (*slog.LevelVar, error) { - result := new(slog.LevelVar) - - switch strings.ToUpper(level) { - case "DEBUG": - result.Set(slog.LevelDebug) - case "INFO": - result.Set(slog.LevelInfo) - case "WARN": - result.Set(slog.LevelWarn) - case "ERROR": - result.Set(slog.LevelError) - default: - return nil, fmt.Errorf("unsupported log level (%s), supported levels: %s", level, strings.Join(Levels(), ", ")) - } - - return result, nil -} diff --git a/tests/mockserver/internal/logging/logger.go b/tests/mockserver/internal/logging/logger.go deleted file mode 100644 index bfd6dc7..0000000 --- a/tests/mockserver/internal/logging/logger.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package logging - -import ( - "fmt" - "io" - "log/slog" -) - -func NewLogger(w io.Writer, formatStr string, levelStr string) (*slog.Logger, error) { - level, err := levelFromString(levelStr) - - if err != nil { - return nil, err - } - - format, err := formatFromString(formatStr) - - if err != nil { - return nil, err - } - - handlerOpts := &slog.HandlerOptions{ - Level: level, - } - - var handler slog.Handler - - switch format { - case FormatJSON: - handler = slog.NewJSONHandler(w, handlerOpts) - case FormatText: - handler = slog.NewTextHandler(w, handlerOpts) - default: - return nil, fmt.Errorf("unimplemented format: %s", format) - } - - return slog.New(handler), nil -} diff --git a/tests/mockserver/internal/logging/oas_operation.go b/tests/mockserver/internal/logging/oas_operation.go deleted file mode 100644 index d4f2af7..0000000 --- a/tests/mockserver/internal/logging/oas_operation.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package logging - -import "net/http" - -// OASOperation contains a singular OAS operation. An operation can have one or -// more calls. -type OASOperation struct { - // Underlying HTTP calls for the operation. - calls []*OASOperationCall - - // Directory that contains HTTP request and response logs. - dir *HTTPFileDirectory - - // Operation identifier as defined in OAS. - id string - - // HTTP method for the operation, such as GET. - method string - - // URL path for the operation, such as /path. - path string - - // TODO: Add group -} - -// NewOASOperation creates a new OASOperation. -func NewOASOperation(dir *HTTPFileDirectory, operationId string, method string, path string) *OASOperation { - operationCalls := dir.OperationCallCount(operationId) - result := &OASOperation{ - calls: make([]*OASOperationCall, 0, operationCalls), - dir: dir, - id: operationId, - method: method, - path: path, - } - - for i := range operationCalls { - // Start at 1 for human consumption. - result.calls = append(result.calls, NewOASOperationCall(result, i+1)) - } - - return result -} - -// CallCount returns the number of calls to an operation. -func (o *OASOperation) CallCount() int64 { - return int64(len(o.calls)) -} - -// Id returns the operation identifier as defined in OAS. -func (o *OASOperation) Id() string { - return o.id -} - -// Method returns the HTTP method for the operation, such as GET. -func (o *OASOperation) Method() string { - return o.method -} - -// Path returns the URL path for the operation, such as /path. -func (o *OASOperation) Path() string { - return o.path -} - -// RawRequest returns the raw HTTP request contents as dumped by -// [httputil.DumpRequest]. -func (o *OASOperation) RawRequest(call int64) ([]byte, error) { - return o.dir.RawRequest(o.id, call) -} - -// RawResponse returns the raw HTTP response contents as dumped by -// [httputil.DumpResponse]. -func (o *OASOperation) RawResponse(call int64) ([]byte, error) { - return o.dir.RawResponse(o.id, call) -} - -// Request returns the parsed HTTP request contents. -func (o *OASOperation) Request(call int64) (*http.Request, error) { - return o.dir.Request(o.id, call) -} - -// Response returns the parsed HTTP response contents. -func (o *OASOperation) Response(call int64) (*http.Response, error) { - return o.dir.Response(o.id, call) -} diff --git a/tests/mockserver/internal/logging/oas_operation_call.go b/tests/mockserver/internal/logging/oas_operation_call.go deleted file mode 100644 index beb0590..0000000 --- a/tests/mockserver/internal/logging/oas_operation_call.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package logging - -import ( - "bufio" - "bytes" - "net/http" -) - -// OASOperationCall contains a singular OAS operation HTTP call. -type OASOperationCall struct { - // The HTTP call number, as determined by the HTTP server. Starts at 1 and - // incremented. - call int64 - - // The associated OAS operation to this call. - operation *OASOperation - - // Parsed HTTP request contents. Cached on first use. - request *http.Request - - // Raw HTTP request contents. Cached on first use. - requestRaw []byte - - // Parsed HTTP response contents. Cached on first use. - response *http.Response - - // Raw HTTP response contents. Cached on first use. - responseRaw []byte - - // TODO: Add test identifier -} - -// NewOASOperationCall creates a new OASOperationCall. -func NewOASOperationCall(operation *OASOperation, call int64) *OASOperationCall { - return &OASOperationCall{ - call: call, - operation: operation, - } -} - -// RawRequest returns the raw HTTP request contents as dumped by -// [httputil.DumpRequest]. -func (c *OASOperationCall) RawRequest() ([]byte, error) { - if c.requestRaw != nil { - return c.requestRaw, nil - } - - requestRaw, err := c.operation.RawRequest(c.call) - - if err != nil { - return nil, err - } - - c.requestRaw = requestRaw - - return c.requestRaw, nil -} - -// RawResponse returns the raw HTTP response contents as dumped by -// [httputil.DumpResponse]. -func (c *OASOperationCall) RawResponse() ([]byte, error) { - if c.responseRaw != nil { - return c.responseRaw, nil - } - - responseRaw, err := c.operation.RawResponse(c.call) - - if err != nil { - return nil, err - } - - c.responseRaw = responseRaw - - return c.responseRaw, nil -} - -// Request returns the parsed HTTP request contents. -func (c *OASOperationCall) Request() (*http.Request, error) { - if c.request != nil { - return c.request, nil - } - - requestRaw, err := c.RawRequest() - - if err != nil { - return nil, err - } - - request, err := http.ReadRequest(bufio.NewReader(bytes.NewReader(requestRaw))) - - if err != nil { - return nil, err - } - - c.request = request - - return c.request, nil -} - -// Response returns the parsed HTTP response contents. -func (c *OASOperationCall) Response() (*http.Response, error) { - if c.response != nil { - return c.response, nil - } - - responseRaw, err := c.RawResponse() - - if err != nil { - return nil, err - } - - response, err := http.ReadResponse(bufio.NewReader(bytes.NewReader(responseRaw)), nil) - - if err != nil { - return nil, err - } - - c.response = response - - return c.response, nil -} diff --git a/tests/mockserver/internal/sdk/models/components/addrequest.go b/tests/mockserver/internal/sdk/models/components/addrequest.go deleted file mode 100644 index 3215a89..0000000 --- a/tests/mockserver/internal/sdk/models/components/addrequest.go +++ /dev/null @@ -1,41 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type AddRequest struct { - // The key of the document - Key *string `json:"key,omitempty"` - Content string `json:"content"` - // The metadata of the document - Metadata map[string]any `json:"metadata,omitempty"` - // The configuration for the document - Configuration *TextProcessingConfiguration `json:"configuration,omitempty"` -} - -func (o *AddRequest) GetKey() *string { - if o == nil { - return nil - } - return o.Key -} - -func (o *AddRequest) GetContent() string { - if o == nil { - return "" - } - return o.Content -} - -func (o *AddRequest) GetMetadata() map[string]any { - if o == nil { - return nil - } - return o.Metadata -} - -func (o *AddRequest) GetConfiguration() *TextProcessingConfiguration { - if o == nil { - return nil - } - return o.Configuration -} diff --git a/tests/mockserver/internal/sdk/models/components/annotation.go b/tests/mockserver/internal/sdk/models/components/annotation.go deleted file mode 100644 index 9fc4cf9..0000000 --- a/tests/mockserver/internal/sdk/models/components/annotation.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" -) - -type Annotation struct { - type_ string `const:"url_citation" json:"type"` - URLCitation AnnotationURLCitation `json:"url_citation"` - AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` -} - -func (a Annotation) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *Annotation) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *Annotation) GetType() string { - return "url_citation" -} - -func (o *Annotation) GetURLCitation() AnnotationURLCitation { - if o == nil { - return AnnotationURLCitation{} - } - return o.URLCitation -} - -func (o *Annotation) GetAdditionalProperties() map[string]any { - if o == nil { - return nil - } - return o.AdditionalProperties -} diff --git a/tests/mockserver/internal/sdk/models/components/annotationurlcitation.go b/tests/mockserver/internal/sdk/models/components/annotationurlcitation.go deleted file mode 100644 index 4116121..0000000 --- a/tests/mockserver/internal/sdk/models/components/annotationurlcitation.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" -) - -type AnnotationURLCitation struct { - EndIndex int64 `json:"end_index"` - StartIndex int64 `json:"start_index"` - Title string `json:"title"` - URL string `json:"url"` - AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` -} - -func (a AnnotationURLCitation) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AnnotationURLCitation) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AnnotationURLCitation) GetEndIndex() int64 { - if o == nil { - return 0 - } - return o.EndIndex -} - -func (o *AnnotationURLCitation) GetStartIndex() int64 { - if o == nil { - return 0 - } - return o.StartIndex -} - -func (o *AnnotationURLCitation) GetTitle() string { - if o == nil { - return "" - } - return o.Title -} - -func (o *AnnotationURLCitation) GetURL() string { - if o == nil { - return "" - } - return o.URL -} - -func (o *AnnotationURLCitation) GetAdditionalProperties() map[string]any { - if o == nil { - return nil - } - return o.AdditionalProperties -} diff --git a/tests/mockserver/internal/sdk/models/components/appapipublicv2functioncallcallfunctionrequest.go b/tests/mockserver/internal/sdk/models/components/appapipublicv2functioncallcallfunctionrequest.go deleted file mode 100644 index af8af27..0000000 --- a/tests/mockserver/internal/sdk/models/components/appapipublicv2functioncallcallfunctionrequest.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type AppAPIPublicV2FunctionCallCallFunctionRequest struct { - // Provide a unique name of the task. A function with this name will be created in the project. Functions configuration is overridden by the request parameters. - Name string `json:"name"` - // Optionally provide an instruction for the model to complete the task. Recommended to be concise and to the point - Instructions *string `json:"instructions,omitempty"` - // Optionally provide an input schema for the task. Can preferably include field descriptions to allow the model to reason about the input variables. Schema is validated against the input data and issues an error if it does not match. With the Opper SDKs you can define these schemas through libraries like Pydantic and Zod. For schemas with definitions, prefer using '$defs' and '#/$defs/...' references. - InputSchema map[string]any `json:"input_schema,omitempty"` - // Optionally provide an output schema for the task. Response is guaranteed to match the schema or throw an error. Can preferably include field descriptions to allow the model to reason about the output variables. With the Opper SDKs you can define these schemas through libraries like Pydantic and Zod. For schemas with definitions, prefer using '$defs' and '#/$defs/...' references. - OutputSchema map[string]any `json:"output_schema,omitempty"` - // Optionally provide input data as context to complete the task. Could be a text, image, audio or a combination of these. - Input any `json:"input,omitempty"` - Model *TModel `json:"model,omitempty"` - // Optionally provide examples of successful task completions. Will be added to the prompt to help the model understand the task from examples. - Examples []Example `json:"examples,omitempty"` - // Optionally provide the parent span ID to add to the call event. This will automatically tie the call to a parent span in the UI. - ParentSpanID *string `json:"parent_span_id,omitempty"` - // Optionally provide a list of tags to add to the call event. Useful for being able to understand aggregate analytics on some dimension. - Tags map[string]string `json:"tags,omitempty"` - // Optional configuration for the function.Configuration is a dictionary of key-value pairs that can be used to override the default configuration for the function. - Configuration *FunctionCallConfiguration `json:"configuration,omitempty"` -} - -func (o *AppAPIPublicV2FunctionCallCallFunctionRequest) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *AppAPIPublicV2FunctionCallCallFunctionRequest) GetInstructions() *string { - if o == nil { - return nil - } - return o.Instructions -} - -func (o *AppAPIPublicV2FunctionCallCallFunctionRequest) GetInputSchema() map[string]any { - if o == nil { - return nil - } - return o.InputSchema -} - -func (o *AppAPIPublicV2FunctionCallCallFunctionRequest) GetOutputSchema() map[string]any { - if o == nil { - return nil - } - return o.OutputSchema -} - -func (o *AppAPIPublicV2FunctionCallCallFunctionRequest) GetInput() any { - if o == nil { - return nil - } - return o.Input -} - -func (o *AppAPIPublicV2FunctionCallCallFunctionRequest) GetModel() *TModel { - if o == nil { - return nil - } - return o.Model -} - -func (o *AppAPIPublicV2FunctionCallCallFunctionRequest) GetExamples() []Example { - if o == nil { - return nil - } - return o.Examples -} - -func (o *AppAPIPublicV2FunctionCallCallFunctionRequest) GetParentSpanID() *string { - if o == nil { - return nil - } - return o.ParentSpanID -} - -func (o *AppAPIPublicV2FunctionCallCallFunctionRequest) GetTags() map[string]string { - if o == nil { - return nil - } - return o.Tags -} - -func (o *AppAPIPublicV2FunctionCallCallFunctionRequest) GetConfiguration() *FunctionCallConfiguration { - if o == nil { - return nil - } - return o.Configuration -} diff --git a/tests/mockserver/internal/sdk/models/components/appapipublicv2functioncallcallfunctionresponse.go b/tests/mockserver/internal/sdk/models/components/appapipublicv2functioncallcallfunctionresponse.go deleted file mode 100644 index 92e7d89..0000000 --- a/tests/mockserver/internal/sdk/models/components/appapipublicv2functioncallcallfunctionresponse.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "errors" - "fmt" - "mockserver/internal/sdk/utils" -) - -type JSONPayloadType string - -const ( - JSONPayloadTypeMapOfAny JSONPayloadType = "mapOfAny" - JSONPayloadTypeArrayOfAny JSONPayloadType = "arrayOfAny" - JSONPayloadTypeAny JSONPayloadType = "any" -) - -// JSONPayload - Result of the task if the call uses an output schema -type JSONPayload struct { - MapOfAny map[string]any `queryParam:"inline"` - ArrayOfAny []any `queryParam:"inline"` - Any any `queryParam:"inline"` - - Type JSONPayloadType -} - -func CreateJSONPayloadMapOfAny(mapOfAny map[string]any) JSONPayload { - typ := JSONPayloadTypeMapOfAny - - return JSONPayload{ - MapOfAny: mapOfAny, - Type: typ, - } -} - -func CreateJSONPayloadArrayOfAny(arrayOfAny []any) JSONPayload { - typ := JSONPayloadTypeArrayOfAny - - return JSONPayload{ - ArrayOfAny: arrayOfAny, - Type: typ, - } -} - -func CreateJSONPayloadAny(anyT any) JSONPayload { - typ := JSONPayloadTypeAny - - return JSONPayload{ - Any: anyT, - Type: typ, - } -} - -func (u *JSONPayload) UnmarshalJSON(data []byte) error { - - var mapOfAny map[string]any = map[string]any{} - if err := utils.UnmarshalJSON(data, &mapOfAny, "", true, true); err == nil { - u.MapOfAny = mapOfAny - u.Type = JSONPayloadTypeMapOfAny - return nil - } - - var arrayOfAny []any = []any{} - if err := utils.UnmarshalJSON(data, &arrayOfAny, "", true, true); err == nil { - u.ArrayOfAny = arrayOfAny - u.Type = JSONPayloadTypeArrayOfAny - return nil - } - - var anyVar any = nil - if err := utils.UnmarshalJSON(data, &anyVar, "", true, true); err == nil { - u.Any = anyVar - u.Type = JSONPayloadTypeAny - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for JSONPayload", string(data)) -} - -func (u JSONPayload) MarshalJSON() ([]byte, error) { - if u.MapOfAny != nil { - return utils.MarshalJSON(u.MapOfAny, "", true) - } - - if u.ArrayOfAny != nil { - return utils.MarshalJSON(u.ArrayOfAny, "", true) - } - - if u.Any != nil { - return utils.MarshalJSON(u.Any, "", true) - } - - return nil, errors.New("could not marshal union type JSONPayload: all fields are null") -} - -type AppAPIPublicV2FunctionCallCallFunctionResponse struct { - // The ID of the span of the call - SpanID string `json:"span_id"` - // Result of the task if the call does not use an output schema - Message *string `json:"message,omitempty"` - // Result of the task if the call uses an output schema - JSONPayload *JSONPayload `json:"json_payload,omitempty"` - Audio map[string]any `json:"audio,omitempty"` - // True if the result was returned from a cached results - Cached *bool `json:"cached,omitempty"` - // The images generated by the call. Only available for image models. Depending on the configuration, the response can either be a list of image urls or a base64 encoded images. - Images []string `json:"images,omitempty"` -} - -func (o *AppAPIPublicV2FunctionCallCallFunctionResponse) GetSpanID() string { - if o == nil { - return "" - } - return o.SpanID -} - -func (o *AppAPIPublicV2FunctionCallCallFunctionResponse) GetMessage() *string { - if o == nil { - return nil - } - return o.Message -} - -func (o *AppAPIPublicV2FunctionCallCallFunctionResponse) GetJSONPayload() *JSONPayload { - if o == nil { - return nil - } - return o.JSONPayload -} - -func (o *AppAPIPublicV2FunctionCallCallFunctionResponse) GetAudio() map[string]any { - if o == nil { - return nil - } - return o.Audio -} - -func (o *AppAPIPublicV2FunctionCallCallFunctionResponse) GetCached() *bool { - if o == nil { - return nil - } - return o.Cached -} - -func (o *AppAPIPublicV2FunctionCallCallFunctionResponse) GetImages() []string { - if o == nil { - return nil - } - return o.Images -} diff --git a/tests/mockserver/internal/sdk/models/components/appapipublicv2functionscallfunctionrequest.go b/tests/mockserver/internal/sdk/models/components/appapipublicv2functionscallfunctionrequest.go deleted file mode 100644 index 1955852..0000000 --- a/tests/mockserver/internal/sdk/models/components/appapipublicv2functionscallfunctionrequest.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type AppAPIPublicV2FunctionsCallFunctionRequest struct { - // Input to the function - Input any `json:"input,omitempty"` - ParentSpanID *string `json:"parent_span_id,omitempty"` - Examples []ExampleIn `json:"examples,omitempty"` - // Tags to add to the call event - Tags map[string]string `json:"tags,omitempty"` -} - -func (o *AppAPIPublicV2FunctionsCallFunctionRequest) GetInput() any { - if o == nil { - return nil - } - return o.Input -} - -func (o *AppAPIPublicV2FunctionsCallFunctionRequest) GetParentSpanID() *string { - if o == nil { - return nil - } - return o.ParentSpanID -} - -func (o *AppAPIPublicV2FunctionsCallFunctionRequest) GetExamples() []ExampleIn { - if o == nil { - return nil - } - return o.Examples -} - -func (o *AppAPIPublicV2FunctionsCallFunctionRequest) GetTags() map[string]string { - if o == nil { - return nil - } - return o.Tags -} diff --git a/tests/mockserver/internal/sdk/models/components/appapipublicv2functionscallfunctionresponse.go b/tests/mockserver/internal/sdk/models/components/appapipublicv2functionscallfunctionresponse.go deleted file mode 100644 index 6eaefbf..0000000 --- a/tests/mockserver/internal/sdk/models/components/appapipublicv2functionscallfunctionresponse.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" -) - -type AppAPIPublicV2FunctionsCallFunctionResponse struct { - SpanID *string `json:"span_id,omitempty"` - Message *string `json:"message,omitempty"` - JSONPayload any `json:"json_payload,omitempty"` - Audio map[string]any `json:"audio,omitempty"` - Cached *bool `default:"false" json:"cached"` -} - -func (a AppAPIPublicV2FunctionsCallFunctionResponse) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AppAPIPublicV2FunctionsCallFunctionResponse) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AppAPIPublicV2FunctionsCallFunctionResponse) GetSpanID() *string { - if o == nil { - return nil - } - return o.SpanID -} - -func (o *AppAPIPublicV2FunctionsCallFunctionResponse) GetMessage() *string { - if o == nil { - return nil - } - return o.Message -} - -func (o *AppAPIPublicV2FunctionsCallFunctionResponse) GetJSONPayload() any { - if o == nil { - return nil - } - return o.JSONPayload -} - -func (o *AppAPIPublicV2FunctionsCallFunctionResponse) GetAudio() map[string]any { - if o == nil { - return nil - } - return o.Audio -} - -func (o *AppAPIPublicV2FunctionsCallFunctionResponse) GetCached() *bool { - if o == nil { - return nil - } - return o.Cached -} diff --git a/tests/mockserver/internal/sdk/models/components/audio.go b/tests/mockserver/internal/sdk/models/components/audio.go deleted file mode 100644 index 4b796bf..0000000 --- a/tests/mockserver/internal/sdk/models/components/audio.go +++ /dev/null @@ -1,14 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type Audio struct { - ID string `json:"id"` -} - -func (o *Audio) GetID() string { - if o == nil { - return "" - } - return o.ID -} diff --git a/tests/mockserver/internal/sdk/models/components/chatcompletion.go b/tests/mockserver/internal/sdk/models/components/chatcompletion.go deleted file mode 100644 index 363edc7..0000000 --- a/tests/mockserver/internal/sdk/models/components/chatcompletion.go +++ /dev/null @@ -1,121 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" -) - -type ChatCompletionServiceTier string - -const ( - ChatCompletionServiceTierAuto ChatCompletionServiceTier = "auto" - ChatCompletionServiceTierDefault ChatCompletionServiceTier = "default" - ChatCompletionServiceTierFlex ChatCompletionServiceTier = "flex" -) - -func (e ChatCompletionServiceTier) ToPointer() *ChatCompletionServiceTier { - return &e -} -func (e *ChatCompletionServiceTier) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "auto": - fallthrough - case "default": - fallthrough - case "flex": - *e = ChatCompletionServiceTier(v) - return nil - default: - return fmt.Errorf("invalid value for ChatCompletionServiceTier: %v", v) - } -} - -type ChatCompletion struct { - ID string `json:"id"` - Choices []Choice `json:"choices"` - Created int64 `json:"created"` - Model string `json:"model"` - object string `const:"chat.completion" json:"object"` - ServiceTier *ChatCompletionServiceTier `json:"service_tier,omitempty"` - SystemFingerprint *string `json:"system_fingerprint,omitempty"` - Usage *CompletionUsage `json:"usage,omitempty"` - AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` -} - -func (c ChatCompletion) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *ChatCompletion) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *ChatCompletion) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *ChatCompletion) GetChoices() []Choice { - if o == nil { - return []Choice{} - } - return o.Choices -} - -func (o *ChatCompletion) GetCreated() int64 { - if o == nil { - return 0 - } - return o.Created -} - -func (o *ChatCompletion) GetModel() string { - if o == nil { - return "" - } - return o.Model -} - -func (o *ChatCompletion) GetObject() string { - return "chat.completion" -} - -func (o *ChatCompletion) GetServiceTier() *ChatCompletionServiceTier { - if o == nil { - return nil - } - return o.ServiceTier -} - -func (o *ChatCompletion) GetSystemFingerprint() *string { - if o == nil { - return nil - } - return o.SystemFingerprint -} - -func (o *ChatCompletion) GetUsage() *CompletionUsage { - if o == nil { - return nil - } - return o.Usage -} - -func (o *ChatCompletion) GetAdditionalProperties() map[string]any { - if o == nil { - return nil - } - return o.AdditionalProperties -} diff --git a/tests/mockserver/internal/sdk/models/components/chatcompletionassistantmessageparam.go b/tests/mockserver/internal/sdk/models/components/chatcompletionassistantmessageparam.go deleted file mode 100644 index 854da5a..0000000 --- a/tests/mockserver/internal/sdk/models/components/chatcompletionassistantmessageparam.go +++ /dev/null @@ -1,202 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "errors" - "fmt" - "mockserver/internal/sdk/utils" -) - -type ChatCompletionAssistantMessageParamContent1Type string - -const ( - ChatCompletionAssistantMessageParamContent1TypeChatCompletionContentPartTextParam ChatCompletionAssistantMessageParamContent1Type = "ChatCompletionContentPartTextParam" - ChatCompletionAssistantMessageParamContent1TypeChatCompletionContentPartRefusalParam ChatCompletionAssistantMessageParamContent1Type = "ChatCompletionContentPartRefusalParam" -) - -type ChatCompletionAssistantMessageParamContent1 struct { - ChatCompletionContentPartTextParam *ChatCompletionContentPartTextParam `queryParam:"inline"` - ChatCompletionContentPartRefusalParam *ChatCompletionContentPartRefusalParam `queryParam:"inline"` - - Type ChatCompletionAssistantMessageParamContent1Type -} - -func CreateChatCompletionAssistantMessageParamContent1ChatCompletionContentPartTextParam(chatCompletionContentPartTextParam ChatCompletionContentPartTextParam) ChatCompletionAssistantMessageParamContent1 { - typ := ChatCompletionAssistantMessageParamContent1TypeChatCompletionContentPartTextParam - - return ChatCompletionAssistantMessageParamContent1{ - ChatCompletionContentPartTextParam: &chatCompletionContentPartTextParam, - Type: typ, - } -} - -func CreateChatCompletionAssistantMessageParamContent1ChatCompletionContentPartRefusalParam(chatCompletionContentPartRefusalParam ChatCompletionContentPartRefusalParam) ChatCompletionAssistantMessageParamContent1 { - typ := ChatCompletionAssistantMessageParamContent1TypeChatCompletionContentPartRefusalParam - - return ChatCompletionAssistantMessageParamContent1{ - ChatCompletionContentPartRefusalParam: &chatCompletionContentPartRefusalParam, - Type: typ, - } -} - -func (u *ChatCompletionAssistantMessageParamContent1) UnmarshalJSON(data []byte) error { - - var chatCompletionContentPartTextParam ChatCompletionContentPartTextParam = ChatCompletionContentPartTextParam{} - if err := utils.UnmarshalJSON(data, &chatCompletionContentPartTextParam, "", true, true); err == nil { - u.ChatCompletionContentPartTextParam = &chatCompletionContentPartTextParam - u.Type = ChatCompletionAssistantMessageParamContent1TypeChatCompletionContentPartTextParam - return nil - } - - var chatCompletionContentPartRefusalParam ChatCompletionContentPartRefusalParam = ChatCompletionContentPartRefusalParam{} - if err := utils.UnmarshalJSON(data, &chatCompletionContentPartRefusalParam, "", true, true); err == nil { - u.ChatCompletionContentPartRefusalParam = &chatCompletionContentPartRefusalParam - u.Type = ChatCompletionAssistantMessageParamContent1TypeChatCompletionContentPartRefusalParam - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for ChatCompletionAssistantMessageParamContent1", string(data)) -} - -func (u ChatCompletionAssistantMessageParamContent1) MarshalJSON() ([]byte, error) { - if u.ChatCompletionContentPartTextParam != nil { - return utils.MarshalJSON(u.ChatCompletionContentPartTextParam, "", true) - } - - if u.ChatCompletionContentPartRefusalParam != nil { - return utils.MarshalJSON(u.ChatCompletionContentPartRefusalParam, "", true) - } - - return nil, errors.New("could not marshal union type ChatCompletionAssistantMessageParamContent1: all fields are null") -} - -type ChatCompletionAssistantMessageParamContent2Type string - -const ( - ChatCompletionAssistantMessageParamContent2TypeStr ChatCompletionAssistantMessageParamContent2Type = "str" - ChatCompletionAssistantMessageParamContent2TypeArrayOfChatCompletionAssistantMessageParamContent1 ChatCompletionAssistantMessageParamContent2Type = "arrayOfChatCompletionAssistantMessageParamContent1" -) - -type ChatCompletionAssistantMessageParamContent2 struct { - Str *string `queryParam:"inline"` - ArrayOfChatCompletionAssistantMessageParamContent1 []ChatCompletionAssistantMessageParamContent1 `queryParam:"inline"` - - Type ChatCompletionAssistantMessageParamContent2Type -} - -func CreateChatCompletionAssistantMessageParamContent2Str(str string) ChatCompletionAssistantMessageParamContent2 { - typ := ChatCompletionAssistantMessageParamContent2TypeStr - - return ChatCompletionAssistantMessageParamContent2{ - Str: &str, - Type: typ, - } -} - -func CreateChatCompletionAssistantMessageParamContent2ArrayOfChatCompletionAssistantMessageParamContent1(arrayOfChatCompletionAssistantMessageParamContent1 []ChatCompletionAssistantMessageParamContent1) ChatCompletionAssistantMessageParamContent2 { - typ := ChatCompletionAssistantMessageParamContent2TypeArrayOfChatCompletionAssistantMessageParamContent1 - - return ChatCompletionAssistantMessageParamContent2{ - ArrayOfChatCompletionAssistantMessageParamContent1: arrayOfChatCompletionAssistantMessageParamContent1, - Type: typ, - } -} - -func (u *ChatCompletionAssistantMessageParamContent2) UnmarshalJSON(data []byte) error { - - var str string = "" - if err := utils.UnmarshalJSON(data, &str, "", true, true); err == nil { - u.Str = &str - u.Type = ChatCompletionAssistantMessageParamContent2TypeStr - return nil - } - - var arrayOfChatCompletionAssistantMessageParamContent1 []ChatCompletionAssistantMessageParamContent1 = []ChatCompletionAssistantMessageParamContent1{} - if err := utils.UnmarshalJSON(data, &arrayOfChatCompletionAssistantMessageParamContent1, "", true, true); err == nil { - u.ArrayOfChatCompletionAssistantMessageParamContent1 = arrayOfChatCompletionAssistantMessageParamContent1 - u.Type = ChatCompletionAssistantMessageParamContent2TypeArrayOfChatCompletionAssistantMessageParamContent1 - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for ChatCompletionAssistantMessageParamContent2", string(data)) -} - -func (u ChatCompletionAssistantMessageParamContent2) MarshalJSON() ([]byte, error) { - if u.Str != nil { - return utils.MarshalJSON(u.Str, "", true) - } - - if u.ArrayOfChatCompletionAssistantMessageParamContent1 != nil { - return utils.MarshalJSON(u.ArrayOfChatCompletionAssistantMessageParamContent1, "", true) - } - - return nil, errors.New("could not marshal union type ChatCompletionAssistantMessageParamContent2: all fields are null") -} - -type ChatCompletionAssistantMessageParam struct { - role string `const:"assistant" json:"role"` - Audio *Audio `json:"audio,omitempty"` - Content *ChatCompletionAssistantMessageParamContent2 `json:"content,omitempty"` - FunctionCall *FunctionCallInput `json:"function_call,omitempty"` - Name *string `json:"name,omitempty"` - Refusal *string `json:"refusal,omitempty"` - ToolCalls []ChatCompletionMessageToolCallParam `json:"tool_calls,omitempty"` -} - -func (c ChatCompletionAssistantMessageParam) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *ChatCompletionAssistantMessageParam) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, true); err != nil { - return err - } - return nil -} - -func (o *ChatCompletionAssistantMessageParam) GetRole() string { - return "assistant" -} - -func (o *ChatCompletionAssistantMessageParam) GetAudio() *Audio { - if o == nil { - return nil - } - return o.Audio -} - -func (o *ChatCompletionAssistantMessageParam) GetContent() *ChatCompletionAssistantMessageParamContent2 { - if o == nil { - return nil - } - return o.Content -} - -func (o *ChatCompletionAssistantMessageParam) GetFunctionCall() *FunctionCallInput { - if o == nil { - return nil - } - return o.FunctionCall -} - -func (o *ChatCompletionAssistantMessageParam) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *ChatCompletionAssistantMessageParam) GetRefusal() *string { - if o == nil { - return nil - } - return o.Refusal -} - -func (o *ChatCompletionAssistantMessageParam) GetToolCalls() []ChatCompletionMessageToolCallParam { - if o == nil { - return nil - } - return o.ToolCalls -} diff --git a/tests/mockserver/internal/sdk/models/components/chatcompletionaudio.go b/tests/mockserver/internal/sdk/models/components/chatcompletionaudio.go deleted file mode 100644 index 47677ea..0000000 --- a/tests/mockserver/internal/sdk/models/components/chatcompletionaudio.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" -) - -type ChatCompletionAudio struct { - ID string `json:"id"` - Data string `json:"data"` - ExpiresAt int64 `json:"expires_at"` - Transcript string `json:"transcript"` - AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` -} - -func (c ChatCompletionAudio) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *ChatCompletionAudio) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *ChatCompletionAudio) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *ChatCompletionAudio) GetData() string { - if o == nil { - return "" - } - return o.Data -} - -func (o *ChatCompletionAudio) GetExpiresAt() int64 { - if o == nil { - return 0 - } - return o.ExpiresAt -} - -func (o *ChatCompletionAudio) GetTranscript() string { - if o == nil { - return "" - } - return o.Transcript -} - -func (o *ChatCompletionAudio) GetAdditionalProperties() map[string]any { - if o == nil { - return nil - } - return o.AdditionalProperties -} diff --git a/tests/mockserver/internal/sdk/models/components/chatcompletionaudioparam.go b/tests/mockserver/internal/sdk/models/components/chatcompletionaudioparam.go deleted file mode 100644 index 6c7bc83..0000000 --- a/tests/mockserver/internal/sdk/models/components/chatcompletionaudioparam.go +++ /dev/null @@ -1,183 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "errors" - "fmt" - "mockserver/internal/sdk/utils" -) - -type ChatCompletionAudioParamFormat string - -const ( - ChatCompletionAudioParamFormatWav ChatCompletionAudioParamFormat = "wav" - ChatCompletionAudioParamFormatAac ChatCompletionAudioParamFormat = "aac" - ChatCompletionAudioParamFormatMp3 ChatCompletionAudioParamFormat = "mp3" - ChatCompletionAudioParamFormatFlac ChatCompletionAudioParamFormat = "flac" - ChatCompletionAudioParamFormatOpus ChatCompletionAudioParamFormat = "opus" - ChatCompletionAudioParamFormatPcm16 ChatCompletionAudioParamFormat = "pcm16" -) - -func (e ChatCompletionAudioParamFormat) ToPointer() *ChatCompletionAudioParamFormat { - return &e -} -func (e *ChatCompletionAudioParamFormat) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "wav": - fallthrough - case "aac": - fallthrough - case "mp3": - fallthrough - case "flac": - fallthrough - case "opus": - fallthrough - case "pcm16": - *e = ChatCompletionAudioParamFormat(v) - return nil - default: - return fmt.Errorf("invalid value for ChatCompletionAudioParamFormat: %v", v) - } -} - -type VoiceEnum string - -const ( - VoiceEnumAlloy VoiceEnum = "alloy" - VoiceEnumAsh VoiceEnum = "ash" - VoiceEnumBallad VoiceEnum = "ballad" - VoiceEnumCoral VoiceEnum = "coral" - VoiceEnumEcho VoiceEnum = "echo" - VoiceEnumFable VoiceEnum = "fable" - VoiceEnumOnyx VoiceEnum = "onyx" - VoiceEnumNova VoiceEnum = "nova" - VoiceEnumSage VoiceEnum = "sage" - VoiceEnumShimmer VoiceEnum = "shimmer" - VoiceEnumVerse VoiceEnum = "verse" -) - -func (e VoiceEnum) ToPointer() *VoiceEnum { - return &e -} -func (e *VoiceEnum) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "alloy": - fallthrough - case "ash": - fallthrough - case "ballad": - fallthrough - case "coral": - fallthrough - case "echo": - fallthrough - case "fable": - fallthrough - case "onyx": - fallthrough - case "nova": - fallthrough - case "sage": - fallthrough - case "shimmer": - fallthrough - case "verse": - *e = VoiceEnum(v) - return nil - default: - return fmt.Errorf("invalid value for VoiceEnum: %v", v) - } -} - -type VoiceType string - -const ( - VoiceTypeStr VoiceType = "str" - VoiceTypeVoiceEnum VoiceType = "Voice_enum" -) - -type Voice struct { - Str *string `queryParam:"inline"` - VoiceEnum *VoiceEnum `queryParam:"inline"` - - Type VoiceType -} - -func CreateVoiceStr(str string) Voice { - typ := VoiceTypeStr - - return Voice{ - Str: &str, - Type: typ, - } -} - -func CreateVoiceVoiceEnum(voiceEnum VoiceEnum) Voice { - typ := VoiceTypeVoiceEnum - - return Voice{ - VoiceEnum: &voiceEnum, - Type: typ, - } -} - -func (u *Voice) UnmarshalJSON(data []byte) error { - - var str string = "" - if err := utils.UnmarshalJSON(data, &str, "", true, true); err == nil { - u.Str = &str - u.Type = VoiceTypeStr - return nil - } - - var voiceEnum VoiceEnum = VoiceEnum("") - if err := utils.UnmarshalJSON(data, &voiceEnum, "", true, true); err == nil { - u.VoiceEnum = &voiceEnum - u.Type = VoiceTypeVoiceEnum - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for Voice", string(data)) -} - -func (u Voice) MarshalJSON() ([]byte, error) { - if u.Str != nil { - return utils.MarshalJSON(u.Str, "", true) - } - - if u.VoiceEnum != nil { - return utils.MarshalJSON(u.VoiceEnum, "", true) - } - - return nil, errors.New("could not marshal union type Voice: all fields are null") -} - -type ChatCompletionAudioParam struct { - Format ChatCompletionAudioParamFormat `json:"format"` - Voice Voice `json:"voice"` -} - -func (o *ChatCompletionAudioParam) GetFormat() ChatCompletionAudioParamFormat { - if o == nil { - return ChatCompletionAudioParamFormat("") - } - return o.Format -} - -func (o *ChatCompletionAudioParam) GetVoice() Voice { - if o == nil { - return Voice{} - } - return o.Voice -} diff --git a/tests/mockserver/internal/sdk/models/components/chatcompletioncontentpartimageparam.go b/tests/mockserver/internal/sdk/models/components/chatcompletioncontentpartimageparam.go deleted file mode 100644 index 9141d46..0000000 --- a/tests/mockserver/internal/sdk/models/components/chatcompletioncontentpartimageparam.go +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" -) - -type ChatCompletionContentPartImageParam struct { - ImageURL ImageURL `json:"image_url"` - type_ string `const:"image_url" json:"type"` -} - -func (c ChatCompletionContentPartImageParam) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *ChatCompletionContentPartImageParam) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, true); err != nil { - return err - } - return nil -} - -func (o *ChatCompletionContentPartImageParam) GetImageURL() ImageURL { - if o == nil { - return ImageURL{} - } - return o.ImageURL -} - -func (o *ChatCompletionContentPartImageParam) GetType() string { - return "image_url" -} diff --git a/tests/mockserver/internal/sdk/models/components/chatcompletioncontentpartinputaudioparam.go b/tests/mockserver/internal/sdk/models/components/chatcompletioncontentpartinputaudioparam.go deleted file mode 100644 index f4970a8..0000000 --- a/tests/mockserver/internal/sdk/models/components/chatcompletioncontentpartinputaudioparam.go +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" -) - -type ChatCompletionContentPartInputAudioParam struct { - InputAudio InputAudio `json:"input_audio"` - type_ string `const:"input_audio" json:"type"` -} - -func (c ChatCompletionContentPartInputAudioParam) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *ChatCompletionContentPartInputAudioParam) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, true); err != nil { - return err - } - return nil -} - -func (o *ChatCompletionContentPartInputAudioParam) GetInputAudio() InputAudio { - if o == nil { - return InputAudio{} - } - return o.InputAudio -} - -func (o *ChatCompletionContentPartInputAudioParam) GetType() string { - return "input_audio" -} diff --git a/tests/mockserver/internal/sdk/models/components/chatcompletioncontentpartrefusalparam.go b/tests/mockserver/internal/sdk/models/components/chatcompletioncontentpartrefusalparam.go deleted file mode 100644 index e9daae8..0000000 --- a/tests/mockserver/internal/sdk/models/components/chatcompletioncontentpartrefusalparam.go +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" -) - -type ChatCompletionContentPartRefusalParam struct { - Refusal string `json:"refusal"` - type_ string `const:"refusal" json:"type"` -} - -func (c ChatCompletionContentPartRefusalParam) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *ChatCompletionContentPartRefusalParam) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, true); err != nil { - return err - } - return nil -} - -func (o *ChatCompletionContentPartRefusalParam) GetRefusal() string { - if o == nil { - return "" - } - return o.Refusal -} - -func (o *ChatCompletionContentPartRefusalParam) GetType() string { - return "refusal" -} diff --git a/tests/mockserver/internal/sdk/models/components/chatcompletioncontentparttextparam.go b/tests/mockserver/internal/sdk/models/components/chatcompletioncontentparttextparam.go deleted file mode 100644 index 71afc2d..0000000 --- a/tests/mockserver/internal/sdk/models/components/chatcompletioncontentparttextparam.go +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" -) - -type ChatCompletionContentPartTextParam struct { - Text string `json:"text"` - type_ string `const:"text" json:"type"` -} - -func (c ChatCompletionContentPartTextParam) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *ChatCompletionContentPartTextParam) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, true); err != nil { - return err - } - return nil -} - -func (o *ChatCompletionContentPartTextParam) GetText() string { - if o == nil { - return "" - } - return o.Text -} - -func (o *ChatCompletionContentPartTextParam) GetType() string { - return "text" -} diff --git a/tests/mockserver/internal/sdk/models/components/chatcompletiondevelopermessageparam.go b/tests/mockserver/internal/sdk/models/components/chatcompletiondevelopermessageparam.go deleted file mode 100644 index 4d2f964..0000000 --- a/tests/mockserver/internal/sdk/models/components/chatcompletiondevelopermessageparam.go +++ /dev/null @@ -1,107 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "errors" - "fmt" - "mockserver/internal/sdk/utils" -) - -type ChatCompletionDeveloperMessageParamContentType string - -const ( - ChatCompletionDeveloperMessageParamContentTypeStr ChatCompletionDeveloperMessageParamContentType = "str" - ChatCompletionDeveloperMessageParamContentTypeArrayOfChatCompletionContentPartTextParam ChatCompletionDeveloperMessageParamContentType = "arrayOfChatCompletionContentPartTextParam" -) - -type ChatCompletionDeveloperMessageParamContent struct { - Str *string `queryParam:"inline"` - ArrayOfChatCompletionContentPartTextParam []ChatCompletionContentPartTextParam `queryParam:"inline"` - - Type ChatCompletionDeveloperMessageParamContentType -} - -func CreateChatCompletionDeveloperMessageParamContentStr(str string) ChatCompletionDeveloperMessageParamContent { - typ := ChatCompletionDeveloperMessageParamContentTypeStr - - return ChatCompletionDeveloperMessageParamContent{ - Str: &str, - Type: typ, - } -} - -func CreateChatCompletionDeveloperMessageParamContentArrayOfChatCompletionContentPartTextParam(arrayOfChatCompletionContentPartTextParam []ChatCompletionContentPartTextParam) ChatCompletionDeveloperMessageParamContent { - typ := ChatCompletionDeveloperMessageParamContentTypeArrayOfChatCompletionContentPartTextParam - - return ChatCompletionDeveloperMessageParamContent{ - ArrayOfChatCompletionContentPartTextParam: arrayOfChatCompletionContentPartTextParam, - Type: typ, - } -} - -func (u *ChatCompletionDeveloperMessageParamContent) UnmarshalJSON(data []byte) error { - - var str string = "" - if err := utils.UnmarshalJSON(data, &str, "", true, true); err == nil { - u.Str = &str - u.Type = ChatCompletionDeveloperMessageParamContentTypeStr - return nil - } - - var arrayOfChatCompletionContentPartTextParam []ChatCompletionContentPartTextParam = []ChatCompletionContentPartTextParam{} - if err := utils.UnmarshalJSON(data, &arrayOfChatCompletionContentPartTextParam, "", true, true); err == nil { - u.ArrayOfChatCompletionContentPartTextParam = arrayOfChatCompletionContentPartTextParam - u.Type = ChatCompletionDeveloperMessageParamContentTypeArrayOfChatCompletionContentPartTextParam - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for ChatCompletionDeveloperMessageParamContent", string(data)) -} - -func (u ChatCompletionDeveloperMessageParamContent) MarshalJSON() ([]byte, error) { - if u.Str != nil { - return utils.MarshalJSON(u.Str, "", true) - } - - if u.ArrayOfChatCompletionContentPartTextParam != nil { - return utils.MarshalJSON(u.ArrayOfChatCompletionContentPartTextParam, "", true) - } - - return nil, errors.New("could not marshal union type ChatCompletionDeveloperMessageParamContent: all fields are null") -} - -type ChatCompletionDeveloperMessageParam struct { - Content ChatCompletionDeveloperMessageParamContent `json:"content"` - role string `const:"developer" json:"role"` - Name *string `json:"name,omitempty"` -} - -func (c ChatCompletionDeveloperMessageParam) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *ChatCompletionDeveloperMessageParam) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, true); err != nil { - return err - } - return nil -} - -func (o *ChatCompletionDeveloperMessageParam) GetContent() ChatCompletionDeveloperMessageParamContent { - if o == nil { - return ChatCompletionDeveloperMessageParamContent{} - } - return o.Content -} - -func (o *ChatCompletionDeveloperMessageParam) GetRole() string { - return "developer" -} - -func (o *ChatCompletionDeveloperMessageParam) GetName() *string { - if o == nil { - return nil - } - return o.Name -} diff --git a/tests/mockserver/internal/sdk/models/components/chatcompletionfunctioncalloptionparam.go b/tests/mockserver/internal/sdk/models/components/chatcompletionfunctioncalloptionparam.go deleted file mode 100644 index 2dbc022..0000000 --- a/tests/mockserver/internal/sdk/models/components/chatcompletionfunctioncalloptionparam.go +++ /dev/null @@ -1,14 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type ChatCompletionFunctionCallOptionParam struct { - Name string `json:"name"` -} - -func (o *ChatCompletionFunctionCallOptionParam) GetName() string { - if o == nil { - return "" - } - return o.Name -} diff --git a/tests/mockserver/internal/sdk/models/components/chatcompletionfunctionmessageparam.go b/tests/mockserver/internal/sdk/models/components/chatcompletionfunctionmessageparam.go deleted file mode 100644 index 3d551bb..0000000 --- a/tests/mockserver/internal/sdk/models/components/chatcompletionfunctionmessageparam.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" -) - -type ChatCompletionFunctionMessageParam struct { - Content *string `json:"content"` - Name string `json:"name"` - role string `const:"function" json:"role"` -} - -func (c ChatCompletionFunctionMessageParam) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *ChatCompletionFunctionMessageParam) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, true); err != nil { - return err - } - return nil -} - -func (o *ChatCompletionFunctionMessageParam) GetContent() *string { - if o == nil { - return nil - } - return o.Content -} - -func (o *ChatCompletionFunctionMessageParam) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *ChatCompletionFunctionMessageParam) GetRole() string { - return "function" -} diff --git a/tests/mockserver/internal/sdk/models/components/chatcompletionmessage.go b/tests/mockserver/internal/sdk/models/components/chatcompletionmessage.go deleted file mode 100644 index 7b44e12..0000000 --- a/tests/mockserver/internal/sdk/models/components/chatcompletionmessage.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" -) - -type ChatCompletionMessage struct { - Content *string `json:"content,omitempty"` - Refusal *string `json:"refusal,omitempty"` - role string `const:"assistant" json:"role"` - Annotations []Annotation `json:"annotations,omitempty"` - Audio *ChatCompletionAudio `json:"audio,omitempty"` - FunctionCall *FunctionCallOutput `json:"function_call,omitempty"` - ToolCalls []ChatCompletionMessageToolCall `json:"tool_calls,omitempty"` - AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` -} - -func (c ChatCompletionMessage) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *ChatCompletionMessage) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *ChatCompletionMessage) GetContent() *string { - if o == nil { - return nil - } - return o.Content -} - -func (o *ChatCompletionMessage) GetRefusal() *string { - if o == nil { - return nil - } - return o.Refusal -} - -func (o *ChatCompletionMessage) GetRole() string { - return "assistant" -} - -func (o *ChatCompletionMessage) GetAnnotations() []Annotation { - if o == nil { - return nil - } - return o.Annotations -} - -func (o *ChatCompletionMessage) GetAudio() *ChatCompletionAudio { - if o == nil { - return nil - } - return o.Audio -} - -func (o *ChatCompletionMessage) GetFunctionCall() *FunctionCallOutput { - if o == nil { - return nil - } - return o.FunctionCall -} - -func (o *ChatCompletionMessage) GetToolCalls() []ChatCompletionMessageToolCall { - if o == nil { - return nil - } - return o.ToolCalls -} - -func (o *ChatCompletionMessage) GetAdditionalProperties() map[string]any { - if o == nil { - return nil - } - return o.AdditionalProperties -} diff --git a/tests/mockserver/internal/sdk/models/components/chatcompletionmessagetoolcall.go b/tests/mockserver/internal/sdk/models/components/chatcompletionmessagetoolcall.go deleted file mode 100644 index f04f3e0..0000000 --- a/tests/mockserver/internal/sdk/models/components/chatcompletionmessagetoolcall.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" -) - -type ChatCompletionMessageToolCall struct { - ID string `json:"id"` - Function FunctionOutput `json:"function"` - type_ string `const:"function" json:"type"` - AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` -} - -func (c ChatCompletionMessageToolCall) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *ChatCompletionMessageToolCall) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *ChatCompletionMessageToolCall) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *ChatCompletionMessageToolCall) GetFunction() FunctionOutput { - if o == nil { - return FunctionOutput{} - } - return o.Function -} - -func (o *ChatCompletionMessageToolCall) GetType() string { - return "function" -} - -func (o *ChatCompletionMessageToolCall) GetAdditionalProperties() map[string]any { - if o == nil { - return nil - } - return o.AdditionalProperties -} diff --git a/tests/mockserver/internal/sdk/models/components/chatcompletionmessagetoolcallparam.go b/tests/mockserver/internal/sdk/models/components/chatcompletionmessagetoolcallparam.go deleted file mode 100644 index 172f4c0..0000000 --- a/tests/mockserver/internal/sdk/models/components/chatcompletionmessagetoolcallparam.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" -) - -type ChatCompletionMessageToolCallParam struct { - ID string `json:"id"` - Function OpenaiTypesChatChatCompletionMessageToolCallParamFunction `json:"function"` - type_ string `const:"function" json:"type"` -} - -func (c ChatCompletionMessageToolCallParam) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *ChatCompletionMessageToolCallParam) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *ChatCompletionMessageToolCallParam) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *ChatCompletionMessageToolCallParam) GetFunction() OpenaiTypesChatChatCompletionMessageToolCallParamFunction { - if o == nil { - return OpenaiTypesChatChatCompletionMessageToolCallParamFunction{} - } - return o.Function -} - -func (o *ChatCompletionMessageToolCallParam) GetType() string { - return "function" -} diff --git a/tests/mockserver/internal/sdk/models/components/chatcompletionnamedtoolchoiceparam.go b/tests/mockserver/internal/sdk/models/components/chatcompletionnamedtoolchoiceparam.go deleted file mode 100644 index 9b52cb4..0000000 --- a/tests/mockserver/internal/sdk/models/components/chatcompletionnamedtoolchoiceparam.go +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" -) - -type ChatCompletionNamedToolChoiceParam struct { - Function OpenaiTypesChatChatCompletionNamedToolChoiceParamFunction `json:"function"` - type_ string `const:"function" json:"type"` -} - -func (c ChatCompletionNamedToolChoiceParam) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *ChatCompletionNamedToolChoiceParam) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, true); err != nil { - return err - } - return nil -} - -func (o *ChatCompletionNamedToolChoiceParam) GetFunction() OpenaiTypesChatChatCompletionNamedToolChoiceParamFunction { - if o == nil { - return OpenaiTypesChatChatCompletionNamedToolChoiceParamFunction{} - } - return o.Function -} - -func (o *ChatCompletionNamedToolChoiceParam) GetType() string { - return "function" -} diff --git a/tests/mockserver/internal/sdk/models/components/chatcompletionnonstreaming.go b/tests/mockserver/internal/sdk/models/components/chatcompletionnonstreaming.go deleted file mode 100644 index 26ed5e9..0000000 --- a/tests/mockserver/internal/sdk/models/components/chatcompletionnonstreaming.go +++ /dev/null @@ -1,850 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "errors" - "fmt" - "mockserver/internal/sdk/types" - "mockserver/internal/sdk/utils" -) - -type ChatCompletionNonStreamingMessageType string - -const ( - ChatCompletionNonStreamingMessageTypeChatCompletionDeveloperMessageParam ChatCompletionNonStreamingMessageType = "ChatCompletionDeveloperMessageParam" - ChatCompletionNonStreamingMessageTypeChatCompletionSystemMessageParam ChatCompletionNonStreamingMessageType = "ChatCompletionSystemMessageParam" - ChatCompletionNonStreamingMessageTypeChatCompletionUserMessageParam ChatCompletionNonStreamingMessageType = "ChatCompletionUserMessageParam" - ChatCompletionNonStreamingMessageTypeChatCompletionAssistantMessageParam ChatCompletionNonStreamingMessageType = "ChatCompletionAssistantMessageParam" - ChatCompletionNonStreamingMessageTypeChatCompletionToolMessageParam ChatCompletionNonStreamingMessageType = "ChatCompletionToolMessageParam" - ChatCompletionNonStreamingMessageTypeChatCompletionFunctionMessageParam ChatCompletionNonStreamingMessageType = "ChatCompletionFunctionMessageParam" -) - -type ChatCompletionNonStreamingMessage struct { - ChatCompletionDeveloperMessageParam *ChatCompletionDeveloperMessageParam `queryParam:"inline"` - ChatCompletionSystemMessageParam *ChatCompletionSystemMessageParam `queryParam:"inline"` - ChatCompletionUserMessageParam *ChatCompletionUserMessageParam `queryParam:"inline"` - ChatCompletionAssistantMessageParam *ChatCompletionAssistantMessageParam `queryParam:"inline"` - ChatCompletionToolMessageParam *ChatCompletionToolMessageParam `queryParam:"inline"` - ChatCompletionFunctionMessageParam *ChatCompletionFunctionMessageParam `queryParam:"inline"` - - Type ChatCompletionNonStreamingMessageType -} - -func CreateChatCompletionNonStreamingMessageChatCompletionDeveloperMessageParam(chatCompletionDeveloperMessageParam ChatCompletionDeveloperMessageParam) ChatCompletionNonStreamingMessage { - typ := ChatCompletionNonStreamingMessageTypeChatCompletionDeveloperMessageParam - - return ChatCompletionNonStreamingMessage{ - ChatCompletionDeveloperMessageParam: &chatCompletionDeveloperMessageParam, - Type: typ, - } -} - -func CreateChatCompletionNonStreamingMessageChatCompletionSystemMessageParam(chatCompletionSystemMessageParam ChatCompletionSystemMessageParam) ChatCompletionNonStreamingMessage { - typ := ChatCompletionNonStreamingMessageTypeChatCompletionSystemMessageParam - - return ChatCompletionNonStreamingMessage{ - ChatCompletionSystemMessageParam: &chatCompletionSystemMessageParam, - Type: typ, - } -} - -func CreateChatCompletionNonStreamingMessageChatCompletionUserMessageParam(chatCompletionUserMessageParam ChatCompletionUserMessageParam) ChatCompletionNonStreamingMessage { - typ := ChatCompletionNonStreamingMessageTypeChatCompletionUserMessageParam - - return ChatCompletionNonStreamingMessage{ - ChatCompletionUserMessageParam: &chatCompletionUserMessageParam, - Type: typ, - } -} - -func CreateChatCompletionNonStreamingMessageChatCompletionAssistantMessageParam(chatCompletionAssistantMessageParam ChatCompletionAssistantMessageParam) ChatCompletionNonStreamingMessage { - typ := ChatCompletionNonStreamingMessageTypeChatCompletionAssistantMessageParam - - return ChatCompletionNonStreamingMessage{ - ChatCompletionAssistantMessageParam: &chatCompletionAssistantMessageParam, - Type: typ, - } -} - -func CreateChatCompletionNonStreamingMessageChatCompletionToolMessageParam(chatCompletionToolMessageParam ChatCompletionToolMessageParam) ChatCompletionNonStreamingMessage { - typ := ChatCompletionNonStreamingMessageTypeChatCompletionToolMessageParam - - return ChatCompletionNonStreamingMessage{ - ChatCompletionToolMessageParam: &chatCompletionToolMessageParam, - Type: typ, - } -} - -func CreateChatCompletionNonStreamingMessageChatCompletionFunctionMessageParam(chatCompletionFunctionMessageParam ChatCompletionFunctionMessageParam) ChatCompletionNonStreamingMessage { - typ := ChatCompletionNonStreamingMessageTypeChatCompletionFunctionMessageParam - - return ChatCompletionNonStreamingMessage{ - ChatCompletionFunctionMessageParam: &chatCompletionFunctionMessageParam, - Type: typ, - } -} - -func (u *ChatCompletionNonStreamingMessage) UnmarshalJSON(data []byte) error { - - var chatCompletionDeveloperMessageParam ChatCompletionDeveloperMessageParam = ChatCompletionDeveloperMessageParam{} - if err := utils.UnmarshalJSON(data, &chatCompletionDeveloperMessageParam, "", true, true); err == nil { - u.ChatCompletionDeveloperMessageParam = &chatCompletionDeveloperMessageParam - u.Type = ChatCompletionNonStreamingMessageTypeChatCompletionDeveloperMessageParam - return nil - } - - var chatCompletionSystemMessageParam ChatCompletionSystemMessageParam = ChatCompletionSystemMessageParam{} - if err := utils.UnmarshalJSON(data, &chatCompletionSystemMessageParam, "", true, true); err == nil { - u.ChatCompletionSystemMessageParam = &chatCompletionSystemMessageParam - u.Type = ChatCompletionNonStreamingMessageTypeChatCompletionSystemMessageParam - return nil - } - - var chatCompletionUserMessageParam ChatCompletionUserMessageParam = ChatCompletionUserMessageParam{} - if err := utils.UnmarshalJSON(data, &chatCompletionUserMessageParam, "", true, true); err == nil { - u.ChatCompletionUserMessageParam = &chatCompletionUserMessageParam - u.Type = ChatCompletionNonStreamingMessageTypeChatCompletionUserMessageParam - return nil - } - - var chatCompletionToolMessageParam ChatCompletionToolMessageParam = ChatCompletionToolMessageParam{} - if err := utils.UnmarshalJSON(data, &chatCompletionToolMessageParam, "", true, true); err == nil { - u.ChatCompletionToolMessageParam = &chatCompletionToolMessageParam - u.Type = ChatCompletionNonStreamingMessageTypeChatCompletionToolMessageParam - return nil - } - - var chatCompletionFunctionMessageParam ChatCompletionFunctionMessageParam = ChatCompletionFunctionMessageParam{} - if err := utils.UnmarshalJSON(data, &chatCompletionFunctionMessageParam, "", true, true); err == nil { - u.ChatCompletionFunctionMessageParam = &chatCompletionFunctionMessageParam - u.Type = ChatCompletionNonStreamingMessageTypeChatCompletionFunctionMessageParam - return nil - } - - var chatCompletionAssistantMessageParam ChatCompletionAssistantMessageParam = ChatCompletionAssistantMessageParam{} - if err := utils.UnmarshalJSON(data, &chatCompletionAssistantMessageParam, "", true, true); err == nil { - u.ChatCompletionAssistantMessageParam = &chatCompletionAssistantMessageParam - u.Type = ChatCompletionNonStreamingMessageTypeChatCompletionAssistantMessageParam - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for ChatCompletionNonStreamingMessage", string(data)) -} - -func (u ChatCompletionNonStreamingMessage) MarshalJSON() ([]byte, error) { - if u.ChatCompletionDeveloperMessageParam != nil { - return utils.MarshalJSON(u.ChatCompletionDeveloperMessageParam, "", true) - } - - if u.ChatCompletionSystemMessageParam != nil { - return utils.MarshalJSON(u.ChatCompletionSystemMessageParam, "", true) - } - - if u.ChatCompletionUserMessageParam != nil { - return utils.MarshalJSON(u.ChatCompletionUserMessageParam, "", true) - } - - if u.ChatCompletionAssistantMessageParam != nil { - return utils.MarshalJSON(u.ChatCompletionAssistantMessageParam, "", true) - } - - if u.ChatCompletionToolMessageParam != nil { - return utils.MarshalJSON(u.ChatCompletionToolMessageParam, "", true) - } - - if u.ChatCompletionFunctionMessageParam != nil { - return utils.MarshalJSON(u.ChatCompletionFunctionMessageParam, "", true) - } - - return nil, errors.New("could not marshal union type ChatCompletionNonStreamingMessage: all fields are null") -} - -type ChatCompletionNonStreamingFunctionCallEnum string - -const ( - ChatCompletionNonStreamingFunctionCallEnumNone ChatCompletionNonStreamingFunctionCallEnum = "none" - ChatCompletionNonStreamingFunctionCallEnumAuto ChatCompletionNonStreamingFunctionCallEnum = "auto" -) - -func (e ChatCompletionNonStreamingFunctionCallEnum) ToPointer() *ChatCompletionNonStreamingFunctionCallEnum { - return &e -} -func (e *ChatCompletionNonStreamingFunctionCallEnum) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "none": - fallthrough - case "auto": - *e = ChatCompletionNonStreamingFunctionCallEnum(v) - return nil - default: - return fmt.Errorf("invalid value for ChatCompletionNonStreamingFunctionCallEnum: %v", v) - } -} - -type ChatCompletionNonStreamingFunctionCallUnionType string - -const ( - ChatCompletionNonStreamingFunctionCallUnionTypeChatCompletionNonStreamingFunctionCallEnum ChatCompletionNonStreamingFunctionCallUnionType = "ChatCompletionNonStreaming_Function Call_enum" - ChatCompletionNonStreamingFunctionCallUnionTypeChatCompletionFunctionCallOptionParam ChatCompletionNonStreamingFunctionCallUnionType = "ChatCompletionFunctionCallOptionParam" -) - -type ChatCompletionNonStreamingFunctionCallUnion struct { - ChatCompletionNonStreamingFunctionCallEnum *ChatCompletionNonStreamingFunctionCallEnum `queryParam:"inline"` - ChatCompletionFunctionCallOptionParam *ChatCompletionFunctionCallOptionParam `queryParam:"inline"` - - Type ChatCompletionNonStreamingFunctionCallUnionType -} - -func CreateChatCompletionNonStreamingFunctionCallUnionChatCompletionNonStreamingFunctionCallEnum(chatCompletionNonStreamingFunctionCallEnum ChatCompletionNonStreamingFunctionCallEnum) ChatCompletionNonStreamingFunctionCallUnion { - typ := ChatCompletionNonStreamingFunctionCallUnionTypeChatCompletionNonStreamingFunctionCallEnum - - return ChatCompletionNonStreamingFunctionCallUnion{ - ChatCompletionNonStreamingFunctionCallEnum: &chatCompletionNonStreamingFunctionCallEnum, - Type: typ, - } -} - -func CreateChatCompletionNonStreamingFunctionCallUnionChatCompletionFunctionCallOptionParam(chatCompletionFunctionCallOptionParam ChatCompletionFunctionCallOptionParam) ChatCompletionNonStreamingFunctionCallUnion { - typ := ChatCompletionNonStreamingFunctionCallUnionTypeChatCompletionFunctionCallOptionParam - - return ChatCompletionNonStreamingFunctionCallUnion{ - ChatCompletionFunctionCallOptionParam: &chatCompletionFunctionCallOptionParam, - Type: typ, - } -} - -func (u *ChatCompletionNonStreamingFunctionCallUnion) UnmarshalJSON(data []byte) error { - - var chatCompletionFunctionCallOptionParam ChatCompletionFunctionCallOptionParam = ChatCompletionFunctionCallOptionParam{} - if err := utils.UnmarshalJSON(data, &chatCompletionFunctionCallOptionParam, "", true, true); err == nil { - u.ChatCompletionFunctionCallOptionParam = &chatCompletionFunctionCallOptionParam - u.Type = ChatCompletionNonStreamingFunctionCallUnionTypeChatCompletionFunctionCallOptionParam - return nil - } - - var chatCompletionNonStreamingFunctionCallEnum ChatCompletionNonStreamingFunctionCallEnum = ChatCompletionNonStreamingFunctionCallEnum("") - if err := utils.UnmarshalJSON(data, &chatCompletionNonStreamingFunctionCallEnum, "", true, true); err == nil { - u.ChatCompletionNonStreamingFunctionCallEnum = &chatCompletionNonStreamingFunctionCallEnum - u.Type = ChatCompletionNonStreamingFunctionCallUnionTypeChatCompletionNonStreamingFunctionCallEnum - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for ChatCompletionNonStreamingFunctionCallUnion", string(data)) -} - -func (u ChatCompletionNonStreamingFunctionCallUnion) MarshalJSON() ([]byte, error) { - if u.ChatCompletionNonStreamingFunctionCallEnum != nil { - return utils.MarshalJSON(u.ChatCompletionNonStreamingFunctionCallEnum, "", true) - } - - if u.ChatCompletionFunctionCallOptionParam != nil { - return utils.MarshalJSON(u.ChatCompletionFunctionCallOptionParam, "", true) - } - - return nil, errors.New("could not marshal union type ChatCompletionNonStreamingFunctionCallUnion: all fields are null") -} - -type ChatCompletionNonStreamingModality string - -const ( - ChatCompletionNonStreamingModalityText ChatCompletionNonStreamingModality = "text" - ChatCompletionNonStreamingModalityAudio ChatCompletionNonStreamingModality = "audio" -) - -func (e ChatCompletionNonStreamingModality) ToPointer() *ChatCompletionNonStreamingModality { - return &e -} -func (e *ChatCompletionNonStreamingModality) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "text": - fallthrough - case "audio": - *e = ChatCompletionNonStreamingModality(v) - return nil - default: - return fmt.Errorf("invalid value for ChatCompletionNonStreamingModality: %v", v) - } -} - -type ChatCompletionNonStreamingReasoningEffort string - -const ( - ChatCompletionNonStreamingReasoningEffortLow ChatCompletionNonStreamingReasoningEffort = "low" - ChatCompletionNonStreamingReasoningEffortMedium ChatCompletionNonStreamingReasoningEffort = "medium" - ChatCompletionNonStreamingReasoningEffortHigh ChatCompletionNonStreamingReasoningEffort = "high" -) - -func (e ChatCompletionNonStreamingReasoningEffort) ToPointer() *ChatCompletionNonStreamingReasoningEffort { - return &e -} -func (e *ChatCompletionNonStreamingReasoningEffort) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "low": - fallthrough - case "medium": - fallthrough - case "high": - *e = ChatCompletionNonStreamingReasoningEffort(v) - return nil - default: - return fmt.Errorf("invalid value for ChatCompletionNonStreamingReasoningEffort: %v", v) - } -} - -type ChatCompletionNonStreamingResponseFormatType string - -const ( - ChatCompletionNonStreamingResponseFormatTypeResponseFormatText ChatCompletionNonStreamingResponseFormatType = "ResponseFormatText" - ChatCompletionNonStreamingResponseFormatTypeResponseFormatJSONSchema ChatCompletionNonStreamingResponseFormatType = "ResponseFormatJSONSchema" - ChatCompletionNonStreamingResponseFormatTypeResponseFormatJSONObject ChatCompletionNonStreamingResponseFormatType = "ResponseFormatJSONObject" -) - -type ChatCompletionNonStreamingResponseFormat struct { - ResponseFormatText *ResponseFormatText `queryParam:"inline"` - ResponseFormatJSONSchema *ResponseFormatJSONSchema `queryParam:"inline"` - ResponseFormatJSONObject *ResponseFormatJSONObject `queryParam:"inline"` - - Type ChatCompletionNonStreamingResponseFormatType -} - -func CreateChatCompletionNonStreamingResponseFormatResponseFormatText(responseFormatText ResponseFormatText) ChatCompletionNonStreamingResponseFormat { - typ := ChatCompletionNonStreamingResponseFormatTypeResponseFormatText - - return ChatCompletionNonStreamingResponseFormat{ - ResponseFormatText: &responseFormatText, - Type: typ, - } -} - -func CreateChatCompletionNonStreamingResponseFormatResponseFormatJSONSchema(responseFormatJSONSchema ResponseFormatJSONSchema) ChatCompletionNonStreamingResponseFormat { - typ := ChatCompletionNonStreamingResponseFormatTypeResponseFormatJSONSchema - - return ChatCompletionNonStreamingResponseFormat{ - ResponseFormatJSONSchema: &responseFormatJSONSchema, - Type: typ, - } -} - -func CreateChatCompletionNonStreamingResponseFormatResponseFormatJSONObject(responseFormatJSONObject ResponseFormatJSONObject) ChatCompletionNonStreamingResponseFormat { - typ := ChatCompletionNonStreamingResponseFormatTypeResponseFormatJSONObject - - return ChatCompletionNonStreamingResponseFormat{ - ResponseFormatJSONObject: &responseFormatJSONObject, - Type: typ, - } -} - -func (u *ChatCompletionNonStreamingResponseFormat) UnmarshalJSON(data []byte) error { - - var responseFormatText ResponseFormatText = ResponseFormatText{} - if err := utils.UnmarshalJSON(data, &responseFormatText, "", true, true); err == nil { - u.ResponseFormatText = &responseFormatText - u.Type = ChatCompletionNonStreamingResponseFormatTypeResponseFormatText - return nil - } - - var responseFormatJSONObject ResponseFormatJSONObject = ResponseFormatJSONObject{} - if err := utils.UnmarshalJSON(data, &responseFormatJSONObject, "", true, true); err == nil { - u.ResponseFormatJSONObject = &responseFormatJSONObject - u.Type = ChatCompletionNonStreamingResponseFormatTypeResponseFormatJSONObject - return nil - } - - var responseFormatJSONSchema ResponseFormatJSONSchema = ResponseFormatJSONSchema{} - if err := utils.UnmarshalJSON(data, &responseFormatJSONSchema, "", true, true); err == nil { - u.ResponseFormatJSONSchema = &responseFormatJSONSchema - u.Type = ChatCompletionNonStreamingResponseFormatTypeResponseFormatJSONSchema - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for ChatCompletionNonStreamingResponseFormat", string(data)) -} - -func (u ChatCompletionNonStreamingResponseFormat) MarshalJSON() ([]byte, error) { - if u.ResponseFormatText != nil { - return utils.MarshalJSON(u.ResponseFormatText, "", true) - } - - if u.ResponseFormatJSONSchema != nil { - return utils.MarshalJSON(u.ResponseFormatJSONSchema, "", true) - } - - if u.ResponseFormatJSONObject != nil { - return utils.MarshalJSON(u.ResponseFormatJSONObject, "", true) - } - - return nil, errors.New("could not marshal union type ChatCompletionNonStreamingResponseFormat: all fields are null") -} - -type ChatCompletionNonStreamingServiceTier string - -const ( - ChatCompletionNonStreamingServiceTierAuto ChatCompletionNonStreamingServiceTier = "auto" - ChatCompletionNonStreamingServiceTierDefault ChatCompletionNonStreamingServiceTier = "default" - ChatCompletionNonStreamingServiceTierFlex ChatCompletionNonStreamingServiceTier = "flex" -) - -func (e ChatCompletionNonStreamingServiceTier) ToPointer() *ChatCompletionNonStreamingServiceTier { - return &e -} -func (e *ChatCompletionNonStreamingServiceTier) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "auto": - fallthrough - case "default": - fallthrough - case "flex": - *e = ChatCompletionNonStreamingServiceTier(v) - return nil - default: - return fmt.Errorf("invalid value for ChatCompletionNonStreamingServiceTier: %v", v) - } -} - -type ChatCompletionNonStreamingStopType string - -const ( - ChatCompletionNonStreamingStopTypeStr ChatCompletionNonStreamingStopType = "str" - ChatCompletionNonStreamingStopTypeArrayOfStr ChatCompletionNonStreamingStopType = "arrayOfStr" -) - -type ChatCompletionNonStreamingStop struct { - Str *string `queryParam:"inline"` - ArrayOfStr []string `queryParam:"inline"` - - Type ChatCompletionNonStreamingStopType -} - -func CreateChatCompletionNonStreamingStopStr(str string) ChatCompletionNonStreamingStop { - typ := ChatCompletionNonStreamingStopTypeStr - - return ChatCompletionNonStreamingStop{ - Str: &str, - Type: typ, - } -} - -func CreateChatCompletionNonStreamingStopArrayOfStr(arrayOfStr []string) ChatCompletionNonStreamingStop { - typ := ChatCompletionNonStreamingStopTypeArrayOfStr - - return ChatCompletionNonStreamingStop{ - ArrayOfStr: arrayOfStr, - Type: typ, - } -} - -func (u *ChatCompletionNonStreamingStop) UnmarshalJSON(data []byte) error { - - var str string = "" - if err := utils.UnmarshalJSON(data, &str, "", true, true); err == nil { - u.Str = &str - u.Type = ChatCompletionNonStreamingStopTypeStr - return nil - } - - var arrayOfStr []string = []string{} - if err := utils.UnmarshalJSON(data, &arrayOfStr, "", true, true); err == nil { - u.ArrayOfStr = arrayOfStr - u.Type = ChatCompletionNonStreamingStopTypeArrayOfStr - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for ChatCompletionNonStreamingStop", string(data)) -} - -func (u ChatCompletionNonStreamingStop) MarshalJSON() ([]byte, error) { - if u.Str != nil { - return utils.MarshalJSON(u.Str, "", true) - } - - if u.ArrayOfStr != nil { - return utils.MarshalJSON(u.ArrayOfStr, "", true) - } - - return nil, errors.New("could not marshal union type ChatCompletionNonStreamingStop: all fields are null") -} - -type ChatCompletionNonStreamingToolChoiceEnum string - -const ( - ChatCompletionNonStreamingToolChoiceEnumNone ChatCompletionNonStreamingToolChoiceEnum = "none" - ChatCompletionNonStreamingToolChoiceEnumAuto ChatCompletionNonStreamingToolChoiceEnum = "auto" - ChatCompletionNonStreamingToolChoiceEnumRequired ChatCompletionNonStreamingToolChoiceEnum = "required" -) - -func (e ChatCompletionNonStreamingToolChoiceEnum) ToPointer() *ChatCompletionNonStreamingToolChoiceEnum { - return &e -} -func (e *ChatCompletionNonStreamingToolChoiceEnum) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "none": - fallthrough - case "auto": - fallthrough - case "required": - *e = ChatCompletionNonStreamingToolChoiceEnum(v) - return nil - default: - return fmt.Errorf("invalid value for ChatCompletionNonStreamingToolChoiceEnum: %v", v) - } -} - -type ChatCompletionNonStreamingToolChoiceUnionType string - -const ( - ChatCompletionNonStreamingToolChoiceUnionTypeChatCompletionNonStreamingToolChoiceEnum ChatCompletionNonStreamingToolChoiceUnionType = "ChatCompletionNonStreaming_Tool Choice_enum" - ChatCompletionNonStreamingToolChoiceUnionTypeChatCompletionNamedToolChoiceParam ChatCompletionNonStreamingToolChoiceUnionType = "ChatCompletionNamedToolChoiceParam" -) - -type ChatCompletionNonStreamingToolChoiceUnion struct { - ChatCompletionNonStreamingToolChoiceEnum *ChatCompletionNonStreamingToolChoiceEnum `queryParam:"inline"` - ChatCompletionNamedToolChoiceParam *ChatCompletionNamedToolChoiceParam `queryParam:"inline"` - - Type ChatCompletionNonStreamingToolChoiceUnionType -} - -func CreateChatCompletionNonStreamingToolChoiceUnionChatCompletionNonStreamingToolChoiceEnum(chatCompletionNonStreamingToolChoiceEnum ChatCompletionNonStreamingToolChoiceEnum) ChatCompletionNonStreamingToolChoiceUnion { - typ := ChatCompletionNonStreamingToolChoiceUnionTypeChatCompletionNonStreamingToolChoiceEnum - - return ChatCompletionNonStreamingToolChoiceUnion{ - ChatCompletionNonStreamingToolChoiceEnum: &chatCompletionNonStreamingToolChoiceEnum, - Type: typ, - } -} - -func CreateChatCompletionNonStreamingToolChoiceUnionChatCompletionNamedToolChoiceParam(chatCompletionNamedToolChoiceParam ChatCompletionNamedToolChoiceParam) ChatCompletionNonStreamingToolChoiceUnion { - typ := ChatCompletionNonStreamingToolChoiceUnionTypeChatCompletionNamedToolChoiceParam - - return ChatCompletionNonStreamingToolChoiceUnion{ - ChatCompletionNamedToolChoiceParam: &chatCompletionNamedToolChoiceParam, - Type: typ, - } -} - -func (u *ChatCompletionNonStreamingToolChoiceUnion) UnmarshalJSON(data []byte) error { - - var chatCompletionNamedToolChoiceParam ChatCompletionNamedToolChoiceParam = ChatCompletionNamedToolChoiceParam{} - if err := utils.UnmarshalJSON(data, &chatCompletionNamedToolChoiceParam, "", true, true); err == nil { - u.ChatCompletionNamedToolChoiceParam = &chatCompletionNamedToolChoiceParam - u.Type = ChatCompletionNonStreamingToolChoiceUnionTypeChatCompletionNamedToolChoiceParam - return nil - } - - var chatCompletionNonStreamingToolChoiceEnum ChatCompletionNonStreamingToolChoiceEnum = ChatCompletionNonStreamingToolChoiceEnum("") - if err := utils.UnmarshalJSON(data, &chatCompletionNonStreamingToolChoiceEnum, "", true, true); err == nil { - u.ChatCompletionNonStreamingToolChoiceEnum = &chatCompletionNonStreamingToolChoiceEnum - u.Type = ChatCompletionNonStreamingToolChoiceUnionTypeChatCompletionNonStreamingToolChoiceEnum - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for ChatCompletionNonStreamingToolChoiceUnion", string(data)) -} - -func (u ChatCompletionNonStreamingToolChoiceUnion) MarshalJSON() ([]byte, error) { - if u.ChatCompletionNonStreamingToolChoiceEnum != nil { - return utils.MarshalJSON(u.ChatCompletionNonStreamingToolChoiceEnum, "", true) - } - - if u.ChatCompletionNamedToolChoiceParam != nil { - return utils.MarshalJSON(u.ChatCompletionNamedToolChoiceParam, "", true) - } - - return nil, errors.New("could not marshal union type ChatCompletionNonStreamingToolChoiceUnion: all fields are null") -} - -type ChatCompletionNonStreaming struct { - Messages []ChatCompletionNonStreamingMessage `json:"messages"` - Model *TModel `json:"model,omitempty"` - Audio *ChatCompletionAudioParam `json:"audio,omitempty"` - FrequencyPenalty *float64 `json:"frequency_penalty,omitempty"` - FunctionCall *ChatCompletionNonStreamingFunctionCallUnion `json:"function_call,omitempty"` - Functions []OpenaiTypesChatCompletionCreateParamsFunction `json:"functions,omitempty"` - LogitBias map[string]int64 `json:"logit_bias,omitempty"` - Logprobs *bool `json:"logprobs,omitempty"` - MaxCompletionTokens *int64 `json:"max_completion_tokens,omitempty"` - MaxTokens *int64 `json:"max_tokens,omitempty"` - Metadata map[string]string `json:"metadata,omitempty"` - Modalities []ChatCompletionNonStreamingModality `json:"modalities,omitempty"` - N *int64 `json:"n,omitempty"` - ParallelToolCalls *bool `json:"parallel_tool_calls,omitempty"` - Prediction *ChatCompletionPredictionContentParam `json:"prediction,omitempty"` - PresencePenalty *float64 `json:"presence_penalty,omitempty"` - ReasoningEffort *ChatCompletionNonStreamingReasoningEffort `json:"reasoning_effort,omitempty"` - ResponseFormat *ChatCompletionNonStreamingResponseFormat `json:"response_format,omitempty"` - Seed *int64 `json:"seed,omitempty"` - ServiceTier *ChatCompletionNonStreamingServiceTier `json:"service_tier,omitempty"` - Stop *ChatCompletionNonStreamingStop `json:"stop,omitempty"` - Store *bool `json:"store,omitempty"` - StreamOptions *ChatCompletionStreamOptionsParam `json:"stream_options,omitempty"` - Temperature *float64 `json:"temperature,omitempty"` - ToolChoice *ChatCompletionNonStreamingToolChoiceUnion `json:"tool_choice,omitempty"` - Tools []ChatCompletionToolParam `json:"tools,omitempty"` - TopLogprobs *int64 `json:"top_logprobs,omitempty"` - TopP *float64 `json:"top_p,omitempty"` - User *string `json:"user,omitempty"` - WebSearchOptions *WebSearchOptions `json:"web_search_options,omitempty"` - stream *bool `const:"false" json:"stream,omitempty"` - Tags map[string]any `json:"tags,omitempty"` - ParentSpanID *string `json:"parent_span_id,omitempty"` -} - -func (c ChatCompletionNonStreaming) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *ChatCompletionNonStreaming) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, true); err != nil { - return err - } - return nil -} - -func (o *ChatCompletionNonStreaming) GetMessages() []ChatCompletionNonStreamingMessage { - if o == nil { - return []ChatCompletionNonStreamingMessage{} - } - return o.Messages -} - -func (o *ChatCompletionNonStreaming) GetModel() *TModel { - if o == nil { - return nil - } - return o.Model -} - -func (o *ChatCompletionNonStreaming) GetAudio() *ChatCompletionAudioParam { - if o == nil { - return nil - } - return o.Audio -} - -func (o *ChatCompletionNonStreaming) GetFrequencyPenalty() *float64 { - if o == nil { - return nil - } - return o.FrequencyPenalty -} - -func (o *ChatCompletionNonStreaming) GetFunctionCall() *ChatCompletionNonStreamingFunctionCallUnion { - if o == nil { - return nil - } - return o.FunctionCall -} - -func (o *ChatCompletionNonStreaming) GetFunctions() []OpenaiTypesChatCompletionCreateParamsFunction { - if o == nil { - return nil - } - return o.Functions -} - -func (o *ChatCompletionNonStreaming) GetLogitBias() map[string]int64 { - if o == nil { - return nil - } - return o.LogitBias -} - -func (o *ChatCompletionNonStreaming) GetLogprobs() *bool { - if o == nil { - return nil - } - return o.Logprobs -} - -func (o *ChatCompletionNonStreaming) GetMaxCompletionTokens() *int64 { - if o == nil { - return nil - } - return o.MaxCompletionTokens -} - -func (o *ChatCompletionNonStreaming) GetMaxTokens() *int64 { - if o == nil { - return nil - } - return o.MaxTokens -} - -func (o *ChatCompletionNonStreaming) GetMetadata() map[string]string { - if o == nil { - return nil - } - return o.Metadata -} - -func (o *ChatCompletionNonStreaming) GetModalities() []ChatCompletionNonStreamingModality { - if o == nil { - return nil - } - return o.Modalities -} - -func (o *ChatCompletionNonStreaming) GetN() *int64 { - if o == nil { - return nil - } - return o.N -} - -func (o *ChatCompletionNonStreaming) GetParallelToolCalls() *bool { - if o == nil { - return nil - } - return o.ParallelToolCalls -} - -func (o *ChatCompletionNonStreaming) GetPrediction() *ChatCompletionPredictionContentParam { - if o == nil { - return nil - } - return o.Prediction -} - -func (o *ChatCompletionNonStreaming) GetPresencePenalty() *float64 { - if o == nil { - return nil - } - return o.PresencePenalty -} - -func (o *ChatCompletionNonStreaming) GetReasoningEffort() *ChatCompletionNonStreamingReasoningEffort { - if o == nil { - return nil - } - return o.ReasoningEffort -} - -func (o *ChatCompletionNonStreaming) GetResponseFormat() *ChatCompletionNonStreamingResponseFormat { - if o == nil { - return nil - } - return o.ResponseFormat -} - -func (o *ChatCompletionNonStreaming) GetSeed() *int64 { - if o == nil { - return nil - } - return o.Seed -} - -func (o *ChatCompletionNonStreaming) GetServiceTier() *ChatCompletionNonStreamingServiceTier { - if o == nil { - return nil - } - return o.ServiceTier -} - -func (o *ChatCompletionNonStreaming) GetStop() *ChatCompletionNonStreamingStop { - if o == nil { - return nil - } - return o.Stop -} - -func (o *ChatCompletionNonStreaming) GetStore() *bool { - if o == nil { - return nil - } - return o.Store -} - -func (o *ChatCompletionNonStreaming) GetStreamOptions() *ChatCompletionStreamOptionsParam { - if o == nil { - return nil - } - return o.StreamOptions -} - -func (o *ChatCompletionNonStreaming) GetTemperature() *float64 { - if o == nil { - return nil - } - return o.Temperature -} - -func (o *ChatCompletionNonStreaming) GetToolChoice() *ChatCompletionNonStreamingToolChoiceUnion { - if o == nil { - return nil - } - return o.ToolChoice -} - -func (o *ChatCompletionNonStreaming) GetTools() []ChatCompletionToolParam { - if o == nil { - return nil - } - return o.Tools -} - -func (o *ChatCompletionNonStreaming) GetTopLogprobs() *int64 { - if o == nil { - return nil - } - return o.TopLogprobs -} - -func (o *ChatCompletionNonStreaming) GetTopP() *float64 { - if o == nil { - return nil - } - return o.TopP -} - -func (o *ChatCompletionNonStreaming) GetUser() *string { - if o == nil { - return nil - } - return o.User -} - -func (o *ChatCompletionNonStreaming) GetWebSearchOptions() *WebSearchOptions { - if o == nil { - return nil - } - return o.WebSearchOptions -} - -func (o *ChatCompletionNonStreaming) GetStream() *bool { - return types.Bool(false) -} - -func (o *ChatCompletionNonStreaming) GetTags() map[string]any { - if o == nil { - return nil - } - return o.Tags -} - -func (o *ChatCompletionNonStreaming) GetParentSpanID() *string { - if o == nil { - return nil - } - return o.ParentSpanID -} diff --git a/tests/mockserver/internal/sdk/models/components/chatcompletionpredictioncontentparam.go b/tests/mockserver/internal/sdk/models/components/chatcompletionpredictioncontentparam.go deleted file mode 100644 index d03c4f7..0000000 --- a/tests/mockserver/internal/sdk/models/components/chatcompletionpredictioncontentparam.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "errors" - "fmt" - "mockserver/internal/sdk/utils" -) - -type ChatCompletionPredictionContentParamContentType string - -const ( - ChatCompletionPredictionContentParamContentTypeStr ChatCompletionPredictionContentParamContentType = "str" - ChatCompletionPredictionContentParamContentTypeArrayOfChatCompletionContentPartTextParam ChatCompletionPredictionContentParamContentType = "arrayOfChatCompletionContentPartTextParam" -) - -type ChatCompletionPredictionContentParamContent struct { - Str *string `queryParam:"inline"` - ArrayOfChatCompletionContentPartTextParam []ChatCompletionContentPartTextParam `queryParam:"inline"` - - Type ChatCompletionPredictionContentParamContentType -} - -func CreateChatCompletionPredictionContentParamContentStr(str string) ChatCompletionPredictionContentParamContent { - typ := ChatCompletionPredictionContentParamContentTypeStr - - return ChatCompletionPredictionContentParamContent{ - Str: &str, - Type: typ, - } -} - -func CreateChatCompletionPredictionContentParamContentArrayOfChatCompletionContentPartTextParam(arrayOfChatCompletionContentPartTextParam []ChatCompletionContentPartTextParam) ChatCompletionPredictionContentParamContent { - typ := ChatCompletionPredictionContentParamContentTypeArrayOfChatCompletionContentPartTextParam - - return ChatCompletionPredictionContentParamContent{ - ArrayOfChatCompletionContentPartTextParam: arrayOfChatCompletionContentPartTextParam, - Type: typ, - } -} - -func (u *ChatCompletionPredictionContentParamContent) UnmarshalJSON(data []byte) error { - - var str string = "" - if err := utils.UnmarshalJSON(data, &str, "", true, true); err == nil { - u.Str = &str - u.Type = ChatCompletionPredictionContentParamContentTypeStr - return nil - } - - var arrayOfChatCompletionContentPartTextParam []ChatCompletionContentPartTextParam = []ChatCompletionContentPartTextParam{} - if err := utils.UnmarshalJSON(data, &arrayOfChatCompletionContentPartTextParam, "", true, true); err == nil { - u.ArrayOfChatCompletionContentPartTextParam = arrayOfChatCompletionContentPartTextParam - u.Type = ChatCompletionPredictionContentParamContentTypeArrayOfChatCompletionContentPartTextParam - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for ChatCompletionPredictionContentParamContent", string(data)) -} - -func (u ChatCompletionPredictionContentParamContent) MarshalJSON() ([]byte, error) { - if u.Str != nil { - return utils.MarshalJSON(u.Str, "", true) - } - - if u.ArrayOfChatCompletionContentPartTextParam != nil { - return utils.MarshalJSON(u.ArrayOfChatCompletionContentPartTextParam, "", true) - } - - return nil, errors.New("could not marshal union type ChatCompletionPredictionContentParamContent: all fields are null") -} - -type ChatCompletionPredictionContentParam struct { - Content ChatCompletionPredictionContentParamContent `json:"content"` - type_ string `const:"content" json:"type"` -} - -func (c ChatCompletionPredictionContentParam) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *ChatCompletionPredictionContentParam) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *ChatCompletionPredictionContentParam) GetContent() ChatCompletionPredictionContentParamContent { - if o == nil { - return ChatCompletionPredictionContentParamContent{} - } - return o.Content -} - -func (o *ChatCompletionPredictionContentParam) GetType() string { - return "content" -} diff --git a/tests/mockserver/internal/sdk/models/components/chatcompletionstreaming.go b/tests/mockserver/internal/sdk/models/components/chatcompletionstreaming.go deleted file mode 100644 index c10e4d9..0000000 --- a/tests/mockserver/internal/sdk/models/components/chatcompletionstreaming.go +++ /dev/null @@ -1,849 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "errors" - "fmt" - "mockserver/internal/sdk/utils" -) - -type ChatCompletionStreamingMessageType string - -const ( - ChatCompletionStreamingMessageTypeChatCompletionDeveloperMessageParam ChatCompletionStreamingMessageType = "ChatCompletionDeveloperMessageParam" - ChatCompletionStreamingMessageTypeChatCompletionSystemMessageParam ChatCompletionStreamingMessageType = "ChatCompletionSystemMessageParam" - ChatCompletionStreamingMessageTypeChatCompletionUserMessageParam ChatCompletionStreamingMessageType = "ChatCompletionUserMessageParam" - ChatCompletionStreamingMessageTypeChatCompletionAssistantMessageParam ChatCompletionStreamingMessageType = "ChatCompletionAssistantMessageParam" - ChatCompletionStreamingMessageTypeChatCompletionToolMessageParam ChatCompletionStreamingMessageType = "ChatCompletionToolMessageParam" - ChatCompletionStreamingMessageTypeChatCompletionFunctionMessageParam ChatCompletionStreamingMessageType = "ChatCompletionFunctionMessageParam" -) - -type ChatCompletionStreamingMessage struct { - ChatCompletionDeveloperMessageParam *ChatCompletionDeveloperMessageParam `queryParam:"inline"` - ChatCompletionSystemMessageParam *ChatCompletionSystemMessageParam `queryParam:"inline"` - ChatCompletionUserMessageParam *ChatCompletionUserMessageParam `queryParam:"inline"` - ChatCompletionAssistantMessageParam *ChatCompletionAssistantMessageParam `queryParam:"inline"` - ChatCompletionToolMessageParam *ChatCompletionToolMessageParam `queryParam:"inline"` - ChatCompletionFunctionMessageParam *ChatCompletionFunctionMessageParam `queryParam:"inline"` - - Type ChatCompletionStreamingMessageType -} - -func CreateChatCompletionStreamingMessageChatCompletionDeveloperMessageParam(chatCompletionDeveloperMessageParam ChatCompletionDeveloperMessageParam) ChatCompletionStreamingMessage { - typ := ChatCompletionStreamingMessageTypeChatCompletionDeveloperMessageParam - - return ChatCompletionStreamingMessage{ - ChatCompletionDeveloperMessageParam: &chatCompletionDeveloperMessageParam, - Type: typ, - } -} - -func CreateChatCompletionStreamingMessageChatCompletionSystemMessageParam(chatCompletionSystemMessageParam ChatCompletionSystemMessageParam) ChatCompletionStreamingMessage { - typ := ChatCompletionStreamingMessageTypeChatCompletionSystemMessageParam - - return ChatCompletionStreamingMessage{ - ChatCompletionSystemMessageParam: &chatCompletionSystemMessageParam, - Type: typ, - } -} - -func CreateChatCompletionStreamingMessageChatCompletionUserMessageParam(chatCompletionUserMessageParam ChatCompletionUserMessageParam) ChatCompletionStreamingMessage { - typ := ChatCompletionStreamingMessageTypeChatCompletionUserMessageParam - - return ChatCompletionStreamingMessage{ - ChatCompletionUserMessageParam: &chatCompletionUserMessageParam, - Type: typ, - } -} - -func CreateChatCompletionStreamingMessageChatCompletionAssistantMessageParam(chatCompletionAssistantMessageParam ChatCompletionAssistantMessageParam) ChatCompletionStreamingMessage { - typ := ChatCompletionStreamingMessageTypeChatCompletionAssistantMessageParam - - return ChatCompletionStreamingMessage{ - ChatCompletionAssistantMessageParam: &chatCompletionAssistantMessageParam, - Type: typ, - } -} - -func CreateChatCompletionStreamingMessageChatCompletionToolMessageParam(chatCompletionToolMessageParam ChatCompletionToolMessageParam) ChatCompletionStreamingMessage { - typ := ChatCompletionStreamingMessageTypeChatCompletionToolMessageParam - - return ChatCompletionStreamingMessage{ - ChatCompletionToolMessageParam: &chatCompletionToolMessageParam, - Type: typ, - } -} - -func CreateChatCompletionStreamingMessageChatCompletionFunctionMessageParam(chatCompletionFunctionMessageParam ChatCompletionFunctionMessageParam) ChatCompletionStreamingMessage { - typ := ChatCompletionStreamingMessageTypeChatCompletionFunctionMessageParam - - return ChatCompletionStreamingMessage{ - ChatCompletionFunctionMessageParam: &chatCompletionFunctionMessageParam, - Type: typ, - } -} - -func (u *ChatCompletionStreamingMessage) UnmarshalJSON(data []byte) error { - - var chatCompletionDeveloperMessageParam ChatCompletionDeveloperMessageParam = ChatCompletionDeveloperMessageParam{} - if err := utils.UnmarshalJSON(data, &chatCompletionDeveloperMessageParam, "", true, true); err == nil { - u.ChatCompletionDeveloperMessageParam = &chatCompletionDeveloperMessageParam - u.Type = ChatCompletionStreamingMessageTypeChatCompletionDeveloperMessageParam - return nil - } - - var chatCompletionSystemMessageParam ChatCompletionSystemMessageParam = ChatCompletionSystemMessageParam{} - if err := utils.UnmarshalJSON(data, &chatCompletionSystemMessageParam, "", true, true); err == nil { - u.ChatCompletionSystemMessageParam = &chatCompletionSystemMessageParam - u.Type = ChatCompletionStreamingMessageTypeChatCompletionSystemMessageParam - return nil - } - - var chatCompletionUserMessageParam ChatCompletionUserMessageParam = ChatCompletionUserMessageParam{} - if err := utils.UnmarshalJSON(data, &chatCompletionUserMessageParam, "", true, true); err == nil { - u.ChatCompletionUserMessageParam = &chatCompletionUserMessageParam - u.Type = ChatCompletionStreamingMessageTypeChatCompletionUserMessageParam - return nil - } - - var chatCompletionToolMessageParam ChatCompletionToolMessageParam = ChatCompletionToolMessageParam{} - if err := utils.UnmarshalJSON(data, &chatCompletionToolMessageParam, "", true, true); err == nil { - u.ChatCompletionToolMessageParam = &chatCompletionToolMessageParam - u.Type = ChatCompletionStreamingMessageTypeChatCompletionToolMessageParam - return nil - } - - var chatCompletionFunctionMessageParam ChatCompletionFunctionMessageParam = ChatCompletionFunctionMessageParam{} - if err := utils.UnmarshalJSON(data, &chatCompletionFunctionMessageParam, "", true, true); err == nil { - u.ChatCompletionFunctionMessageParam = &chatCompletionFunctionMessageParam - u.Type = ChatCompletionStreamingMessageTypeChatCompletionFunctionMessageParam - return nil - } - - var chatCompletionAssistantMessageParam ChatCompletionAssistantMessageParam = ChatCompletionAssistantMessageParam{} - if err := utils.UnmarshalJSON(data, &chatCompletionAssistantMessageParam, "", true, true); err == nil { - u.ChatCompletionAssistantMessageParam = &chatCompletionAssistantMessageParam - u.Type = ChatCompletionStreamingMessageTypeChatCompletionAssistantMessageParam - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for ChatCompletionStreamingMessage", string(data)) -} - -func (u ChatCompletionStreamingMessage) MarshalJSON() ([]byte, error) { - if u.ChatCompletionDeveloperMessageParam != nil { - return utils.MarshalJSON(u.ChatCompletionDeveloperMessageParam, "", true) - } - - if u.ChatCompletionSystemMessageParam != nil { - return utils.MarshalJSON(u.ChatCompletionSystemMessageParam, "", true) - } - - if u.ChatCompletionUserMessageParam != nil { - return utils.MarshalJSON(u.ChatCompletionUserMessageParam, "", true) - } - - if u.ChatCompletionAssistantMessageParam != nil { - return utils.MarshalJSON(u.ChatCompletionAssistantMessageParam, "", true) - } - - if u.ChatCompletionToolMessageParam != nil { - return utils.MarshalJSON(u.ChatCompletionToolMessageParam, "", true) - } - - if u.ChatCompletionFunctionMessageParam != nil { - return utils.MarshalJSON(u.ChatCompletionFunctionMessageParam, "", true) - } - - return nil, errors.New("could not marshal union type ChatCompletionStreamingMessage: all fields are null") -} - -type ChatCompletionStreamingFunctionCallEnum string - -const ( - ChatCompletionStreamingFunctionCallEnumNone ChatCompletionStreamingFunctionCallEnum = "none" - ChatCompletionStreamingFunctionCallEnumAuto ChatCompletionStreamingFunctionCallEnum = "auto" -) - -func (e ChatCompletionStreamingFunctionCallEnum) ToPointer() *ChatCompletionStreamingFunctionCallEnum { - return &e -} -func (e *ChatCompletionStreamingFunctionCallEnum) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "none": - fallthrough - case "auto": - *e = ChatCompletionStreamingFunctionCallEnum(v) - return nil - default: - return fmt.Errorf("invalid value for ChatCompletionStreamingFunctionCallEnum: %v", v) - } -} - -type ChatCompletionStreamingFunctionCallUnionType string - -const ( - ChatCompletionStreamingFunctionCallUnionTypeChatCompletionStreamingFunctionCallEnum ChatCompletionStreamingFunctionCallUnionType = "ChatCompletionStreaming_Function Call_enum" - ChatCompletionStreamingFunctionCallUnionTypeChatCompletionFunctionCallOptionParam ChatCompletionStreamingFunctionCallUnionType = "ChatCompletionFunctionCallOptionParam" -) - -type ChatCompletionStreamingFunctionCallUnion struct { - ChatCompletionStreamingFunctionCallEnum *ChatCompletionStreamingFunctionCallEnum `queryParam:"inline"` - ChatCompletionFunctionCallOptionParam *ChatCompletionFunctionCallOptionParam `queryParam:"inline"` - - Type ChatCompletionStreamingFunctionCallUnionType -} - -func CreateChatCompletionStreamingFunctionCallUnionChatCompletionStreamingFunctionCallEnum(chatCompletionStreamingFunctionCallEnum ChatCompletionStreamingFunctionCallEnum) ChatCompletionStreamingFunctionCallUnion { - typ := ChatCompletionStreamingFunctionCallUnionTypeChatCompletionStreamingFunctionCallEnum - - return ChatCompletionStreamingFunctionCallUnion{ - ChatCompletionStreamingFunctionCallEnum: &chatCompletionStreamingFunctionCallEnum, - Type: typ, - } -} - -func CreateChatCompletionStreamingFunctionCallUnionChatCompletionFunctionCallOptionParam(chatCompletionFunctionCallOptionParam ChatCompletionFunctionCallOptionParam) ChatCompletionStreamingFunctionCallUnion { - typ := ChatCompletionStreamingFunctionCallUnionTypeChatCompletionFunctionCallOptionParam - - return ChatCompletionStreamingFunctionCallUnion{ - ChatCompletionFunctionCallOptionParam: &chatCompletionFunctionCallOptionParam, - Type: typ, - } -} - -func (u *ChatCompletionStreamingFunctionCallUnion) UnmarshalJSON(data []byte) error { - - var chatCompletionFunctionCallOptionParam ChatCompletionFunctionCallOptionParam = ChatCompletionFunctionCallOptionParam{} - if err := utils.UnmarshalJSON(data, &chatCompletionFunctionCallOptionParam, "", true, true); err == nil { - u.ChatCompletionFunctionCallOptionParam = &chatCompletionFunctionCallOptionParam - u.Type = ChatCompletionStreamingFunctionCallUnionTypeChatCompletionFunctionCallOptionParam - return nil - } - - var chatCompletionStreamingFunctionCallEnum ChatCompletionStreamingFunctionCallEnum = ChatCompletionStreamingFunctionCallEnum("") - if err := utils.UnmarshalJSON(data, &chatCompletionStreamingFunctionCallEnum, "", true, true); err == nil { - u.ChatCompletionStreamingFunctionCallEnum = &chatCompletionStreamingFunctionCallEnum - u.Type = ChatCompletionStreamingFunctionCallUnionTypeChatCompletionStreamingFunctionCallEnum - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for ChatCompletionStreamingFunctionCallUnion", string(data)) -} - -func (u ChatCompletionStreamingFunctionCallUnion) MarshalJSON() ([]byte, error) { - if u.ChatCompletionStreamingFunctionCallEnum != nil { - return utils.MarshalJSON(u.ChatCompletionStreamingFunctionCallEnum, "", true) - } - - if u.ChatCompletionFunctionCallOptionParam != nil { - return utils.MarshalJSON(u.ChatCompletionFunctionCallOptionParam, "", true) - } - - return nil, errors.New("could not marshal union type ChatCompletionStreamingFunctionCallUnion: all fields are null") -} - -type ChatCompletionStreamingModality string - -const ( - ChatCompletionStreamingModalityText ChatCompletionStreamingModality = "text" - ChatCompletionStreamingModalityAudio ChatCompletionStreamingModality = "audio" -) - -func (e ChatCompletionStreamingModality) ToPointer() *ChatCompletionStreamingModality { - return &e -} -func (e *ChatCompletionStreamingModality) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "text": - fallthrough - case "audio": - *e = ChatCompletionStreamingModality(v) - return nil - default: - return fmt.Errorf("invalid value for ChatCompletionStreamingModality: %v", v) - } -} - -type ChatCompletionStreamingReasoningEffort string - -const ( - ChatCompletionStreamingReasoningEffortLow ChatCompletionStreamingReasoningEffort = "low" - ChatCompletionStreamingReasoningEffortMedium ChatCompletionStreamingReasoningEffort = "medium" - ChatCompletionStreamingReasoningEffortHigh ChatCompletionStreamingReasoningEffort = "high" -) - -func (e ChatCompletionStreamingReasoningEffort) ToPointer() *ChatCompletionStreamingReasoningEffort { - return &e -} -func (e *ChatCompletionStreamingReasoningEffort) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "low": - fallthrough - case "medium": - fallthrough - case "high": - *e = ChatCompletionStreamingReasoningEffort(v) - return nil - default: - return fmt.Errorf("invalid value for ChatCompletionStreamingReasoningEffort: %v", v) - } -} - -type ChatCompletionStreamingResponseFormatType string - -const ( - ChatCompletionStreamingResponseFormatTypeResponseFormatText ChatCompletionStreamingResponseFormatType = "ResponseFormatText" - ChatCompletionStreamingResponseFormatTypeResponseFormatJSONSchema ChatCompletionStreamingResponseFormatType = "ResponseFormatJSONSchema" - ChatCompletionStreamingResponseFormatTypeResponseFormatJSONObject ChatCompletionStreamingResponseFormatType = "ResponseFormatJSONObject" -) - -type ChatCompletionStreamingResponseFormat struct { - ResponseFormatText *ResponseFormatText `queryParam:"inline"` - ResponseFormatJSONSchema *ResponseFormatJSONSchema `queryParam:"inline"` - ResponseFormatJSONObject *ResponseFormatJSONObject `queryParam:"inline"` - - Type ChatCompletionStreamingResponseFormatType -} - -func CreateChatCompletionStreamingResponseFormatResponseFormatText(responseFormatText ResponseFormatText) ChatCompletionStreamingResponseFormat { - typ := ChatCompletionStreamingResponseFormatTypeResponseFormatText - - return ChatCompletionStreamingResponseFormat{ - ResponseFormatText: &responseFormatText, - Type: typ, - } -} - -func CreateChatCompletionStreamingResponseFormatResponseFormatJSONSchema(responseFormatJSONSchema ResponseFormatJSONSchema) ChatCompletionStreamingResponseFormat { - typ := ChatCompletionStreamingResponseFormatTypeResponseFormatJSONSchema - - return ChatCompletionStreamingResponseFormat{ - ResponseFormatJSONSchema: &responseFormatJSONSchema, - Type: typ, - } -} - -func CreateChatCompletionStreamingResponseFormatResponseFormatJSONObject(responseFormatJSONObject ResponseFormatJSONObject) ChatCompletionStreamingResponseFormat { - typ := ChatCompletionStreamingResponseFormatTypeResponseFormatJSONObject - - return ChatCompletionStreamingResponseFormat{ - ResponseFormatJSONObject: &responseFormatJSONObject, - Type: typ, - } -} - -func (u *ChatCompletionStreamingResponseFormat) UnmarshalJSON(data []byte) error { - - var responseFormatText ResponseFormatText = ResponseFormatText{} - if err := utils.UnmarshalJSON(data, &responseFormatText, "", true, true); err == nil { - u.ResponseFormatText = &responseFormatText - u.Type = ChatCompletionStreamingResponseFormatTypeResponseFormatText - return nil - } - - var responseFormatJSONObject ResponseFormatJSONObject = ResponseFormatJSONObject{} - if err := utils.UnmarshalJSON(data, &responseFormatJSONObject, "", true, true); err == nil { - u.ResponseFormatJSONObject = &responseFormatJSONObject - u.Type = ChatCompletionStreamingResponseFormatTypeResponseFormatJSONObject - return nil - } - - var responseFormatJSONSchema ResponseFormatJSONSchema = ResponseFormatJSONSchema{} - if err := utils.UnmarshalJSON(data, &responseFormatJSONSchema, "", true, true); err == nil { - u.ResponseFormatJSONSchema = &responseFormatJSONSchema - u.Type = ChatCompletionStreamingResponseFormatTypeResponseFormatJSONSchema - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for ChatCompletionStreamingResponseFormat", string(data)) -} - -func (u ChatCompletionStreamingResponseFormat) MarshalJSON() ([]byte, error) { - if u.ResponseFormatText != nil { - return utils.MarshalJSON(u.ResponseFormatText, "", true) - } - - if u.ResponseFormatJSONSchema != nil { - return utils.MarshalJSON(u.ResponseFormatJSONSchema, "", true) - } - - if u.ResponseFormatJSONObject != nil { - return utils.MarshalJSON(u.ResponseFormatJSONObject, "", true) - } - - return nil, errors.New("could not marshal union type ChatCompletionStreamingResponseFormat: all fields are null") -} - -type ChatCompletionStreamingServiceTier string - -const ( - ChatCompletionStreamingServiceTierAuto ChatCompletionStreamingServiceTier = "auto" - ChatCompletionStreamingServiceTierDefault ChatCompletionStreamingServiceTier = "default" - ChatCompletionStreamingServiceTierFlex ChatCompletionStreamingServiceTier = "flex" -) - -func (e ChatCompletionStreamingServiceTier) ToPointer() *ChatCompletionStreamingServiceTier { - return &e -} -func (e *ChatCompletionStreamingServiceTier) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "auto": - fallthrough - case "default": - fallthrough - case "flex": - *e = ChatCompletionStreamingServiceTier(v) - return nil - default: - return fmt.Errorf("invalid value for ChatCompletionStreamingServiceTier: %v", v) - } -} - -type ChatCompletionStreamingStopType string - -const ( - ChatCompletionStreamingStopTypeStr ChatCompletionStreamingStopType = "str" - ChatCompletionStreamingStopTypeArrayOfStr ChatCompletionStreamingStopType = "arrayOfStr" -) - -type ChatCompletionStreamingStop struct { - Str *string `queryParam:"inline"` - ArrayOfStr []string `queryParam:"inline"` - - Type ChatCompletionStreamingStopType -} - -func CreateChatCompletionStreamingStopStr(str string) ChatCompletionStreamingStop { - typ := ChatCompletionStreamingStopTypeStr - - return ChatCompletionStreamingStop{ - Str: &str, - Type: typ, - } -} - -func CreateChatCompletionStreamingStopArrayOfStr(arrayOfStr []string) ChatCompletionStreamingStop { - typ := ChatCompletionStreamingStopTypeArrayOfStr - - return ChatCompletionStreamingStop{ - ArrayOfStr: arrayOfStr, - Type: typ, - } -} - -func (u *ChatCompletionStreamingStop) UnmarshalJSON(data []byte) error { - - var str string = "" - if err := utils.UnmarshalJSON(data, &str, "", true, true); err == nil { - u.Str = &str - u.Type = ChatCompletionStreamingStopTypeStr - return nil - } - - var arrayOfStr []string = []string{} - if err := utils.UnmarshalJSON(data, &arrayOfStr, "", true, true); err == nil { - u.ArrayOfStr = arrayOfStr - u.Type = ChatCompletionStreamingStopTypeArrayOfStr - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for ChatCompletionStreamingStop", string(data)) -} - -func (u ChatCompletionStreamingStop) MarshalJSON() ([]byte, error) { - if u.Str != nil { - return utils.MarshalJSON(u.Str, "", true) - } - - if u.ArrayOfStr != nil { - return utils.MarshalJSON(u.ArrayOfStr, "", true) - } - - return nil, errors.New("could not marshal union type ChatCompletionStreamingStop: all fields are null") -} - -type ChatCompletionStreamingToolChoiceEnum string - -const ( - ChatCompletionStreamingToolChoiceEnumNone ChatCompletionStreamingToolChoiceEnum = "none" - ChatCompletionStreamingToolChoiceEnumAuto ChatCompletionStreamingToolChoiceEnum = "auto" - ChatCompletionStreamingToolChoiceEnumRequired ChatCompletionStreamingToolChoiceEnum = "required" -) - -func (e ChatCompletionStreamingToolChoiceEnum) ToPointer() *ChatCompletionStreamingToolChoiceEnum { - return &e -} -func (e *ChatCompletionStreamingToolChoiceEnum) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "none": - fallthrough - case "auto": - fallthrough - case "required": - *e = ChatCompletionStreamingToolChoiceEnum(v) - return nil - default: - return fmt.Errorf("invalid value for ChatCompletionStreamingToolChoiceEnum: %v", v) - } -} - -type ChatCompletionStreamingToolChoiceUnionType string - -const ( - ChatCompletionStreamingToolChoiceUnionTypeChatCompletionStreamingToolChoiceEnum ChatCompletionStreamingToolChoiceUnionType = "ChatCompletionStreaming_Tool Choice_enum" - ChatCompletionStreamingToolChoiceUnionTypeChatCompletionNamedToolChoiceParam ChatCompletionStreamingToolChoiceUnionType = "ChatCompletionNamedToolChoiceParam" -) - -type ChatCompletionStreamingToolChoiceUnion struct { - ChatCompletionStreamingToolChoiceEnum *ChatCompletionStreamingToolChoiceEnum `queryParam:"inline"` - ChatCompletionNamedToolChoiceParam *ChatCompletionNamedToolChoiceParam `queryParam:"inline"` - - Type ChatCompletionStreamingToolChoiceUnionType -} - -func CreateChatCompletionStreamingToolChoiceUnionChatCompletionStreamingToolChoiceEnum(chatCompletionStreamingToolChoiceEnum ChatCompletionStreamingToolChoiceEnum) ChatCompletionStreamingToolChoiceUnion { - typ := ChatCompletionStreamingToolChoiceUnionTypeChatCompletionStreamingToolChoiceEnum - - return ChatCompletionStreamingToolChoiceUnion{ - ChatCompletionStreamingToolChoiceEnum: &chatCompletionStreamingToolChoiceEnum, - Type: typ, - } -} - -func CreateChatCompletionStreamingToolChoiceUnionChatCompletionNamedToolChoiceParam(chatCompletionNamedToolChoiceParam ChatCompletionNamedToolChoiceParam) ChatCompletionStreamingToolChoiceUnion { - typ := ChatCompletionStreamingToolChoiceUnionTypeChatCompletionNamedToolChoiceParam - - return ChatCompletionStreamingToolChoiceUnion{ - ChatCompletionNamedToolChoiceParam: &chatCompletionNamedToolChoiceParam, - Type: typ, - } -} - -func (u *ChatCompletionStreamingToolChoiceUnion) UnmarshalJSON(data []byte) error { - - var chatCompletionNamedToolChoiceParam ChatCompletionNamedToolChoiceParam = ChatCompletionNamedToolChoiceParam{} - if err := utils.UnmarshalJSON(data, &chatCompletionNamedToolChoiceParam, "", true, true); err == nil { - u.ChatCompletionNamedToolChoiceParam = &chatCompletionNamedToolChoiceParam - u.Type = ChatCompletionStreamingToolChoiceUnionTypeChatCompletionNamedToolChoiceParam - return nil - } - - var chatCompletionStreamingToolChoiceEnum ChatCompletionStreamingToolChoiceEnum = ChatCompletionStreamingToolChoiceEnum("") - if err := utils.UnmarshalJSON(data, &chatCompletionStreamingToolChoiceEnum, "", true, true); err == nil { - u.ChatCompletionStreamingToolChoiceEnum = &chatCompletionStreamingToolChoiceEnum - u.Type = ChatCompletionStreamingToolChoiceUnionTypeChatCompletionStreamingToolChoiceEnum - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for ChatCompletionStreamingToolChoiceUnion", string(data)) -} - -func (u ChatCompletionStreamingToolChoiceUnion) MarshalJSON() ([]byte, error) { - if u.ChatCompletionStreamingToolChoiceEnum != nil { - return utils.MarshalJSON(u.ChatCompletionStreamingToolChoiceEnum, "", true) - } - - if u.ChatCompletionNamedToolChoiceParam != nil { - return utils.MarshalJSON(u.ChatCompletionNamedToolChoiceParam, "", true) - } - - return nil, errors.New("could not marshal union type ChatCompletionStreamingToolChoiceUnion: all fields are null") -} - -type ChatCompletionStreaming struct { - Messages []ChatCompletionStreamingMessage `json:"messages"` - Model *TModel `json:"model,omitempty"` - Audio *ChatCompletionAudioParam `json:"audio,omitempty"` - FrequencyPenalty *float64 `json:"frequency_penalty,omitempty"` - FunctionCall *ChatCompletionStreamingFunctionCallUnion `json:"function_call,omitempty"` - Functions []OpenaiTypesChatCompletionCreateParamsFunction `json:"functions,omitempty"` - LogitBias map[string]int64 `json:"logit_bias,omitempty"` - Logprobs *bool `json:"logprobs,omitempty"` - MaxCompletionTokens *int64 `json:"max_completion_tokens,omitempty"` - MaxTokens *int64 `json:"max_tokens,omitempty"` - Metadata map[string]string `json:"metadata,omitempty"` - Modalities []ChatCompletionStreamingModality `json:"modalities,omitempty"` - N *int64 `json:"n,omitempty"` - ParallelToolCalls *bool `json:"parallel_tool_calls,omitempty"` - Prediction *ChatCompletionPredictionContentParam `json:"prediction,omitempty"` - PresencePenalty *float64 `json:"presence_penalty,omitempty"` - ReasoningEffort *ChatCompletionStreamingReasoningEffort `json:"reasoning_effort,omitempty"` - ResponseFormat *ChatCompletionStreamingResponseFormat `json:"response_format,omitempty"` - Seed *int64 `json:"seed,omitempty"` - ServiceTier *ChatCompletionStreamingServiceTier `json:"service_tier,omitempty"` - Stop *ChatCompletionStreamingStop `json:"stop,omitempty"` - Store *bool `json:"store,omitempty"` - StreamOptions *ChatCompletionStreamOptionsParam `json:"stream_options,omitempty"` - Temperature *float64 `json:"temperature,omitempty"` - ToolChoice *ChatCompletionStreamingToolChoiceUnion `json:"tool_choice,omitempty"` - Tools []ChatCompletionToolParam `json:"tools,omitempty"` - TopLogprobs *int64 `json:"top_logprobs,omitempty"` - TopP *float64 `json:"top_p,omitempty"` - User *string `json:"user,omitempty"` - WebSearchOptions *WebSearchOptions `json:"web_search_options,omitempty"` - stream bool `const:"true" json:"stream"` - Tags map[string]any `json:"tags,omitempty"` - ParentSpanID *string `json:"parent_span_id,omitempty"` -} - -func (c ChatCompletionStreaming) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *ChatCompletionStreaming) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, true); err != nil { - return err - } - return nil -} - -func (o *ChatCompletionStreaming) GetMessages() []ChatCompletionStreamingMessage { - if o == nil { - return []ChatCompletionStreamingMessage{} - } - return o.Messages -} - -func (o *ChatCompletionStreaming) GetModel() *TModel { - if o == nil { - return nil - } - return o.Model -} - -func (o *ChatCompletionStreaming) GetAudio() *ChatCompletionAudioParam { - if o == nil { - return nil - } - return o.Audio -} - -func (o *ChatCompletionStreaming) GetFrequencyPenalty() *float64 { - if o == nil { - return nil - } - return o.FrequencyPenalty -} - -func (o *ChatCompletionStreaming) GetFunctionCall() *ChatCompletionStreamingFunctionCallUnion { - if o == nil { - return nil - } - return o.FunctionCall -} - -func (o *ChatCompletionStreaming) GetFunctions() []OpenaiTypesChatCompletionCreateParamsFunction { - if o == nil { - return nil - } - return o.Functions -} - -func (o *ChatCompletionStreaming) GetLogitBias() map[string]int64 { - if o == nil { - return nil - } - return o.LogitBias -} - -func (o *ChatCompletionStreaming) GetLogprobs() *bool { - if o == nil { - return nil - } - return o.Logprobs -} - -func (o *ChatCompletionStreaming) GetMaxCompletionTokens() *int64 { - if o == nil { - return nil - } - return o.MaxCompletionTokens -} - -func (o *ChatCompletionStreaming) GetMaxTokens() *int64 { - if o == nil { - return nil - } - return o.MaxTokens -} - -func (o *ChatCompletionStreaming) GetMetadata() map[string]string { - if o == nil { - return nil - } - return o.Metadata -} - -func (o *ChatCompletionStreaming) GetModalities() []ChatCompletionStreamingModality { - if o == nil { - return nil - } - return o.Modalities -} - -func (o *ChatCompletionStreaming) GetN() *int64 { - if o == nil { - return nil - } - return o.N -} - -func (o *ChatCompletionStreaming) GetParallelToolCalls() *bool { - if o == nil { - return nil - } - return o.ParallelToolCalls -} - -func (o *ChatCompletionStreaming) GetPrediction() *ChatCompletionPredictionContentParam { - if o == nil { - return nil - } - return o.Prediction -} - -func (o *ChatCompletionStreaming) GetPresencePenalty() *float64 { - if o == nil { - return nil - } - return o.PresencePenalty -} - -func (o *ChatCompletionStreaming) GetReasoningEffort() *ChatCompletionStreamingReasoningEffort { - if o == nil { - return nil - } - return o.ReasoningEffort -} - -func (o *ChatCompletionStreaming) GetResponseFormat() *ChatCompletionStreamingResponseFormat { - if o == nil { - return nil - } - return o.ResponseFormat -} - -func (o *ChatCompletionStreaming) GetSeed() *int64 { - if o == nil { - return nil - } - return o.Seed -} - -func (o *ChatCompletionStreaming) GetServiceTier() *ChatCompletionStreamingServiceTier { - if o == nil { - return nil - } - return o.ServiceTier -} - -func (o *ChatCompletionStreaming) GetStop() *ChatCompletionStreamingStop { - if o == nil { - return nil - } - return o.Stop -} - -func (o *ChatCompletionStreaming) GetStore() *bool { - if o == nil { - return nil - } - return o.Store -} - -func (o *ChatCompletionStreaming) GetStreamOptions() *ChatCompletionStreamOptionsParam { - if o == nil { - return nil - } - return o.StreamOptions -} - -func (o *ChatCompletionStreaming) GetTemperature() *float64 { - if o == nil { - return nil - } - return o.Temperature -} - -func (o *ChatCompletionStreaming) GetToolChoice() *ChatCompletionStreamingToolChoiceUnion { - if o == nil { - return nil - } - return o.ToolChoice -} - -func (o *ChatCompletionStreaming) GetTools() []ChatCompletionToolParam { - if o == nil { - return nil - } - return o.Tools -} - -func (o *ChatCompletionStreaming) GetTopLogprobs() *int64 { - if o == nil { - return nil - } - return o.TopLogprobs -} - -func (o *ChatCompletionStreaming) GetTopP() *float64 { - if o == nil { - return nil - } - return o.TopP -} - -func (o *ChatCompletionStreaming) GetUser() *string { - if o == nil { - return nil - } - return o.User -} - -func (o *ChatCompletionStreaming) GetWebSearchOptions() *WebSearchOptions { - if o == nil { - return nil - } - return o.WebSearchOptions -} - -func (o *ChatCompletionStreaming) GetStream() bool { - return true -} - -func (o *ChatCompletionStreaming) GetTags() map[string]any { - if o == nil { - return nil - } - return o.Tags -} - -func (o *ChatCompletionStreaming) GetParentSpanID() *string { - if o == nil { - return nil - } - return o.ParentSpanID -} diff --git a/tests/mockserver/internal/sdk/models/components/chatcompletionstreamoptionsparam.go b/tests/mockserver/internal/sdk/models/components/chatcompletionstreamoptionsparam.go deleted file mode 100644 index 311c0e9..0000000 --- a/tests/mockserver/internal/sdk/models/components/chatcompletionstreamoptionsparam.go +++ /dev/null @@ -1,14 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type ChatCompletionStreamOptionsParam struct { - IncludeUsage *bool `json:"include_usage,omitempty"` -} - -func (o *ChatCompletionStreamOptionsParam) GetIncludeUsage() *bool { - if o == nil { - return nil - } - return o.IncludeUsage -} diff --git a/tests/mockserver/internal/sdk/models/components/chatcompletionsystemmessageparam.go b/tests/mockserver/internal/sdk/models/components/chatcompletionsystemmessageparam.go deleted file mode 100644 index 5629f08..0000000 --- a/tests/mockserver/internal/sdk/models/components/chatcompletionsystemmessageparam.go +++ /dev/null @@ -1,107 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "errors" - "fmt" - "mockserver/internal/sdk/utils" -) - -type ChatCompletionSystemMessageParamContentType string - -const ( - ChatCompletionSystemMessageParamContentTypeStr ChatCompletionSystemMessageParamContentType = "str" - ChatCompletionSystemMessageParamContentTypeArrayOfChatCompletionContentPartTextParam ChatCompletionSystemMessageParamContentType = "arrayOfChatCompletionContentPartTextParam" -) - -type ChatCompletionSystemMessageParamContent struct { - Str *string `queryParam:"inline"` - ArrayOfChatCompletionContentPartTextParam []ChatCompletionContentPartTextParam `queryParam:"inline"` - - Type ChatCompletionSystemMessageParamContentType -} - -func CreateChatCompletionSystemMessageParamContentStr(str string) ChatCompletionSystemMessageParamContent { - typ := ChatCompletionSystemMessageParamContentTypeStr - - return ChatCompletionSystemMessageParamContent{ - Str: &str, - Type: typ, - } -} - -func CreateChatCompletionSystemMessageParamContentArrayOfChatCompletionContentPartTextParam(arrayOfChatCompletionContentPartTextParam []ChatCompletionContentPartTextParam) ChatCompletionSystemMessageParamContent { - typ := ChatCompletionSystemMessageParamContentTypeArrayOfChatCompletionContentPartTextParam - - return ChatCompletionSystemMessageParamContent{ - ArrayOfChatCompletionContentPartTextParam: arrayOfChatCompletionContentPartTextParam, - Type: typ, - } -} - -func (u *ChatCompletionSystemMessageParamContent) UnmarshalJSON(data []byte) error { - - var str string = "" - if err := utils.UnmarshalJSON(data, &str, "", true, true); err == nil { - u.Str = &str - u.Type = ChatCompletionSystemMessageParamContentTypeStr - return nil - } - - var arrayOfChatCompletionContentPartTextParam []ChatCompletionContentPartTextParam = []ChatCompletionContentPartTextParam{} - if err := utils.UnmarshalJSON(data, &arrayOfChatCompletionContentPartTextParam, "", true, true); err == nil { - u.ArrayOfChatCompletionContentPartTextParam = arrayOfChatCompletionContentPartTextParam - u.Type = ChatCompletionSystemMessageParamContentTypeArrayOfChatCompletionContentPartTextParam - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for ChatCompletionSystemMessageParamContent", string(data)) -} - -func (u ChatCompletionSystemMessageParamContent) MarshalJSON() ([]byte, error) { - if u.Str != nil { - return utils.MarshalJSON(u.Str, "", true) - } - - if u.ArrayOfChatCompletionContentPartTextParam != nil { - return utils.MarshalJSON(u.ArrayOfChatCompletionContentPartTextParam, "", true) - } - - return nil, errors.New("could not marshal union type ChatCompletionSystemMessageParamContent: all fields are null") -} - -type ChatCompletionSystemMessageParam struct { - Content ChatCompletionSystemMessageParamContent `json:"content"` - role string `const:"system" json:"role"` - Name *string `json:"name,omitempty"` -} - -func (c ChatCompletionSystemMessageParam) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *ChatCompletionSystemMessageParam) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, true); err != nil { - return err - } - return nil -} - -func (o *ChatCompletionSystemMessageParam) GetContent() ChatCompletionSystemMessageParamContent { - if o == nil { - return ChatCompletionSystemMessageParamContent{} - } - return o.Content -} - -func (o *ChatCompletionSystemMessageParam) GetRole() string { - return "system" -} - -func (o *ChatCompletionSystemMessageParam) GetName() *string { - if o == nil { - return nil - } - return o.Name -} diff --git a/tests/mockserver/internal/sdk/models/components/chatcompletiontokenlogprob.go b/tests/mockserver/internal/sdk/models/components/chatcompletiontokenlogprob.go deleted file mode 100644 index bbe03c2..0000000 --- a/tests/mockserver/internal/sdk/models/components/chatcompletiontokenlogprob.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" -) - -type ChatCompletionTokenLogprob struct { - Token string `json:"token"` - Bytes []int64 `json:"bytes,omitempty"` - Logprob float64 `json:"logprob"` - TopLogprobs []TopLogprob `json:"top_logprobs"` - AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` -} - -func (c ChatCompletionTokenLogprob) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *ChatCompletionTokenLogprob) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *ChatCompletionTokenLogprob) GetToken() string { - if o == nil { - return "" - } - return o.Token -} - -func (o *ChatCompletionTokenLogprob) GetBytes() []int64 { - if o == nil { - return nil - } - return o.Bytes -} - -func (o *ChatCompletionTokenLogprob) GetLogprob() float64 { - if o == nil { - return 0.0 - } - return o.Logprob -} - -func (o *ChatCompletionTokenLogprob) GetTopLogprobs() []TopLogprob { - if o == nil { - return []TopLogprob{} - } - return o.TopLogprobs -} - -func (o *ChatCompletionTokenLogprob) GetAdditionalProperties() map[string]any { - if o == nil { - return nil - } - return o.AdditionalProperties -} diff --git a/tests/mockserver/internal/sdk/models/components/chatcompletiontoolmessageparam.go b/tests/mockserver/internal/sdk/models/components/chatcompletiontoolmessageparam.go deleted file mode 100644 index 1d4f3c1..0000000 --- a/tests/mockserver/internal/sdk/models/components/chatcompletiontoolmessageparam.go +++ /dev/null @@ -1,107 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "errors" - "fmt" - "mockserver/internal/sdk/utils" -) - -type ChatCompletionToolMessageParamContentType string - -const ( - ChatCompletionToolMessageParamContentTypeStr ChatCompletionToolMessageParamContentType = "str" - ChatCompletionToolMessageParamContentTypeArrayOfChatCompletionContentPartTextParam ChatCompletionToolMessageParamContentType = "arrayOfChatCompletionContentPartTextParam" -) - -type ChatCompletionToolMessageParamContent struct { - Str *string `queryParam:"inline"` - ArrayOfChatCompletionContentPartTextParam []ChatCompletionContentPartTextParam `queryParam:"inline"` - - Type ChatCompletionToolMessageParamContentType -} - -func CreateChatCompletionToolMessageParamContentStr(str string) ChatCompletionToolMessageParamContent { - typ := ChatCompletionToolMessageParamContentTypeStr - - return ChatCompletionToolMessageParamContent{ - Str: &str, - Type: typ, - } -} - -func CreateChatCompletionToolMessageParamContentArrayOfChatCompletionContentPartTextParam(arrayOfChatCompletionContentPartTextParam []ChatCompletionContentPartTextParam) ChatCompletionToolMessageParamContent { - typ := ChatCompletionToolMessageParamContentTypeArrayOfChatCompletionContentPartTextParam - - return ChatCompletionToolMessageParamContent{ - ArrayOfChatCompletionContentPartTextParam: arrayOfChatCompletionContentPartTextParam, - Type: typ, - } -} - -func (u *ChatCompletionToolMessageParamContent) UnmarshalJSON(data []byte) error { - - var str string = "" - if err := utils.UnmarshalJSON(data, &str, "", true, true); err == nil { - u.Str = &str - u.Type = ChatCompletionToolMessageParamContentTypeStr - return nil - } - - var arrayOfChatCompletionContentPartTextParam []ChatCompletionContentPartTextParam = []ChatCompletionContentPartTextParam{} - if err := utils.UnmarshalJSON(data, &arrayOfChatCompletionContentPartTextParam, "", true, true); err == nil { - u.ArrayOfChatCompletionContentPartTextParam = arrayOfChatCompletionContentPartTextParam - u.Type = ChatCompletionToolMessageParamContentTypeArrayOfChatCompletionContentPartTextParam - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for ChatCompletionToolMessageParamContent", string(data)) -} - -func (u ChatCompletionToolMessageParamContent) MarshalJSON() ([]byte, error) { - if u.Str != nil { - return utils.MarshalJSON(u.Str, "", true) - } - - if u.ArrayOfChatCompletionContentPartTextParam != nil { - return utils.MarshalJSON(u.ArrayOfChatCompletionContentPartTextParam, "", true) - } - - return nil, errors.New("could not marshal union type ChatCompletionToolMessageParamContent: all fields are null") -} - -type ChatCompletionToolMessageParam struct { - Content ChatCompletionToolMessageParamContent `json:"content"` - role string `const:"tool" json:"role"` - ToolCallID string `json:"tool_call_id"` -} - -func (c ChatCompletionToolMessageParam) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *ChatCompletionToolMessageParam) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, true); err != nil { - return err - } - return nil -} - -func (o *ChatCompletionToolMessageParam) GetContent() ChatCompletionToolMessageParamContent { - if o == nil { - return ChatCompletionToolMessageParamContent{} - } - return o.Content -} - -func (o *ChatCompletionToolMessageParam) GetRole() string { - return "tool" -} - -func (o *ChatCompletionToolMessageParam) GetToolCallID() string { - if o == nil { - return "" - } - return o.ToolCallID -} diff --git a/tests/mockserver/internal/sdk/models/components/chatcompletiontoolparam.go b/tests/mockserver/internal/sdk/models/components/chatcompletiontoolparam.go deleted file mode 100644 index 092e234..0000000 --- a/tests/mockserver/internal/sdk/models/components/chatcompletiontoolparam.go +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" -) - -type ChatCompletionToolParam struct { - Function FunctionDefinition `json:"function"` - type_ string `const:"function" json:"type"` -} - -func (c ChatCompletionToolParam) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *ChatCompletionToolParam) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *ChatCompletionToolParam) GetFunction() FunctionDefinition { - if o == nil { - return FunctionDefinition{} - } - return o.Function -} - -func (o *ChatCompletionToolParam) GetType() string { - return "function" -} diff --git a/tests/mockserver/internal/sdk/models/components/chatcompletionusermessageparam.go b/tests/mockserver/internal/sdk/models/components/chatcompletionusermessageparam.go deleted file mode 100644 index 1b51d81..0000000 --- a/tests/mockserver/internal/sdk/models/components/chatcompletionusermessageparam.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "errors" - "fmt" - "mockserver/internal/sdk/utils" -) - -type ChatCompletionUserMessageParamContent1Type string - -const ( - ChatCompletionUserMessageParamContent1TypeChatCompletionContentPartTextParam ChatCompletionUserMessageParamContent1Type = "ChatCompletionContentPartTextParam" - ChatCompletionUserMessageParamContent1TypeChatCompletionContentPartImageParam ChatCompletionUserMessageParamContent1Type = "ChatCompletionContentPartImageParam" - ChatCompletionUserMessageParamContent1TypeChatCompletionContentPartInputAudioParam ChatCompletionUserMessageParamContent1Type = "ChatCompletionContentPartInputAudioParam" - ChatCompletionUserMessageParamContent1TypeFile ChatCompletionUserMessageParamContent1Type = "File" -) - -type ChatCompletionUserMessageParamContent1 struct { - ChatCompletionContentPartTextParam *ChatCompletionContentPartTextParam `queryParam:"inline"` - ChatCompletionContentPartImageParam *ChatCompletionContentPartImageParam `queryParam:"inline"` - ChatCompletionContentPartInputAudioParam *ChatCompletionContentPartInputAudioParam `queryParam:"inline"` - File *File `queryParam:"inline"` - - Type ChatCompletionUserMessageParamContent1Type -} - -func CreateChatCompletionUserMessageParamContent1ChatCompletionContentPartTextParam(chatCompletionContentPartTextParam ChatCompletionContentPartTextParam) ChatCompletionUserMessageParamContent1 { - typ := ChatCompletionUserMessageParamContent1TypeChatCompletionContentPartTextParam - - return ChatCompletionUserMessageParamContent1{ - ChatCompletionContentPartTextParam: &chatCompletionContentPartTextParam, - Type: typ, - } -} - -func CreateChatCompletionUserMessageParamContent1ChatCompletionContentPartImageParam(chatCompletionContentPartImageParam ChatCompletionContentPartImageParam) ChatCompletionUserMessageParamContent1 { - typ := ChatCompletionUserMessageParamContent1TypeChatCompletionContentPartImageParam - - return ChatCompletionUserMessageParamContent1{ - ChatCompletionContentPartImageParam: &chatCompletionContentPartImageParam, - Type: typ, - } -} - -func CreateChatCompletionUserMessageParamContent1ChatCompletionContentPartInputAudioParam(chatCompletionContentPartInputAudioParam ChatCompletionContentPartInputAudioParam) ChatCompletionUserMessageParamContent1 { - typ := ChatCompletionUserMessageParamContent1TypeChatCompletionContentPartInputAudioParam - - return ChatCompletionUserMessageParamContent1{ - ChatCompletionContentPartInputAudioParam: &chatCompletionContentPartInputAudioParam, - Type: typ, - } -} - -func CreateChatCompletionUserMessageParamContent1File(file File) ChatCompletionUserMessageParamContent1 { - typ := ChatCompletionUserMessageParamContent1TypeFile - - return ChatCompletionUserMessageParamContent1{ - File: &file, - Type: typ, - } -} - -func (u *ChatCompletionUserMessageParamContent1) UnmarshalJSON(data []byte) error { - - var chatCompletionContentPartTextParam ChatCompletionContentPartTextParam = ChatCompletionContentPartTextParam{} - if err := utils.UnmarshalJSON(data, &chatCompletionContentPartTextParam, "", true, true); err == nil { - u.ChatCompletionContentPartTextParam = &chatCompletionContentPartTextParam - u.Type = ChatCompletionUserMessageParamContent1TypeChatCompletionContentPartTextParam - return nil - } - - var chatCompletionContentPartImageParam ChatCompletionContentPartImageParam = ChatCompletionContentPartImageParam{} - if err := utils.UnmarshalJSON(data, &chatCompletionContentPartImageParam, "", true, true); err == nil { - u.ChatCompletionContentPartImageParam = &chatCompletionContentPartImageParam - u.Type = ChatCompletionUserMessageParamContent1TypeChatCompletionContentPartImageParam - return nil - } - - var chatCompletionContentPartInputAudioParam ChatCompletionContentPartInputAudioParam = ChatCompletionContentPartInputAudioParam{} - if err := utils.UnmarshalJSON(data, &chatCompletionContentPartInputAudioParam, "", true, true); err == nil { - u.ChatCompletionContentPartInputAudioParam = &chatCompletionContentPartInputAudioParam - u.Type = ChatCompletionUserMessageParamContent1TypeChatCompletionContentPartInputAudioParam - return nil - } - - var file File = File{} - if err := utils.UnmarshalJSON(data, &file, "", true, true); err == nil { - u.File = &file - u.Type = ChatCompletionUserMessageParamContent1TypeFile - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for ChatCompletionUserMessageParamContent1", string(data)) -} - -func (u ChatCompletionUserMessageParamContent1) MarshalJSON() ([]byte, error) { - if u.ChatCompletionContentPartTextParam != nil { - return utils.MarshalJSON(u.ChatCompletionContentPartTextParam, "", true) - } - - if u.ChatCompletionContentPartImageParam != nil { - return utils.MarshalJSON(u.ChatCompletionContentPartImageParam, "", true) - } - - if u.ChatCompletionContentPartInputAudioParam != nil { - return utils.MarshalJSON(u.ChatCompletionContentPartInputAudioParam, "", true) - } - - if u.File != nil { - return utils.MarshalJSON(u.File, "", true) - } - - return nil, errors.New("could not marshal union type ChatCompletionUserMessageParamContent1: all fields are null") -} - -type ChatCompletionUserMessageParamContent2Type string - -const ( - ChatCompletionUserMessageParamContent2TypeStr ChatCompletionUserMessageParamContent2Type = "str" - ChatCompletionUserMessageParamContent2TypeArrayOfChatCompletionUserMessageParamContent1 ChatCompletionUserMessageParamContent2Type = "arrayOfChatCompletionUserMessageParamContent1" -) - -type ChatCompletionUserMessageParamContent2 struct { - Str *string `queryParam:"inline"` - ArrayOfChatCompletionUserMessageParamContent1 []ChatCompletionUserMessageParamContent1 `queryParam:"inline"` - - Type ChatCompletionUserMessageParamContent2Type -} - -func CreateChatCompletionUserMessageParamContent2Str(str string) ChatCompletionUserMessageParamContent2 { - typ := ChatCompletionUserMessageParamContent2TypeStr - - return ChatCompletionUserMessageParamContent2{ - Str: &str, - Type: typ, - } -} - -func CreateChatCompletionUserMessageParamContent2ArrayOfChatCompletionUserMessageParamContent1(arrayOfChatCompletionUserMessageParamContent1 []ChatCompletionUserMessageParamContent1) ChatCompletionUserMessageParamContent2 { - typ := ChatCompletionUserMessageParamContent2TypeArrayOfChatCompletionUserMessageParamContent1 - - return ChatCompletionUserMessageParamContent2{ - ArrayOfChatCompletionUserMessageParamContent1: arrayOfChatCompletionUserMessageParamContent1, - Type: typ, - } -} - -func (u *ChatCompletionUserMessageParamContent2) UnmarshalJSON(data []byte) error { - - var str string = "" - if err := utils.UnmarshalJSON(data, &str, "", true, true); err == nil { - u.Str = &str - u.Type = ChatCompletionUserMessageParamContent2TypeStr - return nil - } - - var arrayOfChatCompletionUserMessageParamContent1 []ChatCompletionUserMessageParamContent1 = []ChatCompletionUserMessageParamContent1{} - if err := utils.UnmarshalJSON(data, &arrayOfChatCompletionUserMessageParamContent1, "", true, true); err == nil { - u.ArrayOfChatCompletionUserMessageParamContent1 = arrayOfChatCompletionUserMessageParamContent1 - u.Type = ChatCompletionUserMessageParamContent2TypeArrayOfChatCompletionUserMessageParamContent1 - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for ChatCompletionUserMessageParamContent2", string(data)) -} - -func (u ChatCompletionUserMessageParamContent2) MarshalJSON() ([]byte, error) { - if u.Str != nil { - return utils.MarshalJSON(u.Str, "", true) - } - - if u.ArrayOfChatCompletionUserMessageParamContent1 != nil { - return utils.MarshalJSON(u.ArrayOfChatCompletionUserMessageParamContent1, "", true) - } - - return nil, errors.New("could not marshal union type ChatCompletionUserMessageParamContent2: all fields are null") -} - -type ChatCompletionUserMessageParam struct { - Content ChatCompletionUserMessageParamContent2 `json:"content"` - role string `const:"user" json:"role"` - Name *string `json:"name,omitempty"` -} - -func (c ChatCompletionUserMessageParam) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *ChatCompletionUserMessageParam) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, true); err != nil { - return err - } - return nil -} - -func (o *ChatCompletionUserMessageParam) GetContent() ChatCompletionUserMessageParamContent2 { - if o == nil { - return ChatCompletionUserMessageParamContent2{} - } - return o.Content -} - -func (o *ChatCompletionUserMessageParam) GetRole() string { - return "user" -} - -func (o *ChatCompletionUserMessageParam) GetName() *string { - if o == nil { - return nil - } - return o.Name -} diff --git a/tests/mockserver/internal/sdk/models/components/choice.go b/tests/mockserver/internal/sdk/models/components/choice.go deleted file mode 100644 index 28b930f..0000000 --- a/tests/mockserver/internal/sdk/models/components/choice.go +++ /dev/null @@ -1,98 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" -) - -type FinishReason string - -const ( - FinishReasonStop FinishReason = "stop" - FinishReasonLength FinishReason = "length" - FinishReasonToolCalls FinishReason = "tool_calls" - FinishReasonContentFilter FinishReason = "content_filter" - FinishReasonFunctionCall FinishReason = "function_call" -) - -func (e FinishReason) ToPointer() *FinishReason { - return &e -} -func (e *FinishReason) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "stop": - fallthrough - case "length": - fallthrough - case "tool_calls": - fallthrough - case "content_filter": - fallthrough - case "function_call": - *e = FinishReason(v) - return nil - default: - return fmt.Errorf("invalid value for FinishReason: %v", v) - } -} - -type Choice struct { - FinishReason FinishReason `json:"finish_reason"` - Index int64 `json:"index"` - Logprobs *ChoiceLogprobs `json:"logprobs,omitempty"` - Message ChatCompletionMessage `json:"message"` - AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` -} - -func (c Choice) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *Choice) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *Choice) GetFinishReason() FinishReason { - if o == nil { - return FinishReason("") - } - return o.FinishReason -} - -func (o *Choice) GetIndex() int64 { - if o == nil { - return 0 - } - return o.Index -} - -func (o *Choice) GetLogprobs() *ChoiceLogprobs { - if o == nil { - return nil - } - return o.Logprobs -} - -func (o *Choice) GetMessage() ChatCompletionMessage { - if o == nil { - return ChatCompletionMessage{} - } - return o.Message -} - -func (o *Choice) GetAdditionalProperties() map[string]any { - if o == nil { - return nil - } - return o.AdditionalProperties -} diff --git a/tests/mockserver/internal/sdk/models/components/choicelogprobs.go b/tests/mockserver/internal/sdk/models/components/choicelogprobs.go deleted file mode 100644 index 3f32c74..0000000 --- a/tests/mockserver/internal/sdk/models/components/choicelogprobs.go +++ /dev/null @@ -1,45 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" -) - -type ChoiceLogprobs struct { - Content []ChatCompletionTokenLogprob `json:"content,omitempty"` - Refusal []ChatCompletionTokenLogprob `json:"refusal,omitempty"` - AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` -} - -func (c ChoiceLogprobs) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *ChoiceLogprobs) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *ChoiceLogprobs) GetContent() []ChatCompletionTokenLogprob { - if o == nil { - return nil - } - return o.Content -} - -func (o *ChoiceLogprobs) GetRefusal() []ChatCompletionTokenLogprob { - if o == nil { - return nil - } - return o.Refusal -} - -func (o *ChoiceLogprobs) GetAdditionalProperties() map[string]any { - if o == nil { - return nil - } - return o.AdditionalProperties -} diff --git a/tests/mockserver/internal/sdk/models/components/completiontokensdetails.go b/tests/mockserver/internal/sdk/models/components/completiontokensdetails.go deleted file mode 100644 index 533327e..0000000 --- a/tests/mockserver/internal/sdk/models/components/completiontokensdetails.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" -) - -type CompletionTokensDetails struct { - AcceptedPredictionTokens *int64 `json:"accepted_prediction_tokens,omitempty"` - AudioTokens *int64 `json:"audio_tokens,omitempty"` - ReasoningTokens *int64 `json:"reasoning_tokens,omitempty"` - RejectedPredictionTokens *int64 `json:"rejected_prediction_tokens,omitempty"` - AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` -} - -func (c CompletionTokensDetails) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CompletionTokensDetails) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CompletionTokensDetails) GetAcceptedPredictionTokens() *int64 { - if o == nil { - return nil - } - return o.AcceptedPredictionTokens -} - -func (o *CompletionTokensDetails) GetAudioTokens() *int64 { - if o == nil { - return nil - } - return o.AudioTokens -} - -func (o *CompletionTokensDetails) GetReasoningTokens() *int64 { - if o == nil { - return nil - } - return o.ReasoningTokens -} - -func (o *CompletionTokensDetails) GetRejectedPredictionTokens() *int64 { - if o == nil { - return nil - } - return o.RejectedPredictionTokens -} - -func (o *CompletionTokensDetails) GetAdditionalProperties() map[string]any { - if o == nil { - return nil - } - return o.AdditionalProperties -} diff --git a/tests/mockserver/internal/sdk/models/components/completionusage.go b/tests/mockserver/internal/sdk/models/components/completionusage.go deleted file mode 100644 index a61f3a5..0000000 --- a/tests/mockserver/internal/sdk/models/components/completionusage.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" -) - -type CompletionUsage struct { - CompletionTokens int64 `json:"completion_tokens"` - PromptTokens int64 `json:"prompt_tokens"` - TotalTokens int64 `json:"total_tokens"` - CompletionTokensDetails *CompletionTokensDetails `json:"completion_tokens_details,omitempty"` - PromptTokensDetails *PromptTokensDetails `json:"prompt_tokens_details,omitempty"` - AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` -} - -func (c CompletionUsage) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CompletionUsage) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CompletionUsage) GetCompletionTokens() int64 { - if o == nil { - return 0 - } - return o.CompletionTokens -} - -func (o *CompletionUsage) GetPromptTokens() int64 { - if o == nil { - return 0 - } - return o.PromptTokens -} - -func (o *CompletionUsage) GetTotalTokens() int64 { - if o == nil { - return 0 - } - return o.TotalTokens -} - -func (o *CompletionUsage) GetCompletionTokensDetails() *CompletionTokensDetails { - if o == nil { - return nil - } - return o.CompletionTokensDetails -} - -func (o *CompletionUsage) GetPromptTokensDetails() *PromptTokensDetails { - if o == nil { - return nil - } - return o.PromptTokensDetails -} - -func (o *CompletionUsage) GetAdditionalProperties() map[string]any { - if o == nil { - return nil - } - return o.AdditionalProperties -} diff --git a/tests/mockserver/internal/sdk/models/components/createdatasetentryrequest.go b/tests/mockserver/internal/sdk/models/components/createdatasetentryrequest.go deleted file mode 100644 index 94831ee..0000000 --- a/tests/mockserver/internal/sdk/models/components/createdatasetentryrequest.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type CreateDatasetEntryRequest struct { - // The input to the dataset entry - Input any `json:"input"` - // The output to the dataset entry - Output any `json:"output"` - // The expected output to the dataset entry, this is an optionally edited version of the output - Expected any `json:"expected,omitempty"` - // The comment to the dataset entry - Comment *string `json:"comment,omitempty"` -} - -func (o *CreateDatasetEntryRequest) GetInput() any { - if o == nil { - return nil - } - return o.Input -} - -func (o *CreateDatasetEntryRequest) GetOutput() any { - if o == nil { - return nil - } - return o.Output -} - -func (o *CreateDatasetEntryRequest) GetExpected() any { - if o == nil { - return nil - } - return o.Expected -} - -func (o *CreateDatasetEntryRequest) GetComment() *string { - if o == nil { - return nil - } - return o.Comment -} diff --git a/tests/mockserver/internal/sdk/models/components/createdatasetentryresponse.go b/tests/mockserver/internal/sdk/models/components/createdatasetentryresponse.go deleted file mode 100644 index 2147dd1..0000000 --- a/tests/mockserver/internal/sdk/models/components/createdatasetentryresponse.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type CreateDatasetEntryResponse struct { - // The id of the dataset entry - ID string `json:"id"` - // The input to the dataset entry - Input string `json:"input"` - // The output to the dataset entry - Output string `json:"output"` - // The expected output to the dataset entry, this is an optionally edited version of the output - Expected *string `json:"expected,omitempty"` - // The comment to the dataset entry - Comment *string `json:"comment,omitempty"` -} - -func (o *CreateDatasetEntryResponse) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *CreateDatasetEntryResponse) GetInput() string { - if o == nil { - return "" - } - return o.Input -} - -func (o *CreateDatasetEntryResponse) GetOutput() string { - if o == nil { - return "" - } - return o.Output -} - -func (o *CreateDatasetEntryResponse) GetExpected() *string { - if o == nil { - return nil - } - return o.Expected -} - -func (o *CreateDatasetEntryResponse) GetComment() *string { - if o == nil { - return nil - } - return o.Comment -} diff --git a/tests/mockserver/internal/sdk/models/components/createembeddingrequest.go b/tests/mockserver/internal/sdk/models/components/createembeddingrequest.go deleted file mode 100644 index 5dd8480..0000000 --- a/tests/mockserver/internal/sdk/models/components/createembeddingrequest.go +++ /dev/null @@ -1,94 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "errors" - "fmt" - "mockserver/internal/sdk/utils" -) - -type InputType string - -const ( - InputTypeStr InputType = "str" - InputTypeArrayOfStr InputType = "arrayOfStr" -) - -// Input - The input to embed, can be a single string or a list of strings -type Input struct { - Str *string `queryParam:"inline"` - ArrayOfStr []string `queryParam:"inline"` - - Type InputType -} - -func CreateInputStr(str string) Input { - typ := InputTypeStr - - return Input{ - Str: &str, - Type: typ, - } -} - -func CreateInputArrayOfStr(arrayOfStr []string) Input { - typ := InputTypeArrayOfStr - - return Input{ - ArrayOfStr: arrayOfStr, - Type: typ, - } -} - -func (u *Input) UnmarshalJSON(data []byte) error { - - var str string = "" - if err := utils.UnmarshalJSON(data, &str, "", true, true); err == nil { - u.Str = &str - u.Type = InputTypeStr - return nil - } - - var arrayOfStr []string = []string{} - if err := utils.UnmarshalJSON(data, &arrayOfStr, "", true, true); err == nil { - u.ArrayOfStr = arrayOfStr - u.Type = InputTypeArrayOfStr - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for Input", string(data)) -} - -func (u Input) MarshalJSON() ([]byte, error) { - if u.Str != nil { - return utils.MarshalJSON(u.Str, "", true) - } - - if u.ArrayOfStr != nil { - return utils.MarshalJSON(u.ArrayOfStr, "", true) - } - - return nil, errors.New("could not marshal union type Input: all fields are null") -} - -type CreateEmbeddingRequest struct { - // The model to use for the embedding, if not provided, `EmbeddingModel(hosting_provider='Azure', location='EU', identifier='azure/text-embedding-3-large', name='azure/text-embedding-3-large-1536', dimensions=1536, max_tokens=8191, credentials='azure-se', is_default=True, is_public=True, extra={'api_base': 'https://opperopenaiservice.openai.azure.com', 'api_version': '2023-05-15', 'dimensions': 1536})` will be used - Model *TModel `json:"model,omitempty"` - // The input to embed, can be a single string or a list of strings - Input Input `json:"input"` -} - -func (o *CreateEmbeddingRequest) GetModel() *TModel { - if o == nil { - return nil - } - return o.Model -} - -func (o *CreateEmbeddingRequest) GetInput() Input { - if o == nil { - return Input{} - } - return o.Input -} diff --git a/tests/mockserver/internal/sdk/models/components/createembeddingresponse.go b/tests/mockserver/internal/sdk/models/components/createembeddingresponse.go deleted file mode 100644 index 5b1f0c9..0000000 --- a/tests/mockserver/internal/sdk/models/components/createembeddingresponse.go +++ /dev/null @@ -1,33 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type CreateEmbeddingResponse struct { - // The model that was used to create the embedding - Model string `json:"model"` - // The embedding data - Data []map[string]any `json:"data"` - // The usage information - Usage map[string]any `json:"usage"` -} - -func (o *CreateEmbeddingResponse) GetModel() string { - if o == nil { - return "" - } - return o.Model -} - -func (o *CreateEmbeddingResponse) GetData() []map[string]any { - if o == nil { - return []map[string]any{} - } - return o.Data -} - -func (o *CreateEmbeddingResponse) GetUsage() map[string]any { - if o == nil { - return map[string]any{} - } - return o.Usage -} diff --git a/tests/mockserver/internal/sdk/models/components/createfunctionrequest.go b/tests/mockserver/internal/sdk/models/components/createfunctionrequest.go deleted file mode 100644 index c4b46c5..0000000 --- a/tests/mockserver/internal/sdk/models/components/createfunctionrequest.go +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type CreateFunctionRequest struct { - // The name of the function. Must be unique within the project and can only contain letters, numbers, underscores and hyphens. - Name string `json:"name"` - // Optional description of the function. This is used to describe the function to a user. - Description *string `json:"description,omitempty"` - // The instructions for the function, this is the prompt that will be sent to the model to complete the task. Recommended to be concise and to the point - Instructions string `json:"instructions"` - // Optional input schema for the function. Can preferably include field descriptions to allow the model to reason about the input variables. Schema is validated against the input data and issues an error if it does not match. With the Opper SDKs you can define these schemas through libraries like Pydantic and Zod. For schemas with definitions, prefer using '$defs' and '#/$defs/...' references. - InputSchema map[string]any `json:"input_schema,omitempty"` - // Optional output schema for the function. Can preferably include field descriptions to allow the model to reason about the output variables. Schema is validated against the output data and issues an error if it does not match. With the Opper SDKs you can define these schemas through libraries like Pydantic and Zod. For schemas with definitions, prefer using '$defs' and '#/$defs/...' references. - OutputSchema map[string]any `json:"output_schema,omitempty"` - Model *TModel `json:"model,omitempty"` - // Optional configuration for the function.Configuration is a dictionary of key-value pairs that can be used to override the default configuration for the function. - Configuration *FunctionCallConfiguration `json:"configuration,omitempty"` -} - -func (o *CreateFunctionRequest) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *CreateFunctionRequest) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *CreateFunctionRequest) GetInstructions() string { - if o == nil { - return "" - } - return o.Instructions -} - -func (o *CreateFunctionRequest) GetInputSchema() map[string]any { - if o == nil { - return nil - } - return o.InputSchema -} - -func (o *CreateFunctionRequest) GetOutputSchema() map[string]any { - if o == nil { - return nil - } - return o.OutputSchema -} - -func (o *CreateFunctionRequest) GetModel() *TModel { - if o == nil { - return nil - } - return o.Model -} - -func (o *CreateFunctionRequest) GetConfiguration() *FunctionCallConfiguration { - if o == nil { - return nil - } - return o.Configuration -} diff --git a/tests/mockserver/internal/sdk/models/components/createfunctionresponse.go b/tests/mockserver/internal/sdk/models/components/createfunctionresponse.go deleted file mode 100644 index 7e8b35a..0000000 --- a/tests/mockserver/internal/sdk/models/components/createfunctionresponse.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type CreateFunctionResponse struct { - // The name of the function. Must be unique within the project and can only contain letters, numbers, underscores and hyphens. - Name string `json:"name"` - // Optional description of the function. This is used to describe the function to a user. - Description *string `json:"description,omitempty"` - // The instructions for the function, this is the prompt that will be sent to the model to complete the task. Recommended to be concise and to the point - Instructions string `json:"instructions"` - // Optional input schema for the function. Can preferably include field descriptions to allow the model to reason about the input variables. Schema is validated against the input data and issues an error if it does not match. With the Opper SDKs you can define these schemas through libraries like Pydantic and Zod. For schemas with definitions, prefer using '$defs' and '#/$defs/...' references. - InputSchema map[string]any `json:"input_schema,omitempty"` - // Optional output schema for the function. Can preferably include field descriptions to allow the model to reason about the output variables. Schema is validated against the output data and issues an error if it does not match. With the Opper SDKs you can define these schemas through libraries like Pydantic and Zod. For schemas with definitions, prefer using '$defs' and '#/$defs/...' references. - OutputSchema map[string]any `json:"output_schema,omitempty"` - Model *TModel `json:"model,omitempty"` - // Optional configuration for the function.Configuration is a dictionary of key-value pairs that can be used to override the default configuration for the function. - Configuration *FunctionCallConfiguration `json:"configuration,omitempty"` - // The ID of the function - ID string `json:"id"` - // The ID of the dataset associated with the function - DatasetID *string `json:"dataset_id,omitempty"` - // The ID of the latest revision of the function - RevisionID *string `json:"revision_id,omitempty"` -} - -func (o *CreateFunctionResponse) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *CreateFunctionResponse) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *CreateFunctionResponse) GetInstructions() string { - if o == nil { - return "" - } - return o.Instructions -} - -func (o *CreateFunctionResponse) GetInputSchema() map[string]any { - if o == nil { - return nil - } - return o.InputSchema -} - -func (o *CreateFunctionResponse) GetOutputSchema() map[string]any { - if o == nil { - return nil - } - return o.OutputSchema -} - -func (o *CreateFunctionResponse) GetModel() *TModel { - if o == nil { - return nil - } - return o.Model -} - -func (o *CreateFunctionResponse) GetConfiguration() *FunctionCallConfiguration { - if o == nil { - return nil - } - return o.Configuration -} - -func (o *CreateFunctionResponse) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *CreateFunctionResponse) GetDatasetID() *string { - if o == nil { - return nil - } - return o.DatasetID -} - -func (o *CreateFunctionResponse) GetRevisionID() *string { - if o == nil { - return nil - } - return o.RevisionID -} diff --git a/tests/mockserver/internal/sdk/models/components/createknowledgebaserequest.go b/tests/mockserver/internal/sdk/models/components/createknowledgebaserequest.go deleted file mode 100644 index 0071bda..0000000 --- a/tests/mockserver/internal/sdk/models/components/createknowledgebaserequest.go +++ /dev/null @@ -1,38 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" -) - -type CreateKnowledgeBaseRequest struct { - Name string `json:"name"` - // The embedding model to use for the knowledge base - EmbeddingModel *string `default:"azure/text-embedding-3-large" json:"embedding_model"` -} - -func (c CreateKnowledgeBaseRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CreateKnowledgeBaseRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CreateKnowledgeBaseRequest) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *CreateKnowledgeBaseRequest) GetEmbeddingModel() *string { - if o == nil { - return nil - } - return o.EmbeddingModel -} diff --git a/tests/mockserver/internal/sdk/models/components/createknowledgebaseresponse.go b/tests/mockserver/internal/sdk/models/components/createknowledgebaseresponse.go deleted file mode 100644 index 5ab91da..0000000 --- a/tests/mockserver/internal/sdk/models/components/createknowledgebaseresponse.go +++ /dev/null @@ -1,54 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type CreateKnowledgeBaseResponse struct { - ID string `json:"id"` - Name string `json:"name"` - CreatedAt time.Time `json:"created_at"` - EmbeddingModel string `json:"embedding_model"` -} - -func (c CreateKnowledgeBaseResponse) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CreateKnowledgeBaseResponse) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CreateKnowledgeBaseResponse) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *CreateKnowledgeBaseResponse) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *CreateKnowledgeBaseResponse) GetCreatedAt() time.Time { - if o == nil { - return time.Time{} - } - return o.CreatedAt -} - -func (o *CreateKnowledgeBaseResponse) GetEmbeddingModel() string { - if o == nil { - return "" - } - return o.EmbeddingModel -} diff --git a/tests/mockserver/internal/sdk/models/components/createspanmetricrequest.go b/tests/mockserver/internal/sdk/models/components/createspanmetricrequest.go deleted file mode 100644 index 3d84de7..0000000 --- a/tests/mockserver/internal/sdk/models/components/createspanmetricrequest.go +++ /dev/null @@ -1,33 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type CreateSpanMetricRequest struct { - // The dimension of the metric - Dimension string `json:"dimension"` - // The value of the metric - Value float64 `json:"value"` - // A comment about the metric, e.g. a description of the metric - Comment *string `json:"comment,omitempty"` -} - -func (o *CreateSpanMetricRequest) GetDimension() string { - if o == nil { - return "" - } - return o.Dimension -} - -func (o *CreateSpanMetricRequest) GetValue() float64 { - if o == nil { - return 0.0 - } - return o.Value -} - -func (o *CreateSpanMetricRequest) GetComment() *string { - if o == nil { - return nil - } - return o.Comment -} diff --git a/tests/mockserver/internal/sdk/models/components/createspanmetricresponse.go b/tests/mockserver/internal/sdk/models/components/createspanmetricresponse.go deleted file mode 100644 index 2e8061f..0000000 --- a/tests/mockserver/internal/sdk/models/components/createspanmetricresponse.go +++ /dev/null @@ -1,73 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type CreateSpanMetricResponse struct { - // The dimension of the metric - Dimension string `json:"dimension"` - // The value of the metric - Value float64 `json:"value"` - // A comment about the metric, e.g. a description of the metric - Comment *string `json:"comment,omitempty"` - ID string `json:"id"` - SpanID string `json:"span_id"` - CreatedAt time.Time `json:"created_at"` -} - -func (c CreateSpanMetricResponse) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CreateSpanMetricResponse) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CreateSpanMetricResponse) GetDimension() string { - if o == nil { - return "" - } - return o.Dimension -} - -func (o *CreateSpanMetricResponse) GetValue() float64 { - if o == nil { - return 0.0 - } - return o.Value -} - -func (o *CreateSpanMetricResponse) GetComment() *string { - if o == nil { - return nil - } - return o.Comment -} - -func (o *CreateSpanMetricResponse) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *CreateSpanMetricResponse) GetSpanID() string { - if o == nil { - return "" - } - return o.SpanID -} - -func (o *CreateSpanMetricResponse) GetCreatedAt() time.Time { - if o == nil { - return time.Time{} - } - return o.CreatedAt -} diff --git a/tests/mockserver/internal/sdk/models/components/createspanrequest.go b/tests/mockserver/internal/sdk/models/components/createspanrequest.go deleted file mode 100644 index b7d371b..0000000 --- a/tests/mockserver/internal/sdk/models/components/createspanrequest.go +++ /dev/null @@ -1,130 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type CreateSpanRequest struct { - // The name of the span, something descriptive about the span that will be used to identify it when querying - Name string `json:"name"` - // The start time of the span in UTC - StartTime *time.Time `json:"start_time,omitempty"` - // The id of the span - ID *string `json:"id,omitempty"` - // The id of the trace - TraceID *string `json:"trace_id,omitempty"` - // The id of the parent span - ParentID *string `json:"parent_id,omitempty"` - // The type of the span - Type *string `json:"type,omitempty"` - // The end time of the span in UTC - EndTime *time.Time `json:"end_time,omitempty"` - // The input of the span - Input any `json:"input,omitempty"` - // The output of the span - Output any `json:"output,omitempty"` - // In case of an error, the error message - Error *string `json:"error,omitempty"` - // The metadata of the span - Meta map[string]any `json:"meta,omitempty"` - // The score of the span - Score *int64 `json:"score,omitempty"` -} - -func (c CreateSpanRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CreateSpanRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CreateSpanRequest) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *CreateSpanRequest) GetStartTime() *time.Time { - if o == nil { - return nil - } - return o.StartTime -} - -func (o *CreateSpanRequest) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *CreateSpanRequest) GetTraceID() *string { - if o == nil { - return nil - } - return o.TraceID -} - -func (o *CreateSpanRequest) GetParentID() *string { - if o == nil { - return nil - } - return o.ParentID -} - -func (o *CreateSpanRequest) GetType() *string { - if o == nil { - return nil - } - return o.Type -} - -func (o *CreateSpanRequest) GetEndTime() *time.Time { - if o == nil { - return nil - } - return o.EndTime -} - -func (o *CreateSpanRequest) GetInput() any { - if o == nil { - return nil - } - return o.Input -} - -func (o *CreateSpanRequest) GetOutput() any { - if o == nil { - return nil - } - return o.Output -} - -func (o *CreateSpanRequest) GetError() *string { - if o == nil { - return nil - } - return o.Error -} - -func (o *CreateSpanRequest) GetMeta() map[string]any { - if o == nil { - return nil - } - return o.Meta -} - -func (o *CreateSpanRequest) GetScore() *int64 { - if o == nil { - return nil - } - return o.Score -} diff --git a/tests/mockserver/internal/sdk/models/components/createspanresponse.go b/tests/mockserver/internal/sdk/models/components/createspanresponse.go deleted file mode 100644 index 5b68355..0000000 --- a/tests/mockserver/internal/sdk/models/components/createspanresponse.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type CreateSpanResponse struct { - // The name of the span, something descriptive about the span that will be used to identify it when querying - Name string `json:"name"` - // The start time of the span in UTC - StartTime *time.Time `json:"start_time,omitempty"` - ID string `json:"id"` - // The id of the trace - TraceID *string `json:"trace_id,omitempty"` - // The id of the parent span - ParentID *string `json:"parent_id,omitempty"` - // The type of the span - Type *string `json:"type,omitempty"` - // The end time of the span in UTC - EndTime *time.Time `json:"end_time,omitempty"` - // The input of the span - Input any `json:"input,omitempty"` - // The output of the span - Output any `json:"output,omitempty"` - // In case of an error, the error message - Error *string `json:"error,omitempty"` - // The metadata of the span - Meta map[string]any `json:"meta,omitempty"` - // The score of the span - Score *int64 `json:"score,omitempty"` -} - -func (c CreateSpanResponse) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CreateSpanResponse) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CreateSpanResponse) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *CreateSpanResponse) GetStartTime() *time.Time { - if o == nil { - return nil - } - return o.StartTime -} - -func (o *CreateSpanResponse) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *CreateSpanResponse) GetTraceID() *string { - if o == nil { - return nil - } - return o.TraceID -} - -func (o *CreateSpanResponse) GetParentID() *string { - if o == nil { - return nil - } - return o.ParentID -} - -func (o *CreateSpanResponse) GetType() *string { - if o == nil { - return nil - } - return o.Type -} - -func (o *CreateSpanResponse) GetEndTime() *time.Time { - if o == nil { - return nil - } - return o.EndTime -} - -func (o *CreateSpanResponse) GetInput() any { - if o == nil { - return nil - } - return o.Input -} - -func (o *CreateSpanResponse) GetOutput() any { - if o == nil { - return nil - } - return o.Output -} - -func (o *CreateSpanResponse) GetError() *string { - if o == nil { - return nil - } - return o.Error -} - -func (o *CreateSpanResponse) GetMeta() map[string]any { - if o == nil { - return nil - } - return o.Meta -} - -func (o *CreateSpanResponse) GetScore() *int64 { - if o == nil { - return nil - } - return o.Score -} diff --git a/tests/mockserver/internal/sdk/models/components/example.go b/tests/mockserver/internal/sdk/models/components/example.go deleted file mode 100644 index a48b352..0000000 --- a/tests/mockserver/internal/sdk/models/components/example.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type Example struct { - Input any `json:"input"` - Output any `json:"output"` - Comment *string `json:"comment,omitempty"` -} - -func (o *Example) GetInput() any { - if o == nil { - return nil - } - return o.Input -} - -func (o *Example) GetOutput() any { - if o == nil { - return nil - } - return o.Output -} - -func (o *Example) GetComment() *string { - if o == nil { - return nil - } - return o.Comment -} diff --git a/tests/mockserver/internal/sdk/models/components/examplein.go b/tests/mockserver/internal/sdk/models/components/examplein.go deleted file mode 100644 index 764283e..0000000 --- a/tests/mockserver/internal/sdk/models/components/examplein.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type ExampleIn struct { - Input any `json:"input"` - Output any `json:"output"` - Comment *string `json:"comment,omitempty"` -} - -func (o *ExampleIn) GetInput() any { - if o == nil { - return nil - } - return o.Input -} - -func (o *ExampleIn) GetOutput() any { - if o == nil { - return nil - } - return o.Output -} - -func (o *ExampleIn) GetComment() *string { - if o == nil { - return nil - } - return o.Comment -} diff --git a/tests/mockserver/internal/sdk/models/components/file.go b/tests/mockserver/internal/sdk/models/components/file.go deleted file mode 100644 index 600446b..0000000 --- a/tests/mockserver/internal/sdk/models/components/file.go +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" -) - -type File struct { - File FileFile `json:"file"` - type_ string `const:"file" json:"type"` -} - -func (f File) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *File) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, true); err != nil { - return err - } - return nil -} - -func (o *File) GetFile() FileFile { - if o == nil { - return FileFile{} - } - return o.File -} - -func (o *File) GetType() string { - return "file" -} diff --git a/tests/mockserver/internal/sdk/models/components/filefile.go b/tests/mockserver/internal/sdk/models/components/filefile.go deleted file mode 100644 index f55c8ae..0000000 --- a/tests/mockserver/internal/sdk/models/components/filefile.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type FileFile struct { - FileData *string `json:"file_data,omitempty"` - FileID *string `json:"file_id,omitempty"` - Filename *string `json:"filename,omitempty"` -} - -func (o *FileFile) GetFileData() *string { - if o == nil { - return nil - } - return o.FileData -} - -func (o *FileFile) GetFileID() *string { - if o == nil { - return nil - } - return o.FileID -} - -func (o *FileFile) GetFilename() *string { - if o == nil { - return nil - } - return o.Filename -} diff --git a/tests/mockserver/internal/sdk/models/components/filter.go b/tests/mockserver/internal/sdk/models/components/filter.go deleted file mode 100644 index 391a9dc..0000000 --- a/tests/mockserver/internal/sdk/models/components/filter.go +++ /dev/null @@ -1,231 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "errors" - "fmt" - "mockserver/internal/sdk/utils" -) - -type Value1Type string - -const ( - Value1TypeStr Value1Type = "str" - Value1TypeInteger Value1Type = "integer" - Value1TypeNumber Value1Type = "number" -) - -type Value1 struct { - Str *string `queryParam:"inline"` - Integer *int64 `queryParam:"inline"` - Number *float64 `queryParam:"inline"` - - Type Value1Type -} - -func CreateValue1Str(str string) Value1 { - typ := Value1TypeStr - - return Value1{ - Str: &str, - Type: typ, - } -} - -func CreateValue1Integer(integer int64) Value1 { - typ := Value1TypeInteger - - return Value1{ - Integer: &integer, - Type: typ, - } -} - -func CreateValue1Number(number float64) Value1 { - typ := Value1TypeNumber - - return Value1{ - Number: &number, - Type: typ, - } -} - -func (u *Value1) UnmarshalJSON(data []byte) error { - - var str string = "" - if err := utils.UnmarshalJSON(data, &str, "", true, true); err == nil { - u.Str = &str - u.Type = Value1TypeStr - return nil - } - - var integer int64 = int64(0) - if err := utils.UnmarshalJSON(data, &integer, "", true, true); err == nil { - u.Integer = &integer - u.Type = Value1TypeInteger - return nil - } - - var number float64 = float64(0) - if err := utils.UnmarshalJSON(data, &number, "", true, true); err == nil { - u.Number = &number - u.Type = Value1TypeNumber - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for Value1", string(data)) -} - -func (u Value1) MarshalJSON() ([]byte, error) { - if u.Str != nil { - return utils.MarshalJSON(u.Str, "", true) - } - - if u.Integer != nil { - return utils.MarshalJSON(u.Integer, "", true) - } - - if u.Number != nil { - return utils.MarshalJSON(u.Number, "", true) - } - - return nil, errors.New("could not marshal union type Value1: all fields are null") -} - -type Value2Type string - -const ( - Value2TypeStr Value2Type = "str" - Value2TypeInteger Value2Type = "integer" - Value2TypeNumber Value2Type = "number" - Value2TypeArrayOfValue1 Value2Type = "arrayOfValue1" -) - -// Value2 - The value to filter on -type Value2 struct { - Str *string `queryParam:"inline"` - Integer *int64 `queryParam:"inline"` - Number *float64 `queryParam:"inline"` - ArrayOfValue1 []Value1 `queryParam:"inline"` - - Type Value2Type -} - -func CreateValue2Str(str string) Value2 { - typ := Value2TypeStr - - return Value2{ - Str: &str, - Type: typ, - } -} - -func CreateValue2Integer(integer int64) Value2 { - typ := Value2TypeInteger - - return Value2{ - Integer: &integer, - Type: typ, - } -} - -func CreateValue2Number(number float64) Value2 { - typ := Value2TypeNumber - - return Value2{ - Number: &number, - Type: typ, - } -} - -func CreateValue2ArrayOfValue1(arrayOfValue1 []Value1) Value2 { - typ := Value2TypeArrayOfValue1 - - return Value2{ - ArrayOfValue1: arrayOfValue1, - Type: typ, - } -} - -func (u *Value2) UnmarshalJSON(data []byte) error { - - var str string = "" - if err := utils.UnmarshalJSON(data, &str, "", true, true); err == nil { - u.Str = &str - u.Type = Value2TypeStr - return nil - } - - var integer int64 = int64(0) - if err := utils.UnmarshalJSON(data, &integer, "", true, true); err == nil { - u.Integer = &integer - u.Type = Value2TypeInteger - return nil - } - - var number float64 = float64(0) - if err := utils.UnmarshalJSON(data, &number, "", true, true); err == nil { - u.Number = &number - u.Type = Value2TypeNumber - return nil - } - - var arrayOfValue1 []Value1 = []Value1{} - if err := utils.UnmarshalJSON(data, &arrayOfValue1, "", true, true); err == nil { - u.ArrayOfValue1 = arrayOfValue1 - u.Type = Value2TypeArrayOfValue1 - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for Value2", string(data)) -} - -func (u Value2) MarshalJSON() ([]byte, error) { - if u.Str != nil { - return utils.MarshalJSON(u.Str, "", true) - } - - if u.Integer != nil { - return utils.MarshalJSON(u.Integer, "", true) - } - - if u.Number != nil { - return utils.MarshalJSON(u.Number, "", true) - } - - if u.ArrayOfValue1 != nil { - return utils.MarshalJSON(u.ArrayOfValue1, "", true) - } - - return nil, errors.New("could not marshal union type Value2: all fields are null") -} - -type Filter struct { - // The field to filter on - Field string `json:"field"` - Operation Op `json:"operation"` - // The value to filter on - Value Value2 `json:"value"` -} - -func (o *Filter) GetField() string { - if o == nil { - return "" - } - return o.Field -} - -func (o *Filter) GetOperation() Op { - if o == nil { - return Op("") - } - return o.Operation -} - -func (o *Filter) GetValue() Value2 { - if o == nil { - return Value2{} - } - return o.Value -} diff --git a/tests/mockserver/internal/sdk/models/components/functioncallconfiguration.go b/tests/mockserver/internal/sdk/models/components/functioncallconfiguration.go deleted file mode 100644 index 332e34b..0000000 --- a/tests/mockserver/internal/sdk/models/components/functioncallconfiguration.go +++ /dev/null @@ -1,57 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" -) - -type FunctionCallConfiguration struct { - // The number of few-shot examples to use for the call. The examples are selected using nearest neighbor search of the function's dataset for items that are similar to the input. - InvocationFewShotCount *int64 `default:"0" json:"invocation.few_shot.count"` - // Whether to enable evaluation for the call. Evaluation is a beta feature and is enabled by default. - BetaEvaluationEnabled *bool `default:"true" json:"beta.evaluation.enabled"` - // The maximum number of attempts to make when generating a response matching the output schema if provided. - InvocationStructuredGenerationMaxAttempts *int64 `default:"5" json:"invocation.structured_generation.max_attempts"` - // The time to live for the cache in seconds. If 0, the cache is disabled. - InvocationCacheTTL *int64 `default:"0" json:"invocation.cache.ttl"` -} - -func (f FunctionCallConfiguration) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *FunctionCallConfiguration) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { - return err - } - return nil -} - -func (o *FunctionCallConfiguration) GetInvocationFewShotCount() *int64 { - if o == nil { - return nil - } - return o.InvocationFewShotCount -} - -func (o *FunctionCallConfiguration) GetBetaEvaluationEnabled() *bool { - if o == nil { - return nil - } - return o.BetaEvaluationEnabled -} - -func (o *FunctionCallConfiguration) GetInvocationStructuredGenerationMaxAttempts() *int64 { - if o == nil { - return nil - } - return o.InvocationStructuredGenerationMaxAttempts -} - -func (o *FunctionCallConfiguration) GetInvocationCacheTTL() *int64 { - if o == nil { - return nil - } - return o.InvocationCacheTTL -} diff --git a/tests/mockserver/internal/sdk/models/components/functioncallinput.go b/tests/mockserver/internal/sdk/models/components/functioncallinput.go deleted file mode 100644 index 1c32fc8..0000000 --- a/tests/mockserver/internal/sdk/models/components/functioncallinput.go +++ /dev/null @@ -1,22 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type FunctionCallInput struct { - Arguments string `json:"arguments"` - Name string `json:"name"` -} - -func (o *FunctionCallInput) GetArguments() string { - if o == nil { - return "" - } - return o.Arguments -} - -func (o *FunctionCallInput) GetName() string { - if o == nil { - return "" - } - return o.Name -} diff --git a/tests/mockserver/internal/sdk/models/components/functioncalloutput.go b/tests/mockserver/internal/sdk/models/components/functioncalloutput.go deleted file mode 100644 index a4d822a..0000000 --- a/tests/mockserver/internal/sdk/models/components/functioncalloutput.go +++ /dev/null @@ -1,45 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" -) - -type FunctionCallOutput struct { - Arguments string `json:"arguments"` - Name string `json:"name"` - AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` -} - -func (f FunctionCallOutput) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *FunctionCallOutput) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { - return err - } - return nil -} - -func (o *FunctionCallOutput) GetArguments() string { - if o == nil { - return "" - } - return o.Arguments -} - -func (o *FunctionCallOutput) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *FunctionCallOutput) GetAdditionalProperties() map[string]any { - if o == nil { - return nil - } - return o.AdditionalProperties -} diff --git a/tests/mockserver/internal/sdk/models/components/functiondefinition.go b/tests/mockserver/internal/sdk/models/components/functiondefinition.go deleted file mode 100644 index aadbf45..0000000 --- a/tests/mockserver/internal/sdk/models/components/functiondefinition.go +++ /dev/null @@ -1,38 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type FunctionDefinition struct { - Name string `json:"name"` - Description *string `json:"description,omitempty"` - Parameters map[string]any `json:"parameters,omitempty"` - Strict *bool `json:"strict,omitempty"` -} - -func (o *FunctionDefinition) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *FunctionDefinition) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *FunctionDefinition) GetParameters() map[string]any { - if o == nil { - return nil - } - return o.Parameters -} - -func (o *FunctionDefinition) GetStrict() *bool { - if o == nil { - return nil - } - return o.Strict -} diff --git a/tests/mockserver/internal/sdk/models/components/functionoutput.go b/tests/mockserver/internal/sdk/models/components/functionoutput.go deleted file mode 100644 index ea6963a..0000000 --- a/tests/mockserver/internal/sdk/models/components/functionoutput.go +++ /dev/null @@ -1,45 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" -) - -type FunctionOutput struct { - Arguments string `json:"arguments"` - Name string `json:"name"` - AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` -} - -func (f FunctionOutput) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *FunctionOutput) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { - return err - } - return nil -} - -func (o *FunctionOutput) GetArguments() string { - if o == nil { - return "" - } - return o.Arguments -} - -func (o *FunctionOutput) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *FunctionOutput) GetAdditionalProperties() map[string]any { - if o == nil { - return nil - } - return o.AdditionalProperties -} diff --git a/tests/mockserver/internal/sdk/models/components/getcustommodelresponse.go b/tests/mockserver/internal/sdk/models/components/getcustommodelresponse.go deleted file mode 100644 index 2c9e0bf..0000000 --- a/tests/mockserver/internal/sdk/models/components/getcustommodelresponse.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type GetCustomModelResponse struct { - // The ID of the custom language model - ID string `json:"id"` - // The name of the custom language model - Name string `json:"name"` - // The identifier of the custom language model - Identifier string `json:"identifier"` - // Extra metadata about the custom language model - Extra map[string]any `json:"extra,omitempty"` -} - -func (o *GetCustomModelResponse) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *GetCustomModelResponse) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *GetCustomModelResponse) GetIdentifier() string { - if o == nil { - return "" - } - return o.Identifier -} - -func (o *GetCustomModelResponse) GetExtra() map[string]any { - if o == nil { - return nil - } - return o.Extra -} diff --git a/tests/mockserver/internal/sdk/models/components/getdatasetentriesresponse.go b/tests/mockserver/internal/sdk/models/components/getdatasetentriesresponse.go deleted file mode 100644 index 7077278..0000000 --- a/tests/mockserver/internal/sdk/models/components/getdatasetentriesresponse.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type GetDatasetEntriesResponse struct { - // The id of the dataset entry - ID string `json:"id"` - // The input to the dataset entry - Input string `json:"input"` - // The output to the dataset entry - Output string `json:"output"` - // The expected output to the dataset entry, this is an optionally edited version of the output - Expected *string `json:"expected,omitempty"` - // The comment to the dataset entry - Comment *string `json:"comment,omitempty"` -} - -func (o *GetDatasetEntriesResponse) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *GetDatasetEntriesResponse) GetInput() string { - if o == nil { - return "" - } - return o.Input -} - -func (o *GetDatasetEntriesResponse) GetOutput() string { - if o == nil { - return "" - } - return o.Output -} - -func (o *GetDatasetEntriesResponse) GetExpected() *string { - if o == nil { - return nil - } - return o.Expected -} - -func (o *GetDatasetEntriesResponse) GetComment() *string { - if o == nil { - return nil - } - return o.Comment -} diff --git a/tests/mockserver/internal/sdk/models/components/getdatasetentryresponse.go b/tests/mockserver/internal/sdk/models/components/getdatasetentryresponse.go deleted file mode 100644 index bf2d210..0000000 --- a/tests/mockserver/internal/sdk/models/components/getdatasetentryresponse.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type GetDatasetEntryResponse struct { - // The id of the dataset entry - ID string `json:"id"` - // The input to the dataset entry - Input string `json:"input"` - // The output to the dataset entry - Output string `json:"output"` - // The expected output to the dataset entry, this is an optionally edited version of the output - Expected *string `json:"expected,omitempty"` - // The comment to the dataset entry - Comment *string `json:"comment,omitempty"` -} - -func (o *GetDatasetEntryResponse) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *GetDatasetEntryResponse) GetInput() string { - if o == nil { - return "" - } - return o.Input -} - -func (o *GetDatasetEntryResponse) GetOutput() string { - if o == nil { - return "" - } - return o.Output -} - -func (o *GetDatasetEntryResponse) GetExpected() *string { - if o == nil { - return nil - } - return o.Expected -} - -func (o *GetDatasetEntryResponse) GetComment() *string { - if o == nil { - return nil - } - return o.Comment -} diff --git a/tests/mockserver/internal/sdk/models/components/getfunctionresponse.go b/tests/mockserver/internal/sdk/models/components/getfunctionresponse.go deleted file mode 100644 index 1cc1017..0000000 --- a/tests/mockserver/internal/sdk/models/components/getfunctionresponse.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type GetFunctionResponse struct { - // The name of the function. Must be unique within the project and can only contain letters, numbers, underscores and hyphens. - Name string `json:"name"` - // Optional description of the function. This is used to describe the function to a user. - Description *string `json:"description,omitempty"` - // The instructions for the function, this is the prompt that will be sent to the model to complete the task. Recommended to be concise and to the point - Instructions string `json:"instructions"` - // Optional input schema for the function. Can preferably include field descriptions to allow the model to reason about the input variables. Schema is validated against the input data and issues an error if it does not match. With the Opper SDKs you can define these schemas through libraries like Pydantic and Zod. For schemas with definitions, prefer using '$defs' and '#/$defs/...' references. - InputSchema map[string]any `json:"input_schema,omitempty"` - // Optional output schema for the function. Can preferably include field descriptions to allow the model to reason about the output variables. Schema is validated against the output data and issues an error if it does not match. With the Opper SDKs you can define these schemas through libraries like Pydantic and Zod. For schemas with definitions, prefer using '$defs' and '#/$defs/...' references. - OutputSchema map[string]any `json:"output_schema,omitempty"` - Model *TModel `json:"model,omitempty"` - // Optional configuration for the function.Configuration is a dictionary of key-value pairs that can be used to override the default configuration for the function. - Configuration *FunctionCallConfiguration `json:"configuration,omitempty"` - // The ID of the function - ID string `json:"id"` - // The ID of the dataset associated with the function - DatasetID *string `json:"dataset_id,omitempty"` - // The ID of the latest revision of the function - RevisionID *string `json:"revision_id,omitempty"` -} - -func (o *GetFunctionResponse) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *GetFunctionResponse) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *GetFunctionResponse) GetInstructions() string { - if o == nil { - return "" - } - return o.Instructions -} - -func (o *GetFunctionResponse) GetInputSchema() map[string]any { - if o == nil { - return nil - } - return o.InputSchema -} - -func (o *GetFunctionResponse) GetOutputSchema() map[string]any { - if o == nil { - return nil - } - return o.OutputSchema -} - -func (o *GetFunctionResponse) GetModel() *TModel { - if o == nil { - return nil - } - return o.Model -} - -func (o *GetFunctionResponse) GetConfiguration() *FunctionCallConfiguration { - if o == nil { - return nil - } - return o.Configuration -} - -func (o *GetFunctionResponse) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *GetFunctionResponse) GetDatasetID() *string { - if o == nil { - return nil - } - return o.DatasetID -} - -func (o *GetFunctionResponse) GetRevisionID() *string { - if o == nil { - return nil - } - return o.RevisionID -} diff --git a/tests/mockserver/internal/sdk/models/components/getknowledgebaseresponse.go b/tests/mockserver/internal/sdk/models/components/getknowledgebaseresponse.go deleted file mode 100644 index 6d1cfed..0000000 --- a/tests/mockserver/internal/sdk/models/components/getknowledgebaseresponse.go +++ /dev/null @@ -1,54 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type GetKnowledgeBaseResponse struct { - ID string `json:"id"` - Name string `json:"name"` - CreatedAt time.Time `json:"created_at"` - EmbeddingModel string `json:"embedding_model"` -} - -func (g GetKnowledgeBaseResponse) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetKnowledgeBaseResponse) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { - return err - } - return nil -} - -func (o *GetKnowledgeBaseResponse) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *GetKnowledgeBaseResponse) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *GetKnowledgeBaseResponse) GetCreatedAt() time.Time { - if o == nil { - return time.Time{} - } - return o.CreatedAt -} - -func (o *GetKnowledgeBaseResponse) GetEmbeddingModel() string { - if o == nil { - return "" - } - return o.EmbeddingModel -} diff --git a/tests/mockserver/internal/sdk/models/components/getspanmetricresponse.go b/tests/mockserver/internal/sdk/models/components/getspanmetricresponse.go deleted file mode 100644 index 60e8fbe..0000000 --- a/tests/mockserver/internal/sdk/models/components/getspanmetricresponse.go +++ /dev/null @@ -1,73 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type GetSpanMetricResponse struct { - // The dimension of the metric - Dimension string `json:"dimension"` - // The value of the metric - Value float64 `json:"value"` - // A comment about the metric, e.g. a description of the metric - Comment *string `json:"comment,omitempty"` - ID string `json:"id"` - SpanID string `json:"span_id"` - CreatedAt time.Time `json:"created_at"` -} - -func (g GetSpanMetricResponse) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetSpanMetricResponse) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { - return err - } - return nil -} - -func (o *GetSpanMetricResponse) GetDimension() string { - if o == nil { - return "" - } - return o.Dimension -} - -func (o *GetSpanMetricResponse) GetValue() float64 { - if o == nil { - return 0.0 - } - return o.Value -} - -func (o *GetSpanMetricResponse) GetComment() *string { - if o == nil { - return nil - } - return o.Comment -} - -func (o *GetSpanMetricResponse) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *GetSpanMetricResponse) GetSpanID() string { - if o == nil { - return "" - } - return o.SpanID -} - -func (o *GetSpanMetricResponse) GetCreatedAt() time.Time { - if o == nil { - return time.Time{} - } - return o.CreatedAt -} diff --git a/tests/mockserver/internal/sdk/models/components/getspanresponse.go b/tests/mockserver/internal/sdk/models/components/getspanresponse.go deleted file mode 100644 index 923a31b..0000000 --- a/tests/mockserver/internal/sdk/models/components/getspanresponse.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type GetSpanResponse struct { - // The name of the span, something descriptive about the span that will be used to identify it when querying - Name string `json:"name"` - // The start time of the span in UTC - StartTime *time.Time `json:"start_time,omitempty"` - ID string `json:"id"` - // The id of the trace - TraceID *string `json:"trace_id,omitempty"` - // The id of the parent span - ParentID *string `json:"parent_id,omitempty"` - // The type of the span - Type *string `json:"type,omitempty"` - // The end time of the span in UTC - EndTime *time.Time `json:"end_time,omitempty"` - // The input of the span - Input any `json:"input,omitempty"` - // The output of the span - Output any `json:"output,omitempty"` - // In case of an error, the error message - Error *string `json:"error,omitempty"` - // The metadata of the span - Meta map[string]any `json:"meta,omitempty"` - // The score of the span - Score *int64 `json:"score,omitempty"` -} - -func (g GetSpanResponse) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetSpanResponse) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { - return err - } - return nil -} - -func (o *GetSpanResponse) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *GetSpanResponse) GetStartTime() *time.Time { - if o == nil { - return nil - } - return o.StartTime -} - -func (o *GetSpanResponse) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *GetSpanResponse) GetTraceID() *string { - if o == nil { - return nil - } - return o.TraceID -} - -func (o *GetSpanResponse) GetParentID() *string { - if o == nil { - return nil - } - return o.ParentID -} - -func (o *GetSpanResponse) GetType() *string { - if o == nil { - return nil - } - return o.Type -} - -func (o *GetSpanResponse) GetEndTime() *time.Time { - if o == nil { - return nil - } - return o.EndTime -} - -func (o *GetSpanResponse) GetInput() any { - if o == nil { - return nil - } - return o.Input -} - -func (o *GetSpanResponse) GetOutput() any { - if o == nil { - return nil - } - return o.Output -} - -func (o *GetSpanResponse) GetError() *string { - if o == nil { - return nil - } - return o.Error -} - -func (o *GetSpanResponse) GetMeta() map[string]any { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetSpanResponse) GetScore() *int64 { - if o == nil { - return nil - } - return o.Score -} diff --git a/tests/mockserver/internal/sdk/models/components/gettraceresponse.go b/tests/mockserver/internal/sdk/models/components/gettraceresponse.go deleted file mode 100644 index d35f91f..0000000 --- a/tests/mockserver/internal/sdk/models/components/gettraceresponse.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type GetTraceResponse struct { - // The id of the trace - ID string `json:"id"` - // The start time of the trace - StartTime *time.Time `json:"start_time,omitempty"` - // The end time of the trace - EndTime *time.Time `json:"end_time,omitempty"` - // The duration of the trace - DurationMs *int64 `json:"duration_ms,omitempty"` - // The status of the trace - Status *string `json:"status,omitempty"` - // The name of the trace, set to the name of the root span of the trace - Name *string `json:"name,omitempty"` - // The input of the trace, set to the input of the root span of the trace - Input *string `json:"input,omitempty"` - // The output of the trace, set to the output of the root span of the trace - Output *string `json:"output,omitempty"` - // The total tokens of the trace - TotalTokens *int64 `json:"total_tokens,omitempty"` - // The spans of the trace - Spans []SpanSchema `json:"spans,omitempty"` -} - -func (g GetTraceResponse) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetTraceResponse) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { - return err - } - return nil -} - -func (o *GetTraceResponse) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *GetTraceResponse) GetStartTime() *time.Time { - if o == nil { - return nil - } - return o.StartTime -} - -func (o *GetTraceResponse) GetEndTime() *time.Time { - if o == nil { - return nil - } - return o.EndTime -} - -func (o *GetTraceResponse) GetDurationMs() *int64 { - if o == nil { - return nil - } - return o.DurationMs -} - -func (o *GetTraceResponse) GetStatus() *string { - if o == nil { - return nil - } - return o.Status -} - -func (o *GetTraceResponse) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *GetTraceResponse) GetInput() *string { - if o == nil { - return nil - } - return o.Input -} - -func (o *GetTraceResponse) GetOutput() *string { - if o == nil { - return nil - } - return o.Output -} - -func (o *GetTraceResponse) GetTotalTokens() *int64 { - if o == nil { - return nil - } - return o.TotalTokens -} - -func (o *GetTraceResponse) GetSpans() []SpanSchema { - if o == nil { - return nil - } - return o.Spans -} diff --git a/tests/mockserver/internal/sdk/models/components/getuploadurlresponse.go b/tests/mockserver/internal/sdk/models/components/getuploadurlresponse.go deleted file mode 100644 index b56c7c3..0000000 --- a/tests/mockserver/internal/sdk/models/components/getuploadurlresponse.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type GetUploadURLResponse struct { - URL string `json:"url"` - Fields map[string]any `json:"fields"` - ID string `json:"id"` -} - -func (o *GetUploadURLResponse) GetURL() string { - if o == nil { - return "" - } - return o.URL -} - -func (o *GetUploadURLResponse) GetFields() map[string]any { - if o == nil { - return map[string]any{} - } - return o.Fields -} - -func (o *GetUploadURLResponse) GetID() string { - if o == nil { - return "" - } - return o.ID -} diff --git a/tests/mockserver/internal/sdk/models/components/getusageresultitem.go b/tests/mockserver/internal/sdk/models/components/getusageresultitem.go deleted file mode 100644 index 1026b3b..0000000 --- a/tests/mockserver/internal/sdk/models/components/getusageresultitem.go +++ /dev/null @@ -1,48 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type GetUsageResultItem struct { - // The start time of the time bucket - TimeBucket time.Time `json:"time_bucket"` - // The cost in USD for the time bucket - Cost string `json:"cost"` - AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` -} - -func (g GetUsageResultItem) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetUsageResultItem) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { - return err - } - return nil -} - -func (o *GetUsageResultItem) GetTimeBucket() time.Time { - if o == nil { - return time.Time{} - } - return o.TimeBucket -} - -func (o *GetUsageResultItem) GetCost() string { - if o == nil { - return "" - } - return o.Cost -} - -func (o *GetUsageResultItem) GetAdditionalProperties() map[string]any { - if o == nil { - return nil - } - return o.AdditionalProperties -} diff --git a/tests/mockserver/internal/sdk/models/components/granularity.go b/tests/mockserver/internal/sdk/models/components/granularity.go deleted file mode 100644 index 7308cfa..0000000 --- a/tests/mockserver/internal/sdk/models/components/granularity.go +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -type Granularity string - -const ( - GranularityMinute Granularity = "minute" - GranularityHour Granularity = "hour" - GranularityDay Granularity = "day" - GranularityMonth Granularity = "month" - GranularityYear Granularity = "year" -) - -func (e Granularity) ToPointer() *Granularity { - return &e -} -func (e *Granularity) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "minute": - fallthrough - case "hour": - fallthrough - case "day": - fallthrough - case "month": - fallthrough - case "year": - *e = Granularity(v) - return nil - default: - return fmt.Errorf("invalid value for Granularity: %v", v) - } -} diff --git a/tests/mockserver/internal/sdk/models/components/httpmetadata.go b/tests/mockserver/internal/sdk/models/components/httpmetadata.go deleted file mode 100644 index e18bdc0..0000000 --- a/tests/mockserver/internal/sdk/models/components/httpmetadata.go +++ /dev/null @@ -1,28 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "net/http" -) - -type HTTPMetadata struct { - // Raw HTTP response; suitable for custom response parsing - Response *http.Response `json:"-"` - // Raw HTTP request; suitable for debugging - Request *http.Request `json:"-"` -} - -func (o *HTTPMetadata) GetResponse() *http.Response { - if o == nil { - return nil - } - return o.Response -} - -func (o *HTTPMetadata) GetRequest() *http.Request { - if o == nil { - return nil - } - return o.Request -} diff --git a/tests/mockserver/internal/sdk/models/components/imageurl.go b/tests/mockserver/internal/sdk/models/components/imageurl.go deleted file mode 100644 index 82bba61..0000000 --- a/tests/mockserver/internal/sdk/models/components/imageurl.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -type Detail string - -const ( - DetailAuto Detail = "auto" - DetailLow Detail = "low" - DetailHigh Detail = "high" -) - -func (e Detail) ToPointer() *Detail { - return &e -} -func (e *Detail) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "auto": - fallthrough - case "low": - fallthrough - case "high": - *e = Detail(v) - return nil - default: - return fmt.Errorf("invalid value for Detail: %v", v) - } -} - -type ImageURL struct { - URL string `json:"url"` - Detail *Detail `json:"detail,omitempty"` -} - -func (o *ImageURL) GetURL() string { - if o == nil { - return "" - } - return o.URL -} - -func (o *ImageURL) GetDetail() *Detail { - if o == nil { - return nil - } - return o.Detail -} diff --git a/tests/mockserver/internal/sdk/models/components/inputaudio.go b/tests/mockserver/internal/sdk/models/components/inputaudio.go deleted file mode 100644 index 65d781d..0000000 --- a/tests/mockserver/internal/sdk/models/components/inputaudio.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -type InputAudioFormat string - -const ( - InputAudioFormatWav InputAudioFormat = "wav" - InputAudioFormatMp3 InputAudioFormat = "mp3" -) - -func (e InputAudioFormat) ToPointer() *InputAudioFormat { - return &e -} -func (e *InputAudioFormat) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "wav": - fallthrough - case "mp3": - *e = InputAudioFormat(v) - return nil - default: - return fmt.Errorf("invalid value for InputAudioFormat: %v", v) - } -} - -type InputAudio struct { - Data string `json:"data"` - Format InputAudioFormat `json:"format"` -} - -func (o *InputAudio) GetData() string { - if o == nil { - return "" - } - return o.Data -} - -func (o *InputAudio) GetFormat() InputAudioFormat { - if o == nil { - return InputAudioFormat("") - } - return o.Format -} diff --git a/tests/mockserver/internal/sdk/models/components/jsonschema.go b/tests/mockserver/internal/sdk/models/components/jsonschema.go deleted file mode 100644 index e7cbda1..0000000 --- a/tests/mockserver/internal/sdk/models/components/jsonschema.go +++ /dev/null @@ -1,38 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type JSONSchema struct { - Name string `json:"name"` - Description *string `json:"description,omitempty"` - Schema map[string]any `json:"schema,omitempty"` - Strict *bool `json:"strict,omitempty"` -} - -func (o *JSONSchema) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *JSONSchema) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *JSONSchema) GetSchema() map[string]any { - if o == nil { - return nil - } - return o.Schema -} - -func (o *JSONSchema) GetStrict() *bool { - if o == nil { - return nil - } - return o.Strict -} diff --git a/tests/mockserver/internal/sdk/models/components/listcustommodelsresponseitem.go b/tests/mockserver/internal/sdk/models/components/listcustommodelsresponseitem.go deleted file mode 100644 index 8312d5b..0000000 --- a/tests/mockserver/internal/sdk/models/components/listcustommodelsresponseitem.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type ListCustomModelsResponseItem struct { - // The ID of the custom language model - ID string `json:"id"` - // The name of the custom language model - Name string `json:"name"` - // The identifier of the custom language model - Identifier string `json:"identifier"` - // Extra metadata about the custom language model - Extra map[string]any `json:"extra,omitempty"` -} - -func (o *ListCustomModelsResponseItem) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *ListCustomModelsResponseItem) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *ListCustomModelsResponseItem) GetIdentifier() string { - if o == nil { - return "" - } - return o.Identifier -} - -func (o *ListCustomModelsResponseItem) GetExtra() map[string]any { - if o == nil { - return nil - } - return o.Extra -} diff --git a/tests/mockserver/internal/sdk/models/components/listfunctionrevisionresponse.go b/tests/mockserver/internal/sdk/models/components/listfunctionrevisionresponse.go deleted file mode 100644 index 2407205..0000000 --- a/tests/mockserver/internal/sdk/models/components/listfunctionrevisionresponse.go +++ /dev/null @@ -1,54 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type ListFunctionRevisionResponse struct { - ID string `json:"id"` - Configuration map[string]any `json:"configuration"` - CreatedAt time.Time `json:"created_at"` - UpdatedAt *time.Time `json:"updated_at,omitempty"` -} - -func (l ListFunctionRevisionResponse) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(l, "", false) -} - -func (l *ListFunctionRevisionResponse) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { - return err - } - return nil -} - -func (o *ListFunctionRevisionResponse) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *ListFunctionRevisionResponse) GetConfiguration() map[string]any { - if o == nil { - return map[string]any{} - } - return o.Configuration -} - -func (o *ListFunctionRevisionResponse) GetCreatedAt() time.Time { - if o == nil { - return time.Time{} - } - return o.CreatedAt -} - -func (o *ListFunctionRevisionResponse) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} diff --git a/tests/mockserver/internal/sdk/models/components/listfunctionsresponseitem.go b/tests/mockserver/internal/sdk/models/components/listfunctionsresponseitem.go deleted file mode 100644 index 315bbe2..0000000 --- a/tests/mockserver/internal/sdk/models/components/listfunctionsresponseitem.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type ListFunctionsResponseItem struct { - // The ID of the function - ID string `json:"id"` - // The name of the function - Name string `json:"name"` - // The description of the function - Description *string `json:"description,omitempty"` - // The instructions of the function - Instructions *string `json:"instructions,omitempty"` - // The model of the function - Model *TModel `json:"model,omitempty"` - // The ID of the latest revision of the function - RevisionID string `json:"revision_id"` -} - -func (o *ListFunctionsResponseItem) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *ListFunctionsResponseItem) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *ListFunctionsResponseItem) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *ListFunctionsResponseItem) GetInstructions() *string { - if o == nil { - return nil - } - return o.Instructions -} - -func (o *ListFunctionsResponseItem) GetModel() *TModel { - if o == nil { - return nil - } - return o.Model -} - -func (o *ListFunctionsResponseItem) GetRevisionID() string { - if o == nil { - return "" - } - return o.RevisionID -} diff --git a/tests/mockserver/internal/sdk/models/components/listknowledgebasesresponse.go b/tests/mockserver/internal/sdk/models/components/listknowledgebasesresponse.go deleted file mode 100644 index 3654fc4..0000000 --- a/tests/mockserver/internal/sdk/models/components/listknowledgebasesresponse.go +++ /dev/null @@ -1,54 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type ListKnowledgeBasesResponse struct { - ID string `json:"id"` - Name string `json:"name"` - CreatedAt time.Time `json:"created_at"` - EmbeddingModel string `json:"embedding_model"` -} - -func (l ListKnowledgeBasesResponse) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(l, "", false) -} - -func (l *ListKnowledgeBasesResponse) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { - return err - } - return nil -} - -func (o *ListKnowledgeBasesResponse) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *ListKnowledgeBasesResponse) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *ListKnowledgeBasesResponse) GetCreatedAt() time.Time { - if o == nil { - return time.Time{} - } - return o.CreatedAt -} - -func (o *ListKnowledgeBasesResponse) GetEmbeddingModel() string { - if o == nil { - return "" - } - return o.EmbeddingModel -} diff --git a/tests/mockserver/internal/sdk/models/components/listlanguagemodelsresponse.go b/tests/mockserver/internal/sdk/models/components/listlanguagemodelsresponse.go deleted file mode 100644 index 6bf3f64..0000000 --- a/tests/mockserver/internal/sdk/models/components/listlanguagemodelsresponse.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type ListLanguageModelsResponse struct { - // The hosting provider of the model - HostingProvider string `json:"hosting_provider"` - // The name of the model - Name string `json:"name"` - // The location of the model - Location string `json:"location"` - // The cost in USD per token for input - InputCostPerToken *float64 `json:"input_cost_per_token,omitempty"` - // The cost in USD per token for output - OutputCostPerToken *float64 `json:"output_cost_per_token,omitempty"` -} - -func (o *ListLanguageModelsResponse) GetHostingProvider() string { - if o == nil { - return "" - } - return o.HostingProvider -} - -func (o *ListLanguageModelsResponse) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *ListLanguageModelsResponse) GetLocation() string { - if o == nil { - return "" - } - return o.Location -} - -func (o *ListLanguageModelsResponse) GetInputCostPerToken() *float64 { - if o == nil { - return nil - } - return o.InputCostPerToken -} - -func (o *ListLanguageModelsResponse) GetOutputCostPerToken() *float64 { - if o == nil { - return nil - } - return o.OutputCostPerToken -} diff --git a/tests/mockserver/internal/sdk/models/components/listspanmetricsresponse.go b/tests/mockserver/internal/sdk/models/components/listspanmetricsresponse.go deleted file mode 100644 index 739f7f0..0000000 --- a/tests/mockserver/internal/sdk/models/components/listspanmetricsresponse.go +++ /dev/null @@ -1,73 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type ListSpanMetricsResponse struct { - // The dimension of the metric - Dimension string `json:"dimension"` - // The value of the metric - Value float64 `json:"value"` - // A comment about the metric, e.g. a description of the metric - Comment *string `json:"comment,omitempty"` - ID string `json:"id"` - SpanID string `json:"span_id"` - CreatedAt time.Time `json:"created_at"` -} - -func (l ListSpanMetricsResponse) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(l, "", false) -} - -func (l *ListSpanMetricsResponse) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { - return err - } - return nil -} - -func (o *ListSpanMetricsResponse) GetDimension() string { - if o == nil { - return "" - } - return o.Dimension -} - -func (o *ListSpanMetricsResponse) GetValue() float64 { - if o == nil { - return 0.0 - } - return o.Value -} - -func (o *ListSpanMetricsResponse) GetComment() *string { - if o == nil { - return nil - } - return o.Comment -} - -func (o *ListSpanMetricsResponse) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *ListSpanMetricsResponse) GetSpanID() string { - if o == nil { - return "" - } - return o.SpanID -} - -func (o *ListSpanMetricsResponse) GetCreatedAt() time.Time { - if o == nil { - return time.Time{} - } - return o.CreatedAt -} diff --git a/tests/mockserver/internal/sdk/models/components/listtracesresponse.go b/tests/mockserver/internal/sdk/models/components/listtracesresponse.go deleted file mode 100644 index c8c4891..0000000 --- a/tests/mockserver/internal/sdk/models/components/listtracesresponse.go +++ /dev/null @@ -1,103 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type ListTracesResponse struct { - // The id of the trace - ID string `json:"id"` - // The start time of the trace - StartTime *time.Time `json:"start_time,omitempty"` - // The end time of the trace - EndTime *time.Time `json:"end_time,omitempty"` - // The duration of the trace - DurationMs *int64 `json:"duration_ms,omitempty"` - // The status of the trace - Status *string `json:"status,omitempty"` - // The name of the trace, set to the name of the root span of the trace - Name *string `json:"name,omitempty"` - // The input of the trace, set to the input of the root span of the trace - Input *string `json:"input,omitempty"` - // The output of the trace, set to the output of the root span of the trace - Output *string `json:"output,omitempty"` - // The total tokens of the trace - TotalTokens *int64 `json:"total_tokens,omitempty"` -} - -func (l ListTracesResponse) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(l, "", false) -} - -func (l *ListTracesResponse) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { - return err - } - return nil -} - -func (o *ListTracesResponse) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *ListTracesResponse) GetStartTime() *time.Time { - if o == nil { - return nil - } - return o.StartTime -} - -func (o *ListTracesResponse) GetEndTime() *time.Time { - if o == nil { - return nil - } - return o.EndTime -} - -func (o *ListTracesResponse) GetDurationMs() *int64 { - if o == nil { - return nil - } - return o.DurationMs -} - -func (o *ListTracesResponse) GetStatus() *string { - if o == nil { - return nil - } - return o.Status -} - -func (o *ListTracesResponse) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *ListTracesResponse) GetInput() *string { - if o == nil { - return nil - } - return o.Input -} - -func (o *ListTracesResponse) GetOutput() *string { - if o == nil { - return nil - } - return o.Output -} - -func (o *ListTracesResponse) GetTotalTokens() *int64 { - if o == nil { - return nil - } - return o.TotalTokens -} diff --git a/tests/mockserver/internal/sdk/models/components/meta.go b/tests/mockserver/internal/sdk/models/components/meta.go deleted file mode 100644 index f05ffc3..0000000 --- a/tests/mockserver/internal/sdk/models/components/meta.go +++ /dev/null @@ -1,15 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type Meta struct { - // Total number of items in the collection - TotalCount int64 `json:"total_count"` -} - -func (o *Meta) GetTotalCount() int64 { - if o == nil { - return 0 - } - return o.TotalCount -} diff --git a/tests/mockserver/internal/sdk/models/components/model.go b/tests/mockserver/internal/sdk/models/components/model.go deleted file mode 100644 index bc57fda..0000000 --- a/tests/mockserver/internal/sdk/models/components/model.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type Model struct { - Name string `json:"name"` - ExtraHeaders map[string]any `json:"extra_headers,omitempty"` - Options map[string]any `json:"options,omitempty"` -} - -func (o *Model) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *Model) GetExtraHeaders() map[string]any { - if o == nil { - return nil - } - return o.ExtraHeaders -} - -func (o *Model) GetOptions() map[string]any { - if o == nil { - return nil - } - return o.Options -} diff --git a/tests/mockserver/internal/sdk/models/components/op.go b/tests/mockserver/internal/sdk/models/components/op.go deleted file mode 100644 index 2b0c978..0000000 --- a/tests/mockserver/internal/sdk/models/components/op.go +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -type Op string - -const ( - OpEqual Op = "=" - OpNotEqual Op = "!=" - OpGreaterThan Op = ">" - OpLessThan Op = "<" - OpIn Op = "in" -) - -func (e Op) ToPointer() *Op { - return &e -} -func (e *Op) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "=": - fallthrough - case "!=": - fallthrough - case ">": - fallthrough - case "<": - fallthrough - case "in": - *e = Op(v) - return nil - default: - return fmt.Errorf("invalid value for Op: %v", v) - } -} diff --git a/tests/mockserver/internal/sdk/models/components/openaitypeschatchatcompletionmessagetoolcallparamfunction.go b/tests/mockserver/internal/sdk/models/components/openaitypeschatchatcompletionmessagetoolcallparamfunction.go deleted file mode 100644 index 6f1d6eb..0000000 --- a/tests/mockserver/internal/sdk/models/components/openaitypeschatchatcompletionmessagetoolcallparamfunction.go +++ /dev/null @@ -1,22 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type OpenaiTypesChatChatCompletionMessageToolCallParamFunction struct { - Arguments string `json:"arguments"` - Name string `json:"name"` -} - -func (o *OpenaiTypesChatChatCompletionMessageToolCallParamFunction) GetArguments() string { - if o == nil { - return "" - } - return o.Arguments -} - -func (o *OpenaiTypesChatChatCompletionMessageToolCallParamFunction) GetName() string { - if o == nil { - return "" - } - return o.Name -} diff --git a/tests/mockserver/internal/sdk/models/components/openaitypeschatchatcompletionnamedtoolchoiceparamfunction.go b/tests/mockserver/internal/sdk/models/components/openaitypeschatchatcompletionnamedtoolchoiceparamfunction.go deleted file mode 100644 index ee45daa..0000000 --- a/tests/mockserver/internal/sdk/models/components/openaitypeschatchatcompletionnamedtoolchoiceparamfunction.go +++ /dev/null @@ -1,14 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type OpenaiTypesChatChatCompletionNamedToolChoiceParamFunction struct { - Name string `json:"name"` -} - -func (o *OpenaiTypesChatChatCompletionNamedToolChoiceParamFunction) GetName() string { - if o == nil { - return "" - } - return o.Name -} diff --git a/tests/mockserver/internal/sdk/models/components/openaitypeschatcompletioncreateparamsfunction.go b/tests/mockserver/internal/sdk/models/components/openaitypeschatcompletioncreateparamsfunction.go deleted file mode 100644 index d2f2920..0000000 --- a/tests/mockserver/internal/sdk/models/components/openaitypeschatcompletioncreateparamsfunction.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type OpenaiTypesChatCompletionCreateParamsFunction struct { - Name string `json:"name"` - Description *string `json:"description,omitempty"` - Parameters map[string]any `json:"parameters,omitempty"` -} - -func (o *OpenaiTypesChatCompletionCreateParamsFunction) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *OpenaiTypesChatCompletionCreateParamsFunction) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *OpenaiTypesChatCompletionCreateParamsFunction) GetParameters() map[string]any { - if o == nil { - return nil - } - return o.Parameters -} diff --git a/tests/mockserver/internal/sdk/models/components/paginatedresponsegetdatasetentriesresponse.go b/tests/mockserver/internal/sdk/models/components/paginatedresponsegetdatasetentriesresponse.go deleted file mode 100644 index b9a7e95..0000000 --- a/tests/mockserver/internal/sdk/models/components/paginatedresponsegetdatasetentriesresponse.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type PaginatedResponseGetDatasetEntriesResponse struct { - Meta Meta `json:"meta"` - // List of items returned in the response - Data []GetDatasetEntriesResponse `json:"data"` -} - -func (o *PaginatedResponseGetDatasetEntriesResponse) GetMeta() Meta { - if o == nil { - return Meta{} - } - return o.Meta -} - -func (o *PaginatedResponseGetDatasetEntriesResponse) GetData() []GetDatasetEntriesResponse { - if o == nil { - return []GetDatasetEntriesResponse{} - } - return o.Data -} diff --git a/tests/mockserver/internal/sdk/models/components/paginatedresponselistcustommodelsresponseitem.go b/tests/mockserver/internal/sdk/models/components/paginatedresponselistcustommodelsresponseitem.go deleted file mode 100644 index 19e5cce..0000000 --- a/tests/mockserver/internal/sdk/models/components/paginatedresponselistcustommodelsresponseitem.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type PaginatedResponseListCustomModelsResponseItem struct { - Meta Meta `json:"meta"` - // List of items returned in the response - Data []ListCustomModelsResponseItem `json:"data"` -} - -func (o *PaginatedResponseListCustomModelsResponseItem) GetMeta() Meta { - if o == nil { - return Meta{} - } - return o.Meta -} - -func (o *PaginatedResponseListCustomModelsResponseItem) GetData() []ListCustomModelsResponseItem { - if o == nil { - return []ListCustomModelsResponseItem{} - } - return o.Data -} diff --git a/tests/mockserver/internal/sdk/models/components/paginatedresponselistfunctionrevisionresponse.go b/tests/mockserver/internal/sdk/models/components/paginatedresponselistfunctionrevisionresponse.go deleted file mode 100644 index dd9fd59..0000000 --- a/tests/mockserver/internal/sdk/models/components/paginatedresponselistfunctionrevisionresponse.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type PaginatedResponseListFunctionRevisionResponse struct { - Meta Meta `json:"meta"` - // List of items returned in the response - Data []ListFunctionRevisionResponse `json:"data"` -} - -func (o *PaginatedResponseListFunctionRevisionResponse) GetMeta() Meta { - if o == nil { - return Meta{} - } - return o.Meta -} - -func (o *PaginatedResponseListFunctionRevisionResponse) GetData() []ListFunctionRevisionResponse { - if o == nil { - return []ListFunctionRevisionResponse{} - } - return o.Data -} diff --git a/tests/mockserver/internal/sdk/models/components/paginatedresponselistfunctionsresponseitem.go b/tests/mockserver/internal/sdk/models/components/paginatedresponselistfunctionsresponseitem.go deleted file mode 100644 index e74a5e3..0000000 --- a/tests/mockserver/internal/sdk/models/components/paginatedresponselistfunctionsresponseitem.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type PaginatedResponseListFunctionsResponseItem struct { - Meta Meta `json:"meta"` - // List of items returned in the response - Data []ListFunctionsResponseItem `json:"data"` -} - -func (o *PaginatedResponseListFunctionsResponseItem) GetMeta() Meta { - if o == nil { - return Meta{} - } - return o.Meta -} - -func (o *PaginatedResponseListFunctionsResponseItem) GetData() []ListFunctionsResponseItem { - if o == nil { - return []ListFunctionsResponseItem{} - } - return o.Data -} diff --git a/tests/mockserver/internal/sdk/models/components/paginatedresponselistknowledgebasesresponse.go b/tests/mockserver/internal/sdk/models/components/paginatedresponselistknowledgebasesresponse.go deleted file mode 100644 index 2984327..0000000 --- a/tests/mockserver/internal/sdk/models/components/paginatedresponselistknowledgebasesresponse.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type PaginatedResponseListKnowledgeBasesResponse struct { - Meta Meta `json:"meta"` - // List of items returned in the response - Data []ListKnowledgeBasesResponse `json:"data"` -} - -func (o *PaginatedResponseListKnowledgeBasesResponse) GetMeta() Meta { - if o == nil { - return Meta{} - } - return o.Meta -} - -func (o *PaginatedResponseListKnowledgeBasesResponse) GetData() []ListKnowledgeBasesResponse { - if o == nil { - return []ListKnowledgeBasesResponse{} - } - return o.Data -} diff --git a/tests/mockserver/internal/sdk/models/components/paginatedresponselistlanguagemodelsresponse.go b/tests/mockserver/internal/sdk/models/components/paginatedresponselistlanguagemodelsresponse.go deleted file mode 100644 index 43662da..0000000 --- a/tests/mockserver/internal/sdk/models/components/paginatedresponselistlanguagemodelsresponse.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type PaginatedResponseListLanguageModelsResponse struct { - Meta Meta `json:"meta"` - // List of items returned in the response - Data []ListLanguageModelsResponse `json:"data"` -} - -func (o *PaginatedResponseListLanguageModelsResponse) GetMeta() Meta { - if o == nil { - return Meta{} - } - return o.Meta -} - -func (o *PaginatedResponseListLanguageModelsResponse) GetData() []ListLanguageModelsResponse { - if o == nil { - return []ListLanguageModelsResponse{} - } - return o.Data -} diff --git a/tests/mockserver/internal/sdk/models/components/paginatedresponselistspanmetricsresponse.go b/tests/mockserver/internal/sdk/models/components/paginatedresponselistspanmetricsresponse.go deleted file mode 100644 index e5cef03..0000000 --- a/tests/mockserver/internal/sdk/models/components/paginatedresponselistspanmetricsresponse.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type PaginatedResponseListSpanMetricsResponse struct { - Meta Meta `json:"meta"` - // List of items returned in the response - Data []ListSpanMetricsResponse `json:"data"` -} - -func (o *PaginatedResponseListSpanMetricsResponse) GetMeta() Meta { - if o == nil { - return Meta{} - } - return o.Meta -} - -func (o *PaginatedResponseListSpanMetricsResponse) GetData() []ListSpanMetricsResponse { - if o == nil { - return []ListSpanMetricsResponse{} - } - return o.Data -} diff --git a/tests/mockserver/internal/sdk/models/components/paginatedresponselisttracesresponse.go b/tests/mockserver/internal/sdk/models/components/paginatedresponselisttracesresponse.go deleted file mode 100644 index 17b24be..0000000 --- a/tests/mockserver/internal/sdk/models/components/paginatedresponselisttracesresponse.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type PaginatedResponseListTracesResponse struct { - Meta Meta `json:"meta"` - // List of items returned in the response - Data []ListTracesResponse `json:"data"` -} - -func (o *PaginatedResponseListTracesResponse) GetMeta() Meta { - if o == nil { - return Meta{} - } - return o.Meta -} - -func (o *PaginatedResponseListTracesResponse) GetData() []ListTracesResponse { - if o == nil { - return []ListTracesResponse{} - } - return o.Data -} diff --git a/tests/mockserver/internal/sdk/models/components/prompttokensdetails.go b/tests/mockserver/internal/sdk/models/components/prompttokensdetails.go deleted file mode 100644 index 9bace19..0000000 --- a/tests/mockserver/internal/sdk/models/components/prompttokensdetails.go +++ /dev/null @@ -1,45 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" -) - -type PromptTokensDetails struct { - AudioTokens *int64 `json:"audio_tokens,omitempty"` - CachedTokens *int64 `json:"cached_tokens,omitempty"` - AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` -} - -func (p PromptTokensDetails) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(p, "", false) -} - -func (p *PromptTokensDetails) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { - return err - } - return nil -} - -func (o *PromptTokensDetails) GetAudioTokens() *int64 { - if o == nil { - return nil - } - return o.AudioTokens -} - -func (o *PromptTokensDetails) GetCachedTokens() *int64 { - if o == nil { - return nil - } - return o.CachedTokens -} - -func (o *PromptTokensDetails) GetAdditionalProperties() map[string]any { - if o == nil { - return nil - } - return o.AdditionalProperties -} diff --git a/tests/mockserver/internal/sdk/models/components/querydatasetentriesresponse.go b/tests/mockserver/internal/sdk/models/components/querydatasetentriesresponse.go deleted file mode 100644 index f3de9f8..0000000 --- a/tests/mockserver/internal/sdk/models/components/querydatasetentriesresponse.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type QueryDatasetEntriesResponse struct { - // The id of the dataset entry - ID string `json:"id"` - // The input to the dataset entry - Input string `json:"input"` - // The output to the dataset entry - Output string `json:"output"` - // The expected output to the dataset entry, this is an optionally edited version of the output - Expected *string `json:"expected,omitempty"` - // The comment to the dataset entry - Comment *string `json:"comment,omitempty"` -} - -func (o *QueryDatasetEntriesResponse) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *QueryDatasetEntriesResponse) GetInput() string { - if o == nil { - return "" - } - return o.Input -} - -func (o *QueryDatasetEntriesResponse) GetOutput() string { - if o == nil { - return "" - } - return o.Output -} - -func (o *QueryDatasetEntriesResponse) GetExpected() *string { - if o == nil { - return nil - } - return o.Expected -} - -func (o *QueryDatasetEntriesResponse) GetComment() *string { - if o == nil { - return nil - } - return o.Comment -} diff --git a/tests/mockserver/internal/sdk/models/components/queryknowledgebaserequest.go b/tests/mockserver/internal/sdk/models/components/queryknowledgebaserequest.go deleted file mode 100644 index 1ad470b..0000000 --- a/tests/mockserver/internal/sdk/models/components/queryknowledgebaserequest.go +++ /dev/null @@ -1,75 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" -) - -type QueryKnowledgeBaseRequest struct { - // Query string - Query string `json:"query"` - // Number of documents to retrieve from the knowledge base before filtering - PrefilterLimit *int64 `default:"10" json:"prefilter_limit"` - // Number of documents to return - TopK *int64 `default:"3" json:"top_k"` - // Per-field filters to apply to the query combined with AND - Filters []Filter `json:"filters,omitempty"` - // Whether to rerank the results - Rerank *bool `default:"true" json:"rerank"` - // Parent span id - ParentSpanID *string `json:"parent_span_id,omitempty"` -} - -func (q QueryKnowledgeBaseRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(q, "", false) -} - -func (q *QueryKnowledgeBaseRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &q, "", false, false); err != nil { - return err - } - return nil -} - -func (o *QueryKnowledgeBaseRequest) GetQuery() string { - if o == nil { - return "" - } - return o.Query -} - -func (o *QueryKnowledgeBaseRequest) GetPrefilterLimit() *int64 { - if o == nil { - return nil - } - return o.PrefilterLimit -} - -func (o *QueryKnowledgeBaseRequest) GetTopK() *int64 { - if o == nil { - return nil - } - return o.TopK -} - -func (o *QueryKnowledgeBaseRequest) GetFilters() []Filter { - if o == nil { - return nil - } - return o.Filters -} - -func (o *QueryKnowledgeBaseRequest) GetRerank() *bool { - if o == nil { - return nil - } - return o.Rerank -} - -func (o *QueryKnowledgeBaseRequest) GetParentSpanID() *string { - if o == nil { - return nil - } - return o.ParentSpanID -} diff --git a/tests/mockserver/internal/sdk/models/components/queryknowledgebaseresponse.go b/tests/mockserver/internal/sdk/models/components/queryknowledgebaseresponse.go deleted file mode 100644 index fb017ef..0000000 --- a/tests/mockserver/internal/sdk/models/components/queryknowledgebaseresponse.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type QueryKnowledgeBaseResponse struct { - // The id of the document - ID string `json:"id"` - // The key of the document - Key string `json:"key"` - // The content of the document - Content string `json:"content"` - // The metadata of the document - Metadata map[string]any `json:"metadata"` - // The score of the document - Score float64 `json:"score"` -} - -func (o *QueryKnowledgeBaseResponse) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *QueryKnowledgeBaseResponse) GetKey() string { - if o == nil { - return "" - } - return o.Key -} - -func (o *QueryKnowledgeBaseResponse) GetContent() string { - if o == nil { - return "" - } - return o.Content -} - -func (o *QueryKnowledgeBaseResponse) GetMetadata() map[string]any { - if o == nil { - return map[string]any{} - } - return o.Metadata -} - -func (o *QueryKnowledgeBaseResponse) GetScore() float64 { - if o == nil { - return 0.0 - } - return o.Score -} diff --git a/tests/mockserver/internal/sdk/models/components/registercustommodelrequest.go b/tests/mockserver/internal/sdk/models/components/registercustommodelrequest.go deleted file mode 100644 index a54b0ce..0000000 --- a/tests/mockserver/internal/sdk/models/components/registercustommodelrequest.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type RegisterCustomModelRequest struct { - // The name of the custom language model - Name string `json:"name"` - // The identifier of the custom language model - Identifier string `json:"identifier"` - // Extra metadata about the custom language model - Extra map[string]any `json:"extra,omitempty"` - // The API key of the custom language model - APIKey *string `json:"api_key,omitempty"` -} - -func (o *RegisterCustomModelRequest) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *RegisterCustomModelRequest) GetIdentifier() string { - if o == nil { - return "" - } - return o.Identifier -} - -func (o *RegisterCustomModelRequest) GetExtra() map[string]any { - if o == nil { - return nil - } - return o.Extra -} - -func (o *RegisterCustomModelRequest) GetAPIKey() *string { - if o == nil { - return nil - } - return o.APIKey -} diff --git a/tests/mockserver/internal/sdk/models/components/registercustommodelresponse.go b/tests/mockserver/internal/sdk/models/components/registercustommodelresponse.go deleted file mode 100644 index 5c26c7c..0000000 --- a/tests/mockserver/internal/sdk/models/components/registercustommodelresponse.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type RegisterCustomModelResponse struct { - // The ID of the custom language model - ID string `json:"id"` - // The name of the custom language model - Name string `json:"name"` - // The identifier of the custom language model - Identifier string `json:"identifier"` - // Extra metadata about the custom language model - Extra map[string]any `json:"extra,omitempty"` -} - -func (o *RegisterCustomModelResponse) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *RegisterCustomModelResponse) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *RegisterCustomModelResponse) GetIdentifier() string { - if o == nil { - return "" - } - return o.Identifier -} - -func (o *RegisterCustomModelResponse) GetExtra() map[string]any { - if o == nil { - return nil - } - return o.Extra -} diff --git a/tests/mockserver/internal/sdk/models/components/registerfileuploadrequest.go b/tests/mockserver/internal/sdk/models/components/registerfileuploadrequest.go deleted file mode 100644 index b5b6e78..0000000 --- a/tests/mockserver/internal/sdk/models/components/registerfileuploadrequest.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type RegisterFileUploadRequest struct { - // The filename of the file to register - Filename string `json:"filename"` - // The id of the file to register - FileID string `json:"file_id"` - // The content type of the file to register - ContentType string `json:"content_type"` - // The configuration for the file to register - Configuration *TextProcessingConfiguration `json:"configuration,omitempty"` -} - -func (o *RegisterFileUploadRequest) GetFilename() string { - if o == nil { - return "" - } - return o.Filename -} - -func (o *RegisterFileUploadRequest) GetFileID() string { - if o == nil { - return "" - } - return o.FileID -} - -func (o *RegisterFileUploadRequest) GetContentType() string { - if o == nil { - return "" - } - return o.ContentType -} - -func (o *RegisterFileUploadRequest) GetConfiguration() *TextProcessingConfiguration { - if o == nil { - return nil - } - return o.Configuration -} diff --git a/tests/mockserver/internal/sdk/models/components/registerfileuploadresponse.go b/tests/mockserver/internal/sdk/models/components/registerfileuploadresponse.go deleted file mode 100644 index 965f705..0000000 --- a/tests/mockserver/internal/sdk/models/components/registerfileuploadresponse.go +++ /dev/null @@ -1,38 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type RegisterFileUploadResponse struct { - ID string `json:"id"` - Key string `json:"key"` - OriginalFilename string `json:"original_filename"` - DocumentID int64 `json:"document_id"` -} - -func (o *RegisterFileUploadResponse) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *RegisterFileUploadResponse) GetKey() string { - if o == nil { - return "" - } - return o.Key -} - -func (o *RegisterFileUploadResponse) GetOriginalFilename() string { - if o == nil { - return "" - } - return o.OriginalFilename -} - -func (o *RegisterFileUploadResponse) GetDocumentID() int64 { - if o == nil { - return 0 - } - return o.DocumentID -} diff --git a/tests/mockserver/internal/sdk/models/components/responseformatjsonobject.go b/tests/mockserver/internal/sdk/models/components/responseformatjsonobject.go deleted file mode 100644 index b7f9d50..0000000 --- a/tests/mockserver/internal/sdk/models/components/responseformatjsonobject.go +++ /dev/null @@ -1,26 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" -) - -type ResponseFormatJSONObject struct { - type_ string `const:"json_object" json:"type"` -} - -func (r ResponseFormatJSONObject) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(r, "", false) -} - -func (r *ResponseFormatJSONObject) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &r, "", false, true); err != nil { - return err - } - return nil -} - -func (o *ResponseFormatJSONObject) GetType() string { - return "json_object" -} diff --git a/tests/mockserver/internal/sdk/models/components/responseformatjsonschema.go b/tests/mockserver/internal/sdk/models/components/responseformatjsonschema.go deleted file mode 100644 index 1b869d4..0000000 --- a/tests/mockserver/internal/sdk/models/components/responseformatjsonschema.go +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" -) - -type ResponseFormatJSONSchema struct { - JSONSchema JSONSchema `json:"json_schema"` - type_ string `const:"json_schema" json:"type"` -} - -func (r ResponseFormatJSONSchema) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(r, "", false) -} - -func (r *ResponseFormatJSONSchema) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &r, "", false, true); err != nil { - return err - } - return nil -} - -func (o *ResponseFormatJSONSchema) GetJSONSchema() JSONSchema { - if o == nil { - return JSONSchema{} - } - return o.JSONSchema -} - -func (o *ResponseFormatJSONSchema) GetType() string { - return "json_schema" -} diff --git a/tests/mockserver/internal/sdk/models/components/responseformattext.go b/tests/mockserver/internal/sdk/models/components/responseformattext.go deleted file mode 100644 index 7f543e6..0000000 --- a/tests/mockserver/internal/sdk/models/components/responseformattext.go +++ /dev/null @@ -1,26 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" -) - -type ResponseFormatText struct { - type_ string `const:"text" json:"type"` -} - -func (r ResponseFormatText) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(r, "", false) -} - -func (r *ResponseFormatText) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &r, "", false, true); err != nil { - return err - } - return nil -} - -func (o *ResponseFormatText) GetType() string { - return "text" -} diff --git a/tests/mockserver/internal/sdk/models/components/savetodatasetresponse.go b/tests/mockserver/internal/sdk/models/components/savetodatasetresponse.go deleted file mode 100644 index 0c4c68c..0000000 --- a/tests/mockserver/internal/sdk/models/components/savetodatasetresponse.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type SaveToDatasetResponse struct { - // The ID of the dataset - DatasetID string `json:"dataset_id"` - // The ID of the dataset entry - DatasetEntryID string `json:"dataset_entry_id"` - // The input of the dataset entry - Input *string `json:"input,omitempty"` - // The output of the dataset entry - Output *string `json:"output,omitempty"` - // The expected output of the dataset entry - Expected *string `json:"expected,omitempty"` - // The comment of the dataset entry - Comment *string `json:"comment,omitempty"` -} - -func (o *SaveToDatasetResponse) GetDatasetID() string { - if o == nil { - return "" - } - return o.DatasetID -} - -func (o *SaveToDatasetResponse) GetDatasetEntryID() string { - if o == nil { - return "" - } - return o.DatasetEntryID -} - -func (o *SaveToDatasetResponse) GetInput() *string { - if o == nil { - return nil - } - return o.Input -} - -func (o *SaveToDatasetResponse) GetOutput() *string { - if o == nil { - return nil - } - return o.Output -} - -func (o *SaveToDatasetResponse) GetExpected() *string { - if o == nil { - return nil - } - return o.Expected -} - -func (o *SaveToDatasetResponse) GetComment() *string { - if o == nil { - return nil - } - return o.Comment -} diff --git a/tests/mockserver/internal/sdk/models/components/security.go b/tests/mockserver/internal/sdk/models/components/security.go deleted file mode 100644 index 42d6588..0000000 --- a/tests/mockserver/internal/sdk/models/components/security.go +++ /dev/null @@ -1,14 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type Security struct { - HTTPBearer string `security:"scheme,type=http,subtype=bearer,name=Authorization"` -} - -func (o *Security) GetHTTPBearer() string { - if o == nil { - return "" - } - return o.HTTPBearer -} diff --git a/tests/mockserver/internal/sdk/models/components/spandata.go b/tests/mockserver/internal/sdk/models/components/spandata.go deleted file mode 100644 index 8a94bb1..0000000 --- a/tests/mockserver/internal/sdk/models/components/spandata.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type SpanData struct { - // The input of the span - Input *string `json:"input,omitempty"` - // The output of the span - Output *string `json:"output,omitempty"` - // The total tokens of the span - TotalTokens *int64 `json:"total_tokens,omitempty"` - // The model of the span - Model *string `json:"model,omitempty"` - // The instructions of the span in case of a generation span - Instructions *string `json:"instructions,omitempty"` - // The function of the span - Function *string `json:"function,omitempty"` - // The tags of the span - Tags []string `json:"tags,omitempty"` - // The score of the span, by default set to the evaluation score of the generation of the span - Score *int64 `json:"score,omitempty"` - // The id of the generation of the span - GenerationID *string `json:"generation_id,omitempty"` - // The observations of the span in case of a generation span - Observations *string `json:"observations,omitempty"` -} - -func (o *SpanData) GetInput() *string { - if o == nil { - return nil - } - return o.Input -} - -func (o *SpanData) GetOutput() *string { - if o == nil { - return nil - } - return o.Output -} - -func (o *SpanData) GetTotalTokens() *int64 { - if o == nil { - return nil - } - return o.TotalTokens -} - -func (o *SpanData) GetModel() *string { - if o == nil { - return nil - } - return o.Model -} - -func (o *SpanData) GetInstructions() *string { - if o == nil { - return nil - } - return o.Instructions -} - -func (o *SpanData) GetFunction() *string { - if o == nil { - return nil - } - return o.Function -} - -func (o *SpanData) GetTags() []string { - if o == nil { - return nil - } - return o.Tags -} - -func (o *SpanData) GetScore() *int64 { - if o == nil { - return nil - } - return o.Score -} - -func (o *SpanData) GetGenerationID() *string { - if o == nil { - return nil - } - return o.GenerationID -} - -func (o *SpanData) GetObservations() *string { - if o == nil { - return nil - } - return o.Observations -} diff --git a/tests/mockserver/internal/sdk/models/components/spanmetricdata.go b/tests/mockserver/internal/sdk/models/components/spanmetricdata.go deleted file mode 100644 index 2423010..0000000 --- a/tests/mockserver/internal/sdk/models/components/spanmetricdata.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type SpanMetricData struct { - // The id of the metric - ID string `json:"id"` - // The dimension of the metric - Dimension string `json:"dimension"` - // The value of the metric - Value float64 `json:"value"` - // The timestamp when the metric was created - CreatedAt time.Time `json:"created_at"` - // The comment of the metric, can be used to add additional information about the metric - Comment *string `json:"comment,omitempty"` -} - -func (s SpanMetricData) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(s, "", false) -} - -func (s *SpanMetricData) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &s, "", false, false); err != nil { - return err - } - return nil -} - -func (o *SpanMetricData) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *SpanMetricData) GetDimension() string { - if o == nil { - return "" - } - return o.Dimension -} - -func (o *SpanMetricData) GetValue() float64 { - if o == nil { - return 0.0 - } - return o.Value -} - -func (o *SpanMetricData) GetCreatedAt() time.Time { - if o == nil { - return time.Time{} - } - return o.CreatedAt -} - -func (o *SpanMetricData) GetComment() *string { - if o == nil { - return nil - } - return o.Comment -} diff --git a/tests/mockserver/internal/sdk/models/components/spanschema.go b/tests/mockserver/internal/sdk/models/components/spanschema.go deleted file mode 100644 index 7ce73e4..0000000 --- a/tests/mockserver/internal/sdk/models/components/spanschema.go +++ /dev/null @@ -1,130 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type SpanSchema struct { - // The id of the span, set to the uuid of the span - ID *string `json:"id,omitempty"` - // The name of the span - Name *string `json:"name,omitempty"` - // The start time of the span - StartTime *time.Time `json:"start_time,omitempty"` - // The type of the span - Type *string `json:"type,omitempty"` - // The id of the parent span - ParentID *string `json:"parent_id,omitempty"` - // The end time of the span - EndTime *time.Time `json:"end_time,omitempty"` - // The duration of the span in milliseconds - DurationMs *int64 `json:"duration_ms,omitempty"` - // Optional error of the span - Error *string `json:"error,omitempty"` - // The metadata of the span, can be used to add additional information about the span - Meta map[string]any `json:"meta,omitempty"` - // The data of the span - Data *SpanData `json:"data,omitempty"` - // The metrics of the span - Metrics []SpanMetricData `json:"metrics,omitempty"` - // The score of the span - Score *int64 `json:"score,omitempty"` -} - -func (s SpanSchema) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(s, "", false) -} - -func (s *SpanSchema) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &s, "", false, false); err != nil { - return err - } - return nil -} - -func (o *SpanSchema) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *SpanSchema) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *SpanSchema) GetStartTime() *time.Time { - if o == nil { - return nil - } - return o.StartTime -} - -func (o *SpanSchema) GetType() *string { - if o == nil { - return nil - } - return o.Type -} - -func (o *SpanSchema) GetParentID() *string { - if o == nil { - return nil - } - return o.ParentID -} - -func (o *SpanSchema) GetEndTime() *time.Time { - if o == nil { - return nil - } - return o.EndTime -} - -func (o *SpanSchema) GetDurationMs() *int64 { - if o == nil { - return nil - } - return o.DurationMs -} - -func (o *SpanSchema) GetError() *string { - if o == nil { - return nil - } - return o.Error -} - -func (o *SpanSchema) GetMeta() map[string]any { - if o == nil { - return nil - } - return o.Meta -} - -func (o *SpanSchema) GetData() *SpanData { - if o == nil { - return nil - } - return o.Data -} - -func (o *SpanSchema) GetMetrics() []SpanMetricData { - if o == nil { - return nil - } - return o.Metrics -} - -func (o *SpanSchema) GetScore() *int64 { - if o == nil { - return nil - } - return o.Score -} diff --git a/tests/mockserver/internal/sdk/models/components/textprocessingconfiguration.go b/tests/mockserver/internal/sdk/models/components/textprocessingconfiguration.go deleted file mode 100644 index 6f4058d..0000000 --- a/tests/mockserver/internal/sdk/models/components/textprocessingconfiguration.go +++ /dev/null @@ -1,39 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" -) - -type TextProcessingConfiguration struct { - // The chunk size to use for the document. This is the number of characters to use for the chunk. The default is 2000 characters. - TextProcessingChunkSize *int64 `default:"2000" json:"text_processing.chunk_size"` - // The chunk overlap to use for the document. This is the number of characters to overlap between chunks. The default is 200 characters. - TextProcessingChunkOverlap *int64 `default:"200" json:"text_processing.chunk_overlap"` -} - -func (t TextProcessingConfiguration) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(t, "", false) -} - -func (t *TextProcessingConfiguration) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &t, "", false, false); err != nil { - return err - } - return nil -} - -func (o *TextProcessingConfiguration) GetTextProcessingChunkSize() *int64 { - if o == nil { - return nil - } - return o.TextProcessingChunkSize -} - -func (o *TextProcessingConfiguration) GetTextProcessingChunkOverlap() *int64 { - if o == nil { - return nil - } - return o.TextProcessingChunkOverlap -} diff --git a/tests/mockserver/internal/sdk/models/components/tmodel.go b/tests/mockserver/internal/sdk/models/components/tmodel.go deleted file mode 100644 index 6c818b0..0000000 --- a/tests/mockserver/internal/sdk/models/components/tmodel.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "errors" - "fmt" - "mockserver/internal/sdk/utils" -) - -type TModel1Type string - -const ( - TModel1TypeStr TModel1Type = "str" - TModel1TypeModel TModel1Type = "Model" -) - -type TModel1 struct { - Str *string `queryParam:"inline"` - Model *Model `queryParam:"inline"` - - Type TModel1Type -} - -func CreateTModel1Str(str string) TModel1 { - typ := TModel1TypeStr - - return TModel1{ - Str: &str, - Type: typ, - } -} - -func CreateTModel1Model(model Model) TModel1 { - typ := TModel1TypeModel - - return TModel1{ - Model: &model, - Type: typ, - } -} - -func (u *TModel1) UnmarshalJSON(data []byte) error { - - var model Model = Model{} - if err := utils.UnmarshalJSON(data, &model, "", true, true); err == nil { - u.Model = &model - u.Type = TModel1TypeModel - return nil - } - - var str string = "" - if err := utils.UnmarshalJSON(data, &str, "", true, true); err == nil { - u.Str = &str - u.Type = TModel1TypeStr - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for TModel1", string(data)) -} - -func (u TModel1) MarshalJSON() ([]byte, error) { - if u.Str != nil { - return utils.MarshalJSON(u.Str, "", true) - } - - if u.Model != nil { - return utils.MarshalJSON(u.Model, "", true) - } - - return nil, errors.New("could not marshal union type TModel1: all fields are null") -} - -type TModelType string - -const ( - TModelTypeStr TModelType = "str" - TModelTypeModel TModelType = "Model" - TModelTypeArrayOfTModel1 TModelType = "arrayOfTModel1" -) - -type TModel struct { - Str *string `queryParam:"inline"` - Model *Model `queryParam:"inline"` - ArrayOfTModel1 []TModel1 `queryParam:"inline"` - - Type TModelType -} - -func CreateTModelStr(str string) TModel { - typ := TModelTypeStr - - return TModel{ - Str: &str, - Type: typ, - } -} - -func CreateTModelModel(model Model) TModel { - typ := TModelTypeModel - - return TModel{ - Model: &model, - Type: typ, - } -} - -func CreateTModelArrayOfTModel1(arrayOfTModel1 []TModel1) TModel { - typ := TModelTypeArrayOfTModel1 - - return TModel{ - ArrayOfTModel1: arrayOfTModel1, - Type: typ, - } -} - -func (u *TModel) UnmarshalJSON(data []byte) error { - - var model Model = Model{} - if err := utils.UnmarshalJSON(data, &model, "", true, true); err == nil { - u.Model = &model - u.Type = TModelTypeModel - return nil - } - - var str string = "" - if err := utils.UnmarshalJSON(data, &str, "", true, true); err == nil { - u.Str = &str - u.Type = TModelTypeStr - return nil - } - - var arrayOfTModel1 []TModel1 = []TModel1{} - if err := utils.UnmarshalJSON(data, &arrayOfTModel1, "", true, true); err == nil { - u.ArrayOfTModel1 = arrayOfTModel1 - u.Type = TModelTypeArrayOfTModel1 - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for TModel", string(data)) -} - -func (u TModel) MarshalJSON() ([]byte, error) { - if u.Str != nil { - return utils.MarshalJSON(u.Str, "", true) - } - - if u.Model != nil { - return utils.MarshalJSON(u.Model, "", true) - } - - if u.ArrayOfTModel1 != nil { - return utils.MarshalJSON(u.ArrayOfTModel1, "", true) - } - - return nil, errors.New("could not marshal union type TModel: all fields are null") -} diff --git a/tests/mockserver/internal/sdk/models/components/toplogprob.go b/tests/mockserver/internal/sdk/models/components/toplogprob.go deleted file mode 100644 index ea94e33..0000000 --- a/tests/mockserver/internal/sdk/models/components/toplogprob.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" -) - -type TopLogprob struct { - Token string `json:"token"` - Bytes []int64 `json:"bytes,omitempty"` - Logprob float64 `json:"logprob"` - AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` -} - -func (t TopLogprob) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(t, "", false) -} - -func (t *TopLogprob) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &t, "", false, false); err != nil { - return err - } - return nil -} - -func (o *TopLogprob) GetToken() string { - if o == nil { - return "" - } - return o.Token -} - -func (o *TopLogprob) GetBytes() []int64 { - if o == nil { - return nil - } - return o.Bytes -} - -func (o *TopLogprob) GetLogprob() float64 { - if o == nil { - return 0.0 - } - return o.Logprob -} - -func (o *TopLogprob) GetAdditionalProperties() map[string]any { - if o == nil { - return nil - } - return o.AdditionalProperties -} diff --git a/tests/mockserver/internal/sdk/models/components/updatecustommodelrequest.go b/tests/mockserver/internal/sdk/models/components/updatecustommodelrequest.go deleted file mode 100644 index 701a2bc..0000000 --- a/tests/mockserver/internal/sdk/models/components/updatecustommodelrequest.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type UpdateCustomModelRequest struct { - // The name of the custom language model - Name *string `json:"name,omitempty"` - // The identifier of the custom language model - Identifier *string `json:"identifier,omitempty"` - // Extra metadata about the custom language model - Extra map[string]any `json:"extra,omitempty"` - // The API key of the custom language model - APIKey *string `json:"api_key,omitempty"` -} - -func (o *UpdateCustomModelRequest) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *UpdateCustomModelRequest) GetIdentifier() *string { - if o == nil { - return nil - } - return o.Identifier -} - -func (o *UpdateCustomModelRequest) GetExtra() map[string]any { - if o == nil { - return nil - } - return o.Extra -} - -func (o *UpdateCustomModelRequest) GetAPIKey() *string { - if o == nil { - return nil - } - return o.APIKey -} diff --git a/tests/mockserver/internal/sdk/models/components/updatecustommodelresponse.go b/tests/mockserver/internal/sdk/models/components/updatecustommodelresponse.go deleted file mode 100644 index a80571a..0000000 --- a/tests/mockserver/internal/sdk/models/components/updatecustommodelresponse.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type UpdateCustomModelResponse struct { - // The ID of the custom language model - ID string `json:"id"` - // The name of the custom language model - Name string `json:"name"` - // The identifier of the custom language model - Identifier string `json:"identifier"` - // Extra metadata about the custom language model - Extra map[string]any `json:"extra,omitempty"` -} - -func (o *UpdateCustomModelResponse) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *UpdateCustomModelResponse) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *UpdateCustomModelResponse) GetIdentifier() string { - if o == nil { - return "" - } - return o.Identifier -} - -func (o *UpdateCustomModelResponse) GetExtra() map[string]any { - if o == nil { - return nil - } - return o.Extra -} diff --git a/tests/mockserver/internal/sdk/models/components/updatedatasetentryrequest.go b/tests/mockserver/internal/sdk/models/components/updatedatasetentryrequest.go deleted file mode 100644 index 6159f18..0000000 --- a/tests/mockserver/internal/sdk/models/components/updatedatasetentryrequest.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type UpdateDatasetEntryRequest struct { - // The input to the dataset entry - Input any `json:"input,omitempty"` - // The output to the dataset entry - Output any `json:"output,omitempty"` - // The expected output to the dataset entry, this is an optionally edited version of the output - Expected any `json:"expected,omitempty"` - // The comment to the dataset entry - Comment *string `json:"comment,omitempty"` -} - -func (o *UpdateDatasetEntryRequest) GetInput() any { - if o == nil { - return nil - } - return o.Input -} - -func (o *UpdateDatasetEntryRequest) GetOutput() any { - if o == nil { - return nil - } - return o.Output -} - -func (o *UpdateDatasetEntryRequest) GetExpected() any { - if o == nil { - return nil - } - return o.Expected -} - -func (o *UpdateDatasetEntryRequest) GetComment() *string { - if o == nil { - return nil - } - return o.Comment -} diff --git a/tests/mockserver/internal/sdk/models/components/updatedatasetentryresponse.go b/tests/mockserver/internal/sdk/models/components/updatedatasetentryresponse.go deleted file mode 100644 index 06b51c7..0000000 --- a/tests/mockserver/internal/sdk/models/components/updatedatasetentryresponse.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type UpdateDatasetEntryResponse struct { - // The id of the dataset entry - ID string `json:"id"` - // The input to the dataset entry - Input string `json:"input"` - // The output to the dataset entry - Output string `json:"output"` - // The expected output to the dataset entry, this is an optionally edited version of the output - Expected *string `json:"expected,omitempty"` - // The comment to the dataset entry - Comment *string `json:"comment,omitempty"` -} - -func (o *UpdateDatasetEntryResponse) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *UpdateDatasetEntryResponse) GetInput() string { - if o == nil { - return "" - } - return o.Input -} - -func (o *UpdateDatasetEntryResponse) GetOutput() string { - if o == nil { - return "" - } - return o.Output -} - -func (o *UpdateDatasetEntryResponse) GetExpected() *string { - if o == nil { - return nil - } - return o.Expected -} - -func (o *UpdateDatasetEntryResponse) GetComment() *string { - if o == nil { - return nil - } - return o.Comment -} diff --git a/tests/mockserver/internal/sdk/models/components/updatefunctionrequest.go b/tests/mockserver/internal/sdk/models/components/updatefunctionrequest.go deleted file mode 100644 index 53c891b..0000000 --- a/tests/mockserver/internal/sdk/models/components/updatefunctionrequest.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type UpdateFunctionRequest struct { - // The name of the function. Must be unique within the project and can only contain letters, numbers, underscores and hyphens. - Name *string `json:"name,omitempty"` - // Optional description of the function. This is used to describe the function to a user. - Description *string `json:"description,omitempty"` - // The instructions for the function, this is the prompt that will be sent to the model to complete the task. Recommended to be concise and to the point - Instructions *string `json:"instructions,omitempty"` - // Optional input schema for the function. Can preferably include field descriptions to allow the model to reason about the input variables. Schema is validated against the input data and issues an error if it does not match. With the Opper SDKs you can define these schemas through libraries like Pydantic and Zod. For schemas with definitions, prefer using '$defs' and '#/$defs/...' references. - InputSchema map[string]any `json:"input_schema,omitempty"` - // Optional output schema for the function. Can preferably include field descriptions to allow the model to reason about the output variables. Schema is validated against the output data and issues an error if it does not match. With the Opper SDKs you can define these schemas through libraries like Pydantic and Zod. For schemas with definitions, prefer using '$defs' and '#/$defs/...' references. - OutputSchema map[string]any `json:"output_schema,omitempty"` - // Optionally provide a model to use for completing the task. If not provided, a default model will be used. Currently the default model is `azure/gpt-4o-eu` - Model *TModel `json:"model,omitempty"` - // Optional configuration for the function.Configuration is a dictionary of key-value pairs that can be used to override the default configuration for the function. - Configuration map[string]any `json:"configuration,omitempty"` -} - -func (o *UpdateFunctionRequest) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *UpdateFunctionRequest) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *UpdateFunctionRequest) GetInstructions() *string { - if o == nil { - return nil - } - return o.Instructions -} - -func (o *UpdateFunctionRequest) GetInputSchema() map[string]any { - if o == nil { - return nil - } - return o.InputSchema -} - -func (o *UpdateFunctionRequest) GetOutputSchema() map[string]any { - if o == nil { - return nil - } - return o.OutputSchema -} - -func (o *UpdateFunctionRequest) GetModel() *TModel { - if o == nil { - return nil - } - return o.Model -} - -func (o *UpdateFunctionRequest) GetConfiguration() map[string]any { - if o == nil { - return nil - } - return o.Configuration -} diff --git a/tests/mockserver/internal/sdk/models/components/updatefunctionresponse.go b/tests/mockserver/internal/sdk/models/components/updatefunctionresponse.go deleted file mode 100644 index f817bd2..0000000 --- a/tests/mockserver/internal/sdk/models/components/updatefunctionresponse.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type UpdateFunctionResponse struct { - // The name of the function. Must be unique within the project and can only contain letters, numbers, underscores and hyphens. - Name string `json:"name"` - // Optional description of the function. This is used to describe the function to a user. - Description *string `json:"description,omitempty"` - // The instructions for the function, this is the prompt that will be sent to the model to complete the task. Recommended to be concise and to the point - Instructions string `json:"instructions"` - // Optional input schema for the function. Can preferably include field descriptions to allow the model to reason about the input variables. Schema is validated against the input data and issues an error if it does not match. With the Opper SDKs you can define these schemas through libraries like Pydantic and Zod. For schemas with definitions, prefer using '$defs' and '#/$defs/...' references. - InputSchema map[string]any `json:"input_schema,omitempty"` - // Optional output schema for the function. Can preferably include field descriptions to allow the model to reason about the output variables. Schema is validated against the output data and issues an error if it does not match. With the Opper SDKs you can define these schemas through libraries like Pydantic and Zod. For schemas with definitions, prefer using '$defs' and '#/$defs/...' references. - OutputSchema map[string]any `json:"output_schema,omitempty"` - Model *TModel `json:"model,omitempty"` - // Optional configuration for the function.Configuration is a dictionary of key-value pairs that can be used to override the default configuration for the function. - Configuration *FunctionCallConfiguration `json:"configuration,omitempty"` - // The ID of the function - ID string `json:"id"` - // The ID of the dataset associated with the function - DatasetID *string `json:"dataset_id,omitempty"` - // The ID of the latest revision of the function - RevisionID *string `json:"revision_id,omitempty"` -} - -func (o *UpdateFunctionResponse) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *UpdateFunctionResponse) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *UpdateFunctionResponse) GetInstructions() string { - if o == nil { - return "" - } - return o.Instructions -} - -func (o *UpdateFunctionResponse) GetInputSchema() map[string]any { - if o == nil { - return nil - } - return o.InputSchema -} - -func (o *UpdateFunctionResponse) GetOutputSchema() map[string]any { - if o == nil { - return nil - } - return o.OutputSchema -} - -func (o *UpdateFunctionResponse) GetModel() *TModel { - if o == nil { - return nil - } - return o.Model -} - -func (o *UpdateFunctionResponse) GetConfiguration() *FunctionCallConfiguration { - if o == nil { - return nil - } - return o.Configuration -} - -func (o *UpdateFunctionResponse) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *UpdateFunctionResponse) GetDatasetID() *string { - if o == nil { - return nil - } - return o.DatasetID -} - -func (o *UpdateFunctionResponse) GetRevisionID() *string { - if o == nil { - return nil - } - return o.RevisionID -} diff --git a/tests/mockserver/internal/sdk/models/components/updatespanmetricrequest.go b/tests/mockserver/internal/sdk/models/components/updatespanmetricrequest.go deleted file mode 100644 index 40e02dd..0000000 --- a/tests/mockserver/internal/sdk/models/components/updatespanmetricrequest.go +++ /dev/null @@ -1,33 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type UpdateSpanMetricRequest struct { - // The dimension of the metric - Dimension *string `json:"dimension,omitempty"` - // The value of the metric - Value *float64 `json:"value,omitempty"` - // A comment about the metric, e.g. a description of the metric - Comment *string `json:"comment,omitempty"` -} - -func (o *UpdateSpanMetricRequest) GetDimension() *string { - if o == nil { - return nil - } - return o.Dimension -} - -func (o *UpdateSpanMetricRequest) GetValue() *float64 { - if o == nil { - return nil - } - return o.Value -} - -func (o *UpdateSpanMetricRequest) GetComment() *string { - if o == nil { - return nil - } - return o.Comment -} diff --git a/tests/mockserver/internal/sdk/models/components/updatespanmetricresponse.go b/tests/mockserver/internal/sdk/models/components/updatespanmetricresponse.go deleted file mode 100644 index e05088d..0000000 --- a/tests/mockserver/internal/sdk/models/components/updatespanmetricresponse.go +++ /dev/null @@ -1,73 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type UpdateSpanMetricResponse struct { - // The dimension of the metric - Dimension string `json:"dimension"` - // The value of the metric - Value float64 `json:"value"` - // A comment about the metric, e.g. a description of the metric - Comment *string `json:"comment,omitempty"` - ID string `json:"id"` - SpanID string `json:"span_id"` - CreatedAt time.Time `json:"created_at"` -} - -func (u UpdateSpanMetricResponse) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(u, "", false) -} - -func (u *UpdateSpanMetricResponse) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &u, "", false, false); err != nil { - return err - } - return nil -} - -func (o *UpdateSpanMetricResponse) GetDimension() string { - if o == nil { - return "" - } - return o.Dimension -} - -func (o *UpdateSpanMetricResponse) GetValue() float64 { - if o == nil { - return 0.0 - } - return o.Value -} - -func (o *UpdateSpanMetricResponse) GetComment() *string { - if o == nil { - return nil - } - return o.Comment -} - -func (o *UpdateSpanMetricResponse) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *UpdateSpanMetricResponse) GetSpanID() string { - if o == nil { - return "" - } - return o.SpanID -} - -func (o *UpdateSpanMetricResponse) GetCreatedAt() time.Time { - if o == nil { - return time.Time{} - } - return o.CreatedAt -} diff --git a/tests/mockserver/internal/sdk/models/components/updatespanrequest.go b/tests/mockserver/internal/sdk/models/components/updatespanrequest.go deleted file mode 100644 index 4320614..0000000 --- a/tests/mockserver/internal/sdk/models/components/updatespanrequest.go +++ /dev/null @@ -1,103 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type UpdateSpanRequest struct { - // The name of the span, something descriptive about the span that will be used to identify it when querying - Name *string `json:"name,omitempty"` - // The start time of the span in UTC - StartTime *time.Time `json:"start_time,omitempty"` - // The type of the span - Type *string `json:"type,omitempty"` - // The end time of the span in UTC - EndTime *time.Time `json:"end_time,omitempty"` - // The input of the span - Input *string `json:"input,omitempty"` - // The output of the span - Output *string `json:"output,omitempty"` - // In case of an error, the error message - Error *string `json:"error,omitempty"` - // The meta data of the span - Meta map[string]any `json:"meta,omitempty"` - // The score of the span - Score *int64 `json:"score,omitempty"` -} - -func (u UpdateSpanRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(u, "", false) -} - -func (u *UpdateSpanRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &u, "", false, false); err != nil { - return err - } - return nil -} - -func (o *UpdateSpanRequest) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *UpdateSpanRequest) GetStartTime() *time.Time { - if o == nil { - return nil - } - return o.StartTime -} - -func (o *UpdateSpanRequest) GetType() *string { - if o == nil { - return nil - } - return o.Type -} - -func (o *UpdateSpanRequest) GetEndTime() *time.Time { - if o == nil { - return nil - } - return o.EndTime -} - -func (o *UpdateSpanRequest) GetInput() *string { - if o == nil { - return nil - } - return o.Input -} - -func (o *UpdateSpanRequest) GetOutput() *string { - if o == nil { - return nil - } - return o.Output -} - -func (o *UpdateSpanRequest) GetError() *string { - if o == nil { - return nil - } - return o.Error -} - -func (o *UpdateSpanRequest) GetMeta() map[string]any { - if o == nil { - return nil - } - return o.Meta -} - -func (o *UpdateSpanRequest) GetScore() *int64 { - if o == nil { - return nil - } - return o.Score -} diff --git a/tests/mockserver/internal/sdk/models/components/updatespanresponse.go b/tests/mockserver/internal/sdk/models/components/updatespanresponse.go deleted file mode 100644 index 909952b..0000000 --- a/tests/mockserver/internal/sdk/models/components/updatespanresponse.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type UpdateSpanResponse struct { - // The name of the span, something descriptive about the span that will be used to identify it when querying - Name string `json:"name"` - // The start time of the span in UTC - StartTime *time.Time `json:"start_time,omitempty"` - ID string `json:"id"` - // The id of the trace - TraceID *string `json:"trace_id,omitempty"` - // The id of the parent span - ParentID *string `json:"parent_id,omitempty"` - // The type of the span - Type *string `json:"type,omitempty"` - // The end time of the span in UTC - EndTime *time.Time `json:"end_time,omitempty"` - // The input of the span - Input any `json:"input,omitempty"` - // The output of the span - Output any `json:"output,omitempty"` - // In case of an error, the error message - Error *string `json:"error,omitempty"` - // The metadata of the span - Meta map[string]any `json:"meta,omitempty"` - // The score of the span - Score *int64 `json:"score,omitempty"` -} - -func (u UpdateSpanResponse) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(u, "", false) -} - -func (u *UpdateSpanResponse) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &u, "", false, false); err != nil { - return err - } - return nil -} - -func (o *UpdateSpanResponse) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *UpdateSpanResponse) GetStartTime() *time.Time { - if o == nil { - return nil - } - return o.StartTime -} - -func (o *UpdateSpanResponse) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *UpdateSpanResponse) GetTraceID() *string { - if o == nil { - return nil - } - return o.TraceID -} - -func (o *UpdateSpanResponse) GetParentID() *string { - if o == nil { - return nil - } - return o.ParentID -} - -func (o *UpdateSpanResponse) GetType() *string { - if o == nil { - return nil - } - return o.Type -} - -func (o *UpdateSpanResponse) GetEndTime() *time.Time { - if o == nil { - return nil - } - return o.EndTime -} - -func (o *UpdateSpanResponse) GetInput() any { - if o == nil { - return nil - } - return o.Input -} - -func (o *UpdateSpanResponse) GetOutput() any { - if o == nil { - return nil - } - return o.Output -} - -func (o *UpdateSpanResponse) GetError() *string { - if o == nil { - return nil - } - return o.Error -} - -func (o *UpdateSpanResponse) GetMeta() map[string]any { - if o == nil { - return nil - } - return o.Meta -} - -func (o *UpdateSpanResponse) GetScore() *int64 { - if o == nil { - return nil - } - return o.Score -} diff --git a/tests/mockserver/internal/sdk/models/components/websearchoptions.go b/tests/mockserver/internal/sdk/models/components/websearchoptions.go deleted file mode 100644 index 4d7d094..0000000 --- a/tests/mockserver/internal/sdk/models/components/websearchoptions.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -type SearchContextSize string - -const ( - SearchContextSizeLow SearchContextSize = "low" - SearchContextSizeMedium SearchContextSize = "medium" - SearchContextSizeHigh SearchContextSize = "high" -) - -func (e SearchContextSize) ToPointer() *SearchContextSize { - return &e -} -func (e *SearchContextSize) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "low": - fallthrough - case "medium": - fallthrough - case "high": - *e = SearchContextSize(v) - return nil - default: - return fmt.Errorf("invalid value for SearchContextSize: %v", v) - } -} - -type WebSearchOptions struct { - SearchContextSize *SearchContextSize `json:"search_context_size,omitempty"` - UserLocation *WebSearchOptionsUserLocation `json:"user_location,omitempty"` -} - -func (o *WebSearchOptions) GetSearchContextSize() *SearchContextSize { - if o == nil { - return nil - } - return o.SearchContextSize -} - -func (o *WebSearchOptions) GetUserLocation() *WebSearchOptionsUserLocation { - if o == nil { - return nil - } - return o.UserLocation -} diff --git a/tests/mockserver/internal/sdk/models/components/websearchoptionsuserlocation.go b/tests/mockserver/internal/sdk/models/components/websearchoptionsuserlocation.go deleted file mode 100644 index 486f1ef..0000000 --- a/tests/mockserver/internal/sdk/models/components/websearchoptionsuserlocation.go +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" -) - -type WebSearchOptionsUserLocation struct { - Approximate WebSearchOptionsUserLocationApproximate `json:"approximate"` - type_ string `const:"approximate" json:"type"` -} - -func (w WebSearchOptionsUserLocation) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(w, "", false) -} - -func (w *WebSearchOptionsUserLocation) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &w, "", false, false); err != nil { - return err - } - return nil -} - -func (o *WebSearchOptionsUserLocation) GetApproximate() WebSearchOptionsUserLocationApproximate { - if o == nil { - return WebSearchOptionsUserLocationApproximate{} - } - return o.Approximate -} - -func (o *WebSearchOptionsUserLocation) GetType() string { - return "approximate" -} diff --git a/tests/mockserver/internal/sdk/models/components/websearchoptionsuserlocationapproximate.go b/tests/mockserver/internal/sdk/models/components/websearchoptionsuserlocationapproximate.go deleted file mode 100644 index 1b14e5f..0000000 --- a/tests/mockserver/internal/sdk/models/components/websearchoptionsuserlocationapproximate.go +++ /dev/null @@ -1,38 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type WebSearchOptionsUserLocationApproximate struct { - City *string `json:"city,omitempty"` - Country *string `json:"country,omitempty"` - Region *string `json:"region,omitempty"` - Timezone *string `json:"timezone,omitempty"` -} - -func (o *WebSearchOptionsUserLocationApproximate) GetCity() *string { - if o == nil { - return nil - } - return o.City -} - -func (o *WebSearchOptionsUserLocationApproximate) GetCountry() *string { - if o == nil { - return nil - } - return o.Country -} - -func (o *WebSearchOptionsUserLocationApproximate) GetRegion() *string { - if o == nil { - return nil - } - return o.Region -} - -func (o *WebSearchOptionsUserLocationApproximate) GetTimezone() *string { - if o == nil { - return nil - } - return o.Timezone -} diff --git a/tests/mockserver/internal/sdk/models/operations/addknowledgeknowledgebaseidaddpost.go b/tests/mockserver/internal/sdk/models/operations/addknowledgeknowledgebaseidaddpost.go deleted file mode 100644 index 6adca75..0000000 --- a/tests/mockserver/internal/sdk/models/operations/addknowledgeknowledgebaseidaddpost.go +++ /dev/null @@ -1,47 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type AddKnowledgeKnowledgeBaseIDAddPostRequest struct { - // The id of the knowledge base to add the data to - KnowledgeBaseID string `pathParam:"style=simple,explode=false,name=knowledge_base_id"` - AddRequest components.AddRequest `request:"mediaType=application/json"` -} - -func (o *AddKnowledgeKnowledgeBaseIDAddPostRequest) GetKnowledgeBaseID() string { - if o == nil { - return "" - } - return o.KnowledgeBaseID -} - -func (o *AddKnowledgeKnowledgeBaseIDAddPostRequest) GetAddRequest() components.AddRequest { - if o == nil { - return components.AddRequest{} - } - return o.AddRequest -} - -type AddKnowledgeKnowledgeBaseIDAddPostResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - Any any -} - -func (o *AddKnowledgeKnowledgeBaseIDAddPostResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AddKnowledgeKnowledgeBaseIDAddPostResponse) GetAny() any { - if o == nil { - return nil - } - return o.Any -} diff --git a/tests/mockserver/internal/sdk/models/operations/callfunctionfunctionsfunctionidcallpost.go b/tests/mockserver/internal/sdk/models/operations/callfunctionfunctionsfunctionidcallpost.go deleted file mode 100644 index 9250494..0000000 --- a/tests/mockserver/internal/sdk/models/operations/callfunctionfunctionsfunctionidcallpost.go +++ /dev/null @@ -1,47 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type CallFunctionFunctionsFunctionIDCallPostRequest struct { - // The id of the function to call - FunctionID string `pathParam:"style=simple,explode=false,name=function_id"` - AppAPIPublicV2FunctionsCallFunctionRequest components.AppAPIPublicV2FunctionsCallFunctionRequest `request:"mediaType=application/json"` -} - -func (o *CallFunctionFunctionsFunctionIDCallPostRequest) GetFunctionID() string { - if o == nil { - return "" - } - return o.FunctionID -} - -func (o *CallFunctionFunctionsFunctionIDCallPostRequest) GetAppAPIPublicV2FunctionsCallFunctionRequest() components.AppAPIPublicV2FunctionsCallFunctionRequest { - if o == nil { - return components.AppAPIPublicV2FunctionsCallFunctionRequest{} - } - return o.AppAPIPublicV2FunctionsCallFunctionRequest -} - -type CallFunctionFunctionsFunctionIDCallPostResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - AppAPIPublicV2FunctionsCallFunctionResponse *components.AppAPIPublicV2FunctionsCallFunctionResponse -} - -func (o *CallFunctionFunctionsFunctionIDCallPostResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CallFunctionFunctionsFunctionIDCallPostResponse) GetAppAPIPublicV2FunctionsCallFunctionResponse() *components.AppAPIPublicV2FunctionsCallFunctionResponse { - if o == nil { - return nil - } - return o.AppAPIPublicV2FunctionsCallFunctionResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/callfunctionrevisionfunctionsfunctionidcallrevisionidpost.go b/tests/mockserver/internal/sdk/models/operations/callfunctionrevisionfunctionsfunctionidcallrevisionidpost.go deleted file mode 100644 index 0306fa6..0000000 --- a/tests/mockserver/internal/sdk/models/operations/callfunctionrevisionfunctionsfunctionidcallrevisionidpost.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type CallFunctionRevisionFunctionsFunctionIDCallRevisionIDPostRequest struct { - // The id of the function to call - FunctionID string `pathParam:"style=simple,explode=false,name=function_id"` - // The id of the revision to call - RevisionID string `pathParam:"style=simple,explode=false,name=revision_id"` - AppAPIPublicV2FunctionsCallFunctionRequest components.AppAPIPublicV2FunctionsCallFunctionRequest `request:"mediaType=application/json"` -} - -func (o *CallFunctionRevisionFunctionsFunctionIDCallRevisionIDPostRequest) GetFunctionID() string { - if o == nil { - return "" - } - return o.FunctionID -} - -func (o *CallFunctionRevisionFunctionsFunctionIDCallRevisionIDPostRequest) GetRevisionID() string { - if o == nil { - return "" - } - return o.RevisionID -} - -func (o *CallFunctionRevisionFunctionsFunctionIDCallRevisionIDPostRequest) GetAppAPIPublicV2FunctionsCallFunctionRequest() components.AppAPIPublicV2FunctionsCallFunctionRequest { - if o == nil { - return components.AppAPIPublicV2FunctionsCallFunctionRequest{} - } - return o.AppAPIPublicV2FunctionsCallFunctionRequest -} - -type CallFunctionRevisionFunctionsFunctionIDCallRevisionIDPostResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - AppAPIPublicV2FunctionsCallFunctionResponse *components.AppAPIPublicV2FunctionsCallFunctionResponse -} - -func (o *CallFunctionRevisionFunctionsFunctionIDCallRevisionIDPostResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CallFunctionRevisionFunctionsFunctionIDCallRevisionIDPostResponse) GetAppAPIPublicV2FunctionsCallFunctionResponse() *components.AppAPIPublicV2FunctionsCallFunctionResponse { - if o == nil { - return nil - } - return o.AppAPIPublicV2FunctionsCallFunctionResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/chatcompletionsopenaichatcompletionspost.go b/tests/mockserver/internal/sdk/models/operations/chatcompletionsopenaichatcompletionspost.go deleted file mode 100644 index 4b61e63..0000000 --- a/tests/mockserver/internal/sdk/models/operations/chatcompletionsopenaichatcompletionspost.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "errors" - "fmt" - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type PayloadType string - -const ( - PayloadTypeChatCompletionNonStreaming PayloadType = "ChatCompletionNonStreaming" - PayloadTypeChatCompletionStreaming PayloadType = "ChatCompletionStreaming" -) - -type Payload struct { - ChatCompletionNonStreaming *components.ChatCompletionNonStreaming `queryParam:"inline"` - ChatCompletionStreaming *components.ChatCompletionStreaming `queryParam:"inline"` - - Type PayloadType -} - -func CreatePayloadChatCompletionNonStreaming(chatCompletionNonStreaming components.ChatCompletionNonStreaming) Payload { - typ := PayloadTypeChatCompletionNonStreaming - - return Payload{ - ChatCompletionNonStreaming: &chatCompletionNonStreaming, - Type: typ, - } -} - -func CreatePayloadChatCompletionStreaming(chatCompletionStreaming components.ChatCompletionStreaming) Payload { - typ := PayloadTypeChatCompletionStreaming - - return Payload{ - ChatCompletionStreaming: &chatCompletionStreaming, - Type: typ, - } -} - -func (u *Payload) UnmarshalJSON(data []byte) error { - - var chatCompletionNonStreaming components.ChatCompletionNonStreaming = components.ChatCompletionNonStreaming{} - if err := utils.UnmarshalJSON(data, &chatCompletionNonStreaming, "", true, true); err == nil { - u.ChatCompletionNonStreaming = &chatCompletionNonStreaming - u.Type = PayloadTypeChatCompletionNonStreaming - return nil - } - - var chatCompletionStreaming components.ChatCompletionStreaming = components.ChatCompletionStreaming{} - if err := utils.UnmarshalJSON(data, &chatCompletionStreaming, "", true, true); err == nil { - u.ChatCompletionStreaming = &chatCompletionStreaming - u.Type = PayloadTypeChatCompletionStreaming - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for Payload", string(data)) -} - -func (u Payload) MarshalJSON() ([]byte, error) { - if u.ChatCompletionNonStreaming != nil { - return utils.MarshalJSON(u.ChatCompletionNonStreaming, "", true) - } - - if u.ChatCompletionStreaming != nil { - return utils.MarshalJSON(u.ChatCompletionStreaming, "", true) - } - - return nil, errors.New("could not marshal union type Payload: all fields are null") -} - -type ChatCompletionsOpenaiChatCompletionsPostResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - ChatCompletion *components.ChatCompletion -} - -func (o *ChatCompletionsOpenaiChatCompletionsPostResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *ChatCompletionsOpenaiChatCompletionsPostResponse) GetChatCompletion() *components.ChatCompletion { - if o == nil { - return nil - } - return o.ChatCompletion -} diff --git a/tests/mockserver/internal/sdk/models/operations/createdatasetentrydatasetsdatasetidpost.go b/tests/mockserver/internal/sdk/models/operations/createdatasetentrydatasetsdatasetidpost.go deleted file mode 100644 index c504ded..0000000 --- a/tests/mockserver/internal/sdk/models/operations/createdatasetentrydatasetsdatasetidpost.go +++ /dev/null @@ -1,47 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type CreateDatasetEntryDatasetsDatasetIDPostRequest struct { - // The id of the dataset - DatasetID string `pathParam:"style=simple,explode=false,name=dataset_id"` - CreateDatasetEntryRequest components.CreateDatasetEntryRequest `request:"mediaType=application/json"` -} - -func (o *CreateDatasetEntryDatasetsDatasetIDPostRequest) GetDatasetID() string { - if o == nil { - return "" - } - return o.DatasetID -} - -func (o *CreateDatasetEntryDatasetsDatasetIDPostRequest) GetCreateDatasetEntryRequest() components.CreateDatasetEntryRequest { - if o == nil { - return components.CreateDatasetEntryRequest{} - } - return o.CreateDatasetEntryRequest -} - -type CreateDatasetEntryDatasetsDatasetIDPostResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - CreateDatasetEntryResponse *components.CreateDatasetEntryResponse -} - -func (o *CreateDatasetEntryDatasetsDatasetIDPostResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CreateDatasetEntryDatasetsDatasetIDPostResponse) GetCreateDatasetEntryResponse() *components.CreateDatasetEntryResponse { - if o == nil { - return nil - } - return o.CreateDatasetEntryResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/createembeddingembeddingspost.go b/tests/mockserver/internal/sdk/models/operations/createembeddingembeddingspost.go deleted file mode 100644 index 43fac17..0000000 --- a/tests/mockserver/internal/sdk/models/operations/createembeddingembeddingspost.go +++ /dev/null @@ -1,27 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type CreateEmbeddingEmbeddingsPostResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - CreateEmbeddingResponse *components.CreateEmbeddingResponse -} - -func (o *CreateEmbeddingEmbeddingsPostResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CreateEmbeddingEmbeddingsPostResponse) GetCreateEmbeddingResponse() *components.CreateEmbeddingResponse { - if o == nil { - return nil - } - return o.CreateEmbeddingResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/createfunctionfunctionspost.go b/tests/mockserver/internal/sdk/models/operations/createfunctionfunctionspost.go deleted file mode 100644 index 9f9fb3c..0000000 --- a/tests/mockserver/internal/sdk/models/operations/createfunctionfunctionspost.go +++ /dev/null @@ -1,27 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type CreateFunctionFunctionsPostResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - CreateFunctionResponse *components.CreateFunctionResponse -} - -func (o *CreateFunctionFunctionsPostResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CreateFunctionFunctionsPostResponse) GetCreateFunctionResponse() *components.CreateFunctionResponse { - if o == nil { - return nil - } - return o.CreateFunctionResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/createknowledgebaseknowledgepost.go b/tests/mockserver/internal/sdk/models/operations/createknowledgebaseknowledgepost.go deleted file mode 100644 index 30278fe..0000000 --- a/tests/mockserver/internal/sdk/models/operations/createknowledgebaseknowledgepost.go +++ /dev/null @@ -1,27 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type CreateKnowledgeBaseKnowledgePostResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - CreateKnowledgeBaseResponse *components.CreateKnowledgeBaseResponse -} - -func (o *CreateKnowledgeBaseKnowledgePostResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CreateKnowledgeBaseKnowledgePostResponse) GetCreateKnowledgeBaseResponse() *components.CreateKnowledgeBaseResponse { - if o == nil { - return nil - } - return o.CreateKnowledgeBaseResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/createmetricspansspanidmetricspost.go b/tests/mockserver/internal/sdk/models/operations/createmetricspansspanidmetricspost.go deleted file mode 100644 index 2530d6a..0000000 --- a/tests/mockserver/internal/sdk/models/operations/createmetricspansspanidmetricspost.go +++ /dev/null @@ -1,47 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type CreateMetricSpansSpanIDMetricsPostRequest struct { - // The id of the span - SpanID string `pathParam:"style=simple,explode=false,name=span_id"` - CreateSpanMetricRequest components.CreateSpanMetricRequest `request:"mediaType=application/json"` -} - -func (o *CreateMetricSpansSpanIDMetricsPostRequest) GetSpanID() string { - if o == nil { - return "" - } - return o.SpanID -} - -func (o *CreateMetricSpansSpanIDMetricsPostRequest) GetCreateSpanMetricRequest() components.CreateSpanMetricRequest { - if o == nil { - return components.CreateSpanMetricRequest{} - } - return o.CreateSpanMetricRequest -} - -type CreateMetricSpansSpanIDMetricsPostResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - CreateSpanMetricResponse *components.CreateSpanMetricResponse -} - -func (o *CreateMetricSpansSpanIDMetricsPostResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CreateMetricSpansSpanIDMetricsPostResponse) GetCreateSpanMetricResponse() *components.CreateSpanMetricResponse { - if o == nil { - return nil - } - return o.CreateSpanMetricResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/createspanspanspost.go b/tests/mockserver/internal/sdk/models/operations/createspanspanspost.go deleted file mode 100644 index 8058af3..0000000 --- a/tests/mockserver/internal/sdk/models/operations/createspanspanspost.go +++ /dev/null @@ -1,27 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type CreateSpanSpansPostResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - CreateSpanResponse *components.CreateSpanResponse -} - -func (o *CreateSpanSpansPostResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CreateSpanSpansPostResponse) GetCreateSpanResponse() *components.CreateSpanResponse { - if o == nil { - return nil - } - return o.CreateSpanResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/deletecustommodelmodelscustommodeliddelete.go b/tests/mockserver/internal/sdk/models/operations/deletecustommodelmodelscustommodeliddelete.go deleted file mode 100644 index 8942138..0000000 --- a/tests/mockserver/internal/sdk/models/operations/deletecustommodelmodelscustommodeliddelete.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type DeleteCustomModelModelsCustomModelIDDeleteRequest struct { - // The ID of the custom language model to delete - ModelID string `pathParam:"style=simple,explode=false,name=model_id"` -} - -func (o *DeleteCustomModelModelsCustomModelIDDeleteRequest) GetModelID() string { - if o == nil { - return "" - } - return o.ModelID -} - -type DeleteCustomModelModelsCustomModelIDDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` -} - -func (o *DeleteCustomModelModelsCustomModelIDDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} diff --git a/tests/mockserver/internal/sdk/models/operations/deletedatasetentrydatasetsdatasetidentriesentryiddelete.go b/tests/mockserver/internal/sdk/models/operations/deletedatasetentrydatasetsdatasetidentriesentryiddelete.go deleted file mode 100644 index f6581ff..0000000 --- a/tests/mockserver/internal/sdk/models/operations/deletedatasetentrydatasetsdatasetidentriesentryiddelete.go +++ /dev/null @@ -1,39 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type DeleteDatasetEntryDatasetsDatasetIDEntriesEntryIDDeleteRequest struct { - // The id of the dataset - DatasetID string `pathParam:"style=simple,explode=false,name=dataset_id"` - // The id of the entry to delete - EntryID string `pathParam:"style=simple,explode=false,name=entry_id"` -} - -func (o *DeleteDatasetEntryDatasetsDatasetIDEntriesEntryIDDeleteRequest) GetDatasetID() string { - if o == nil { - return "" - } - return o.DatasetID -} - -func (o *DeleteDatasetEntryDatasetsDatasetIDEntriesEntryIDDeleteRequest) GetEntryID() string { - if o == nil { - return "" - } - return o.EntryID -} - -type DeleteDatasetEntryDatasetsDatasetIDEntriesEntryIDDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` -} - -func (o *DeleteDatasetEntryDatasetsDatasetIDEntriesEntryIDDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} diff --git a/tests/mockserver/internal/sdk/models/operations/deletefilefromknowledgebaseknowledgeknowledgebaseidfilesfileiddelete.go b/tests/mockserver/internal/sdk/models/operations/deletefilefromknowledgebaseknowledgeknowledgebaseidfilesfileiddelete.go deleted file mode 100644 index 3096d80..0000000 --- a/tests/mockserver/internal/sdk/models/operations/deletefilefromknowledgebaseknowledgeknowledgebaseidfilesfileiddelete.go +++ /dev/null @@ -1,39 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type DeleteFileFromKnowledgeBaseKnowledgeKnowledgeBaseIDFilesFileIDDeleteRequest struct { - // The id of the knowledge base - KnowledgeBaseID string `pathParam:"style=simple,explode=false,name=knowledge_base_id"` - // The id of the file to delete - FileID string `pathParam:"style=simple,explode=false,name=file_id"` -} - -func (o *DeleteFileFromKnowledgeBaseKnowledgeKnowledgeBaseIDFilesFileIDDeleteRequest) GetKnowledgeBaseID() string { - if o == nil { - return "" - } - return o.KnowledgeBaseID -} - -func (o *DeleteFileFromKnowledgeBaseKnowledgeKnowledgeBaseIDFilesFileIDDeleteRequest) GetFileID() string { - if o == nil { - return "" - } - return o.FileID -} - -type DeleteFileFromKnowledgeBaseKnowledgeKnowledgeBaseIDFilesFileIDDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` -} - -func (o *DeleteFileFromKnowledgeBaseKnowledgeKnowledgeBaseIDFilesFileIDDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} diff --git a/tests/mockserver/internal/sdk/models/operations/deletefunctionfunctionsfunctioniddelete.go b/tests/mockserver/internal/sdk/models/operations/deletefunctionfunctionsfunctioniddelete.go deleted file mode 100644 index 0ce65be..0000000 --- a/tests/mockserver/internal/sdk/models/operations/deletefunctionfunctionsfunctioniddelete.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type DeleteFunctionFunctionsFunctionIDDeleteRequest struct { - // Unique identifier of the function given as a UUID - FunctionID string `pathParam:"style=simple,explode=false,name=function_id"` -} - -func (o *DeleteFunctionFunctionsFunctionIDDeleteRequest) GetFunctionID() string { - if o == nil { - return "" - } - return o.FunctionID -} - -type DeleteFunctionFunctionsFunctionIDDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` -} - -func (o *DeleteFunctionFunctionsFunctionIDDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} diff --git a/tests/mockserver/internal/sdk/models/operations/deleteknowledgebaseknowledgeknowledgebaseiddelete.go b/tests/mockserver/internal/sdk/models/operations/deleteknowledgebaseknowledgeknowledgebaseiddelete.go deleted file mode 100644 index bdc7a8a..0000000 --- a/tests/mockserver/internal/sdk/models/operations/deleteknowledgebaseknowledgeknowledgebaseiddelete.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type DeleteKnowledgeBaseKnowledgeKnowledgeBaseIDDeleteRequest struct { - // The id of the knowledge base to delete - KnowledgeBaseID string `pathParam:"style=simple,explode=false,name=knowledge_base_id"` -} - -func (o *DeleteKnowledgeBaseKnowledgeKnowledgeBaseIDDeleteRequest) GetKnowledgeBaseID() string { - if o == nil { - return "" - } - return o.KnowledgeBaseID -} - -type DeleteKnowledgeBaseKnowledgeKnowledgeBaseIDDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` -} - -func (o *DeleteKnowledgeBaseKnowledgeKnowledgeBaseIDDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} diff --git a/tests/mockserver/internal/sdk/models/operations/deletemetricspansspanidmetricsmetriciddelete.go b/tests/mockserver/internal/sdk/models/operations/deletemetricspansspanidmetricsmetriciddelete.go deleted file mode 100644 index a1b500b..0000000 --- a/tests/mockserver/internal/sdk/models/operations/deletemetricspansspanidmetricsmetriciddelete.go +++ /dev/null @@ -1,37 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type DeleteMetricSpansSpanIDMetricsMetricIDDeleteRequest struct { - SpanID string `pathParam:"style=simple,explode=false,name=span_id"` - MetricID string `pathParam:"style=simple,explode=false,name=metric_id"` -} - -func (o *DeleteMetricSpansSpanIDMetricsMetricIDDeleteRequest) GetSpanID() string { - if o == nil { - return "" - } - return o.SpanID -} - -func (o *DeleteMetricSpansSpanIDMetricsMetricIDDeleteRequest) GetMetricID() string { - if o == nil { - return "" - } - return o.MetricID -} - -type DeleteMetricSpansSpanIDMetricsMetricIDDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` -} - -func (o *DeleteMetricSpansSpanIDMetricsMetricIDDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} diff --git a/tests/mockserver/internal/sdk/models/operations/deletespanspansspaniddelete.go b/tests/mockserver/internal/sdk/models/operations/deletespanspansspaniddelete.go deleted file mode 100644 index bb4bfae..0000000 --- a/tests/mockserver/internal/sdk/models/operations/deletespanspansspaniddelete.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type DeleteSpanSpansSpanIDDeleteRequest struct { - // The ID of the span to delete - SpanID string `pathParam:"style=simple,explode=false,name=span_id"` -} - -func (o *DeleteSpanSpansSpanIDDeleteRequest) GetSpanID() string { - if o == nil { - return "" - } - return o.SpanID -} - -type DeleteSpanSpansSpanIDDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` -} - -func (o *DeleteSpanSpansSpanIDDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} diff --git a/tests/mockserver/internal/sdk/models/operations/functioncallcallpost.go b/tests/mockserver/internal/sdk/models/operations/functioncallcallpost.go deleted file mode 100644 index 98f62c3..0000000 --- a/tests/mockserver/internal/sdk/models/operations/functioncallcallpost.go +++ /dev/null @@ -1,27 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type FunctionCallCallPostResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - AppAPIPublicV2FunctionCallCallFunctionResponse *components.AppAPIPublicV2FunctionCallCallFunctionResponse -} - -func (o *FunctionCallCallPostResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *FunctionCallCallPostResponse) GetAppAPIPublicV2FunctionCallCallFunctionResponse() *components.AppAPIPublicV2FunctionCallCallFunctionResponse { - if o == nil { - return nil - } - return o.AppAPIPublicV2FunctionCallCallFunctionResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/functionstreamcallstreampost.go b/tests/mockserver/internal/sdk/models/operations/functionstreamcallstreampost.go deleted file mode 100644 index 6b3c10a..0000000 --- a/tests/mockserver/internal/sdk/models/operations/functionstreamcallstreampost.go +++ /dev/null @@ -1,102 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/types/stream" -) - -// FunctionStreamCallStreamPostData - The actual data payload containing streaming chunk information -type FunctionStreamCallStreamPostData struct { - // Incremental text content generated by the model - Delta *string `json:"delta,omitempty"` - // Unique identifier for the execution span - SpanID *string `json:"span_id,omitempty"` -} - -func (o *FunctionStreamCallStreamPostData) GetDelta() *string { - if o == nil { - return nil - } - return o.Delta -} - -func (o *FunctionStreamCallStreamPostData) GetSpanID() *string { - if o == nil { - return nil - } - return o.SpanID -} - -// FunctionStreamCallStreamPostResponseBody - Server-Sent Event following the SSE specification -type FunctionStreamCallStreamPostResponseBody struct { - // Event ID for the SSE event - ID *string `json:"id,omitempty"` - // Event type for the SSE event - Event *string `json:"event,omitempty"` - // The actual data payload containing streaming chunk information - Data FunctionStreamCallStreamPostData `json:"data"` - // Retry interval in milliseconds for the SSE connection - Retry *int64 `json:"retry,omitempty"` -} - -func (o *FunctionStreamCallStreamPostResponseBody) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *FunctionStreamCallStreamPostResponseBody) GetEvent() *string { - if o == nil { - return nil - } - return o.Event -} - -func (o *FunctionStreamCallStreamPostResponseBody) GetData() FunctionStreamCallStreamPostData { - if o == nil { - return FunctionStreamCallStreamPostData{} - } - return o.Data -} - -func (o *FunctionStreamCallStreamPostResponseBody) GetRetry() *int64 { - if o == nil { - return nil - } - return o.Retry -} - -func (o FunctionStreamCallStreamPostResponseBody) GetEventEncoding(event string) (string, error) { - return "application/json", nil -} - -type FunctionStreamCallStreamPostResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Server-Sent Events stream of function execution chunks - Object *stream.EventStream[FunctionStreamCallStreamPostResponseBody] - Headers map[string][]string -} - -func (o *FunctionStreamCallStreamPostResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *FunctionStreamCallStreamPostResponse) GetObject() *stream.EventStream[FunctionStreamCallStreamPostResponseBody] { - if o == nil { - return nil - } - return o.Object -} - -func (o *FunctionStreamCallStreamPostResponse) GetHeaders() map[string][]string { - if o == nil { - return map[string][]string{} - } - return o.Headers -} diff --git a/tests/mockserver/internal/sdk/models/operations/getcustommodelbynamemodelscustombynamenameget.go b/tests/mockserver/internal/sdk/models/operations/getcustommodelbynamemodelscustombynamenameget.go deleted file mode 100644 index bd06f49..0000000 --- a/tests/mockserver/internal/sdk/models/operations/getcustommodelbynamemodelscustombynamenameget.go +++ /dev/null @@ -1,38 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type GetCustomModelByNameModelsCustomByNameNameGetRequest struct { - Name string `pathParam:"style=simple,explode=false,name=name"` -} - -func (o *GetCustomModelByNameModelsCustomByNameNameGetRequest) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -type GetCustomModelByNameModelsCustomByNameNameGetResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - GetCustomModelResponse *components.GetCustomModelResponse -} - -func (o *GetCustomModelByNameModelsCustomByNameNameGetResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *GetCustomModelByNameModelsCustomByNameNameGetResponse) GetGetCustomModelResponse() *components.GetCustomModelResponse { - if o == nil { - return nil - } - return o.GetCustomModelResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/getcustommodelmodelscustommodelidget.go b/tests/mockserver/internal/sdk/models/operations/getcustommodelmodelscustommodelidget.go deleted file mode 100644 index a96d950..0000000 --- a/tests/mockserver/internal/sdk/models/operations/getcustommodelmodelscustommodelidget.go +++ /dev/null @@ -1,39 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type GetCustomModelModelsCustomModelIDGetRequest struct { - // The ID of the custom language model to get - ModelID string `pathParam:"style=simple,explode=false,name=model_id"` -} - -func (o *GetCustomModelModelsCustomModelIDGetRequest) GetModelID() string { - if o == nil { - return "" - } - return o.ModelID -} - -type GetCustomModelModelsCustomModelIDGetResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - GetCustomModelResponse *components.GetCustomModelResponse -} - -func (o *GetCustomModelModelsCustomModelIDGetResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *GetCustomModelModelsCustomModelIDGetResponse) GetGetCustomModelResponse() *components.GetCustomModelResponse { - if o == nil { - return nil - } - return o.GetCustomModelResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/getdatasetentrydatasetsdatasetidentriesentryidget.go b/tests/mockserver/internal/sdk/models/operations/getdatasetentrydatasetsdatasetidentriesentryidget.go deleted file mode 100644 index 39db4ac..0000000 --- a/tests/mockserver/internal/sdk/models/operations/getdatasetentrydatasetsdatasetidentriesentryidget.go +++ /dev/null @@ -1,48 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type GetDatasetEntryDatasetsDatasetIDEntriesEntryIDGetRequest struct { - // The id of the dataset - DatasetID string `pathParam:"style=simple,explode=false,name=dataset_id"` - // The id of the entry to get - EntryID string `pathParam:"style=simple,explode=false,name=entry_id"` -} - -func (o *GetDatasetEntryDatasetsDatasetIDEntriesEntryIDGetRequest) GetDatasetID() string { - if o == nil { - return "" - } - return o.DatasetID -} - -func (o *GetDatasetEntryDatasetsDatasetIDEntriesEntryIDGetRequest) GetEntryID() string { - if o == nil { - return "" - } - return o.EntryID -} - -type GetDatasetEntryDatasetsDatasetIDEntriesEntryIDGetResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - GetDatasetEntryResponse *components.GetDatasetEntryResponse -} - -func (o *GetDatasetEntryDatasetsDatasetIDEntriesEntryIDGetResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *GetDatasetEntryDatasetsDatasetIDEntriesEntryIDGetResponse) GetGetDatasetEntryResponse() *components.GetDatasetEntryResponse { - if o == nil { - return nil - } - return o.GetDatasetEntryResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/getfunctionbynamefunctionsbynamenameget.go b/tests/mockserver/internal/sdk/models/operations/getfunctionbynamefunctionsbynamenameget.go deleted file mode 100644 index baa6754..0000000 --- a/tests/mockserver/internal/sdk/models/operations/getfunctionbynamefunctionsbynamenameget.go +++ /dev/null @@ -1,39 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type GetFunctionByNameFunctionsByNameNameGetRequest struct { - // The name of the function to retrieve - Name string `pathParam:"style=simple,explode=false,name=name"` -} - -func (o *GetFunctionByNameFunctionsByNameNameGetRequest) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -type GetFunctionByNameFunctionsByNameNameGetResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - GetFunctionResponse *components.GetFunctionResponse -} - -func (o *GetFunctionByNameFunctionsByNameNameGetResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *GetFunctionByNameFunctionsByNameNameGetResponse) GetGetFunctionResponse() *components.GetFunctionResponse { - if o == nil { - return nil - } - return o.GetFunctionResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/getfunctionbyrevisionfunctionsfunctionidrevisionsrevisionidget.go b/tests/mockserver/internal/sdk/models/operations/getfunctionbyrevisionfunctionsfunctionidrevisionsrevisionidget.go deleted file mode 100644 index 224e466..0000000 --- a/tests/mockserver/internal/sdk/models/operations/getfunctionbyrevisionfunctionsfunctionidrevisionsrevisionidget.go +++ /dev/null @@ -1,48 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type GetFunctionByRevisionFunctionsFunctionIDRevisionsRevisionIDGetRequest struct { - // The id of the function to retrieve - FunctionID string `pathParam:"style=simple,explode=false,name=function_id"` - // The id of the revision to retrieve - RevisionID string `pathParam:"style=simple,explode=false,name=revision_id"` -} - -func (o *GetFunctionByRevisionFunctionsFunctionIDRevisionsRevisionIDGetRequest) GetFunctionID() string { - if o == nil { - return "" - } - return o.FunctionID -} - -func (o *GetFunctionByRevisionFunctionsFunctionIDRevisionsRevisionIDGetRequest) GetRevisionID() string { - if o == nil { - return "" - } - return o.RevisionID -} - -type GetFunctionByRevisionFunctionsFunctionIDRevisionsRevisionIDGetResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - GetFunctionResponse *components.GetFunctionResponse -} - -func (o *GetFunctionByRevisionFunctionsFunctionIDRevisionsRevisionIDGetResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *GetFunctionByRevisionFunctionsFunctionIDRevisionsRevisionIDGetResponse) GetGetFunctionResponse() *components.GetFunctionResponse { - if o == nil { - return nil - } - return o.GetFunctionResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/getfunctionfunctionsfunctionidget.go b/tests/mockserver/internal/sdk/models/operations/getfunctionfunctionsfunctionidget.go deleted file mode 100644 index a724e86..0000000 --- a/tests/mockserver/internal/sdk/models/operations/getfunctionfunctionsfunctionidget.go +++ /dev/null @@ -1,39 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type GetFunctionFunctionsFunctionIDGetRequest struct { - // The id of the function to retrieve - FunctionID string `pathParam:"style=simple,explode=false,name=function_id"` -} - -func (o *GetFunctionFunctionsFunctionIDGetRequest) GetFunctionID() string { - if o == nil { - return "" - } - return o.FunctionID -} - -type GetFunctionFunctionsFunctionIDGetResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - GetFunctionResponse *components.GetFunctionResponse -} - -func (o *GetFunctionFunctionsFunctionIDGetResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *GetFunctionFunctionsFunctionIDGetResponse) GetGetFunctionResponse() *components.GetFunctionResponse { - if o == nil { - return nil - } - return o.GetFunctionResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/getknowledgebasebynameknowledgebynameknowledgebasenameget.go b/tests/mockserver/internal/sdk/models/operations/getknowledgebasebynameknowledgebynameknowledgebasenameget.go deleted file mode 100644 index 075f1b3..0000000 --- a/tests/mockserver/internal/sdk/models/operations/getknowledgebasebynameknowledgebynameknowledgebasenameget.go +++ /dev/null @@ -1,39 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type GetKnowledgeBaseByNameKnowledgeByNameKnowledgeBaseNameGetRequest struct { - // The name of the knowledge base to get - KnowledgeBaseName string `pathParam:"style=simple,explode=false,name=knowledge_base_name"` -} - -func (o *GetKnowledgeBaseByNameKnowledgeByNameKnowledgeBaseNameGetRequest) GetKnowledgeBaseName() string { - if o == nil { - return "" - } - return o.KnowledgeBaseName -} - -type GetKnowledgeBaseByNameKnowledgeByNameKnowledgeBaseNameGetResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - GetKnowledgeBaseResponse *components.GetKnowledgeBaseResponse -} - -func (o *GetKnowledgeBaseByNameKnowledgeByNameKnowledgeBaseNameGetResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *GetKnowledgeBaseByNameKnowledgeByNameKnowledgeBaseNameGetResponse) GetGetKnowledgeBaseResponse() *components.GetKnowledgeBaseResponse { - if o == nil { - return nil - } - return o.GetKnowledgeBaseResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/getknowledgebaseknowledgeknowledgebaseidget.go b/tests/mockserver/internal/sdk/models/operations/getknowledgebaseknowledgeknowledgebaseidget.go deleted file mode 100644 index 2ecbb04..0000000 --- a/tests/mockserver/internal/sdk/models/operations/getknowledgebaseknowledgeknowledgebaseidget.go +++ /dev/null @@ -1,39 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type GetKnowledgeBaseKnowledgeKnowledgeBaseIDGetRequest struct { - // The id of the knowledge base to get - KnowledgeBaseID string `pathParam:"style=simple,explode=false,name=knowledge_base_id"` -} - -func (o *GetKnowledgeBaseKnowledgeKnowledgeBaseIDGetRequest) GetKnowledgeBaseID() string { - if o == nil { - return "" - } - return o.KnowledgeBaseID -} - -type GetKnowledgeBaseKnowledgeKnowledgeBaseIDGetResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - GetKnowledgeBaseResponse *components.GetKnowledgeBaseResponse -} - -func (o *GetKnowledgeBaseKnowledgeKnowledgeBaseIDGetResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *GetKnowledgeBaseKnowledgeKnowledgeBaseIDGetResponse) GetGetKnowledgeBaseResponse() *components.GetKnowledgeBaseResponse { - if o == nil { - return nil - } - return o.GetKnowledgeBaseResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/getmetricspansspanidmetricsmetricidget.go b/tests/mockserver/internal/sdk/models/operations/getmetricspansspanidmetricsmetricidget.go deleted file mode 100644 index bd19474..0000000 --- a/tests/mockserver/internal/sdk/models/operations/getmetricspansspanidmetricsmetricidget.go +++ /dev/null @@ -1,48 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type GetMetricSpansSpanIDMetricsMetricIDGetRequest struct { - // The id of the span - SpanID string `pathParam:"style=simple,explode=false,name=span_id"` - // The id of the metric to get - MetricID string `pathParam:"style=simple,explode=false,name=metric_id"` -} - -func (o *GetMetricSpansSpanIDMetricsMetricIDGetRequest) GetSpanID() string { - if o == nil { - return "" - } - return o.SpanID -} - -func (o *GetMetricSpansSpanIDMetricsMetricIDGetRequest) GetMetricID() string { - if o == nil { - return "" - } - return o.MetricID -} - -type GetMetricSpansSpanIDMetricsMetricIDGetResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - GetSpanMetricResponse *components.GetSpanMetricResponse -} - -func (o *GetMetricSpansSpanIDMetricsMetricIDGetResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *GetMetricSpansSpanIDMetricsMetricIDGetResponse) GetGetSpanMetricResponse() *components.GetSpanMetricResponse { - if o == nil { - return nil - } - return o.GetSpanMetricResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/getspanspansspanidget.go b/tests/mockserver/internal/sdk/models/operations/getspanspansspanidget.go deleted file mode 100644 index 6f3e2ca..0000000 --- a/tests/mockserver/internal/sdk/models/operations/getspanspansspanidget.go +++ /dev/null @@ -1,39 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type GetSpanSpansSpanIDGetRequest struct { - // The ID of the span to get - SpanID string `pathParam:"style=simple,explode=false,name=span_id"` -} - -func (o *GetSpanSpansSpanIDGetRequest) GetSpanID() string { - if o == nil { - return "" - } - return o.SpanID -} - -type GetSpanSpansSpanIDGetResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - GetSpanResponse *components.GetSpanResponse -} - -func (o *GetSpanSpansSpanIDGetResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *GetSpanSpansSpanIDGetResponse) GetGetSpanResponse() *components.GetSpanResponse { - if o == nil { - return nil - } - return o.GetSpanResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/gettracetracestraceidget.go b/tests/mockserver/internal/sdk/models/operations/gettracetracestraceidget.go deleted file mode 100644 index 68a65c7..0000000 --- a/tests/mockserver/internal/sdk/models/operations/gettracetracestraceidget.go +++ /dev/null @@ -1,39 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type GetTraceTracesTraceIDGetRequest struct { - // The id of the trace to get - TraceID string `pathParam:"style=simple,explode=false,name=trace_id"` -} - -func (o *GetTraceTracesTraceIDGetRequest) GetTraceID() string { - if o == nil { - return "" - } - return o.TraceID -} - -type GetTraceTracesTraceIDGetResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - GetTraceResponse *components.GetTraceResponse -} - -func (o *GetTraceTracesTraceIDGetResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *GetTraceTracesTraceIDGetResponse) GetGetTraceResponse() *components.GetTraceResponse { - if o == nil { - return nil - } - return o.GetTraceResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/getuploadurlknowledgeknowledgebaseiduploadurlget.go b/tests/mockserver/internal/sdk/models/operations/getuploadurlknowledgeknowledgebaseiduploadurlget.go deleted file mode 100644 index 104f662..0000000 --- a/tests/mockserver/internal/sdk/models/operations/getuploadurlknowledgeknowledgebaseiduploadurlget.go +++ /dev/null @@ -1,48 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type GetUploadURLKnowledgeKnowledgeBaseIDUploadURLGetRequest struct { - // The id of the knowledge base to get the upload URL for - KnowledgeBaseID string `pathParam:"style=simple,explode=false,name=knowledge_base_id"` - // The filename of the file to upload - Filename string `queryParam:"style=form,explode=true,name=filename"` -} - -func (o *GetUploadURLKnowledgeKnowledgeBaseIDUploadURLGetRequest) GetKnowledgeBaseID() string { - if o == nil { - return "" - } - return o.KnowledgeBaseID -} - -func (o *GetUploadURLKnowledgeKnowledgeBaseIDUploadURLGetRequest) GetFilename() string { - if o == nil { - return "" - } - return o.Filename -} - -type GetUploadURLKnowledgeKnowledgeBaseIDUploadURLGetResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - GetUploadURLResponse *components.GetUploadURLResponse -} - -func (o *GetUploadURLKnowledgeKnowledgeBaseIDUploadURLGetResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *GetUploadURLKnowledgeKnowledgeBaseIDUploadURLGetResponse) GetGetUploadURLResponse() *components.GetUploadURLResponse { - if o == nil { - return nil - } - return o.GetUploadURLResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/listcustommodelsmodelscustomget.go b/tests/mockserver/internal/sdk/models/operations/listcustommodelsmodelscustomget.go deleted file mode 100644 index 848a857..0000000 --- a/tests/mockserver/internal/sdk/models/operations/listcustommodelsmodelscustomget.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type ListCustomModelsModelsCustomGetRequest struct { - // The offset of the first model to return - Offset *int64 `default:"0" queryParam:"style=form,explode=true,name=offset"` - // The maximum number of models to return - Limit *int64 `default:"100" queryParam:"style=form,explode=true,name=limit"` -} - -func (l ListCustomModelsModelsCustomGetRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(l, "", false) -} - -func (l *ListCustomModelsModelsCustomGetRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { - return err - } - return nil -} - -func (o *ListCustomModelsModelsCustomGetRequest) GetOffset() *int64 { - if o == nil { - return nil - } - return o.Offset -} - -func (o *ListCustomModelsModelsCustomGetRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -type ListCustomModelsModelsCustomGetResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - PaginatedResponseListCustomModelsResponseItem *components.PaginatedResponseListCustomModelsResponseItem -} - -func (o *ListCustomModelsModelsCustomGetResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *ListCustomModelsModelsCustomGetResponse) GetPaginatedResponseListCustomModelsResponseItem() *components.PaginatedResponseListCustomModelsResponseItem { - if o == nil { - return nil - } - return o.PaginatedResponseListCustomModelsResponseItem -} diff --git a/tests/mockserver/internal/sdk/models/operations/listdatasetentriesdatasetsdatasetidentriesget.go b/tests/mockserver/internal/sdk/models/operations/listdatasetentriesdatasetsdatasetidentriesget.go deleted file mode 100644 index bfc5875..0000000 --- a/tests/mockserver/internal/sdk/models/operations/listdatasetentriesdatasetsdatasetidentriesget.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type ListDatasetEntriesDatasetsDatasetIDEntriesGetRequest struct { - // The id of the dataset - DatasetID string `pathParam:"style=simple,explode=false,name=dataset_id"` - // The offset of the entries to get - Offset *int64 `default:"0" queryParam:"style=form,explode=true,name=offset"` - // The limit of the entries to get - Limit *int64 `default:"100" queryParam:"style=form,explode=true,name=limit"` -} - -func (l ListDatasetEntriesDatasetsDatasetIDEntriesGetRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(l, "", false) -} - -func (l *ListDatasetEntriesDatasetsDatasetIDEntriesGetRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { - return err - } - return nil -} - -func (o *ListDatasetEntriesDatasetsDatasetIDEntriesGetRequest) GetDatasetID() string { - if o == nil { - return "" - } - return o.DatasetID -} - -func (o *ListDatasetEntriesDatasetsDatasetIDEntriesGetRequest) GetOffset() *int64 { - if o == nil { - return nil - } - return o.Offset -} - -func (o *ListDatasetEntriesDatasetsDatasetIDEntriesGetRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -type ListDatasetEntriesDatasetsDatasetIDEntriesGetResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - PaginatedResponseGetDatasetEntriesResponse *components.PaginatedResponseGetDatasetEntriesResponse -} - -func (o *ListDatasetEntriesDatasetsDatasetIDEntriesGetResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *ListDatasetEntriesDatasetsDatasetIDEntriesGetResponse) GetPaginatedResponseGetDatasetEntriesResponse() *components.PaginatedResponseGetDatasetEntriesResponse { - if o == nil { - return nil - } - return o.PaginatedResponseGetDatasetEntriesResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/listfunctionrevisionsfunctionsfunctionidrevisionsget.go b/tests/mockserver/internal/sdk/models/operations/listfunctionrevisionsfunctionsfunctionidrevisionsget.go deleted file mode 100644 index eac1fbd..0000000 --- a/tests/mockserver/internal/sdk/models/operations/listfunctionrevisionsfunctionsfunctionidrevisionsget.go +++ /dev/null @@ -1,57 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type ListFunctionRevisionsFunctionsFunctionIDRevisionsGetRequest struct { - // The id of the function to get revisions for - FunctionID string `pathParam:"style=simple,explode=false,name=function_id"` - // The offset of the revisions to get - Offset *int64 `queryParam:"style=form,explode=true,name=offset"` - // The limit of the revisions to get - Limit *int64 `queryParam:"style=form,explode=true,name=limit"` -} - -func (o *ListFunctionRevisionsFunctionsFunctionIDRevisionsGetRequest) GetFunctionID() string { - if o == nil { - return "" - } - return o.FunctionID -} - -func (o *ListFunctionRevisionsFunctionsFunctionIDRevisionsGetRequest) GetOffset() *int64 { - if o == nil { - return nil - } - return o.Offset -} - -func (o *ListFunctionRevisionsFunctionsFunctionIDRevisionsGetRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -type ListFunctionRevisionsFunctionsFunctionIDRevisionsGetResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - PaginatedResponseListFunctionRevisionResponse *components.PaginatedResponseListFunctionRevisionResponse -} - -func (o *ListFunctionRevisionsFunctionsFunctionIDRevisionsGetResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *ListFunctionRevisionsFunctionsFunctionIDRevisionsGetResponse) GetPaginatedResponseListFunctionRevisionResponse() *components.PaginatedResponseListFunctionRevisionResponse { - if o == nil { - return nil - } - return o.PaginatedResponseListFunctionRevisionResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/listfunctionsfunctionsget.go b/tests/mockserver/internal/sdk/models/operations/listfunctionsfunctionsget.go deleted file mode 100644 index 08b4880..0000000 --- a/tests/mockserver/internal/sdk/models/operations/listfunctionsfunctionsget.go +++ /dev/null @@ -1,66 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type ListFunctionsFunctionsGetRequest struct { - // Filter functions by name - Name *string `queryParam:"style=form,explode=true,name=name"` - // Sort the functions by name or created_at, use '-' to sort in descending order - Sort *string `queryParam:"style=form,explode=true,name=sort"` - // The offset of the page of functions to return when paginating - Offset *int64 `queryParam:"style=form,explode=true,name=offset"` - // The number of functions to return per page when paginating - Limit *int64 `queryParam:"style=form,explode=true,name=limit"` -} - -func (o *ListFunctionsFunctionsGetRequest) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *ListFunctionsFunctionsGetRequest) GetSort() *string { - if o == nil { - return nil - } - return o.Sort -} - -func (o *ListFunctionsFunctionsGetRequest) GetOffset() *int64 { - if o == nil { - return nil - } - return o.Offset -} - -func (o *ListFunctionsFunctionsGetRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -type ListFunctionsFunctionsGetResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - PaginatedResponseListFunctionsResponseItem *components.PaginatedResponseListFunctionsResponseItem -} - -func (o *ListFunctionsFunctionsGetResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *ListFunctionsFunctionsGetResponse) GetPaginatedResponseListFunctionsResponseItem() *components.PaginatedResponseListFunctionsResponseItem { - if o == nil { - return nil - } - return o.PaginatedResponseListFunctionsResponseItem -} diff --git a/tests/mockserver/internal/sdk/models/operations/listknowledgebasesknowledgeget.go b/tests/mockserver/internal/sdk/models/operations/listknowledgebasesknowledgeget.go deleted file mode 100644 index 25af5c3..0000000 --- a/tests/mockserver/internal/sdk/models/operations/listknowledgebasesknowledgeget.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type ListKnowledgeBasesKnowledgeGetRequest struct { - // The offset to start the list from - Offset *int64 `default:"0" queryParam:"style=form,explode=true,name=offset"` - // The number of knowledge bases to return - Limit *int64 `default:"100" queryParam:"style=form,explode=true,name=limit"` -} - -func (l ListKnowledgeBasesKnowledgeGetRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(l, "", false) -} - -func (l *ListKnowledgeBasesKnowledgeGetRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { - return err - } - return nil -} - -func (o *ListKnowledgeBasesKnowledgeGetRequest) GetOffset() *int64 { - if o == nil { - return nil - } - return o.Offset -} - -func (o *ListKnowledgeBasesKnowledgeGetRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -type ListKnowledgeBasesKnowledgeGetResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - PaginatedResponseListKnowledgeBasesResponse *components.PaginatedResponseListKnowledgeBasesResponse -} - -func (o *ListKnowledgeBasesKnowledgeGetResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *ListKnowledgeBasesKnowledgeGetResponse) GetPaginatedResponseListKnowledgeBasesResponse() *components.PaginatedResponseListKnowledgeBasesResponse { - if o == nil { - return nil - } - return o.PaginatedResponseListKnowledgeBasesResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/listmetricsspansspanidmetricsget.go b/tests/mockserver/internal/sdk/models/operations/listmetricsspansspanidmetricsget.go deleted file mode 100644 index 5424133..0000000 --- a/tests/mockserver/internal/sdk/models/operations/listmetricsspansspanidmetricsget.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type ListMetricsSpansSpanIDMetricsGetRequest struct { - // The id of the span to list metrics for - SpanID string `pathParam:"style=simple,explode=false,name=span_id"` - // The offset to start the list from - Offset *int64 `default:"0" queryParam:"style=form,explode=true,name=offset"` - // The number of metrics to return - Limit *int64 `default:"100" queryParam:"style=form,explode=true,name=limit"` -} - -func (l ListMetricsSpansSpanIDMetricsGetRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(l, "", false) -} - -func (l *ListMetricsSpansSpanIDMetricsGetRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { - return err - } - return nil -} - -func (o *ListMetricsSpansSpanIDMetricsGetRequest) GetSpanID() string { - if o == nil { - return "" - } - return o.SpanID -} - -func (o *ListMetricsSpansSpanIDMetricsGetRequest) GetOffset() *int64 { - if o == nil { - return nil - } - return o.Offset -} - -func (o *ListMetricsSpansSpanIDMetricsGetRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -type ListMetricsSpansSpanIDMetricsGetResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - PaginatedResponseListSpanMetricsResponse *components.PaginatedResponseListSpanMetricsResponse -} - -func (o *ListMetricsSpansSpanIDMetricsGetResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *ListMetricsSpansSpanIDMetricsGetResponse) GetPaginatedResponseListSpanMetricsResponse() *components.PaginatedResponseListSpanMetricsResponse { - if o == nil { - return nil - } - return o.PaginatedResponseListSpanMetricsResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/listmodelsmodelsget.go b/tests/mockserver/internal/sdk/models/operations/listmodelsmodelsget.go deleted file mode 100644 index f580e4d..0000000 --- a/tests/mockserver/internal/sdk/models/operations/listmodelsmodelsget.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type ListModelsModelsGetRequest struct { - // The offset of the models to return when paginating - Offset *int64 `default:"0" queryParam:"style=form,explode=true,name=offset"` - // The number of models to return per page when paginating - Limit *int64 `default:"100" queryParam:"style=form,explode=true,name=limit"` -} - -func (l ListModelsModelsGetRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(l, "", false) -} - -func (l *ListModelsModelsGetRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { - return err - } - return nil -} - -func (o *ListModelsModelsGetRequest) GetOffset() *int64 { - if o == nil { - return nil - } - return o.Offset -} - -func (o *ListModelsModelsGetRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -type ListModelsModelsGetResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - PaginatedResponseListLanguageModelsResponse *components.PaginatedResponseListLanguageModelsResponse -} - -func (o *ListModelsModelsGetResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *ListModelsModelsGetResponse) GetPaginatedResponseListLanguageModelsResponse() *components.PaginatedResponseListLanguageModelsResponse { - if o == nil { - return nil - } - return o.PaginatedResponseListLanguageModelsResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/listtracestracesget.go b/tests/mockserver/internal/sdk/models/operations/listtracestracesget.go deleted file mode 100644 index c9584b8..0000000 --- a/tests/mockserver/internal/sdk/models/operations/listtracestracesget.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type ListTracesTracesGetRequest struct { - // The name of the trace to filter by, the name of a trace is the name of the root span of the trace - Name *string `queryParam:"style=form,explode=true,name=name"` - // The offset to start the list from - Offset *int64 `default:"0" queryParam:"style=form,explode=true,name=offset"` - // The number of traces to return - Limit *int64 `default:"100" queryParam:"style=form,explode=true,name=limit"` -} - -func (l ListTracesTracesGetRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(l, "", false) -} - -func (l *ListTracesTracesGetRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { - return err - } - return nil -} - -func (o *ListTracesTracesGetRequest) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *ListTracesTracesGetRequest) GetOffset() *int64 { - if o == nil { - return nil - } - return o.Offset -} - -func (o *ListTracesTracesGetRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -type ListTracesTracesGetResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - PaginatedResponseListTracesResponse *components.PaginatedResponseListTracesResponse -} - -func (o *ListTracesTracesGetResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *ListTracesTracesGetResponse) GetPaginatedResponseListTracesResponse() *components.PaginatedResponseListTracesResponse { - if o == nil { - return nil - } - return o.PaginatedResponseListTracesResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/querydatasetentriesdatasetsdatasetidentriesquerypost.go b/tests/mockserver/internal/sdk/models/operations/querydatasetentriesdatasetsdatasetidentriesquerypost.go deleted file mode 100644 index 1995342..0000000 --- a/tests/mockserver/internal/sdk/models/operations/querydatasetentriesdatasetsdatasetidentriesquerypost.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type QueryDatasetEntriesDatasetsDatasetIDEntriesQueryPostRequest struct { - // The id of the dataset - DatasetID string `pathParam:"style=simple,explode=false,name=dataset_id"` - // The query to search for - Query string `queryParam:"style=form,explode=true,name=query"` - // The limit of the entries to get - Limit *int64 `default:"5" queryParam:"style=form,explode=true,name=limit"` -} - -func (q QueryDatasetEntriesDatasetsDatasetIDEntriesQueryPostRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(q, "", false) -} - -func (q *QueryDatasetEntriesDatasetsDatasetIDEntriesQueryPostRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &q, "", false, false); err != nil { - return err - } - return nil -} - -func (o *QueryDatasetEntriesDatasetsDatasetIDEntriesQueryPostRequest) GetDatasetID() string { - if o == nil { - return "" - } - return o.DatasetID -} - -func (o *QueryDatasetEntriesDatasetsDatasetIDEntriesQueryPostRequest) GetQuery() string { - if o == nil { - return "" - } - return o.Query -} - -func (o *QueryDatasetEntriesDatasetsDatasetIDEntriesQueryPostRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -type QueryDatasetEntriesDatasetsDatasetIDEntriesQueryPostResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - ResponseQueryDatasetEntriesDatasetsDatasetIDEntriesQueryPost []components.QueryDatasetEntriesResponse -} - -func (o *QueryDatasetEntriesDatasetsDatasetIDEntriesQueryPostResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *QueryDatasetEntriesDatasetsDatasetIDEntriesQueryPostResponse) GetResponseQueryDatasetEntriesDatasetsDatasetIDEntriesQueryPost() []components.QueryDatasetEntriesResponse { - if o == nil { - return nil - } - return o.ResponseQueryDatasetEntriesDatasetsDatasetIDEntriesQueryPost -} diff --git a/tests/mockserver/internal/sdk/models/operations/queryknowledgebaseknowledgeknowledgebaseidquerypost.go b/tests/mockserver/internal/sdk/models/operations/queryknowledgebaseknowledgeknowledgebaseidquerypost.go deleted file mode 100644 index 46ff7c3..0000000 --- a/tests/mockserver/internal/sdk/models/operations/queryknowledgebaseknowledgeknowledgebaseidquerypost.go +++ /dev/null @@ -1,47 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type QueryKnowledgeBaseKnowledgeKnowledgeBaseIDQueryPostRequest struct { - // The id of the knowledge base to query - KnowledgeBaseID string `pathParam:"style=simple,explode=false,name=knowledge_base_id"` - QueryKnowledgeBaseRequest components.QueryKnowledgeBaseRequest `request:"mediaType=application/json"` -} - -func (o *QueryKnowledgeBaseKnowledgeKnowledgeBaseIDQueryPostRequest) GetKnowledgeBaseID() string { - if o == nil { - return "" - } - return o.KnowledgeBaseID -} - -func (o *QueryKnowledgeBaseKnowledgeKnowledgeBaseIDQueryPostRequest) GetQueryKnowledgeBaseRequest() components.QueryKnowledgeBaseRequest { - if o == nil { - return components.QueryKnowledgeBaseRequest{} - } - return o.QueryKnowledgeBaseRequest -} - -type QueryKnowledgeBaseKnowledgeKnowledgeBaseIDQueryPostResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - ResponseQueryKnowledgeBaseKnowledgeKnowledgeBaseIDQueryPost []components.QueryKnowledgeBaseResponse -} - -func (o *QueryKnowledgeBaseKnowledgeKnowledgeBaseIDQueryPostResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *QueryKnowledgeBaseKnowledgeKnowledgeBaseIDQueryPostResponse) GetResponseQueryKnowledgeBaseKnowledgeKnowledgeBaseIDQueryPost() []components.QueryKnowledgeBaseResponse { - if o == nil { - return nil - } - return o.ResponseQueryKnowledgeBaseKnowledgeKnowledgeBaseIDQueryPost -} diff --git a/tests/mockserver/internal/sdk/models/operations/registercustommodelmodelscustompost.go b/tests/mockserver/internal/sdk/models/operations/registercustommodelmodelscustompost.go deleted file mode 100644 index 2c2f1ae..0000000 --- a/tests/mockserver/internal/sdk/models/operations/registercustommodelmodelscustompost.go +++ /dev/null @@ -1,27 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type RegisterCustomModelModelsCustomPostResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - RegisterCustomModelResponse *components.RegisterCustomModelResponse -} - -func (o *RegisterCustomModelModelsCustomPostResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *RegisterCustomModelModelsCustomPostResponse) GetRegisterCustomModelResponse() *components.RegisterCustomModelResponse { - if o == nil { - return nil - } - return o.RegisterCustomModelResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/registerfileuploadknowledgeknowledgebaseidregisterfilepost.go b/tests/mockserver/internal/sdk/models/operations/registerfileuploadknowledgeknowledgebaseidregisterfilepost.go deleted file mode 100644 index 9690266..0000000 --- a/tests/mockserver/internal/sdk/models/operations/registerfileuploadknowledgeknowledgebaseidregisterfilepost.go +++ /dev/null @@ -1,47 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type RegisterFileUploadKnowledgeKnowledgeBaseIDRegisterFilePostRequest struct { - // The id of the knowledge base to register the file for - KnowledgeBaseID string `pathParam:"style=simple,explode=false,name=knowledge_base_id"` - RegisterFileUploadRequest components.RegisterFileUploadRequest `request:"mediaType=application/json"` -} - -func (o *RegisterFileUploadKnowledgeKnowledgeBaseIDRegisterFilePostRequest) GetKnowledgeBaseID() string { - if o == nil { - return "" - } - return o.KnowledgeBaseID -} - -func (o *RegisterFileUploadKnowledgeKnowledgeBaseIDRegisterFilePostRequest) GetRegisterFileUploadRequest() components.RegisterFileUploadRequest { - if o == nil { - return components.RegisterFileUploadRequest{} - } - return o.RegisterFileUploadRequest -} - -type RegisterFileUploadKnowledgeKnowledgeBaseIDRegisterFilePostResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - RegisterFileUploadResponse *components.RegisterFileUploadResponse -} - -func (o *RegisterFileUploadKnowledgeKnowledgeBaseIDRegisterFilePostResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *RegisterFileUploadKnowledgeKnowledgeBaseIDRegisterFilePostResponse) GetRegisterFileUploadResponse() *components.RegisterFileUploadResponse { - if o == nil { - return nil - } - return o.RegisterFileUploadResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/savetodatasetspansspanidsaveexamplespost.go b/tests/mockserver/internal/sdk/models/operations/savetodatasetspansspanidsaveexamplespost.go deleted file mode 100644 index e34274c..0000000 --- a/tests/mockserver/internal/sdk/models/operations/savetodatasetspansspanidsaveexamplespost.go +++ /dev/null @@ -1,38 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type SaveToDatasetSpansSpanIDSaveExamplesPostRequest struct { - SpanID string `pathParam:"style=simple,explode=false,name=span_id"` -} - -func (o *SaveToDatasetSpansSpanIDSaveExamplesPostRequest) GetSpanID() string { - if o == nil { - return "" - } - return o.SpanID -} - -type SaveToDatasetSpansSpanIDSaveExamplesPostResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - SaveToDatasetResponse *components.SaveToDatasetResponse -} - -func (o *SaveToDatasetSpansSpanIDSaveExamplesPostResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *SaveToDatasetSpansSpanIDSaveExamplesPostResponse) GetSaveToDatasetResponse() *components.SaveToDatasetResponse { - if o == nil { - return nil - } - return o.SaveToDatasetResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/streamfunctionfunctionsfunctionidcallstreampost.go b/tests/mockserver/internal/sdk/models/operations/streamfunctionfunctionsfunctionidcallstreampost.go deleted file mode 100644 index 131b954..0000000 --- a/tests/mockserver/internal/sdk/models/operations/streamfunctionfunctionsfunctionidcallstreampost.go +++ /dev/null @@ -1,122 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/types/stream" -) - -type StreamFunctionFunctionsFunctionIDCallStreamPostRequest struct { - // The id of the function to call - FunctionID string `pathParam:"style=simple,explode=false,name=function_id"` - AppAPIPublicV2FunctionsCallFunctionRequest components.AppAPIPublicV2FunctionsCallFunctionRequest `request:"mediaType=application/json"` -} - -func (o *StreamFunctionFunctionsFunctionIDCallStreamPostRequest) GetFunctionID() string { - if o == nil { - return "" - } - return o.FunctionID -} - -func (o *StreamFunctionFunctionsFunctionIDCallStreamPostRequest) GetAppAPIPublicV2FunctionsCallFunctionRequest() components.AppAPIPublicV2FunctionsCallFunctionRequest { - if o == nil { - return components.AppAPIPublicV2FunctionsCallFunctionRequest{} - } - return o.AppAPIPublicV2FunctionsCallFunctionRequest -} - -// StreamFunctionFunctionsFunctionIDCallStreamPostData - The actual data payload containing streaming chunk information -type StreamFunctionFunctionsFunctionIDCallStreamPostData struct { - // Incremental text content generated by the model - Delta *string `json:"delta,omitempty"` - // Unique identifier for the execution span - SpanID *string `json:"span_id,omitempty"` -} - -func (o *StreamFunctionFunctionsFunctionIDCallStreamPostData) GetDelta() *string { - if o == nil { - return nil - } - return o.Delta -} - -func (o *StreamFunctionFunctionsFunctionIDCallStreamPostData) GetSpanID() *string { - if o == nil { - return nil - } - return o.SpanID -} - -// StreamFunctionFunctionsFunctionIDCallStreamPostResponseBody - Server-Sent Event following the SSE specification -type StreamFunctionFunctionsFunctionIDCallStreamPostResponseBody struct { - // Event ID for the SSE event - ID *string `json:"id,omitempty"` - // Event type for the SSE event - Event *string `json:"event,omitempty"` - // The actual data payload containing streaming chunk information - Data StreamFunctionFunctionsFunctionIDCallStreamPostData `json:"data"` - // Retry interval in milliseconds for the SSE connection - Retry *int64 `json:"retry,omitempty"` -} - -func (o *StreamFunctionFunctionsFunctionIDCallStreamPostResponseBody) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *StreamFunctionFunctionsFunctionIDCallStreamPostResponseBody) GetEvent() *string { - if o == nil { - return nil - } - return o.Event -} - -func (o *StreamFunctionFunctionsFunctionIDCallStreamPostResponseBody) GetData() StreamFunctionFunctionsFunctionIDCallStreamPostData { - if o == nil { - return StreamFunctionFunctionsFunctionIDCallStreamPostData{} - } - return o.Data -} - -func (o *StreamFunctionFunctionsFunctionIDCallStreamPostResponseBody) GetRetry() *int64 { - if o == nil { - return nil - } - return o.Retry -} - -func (o StreamFunctionFunctionsFunctionIDCallStreamPostResponseBody) GetEventEncoding(event string) (string, error) { - return "application/json", nil -} - -type StreamFunctionFunctionsFunctionIDCallStreamPostResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Server-Sent Events stream of function execution chunks - Object *stream.EventStream[StreamFunctionFunctionsFunctionIDCallStreamPostResponseBody] - Headers map[string][]string -} - -func (o *StreamFunctionFunctionsFunctionIDCallStreamPostResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *StreamFunctionFunctionsFunctionIDCallStreamPostResponse) GetObject() *stream.EventStream[StreamFunctionFunctionsFunctionIDCallStreamPostResponseBody] { - if o == nil { - return nil - } - return o.Object -} - -func (o *StreamFunctionFunctionsFunctionIDCallStreamPostResponse) GetHeaders() map[string][]string { - if o == nil { - return map[string][]string{} - } - return o.Headers -} diff --git a/tests/mockserver/internal/sdk/models/operations/streamfunctionrevisionfunctionsfunctionidcallstreamrevisionidpost.go b/tests/mockserver/internal/sdk/models/operations/streamfunctionrevisionfunctionsfunctionidcallstreamrevisionidpost.go deleted file mode 100644 index 73a2d1a..0000000 --- a/tests/mockserver/internal/sdk/models/operations/streamfunctionrevisionfunctionsfunctionidcallstreamrevisionidpost.go +++ /dev/null @@ -1,131 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/types/stream" -) - -type StreamFunctionRevisionFunctionsFunctionIDCallStreamRevisionIDPostRequest struct { - // The id of the function to call - FunctionID string `pathParam:"style=simple,explode=false,name=function_id"` - // The id of the revision to call - RevisionID string `pathParam:"style=simple,explode=false,name=revision_id"` - AppAPIPublicV2FunctionsCallFunctionRequest components.AppAPIPublicV2FunctionsCallFunctionRequest `request:"mediaType=application/json"` -} - -func (o *StreamFunctionRevisionFunctionsFunctionIDCallStreamRevisionIDPostRequest) GetFunctionID() string { - if o == nil { - return "" - } - return o.FunctionID -} - -func (o *StreamFunctionRevisionFunctionsFunctionIDCallStreamRevisionIDPostRequest) GetRevisionID() string { - if o == nil { - return "" - } - return o.RevisionID -} - -func (o *StreamFunctionRevisionFunctionsFunctionIDCallStreamRevisionIDPostRequest) GetAppAPIPublicV2FunctionsCallFunctionRequest() components.AppAPIPublicV2FunctionsCallFunctionRequest { - if o == nil { - return components.AppAPIPublicV2FunctionsCallFunctionRequest{} - } - return o.AppAPIPublicV2FunctionsCallFunctionRequest -} - -// StreamFunctionRevisionFunctionsFunctionIDCallStreamRevisionIDPostData - The actual data payload containing streaming chunk information -type StreamFunctionRevisionFunctionsFunctionIDCallStreamRevisionIDPostData struct { - // Incremental text content generated by the model - Delta *string `json:"delta,omitempty"` - // Unique identifier for the execution span - SpanID *string `json:"span_id,omitempty"` -} - -func (o *StreamFunctionRevisionFunctionsFunctionIDCallStreamRevisionIDPostData) GetDelta() *string { - if o == nil { - return nil - } - return o.Delta -} - -func (o *StreamFunctionRevisionFunctionsFunctionIDCallStreamRevisionIDPostData) GetSpanID() *string { - if o == nil { - return nil - } - return o.SpanID -} - -// StreamFunctionRevisionFunctionsFunctionIDCallStreamRevisionIDPostResponseBody - Server-Sent Event following the SSE specification -type StreamFunctionRevisionFunctionsFunctionIDCallStreamRevisionIDPostResponseBody struct { - // Event ID for the SSE event - ID *string `json:"id,omitempty"` - // Event type for the SSE event - Event *string `json:"event,omitempty"` - // The actual data payload containing streaming chunk information - Data StreamFunctionRevisionFunctionsFunctionIDCallStreamRevisionIDPostData `json:"data"` - // Retry interval in milliseconds for the SSE connection - Retry *int64 `json:"retry,omitempty"` -} - -func (o *StreamFunctionRevisionFunctionsFunctionIDCallStreamRevisionIDPostResponseBody) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *StreamFunctionRevisionFunctionsFunctionIDCallStreamRevisionIDPostResponseBody) GetEvent() *string { - if o == nil { - return nil - } - return o.Event -} - -func (o *StreamFunctionRevisionFunctionsFunctionIDCallStreamRevisionIDPostResponseBody) GetData() StreamFunctionRevisionFunctionsFunctionIDCallStreamRevisionIDPostData { - if o == nil { - return StreamFunctionRevisionFunctionsFunctionIDCallStreamRevisionIDPostData{} - } - return o.Data -} - -func (o *StreamFunctionRevisionFunctionsFunctionIDCallStreamRevisionIDPostResponseBody) GetRetry() *int64 { - if o == nil { - return nil - } - return o.Retry -} - -func (o StreamFunctionRevisionFunctionsFunctionIDCallStreamRevisionIDPostResponseBody) GetEventEncoding(event string) (string, error) { - return "application/json", nil -} - -type StreamFunctionRevisionFunctionsFunctionIDCallStreamRevisionIDPostResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Server-Sent Events stream of function execution chunks - Object *stream.EventStream[StreamFunctionRevisionFunctionsFunctionIDCallStreamRevisionIDPostResponseBody] - Headers map[string][]string -} - -func (o *StreamFunctionRevisionFunctionsFunctionIDCallStreamRevisionIDPostResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *StreamFunctionRevisionFunctionsFunctionIDCallStreamRevisionIDPostResponse) GetObject() *stream.EventStream[StreamFunctionRevisionFunctionsFunctionIDCallStreamRevisionIDPostResponseBody] { - if o == nil { - return nil - } - return o.Object -} - -func (o *StreamFunctionRevisionFunctionsFunctionIDCallStreamRevisionIDPostResponse) GetHeaders() map[string][]string { - if o == nil { - return map[string][]string{} - } - return o.Headers -} diff --git a/tests/mockserver/internal/sdk/models/operations/updatecustommodelmodelscustommodelidpatch.go b/tests/mockserver/internal/sdk/models/operations/updatecustommodelmodelscustommodelidpatch.go deleted file mode 100644 index 46427b8..0000000 --- a/tests/mockserver/internal/sdk/models/operations/updatecustommodelmodelscustommodelidpatch.go +++ /dev/null @@ -1,47 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type UpdateCustomModelModelsCustomModelIDPatchRequest struct { - // The ID of the custom language model to update - ModelID string `pathParam:"style=simple,explode=false,name=model_id"` - UpdateCustomModelRequest components.UpdateCustomModelRequest `request:"mediaType=application/json"` -} - -func (o *UpdateCustomModelModelsCustomModelIDPatchRequest) GetModelID() string { - if o == nil { - return "" - } - return o.ModelID -} - -func (o *UpdateCustomModelModelsCustomModelIDPatchRequest) GetUpdateCustomModelRequest() components.UpdateCustomModelRequest { - if o == nil { - return components.UpdateCustomModelRequest{} - } - return o.UpdateCustomModelRequest -} - -type UpdateCustomModelModelsCustomModelIDPatchResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - UpdateCustomModelResponse *components.UpdateCustomModelResponse -} - -func (o *UpdateCustomModelModelsCustomModelIDPatchResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *UpdateCustomModelModelsCustomModelIDPatchResponse) GetUpdateCustomModelResponse() *components.UpdateCustomModelResponse { - if o == nil { - return nil - } - return o.UpdateCustomModelResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/updatedatasetentrydatasetsdatasetidentriesentryidpatch.go b/tests/mockserver/internal/sdk/models/operations/updatedatasetentrydatasetsdatasetidentriesentryidpatch.go deleted file mode 100644 index 8fc5408..0000000 --- a/tests/mockserver/internal/sdk/models/operations/updatedatasetentrydatasetsdatasetidentriesentryidpatch.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type UpdateDatasetEntryDatasetsDatasetIDEntriesEntryIDPatchRequest struct { - // The id of the dataset - DatasetID string `pathParam:"style=simple,explode=false,name=dataset_id"` - // The id of the entry to update - EntryID string `pathParam:"style=simple,explode=false,name=entry_id"` - UpdateDatasetEntryRequest components.UpdateDatasetEntryRequest `request:"mediaType=application/json"` -} - -func (o *UpdateDatasetEntryDatasetsDatasetIDEntriesEntryIDPatchRequest) GetDatasetID() string { - if o == nil { - return "" - } - return o.DatasetID -} - -func (o *UpdateDatasetEntryDatasetsDatasetIDEntriesEntryIDPatchRequest) GetEntryID() string { - if o == nil { - return "" - } - return o.EntryID -} - -func (o *UpdateDatasetEntryDatasetsDatasetIDEntriesEntryIDPatchRequest) GetUpdateDatasetEntryRequest() components.UpdateDatasetEntryRequest { - if o == nil { - return components.UpdateDatasetEntryRequest{} - } - return o.UpdateDatasetEntryRequest -} - -type UpdateDatasetEntryDatasetsDatasetIDEntriesEntryIDPatchResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - UpdateDatasetEntryResponse *components.UpdateDatasetEntryResponse -} - -func (o *UpdateDatasetEntryDatasetsDatasetIDEntriesEntryIDPatchResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *UpdateDatasetEntryDatasetsDatasetIDEntriesEntryIDPatchResponse) GetUpdateDatasetEntryResponse() *components.UpdateDatasetEntryResponse { - if o == nil { - return nil - } - return o.UpdateDatasetEntryResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/updatefunctionfunctionsfunctionidpatch.go b/tests/mockserver/internal/sdk/models/operations/updatefunctionfunctionsfunctionidpatch.go deleted file mode 100644 index d8d2aad..0000000 --- a/tests/mockserver/internal/sdk/models/operations/updatefunctionfunctionsfunctionidpatch.go +++ /dev/null @@ -1,47 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type UpdateFunctionFunctionsFunctionIDPatchRequest struct { - // Unique identifier of the function given as a UUID - FunctionID string `pathParam:"style=simple,explode=false,name=function_id"` - UpdateFunctionRequest components.UpdateFunctionRequest `request:"mediaType=application/json"` -} - -func (o *UpdateFunctionFunctionsFunctionIDPatchRequest) GetFunctionID() string { - if o == nil { - return "" - } - return o.FunctionID -} - -func (o *UpdateFunctionFunctionsFunctionIDPatchRequest) GetUpdateFunctionRequest() components.UpdateFunctionRequest { - if o == nil { - return components.UpdateFunctionRequest{} - } - return o.UpdateFunctionRequest -} - -type UpdateFunctionFunctionsFunctionIDPatchResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - UpdateFunctionResponse *components.UpdateFunctionResponse -} - -func (o *UpdateFunctionFunctionsFunctionIDPatchResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *UpdateFunctionFunctionsFunctionIDPatchResponse) GetUpdateFunctionResponse() *components.UpdateFunctionResponse { - if o == nil { - return nil - } - return o.UpdateFunctionResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/updatemetricspansspanidmetricsmetricidpatch.go b/tests/mockserver/internal/sdk/models/operations/updatemetricspansspanidmetricsmetricidpatch.go deleted file mode 100644 index f1783b3..0000000 --- a/tests/mockserver/internal/sdk/models/operations/updatemetricspansspanidmetricsmetricidpatch.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type UpdateMetricSpansSpanIDMetricsMetricIDPatchRequest struct { - // The id of the span - SpanID string `pathParam:"style=simple,explode=false,name=span_id"` - // The id of the metric to update - MetricID string `pathParam:"style=simple,explode=false,name=metric_id"` - UpdateSpanMetricRequest components.UpdateSpanMetricRequest `request:"mediaType=application/json"` -} - -func (o *UpdateMetricSpansSpanIDMetricsMetricIDPatchRequest) GetSpanID() string { - if o == nil { - return "" - } - return o.SpanID -} - -func (o *UpdateMetricSpansSpanIDMetricsMetricIDPatchRequest) GetMetricID() string { - if o == nil { - return "" - } - return o.MetricID -} - -func (o *UpdateMetricSpansSpanIDMetricsMetricIDPatchRequest) GetUpdateSpanMetricRequest() components.UpdateSpanMetricRequest { - if o == nil { - return components.UpdateSpanMetricRequest{} - } - return o.UpdateSpanMetricRequest -} - -type UpdateMetricSpansSpanIDMetricsMetricIDPatchResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - UpdateSpanMetricResponse *components.UpdateSpanMetricResponse -} - -func (o *UpdateMetricSpansSpanIDMetricsMetricIDPatchResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *UpdateMetricSpansSpanIDMetricsMetricIDPatchResponse) GetUpdateSpanMetricResponse() *components.UpdateSpanMetricResponse { - if o == nil { - return nil - } - return o.UpdateSpanMetricResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/updatespanspansspanidpatch.go b/tests/mockserver/internal/sdk/models/operations/updatespanspansspanidpatch.go deleted file mode 100644 index f1f7c47..0000000 --- a/tests/mockserver/internal/sdk/models/operations/updatespanspansspanidpatch.go +++ /dev/null @@ -1,47 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type UpdateSpanSpansSpanIDPatchRequest struct { - // The ID of the span to update - SpanID string `pathParam:"style=simple,explode=false,name=span_id"` - UpdateSpanRequest components.UpdateSpanRequest `request:"mediaType=application/json"` -} - -func (o *UpdateSpanSpansSpanIDPatchRequest) GetSpanID() string { - if o == nil { - return "" - } - return o.SpanID -} - -func (o *UpdateSpanSpansSpanIDPatchRequest) GetUpdateSpanRequest() components.UpdateSpanRequest { - if o == nil { - return components.UpdateSpanRequest{} - } - return o.UpdateSpanRequest -} - -type UpdateSpanSpansSpanIDPatchResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - UpdateSpanResponse *components.UpdateSpanResponse -} - -func (o *UpdateSpanSpansSpanIDPatchResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *UpdateSpanSpansSpanIDPatchResponse) GetUpdateSpanResponse() *components.UpdateSpanResponse { - if o == nil { - return nil - } - return o.UpdateSpanResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/usageanalyticsusageget.go b/tests/mockserver/internal/sdk/models/operations/usageanalyticsusageget.go deleted file mode 100644 index e7ff6e8..0000000 --- a/tests/mockserver/internal/sdk/models/operations/usageanalyticsusageget.go +++ /dev/null @@ -1,88 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" - "time" -) - -type UsageAnalyticsUsageGetRequest struct { - // Start date for the time range (inclusive). If not provided, defaults to the first day of the current month. - FromDate *time.Time `queryParam:"style=form,explode=true,name=from_date"` - // End date for the time range (exclusive). If not provided, defaults to the last day of the current month. - ToDate *time.Time `queryParam:"style=form,explode=true,name=to_date"` - // Time granularity for grouping (minute, hour, day, month, year) - Granularity *components.Granularity `queryParam:"style=form,explode=true,name=granularity"` - // Fields from event_metadata to include and sum - Fields []string `queryParam:"style=form,explode=true,name=fields"` - // Fields from tags to group by - GroupBy []string `queryParam:"style=form,explode=true,name=group_by"` -} - -func (u UsageAnalyticsUsageGetRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(u, "", false) -} - -func (u *UsageAnalyticsUsageGetRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &u, "", false, false); err != nil { - return err - } - return nil -} - -func (o *UsageAnalyticsUsageGetRequest) GetFromDate() *time.Time { - if o == nil { - return nil - } - return o.FromDate -} - -func (o *UsageAnalyticsUsageGetRequest) GetToDate() *time.Time { - if o == nil { - return nil - } - return o.ToDate -} - -func (o *UsageAnalyticsUsageGetRequest) GetGranularity() *components.Granularity { - if o == nil { - return nil - } - return o.Granularity -} - -func (o *UsageAnalyticsUsageGetRequest) GetFields() []string { - if o == nil { - return nil - } - return o.Fields -} - -func (o *UsageAnalyticsUsageGetRequest) GetGroupBy() []string { - if o == nil { - return nil - } - return o.GroupBy -} - -type UsageAnalyticsUsageGetResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Successful Response - ResponseUsageAnalyticsUsageGet []components.GetUsageResultItem -} - -func (o *UsageAnalyticsUsageGetResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *UsageAnalyticsUsageGetResponse) GetResponseUsageAnalyticsUsageGet() []components.GetUsageResultItem { - if o == nil { - return nil - } - return o.ResponseUsageAnalyticsUsageGet -} diff --git a/tests/mockserver/internal/sdk/models/sdkerrors/badrequesterror.go b/tests/mockserver/internal/sdk/models/sdkerrors/badrequesterror.go deleted file mode 100644 index a28ce7a..0000000 --- a/tests/mockserver/internal/sdk/models/sdkerrors/badrequesterror.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "mockserver/internal/sdk/models/components" -) - -type BadRequestError struct { - Type *string `default:"BadRequestError" json:"type"` - Message *string `default:"The request is invalid" json:"message"` - // The detail of the error - Detail any `json:"detail"` - HTTPMeta components.HTTPMetadata `json:"-"` -} - -var _ error = &BadRequestError{} - -func (e *BadRequestError) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/tests/mockserver/internal/sdk/models/sdkerrors/conflicterror.go b/tests/mockserver/internal/sdk/models/sdkerrors/conflicterror.go deleted file mode 100644 index 1a1482b..0000000 --- a/tests/mockserver/internal/sdk/models/sdkerrors/conflicterror.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "mockserver/internal/sdk/models/components" -) - -type ConflictError struct { - Type *string `default:"ConflictError" json:"type"` - Message *string `default:"The resource already exists" json:"message"` - // The detail of the error - Detail any `json:"detail"` - HTTPMeta components.HTTPMetadata `json:"-"` -} - -var _ error = &ConflictError{} - -func (e *ConflictError) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/tests/mockserver/internal/sdk/models/sdkerrors/error.go b/tests/mockserver/internal/sdk/models/sdkerrors/error.go deleted file mode 100644 index d7dd2b4..0000000 --- a/tests/mockserver/internal/sdk/models/sdkerrors/error.go +++ /dev/null @@ -1,22 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "mockserver/internal/sdk/models/components" -) - -type Error struct { - Type string `json:"type"` - Message string `json:"message"` - Detail any `json:"detail"` - HTTPMeta components.HTTPMetadata `json:"-"` -} - -var _ error = &Error{} - -func (e *Error) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/tests/mockserver/internal/sdk/models/sdkerrors/notfounderror.go b/tests/mockserver/internal/sdk/models/sdkerrors/notfounderror.go deleted file mode 100644 index 5f00ccb..0000000 --- a/tests/mockserver/internal/sdk/models/sdkerrors/notfounderror.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "mockserver/internal/sdk/models/components" -) - -type NotFoundError struct { - Type *string `default:"NotFoundError" json:"type"` - Message *string `default:"The resource was not found" json:"message"` - // The detail of the error - Detail any `json:"detail"` - HTTPMeta components.HTTPMetadata `json:"-"` -} - -var _ error = &NotFoundError{} - -func (e *NotFoundError) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/tests/mockserver/internal/sdk/models/sdkerrors/requestvalidationerror.go b/tests/mockserver/internal/sdk/models/sdkerrors/requestvalidationerror.go deleted file mode 100644 index b541afb..0000000 --- a/tests/mockserver/internal/sdk/models/sdkerrors/requestvalidationerror.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "mockserver/internal/sdk/models/components" -) - -type RequestValidationError struct { - Type *string `default:"RequestValidationError" json:"type"` - Message *string `default:"The request is invalid" json:"message"` - // Where the error occurred and the error message - Detail any `json:"detail"` - HTTPMeta components.HTTPMetadata `json:"-"` -} - -var _ error = &RequestValidationError{} - -func (e *RequestValidationError) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/tests/mockserver/internal/sdk/models/sdkerrors/unauthorizederror.go b/tests/mockserver/internal/sdk/models/sdkerrors/unauthorizederror.go deleted file mode 100644 index a6a2e81..0000000 --- a/tests/mockserver/internal/sdk/models/sdkerrors/unauthorizederror.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "encoding/json" - "mockserver/internal/sdk/models/components" -) - -type UnauthorizedError struct { - Type *string `default:"UnauthorizedError" json:"type"` - Message *string `default:"The request is unauthorized" json:"message"` - // The detail of the error - Detail any `json:"detail"` - HTTPMeta components.HTTPMetadata `json:"-"` -} - -var _ error = &UnauthorizedError{} - -func (e *UnauthorizedError) Error() string { - data, _ := json.Marshal(e) - return string(data) -} diff --git a/tests/mockserver/internal/sdk/types/bigint.go b/tests/mockserver/internal/sdk/types/bigint.go deleted file mode 100644 index 9c6a086..0000000 --- a/tests/mockserver/internal/sdk/types/bigint.go +++ /dev/null @@ -1,21 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package types - -import ( - "fmt" - "math/big" -) - -// MustNewBigIntFromString returns an instance of big.Int from a string -// The string is assumed to be base 10 and if it is not a valid big.Int -// then the function panics. -// Avoid using this function in production code. -func MustNewBigIntFromString(s string) *big.Int { - i, ok := new(big.Int).SetString(s, 10) - if !ok { - panic(fmt.Errorf("failed to parse string as big.Int")) - } - - return i -} diff --git a/tests/mockserver/internal/sdk/types/date.go b/tests/mockserver/internal/sdk/types/date.go deleted file mode 100644 index 5b2782f..0000000 --- a/tests/mockserver/internal/sdk/types/date.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package types - -import ( - "encoding/json" - "fmt" - "strings" - "time" -) - -// Date is a wrapper around time.Time that allows for JSON marshaling a date string formatted as "2006-01-02". -type Date struct { - time.Time -} - -var ( - _ json.Marshaler = &Date{} - _ json.Unmarshaler = &Date{} - _ fmt.Stringer = &Date{} -) - -// NewDate returns an instance of Date from a time.Time. -func NewDate(t time.Time) *Date { - d := DateFromTime(t) - return &d -} - -// DateFromTime returns a Date from a time.Time. -func DateFromTime(t time.Time) Date { - return Date{t} -} - -// NewDateFromString returns an instance of Date from a string formatted as "2006-01-02". -func NewDateFromString(str string) (*Date, error) { - d, err := DateFromString(str) - if err != nil { - return nil, err - } - - return &d, nil -} - -// DateFromString returns a Date from a string formatted as "2006-01-02". -func DateFromString(str string) (Date, error) { - var d Date - var err error - - d.Time, err = time.Parse("2006-01-02", str) - return d, err -} - -// MustNewDateFromString returns an instance of Date from a string formatted as "2006-01-02" or panics. -// Avoid using this function in production code. -func MustNewDateFromString(str string) *Date { - d := MustDateFromString(str) - return &d -} - -// MustDateFromString returns a Date from a string formatted as "2006-01-02" or panics. -// Avoid using this function in production code. -func MustDateFromString(str string) Date { - d, err := DateFromString(str) - if err != nil { - panic(err) - } - return d -} - -func (d Date) GetTime() time.Time { - return d.Time -} - -func (d Date) MarshalJSON() ([]byte, error) { - return []byte(fmt.Sprintf(`"%s"`, d.Time.Format("2006-01-02"))), nil -} - -func (d *Date) UnmarshalJSON(data []byte) error { - var err error - - str := string(data) - str = strings.Trim(str, `"`) - - d.Time, err = time.Parse("2006-01-02", str) - return err -} - -func (d Date) String() string { - return d.Time.Format("2006-01-02") -} diff --git a/tests/mockserver/internal/sdk/types/datetime.go b/tests/mockserver/internal/sdk/types/datetime.go deleted file mode 100644 index 3eff332..0000000 --- a/tests/mockserver/internal/sdk/types/datetime.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package types - -import "time" - -// MustTimeFromString returns a time.Time from a string formatted as "2006-01-02T15:04:05Z07:00" or panics. -// Avoid using this function in production code. -func MustTimeFromString(str string) time.Time { - t, err := time.Parse(time.RFC3339, str) - if err != nil { - panic(err) - } - - return t -} - -// MustNewTimeFromString returns an instance of time.Time from a string formatted as "2006-01-02T15:04:05Z07:00" or panics. -// Avoid using this function in production code. -func MustNewTimeFromString(str string) *time.Time { - t := MustTimeFromString(str) - return &t -} diff --git a/tests/mockserver/internal/sdk/types/decimal.go b/tests/mockserver/internal/sdk/types/decimal.go deleted file mode 100644 index d8429bc..0000000 --- a/tests/mockserver/internal/sdk/types/decimal.go +++ /dev/null @@ -1,20 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package types - -import ( - "fmt" - - "github.com/ericlagergren/decimal" -) - -// MustNewDecimalFromString returns an instance of Decimal from a string -// Avoid using this function in production code. -func MustNewDecimalFromString(s string) *decimal.Big { - d, ok := new(decimal.Big).SetString(s) - if !ok { - panic(fmt.Errorf("failed to parse string as decimal.Big")) - } - - return d -} diff --git a/tests/mockserver/internal/sdk/types/jsonl/jsonl.go b/tests/mockserver/internal/sdk/types/jsonl/jsonl.go deleted file mode 100644 index 26df95c..0000000 --- a/tests/mockserver/internal/sdk/types/jsonl/jsonl.go +++ /dev/null @@ -1,7 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package jsonl - -type JsonLStream[T any] struct { - // TODO to be implemented -} diff --git a/tests/mockserver/internal/sdk/types/pointers.go b/tests/mockserver/internal/sdk/types/pointers.go deleted file mode 100644 index 35c439d..0000000 --- a/tests/mockserver/internal/sdk/types/pointers.go +++ /dev/null @@ -1,11 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package types - -func String(s string) *string { return &s } -func Bool(b bool) *bool { return &b } -func Int(i int) *int { return &i } -func Int64(i int64) *int64 { return &i } -func Float32(f float32) *float32 { return &f } -func Float64(f float64) *float64 { return &f } -func Pointer[T any](v T) *T { return &v } diff --git a/tests/mockserver/internal/sdk/types/stream/stream.go b/tests/mockserver/internal/sdk/types/stream/stream.go deleted file mode 100644 index 365d8cf..0000000 --- a/tests/mockserver/internal/sdk/types/stream/stream.go +++ /dev/null @@ -1,218 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package stream - -import ( - "bufio" - "bytes" - "encoding/json" - "fmt" - "io" - "regexp" - "strconv" - "strings" -) - -type ServerEvent struct { - ID *string `json:"id,omitempty"` - Event *string `json:"event,omitempty"` - Data json.RawMessage `json:"data,omitempty"` - Retry *int64 `json:"retry,omitempty"` -} - -var ( - boundary = regexp.MustCompile(`\r\n\r\n|\r\r|\n\n`) - lineEnding = regexp.MustCompile(`\r?\n|\r`) -) - -func scanServerEvents(data []byte, atEOF bool) (advance int, token []byte, err error) { - if atEOF && len(data) == 0 { - return 0, nil, nil - } - - result := boundary.FindIndex(data) - if result != nil { - return result[1], data[:result[0]], nil - } - - if atEOF { - return len(data), bytes.TrimRight(data, "\r\n"), nil - } - - return 0, nil, nil -} - -type EventType interface { - GetEventEncoding(event string) (string, error) -} - -type EventStream[T any] struct { - r io.ReadCloser - scanner *bufio.Scanner - unmarshaller func(se []byte) (T, error) - sentinel string - - finished bool - err error - val *T -} - -func NewEventStream[T any]( - source io.Reader, - unmarshaller func(se []byte) (T, error), - sentinel string, -) *EventStream[T] { - scanner := bufio.NewScanner(source) - scanner.Split(scanServerEvents) - - var src io.ReadCloser - if s, ok := source.(io.ReadCloser); ok { - src = s - } else { - src = io.NopCloser(source) - } - - return &EventStream[T]{ - r: src, - scanner: scanner, - unmarshaller: unmarshaller, - sentinel: sentinel, - } -} - -// Next waits for the next event from a stream which will be available -// through the Value() method. It returns false when the stream is done or -// an error occurred. After this method returns false, the Err method is used -// to check for any errors that occurred while parsing the stream. -func (es *EventStream[T]) Next() bool { - if es.err != nil || es.finished { - return false - } - - if !es.scanner.Scan() { - return false - } - - es.err = es.scanner.Err() - if es.err != nil { - return false - } - - b := es.scanner.Bytes() - - var event ServerEvent - lines := lineEnding.Split(string(b), -1) - publish := false - data := "" - for _, line := range lines { - if line == "" { - continue - } - - delim := strings.Index(line, ":") - if delim == 0 { - continue - } - - field := "" - value := "" - if delim > 0 { - field = line[:delim] - } - if delim > 0 && delim < len(line)-1 { - value = line[delim+1:] - } - value = strings.TrimPrefix(value, " ") - - switch field { - case "id": - publish = true - event.ID = &value - case "event": - publish = true - event.Event = &value - case "retry": - retry, err := strconv.ParseInt(value, 10, 64) - if err == nil { - publish = true - event.Retry = &retry - } - case "data": - publish = true - data += value + "\n" - } - } - - if es.sentinel != "" && data == es.sentinel+"\n" { - es.finished = true - return false - } - - if len(data) > 0 { - data = data[:len(data)-1] - } - - encoding := "application/json" - - var t T - if et, ok := any(t).(EventType); ok { - ev := "" - if event.Event != nil { - ev = *event.Event - } - - var err error - encoding, err = et.GetEventEncoding(ev) - if err != nil { - es.err = err - return false - } - } else { - var a interface{} - if err := json.Unmarshal([]byte(data), &a); err != nil { - encoding = "string" - } - } - - if encoding == "string" { - data = fmt.Sprintf("%q", data) - } - - event.Data = []byte(data) - - e, err := json.Marshal(event) - if err != nil { - es.err = err - return false - } - - parsedEvent, err := es.unmarshaller(e) - if err != nil { - es.err = err - return false - } - - if publish { - es.val = &parsedEvent - } else { - es.val = nil - } - - return true -} - -// Value returns the most recent event that was generated from a call to Next -func (es *EventStream[T]) Value() *T { - return es.val -} - -// Err returns the first non-EOF error that was encountered -func (es *EventStream[T]) Err() error { - return es.err -} - -// Close will release underlying resources held by an event stream. It must -// always be called. -func (es *EventStream[T]) Close() error { - return es.r.Close() -} diff --git a/tests/mockserver/internal/sdk/utils/json.go b/tests/mockserver/internal/sdk/utils/json.go deleted file mode 100644 index ca93aa5..0000000 --- a/tests/mockserver/internal/sdk/utils/json.go +++ /dev/null @@ -1,675 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package utils - -import ( - "bytes" - "encoding/json" - "fmt" - "math/big" - "reflect" - "strconv" - "strings" - "time" - "unsafe" - - "mockserver/internal/sdk/types" - - "github.com/ericlagergren/decimal" -) - -func MarshalJSON(v interface{}, tag reflect.StructTag, topLevel bool) ([]byte, error) { - typ, val := dereferencePointers(reflect.TypeOf(v), reflect.ValueOf(v)) - - switch { - case isModelType(typ): - if topLevel { - return json.Marshal(v) - } - - if isNil(typ, val) { - return []byte("null"), nil - } - - out := map[string]json.RawMessage{} - - for i := 0; i < typ.NumField(); i++ { - field := typ.Field(i) - fieldVal := val.Field(i) - - fieldName := field.Name - - omitEmpty := false - jsonTag := field.Tag.Get("json") - if jsonTag != "" { - for _, tag := range strings.Split(jsonTag, ",") { - if tag == "omitempty" { - omitEmpty = true - } else { - fieldName = tag - } - } - } - - if (isNil(field.Type, fieldVal) || isEmpty(field.Type, fieldVal)) && field.Tag.Get("const") == "" { - if omitEmpty { - continue - } - } - - if !field.IsExported() && field.Tag.Get("const") == "" { - continue - } - - additionalProperties := field.Tag.Get("additionalProperties") - if fieldName == "-" && additionalProperties == "" { - continue - } - - if additionalProperties == "true" { - if isNil(field.Type, fieldVal) { - continue - } - fieldVal := trueReflectValue(fieldVal) - if fieldVal.Type().Kind() != reflect.Map { - return nil, fmt.Errorf("additionalProperties must be a map") - } - - for _, key := range fieldVal.MapKeys() { - r, err := marshalValue(fieldVal.MapIndex(key).Interface(), field.Tag) - if err != nil { - return nil, err - } - - out[key.String()] = r - } - - continue - } - - var fv interface{} - - if field.IsExported() { - fv = fieldVal.Interface() - } else { - pt := reflect.New(typ).Elem() - pt.Set(val) - - pf := pt.Field(i) - - fv = reflect.NewAt(pf.Type(), unsafe.Pointer(pf.UnsafeAddr())).Elem().Interface() - } - - r, err := marshalValue(fv, field.Tag) - if err != nil { - return nil, err - } - - out[fieldName] = r - } - - return json.Marshal(out) - default: - return marshalValue(v, tag) - } -} - -func UnmarshalJSON(b []byte, v interface{}, tag reflect.StructTag, topLevel bool, disallowUnknownFields bool) error { - if reflect.TypeOf(v).Kind() != reflect.Ptr { - return fmt.Errorf("v must be a pointer") - } - - typ, val := dereferencePointers(reflect.TypeOf(v), reflect.ValueOf(v)) - - switch { - case isModelType(typ): - if topLevel || bytes.Equal(b, []byte("null")) { - d := json.NewDecoder(bytes.NewReader(b)) - if disallowUnknownFields { - d.DisallowUnknownFields() - } - return d.Decode(v) - } - - var unmarhsaled map[string]json.RawMessage - - if err := json.Unmarshal(b, &unmarhsaled); err != nil { - return err - } - - var additionalPropertiesField *reflect.StructField - var additionalPropertiesValue *reflect.Value - - for i := 0; i < typ.NumField(); i++ { - field := typ.Field(i) - fieldVal := val.Field(i) - - fieldName := field.Name - - jsonTag := field.Tag.Get("json") - if jsonTag != "" { - for _, tag := range strings.Split(jsonTag, ",") { - if tag != "omitempty" { - fieldName = tag - } - } - } - - if field.Tag.Get("additionalProperties") == "true" { - additionalPropertiesField = &field - additionalPropertiesValue = &fieldVal - continue - } - - // If we receive a value for a const field ignore it but mark it as unmarshaled - if field.Tag.Get("const") != "" { - if r, ok := unmarhsaled[fieldName]; ok { - val := string(r) - - if strings.HasPrefix(val, `"`) && strings.HasSuffix(val, `"`) { - var err error - val, err = strconv.Unquote(val) - if err != nil { - return fmt.Errorf("failed to unquote const field `%s` value `%s`: %w", fieldName, val, err) - } - } - constValue := field.Tag.Get("const") - if val != constValue { - return fmt.Errorf("const field `%s` does not match expected value `%s` got `%s`", fieldName, constValue, val) - } - - delete(unmarhsaled, fieldName) - } - } else if !field.IsExported() { - continue - } - - value, ok := unmarhsaled[fieldName] - if !ok { - defaultTag := field.Tag.Get("default") - if defaultTag != "" { - value = handleDefaultConstValue(defaultTag, fieldVal.Interface(), field.Tag) - ok = true - } - } else { - delete(unmarhsaled, fieldName) - } - - if ok { - if err := unmarshalValue(value, fieldVal, field.Tag, disallowUnknownFields); err != nil { - return err - } - } - } - - keys := make([]string, 0, len(unmarhsaled)) - for k := range unmarhsaled { - keys = append(keys, k) - } - - if len(keys) > 0 { - if disallowUnknownFields && (additionalPropertiesField == nil || additionalPropertiesValue == nil) { - return fmt.Errorf("unknown fields: %v", keys) - } - - if additionalPropertiesField != nil && additionalPropertiesValue != nil { - typeOfMap := additionalPropertiesField.Type - if additionalPropertiesValue.Type().Kind() == reflect.Interface { - typeOfMap = reflect.TypeOf(map[string]interface{}{}) - } else if additionalPropertiesValue.Type().Kind() != reflect.Map { - return fmt.Errorf("additionalProperties must be a map") - } - - mapValue := reflect.MakeMap(typeOfMap) - - for key, value := range unmarhsaled { - val := reflect.New(typeOfMap.Elem()) - - if err := unmarshalValue(value, val, additionalPropertiesField.Tag, disallowUnknownFields); err != nil { - return err - } - - if val.Elem().Type().String() == typeOfMap.Elem().String() { - mapValue.SetMapIndex(reflect.ValueOf(key), val.Elem()) - } else { - mapValue.SetMapIndex(reflect.ValueOf(key), trueReflectValue(val)) - } - - } - if additionalPropertiesValue.Type().Kind() == reflect.Interface { - additionalPropertiesValue.Set(mapValue) - } else { - additionalPropertiesValue.Set(mapValue) - } - } - } - default: - return unmarshalValue(b, reflect.ValueOf(v), tag, disallowUnknownFields) - } - - return nil -} - -func marshalValue(v interface{}, tag reflect.StructTag) (json.RawMessage, error) { - constTag := tag.Get("const") - if constTag != "" { - return handleDefaultConstValue(constTag, v, tag), nil - } - - if isNil(reflect.TypeOf(v), reflect.ValueOf(v)) { - defaultTag := tag.Get("default") - if defaultTag != "" { - return handleDefaultConstValue(defaultTag, v, tag), nil - } - - return []byte("null"), nil - } - - typ, val := dereferencePointers(reflect.TypeOf(v), reflect.ValueOf(v)) - switch typ.Kind() { - case reflect.Int64: - format := tag.Get("integer") - if format == "string" { - b := val.Interface().(int64) - return []byte(fmt.Sprintf(`"%d"`, b)), nil - } - case reflect.Float64: - format := tag.Get("number") - if format == "string" { - b := val.Interface().(float64) - return []byte(fmt.Sprintf(`"%g"`, b)), nil - } - case reflect.Map: - if isNil(typ, val) { - return []byte("null"), nil - } - - out := map[string]json.RawMessage{} - - for _, key := range val.MapKeys() { - itemVal := val.MapIndex(key) - - if isNil(itemVal.Type(), itemVal) { - out[key.String()] = []byte("null") - continue - } - - r, err := marshalValue(itemVal.Interface(), tag) - if err != nil { - return nil, err - } - - out[key.String()] = r - } - - return json.Marshal(out) - case reflect.Slice, reflect.Array: - if isNil(typ, val) { - return []byte("null"), nil - } - - out := []json.RawMessage{} - - for i := 0; i < val.Len(); i++ { - itemVal := val.Index(i) - - if isNil(itemVal.Type(), itemVal) { - out = append(out, []byte("null")) - continue - } - - r, err := marshalValue(itemVal.Interface(), tag) - if err != nil { - return nil, err - } - - out = append(out, r) - } - - return json.Marshal(out) - case reflect.Struct: - switch typ { - case reflect.TypeOf(time.Time{}): - return []byte(fmt.Sprintf(`"%s"`, val.Interface().(time.Time).Format(time.RFC3339Nano))), nil - case reflect.TypeOf(big.Int{}): - format := tag.Get("bigint") - if format == "string" { - b := val.Interface().(big.Int) - return []byte(fmt.Sprintf(`"%s"`, (&b).String())), nil - } - case reflect.TypeOf(decimal.Big{}): - format := tag.Get("decimal") - if format == "number" { - b := val.Interface().(decimal.Big) - f, ok := (&b).Float64() - if ok { - return []byte(b.String()), nil - } - - return []byte(fmt.Sprintf(`%f`, f)), nil - } - } - } - - return json.Marshal(v) -} - -func handleDefaultConstValue(tagValue string, val interface{}, tag reflect.StructTag) json.RawMessage { - if tagValue == "null" { - return []byte("null") - } - - typ := dereferenceTypePointer(reflect.TypeOf(val)) - switch typ { - case reflect.TypeOf(time.Time{}): - return []byte(fmt.Sprintf(`"%s"`, tagValue)) - case reflect.TypeOf(big.Int{}): - bigIntTag := tag.Get("bigint") - if bigIntTag == "string" { - return []byte(fmt.Sprintf(`"%s"`, tagValue)) - } - case reflect.TypeOf(int64(0)): - format := tag.Get("integer") - if format == "string" { - return []byte(fmt.Sprintf(`"%s"`, tagValue)) - } - case reflect.TypeOf(float64(0)): - format := tag.Get("number") - if format == "string" { - return []byte(fmt.Sprintf(`"%s"`, tagValue)) - } - case reflect.TypeOf(decimal.Big{}): - decimalTag := tag.Get("decimal") - if decimalTag != "number" { - return []byte(fmt.Sprintf(`"%s"`, tagValue)) - } - case reflect.TypeOf(types.Date{}): - return []byte(fmt.Sprintf(`"%s"`, tagValue)) - default: - if typ.Kind() == reflect.String { - return []byte(fmt.Sprintf("%q", tagValue)) - } - } - - return []byte(tagValue) -} - -func unmarshalValue(value json.RawMessage, v reflect.Value, tag reflect.StructTag, disallowUnknownFields bool) error { - if bytes.Equal(value, []byte("null")) { - if v.CanAddr() { - return json.Unmarshal(value, v.Addr().Interface()) - } else { - return json.Unmarshal(value, v.Interface()) - } - } - - typ := dereferenceTypePointer(v.Type()) - - switch typ.Kind() { - case reflect.Int64: - var b int64 - - format := tag.Get("integer") - if format == "string" { - var s string - if err := json.Unmarshal(value, &s); err != nil { - return err - } - - var err error - b, err = strconv.ParseInt(s, 10, 64) - if err != nil { - return fmt.Errorf("failed to parse string as int64: %w", err) - } - if v.Kind() == reflect.Ptr { - if v.IsNil() { - v.Set(reflect.New(typ)) - } - v = v.Elem() - } - - v.Set(reflect.ValueOf(b)) - return nil - } - case reflect.Float64: - var b float64 - - format := tag.Get("number") - if format == "string" { - var s string - if err := json.Unmarshal(value, &s); err != nil { - return err - } - - var err error - b, err = strconv.ParseFloat(s, 64) - if err != nil { - return fmt.Errorf("failed to parse string as float64: %w", err) - } - - if v.Kind() == reflect.Ptr { - if v.IsNil() { - v.Set(reflect.New(typ)) - } - v = v.Elem() - } - - v.Set(reflect.ValueOf(b)) - return nil - } - case reflect.Map: - if bytes.Equal(value, []byte("null")) || !isComplexValueType(dereferenceTypePointer(typ.Elem())) { - if v.CanAddr() { - return json.Unmarshal(value, v.Addr().Interface()) - } else { - return json.Unmarshal(value, v.Interface()) - } - } - - var unmarhsaled map[string]json.RawMessage - - if err := json.Unmarshal(value, &unmarhsaled); err != nil { - return err - } - - m := reflect.MakeMap(typ) - - for k, value := range unmarhsaled { - itemVal := reflect.New(typ.Elem()) - - if err := unmarshalValue(value, itemVal, tag, disallowUnknownFields); err != nil { - return err - } - - m.SetMapIndex(reflect.ValueOf(k), itemVal.Elem()) - } - - v.Set(m) - return nil - case reflect.Slice, reflect.Array: - var unmarshaled []json.RawMessage - - if err := json.Unmarshal(value, &unmarshaled); err != nil { - return err - } - - arrVal := reflect.MakeSlice(typ, len(unmarshaled), len(unmarshaled)) - - for index, value := range unmarshaled { - itemVal := reflect.New(typ.Elem()) - - if err := unmarshalValue(value, itemVal, tag, disallowUnknownFields); err != nil { - return err - } - - arrVal.Index(index).Set(itemVal.Elem()) - } - - if v.Kind() == reflect.Pointer { - if v.IsNil() { - v.Set(reflect.New(typ)) - } - v = v.Elem() - } - - v.Set(arrVal) - return nil - case reflect.Struct: - switch typ { - case reflect.TypeOf(time.Time{}): - var s string - if err := json.Unmarshal(value, &s); err != nil { - return err - } - - t, err := time.Parse(time.RFC3339Nano, s) - if err != nil { - return fmt.Errorf("failed to parse string as time.Time: %w", err) - } - - if v.Kind() == reflect.Ptr { - if v.IsNil() { - v.Set(reflect.New(typ)) - } - v = v.Elem() - } - - v.Set(reflect.ValueOf(t)) - return nil - case reflect.TypeOf(big.Int{}): - var b *big.Int - - format := tag.Get("bigint") - if format == "string" { - var s string - if err := json.Unmarshal(value, &s); err != nil { - return err - } - - var ok bool - b, ok = new(big.Int).SetString(s, 10) - if !ok { - return fmt.Errorf("failed to parse string as big.Int") - } - } else { - if err := json.Unmarshal(value, &b); err != nil { - return err - } - } - - if v.Kind() == reflect.Ptr && v.Elem().Kind() == reflect.Ptr { - v = v.Elem() - } - - v.Set(reflect.ValueOf(b)) - return nil - case reflect.TypeOf(decimal.Big{}): - var d *decimal.Big - format := tag.Get("decimal") - if format == "number" { - var ok bool - d, ok = new(decimal.Big).SetString(string(value)) - if !ok { - return fmt.Errorf("failed to parse number as decimal.Big") - } - } else { - if err := json.Unmarshal(value, &d); err != nil { - return err - } - } - - if v.Kind() == reflect.Ptr && v.Elem().Kind() == reflect.Ptr { - v = v.Elem() - } - - v.Set(reflect.ValueOf(d)) - return nil - case reflect.TypeOf(types.Date{}): - var s string - - if err := json.Unmarshal(value, &s); err != nil { - return err - } - - d, err := types.DateFromString(s) - if err != nil { - return fmt.Errorf("failed to parse string as types.Date: %w", err) - } - - if v.Kind() == reflect.Ptr { - if v.IsNil() { - v.Set(reflect.New(typ)) - } - v = v.Elem() - } - - v.Set(reflect.ValueOf(d)) - return nil - } - } - - var val interface{} - - if v.CanAddr() { - val = v.Addr().Interface() - } else { - val = v.Interface() - } - - d := json.NewDecoder(bytes.NewReader(value)) - if disallowUnknownFields { - d.DisallowUnknownFields() - } - return d.Decode(val) -} - -func dereferencePointers(typ reflect.Type, val reflect.Value) (reflect.Type, reflect.Value) { - if typ.Kind() == reflect.Ptr { - typ = typ.Elem() - val = val.Elem() - } else { - return typ, val - } - - return dereferencePointers(typ, val) -} - -func dereferenceTypePointer(typ reflect.Type) reflect.Type { - if typ.Kind() == reflect.Ptr { - typ = typ.Elem() - } else { - return typ - } - - return dereferenceTypePointer(typ) -} - -func isComplexValueType(typ reflect.Type) bool { - switch typ.Kind() { - case reflect.Struct: - switch typ { - case reflect.TypeOf(time.Time{}): - fallthrough - case reflect.TypeOf(big.Int{}): - fallthrough - case reflect.TypeOf(decimal.Big{}): - fallthrough - case reflect.TypeOf(types.Date{}): - return true - } - } - - return false -} - -func isModelType(typ reflect.Type) bool { - if isComplexValueType(typ) { - return false - } - - if typ.Kind() == reflect.Struct { - return true - } - - return false -} diff --git a/tests/mockserver/internal/sdk/utils/reflect.go b/tests/mockserver/internal/sdk/utils/reflect.go deleted file mode 100644 index 255f3dd..0000000 --- a/tests/mockserver/internal/sdk/utils/reflect.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package utils - -import ( - "reflect" -) - -func isNil(typ reflect.Type, val reflect.Value) bool { - // `reflect.TypeOf(nil) == nil` so calling typ.Kind() will cause a nil pointer - // dereference panic. Catch it and return early. - // https://github.com/golang/go/issues/51649 - // https://github.com/golang/go/issues/54208 - if typ == nil { - return true - } - - if typ.Kind() == reflect.Ptr || typ.Kind() == reflect.Map || typ.Kind() == reflect.Slice || typ.Kind() == reflect.Interface { - return val.IsNil() - } - - return false -} - -func isEmpty(typ reflect.Type, val reflect.Value) bool { - if typ == nil { - return true - } - - switch typ.Kind() { - case reflect.Array, reflect.Map, reflect.Slice, reflect.String: - return val.Len() == 0 - } - - return false -} - -func trueReflectValue(val reflect.Value) reflect.Value { - kind := val.Type().Kind() - for kind == reflect.Interface || kind == reflect.Ptr { - innerVal := val.Elem() - if !innerVal.IsValid() { - break - } - val = innerVal - kind = val.Type().Kind() - } - return val -} diff --git a/tests/mockserver/internal/sdk/utils/sort.go b/tests/mockserver/internal/sdk/utils/sort.go deleted file mode 100644 index 6b265be..0000000 --- a/tests/mockserver/internal/sdk/utils/sort.go +++ /dev/null @@ -1,94 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package utils - -import ( - "regexp" - "sort" - "strings" -) - -// SortSerializedMaps will sort a given string, []string, or map[string]string -// such that all keys are ordered. This should only be used to simplify testing -// logic. -func SortSerializedMaps(input interface{}, regex string, delim string) interface{} { - sortString := func(input string) string { - r := regexp.MustCompile(regex) - - return replaceAllStringSubmatchFunc(r, input, func(matches []string) string { - result := matches[0] - - for i := 1; i < len(matches); i++ { - match := matches[i] - - pairs := []string{} - if strings.Contains(match, "=") { - pairs = strings.Split(match, delim) - - sort.SliceStable(pairs, func(i, j int) bool { - return strings.Split(pairs[i], "=")[0] < strings.Split(pairs[j], "=")[0] - }) - } else { - values := strings.Split(match, delim) - - if len(values) == 1 { - pairs = values - } else { - pairs = make([]string, len(values)/2) - for i := 0; i < len(values); i += 2 { - pairs[i/2] = values[i] + delim + values[i+1] - } - } - - sort.SliceStable(pairs, func(i, j int) bool { - return strings.Split(pairs[i], delim)[0] < strings.Split(pairs[j], delim)[0] - }) - } - - match = strings.Join(pairs, delim) - - result = strings.Replace(result, matches[i], match, 1) - } - - return result - }) - } - - switch input := input.(type) { - case string: - return sortString(input) - case []string: - for i, v := range input { - input[i] = sortString(v) - } - return input - case map[string]string: - for k, v := range input { - input[k] = sortString(v) - } - return input - default: - panic("unsupported type") - } -} - -func replaceAllStringSubmatchFunc(re *regexp.Regexp, str string, repl func([]string) string) string { - result := "" - lastIndex := 0 - - for _, v := range re.FindAllSubmatchIndex([]byte(str), -1) { - groups := []string{} - for i := 0; i < len(v); i += 2 { - if v[i] == -1 || v[i+1] == -1 { - groups = append(groups, "") - } else { - groups = append(groups, str[v[i]:v[i+1]]) - } - } - - result += str[lastIndex:v[0]] + repl(groups) - lastIndex = v[1] - } - - return result + str[lastIndex:] -} diff --git a/tests/mockserver/internal/server/doc.go b/tests/mockserver/internal/server/doc.go deleted file mode 100644 index 666dc10..0000000 --- a/tests/mockserver/internal/server/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -// Package server implements the HTTP server. -package server diff --git a/tests/mockserver/internal/server/generated_handlers.go b/tests/mockserver/internal/server/generated_handlers.go deleted file mode 100644 index 1ea1635..0000000 --- a/tests/mockserver/internal/server/generated_handlers.go +++ /dev/null @@ -1,17 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package server - -import ( - "context" - - "mockserver/internal/handler" -) - -func (s *Server) registerGeneratedHandlers(ctx context.Context) { - s.logger.Debug("registering generated handlers") - - for _, h := range handler.GeneratedHandlers(ctx, s.httpFileDir, s.requestTracker) { - s.RegisterHandlerFunc(ctx, []string{h.Method}, h.Path, h.HandlerFunc()) - } -} diff --git a/tests/mockserver/internal/server/internal_handlers.go b/tests/mockserver/internal/server/internal_handlers.go deleted file mode 100644 index 1c24861..0000000 --- a/tests/mockserver/internal/server/internal_handlers.go +++ /dev/null @@ -1,343 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package server - -import ( - "bytes" - "context" - "fmt" - "html/template" - "io" - "net/http" - "path/filepath" - "strings" -) - -const ( - // Mock server internal route prefix to prevent naming collisions. - internalPathPrefix = "/_mockserver" -) - -// registerInternalHandlers adds any internal handlers, such as healthcheck -// endpoints and fallback handling. -func (s *Server) registerInternalHandlers(ctx context.Context) { - s.logger.Debug("registering internal handlers") - - // Healthcheck endpoint - s.RegisterHandlerFunc(ctx, []string{http.MethodGet}, internalPathPrefix+"/health", healthcheckHandler) - - // HTTP log index endpoint - s.RegisterHandlerFunc(ctx, []string{http.MethodGet}, internalPathPrefix+"/log", s.httpFileIndexHandler) - - // HTTP log operation endpoint - s.RegisterHandlerFunc(ctx, []string{http.MethodGet}, internalPathPrefix+"/log/{operationId}", s.httpOperationHandler) - - // Default all other requests to 404 Not Found - s.RegisterHandlerFunc(ctx, []string{}, "/", rootHandler) -} - -// healthcheckHandler returns a simple OK response. -func healthcheckHandler(w http.ResponseWriter, _ *http.Request) { - w.Header().Set("Content-Type", "text/plain; charset=utf-8") - w.WriteHeader(http.StatusOK) - fmt.Fprintln(w, "OK") -} - -// httpFileIndexHandler returns a HTML index page for all logged HTTP operations -// written to the HTTP file directory. -func (s *Server) httpFileIndexHandler(w http.ResponseWriter, _ *http.Request) { - operations, err := s.httpFileDir.Operations() - - if err != nil { - http.Error( - w, - fmt.Sprintf("operation log error: %s", err), - http.StatusInternalServerError, - ) - - return - } - - type operationModel struct { - CallCount int64 - ID string - LogURL string - Method string - Path string - } - - type indexModel struct { - Operations []operationModel - } - - var index indexModel - - for _, operation := range operations { - index.Operations = append(index.Operations, operationModel{ - CallCount: operation.CallCount(), - ID: operation.Id(), - LogURL: internalPathPrefix + "/log/" + operation.Id(), - Method: operation.Method(), - Path: operation.Path(), - }) - } - - tmpl := template.New("index.html.tmpl") - tmpl.Funcs(template.FuncMap{ - "mod": func(i, j int) bool { return i%j == 0 }, - }) - _, err = tmpl.ParseFiles( - filepath.Join("internal", "server", "templates", "log", "style.css.tmpl"), - filepath.Join("internal", "server", "templates", "log", "index.html.tmpl"), - ) - - if err != nil { - http.Error( - w, - fmt.Sprintf("operation log template error: %s", err), - http.StatusInternalServerError, - ) - - return - } - - var wBuf bytes.Buffer - - err = tmpl.Execute(&wBuf, index) - - if err != nil { - http.Error( - w, - fmt.Sprintf("operation log template execution error: %s", err), - http.StatusInternalServerError, - ) - - return - } - - w.Header().Set("Content-Type", "text/html; charset=utf-8") - w.WriteHeader(http.StatusOK) - _, _ = wBuf.WriteTo(w) -} - -// httpOperationHandler returns a HTML page for HTTP request and response log files -// written to _debug. -func (s *Server) httpOperationHandler(w http.ResponseWriter, req *http.Request) { - operationId := req.PathValue("operationId") - - if operationId == "" { - http.Error(w, "operation logs not found", http.StatusNotFound) - - return - } - - operation, err := s.httpFileDir.Operation(operationId) - - if err != nil { - http.Error( - w, - fmt.Sprintf("operation %s log error: %s", operationId, err), - http.StatusInternalServerError, - ) - - return - } - - type headerModel struct { - Key string - Values template.HTML - } - - type queryParameterModel struct { - Key string - Values template.HTML - } - - type operationCallModel struct { - Call int64 - ID string - LogOperationURL string - - RawRequest template.HTML - RawResponse template.HTML - - RequestBody string - RequestHeaders []headerModel - RequestQueryParameters []queryParameterModel - - ResponseBody string - ResponseHeaders []headerModel - ResponseStatus string - } - - type operationDataModel struct { - Calls []operationCallModel - ID string - LogIndexURL string - RequestMethod string - RequestPath string - } - - operationData := operationDataModel{ - ID: operationId, - LogIndexURL: internalPathPrefix + "/log", - RequestMethod: operation.Method(), - RequestPath: operation.Path(), - } - - for i := range operation.CallCount() { - call := i + 1 - - callReqRaw, err := operation.RawRequest(call) - - if err != nil { - http.Error( - w, - fmt.Sprintf("operation %s call %d log raw request error: %s", operationId, call, err), - http.StatusInternalServerError, - ) - - return - } - - callReq, err := operation.Request(call) - - if err != nil { - http.Error( - w, - fmt.Sprintf("operation %s call %d log request error: %s", operationId, call, err), - http.StatusInternalServerError, - ) - - return - } - - callReqBody, err := io.ReadAll(callReq.Body) - defer callReq.Body.Close() - - if err != nil { - http.Error( - w, - fmt.Sprintf("operation %s call %d log request body error: %s", operationId, call, err), - http.StatusInternalServerError, - ) - - return - } - - callRespRaw, err := operation.RawResponse(call) - - if err != nil { - http.Error( - w, - fmt.Sprintf("operation %s call %d log response error: %s", operationId, call, err), - http.StatusInternalServerError, - ) - - return - } - - callResp, err := operation.Response(call) - - if err != nil { - http.Error( - w, - fmt.Sprintf("operation %s call %d log response error: %s", operationId, call, err), - http.StatusInternalServerError, - ) - - return - } - - callRespBody, err := io.ReadAll(callResp.Body) - defer callReq.Body.Close() - - if err != nil { - http.Error( - w, - fmt.Sprintf("operation %s call %d log response body error: %s", operationId, call, err), - http.StatusInternalServerError, - ) - - return - } - - operationCall := operationCallModel{ - Call: call, - LogOperationURL: internalPathPrefix + "/log/" + operationId, - - RawRequest: template.HTML(strings.ReplaceAll(string(callReqRaw), "\r\n", "
")), - RawResponse: template.HTML(strings.ReplaceAll(string(callRespRaw), "\r\n", "
")), - - RequestBody: string(callReqBody), - ResponseBody: string(callRespBody), - ResponseStatus: callResp.Status, - } - - for key, values := range callReq.URL.Query() { - operationCall.RequestQueryParameters = append(operationCall.RequestQueryParameters, queryParameterModel{ - Key: key, - Values: template.HTML(strings.Join(values, "
")), - }) - } - - for key, values := range callReq.Header { - operationCall.RequestHeaders = append(operationCall.RequestHeaders, headerModel{ - Key: key, - Values: template.HTML(strings.Join(values, "
")), - }) - } - - for key, values := range callResp.Header { - operationCall.ResponseHeaders = append(operationCall.ResponseHeaders, headerModel{ - Key: key, - Values: template.HTML(strings.Join(values, "
")), - }) - } - - operationData.Calls = append(operationData.Calls, operationCall) - } - - tmpl := template.New("operation.html.tmpl") - tmpl.Funcs(template.FuncMap{ - "mod": func(i, j int) bool { return i%j == 0 }, - }) - _, err = tmpl.ParseFiles( - filepath.Join("internal", "server", "templates", "log", "style.css.tmpl"), - filepath.Join("internal", "server", "templates", "log", "operation.html.tmpl"), - ) - - if err != nil { - http.Error( - w, - fmt.Sprintf("operation log template error: %s", err), - http.StatusInternalServerError, - ) - - return - } - - var wBuf bytes.Buffer - - err = tmpl.Execute(&wBuf, operationData) - - if err != nil { - http.Error( - w, - fmt.Sprintf("operation log template execution error: %s", err), - http.StatusInternalServerError, - ) - - return - } - - w.Header().Set("Content-Type", "text/html; charset=utf-8") - w.WriteHeader(http.StatusOK) - _, _ = wBuf.WriteTo(w) -} - -// rootHandler returns a slightly customized [http.NotFoundHandler], saying -// "path" instead of "page". -func rootHandler(w http.ResponseWriter, _ *http.Request) { - http.Error(w, "path not found", http.StatusNotFound) -} diff --git a/tests/mockserver/internal/server/server.go b/tests/mockserver/internal/server/server.go deleted file mode 100644 index 1223961..0000000 --- a/tests/mockserver/internal/server/server.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package server - -import ( - "context" - "errors" - "fmt" - "log/slog" - "mockserver/internal/logging" - "mockserver/internal/tracking" - "net/http" - "strings" - "time" - - "github.com/gorilla/mux" -) - -const ( - // Default address for server listening. - DefaultAddress = ":18080" -) - -// Server implements the HTTP server. -type Server struct { - // Address for server listening. - address string - - // Directory for raw HTTP request and response files. - httpFileDir *logging.HTTPFileDirectory - - // Logger implementation. - logger *slog.Logger - - // Underlying mux implementation. - // Based on gorilla mux as the native mux suffered from issues with ambiguous paths and different http methods - // eg - panic: pattern "HEAD /v8/artifacts/{hash}" (registered at /usr/src/app/internal/server/server.go:104) conflicts with pattern "GET /v8/artifacts/status" (registered at /usr/src/app/internal/server/server.go:104): HEAD /v8/artifacts/{hash} matches fewer methods than GET /v8/artifacts/status, but has a more general path pattern - mux *mux.Router - - // Underlying server implementation. - server *http.Server - - requestTracker *tracking.RequestTracker -} - -// NewServer creates a new Server instance. -func NewServer(ctx context.Context, opts ...ServerOption) (*Server, error) { - // Initialize with defaults. - result := &Server{ - address: DefaultAddress, - logger: slog.Default(), - mux: mux.NewRouter(), - requestTracker: tracking.New(), - } - - // Customize based on ServerOption. - for _, opt := range opts { - err := opt(result) - - if err != nil { - return result, err - } - } - - result.server = &http.Server{ - Addr: result.address, - Handler: logging.HTTPLoggerHandler(result.logger, result.mux), - ErrorLog: slog.NewLogLogger(result.logger.Handler(), slog.LevelError), - } - - httpFileDir, err := logging.NewHTTPFileDirectory("") - - if err != nil { - return result, err - } - - err = httpFileDir.Clean() - - if err != nil { - return result, err - } - - result.httpFileDir = httpFileDir - - result.registerGeneratedHandlers(ctx) - result.registerInternalHandlers(ctx) - - return result, err -} - -// Address returns the server address including protocol, hostname, and port. -func (s *Server) Address() string { - return "http://localhost" + s.address -} - -// RegisterHandlerFunc adds a new HTTP handler function for the given methods and path. -func (s *Server) RegisterHandlerFunc(ctx context.Context, methods []string, path string, handlerFunc http.HandlerFunc) { - s.logger.DebugContext(ctx, fmt.Sprintf("registering handler for %s %s", strings.Join(methods, ", "), path)) - - r := s.mux.HandleFunc(path, handlerFunc) - if len(methods) > 0 { - r.Methods(methods...) - } -} - -// Serve starts the server. -func (s *Server) Serve(ctx context.Context) error { - s.logger.InfoContext(ctx, "starting server with address "+s.server.Addr) - - err := s.server.ListenAndServe() - - if errors.Is(err, http.ErrServerClosed) { - return nil - } - - return fmt.Errorf("error running server: %w", err) -} - -// Shutdown gracefully stops the server. -func (s *Server) Shutdown(ctx context.Context) error { - s.logger.WarnContext(ctx, "shutting down server") - s.server.SetKeepAlivesEnabled(false) - - ctx, cancel := context.WithTimeout(ctx, 5*time.Second) - defer cancel() - - err := s.server.Shutdown(ctx) - - if err != nil { - return fmt.Errorf("error shutting down server: %w", err) - } - - return nil -} diff --git a/tests/mockserver/internal/server/server_option.go b/tests/mockserver/internal/server/server_option.go deleted file mode 100644 index ff85a67..0000000 --- a/tests/mockserver/internal/server/server_option.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package server - -import ( - "log/slog" -) - -// ServerOption is a function which modifies the Server. -type ServerOption func(*Server) error - -// WithAddress sets the listening address for a Server. By default, the server -// address is :18080. -func WithAddress(address string) ServerOption { - return func(s *Server) error { - s.address = address - - return nil - } -} - -// WithLogger sets the logger implementation for a Server. By default, the -// server logger is [slog.Default]. -func WithLogger(logger *slog.Logger) ServerOption { - return func(s *Server) error { - s.logger = logger - - return nil - } -} diff --git a/tests/mockserver/internal/server/templates/log/index.html.tmpl b/tests/mockserver/internal/server/templates/log/index.html.tmpl deleted file mode 100644 index 8b1124e..0000000 --- a/tests/mockserver/internal/server/templates/log/index.html.tmpl +++ /dev/null @@ -1,22 +0,0 @@ - - - Operation Logs - - - -

// Speakeasy

-

Operation Logs

- - - {{ range $idx, $o := .Operations }} - - - - - - {{ end }} -
OperationRequestCalls
{{ .ID }}{{ .Method }} {{ .Path }}{{ .CallCount }}
- - diff --git a/tests/mockserver/internal/server/templates/log/operation.html.tmpl b/tests/mockserver/internal/server/templates/log/operation.html.tmpl deleted file mode 100644 index a54a2ad..0000000 --- a/tests/mockserver/internal/server/templates/log/operation.html.tmpl +++ /dev/null @@ -1,93 +0,0 @@ - - - Operation Logs: {{ .ID }} - - - -

// Speakeasy

-

Operation Logs: {{ .ID }}

-

{{ .RequestMethod }} {{ .RequestPath }}

-

Back to All Operation Logs

-
- {{ range $idx, $c := .Calls }} -
- {{ if (ne (len $.Calls) 1) }} -

Call {{ .Call }}

- {{ end }} -
-

Request

- - {{ if (gt (len .RequestQueryParameters) 0) }} -
-

Query Parameters

- - - {{ range $idx, $p := .RequestQueryParameters }} - - - - - {{ end }} -
KeyValue
{{ .Key }}{{ .Values }}
-
- {{ end }} -
-

Headers

- - - {{ range $idx, $h := .RequestHeaders }} - - - - - {{ end }} -
KeyValue(s)
{{ .Key }}{{ .Values }}
-
- {{ if (gt (len .RequestBody) 0) }} -
-

Body

-

{{ .RequestBody }}

-
- {{ end }} -

-

- Raw Request -
{{ .RawRequest }}
-
-

-
-
-

Response

-

{{ .ResponseStatus }}

-
-

Headers

- - - {{ range $idx, $h := .ResponseHeaders }} - - - - - {{ end }} -
KeyValue(s)
{{ .Key }}{{ .Values }}
-
- {{ if (gt (len .ResponseBody) 0) }} -
-

Body

-

{{ .ResponseBody }}

-
- {{ end }} -

-

- Raw Response -
{{ .RawResponse }}
-
-

-
-
- {{ end }} -
- - diff --git a/tests/mockserver/internal/server/templates/log/style.css.tmpl b/tests/mockserver/internal/server/templates/log/style.css.tmpl deleted file mode 100644 index 5490930..0000000 --- a/tests/mockserver/internal/server/templates/log/style.css.tmpl +++ /dev/null @@ -1,64 +0,0 @@ -{{ define "style" }} -a { - color: rgba(251, 227, 50, 1.0); -} -body { - background: black; - font-family: Arial, Helvetica, sans-serif; -} -code { - color: white; -} -details > div { - border-left: 1px solid gray; - margin-left: 10px; - padding: 10px; -} -div { - width: fit-content; -} -div.operation-call.odd { - background-color: rgba(251, 227, 50, 0.1); -} -h1 { - color: hsl(53, 96%, 59%); -} -h2 { - color: rgba(255, 255, 255, 1.0); -} -h3 { - color: rgba(255, 255, 255, 0.75); -} -h4 { - color: rgba(255, 255, 255, 0.50); -} -p { - color: white; - padding-left: 10px; -} -summary { - color: gray; - font-weight: bold; - margin-bottom: 5px; -} -table { - border-collapse: collapse; - margin: 5px; -} -th { - border-bottom: 1px solid gray; - color: white; - padding: 10px; - text-align: left; -} -td { - color: white; - padding: 10px; -} -tr.even { - background-color: rgba(255, 255, 255, 0.0); -} -tr.odd { - background-color: rgba(255, 255, 255, 0.1); -} -{{ end }} diff --git a/tests/mockserver/internal/tracking/requesttracker.go b/tests/mockserver/internal/tracking/requesttracker.go deleted file mode 100644 index 1d9131d..0000000 --- a/tests/mockserver/internal/tracking/requesttracker.go +++ /dev/null @@ -1,47 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package tracking - -import ( - "fmt" - "time" - - cache "github.com/go-pkgz/expirable-cache/v3" -) - -type RequestTracker struct { - cache cache.Cache[string, *testEntry] -} - -type testEntry struct { - name string - id string - count int - created time.Time -} - -func New() *RequestTracker { - return &RequestTracker{ - cache: cache.NewCache[string, *testEntry]().WithTTL(5 * time.Minute), - } -} - -func (t *RequestTracker) GetRequestCount(testName, instanceID string) int { - key := fmt.Sprintf("%s-%s", testName, instanceID) - - entry, ok := t.cache.Get(key) - if !ok { - entry = &testEntry{ - name: testName, - id: instanceID, - count: 0, - created: time.Now(), - } - } - - count := entry.count - entry.count++ - t.cache.Set(key, entry, 0) - - return count -} diff --git a/tests/mockserver/main.go b/tests/mockserver/main.go deleted file mode 100644 index 2270443..0000000 --- a/tests/mockserver/main.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package main - -import ( - "context" - "flag" - "fmt" - "os" - "os/signal" - "strings" - - "mockserver/internal/logging" - "mockserver/internal/server" -) - -func main() { - ctx := context.Background() - - address := flag.String("address", server.DefaultAddress, fmt.Sprintf("server listen address (default: %s)", server.DefaultAddress)) - logFormat := flag.String("log-format", logging.DefaultFormat, fmt.Sprintf("logging format (default: %s, supported: %s)", logging.DefaultFormat, strings.Join(logging.Formats(), ", "))) - logLevel := flag.String("log-level", logging.DefaultLevel, fmt.Sprintf("logging level (default: %s, supported: %s)", logging.DefaultLevel, strings.Join(logging.Levels(), ", "))) - - flag.Parse() - - logger, err := logging.NewLogger(os.Stdout, *logFormat, *logLevel) - - if err != nil { - fmt.Fprintf(os.Stderr, "error setting up logging: %s", err) - os.Exit(1) - } - - serverOpts := []server.ServerOption{ - server.WithAddress(*address), - server.WithLogger(logger), - } - - s, err := server.NewServer(ctx, serverOpts...) - - if err != nil { - logger.ErrorContext(ctx, err.Error()) - os.Exit(1) - } - - finishedShutdown := make(chan struct{}) - startShutdown := make(chan os.Signal, 1) - signal.Notify(startShutdown, os.Interrupt) - - go func() { - <-startShutdown - - logger.WarnContext(ctx, "server received interrupt") - - err := s.Shutdown(ctx) - - if err != nil { - logger.Error(err.Error()) - os.Exit(1) - } - - close(finishedShutdown) - }() - - err = s.Serve(ctx) - - if err != nil { - logger.ErrorContext(ctx, err.Error()) - os.Exit(1) - } - - <-finishedShutdown - - logger.InfoContext(ctx, "server stopped") -}