From aefa5a92a4d70977ceaab7b7d907283325632cab Mon Sep 17 00:00:00 2001 From: Ed Ropple Date: Mon, 23 May 2022 12:34:00 -0400 Subject: [PATCH] [minor] release for real-time --- api_spaces.go | 691 +++++++++++++++++++++++ client.go | 2 + configuration.go | 2 +- docs/Asset.md | 2 +- docs/Broadcast.md | 16 + docs/BroadcastLayout.md | 9 + docs/BroadcastResolution.md | 9 + docs/BroadcastResponse.md | 10 + docs/BroadcastStatus.md | 9 + docs/CreateBroadcastRequest.md | 14 + docs/CreateSimulcastTargetRequest.md | 2 +- docs/CreateSpaceRequest.md | 12 + docs/ListSpacesResponse.md | 10 + docs/Space.md | 16 + docs/SpaceResponse.md | 10 + docs/SpaceStatus.md | 9 + docs/SpaceType.md | 9 + docs/SpacesApi.md | 282 +++++++++ docs/StartSpaceBroadcastResponse.md | 10 + docs/StopSpaceBroadcastResponse.md | 10 + model_asset.go | 2 +- model_broadcast.go | 18 + model_broadcast_layout.go | 13 + model_broadcast_resolution.go | 17 + model_broadcast_response.go | 8 + model_broadcast_status.go | 13 + model_create_broadcast_request.go | 15 + model_create_simulcast_target_request.go | 2 +- model_create_space_request.go | 12 + model_list_spaces_response.go | 8 + model_space.go | 19 + model_space_response.go | 8 + model_space_status.go | 13 + model_space_type.go | 12 + model_start_space_broadcast_response.go | 8 + model_stop_space_broadcast_response.go | 8 + 36 files changed, 1305 insertions(+), 5 deletions(-) create mode 100644 api_spaces.go create mode 100644 docs/Broadcast.md create mode 100644 docs/BroadcastLayout.md create mode 100644 docs/BroadcastResolution.md create mode 100644 docs/BroadcastResponse.md create mode 100644 docs/BroadcastStatus.md create mode 100644 docs/CreateBroadcastRequest.md create mode 100644 docs/CreateSpaceRequest.md create mode 100644 docs/ListSpacesResponse.md create mode 100644 docs/Space.md create mode 100644 docs/SpaceResponse.md create mode 100644 docs/SpaceStatus.md create mode 100644 docs/SpaceType.md create mode 100644 docs/SpacesApi.md create mode 100644 docs/StartSpaceBroadcastResponse.md create mode 100644 docs/StopSpaceBroadcastResponse.md create mode 100644 model_broadcast.go create mode 100644 model_broadcast_layout.go create mode 100644 model_broadcast_resolution.go create mode 100644 model_broadcast_response.go create mode 100644 model_broadcast_status.go create mode 100644 model_create_broadcast_request.go create mode 100644 model_create_space_request.go create mode 100644 model_list_spaces_response.go create mode 100644 model_space.go create mode 100644 model_space_response.go create mode 100644 model_space_status.go create mode 100644 model_space_type.go create mode 100644 model_start_space_broadcast_response.go create mode 100644 model_stop_space_broadcast_response.go diff --git a/api_spaces.go b/api_spaces.go new file mode 100644 index 0000000..44cc680 --- /dev/null +++ b/api_spaces.go @@ -0,0 +1,691 @@ +// Mux Go - Copyright 2019 Mux Inc. +// NOTE: This file is auto generated. Do not edit this file manually. + +package muxgo + +import ( + "fmt" + "io/ioutil" + "net/url" + "strings" +) + +type SpacesApiService service + +func (a *SpacesApiService) CreateSpace(createSpaceRequest CreateSpaceRequest, opts ...APIOption) (SpaceResponse, error) { + var ( + localVarAPIOptions = new(APIOptions) + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue SpaceResponse + ) + + for _, opt := range opts { + opt(localVarAPIOptions) + } + + // create path and map variables + localVarPath := a.client.cfg.basePath + "/video/v1/spaces" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &createSpaceRequest + + r, err := a.client.prepareRequest(localVarAPIOptions, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, err + } + + // Check for common HTTP error status codes + err = CheckForHttpError(localVarHttpResponse.StatusCode, localVarBody) + if err != nil { + return localVarReturnValue, err + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +func (a *SpacesApiService) CreateSpaceBroadcast(sPACEID string, createBroadcastRequest CreateBroadcastRequest, opts ...APIOption) (BroadcastResponse, error) { + var ( + localVarAPIOptions = new(APIOptions) + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue BroadcastResponse + ) + + for _, opt := range opts { + opt(localVarAPIOptions) + } + + // create path and map variables + localVarPath := a.client.cfg.basePath + "/video/v1/spaces/${SPACE_ID}/broadcasts" + localVarPath = strings.Replace(localVarPath, "{"+"SPACE_ID"+"}", fmt.Sprintf("%v", sPACEID), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &createBroadcastRequest + + r, err := a.client.prepareRequest(localVarAPIOptions, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, err + } + + // Check for common HTTP error status codes + err = CheckForHttpError(localVarHttpResponse.StatusCode, localVarBody) + if err != nil { + return localVarReturnValue, err + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +func (a *SpacesApiService) DeleteSpace(sPACEID string, opts ...APIOption) error { + var ( + localVarAPIOptions = new(APIOptions) + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + for _, opt := range opts { + opt(localVarAPIOptions) + } + + // create path and map variables + localVarPath := a.client.cfg.basePath + "/video/v1/spaces/${SPACE_ID}" + localVarPath = strings.Replace(localVarPath, "{"+"SPACE_ID"+"}", fmt.Sprintf("%v", sPACEID), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + + r, err := a.client.prepareRequest(localVarAPIOptions, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return err + } + + // Check for common HTTP error status codes + err = CheckForHttpError(localVarHttpResponse.StatusCode, localVarBody) + if err != nil { + return err + } + + return nil +} + +func (a *SpacesApiService) DeleteSpaceBroadcast(sPACEID string, bROADCASTID string, opts ...APIOption) error { + var ( + localVarAPIOptions = new(APIOptions) + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + for _, opt := range opts { + opt(localVarAPIOptions) + } + + // create path and map variables + localVarPath := a.client.cfg.basePath + "/video/v1/spaces/${SPACE_ID}/broadcasts/${BROADCAST_ID}" + localVarPath = strings.Replace(localVarPath, "{"+"SPACE_ID"+"}", fmt.Sprintf("%v", sPACEID), -1) + localVarPath = strings.Replace(localVarPath, "{"+"BROADCAST_ID"+"}", fmt.Sprintf("%v", bROADCASTID), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + + r, err := a.client.prepareRequest(localVarAPIOptions, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return err + } + + // Check for common HTTP error status codes + err = CheckForHttpError(localVarHttpResponse.StatusCode, localVarBody) + if err != nil { + return err + } + + return nil +} + +func (a *SpacesApiService) GetSpace(sPACEID string, opts ...APIOption) (SpaceResponse, error) { + var ( + localVarAPIOptions = new(APIOptions) + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue SpaceResponse + ) + + for _, opt := range opts { + opt(localVarAPIOptions) + } + + // create path and map variables + localVarPath := a.client.cfg.basePath + "/video/v1/spaces/${SPACE_ID}" + localVarPath = strings.Replace(localVarPath, "{"+"SPACE_ID"+"}", fmt.Sprintf("%v", sPACEID), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + + r, err := a.client.prepareRequest(localVarAPIOptions, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, err + } + + // Check for common HTTP error status codes + err = CheckForHttpError(localVarHttpResponse.StatusCode, localVarBody) + if err != nil { + return localVarReturnValue, err + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +func (a *SpacesApiService) GetSpaceBroadcast(sPACEID string, bROADCASTID string, opts ...APIOption) (BroadcastResponse, error) { + var ( + localVarAPIOptions = new(APIOptions) + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue BroadcastResponse + ) + + for _, opt := range opts { + opt(localVarAPIOptions) + } + + // create path and map variables + localVarPath := a.client.cfg.basePath + "/video/v1/spaces/${SPACE_ID}/broadcasts/${BROADCAST_ID}" + localVarPath = strings.Replace(localVarPath, "{"+"SPACE_ID"+"}", fmt.Sprintf("%v", sPACEID), -1) + localVarPath = strings.Replace(localVarPath, "{"+"BROADCAST_ID"+"}", fmt.Sprintf("%v", bROADCASTID), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + + r, err := a.client.prepareRequest(localVarAPIOptions, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, err + } + + // Check for common HTTP error status codes + err = CheckForHttpError(localVarHttpResponse.StatusCode, localVarBody) + if err != nil { + return localVarReturnValue, err + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ListSpacesParams struct { + Limit int32 + Page int32 +} + +// ListSpaces optionally accepts the APIOption of WithParams(*ListSpacesParams). +func (a *SpacesApiService) ListSpaces(opts ...APIOption) (ListSpacesResponse, error) { + var ( + localVarAPIOptions = new(APIOptions) + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ListSpacesResponse + ) + + for _, opt := range opts { + opt(localVarAPIOptions) + } + + localVarOptionals, ok := localVarAPIOptions.params.(*ListSpacesParams) + if localVarAPIOptions.params != nil && !ok { + return localVarReturnValue, reportError("provided params were not of type *ListSpacesParams") + } + + // create path and map variables + localVarPath := a.client.cfg.basePath + "/video/v1/spaces" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && isSet(localVarOptionals.Limit) { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit, "")) + } + if localVarOptionals != nil && isSet(localVarOptionals.Page) { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page, "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + + r, err := a.client.prepareRequest(localVarAPIOptions, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, err + } + + // Check for common HTTP error status codes + err = CheckForHttpError(localVarHttpResponse.StatusCode, localVarBody) + if err != nil { + return localVarReturnValue, err + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +func (a *SpacesApiService) StartSpaceBroadcast(sPACEID string, bROADCASTID string, opts ...APIOption) (StartSpaceBroadcastResponse, error) { + var ( + localVarAPIOptions = new(APIOptions) + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue StartSpaceBroadcastResponse + ) + + for _, opt := range opts { + opt(localVarAPIOptions) + } + + // create path and map variables + localVarPath := a.client.cfg.basePath + "/video/v1/spaces/${SPACE_ID}/broadcasts/${BROADCAST_ID}/start" + localVarPath = strings.Replace(localVarPath, "{"+"SPACE_ID"+"}", fmt.Sprintf("%v", sPACEID), -1) + localVarPath = strings.Replace(localVarPath, "{"+"BROADCAST_ID"+"}", fmt.Sprintf("%v", bROADCASTID), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + + r, err := a.client.prepareRequest(localVarAPIOptions, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, err + } + + // Check for common HTTP error status codes + err = CheckForHttpError(localVarHttpResponse.StatusCode, localVarBody) + if err != nil { + return localVarReturnValue, err + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +func (a *SpacesApiService) StopSpaceBroadcast(sPACEID string, bROADCASTID string, opts ...APIOption) (StopSpaceBroadcastResponse, error) { + var ( + localVarAPIOptions = new(APIOptions) + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue StopSpaceBroadcastResponse + ) + + for _, opt := range opts { + opt(localVarAPIOptions) + } + + // create path and map variables + localVarPath := a.client.cfg.basePath + "/video/v1/spaces/${SPACE_ID}/broadcasts/${BROADCAST_ID}/stop" + localVarPath = strings.Replace(localVarPath, "{"+"SPACE_ID"+"}", fmt.Sprintf("%v", sPACEID), -1) + localVarPath = strings.Replace(localVarPath, "{"+"BROADCAST_ID"+"}", fmt.Sprintf("%v", bROADCASTID), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + + r, err := a.client.prepareRequest(localVarAPIOptions, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, err + } + + // Check for common HTTP error status codes + err = CheckForHttpError(localVarHttpResponse.StatusCode, localVarBody) + if err != nil { + return localVarReturnValue, err + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} diff --git a/client.go b/client.go index c658646..5dee043 100644 --- a/client.go +++ b/client.go @@ -50,6 +50,7 @@ type APIClient struct { PlaybackIDApi *PlaybackIDApiService PlaybackRestrictionsApi *PlaybackRestrictionsApiService RealTimeApi *RealTimeApiService + SpacesApi *SpacesApiService URLSigningKeysApi *URLSigningKeysApiService VideoViewsApi *VideoViewsApiService } @@ -81,6 +82,7 @@ func NewAPIClient(cfg *Configuration) *APIClient { c.PlaybackIDApi = (*PlaybackIDApiService)(&c.common) c.PlaybackRestrictionsApi = (*PlaybackRestrictionsApiService)(&c.common) c.RealTimeApi = (*RealTimeApiService)(&c.common) + c.SpacesApi = (*SpacesApiService)(&c.common) c.URLSigningKeysApi = (*URLSigningKeysApiService)(&c.common) c.VideoViewsApi = (*VideoViewsApiService)(&c.common) diff --git a/configuration.go b/configuration.go index 550400e..f95086e 100644 --- a/configuration.go +++ b/configuration.go @@ -22,7 +22,7 @@ type ConfigurationOption func(*Configuration) func NewConfiguration(opts ...ConfigurationOption) *Configuration { cfg := &Configuration{ basePath: "https://api.mux.com", - userAgent: "Mux Go | 4.1.0", + userAgent: "Mux Go | 4.2.1", } for _, opt := range opts { opt(cfg) diff --git a/docs/Asset.md b/docs/Asset.md index 081b41e..db66bae 100644 --- a/docs/Asset.md +++ b/docs/Asset.md @@ -15,7 +15,7 @@ Name | Type | Description | Notes **Errors** | [**AssetErrors**](Asset_errors.md) | | [optional] **PerTitleEncode** | **bool** | | [optional] **UploadId** | **string** | Unique identifier for the Direct Upload. This is an optional parameter added when the asset is created from a direct upload. | [optional] -**IsLive** | **bool** | Whether the asset is created from a live stream and the live stream is currently `active` and not in `idle` state. | [optional] +**IsLive** | **bool** | Indicates whether the live stream that created this asset is currently `active` and not in `idle` state. This is an optional parameter added when the asset is created from a live stream. | [optional] **Passthrough** | **string** | Arbitrary user-supplied metadata set for the asset. Max 255 characters. | [optional] **LiveStreamId** | **string** | Unique identifier for the live stream. This is an optional parameter added when the asset is created from a live stream. | [optional] **Master** | [**AssetMaster**](Asset_master.md) | | [optional] diff --git a/docs/Broadcast.md b/docs/Broadcast.md new file mode 100644 index 0000000..6bfac05 --- /dev/null +++ b/docs/Broadcast.md @@ -0,0 +1,16 @@ +# Broadcast + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | Unique identifier for the broadcast. Max 255 characters. | +**Passthrough** | **string** | Arbitrary user-supplied metadata that will be included in the broadcast details and related webhooks. Max: 255 characters. | [optional] +**LiveStreamId** | **string** | The ID of the live stream that the broadcast will be sent to. | +**Status** | [**BroadcastStatus**](BroadcastStatus.md) | | +**Layout** | [**BroadcastLayout**](BroadcastLayout.md) | | +**Background** | **string** | URL of an image to display as the background of the broadcast. Its dimensions should match the provided resolution. | [optional] +**Resolution** | [**BroadcastResolution**](BroadcastResolution.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BroadcastLayout.md b/docs/BroadcastLayout.md new file mode 100644 index 0000000..847b8cb --- /dev/null +++ b/docs/BroadcastLayout.md @@ -0,0 +1,9 @@ +# BroadcastLayout + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BroadcastResolution.md b/docs/BroadcastResolution.md new file mode 100644 index 0000000..a2fa438 --- /dev/null +++ b/docs/BroadcastResolution.md @@ -0,0 +1,9 @@ +# BroadcastResolution + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BroadcastResponse.md b/docs/BroadcastResponse.md new file mode 100644 index 0000000..12311c8 --- /dev/null +++ b/docs/BroadcastResponse.md @@ -0,0 +1,10 @@ +# BroadcastResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**Broadcast**](Broadcast.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BroadcastStatus.md b/docs/BroadcastStatus.md new file mode 100644 index 0000000..b9ce055 --- /dev/null +++ b/docs/BroadcastStatus.md @@ -0,0 +1,9 @@ +# BroadcastStatus + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateBroadcastRequest.md b/docs/CreateBroadcastRequest.md new file mode 100644 index 0000000..4c520c9 --- /dev/null +++ b/docs/CreateBroadcastRequest.md @@ -0,0 +1,14 @@ +# CreateBroadcastRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Passthrough** | **string** | Arbitrary user-supplied metadata that will be included in the broadcast details and related webhooks. Max: 255 characters. | [optional] +**LiveStreamId** | **string** | The ID of the live stream that you want to broadcast to. | +**Layout** | [**BroadcastLayout**](BroadcastLayout.md) | | [optional] +**Background** | **string** | URL of an image to display as the background of the broadcast. Its dimensions should match the provided resolution. | [optional] +**Resolution** | [**BroadcastResolution**](BroadcastResolution.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateSimulcastTargetRequest.md b/docs/CreateSimulcastTargetRequest.md index c449e9b..50f105b 100644 --- a/docs/CreateSimulcastTargetRequest.md +++ b/docs/CreateSimulcastTargetRequest.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Passthrough** | **string** | Arbitrary user-supplied metadata set by you when creating a simulcast target. | [optional] **StreamKey** | **string** | Stream Key represents a stream identifier on the third party live streaming service to send the parent live stream to. | [optional] -**Url** | **string** | RTMP hostname including application name for the third party live streaming service. Example: 'rtmp://live.example.com/app'. | +**Url** | **string** | RTMP hostname including application name for the third party live streaming service. Example: `rtmp://live.example.com/app`. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreateSpaceRequest.md b/docs/CreateSpaceRequest.md new file mode 100644 index 0000000..d1879ba --- /dev/null +++ b/docs/CreateSpaceRequest.md @@ -0,0 +1,12 @@ +# CreateSpaceRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | [**SpaceType**](SpaceType.md) | | [optional] +**Passthrough** | **string** | Arbitrary user-supplied metadata that will be included in the space details and related webhooks. Max: 255 characters. | [optional] +**Broadcasts** | [**[]CreateBroadcastRequest**](CreateBroadcastRequest.md) | An array of broadcast destinations you want to stream the space to. **Note:** By default only a single broadcast destination can be specified. Contact Mux support if you need more. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListSpacesResponse.md b/docs/ListSpacesResponse.md new file mode 100644 index 0000000..49501a8 --- /dev/null +++ b/docs/ListSpacesResponse.md @@ -0,0 +1,10 @@ +# ListSpacesResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**[]Space**](Space.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Space.md b/docs/Space.md new file mode 100644 index 0000000..c7fe251 --- /dev/null +++ b/docs/Space.md @@ -0,0 +1,16 @@ +# Space + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | Unique identifier for the space. Max 255 characters. | +**CreatedAt** | **string** | Time the space was created, defined as a Unix timestamp (seconds since epoch). | +**Type** | [**SpaceType**](SpaceType.md) | | +**Status** | [**SpaceStatus**](SpaceStatus.md) | | +**Passthrough** | **string** | Arbitrary user-supplied metadata that will be included in the space details and related webhooks. Max: 255 characters. | [optional] +**Broadcasts** | [**[]Broadcast**](Broadcast.md) | An array of broadcast destinations. | [optional] +**ActiveSessionId** | **string** | Unique identifier for the current lifecycle of the space. Only set when the space is `active` and is set to a new value each time the space transitions from `idle` to `active`. This value is useful for logging and debugging issues. Max 255 characters. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SpaceResponse.md b/docs/SpaceResponse.md new file mode 100644 index 0000000..777f9d0 --- /dev/null +++ b/docs/SpaceResponse.md @@ -0,0 +1,10 @@ +# SpaceResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**Space**](Space.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SpaceStatus.md b/docs/SpaceStatus.md new file mode 100644 index 0000000..f2e1329 --- /dev/null +++ b/docs/SpaceStatus.md @@ -0,0 +1,9 @@ +# SpaceStatus + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SpaceType.md b/docs/SpaceType.md new file mode 100644 index 0000000..f4c35de --- /dev/null +++ b/docs/SpaceType.md @@ -0,0 +1,9 @@ +# SpaceType + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SpacesApi.md b/docs/SpacesApi.md new file mode 100644 index 0000000..4b78b22 --- /dev/null +++ b/docs/SpacesApi.md @@ -0,0 +1,282 @@ +# \SpacesApi + +All URIs are relative to *https://api.mux.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateSpace**](SpacesApi.md#CreateSpace) | **Post** /video/v1/spaces | Create a space +[**CreateSpaceBroadcast**](SpacesApi.md#CreateSpaceBroadcast) | **Post** /video/v1/spaces/${SPACE_ID}/broadcasts | Create a space broadcast +[**DeleteSpace**](SpacesApi.md#DeleteSpace) | **Delete** /video/v1/spaces/${SPACE_ID} | Delete a space +[**DeleteSpaceBroadcast**](SpacesApi.md#DeleteSpaceBroadcast) | **Delete** /video/v1/spaces/${SPACE_ID}/broadcasts/${BROADCAST_ID} | Delete a space broadcast +[**GetSpace**](SpacesApi.md#GetSpace) | **Get** /video/v1/spaces/${SPACE_ID} | Retrieve a space +[**GetSpaceBroadcast**](SpacesApi.md#GetSpaceBroadcast) | **Get** /video/v1/spaces/${SPACE_ID}/broadcasts/${BROADCAST_ID} | Retrieve space broadcast +[**ListSpaces**](SpacesApi.md#ListSpaces) | **Get** /video/v1/spaces | List spaces +[**StartSpaceBroadcast**](SpacesApi.md#StartSpaceBroadcast) | **Post** /video/v1/spaces/${SPACE_ID}/broadcasts/${BROADCAST_ID}/start | Start a space broadcast +[**StopSpaceBroadcast**](SpacesApi.md#StopSpaceBroadcast) | **Post** /video/v1/spaces/${SPACE_ID}/broadcasts/${BROADCAST_ID}/stop | Stop a space broadcast + + +# **CreateSpace** +> SpaceResponse CreateSpace(ctx, createSpaceRequest) +Create a space + +Create a new space. Spaces are used to build [real-time video applications.](https://mux.com/real-time-video) + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **createSpaceRequest** | [**CreateSpaceRequest**](CreateSpaceRequest.md)| | + +### Return type + +[**SpaceResponse**](SpaceResponse.md) + +### Authorization + +[accessToken](../README.md#accessToken) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CreateSpaceBroadcast** +> BroadcastResponse CreateSpaceBroadcast(ctx, sPACEID, createBroadcastRequest) +Create a space broadcast + +Creates a new broadcast. Broadcasts are used to create composited versions of your space, which can be broadcast to live streams. **Note:** By default only a single broadcast destination can be specified. Contact Mux support if you need more. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **sPACEID** | **string**| The space ID. | + **createBroadcastRequest** | [**CreateBroadcastRequest**](CreateBroadcastRequest.md)| | + +### Return type + +[**BroadcastResponse**](BroadcastResponse.md) + +### Authorization + +[accessToken](../README.md#accessToken) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **DeleteSpace** +> DeleteSpace(ctx, sPACEID) +Delete a space + +Deletes a space. Spaces can only be deleted when `idle`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **sPACEID** | **string**| The space ID. | + +### Return type + + (empty response body) + +### Authorization + +[accessToken](../README.md#accessToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **DeleteSpaceBroadcast** +> DeleteSpaceBroadcast(ctx, sPACEID, bROADCASTID) +Delete a space broadcast + +Deletes a single broadcast of a specific space. Broadcasts can only be deleted when `idle`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **sPACEID** | **string**| The space ID. | + **bROADCASTID** | **string**| The broadcast ID. | + +### Return type + + (empty response body) + +### Authorization + +[accessToken](../README.md#accessToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetSpace** +> SpaceResponse GetSpace(ctx, sPACEID) +Retrieve a space + +Retrieves the details of a space that has previously been created. Supply the unique space ID that was returned from your create space request, and Mux will return the information about the corresponding space. The same information is returned when creating a space. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **sPACEID** | **string**| The space ID. | + +### Return type + +[**SpaceResponse**](SpaceResponse.md) + +### Authorization + +[accessToken](../README.md#accessToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetSpaceBroadcast** +> BroadcastResponse GetSpaceBroadcast(ctx, sPACEID, bROADCASTID) +Retrieve space broadcast + +Retrieves the details of a broadcast of a specific space. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **sPACEID** | **string**| The space ID. | + **bROADCASTID** | **string**| The broadcast ID. | + +### Return type + +[**BroadcastResponse**](BroadcastResponse.md) + +### Authorization + +[accessToken](../README.md#accessToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ListSpaces** +> ListSpacesResponse ListSpaces(ctx, optional) +List spaces + +List all spaces in the current enviroment. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***ListSpacesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ListSpacesOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **optional.Int32**| Number of items to include in the response | [default to 25] + **page** | **optional.Int32**| Offset by this many pages, of the size of `limit` | [default to 1] + +### Return type + +[**ListSpacesResponse**](ListSpacesResponse.md) + +### Authorization + +[accessToken](../README.md#accessToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **StartSpaceBroadcast** +> StartSpaceBroadcastResponse StartSpaceBroadcast(ctx, sPACEID, bROADCASTID) +Start a space broadcast + +Starts broadcasting a space to the associated destination. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **sPACEID** | **string**| The space ID. | + **bROADCASTID** | **string**| The broadcast ID. | + +### Return type + +[**StartSpaceBroadcastResponse**](StartSpaceBroadcastResponse.md) + +### Authorization + +[accessToken](../README.md#accessToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **StopSpaceBroadcast** +> StopSpaceBroadcastResponse StopSpaceBroadcast(ctx, sPACEID, bROADCASTID) +Stop a space broadcast + +Stops broadcasting a space, causing the destination live stream to become idle. This API also automatically calls `complete` on the destination live stream. Broadcasts are also automatically stopped when a space becomes idle. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **sPACEID** | **string**| The space ID. | + **bROADCASTID** | **string**| The broadcast ID. | + +### Return type + +[**StopSpaceBroadcastResponse**](StopSpaceBroadcastResponse.md) + +### Authorization + +[accessToken](../README.md#accessToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/StartSpaceBroadcastResponse.md b/docs/StartSpaceBroadcastResponse.md new file mode 100644 index 0000000..ee2fca4 --- /dev/null +++ b/docs/StartSpaceBroadcastResponse.md @@ -0,0 +1,10 @@ +# StartSpaceBroadcastResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**map[string]interface{}**](.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/StopSpaceBroadcastResponse.md b/docs/StopSpaceBroadcastResponse.md new file mode 100644 index 0000000..f0f6843 --- /dev/null +++ b/docs/StopSpaceBroadcastResponse.md @@ -0,0 +1,10 @@ +# StopSpaceBroadcastResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**map[string]interface{}**](.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/model_asset.go b/model_asset.go index 2db3c9d..44bb9f5 100644 --- a/model_asset.go +++ b/model_asset.go @@ -26,7 +26,7 @@ type Asset struct { PerTitleEncode bool `json:"per_title_encode,omitempty"` // Unique identifier for the Direct Upload. This is an optional parameter added when the asset is created from a direct upload. UploadId string `json:"upload_id,omitempty"` - // Whether the asset is created from a live stream and the live stream is currently `active` and not in `idle` state. + // Indicates whether the live stream that created this asset is currently `active` and not in `idle` state. This is an optional parameter added when the asset is created from a live stream. IsLive bool `json:"is_live,omitempty"` // Arbitrary user-supplied metadata set for the asset. Max 255 characters. Passthrough string `json:"passthrough,omitempty"` diff --git a/model_broadcast.go b/model_broadcast.go new file mode 100644 index 0000000..802db7d --- /dev/null +++ b/model_broadcast.go @@ -0,0 +1,18 @@ +// Mux Go - Copyright 2019 Mux Inc. +// NOTE: This file is auto generated. Do not edit this file manually. + +package muxgo + +type Broadcast struct { + // Unique identifier for the broadcast. Max 255 characters. + Id string `json:"id"` + // Arbitrary user-supplied metadata that will be included in the broadcast details and related webhooks. Max: 255 characters. + Passthrough string `json:"passthrough,omitempty"` + // The ID of the live stream that the broadcast will be sent to. + LiveStreamId string `json:"live_stream_id"` + Status BroadcastStatus `json:"status"` + Layout BroadcastLayout `json:"layout"` + // URL of an image to display as the background of the broadcast. Its dimensions should match the provided resolution. + Background string `json:"background,omitempty"` + Resolution BroadcastResolution `json:"resolution"` +} diff --git a/model_broadcast_layout.go b/model_broadcast_layout.go new file mode 100644 index 0000000..98a9f49 --- /dev/null +++ b/model_broadcast_layout.go @@ -0,0 +1,13 @@ +// Mux Go - Copyright 2019 Mux Inc. +// NOTE: This file is auto generated. Do not edit this file manually. + +package muxgo + +// BroadcastLayout : The layout used when broadcasting the space. Defaults to `gallery` if not set. +type BroadcastLayout string + +// List of BroadcastLayout +const ( + GALLERY BroadcastLayout = "gallery" + ACTIVE_SPEAKER BroadcastLayout = "active-speaker" +) diff --git a/model_broadcast_resolution.go b/model_broadcast_resolution.go new file mode 100644 index 0000000..38330b8 --- /dev/null +++ b/model_broadcast_resolution.go @@ -0,0 +1,17 @@ +// Mux Go - Copyright 2019 Mux Inc. +// NOTE: This file is auto generated. Do not edit this file manually. + +package muxgo + +// BroadcastResolution : The resolution of the composited video sent to the live stream. Defaults to `1920x1080` if not set. +type BroadcastResolution string + +// List of BroadcastResolution +const ( + _1920X1080 BroadcastResolution = "1920x1080" + _1280X720 BroadcastResolution = "1280x720" + _1080X1920 BroadcastResolution = "1080x1920" + _720X1280 BroadcastResolution = "720x1280" + _1080X1080 BroadcastResolution = "1080x1080" + _720X720 BroadcastResolution = "720x720" +) diff --git a/model_broadcast_response.go b/model_broadcast_response.go new file mode 100644 index 0000000..f50d5ce --- /dev/null +++ b/model_broadcast_response.go @@ -0,0 +1,8 @@ +// Mux Go - Copyright 2019 Mux Inc. +// NOTE: This file is auto generated. Do not edit this file manually. + +package muxgo + +type BroadcastResponse struct { + Data Broadcast `json:"data"` +} diff --git a/model_broadcast_status.go b/model_broadcast_status.go new file mode 100644 index 0000000..f8db8a4 --- /dev/null +++ b/model_broadcast_status.go @@ -0,0 +1,13 @@ +// Mux Go - Copyright 2019 Mux Inc. +// NOTE: This file is auto generated. Do not edit this file manually. + +package muxgo + +// BroadcastStatus : The status of the broadcast. You can start and stop broadcasts with the `start` and `stop` APIs. +type BroadcastStatus string + +// List of BroadcastStatus +const ( + BROADCAST_IDLE BroadcastStatus = "idle" + BROADCAST_ACTIVE BroadcastStatus = "active" +) diff --git a/model_create_broadcast_request.go b/model_create_broadcast_request.go new file mode 100644 index 0000000..6f236a4 --- /dev/null +++ b/model_create_broadcast_request.go @@ -0,0 +1,15 @@ +// Mux Go - Copyright 2019 Mux Inc. +// NOTE: This file is auto generated. Do not edit this file manually. + +package muxgo + +type CreateBroadcastRequest struct { + // Arbitrary user-supplied metadata that will be included in the broadcast details and related webhooks. Max: 255 characters. + Passthrough string `json:"passthrough,omitempty"` + // The ID of the live stream that you want to broadcast to. + LiveStreamId string `json:"live_stream_id"` + Layout BroadcastLayout `json:"layout,omitempty"` + // URL of an image to display as the background of the broadcast. Its dimensions should match the provided resolution. + Background string `json:"background,omitempty"` + Resolution BroadcastResolution `json:"resolution,omitempty"` +} diff --git a/model_create_simulcast_target_request.go b/model_create_simulcast_target_request.go index 511a97b..5c07d60 100644 --- a/model_create_simulcast_target_request.go +++ b/model_create_simulcast_target_request.go @@ -8,6 +8,6 @@ type CreateSimulcastTargetRequest struct { Passthrough string `json:"passthrough,omitempty"` // Stream Key represents a stream identifier on the third party live streaming service to send the parent live stream to. StreamKey string `json:"stream_key,omitempty"` - // RTMP hostname including application name for the third party live streaming service. Example: 'rtmp://live.example.com/app'. + // RTMP hostname including application name for the third party live streaming service. Example: `rtmp://live.example.com/app`. Url string `json:"url"` } diff --git a/model_create_space_request.go b/model_create_space_request.go new file mode 100644 index 0000000..e593a04 --- /dev/null +++ b/model_create_space_request.go @@ -0,0 +1,12 @@ +// Mux Go - Copyright 2019 Mux Inc. +// NOTE: This file is auto generated. Do not edit this file manually. + +package muxgo + +type CreateSpaceRequest struct { + Type SpaceType `json:"type,omitempty"` + // Arbitrary user-supplied metadata that will be included in the space details and related webhooks. Max: 255 characters. + Passthrough string `json:"passthrough,omitempty"` + // An array of broadcast destinations you want to stream the space to. **Note:** By default only a single broadcast destination can be specified. Contact Mux support if you need more. + Broadcasts []CreateBroadcastRequest `json:"broadcasts,omitempty"` +} diff --git a/model_list_spaces_response.go b/model_list_spaces_response.go new file mode 100644 index 0000000..278176e --- /dev/null +++ b/model_list_spaces_response.go @@ -0,0 +1,8 @@ +// Mux Go - Copyright 2019 Mux Inc. +// NOTE: This file is auto generated. Do not edit this file manually. + +package muxgo + +type ListSpacesResponse struct { + Data []Space `json:"data"` +} diff --git a/model_space.go b/model_space.go new file mode 100644 index 0000000..811060b --- /dev/null +++ b/model_space.go @@ -0,0 +1,19 @@ +// Mux Go - Copyright 2019 Mux Inc. +// NOTE: This file is auto generated. Do not edit this file manually. + +package muxgo + +type Space struct { + // Unique identifier for the space. Max 255 characters. + Id string `json:"id"` + // Time the space was created, defined as a Unix timestamp (seconds since epoch). + CreatedAt string `json:"created_at"` + Type SpaceType `json:"type"` + Status SpaceStatus `json:"status"` + // Arbitrary user-supplied metadata that will be included in the space details and related webhooks. Max: 255 characters. + Passthrough string `json:"passthrough,omitempty"` + // An array of broadcast destinations. + Broadcasts []Broadcast `json:"broadcasts,omitempty"` + // Unique identifier for the current lifecycle of the space. Only set when the space is `active` and is set to a new value each time the space transitions from `idle` to `active`. This value is useful for logging and debugging issues. Max 255 characters. + ActiveSessionId string `json:"active_session_id,omitempty"` +} diff --git a/model_space_response.go b/model_space_response.go new file mode 100644 index 0000000..01a15ad --- /dev/null +++ b/model_space_response.go @@ -0,0 +1,8 @@ +// Mux Go - Copyright 2019 Mux Inc. +// NOTE: This file is auto generated. Do not edit this file manually. + +package muxgo + +type SpaceResponse struct { + Data Space `json:"data"` +} diff --git a/model_space_status.go b/model_space_status.go new file mode 100644 index 0000000..9adb99c --- /dev/null +++ b/model_space_status.go @@ -0,0 +1,13 @@ +// Mux Go - Copyright 2019 Mux Inc. +// NOTE: This file is auto generated. Do not edit this file manually. + +package muxgo + +// SpaceStatus : The status of the space. Spaces are `idle` when there are no participants connected, and `active` when there are participants connected. +type SpaceStatus string + +// List of SpaceStatus +const ( + SPACE_IDLE SpaceStatus = "idle" + SPACE_ACTIVE SpaceStatus = "active" +) diff --git a/model_space_type.go b/model_space_type.go new file mode 100644 index 0000000..f870ac0 --- /dev/null +++ b/model_space_type.go @@ -0,0 +1,12 @@ +// Mux Go - Copyright 2019 Mux Inc. +// NOTE: This file is auto generated. Do not edit this file manually. + +package muxgo + +// SpaceType : Specify the network architecture of the space. In `server` spaces, all video travels through Mux's video infrastructure. Defaults to `server` if not set. +type SpaceType string + +// List of SpaceType +const ( + SERVER SpaceType = "server" +) diff --git a/model_start_space_broadcast_response.go b/model_start_space_broadcast_response.go new file mode 100644 index 0000000..6fb6190 --- /dev/null +++ b/model_start_space_broadcast_response.go @@ -0,0 +1,8 @@ +// Mux Go - Copyright 2019 Mux Inc. +// NOTE: This file is auto generated. Do not edit this file manually. + +package muxgo + +type StartSpaceBroadcastResponse struct { + Data map[string]interface{} `json:"data,omitempty"` +} diff --git a/model_stop_space_broadcast_response.go b/model_stop_space_broadcast_response.go new file mode 100644 index 0000000..4b6d27d --- /dev/null +++ b/model_stop_space_broadcast_response.go @@ -0,0 +1,8 @@ +// Mux Go - Copyright 2019 Mux Inc. +// NOTE: This file is auto generated. Do not edit this file manually. + +package muxgo + +type StopSpaceBroadcastResponse struct { + Data map[string]interface{} `json:"data,omitempty"` +}